| 7 | import boxen from "boxen"; |
| 8 | |
| 9 | export class Express implements Framework { |
| 10 | id = "express"; |
| 11 | name = "Express"; |
| 12 | |
| 13 | async isMatch(path: string, packageManager: PackageManager): Promise<boolean> { |
| 14 | //check for the express package |
| 15 | const packageJsonContent = await readPackageJson(path); |
| 16 | if (packageJsonContent?.dependencies?.express) { |
| 17 | return true; |
| 18 | } |
| 19 | |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | async dependencies(): Promise<InstallPackage[]> { |
| 24 | return [ |
| 25 | { name: "@trigger.dev/sdk", tag: "latest" }, |
| 26 | { name: "@trigger.dev/express", tag: "latest" }, |
| 27 | ]; |
| 28 | } |
| 29 | |
| 30 | possibleEnvFilenames(): string[] { |
| 31 | return [".env"]; |
| 32 | } |
| 33 | |
| 34 | async install(path: string, { typescript, endpointSlug }: ProjectInstallOptions): Promise<void> {} |
| 35 | |
| 36 | async postInstall(path: string, options: ProjectInstallOptions): Promise<void> {} |
| 37 | |
| 38 | async printInstallationComplete(projectUrl: string): Promise<void> { |
| 39 | logger.info( |
| 40 | boxen( |
| 41 | "Automatic installation isn't currently supported for Express. \nFollow the steps in our manual installation guide: https://trigger.dev/docs/documentation/guides/manual/express", |
| 42 | { padding: 1, margin: 1, borderStyle: "double", borderColor: "magenta" } |
| 43 | ) |
| 44 | ); |
| 45 | } |
| 46 | |
| 47 | defaultHostnames = ["localhost", "[::]"]; |
| 48 | defaultPorts = [3000, 8000, 80, 8080]; |
| 49 | watchFilePaths = standardWatchFilePaths; |
| 50 | watchIgnoreRegex = /(node_modules)/; |
| 51 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…