@tsed/cli 3.25.0 → 3.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Cli.js.map +1 -1
- package/lib/cjs/commands/generate/GenerateCmd.js +4 -8
- package/lib/cjs/commands/generate/GenerateCmd.js.map +1 -1
- package/lib/cjs/commands/init/InitCmd.js +102 -40
- package/lib/cjs/commands/init/InitCmd.js.map +1 -1
- package/lib/cjs/commands/init/config/FeaturesPrompt.js +406 -0
- package/lib/cjs/commands/init/config/FeaturesPrompt.js.map +1 -0
- package/lib/cjs/commands/init/config/InitFileSchema.js +53 -0
- package/lib/cjs/commands/init/config/InitFileSchema.js.map +1 -0
- package/lib/cjs/commands/init/interfaces/InitCmdContext.js +3 -0
- package/lib/cjs/commands/init/interfaces/InitCmdContext.js.map +1 -0
- package/lib/cjs/commands/init/interfaces/InitOptions.js +3 -0
- package/lib/cjs/commands/init/interfaces/InitOptions.js.map +1 -0
- package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js +3 -0
- package/lib/cjs/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
- package/lib/cjs/commands/init/mappers/mapToContext.js +16 -0
- package/lib/cjs/commands/init/mappers/mapToContext.js.map +1 -0
- package/lib/cjs/commands/init/mappers/mapUniqFeatures.js +18 -0
- package/lib/cjs/commands/init/mappers/mapUniqFeatures.js.map +1 -0
- package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js +25 -0
- package/lib/cjs/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
- package/lib/cjs/commands/init/utils/hasFeature.js +13 -0
- package/lib/cjs/commands/init/utils/hasFeature.js.map +1 -0
- package/lib/cjs/commands/init/utils/isPlatform.js +8 -0
- package/lib/cjs/commands/init/utils/isPlatform.js.map +1 -0
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/interfaces/PlatformType.js +9 -0
- package/lib/cjs/interfaces/PlatformType.js.map +1 -0
- package/lib/cjs/interfaces/index.js +1 -0
- package/lib/cjs/interfaces/index.js.map +1 -1
- package/lib/cjs/utils/fillImports.js +48 -0
- package/lib/cjs/utils/fillImports.js.map +1 -0
- package/lib/esm/Cli.js.map +1 -1
- package/lib/esm/commands/generate/GenerateCmd.js +4 -8
- package/lib/esm/commands/generate/GenerateCmd.js.map +1 -1
- package/lib/esm/commands/init/InitCmd.js +105 -43
- package/lib/esm/commands/init/InitCmd.js.map +1 -1
- package/lib/esm/commands/init/config/FeaturesPrompt.js +402 -0
- package/lib/esm/commands/init/config/FeaturesPrompt.js.map +1 -0
- package/lib/esm/commands/init/config/InitFileSchema.js +50 -0
- package/lib/esm/commands/init/config/InitFileSchema.js.map +1 -0
- package/lib/esm/commands/init/interfaces/InitCmdContext.js +2 -0
- package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +1 -0
- package/lib/esm/commands/init/interfaces/InitOptions.js +2 -0
- package/lib/esm/commands/init/interfaces/InitOptions.js.map +1 -0
- package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +2 -0
- package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +1 -0
- package/lib/esm/commands/init/mappers/mapToContext.js +12 -0
- package/lib/esm/commands/init/mappers/mapToContext.js.map +1 -0
- package/lib/esm/commands/init/mappers/mapUniqFeatures.js +14 -0
- package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +1 -0
- package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +21 -0
- package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +1 -0
- package/lib/esm/commands/init/utils/hasFeature.js +8 -0
- package/lib/esm/commands/init/utils/hasFeature.js.map +1 -0
- package/lib/esm/commands/init/utils/isPlatform.js +4 -0
- package/lib/esm/commands/init/utils/isPlatform.js.map +1 -0
- package/lib/esm/index.js +5 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/interfaces/PlatformType.js +6 -0
- package/lib/esm/interfaces/PlatformType.js.map +1 -0
- package/lib/esm/interfaces/index.js +1 -0
- package/lib/esm/interfaces/index.js.map +1 -1
- package/lib/esm/utils/fillImports.js +44 -0
- package/lib/esm/utils/fillImports.js.map +1 -0
- package/lib/types/Cli.d.ts +2 -2
- package/lib/types/commands/init/InitCmd.d.ts +9 -24
- package/lib/types/commands/init/config/FeaturesPrompt.d.ts +98 -0
- package/lib/types/commands/init/config/InitFileSchema.d.ts +49 -0
- package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +6 -0
- package/lib/types/commands/init/interfaces/InitOptions.d.ts +19 -0
- package/lib/types/commands/init/interfaces/InitPromptAnswers.d.ts +16 -0
- package/lib/types/commands/init/mappers/mapToContext.d.ts +2 -0
- package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +3 -0
- package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +2 -0
- package/lib/types/commands/init/utils/hasFeature.d.ts +2 -0
- package/lib/types/commands/init/utils/isPlatform.d.ts +1 -0
- package/lib/types/index.d.ts +5 -1
- package/lib/types/interfaces/PlatformType.d.ts +4 -0
- package/lib/types/interfaces/index.d.ts +1 -0
- package/lib/types/utils/fillImports.d.ts +1 -0
- package/package.json +4 -2
- package/readme.md +97 -0
- package/templates/generate/server.hbs +4 -23
- package/templates/init/.barrelsby.json.hbs +1 -7
- package/lib/cjs/services/Features.js +0 -528
- package/lib/cjs/services/Features.js.map +0 -1
- package/lib/esm/services/Features.js +0 -519
- package/lib/esm/services/Features.js.map +0 -1
- package/lib/types/services/Features.d.ts +0 -412
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InitCmd.js","sourceRoot":"","sources":["../../../../src/commands/init/InitCmd.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EACR,KAAK,EACL,UAAU,EACV,UAAU,EACV,OAAO,EAEP,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,MAAM,EAEN,cAAc,EACd,kBAAkB,EAElB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAA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;AAG7B;IADC,MAAM,EAAE;8BACa,UAAU;2CAAC;AAGjC;IADC,MAAM,EAAE;8BACe,mBAAmB;6CAAC;AAG5C;IADC,MAAM,EAAE;8BACqB,kBAAkB;mDAAC;AAGjD;IADC,MAAM,EAAE;8BACQ,QAAQ;sCAAC;AAG1B;IADC,MAAM,EAAE;8BACK,KAAK;mCAAC;AA1BT,OAAO;IAtBnB,OAAO,CAAC;QACP,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,0BAA0B;QACvC,IAAI,EAAE;YACJ,IAAI,EAAE;gBACJ,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,GAAG;gBACjB,WAAW,EAAE,gDAAgD;aAC9D;SACF;QACD,OAAO,EAAE;YACP,8BAA8B,EAAE;gBAC9B,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,iBAAiB;gBAC/B,WAAW,EAAE,iDAAiD;aAC/D;YACD,4BAA4B,EAAE;gBAC5B,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,uDAAuD;aACrE;SACF;KACF,CAAC;GACW,OAAO,CA4YnB;SA5YY,OAAO","sourcesContent":["import {\n CliDefaultOptions,\n CliExeca,\n CliFs,\n CliPlugins,\n CliService,\n Command,\n CommandProvider,\n Configuration,\n createSubTasks,\n createTasksRunner,\n Inject,\n InstallOptions,\n PackageManager,\n ProjectPackageJson,\n QuestionOptions,\n RootRendererService\n} from \"@tsed/cli-core\";\nimport {camelCase, paramCase, pascalCase} from \"change-case\";\nimport {basename, join, resolve} from \"path\";\nimport {DEFAULT_TSED_TAGS} from \"../../constants\";\nimport {ArchitectureConvention} from \"../../interfaces/ArchitectureConvention\";\nimport {ProjectConvention} from \"../../interfaces/ProjectConvention\";\nimport {OutputFilePathPipe} from \"../../pipes/OutputFilePathPipe\";\nimport {Features, FeatureValue, parseFeaturesFile} from \"../../services/Features\";\n\nexport interface InitCmdContext extends CliDefaultOptions, InstallOptions {\n platform: \"express\" | \"koa\";\n root: string;\n srcDir: string;\n projectName: string;\n tsedVersion: string;\n features: FeatureValue[];\n featuresTypeORM?: FeatureValue;\n babel?: boolean;\n webpack?: boolean;\n architecture?: ArchitectureConvention;\n convention?: ProjectConvention;\n commands?: boolean;\n GH_TOKEN?: string;\n\n [key: string]: any;\n}\n\n@Command({\n name: \"init\",\n description: \"Init a new Ts.ED project\",\n args: {\n root: {\n type: String,\n defaultValue: \".\",\n description: \"Root directory to initialize the Ts.ED project\"\n }\n },\n options: {\n \"-t, --tsed-version <version>\": {\n type: String,\n defaultValue: DEFAULT_TSED_TAGS,\n description: \"Use a specific version of Ts.ED (format: 5.x.x)\"\n },\n \"-f, --features-file <path>\": {\n type: String,\n description: \"Location of a file in which the features are defined.\"\n }\n }\n})\nexport class InitCmd implements CommandProvider {\n @Configuration()\n protected configuration: Configuration;\n\n @Inject()\n protected cliPlugins: CliPlugins;\n\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @Features()\n protected features: Features;\n\n @Inject()\n protected cliService: CliService;\n\n @Inject()\n protected rootRenderer: RootRendererService;\n\n @Inject()\n protected outputFilePathPipe: OutputFilePathPipe;\n\n @Inject()\n protected execa: CliExeca;\n\n @Inject()\n protected fs: CliFs;\n\n async $beforePrompt(initialOptions: Partial<InitCmdContext>) {\n const callPath = process.cwd();\n if (callPath && initialOptions.featuresFile) {\n const featuresFilePath = resolve(callPath, initialOptions.featuresFile);\n const featuresFromFile = await import(featuresFilePath);\n const mappedFeatures = parseFeaturesFile(featuresFromFile, \"3.8.0\"); // Inject CLI version\n initialOptions = {...initialOptions, ...mappedFeatures};\n }\n return initialOptions;\n }\n\n $prompt(initialOptions: Partial<InitCmdContext>): QuestionOptions {\n const featuresQuestions = initialOptions.features?.length ? [] : [...this.features];\n return [\n {\n type: \"input\",\n name: \"projectName\",\n message: \"What is your project name\",\n default: paramCase(initialOptions.root!),\n when: initialOptions.root !== \".\",\n transformer(input) {\n return paramCase(input);\n }\n },\n ...featuresQuestions\n ];\n }\n\n $mapContext(ctx: Partial<InitCmdContext>): InitCmdContext {\n this.resolveRootDir(ctx);\n\n const features: FeatureValue[] = [];\n\n Object.entries(ctx)\n .filter(([key]) => key.startsWith(\"features\") && key !== \"featuresFile\")\n .forEach(([key, value]: any[]) => {\n delete ctx[key];\n features.push(...[].concat(value));\n });\n\n features.forEach((feature) => {\n feature.type.split(\":\").forEach((type) => {\n ctx[camelCase(type)] = true;\n });\n });\n\n return {\n ...ctx,\n features,\n srcDir: this.configuration.project?.srcDir,\n pnpm: ctx.packageManager === PackageManager.PNPM,\n npm: ctx.packageManager === PackageManager.NPM,\n yarn: ctx.packageManager === PackageManager.YARN,\n express: ctx.platform === \"express\",\n koa: ctx.platform === \"koa\",\n platformSymbol: ctx.platform && pascalCase(`Platform ${ctx.platform}`)\n } as InitCmdContext;\n }\n\n async $beforeExec(ctx: InitCmdContext): Promise<any> {\n this.fs.ensureDirSync(this.packageJson.dir);\n this.packageJson.name = ctx.projectName;\n\n ctx.packageManager && this.packageJson.setPreference(\"packageManager\", ctx.packageManager);\n ctx.architecture && this.packageJson.setPreference(\"architecture\", ctx.architecture);\n ctx.convention && this.packageJson.setPreference(\"convention\", ctx.convention);\n ctx.GH_TOKEN && this.packageJson.setGhToken(ctx.GH_TOKEN);\n\n this.addDependencies(ctx);\n this.addDevDependencies(ctx);\n this.addScripts(ctx);\n this.addFeatures(ctx);\n\n await createTasksRunner(\n [\n {\n title: \"Write RC files\",\n skip: () => !ctx.GH_TOKEN,\n task: () =>\n this.rootRenderer.renderAll([\"/init/.npmrc.hbs\", \"/init/.yarnrc.hbs\"], ctx, {\n baseDir: \"/init\"\n })\n },\n {\n title: \"Install plugins\",\n task: createSubTasks(() => this.packageJson.install(ctx), {...ctx, concurrent: false})\n },\n {\n title: \"Load plugins\",\n task: () => this.cliPlugins.loadPlugins()\n },\n {\n title: \"Install plugins dependencies\",\n task: createSubTasks(this.cliPlugins.addPluginsDependencies(ctx), {...ctx, concurrent: false})\n }\n ],\n ctx\n );\n }\n\n async $exec(ctx: InitCmdContext) {\n const subTasks = [\n ...(await this.cliService.getTasks(\"generate\", {\n ...ctx,\n type: \"server\",\n name: \"Server\",\n route: \"/rest\"\n })),\n ...(await this.cliService.getTasks(\"generate\", {\n type: \"controller\",\n route: \"hello-world\",\n name: \"HelloWorld\",\n directory: \"rest\"\n })),\n ...(ctx.commands\n ? await this.cliService.getTasks(\"generate\", {\n type: \"command\",\n route: \"hello\",\n name: \"hello\"\n })\n : [])\n ];\n\n const indexCtrlBaseName = basename(\n `${this.outputFilePathPipe.transform({\n name: \"Index\",\n type: \"controller\",\n format: ctx.convention\n })}.ts`\n );\n\n return [\n {\n title: \"Generate project files\",\n task: createSubTasks(\n [\n {\n title: \"Root files\",\n task: () =>\n this.rootRenderer.renderAll(\n [\n \"/init/.dockerignore.hbs\",\n \"/init/.gitignore.hbs\",\n \"/init/.barrelsby.json.hbs\",\n \"/init/processes.config.js.hbs\",\n ctx.babel && \"/init/.babelrc.hbs\",\n ctx.webpack && \"/init/webpack.config.js.hbs\",\n \"/init/docker-compose.yml.hbs\",\n \"/init/Dockerfile.hbs\",\n \"/init/README.md.hbs\",\n \"/init/tsconfig.compile.json.hbs\",\n \"/init/tsconfig.json.hbs\",\n \"/init/src/index.ts.hbs\",\n \"/init/src/config/envs/index.ts.hbs\",\n \"/init/src/config/logger/index.ts.hbs\",\n \"/init/src/config/index.ts.hbs\",\n ctx.commands && \"/init/src/bin/index.ts.hbs\",\n ctx.swagger && \"/init/views/swagger.ejs.hbs\",\n ctx.swagger && {\n path: \"/init/src/controllers/pages/IndexController.ts.hbs\",\n basename: indexCtrlBaseName\n }\n ].filter(Boolean),\n ctx,\n {\n baseDir: \"/init\"\n }\n )\n },\n ...subTasks\n ],\n {...ctx, concurrent: false}\n )\n }\n ];\n }\n\n async $afterPostInstall() {\n return [\n {\n title: \"Generate barrels files\",\n task: () => {\n return this.packageJson.runScript(\"barrels\", {\n ignoreError: true\n });\n }\n }\n ];\n }\n\n resolveRootDir(ctx: Partial<InitCmdContext>) {\n const rootDirName = paramCase(ctx.projectName || basename(this.packageJson.dir));\n\n if (this.packageJson.dir.endsWith(rootDirName)) {\n ctx.projectName = ctx.projectName || rootDirName;\n ctx.root = \".\";\n return;\n }\n\n ctx.projectName = ctx.projectName || rootDirName;\n\n if (ctx.root && ctx.root !== \".\") {\n this.packageJson.dir = join(this.packageJson.dir, rootDirName);\n ctx.root = \".\";\n }\n }\n\n addScripts(ctx: InitCmdContext): void {\n const runner = this.packageJson.getRunCmd();\n\n this.packageJson.addScripts({\n build: `${runner} barrels && tsc --project tsconfig.compile.json`,\n barrels: \"barrelsby --config .barrelsby.json\",\n start: `${runner} barrels && tsnd --inspect --ignore-watch node_modules --respawn --transpile-only -r tsconfig-paths/register src/index.ts`,\n \"start:prod\": \"cross-env NODE_ENV=production node dist/index.js\"\n });\n\n if (ctx.babel) {\n this.packageJson.addScripts({\n build: `tsc && babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline`,\n start: \"babel-watch --extensions .ts src/index.ts\"\n });\n }\n\n if (ctx.webpack) {\n this.packageJson.addScripts({\n bundle: `tsc && cross-env NODE_ENV=production webpack`,\n \"start:bundle\": \"cross-env NODE_ENV=production node dist/app.bundle.js\"\n });\n }\n }\n\n addDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies({\n \"@tsed/common\": ctx.tsedVersion,\n \"@tsed/core\": ctx.tsedVersion,\n \"@tsed/di\": ctx.tsedVersion,\n \"@tsed/ajv\": ctx.tsedVersion,\n \"@tsed/exceptions\": ctx.tsedVersion,\n \"@tsed/schema\": ctx.tsedVersion,\n \"@tsed/json-mapper\": ctx.tsedVersion,\n \"@tsed/platform-cache\": ctx.tsedVersion,\n \"@tsed/platform-exceptions\": ctx.tsedVersion,\n \"@tsed/platform-log-middleware\": ctx.tsedVersion,\n \"@tsed/platform-middlewares\": ctx.tsedVersion,\n \"@tsed/platform-params\": ctx.tsedVersion,\n \"@tsed/platform-response-filter\": ctx.tsedVersion,\n \"@tsed/platform-views\": ctx.tsedVersion,\n \"@tsed/logger\": \"latest\",\n \"@tsed/logger-file\": \"latest\",\n \"@tsed/engines\": \"latest\",\n ajv: \"latest\",\n barrelsby: \"latest\",\n \"cross-env\": \"latest\",\n dotenv: \"latest\",\n \"dotenv-expand\": \"latest\",\n \"dotenv-flow\": \"latest\"\n });\n }\n\n addDevDependencies(ctx: InitCmdContext) {\n this.packageJson.addDevDependencies(\n {\n \"@types/node\": \"latest\",\n \"@types/multer\": \"latest\",\n tslib: \"latest\",\n \"ts-node\": \"latest\",\n \"tsconfig-paths\": \"latest\",\n typescript: \"latest\"\n },\n ctx\n );\n\n if (!ctx.babel) {\n this.packageJson.addDevDependencies(\n {\n \"ts-node-dev\": \"latest\"\n },\n ctx\n );\n }\n }\n\n addFeatures(ctx: InitCmdContext) {\n ctx.features.forEach((feature) => {\n if (feature.dependencies) {\n this.packageJson.addDependencies(feature.dependencies, ctx);\n }\n\n if (feature.devDependencies) {\n this.packageJson.addDevDependencies(feature.devDependencies, ctx);\n }\n });\n\n switch (ctx.platform) {\n case \"express\":\n this.addExpressDependencies(ctx);\n break;\n case \"koa\":\n this.addKoaDependencies(ctx);\n break;\n }\n\n if (ctx.features.find(({type}) => type === \"graphql\")) {\n this.packageJson.addDependencies(\n {\n [\"apollo-server-\" + ctx.platform]: \"2.25.2\"\n },\n ctx\n );\n }\n }\n\n private addExpressDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/platform-express\": ctx.tsedVersion,\n \"body-parser\": \"latest\",\n cors: \"latest\",\n compression: \"latest\",\n \"cookie-parser\": \"latest\",\n express: \"latest\",\n \"method-override\": \"latest\"\n },\n ctx\n );\n\n this.packageJson.addDevDependencies(\n {\n \"@types/cors\": \"latest\",\n \"@types/express\": \"latest\",\n \"@types/compression\": \"latest\",\n \"@types/cookie-parser\": \"latest\",\n \"@types/method-override\": \"latest\"\n },\n ctx\n );\n }\n\n private addKoaDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/platform-koa\": ctx.tsedVersion,\n koa: \"latest\",\n \"@koa/cors\": \"latest\",\n \"@koa/router\": \"latest\",\n \"koa-qs\": \"latest\",\n \"koa-bodyparser\": \"latest\",\n \"koa-override\": \"latest\",\n \"koa-compress\": \"latest\"\n },\n ctx\n );\n\n this.packageJson.addDevDependencies(\n {\n \"@types/koa\": \"latest\",\n \"@types/koa-qs\": \"latest\",\n \"@types/koa-json\": \"latest\",\n \"@types/koa-bodyparser\": \"latest\",\n \"@types/koa__router\": \"latest\",\n \"@types/koa-compress\": \"latest\",\n \"@types/koa-send\": \"latest\",\n \"@types/koa__cors\": \"latest\"\n },\n ctx\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"InitCmd.js","sourceRoot":"","sources":["../../../../src/commands/init/InitCmd.ts"],"names":[],"mappings":";;AAAA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,WAAW,EACX,cAAc,EACd,UAAU,EACV,UAAU,EACV,OAAO,EAEP,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,MAAM,EACN,cAAc,EACd,kBAAkB,EAElB,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,aAAa,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,MAAM,CAAC;AACpC,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,sBAAsB,EAAC,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAC,kBAAkB,EAAC,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,WAAW,EAAE,WAAW,EAAC,MAAM,yBAAyB,CAAC;AAEj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AAE,MAAM;gBACZ,YAAY,EAAE,sBAAsB,CAAC,OAAO;gBAC5C,WAAW,EAAE,4CAA4C,sBAAsB,CAAC,OAAO,OAAO,sBAAsB,CAAC,OAAO,GAAG;aAChI;YACD,+BAA+B,EAAE;gBAC/B,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,iBAAiB,CAAC,OAAO;gBACvC,WAAW,EAAE,uCAAuC,sBAAsB,CAAC,OAAO,OAAO,sBAAsB,CAAC,OAAO,GAAG;aAC3H;YACD,2BAA2B,EAAE;gBAC3B,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,YAAY,CAAC,OAAO;gBAClC,WAAW,EAAE,qDAAqD;aACnE;YACD,0BAA0B,EAAE;gBAC1B,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,MAAM;gBAChB,YAAY,EAAE,EAAE;gBAChB,WAAW,EAAE,6BAA6B;aAC3C;YACD,wCAAwC,EAAE;gBACxC,IAAI,EAAE,KAAK;gBACX,QAAQ,EAAE,MAAM;gBAChB,YAAY,EAAE,cAAc,CAAC,IAAI;gBACjC,WAAW,EAAE,oDAAoD;aAClE;YACD,8BAA8B,EAAE;gBAC9B,IAAI,EAAE,MAAM;gBACZ,YAAY,EAAE,iBAAiB;gBAC/B,WAAW,EAAE,kDAAkD;aAChE;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,uDAAuD;aACrE;YACD,mBAAmB,EAAE;gBACnB,IAAI,EAAE,OAAO;gBACb,YAAY,EAAE,KAAK;gBACnB,WAAW,EAAE,kBAAkB;aAChC;SACF;KACF,CAAC;GACW,OAAO,CAsanB;SAtaY,OAAO","sourcesContent":["import {\n CliExeca,\n CliFs,\n CliLoadFile,\n CliPackageJson,\n CliPlugins,\n CliService,\n Command,\n CommandProvider,\n Configuration,\n createSubTasks,\n createTasksRunner,\n Inject,\n PackageManager,\n ProjectPackageJson,\n QuestionOptions,\n RootRendererService\n} from \"@tsed/cli-core\";\nimport {paramCase, pascalCase} from \"change-case\";\nimport {basename, join} from \"path\";\nimport {DEFAULT_TSED_TAGS} from \"../../constants\";\nimport {ArchitectureConvention} from \"../../interfaces/ArchitectureConvention\";\nimport {ProjectConvention} from \"../../interfaces/ProjectConvention\";\nimport {OutputFilePathPipe} from \"../../pipes/OutputFilePathPipe\";\nimport {InitCmdContext} from \"./interfaces/InitCmdContext\";\nimport {InitFileSchema} from \"./config/InitFileSchema\";\nimport {mapToContext} from \"./mappers/mapToContext\";\nimport {FeaturesMap, FeatureType} from \"./config/FeaturesPrompt\";\nimport {InitOptions} from \"./interfaces/InitOptions\";\nimport {getFeaturesPrompt} from \"./prompts/getFeaturesPrompt\";\nimport {PlatformType} from \"../../interfaces\";\nimport {fillImports} from \"../../utils/fillImports\";\n\n@Command({\n name: \"init\",\n description: \"Init a new Ts.ED project\",\n args: {\n root: {\n type: String,\n defaultValue: \".\",\n description: \"Root directory to initialize the Ts.ED project\"\n }\n },\n options: {\n \"-n, --project-name <projectName>\": {\n type: String,\n defaultValue: \"\",\n description: \"Set the project name. By default, the project is the same as the name directory.\"\n },\n \"-a, --arch <architecture>\": {\n type: String,\n defaultValue: ArchitectureConvention.DEFAULT,\n description: `Set the default architecture convention (${ArchitectureConvention.DEFAULT} or ${ArchitectureConvention.FEATURE})`\n },\n \"-c, --convention <convention>\": {\n type: String,\n defaultValue: ProjectConvention.DEFAULT,\n description: `Set the default project convention (${ArchitectureConvention.DEFAULT} or ${ArchitectureConvention.FEATURE})`\n },\n \"-p, --platform <platform>\": {\n type: String,\n defaultValue: PlatformType.EXPRESS,\n description: \"Set the default platform for Ts.ED (express or koa)\"\n },\n \"--features <features...>\": {\n type: Array,\n itemType: String,\n defaultValue: [],\n description: \"List of the Ts.ED features.\"\n },\n \"-m, --package-manager <packageManager>\": {\n type: Array,\n itemType: String,\n defaultValue: PackageManager.YARN,\n description: \"The default package manager to install the project\"\n },\n \"-t, --tsed-version <version>\": {\n type: String,\n defaultValue: DEFAULT_TSED_TAGS,\n description: \"Use a specific version of Ts.ED (format: 5.x.x).\"\n },\n \"-f, --file <path>\": {\n type: String,\n description: \"Location of a file in which the features are defined.\"\n },\n \"-s, --skip-prompt\": {\n type: Boolean,\n defaultValue: false,\n description: \"Skip the prompt.\"\n }\n }\n})\nexport class InitCmd implements CommandProvider {\n @Configuration()\n protected configuration: Configuration;\n\n @Inject()\n protected cliPlugins: CliPlugins;\n\n @Inject()\n protected packageJson: ProjectPackageJson;\n\n @CliPackageJson()\n protected cliPackageJson: CliPackageJson;\n\n @Inject()\n protected cliService: CliService;\n\n @Inject()\n protected cliLoadFile: CliLoadFile;\n\n @Inject()\n protected rootRenderer: RootRendererService;\n\n @Inject()\n protected outputFilePathPipe: OutputFilePathPipe;\n\n @Inject()\n protected execa: CliExeca;\n\n @Inject()\n protected fs: CliFs;\n\n async $beforePrompt(initialOptions: Partial<InitOptions>) {\n if (initialOptions.file) {\n const file = join(this.packageJson.dir, initialOptions.file);\n\n return {\n ...initialOptions,\n ...(await this.cliLoadFile.loadFile(file, InitFileSchema))\n };\n }\n\n return initialOptions;\n }\n\n $prompt(initialOptions: Partial<InitOptions>): QuestionOptions {\n if (initialOptions.skipPrompt) {\n return [];\n }\n\n return [\n {\n type: \"input\",\n name: \"projectName\",\n message: \"What is your project name\",\n default: paramCase(initialOptions.root!),\n when: initialOptions.root !== \".\",\n transformer(input) {\n return paramCase(input);\n }\n },\n ...getFeaturesPrompt(initialOptions)\n ];\n }\n\n $mapContext(ctx: any): InitCmdContext {\n this.resolveRootDir(ctx);\n ctx = mapToContext(ctx);\n\n return fillImports({\n ...ctx,\n cliVersion: ctx.cliVersion || this.cliPackageJson.version,\n srcDir: this.configuration.project?.srcDir,\n platformSymbol: ctx.platform && pascalCase(`Platform ${ctx.platform}`)\n }) as InitCmdContext;\n }\n\n async $beforeExec(ctx: InitCmdContext): Promise<any> {\n this.fs.ensureDirSync(this.packageJson.dir);\n this.packageJson.name = ctx.projectName;\n\n ctx.packageManager && this.packageJson.setPreference(\"packageManager\", ctx.packageManager);\n ctx.architecture && this.packageJson.setPreference(\"architecture\", ctx.architecture);\n ctx.convention && this.packageJson.setPreference(\"convention\", ctx.convention);\n ctx.GH_TOKEN && this.packageJson.setGhToken(ctx.GH_TOKEN);\n\n this.addDependencies(ctx);\n this.addDevDependencies(ctx);\n this.addScripts(ctx);\n this.addFeatures(ctx);\n\n await createTasksRunner(\n [\n {\n title: \"Write RC files\",\n skip: () => !ctx.GH_TOKEN,\n task: () =>\n this.rootRenderer.renderAll([\"/init/.npmrc.hbs\", \"/init/.yarnrc.hbs\"], ctx, {\n baseDir: \"/init\"\n })\n },\n {\n title: \"Install plugins\",\n task: createSubTasks(() => this.packageJson.install(ctx), {...ctx, concurrent: false})\n },\n {\n title: \"Load plugins\",\n task: () => this.cliPlugins.loadPlugins()\n },\n {\n title: \"Install plugins dependencies\",\n task: createSubTasks(this.cliPlugins.addPluginsDependencies(ctx), {...ctx, concurrent: false})\n }\n ],\n ctx\n );\n }\n\n async $exec(ctx: InitCmdContext) {\n InitCmd.checkPrecondition(ctx);\n\n const subTasks = [\n ...(await this.cliService.getTasks(\"generate\", {\n ...ctx,\n type: \"server\",\n name: \"Server\",\n route: \"/rest\"\n })),\n ...(await this.cliService.getTasks(\"generate\", {\n type: \"controller\",\n route: \"hello-world\",\n name: \"HelloWorld\",\n directory: \"rest\"\n })),\n ...(ctx.commands\n ? await this.cliService.getTasks(\"generate\", {\n type: \"command\",\n route: \"hello\",\n name: \"hello\"\n })\n : [])\n ];\n\n const indexCtrlBaseName = basename(\n `${this.outputFilePathPipe.transform({\n name: \"Index\",\n type: \"controller\",\n format: ctx.convention\n })}.ts`\n );\n\n return [\n {\n title: \"Generate project files\",\n task: createSubTasks(\n [\n {\n title: \"Root files\",\n task: () =>\n this.rootRenderer.renderAll(\n [\n \"/init/.dockerignore.hbs\",\n \"/init/.gitignore.hbs\",\n \"/init/.barrelsby.json.hbs\",\n \"/init/processes.config.js.hbs\",\n ctx.babel && \"/init/.babelrc.hbs\",\n ctx.webpack && \"/init/webpack.config.js.hbs\",\n \"/init/docker-compose.yml.hbs\",\n \"/init/Dockerfile.hbs\",\n \"/init/README.md.hbs\",\n \"/init/tsconfig.compile.json.hbs\",\n \"/init/tsconfig.json.hbs\",\n \"/init/src/index.ts.hbs\",\n \"/init/src/config/envs/index.ts.hbs\",\n \"/init/src/config/logger/index.ts.hbs\",\n \"/init/src/config/index.ts.hbs\",\n ctx.commands && \"/init/src/bin/index.ts.hbs\",\n ctx.swagger && \"/init/views/swagger.ejs.hbs\",\n ctx.swagger && {\n path: \"/init/src/controllers/pages/IndexController.ts.hbs\",\n basename: indexCtrlBaseName,\n output: ctx.architecture === \"default\" ? \"/controllers/pages/IndexController.ts\" : \"/pages/IndexController.ts\"\n }\n ].filter(Boolean),\n ctx,\n {\n baseDir: \"/init\"\n }\n )\n },\n ...subTasks\n ],\n {...ctx, concurrent: false}\n )\n }\n ];\n }\n\n async $afterPostInstall() {\n return [\n {\n title: \"Generate barrels files\",\n task: () => {\n return this.packageJson.runScript(\"barrels\", {\n ignoreError: true\n });\n }\n }\n ];\n }\n\n resolveRootDir(ctx: Partial<InitCmdContext>) {\n const rootDirName = paramCase(ctx.projectName || basename(this.packageJson.dir));\n\n if (this.packageJson.dir.endsWith(rootDirName)) {\n ctx.projectName = ctx.projectName || rootDirName;\n ctx.root = \".\";\n return;\n }\n\n ctx.projectName = ctx.projectName || rootDirName;\n\n if (ctx.root && ctx.root !== \".\") {\n this.packageJson.dir = join(this.packageJson.dir, rootDirName);\n ctx.root = \".\";\n }\n }\n\n addScripts(ctx: InitCmdContext): void {\n const runner = this.packageJson.getRunCmd();\n\n this.packageJson.addScripts({\n build: `${runner} barrels && tsc --project tsconfig.compile.json`,\n barrels: \"barrelsby --config .barrelsby.json\",\n start: `${runner} barrels && tsnd --inspect --ignore-watch node_modules --respawn --transpile-only -r tsconfig-paths/register src/index.ts`,\n \"start:prod\": \"cross-env NODE_ENV=production node dist/index.js\"\n });\n\n if (ctx.babel) {\n this.packageJson.addScripts({\n build: `tsc && babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline`,\n start: \"babel-watch --extensions .ts src/index.ts\"\n });\n }\n\n if (ctx.webpack) {\n this.packageJson.addScripts({\n bundle: `tsc && cross-env NODE_ENV=production webpack`,\n \"start:bundle\": \"cross-env NODE_ENV=production node dist/app.bundle.js\"\n });\n }\n }\n\n addDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies({\n \"@tsed/common\": ctx.tsedVersion,\n \"@tsed/core\": ctx.tsedVersion,\n \"@tsed/di\": ctx.tsedVersion,\n \"@tsed/ajv\": ctx.tsedVersion,\n \"@tsed/exceptions\": ctx.tsedVersion,\n \"@tsed/schema\": ctx.tsedVersion,\n \"@tsed/json-mapper\": ctx.tsedVersion,\n \"@tsed/platform-cache\": ctx.tsedVersion,\n \"@tsed/platform-exceptions\": ctx.tsedVersion,\n \"@tsed/platform-log-middleware\": ctx.tsedVersion,\n \"@tsed/platform-middlewares\": ctx.tsedVersion,\n \"@tsed/platform-params\": ctx.tsedVersion,\n \"@tsed/platform-response-filter\": ctx.tsedVersion,\n \"@tsed/platform-views\": ctx.tsedVersion,\n \"@tsed/logger\": \"latest\",\n \"@tsed/logger-file\": \"latest\",\n \"@tsed/engines\": \"latest\",\n ajv: \"latest\",\n barrelsby: \"latest\",\n \"cross-env\": \"latest\",\n dotenv: \"latest\",\n \"dotenv-expand\": \"latest\",\n \"dotenv-flow\": \"latest\"\n });\n }\n\n addDevDependencies(ctx: InitCmdContext) {\n this.packageJson.addDevDependencies(\n {\n \"@types/node\": \"latest\",\n \"@types/multer\": \"latest\",\n tslib: \"latest\",\n \"ts-node\": \"latest\",\n \"tsconfig-paths\": \"latest\",\n typescript: \"latest\"\n },\n ctx\n );\n\n if (!ctx.babel) {\n this.packageJson.addDevDependencies(\n {\n \"ts-node-dev\": \"latest\"\n },\n ctx\n );\n }\n }\n\n addFeatures(ctx: InitCmdContext) {\n ctx.features.forEach((value) => {\n const feature = FeaturesMap[value.toLowerCase()];\n\n if (feature.dependencies) {\n this.packageJson.addDependencies(feature.dependencies, ctx);\n }\n\n if (feature.devDependencies) {\n this.packageJson.addDevDependencies(feature.devDependencies, ctx);\n }\n });\n\n switch (ctx.platform) {\n case \"express\":\n this.addExpressDependencies(ctx);\n break;\n case \"koa\":\n this.addKoaDependencies(ctx);\n break;\n }\n\n if (ctx.features.find((value) => value === FeatureType.GRAPHQL)) {\n this.packageJson.addDependencies(\n {\n [\"apollo-server-\" + ctx.platform]: \"2.25.2\"\n },\n ctx\n );\n }\n }\n\n private addExpressDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/platform-express\": ctx.tsedVersion,\n \"body-parser\": \"latest\",\n cors: \"latest\",\n compression: \"latest\",\n \"cookie-parser\": \"latest\",\n express: \"latest\",\n \"method-override\": \"latest\"\n },\n ctx\n );\n\n this.packageJson.addDevDependencies(\n {\n \"@types/cors\": \"latest\",\n \"@types/express\": \"latest\",\n \"@types/compression\": \"latest\",\n \"@types/cookie-parser\": \"latest\",\n \"@types/method-override\": \"latest\"\n },\n ctx\n );\n }\n\n private addKoaDependencies(ctx: InitCmdContext) {\n this.packageJson.addDependencies(\n {\n \"@tsed/platform-koa\": ctx.tsedVersion,\n koa: \"latest\",\n \"@koa/cors\": \"latest\",\n \"@koa/router\": \"latest\",\n \"koa-qs\": \"latest\",\n \"koa-bodyparser\": \"latest\",\n \"koa-override\": \"latest\",\n \"koa-compress\": \"latest\"\n },\n ctx\n );\n\n this.packageJson.addDevDependencies(\n {\n \"@types/koa\": \"latest\",\n \"@types/koa-qs\": \"latest\",\n \"@types/koa-json\": \"latest\",\n \"@types/koa-bodyparser\": \"latest\",\n \"@types/koa__router\": \"latest\",\n \"@types/koa-compress\": \"latest\",\n \"@types/koa-send\": \"latest\",\n \"@types/koa__cors\": \"latest\"\n },\n ctx\n );\n }\n\n static checkPrecondition(ctx: InitCmdContext) {\n const isValid = (types: any, value: any) => (value ? Object.values(types).includes(value) : true);\n\n if (!isValid(PlatformType, ctx.platform)) {\n throw new Error(`Invalid selected platform: ${ctx.platform}. Possible values: ${Object.values(PlatformType).join(\", \")}.`);\n }\n\n if (!isValid(ArchitectureConvention, ctx.architecture)) {\n throw new Error(\n `Invalid selected architecture: ${ctx.architecture}. Possible values: ${Object.values(ArchitectureConvention).join(\", \")}.`\n );\n }\n\n if (!isValid(ProjectConvention, ctx.convention)) {\n throw new Error(`Invalid selected convention: ${ctx.convention}. Possible values: ${Object.values(ProjectConvention).join(\", \")}.`);\n }\n\n if (!isValid(PackageManager, ctx.packageManager)) {\n throw new Error(`Invalid selected convention: ${ctx.packageManager}. Possible values: ${Object.values(PackageManager).join(\", \")}.`);\n }\n\n if (ctx.features) {\n ctx.features.forEach((value) => {\n const feature = FeaturesMap[value.toLowerCase()];\n\n if (!feature) {\n throw new Error(`Invalid selected feature: ${value}. Possible values: ${Object.values(FeatureType).join(\", \")}.`);\n }\n });\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { isPlatform } from "../utils/isPlatform.js";
|
|
3
|
+
import { hasFeature, hasValue } from "../utils/hasFeature.js";
|
|
4
|
+
import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces.js";
|
|
5
|
+
export var FeatureType;
|
|
6
|
+
(function (FeatureType) {
|
|
7
|
+
FeatureType["GRAPHQL"] = "graphql";
|
|
8
|
+
FeatureType["SOCKETIO"] = "socketio";
|
|
9
|
+
FeatureType["SWAGGER"] = "swagger";
|
|
10
|
+
FeatureType["OIDC"] = "oidc";
|
|
11
|
+
FeatureType["PASSPORTJS"] = "passportjs";
|
|
12
|
+
FeatureType["COMMANDS"] = "commands";
|
|
13
|
+
FeatureType["DB"] = "db";
|
|
14
|
+
// ORM
|
|
15
|
+
FeatureType["PRISMA"] = "prisma";
|
|
16
|
+
FeatureType["MONGOOSE"] = "mongoose";
|
|
17
|
+
// TYPEORM
|
|
18
|
+
FeatureType["TYPEORM"] = "typeorm";
|
|
19
|
+
FeatureType["TYPEORM_MYSQL"] = "typeorm:mysql";
|
|
20
|
+
FeatureType["TYPEORM_MARIADB"] = "typeorm:mariadb";
|
|
21
|
+
FeatureType["TYPEORM_POSTGRES"] = "typeorm:postgres";
|
|
22
|
+
FeatureType["TYPEORM_COCKROACHDB"] = "typeorm:cockroachdb";
|
|
23
|
+
FeatureType["TYPEORM_SQLITE"] = "typeorm:sqlite";
|
|
24
|
+
FeatureType["TYPEORM_BETTER_SQLITE3"] = "typeorm:better-sqlite3";
|
|
25
|
+
FeatureType["TYPEORM_CORDOVA"] = "typeorm:cordova";
|
|
26
|
+
FeatureType["TYPEORM_NATIVESCRIPT"] = "typeorm:nativescript";
|
|
27
|
+
FeatureType["TYPEORM_ORACLE"] = "typeorm:oracle";
|
|
28
|
+
FeatureType["TYPEORM_MSSQL"] = "typeorm:mssql";
|
|
29
|
+
FeatureType["TYPEORM_MONGODB"] = "typeorm:mongodb";
|
|
30
|
+
FeatureType["TYPEORM_SQLJS"] = "typeorm:sqljs";
|
|
31
|
+
FeatureType["TYPEORM_REACTNATIVE"] = "typeorm:reactnative";
|
|
32
|
+
FeatureType["TYPEORM_EXPO"] = "typeorm:expo";
|
|
33
|
+
// TESTING
|
|
34
|
+
FeatureType["TESTING"] = "testing";
|
|
35
|
+
FeatureType["JEST"] = "jest";
|
|
36
|
+
FeatureType["MOCHA"] = "mocha";
|
|
37
|
+
FeatureType["LINTER"] = "linter";
|
|
38
|
+
FeatureType["ESLINT"] = "eslint";
|
|
39
|
+
FeatureType["LINT_STAGED"] = "lintstaged";
|
|
40
|
+
FeatureType["PRETTIER"] = "prettier";
|
|
41
|
+
// BUNDLER
|
|
42
|
+
FeatureType["BUNDLER"] = "bundler";
|
|
43
|
+
FeatureType["BABEL"] = "babel";
|
|
44
|
+
FeatureType["WEBPACK"] = "babel:webpack";
|
|
45
|
+
})(FeatureType || (FeatureType = {}));
|
|
46
|
+
export const FeaturesMap = {
|
|
47
|
+
[PlatformType.EXPRESS]: {
|
|
48
|
+
name: "Express.js",
|
|
49
|
+
checked: (options) => options.platform !== PlatformType.KOA
|
|
50
|
+
},
|
|
51
|
+
[PlatformType.KOA]: {
|
|
52
|
+
name: "Koa.js",
|
|
53
|
+
checked: (options) => options.platform === PlatformType.KOA
|
|
54
|
+
},
|
|
55
|
+
[FeatureType.GRAPHQL]: {
|
|
56
|
+
name: "TypeGraphQL",
|
|
57
|
+
dependencies: {
|
|
58
|
+
"@tsed/typegraphql": "{{tsedVersion}}"
|
|
59
|
+
},
|
|
60
|
+
devDependencies: {
|
|
61
|
+
"@tsed/cli-plugin-typegraphql": "{{cliVersion}}"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[FeatureType.DB]: {
|
|
65
|
+
name: "Database"
|
|
66
|
+
},
|
|
67
|
+
[FeatureType.PASSPORTJS]: {
|
|
68
|
+
name: "Passport.js",
|
|
69
|
+
when: isPlatform(PlatformType.EXPRESS),
|
|
70
|
+
devDependencies: {
|
|
71
|
+
"@tsed/cli-plugin-passport": "{{cliVersion}}"
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
[FeatureType.SOCKETIO]: {
|
|
75
|
+
name: "Socket.io",
|
|
76
|
+
dependencies: {
|
|
77
|
+
"@tsed/socketio": "{{tsedVersion}}",
|
|
78
|
+
"socket.io": "latest"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[FeatureType.SWAGGER]: {
|
|
82
|
+
name: "Swagger",
|
|
83
|
+
dependencies: {
|
|
84
|
+
"@tsed/swagger": "{{tsedVersion}}"
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
[FeatureType.OIDC]: {
|
|
88
|
+
name: "OpenID Connect provider",
|
|
89
|
+
devDependencies: {
|
|
90
|
+
"@tsed/cli-plugin-oidc-provider": "{{cliVersion}}"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
[FeatureType.TESTING]: {
|
|
94
|
+
name: "Testing",
|
|
95
|
+
dependencies: {},
|
|
96
|
+
devDependencies: {
|
|
97
|
+
"@types/supertest": "latest",
|
|
98
|
+
supertest: "latest"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
[FeatureType.LINTER]: {
|
|
102
|
+
name: "Linter"
|
|
103
|
+
},
|
|
104
|
+
[FeatureType.BUNDLER]: {
|
|
105
|
+
name: "Bundler"
|
|
106
|
+
},
|
|
107
|
+
[FeatureType.COMMANDS]: {
|
|
108
|
+
name: "Commands",
|
|
109
|
+
dependencies: {
|
|
110
|
+
"@tsed/cli-core": "{{cliVersion}}"
|
|
111
|
+
},
|
|
112
|
+
devDependencies: {
|
|
113
|
+
"@types/inquirer": "latest"
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
[ProjectConvention.DEFAULT]: {
|
|
117
|
+
name: "Ts.ED",
|
|
118
|
+
checked: true
|
|
119
|
+
},
|
|
120
|
+
[ProjectConvention.ANGULAR]: {
|
|
121
|
+
name: "Angular",
|
|
122
|
+
checked: false
|
|
123
|
+
},
|
|
124
|
+
[ArchitectureConvention.DEFAULT]: {
|
|
125
|
+
name: "Ts.ED",
|
|
126
|
+
checked: true
|
|
127
|
+
},
|
|
128
|
+
[ArchitectureConvention.FEATURE]: {
|
|
129
|
+
name: "Feature",
|
|
130
|
+
checked: false
|
|
131
|
+
},
|
|
132
|
+
[FeatureType.TYPEORM_MYSQL]: {
|
|
133
|
+
name: "MySQL",
|
|
134
|
+
dependencies: {
|
|
135
|
+
mysql2: "latest"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
[FeatureType.TYPEORM_MARIADB]: {
|
|
139
|
+
name: "MariaDB",
|
|
140
|
+
dependencies: {
|
|
141
|
+
mariadb: "latest"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
[FeatureType.TYPEORM_POSTGRES]: {
|
|
145
|
+
name: "Postgres",
|
|
146
|
+
dependencies: {
|
|
147
|
+
pg: "latest"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
[FeatureType.TYPEORM_COCKROACHDB]: {
|
|
151
|
+
name: "CockRoachDB",
|
|
152
|
+
dependencies: {
|
|
153
|
+
cockroachdb: "latest"
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
[FeatureType.TYPEORM_SQLITE]: {
|
|
157
|
+
name: "SQLite",
|
|
158
|
+
dependencies: {
|
|
159
|
+
sqlite3: "latest"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
[FeatureType.TYPEORM_BETTER_SQLITE3]: {
|
|
163
|
+
name: "Better SQLite3",
|
|
164
|
+
dependencies: {
|
|
165
|
+
"better-sqlite3": "latest"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
[FeatureType.TYPEORM_CORDOVA]: {
|
|
169
|
+
name: "Cordova"
|
|
170
|
+
},
|
|
171
|
+
[FeatureType.TYPEORM_NATIVESCRIPT]: {
|
|
172
|
+
name: "NativeScript"
|
|
173
|
+
},
|
|
174
|
+
[FeatureType.TYPEORM_ORACLE]: {
|
|
175
|
+
name: "Oracle",
|
|
176
|
+
dependencies: {
|
|
177
|
+
oracledb: "latest"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
[FeatureType.TYPEORM_MSSQL]: {
|
|
181
|
+
name: "MsSQL",
|
|
182
|
+
dependencies: {
|
|
183
|
+
mssql: "latest"
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
[FeatureType.TYPEORM_MONGODB]: {
|
|
187
|
+
name: "MongoDB",
|
|
188
|
+
dependencies: {
|
|
189
|
+
mongodb: "latest"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
[FeatureType.TYPEORM_SQLJS]: {
|
|
193
|
+
name: "SQL.js"
|
|
194
|
+
},
|
|
195
|
+
[FeatureType.TYPEORM_REACTNATIVE]: {
|
|
196
|
+
name: "ReactNative"
|
|
197
|
+
},
|
|
198
|
+
[FeatureType.TYPEORM_EXPO]: {
|
|
199
|
+
name: "Expo"
|
|
200
|
+
},
|
|
201
|
+
[FeatureType.PRISMA]: {
|
|
202
|
+
name: "Prisma",
|
|
203
|
+
devDependencies: {
|
|
204
|
+
"@tsed/cli-plugin-prisma": "{{cliVersion}}"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
[FeatureType.MONGOOSE]: {
|
|
208
|
+
name: "Mongoose",
|
|
209
|
+
devDependencies: {
|
|
210
|
+
"@tsed/cli-plugin-mongoose": "{{cliVersion}}"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
[FeatureType.TYPEORM]: {
|
|
214
|
+
name: "TypeORM",
|
|
215
|
+
devDependencies: {
|
|
216
|
+
"@tsed/cli-plugin-typeorm": "{{cliVersion}}"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
[FeatureType.JEST]: {
|
|
220
|
+
name: "Jest",
|
|
221
|
+
devDependencies: {
|
|
222
|
+
"@tsed/cli-plugin-jest": "{{cliVersion}}"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
[FeatureType.MOCHA]: {
|
|
226
|
+
name: "Mocha + Chai + Sinon",
|
|
227
|
+
devDependencies: {
|
|
228
|
+
"@tsed/cli-plugin-mocha": "{{cliVersion}}"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
[FeatureType.ESLINT]: {
|
|
232
|
+
name: "EsLint",
|
|
233
|
+
checked: true,
|
|
234
|
+
devDependencies: {
|
|
235
|
+
"@tsed/cli-plugin-eslint": "{{cliVersion}}"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
[FeatureType.PRETTIER]: {
|
|
239
|
+
name: "Prettier"
|
|
240
|
+
},
|
|
241
|
+
[FeatureType.LINT_STAGED]: {
|
|
242
|
+
name: "Lint on commit"
|
|
243
|
+
},
|
|
244
|
+
[FeatureType.BABEL]: {
|
|
245
|
+
name: "Babel",
|
|
246
|
+
devDependencies: {
|
|
247
|
+
"@babel/cli": "latest",
|
|
248
|
+
"@babel/core": "latest",
|
|
249
|
+
"@babel/node": "latest",
|
|
250
|
+
"@babel/plugin-proposal-class-properties": "latest",
|
|
251
|
+
"@babel/plugin-proposal-decorators": "latest",
|
|
252
|
+
"@babel/preset-env": "latest",
|
|
253
|
+
"@babel/preset-typescript": "latest",
|
|
254
|
+
"babel-plugin-transform-typescript-metadata": "latest",
|
|
255
|
+
"babel-watch": "latest"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
[FeatureType.WEBPACK]: {
|
|
259
|
+
name: "Webpack",
|
|
260
|
+
devDependencies: {
|
|
261
|
+
"@babel/cli": "latest",
|
|
262
|
+
"@babel/core": "latest",
|
|
263
|
+
"@babel/node": "latest",
|
|
264
|
+
"@babel/plugin-proposal-class-properties": "latest",
|
|
265
|
+
"@babel/plugin-proposal-decorators": "latest",
|
|
266
|
+
"@babel/preset-env": "latest",
|
|
267
|
+
"@babel/preset-typescript": "latest",
|
|
268
|
+
"babel-plugin-transform-typescript-metadata": "latest",
|
|
269
|
+
"babel-watch": "latest",
|
|
270
|
+
"babel-loader": "latest",
|
|
271
|
+
webpack: "latest",
|
|
272
|
+
"webpack-cli": "latest"
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
[PackageManager.YARN]: {
|
|
276
|
+
name: "Yarn",
|
|
277
|
+
checked: true
|
|
278
|
+
},
|
|
279
|
+
[PackageManager.NPM]: {
|
|
280
|
+
name: "NPM",
|
|
281
|
+
checked: false
|
|
282
|
+
},
|
|
283
|
+
[PackageManager.PNPM]: {
|
|
284
|
+
name: "PNPM - experimental",
|
|
285
|
+
checked: false
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
export const FeaturesPrompt = () => [
|
|
289
|
+
{
|
|
290
|
+
message: "Choose the target platform:",
|
|
291
|
+
type: "list",
|
|
292
|
+
name: "platform",
|
|
293
|
+
choices: [PlatformType.EXPRESS, PlatformType.KOA]
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
message: "Choose the architecture for your project:",
|
|
297
|
+
type: "list",
|
|
298
|
+
name: "architecture",
|
|
299
|
+
choices: [ArchitectureConvention.DEFAULT, ArchitectureConvention.FEATURE]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
message: "Choose the convention file styling:",
|
|
303
|
+
type: "list",
|
|
304
|
+
name: "convention",
|
|
305
|
+
choices: [ProjectConvention.DEFAULT, ProjectConvention.ANGULAR]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
type: "checkbox",
|
|
309
|
+
name: "features",
|
|
310
|
+
message: "Check the features needed for your project",
|
|
311
|
+
choices: [
|
|
312
|
+
FeatureType.GRAPHQL,
|
|
313
|
+
FeatureType.DB,
|
|
314
|
+
FeatureType.PASSPORTJS,
|
|
315
|
+
FeatureType.SOCKETIO,
|
|
316
|
+
FeatureType.SWAGGER,
|
|
317
|
+
FeatureType.OIDC,
|
|
318
|
+
FeatureType.TESTING,
|
|
319
|
+
FeatureType.LINTER,
|
|
320
|
+
FeatureType.BUNDLER,
|
|
321
|
+
FeatureType.COMMANDS
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
message: "Choose a ORM manager",
|
|
326
|
+
type: "list",
|
|
327
|
+
name: "featuresDB",
|
|
328
|
+
when: hasFeature(FeatureType.DB),
|
|
329
|
+
choices: [FeatureType.PRISMA, FeatureType.MONGOOSE, FeatureType.TYPEORM]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
type: "list",
|
|
333
|
+
name: "featuresTypeORM",
|
|
334
|
+
message: "Which TypeORM you want to install?",
|
|
335
|
+
choices: [
|
|
336
|
+
FeatureType.TYPEORM_MYSQL,
|
|
337
|
+
FeatureType.TYPEORM_MARIADB,
|
|
338
|
+
FeatureType.TYPEORM_POSTGRES,
|
|
339
|
+
FeatureType.TYPEORM_COCKROACHDB,
|
|
340
|
+
FeatureType.TYPEORM_SQLITE,
|
|
341
|
+
FeatureType.TYPEORM_BETTER_SQLITE3,
|
|
342
|
+
FeatureType.TYPEORM_CORDOVA,
|
|
343
|
+
FeatureType.TYPEORM_NATIVESCRIPT,
|
|
344
|
+
FeatureType.TYPEORM_ORACLE,
|
|
345
|
+
FeatureType.TYPEORM_MSSQL,
|
|
346
|
+
FeatureType.TYPEORM_MONGODB,
|
|
347
|
+
FeatureType.TYPEORM_SQLJS,
|
|
348
|
+
FeatureType.TYPEORM_REACTNATIVE,
|
|
349
|
+
FeatureType.TYPEORM_EXPO
|
|
350
|
+
],
|
|
351
|
+
when: hasValue("featuresDB", FeatureType.TYPEORM)
|
|
352
|
+
},
|
|
353
|
+
// {
|
|
354
|
+
// type: "password",
|
|
355
|
+
// name: "GH_TOKEN",
|
|
356
|
+
// message:
|
|
357
|
+
// "Enter GH_TOKEN to use the premium @tsedio/prisma package or leave blank (see https://tsed.io/tutorials/prisma-client.html)",
|
|
358
|
+
// when: hasValue("featuresDB.type", "prisma")
|
|
359
|
+
// },
|
|
360
|
+
{
|
|
361
|
+
message: "Choose unit framework",
|
|
362
|
+
type: "list",
|
|
363
|
+
name: "featuresTesting",
|
|
364
|
+
when: hasFeature(FeatureType.TESTING),
|
|
365
|
+
choices: [FeatureType.JEST, FeatureType.MOCHA]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
message: "Choose linter tools framework",
|
|
369
|
+
type: "list",
|
|
370
|
+
name: "featuresLinter",
|
|
371
|
+
when: hasFeature(FeatureType.LINTER),
|
|
372
|
+
choices: [FeatureType.ESLINT]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
message: "Choose extra linter tools",
|
|
376
|
+
type: "checkbox",
|
|
377
|
+
name: "featuresExtraLinter",
|
|
378
|
+
when: hasFeature(FeatureType.LINTER),
|
|
379
|
+
choices: [FeatureType.PRETTIER, FeatureType.LINT_STAGED]
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
message: "Choose your bundler",
|
|
383
|
+
type: "list",
|
|
384
|
+
name: "featuresBundler",
|
|
385
|
+
when: hasFeature(FeatureType.BUNDLER),
|
|
386
|
+
choices: [FeatureType.BABEL, FeatureType.WEBPACK]
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
message: "Choose the OIDC base path server",
|
|
390
|
+
name: "oidcBasePath",
|
|
391
|
+
default: "/oidc",
|
|
392
|
+
when: hasFeature(FeatureType.OIDC),
|
|
393
|
+
type: "input"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
message: "Choose the package manager:",
|
|
397
|
+
type: "list",
|
|
398
|
+
name: "packageManager",
|
|
399
|
+
choices: [PackageManager.YARN, PackageManager.NPM, PackageManager.PNPM]
|
|
400
|
+
}
|
|
401
|
+
];
|
|
402
|
+
//# sourceMappingURL=FeaturesPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FeaturesPrompt.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/FeaturesPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAW5F,MAAM,CAAN,IAAY,WA4CX;AA5CD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,oCAAqB,CAAA;IACrB,wBAAS,CAAA;IAET,MAAM;IACN,gCAAiB,CAAA;IAEjB,oCAAqB,CAAA;IAErB,UAAU;IACV,kCAAmB,CAAA;IACnB,8CAA+B,CAAA;IAC/B,kDAAmC,CAAA;IACnC,oDAAqC,CAAA;IACrC,0DAA2C,CAAA;I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,IAAI,CAAC;QAClC,IAAI,EAAE,OAAO;KACd;IACD;QACE,OAAO,EAAE,6BAA6B;QACtC,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,gBAAgB;QACtB,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,IAAI,CAAC;KACxE;CACF,CAAC","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {isPlatform} from \"../utils/isPlatform\";\nimport {hasFeature, hasValue} from \"../utils/hasFeature\";\nimport {InitOptions} from \"../interfaces/InitOptions\";\nimport {ArchitectureConvention, PlatformType, ProjectConvention} from \"../../../interfaces\";\n\nexport interface Feature {\n name: string;\n value?: any;\n checked?: boolean | ((opts: Partial<InitOptions>) => boolean);\n when?: (opts: any) => boolean;\n dependencies?: Record<string, any>;\n devDependencies?: Record<string, any>;\n}\n\nexport enum FeatureType {\n GRAPHQL = \"graphql\",\n SOCKETIO = \"socketio\",\n SWAGGER = \"swagger\",\n OIDC = \"oidc\",\n PASSPORTJS = \"passportjs\",\n COMMANDS = \"commands\",\n DB = \"db\",\n\n // ORM\n PRISMA = \"prisma\",\n\n MONGOOSE = \"mongoose\",\n\n // TYPEORM\n TYPEORM = \"typeorm\",\n TYPEORM_MYSQL = \"typeorm:mysql\",\n TYPEORM_MARIADB = \"typeorm:mariadb\",\n TYPEORM_POSTGRES = \"typeorm:postgres\",\n TYPEORM_COCKROACHDB = \"typeorm:cockroachdb\",\n TYPEORM_SQLITE = \"typeorm:sqlite\",\n TYPEORM_BETTER_SQLITE3 = \"typeorm:better-sqlite3\",\n TYPEORM_CORDOVA = \"typeorm:cordova\",\n TYPEORM_NATIVESCRIPT = \"typeorm:nativescript\",\n TYPEORM_ORACLE = \"typeorm:oracle\",\n TYPEORM_MSSQL = \"typeorm:mssql\",\n TYPEORM_MONGODB = \"typeorm:mongodb\",\n TYPEORM_SQLJS = \"typeorm:sqljs\",\n TYPEORM_REACTNATIVE = \"typeorm:reactnative\",\n TYPEORM_EXPO = \"typeorm:expo\",\n\n // TESTING\n TESTING = \"testing\",\n JEST = \"jest\",\n MOCHA = \"mocha\",\n LINTER = \"linter\",\n ESLINT = \"eslint\",\n LINT_STAGED = \"lintstaged\",\n PRETTIER = \"prettier\",\n\n // BUNDLER\n BUNDLER = \"bundler\",\n BABEL = \"babel\",\n WEBPACK = \"babel:webpack\"\n}\n\nexport const FeaturesMap: Record<string, Feature> = {\n [PlatformType.EXPRESS]: {\n name: \"Express.js\",\n checked: (options: any) => options.platform !== PlatformType.KOA\n },\n [PlatformType.KOA]: {\n name: \"Koa.js\",\n checked: (options: any) => options.platform === PlatformType.KOA\n },\n [FeatureType.GRAPHQL]: {\n name: \"TypeGraphQL\",\n dependencies: {\n \"@tsed/typegraphql\": \"{{tsedVersion}}\"\n },\n devDependencies: {\n \"@tsed/cli-plugin-typegraphql\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.DB]: {\n name: \"Database\"\n },\n [FeatureType.PASSPORTJS]: {\n name: \"Passport.js\",\n when: isPlatform(PlatformType.EXPRESS),\n devDependencies: {\n \"@tsed/cli-plugin-passport\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.SOCKETIO]: {\n name: \"Socket.io\",\n dependencies: {\n \"@tsed/socketio\": \"{{tsedVersion}}\",\n \"socket.io\": \"latest\"\n }\n },\n [FeatureType.SWAGGER]: {\n name: \"Swagger\",\n dependencies: {\n \"@tsed/swagger\": \"{{tsedVersion}}\"\n }\n },\n [FeatureType.OIDC]: {\n name: \"OpenID Connect provider\",\n devDependencies: {\n \"@tsed/cli-plugin-oidc-provider\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.TESTING]: {\n name: \"Testing\",\n dependencies: {},\n devDependencies: {\n \"@types/supertest\": \"latest\",\n supertest: \"latest\"\n }\n },\n [FeatureType.LINTER]: {\n name: \"Linter\"\n },\n [FeatureType.BUNDLER]: {\n name: \"Bundler\"\n },\n [FeatureType.COMMANDS]: {\n name: \"Commands\",\n dependencies: {\n \"@tsed/cli-core\": \"{{cliVersion}}\"\n },\n devDependencies: {\n \"@types/inquirer\": \"latest\"\n }\n },\n\n [ProjectConvention.DEFAULT]: {\n name: \"Ts.ED\",\n checked: true\n },\n [ProjectConvention.ANGULAR]: {\n name: \"Angular\",\n checked: false\n },\n [ArchitectureConvention.DEFAULT]: {\n name: \"Ts.ED\",\n checked: true\n },\n [ArchitectureConvention.FEATURE]: {\n name: \"Feature\",\n checked: false\n },\n [FeatureType.TYPEORM_MYSQL]: {\n name: \"MySQL\",\n dependencies: {\n mysql2: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MARIADB]: {\n name: \"MariaDB\",\n dependencies: {\n mariadb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_POSTGRES]: {\n name: \"Postgres\",\n dependencies: {\n pg: \"latest\"\n }\n },\n [FeatureType.TYPEORM_COCKROACHDB]: {\n name: \"CockRoachDB\",\n dependencies: {\n cockroachdb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_SQLITE]: {\n name: \"SQLite\",\n dependencies: {\n sqlite3: \"latest\"\n }\n },\n [FeatureType.TYPEORM_BETTER_SQLITE3]: {\n name: \"Better SQLite3\",\n dependencies: {\n \"better-sqlite3\": \"latest\"\n }\n },\n [FeatureType.TYPEORM_CORDOVA]: {\n name: \"Cordova\"\n },\n [FeatureType.TYPEORM_NATIVESCRIPT]: {\n name: \"NativeScript\"\n },\n [FeatureType.TYPEORM_ORACLE]: {\n name: \"Oracle\",\n dependencies: {\n oracledb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MSSQL]: {\n name: \"MsSQL\",\n\n dependencies: {\n mssql: \"latest\"\n }\n },\n [FeatureType.TYPEORM_MONGODB]: {\n name: \"MongoDB\",\n dependencies: {\n mongodb: \"latest\"\n }\n },\n [FeatureType.TYPEORM_SQLJS]: {\n name: \"SQL.js\"\n },\n [FeatureType.TYPEORM_REACTNATIVE]: {\n name: \"ReactNative\"\n },\n [FeatureType.TYPEORM_EXPO]: {\n name: \"Expo\"\n },\n [FeatureType.PRISMA]: {\n name: \"Prisma\",\n devDependencies: {\n \"@tsed/cli-plugin-prisma\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.MONGOOSE]: {\n name: \"Mongoose\",\n\n devDependencies: {\n \"@tsed/cli-plugin-mongoose\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.TYPEORM]: {\n name: \"TypeORM\",\n devDependencies: {\n \"@tsed/cli-plugin-typeorm\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.JEST]: {\n name: \"Jest\",\n devDependencies: {\n \"@tsed/cli-plugin-jest\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.MOCHA]: {\n name: \"Mocha + Chai + Sinon\",\n devDependencies: {\n \"@tsed/cli-plugin-mocha\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.ESLINT]: {\n name: \"EsLint\",\n checked: true,\n devDependencies: {\n \"@tsed/cli-plugin-eslint\": \"{{cliVersion}}\"\n }\n },\n [FeatureType.PRETTIER]: {\n name: \"Prettier\"\n },\n [FeatureType.LINT_STAGED]: {\n name: \"Lint on commit\"\n },\n [FeatureType.BABEL]: {\n name: \"Babel\",\n devDependencies: {\n \"@babel/cli\": \"latest\",\n \"@babel/core\": \"latest\",\n \"@babel/node\": \"latest\",\n \"@babel/plugin-proposal-class-properties\": \"latest\",\n \"@babel/plugin-proposal-decorators\": \"latest\",\n \"@babel/preset-env\": \"latest\",\n \"@babel/preset-typescript\": \"latest\",\n \"babel-plugin-transform-typescript-metadata\": \"latest\",\n \"babel-watch\": \"latest\"\n }\n },\n [FeatureType.WEBPACK]: {\n name: \"Webpack\",\n devDependencies: {\n \"@babel/cli\": \"latest\",\n \"@babel/core\": \"latest\",\n \"@babel/node\": \"latest\",\n \"@babel/plugin-proposal-class-properties\": \"latest\",\n \"@babel/plugin-proposal-decorators\": \"latest\",\n \"@babel/preset-env\": \"latest\",\n \"@babel/preset-typescript\": \"latest\",\n \"babel-plugin-transform-typescript-metadata\": \"latest\",\n \"babel-watch\": \"latest\",\n \"babel-loader\": \"latest\",\n webpack: \"latest\",\n \"webpack-cli\": \"latest\"\n }\n },\n [PackageManager.YARN]: {\n name: \"Yarn\",\n checked: true\n },\n [PackageManager.NPM]: {\n name: \"NPM\",\n checked: false\n },\n [PackageManager.PNPM]: {\n name: \"PNPM - experimental\",\n checked: false\n }\n};\n\nexport const FeaturesPrompt = () => [\n {\n message: \"Choose the target platform:\",\n type: \"list\",\n name: \"platform\",\n choices: [PlatformType.EXPRESS, PlatformType.KOA]\n },\n {\n message: \"Choose the architecture for your project:\",\n type: \"list\",\n name: \"architecture\",\n choices: [ArchitectureConvention.DEFAULT, ArchitectureConvention.FEATURE]\n },\n {\n message: \"Choose the convention file styling:\",\n type: \"list\",\n name: \"convention\",\n choices: [ProjectConvention.DEFAULT, ProjectConvention.ANGULAR]\n },\n {\n type: \"checkbox\",\n name: \"features\",\n message: \"Check the features needed for your project\",\n choices: [\n FeatureType.GRAPHQL,\n FeatureType.DB,\n FeatureType.PASSPORTJS,\n FeatureType.SOCKETIO,\n FeatureType.SWAGGER,\n FeatureType.OIDC,\n FeatureType.TESTING,\n FeatureType.LINTER,\n FeatureType.BUNDLER,\n FeatureType.COMMANDS\n ]\n },\n {\n message: \"Choose a ORM manager\",\n type: \"list\",\n name: \"featuresDB\",\n when: hasFeature(FeatureType.DB),\n choices: [FeatureType.PRISMA, FeatureType.MONGOOSE, FeatureType.TYPEORM]\n },\n {\n type: \"list\",\n name: \"featuresTypeORM\",\n message: \"Which TypeORM you want to install?\",\n choices: [\n FeatureType.TYPEORM_MYSQL,\n FeatureType.TYPEORM_MARIADB,\n FeatureType.TYPEORM_POSTGRES,\n FeatureType.TYPEORM_COCKROACHDB,\n FeatureType.TYPEORM_SQLITE,\n FeatureType.TYPEORM_BETTER_SQLITE3,\n FeatureType.TYPEORM_CORDOVA,\n FeatureType.TYPEORM_NATIVESCRIPT,\n FeatureType.TYPEORM_ORACLE,\n FeatureType.TYPEORM_MSSQL,\n FeatureType.TYPEORM_MONGODB,\n FeatureType.TYPEORM_SQLJS,\n FeatureType.TYPEORM_REACTNATIVE,\n FeatureType.TYPEORM_EXPO\n ],\n when: hasValue(\"featuresDB\", FeatureType.TYPEORM)\n },\n // {\n // type: \"password\",\n // name: \"GH_TOKEN\",\n // message:\n // \"Enter GH_TOKEN to use the premium @tsedio/prisma package or leave blank (see https://tsed.io/tutorials/prisma-client.html)\",\n // when: hasValue(\"featuresDB.type\", \"prisma\")\n // },\n {\n message: \"Choose unit framework\",\n type: \"list\",\n name: \"featuresTesting\",\n when: hasFeature(FeatureType.TESTING),\n choices: [FeatureType.JEST, FeatureType.MOCHA]\n },\n {\n message: \"Choose linter tools framework\",\n type: \"list\",\n name: \"featuresLinter\",\n when: hasFeature(FeatureType.LINTER),\n choices: [FeatureType.ESLINT]\n },\n {\n message: \"Choose extra linter tools\",\n type: \"checkbox\",\n name: \"featuresExtraLinter\",\n when: hasFeature(FeatureType.LINTER),\n choices: [FeatureType.PRETTIER, FeatureType.LINT_STAGED]\n },\n {\n message: \"Choose your bundler\",\n type: \"list\",\n name: \"featuresBundler\",\n when: hasFeature(FeatureType.BUNDLER),\n choices: [FeatureType.BABEL, FeatureType.WEBPACK]\n },\n {\n message: \"Choose the OIDC base path server\",\n name: \"oidcBasePath\",\n default: \"/oidc\",\n when: hasFeature(FeatureType.OIDC),\n type: \"input\"\n },\n {\n message: \"Choose the package manager:\",\n type: \"list\",\n name: \"packageManager\",\n choices: [PackageManager.YARN, PackageManager.NPM, PackageManager.PNPM]\n }\n];\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces.js";
|
|
3
|
+
import { FeatureType } from "./FeaturesPrompt.js";
|
|
4
|
+
export const InitFileSchema = {
|
|
5
|
+
type: "object",
|
|
6
|
+
properties: {
|
|
7
|
+
tsedVersion: {
|
|
8
|
+
type: "string"
|
|
9
|
+
},
|
|
10
|
+
projectName: {
|
|
11
|
+
type: "string",
|
|
12
|
+
maxLength: 100
|
|
13
|
+
},
|
|
14
|
+
platform: {
|
|
15
|
+
type: "string",
|
|
16
|
+
description: "The project name. By default, the project is the same as the name directory.",
|
|
17
|
+
enum: Object.values(PlatformType),
|
|
18
|
+
default: PlatformType.EXPRESS
|
|
19
|
+
},
|
|
20
|
+
architecture: {
|
|
21
|
+
type: "string",
|
|
22
|
+
enum: Object.values(ArchitectureConvention),
|
|
23
|
+
default: ArchitectureConvention.DEFAULT
|
|
24
|
+
},
|
|
25
|
+
convention: {
|
|
26
|
+
type: "string",
|
|
27
|
+
enum: Object.values(ProjectConvention),
|
|
28
|
+
default: ProjectConvention.DEFAULT
|
|
29
|
+
},
|
|
30
|
+
features: {
|
|
31
|
+
type: "array",
|
|
32
|
+
items: {
|
|
33
|
+
type: "string",
|
|
34
|
+
enum: Object.values(FeatureType)
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
packageManager: {
|
|
38
|
+
type: "string",
|
|
39
|
+
enum: Object.values(PackageManager),
|
|
40
|
+
default: PackageManager.YARN
|
|
41
|
+
},
|
|
42
|
+
skipPrompt: {
|
|
43
|
+
type: "boolean",
|
|
44
|
+
default: false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
required: ["features"],
|
|
48
|
+
additionalProperties: true
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=InitFileSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitFileSchema.js","sourceRoot":"","sources":["../../../../../src/commands/init/config/InitFileSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAC,sBAAsB,EAAE,YAAY,EAAE,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,GAAG;SACf;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,8EAA8E;YAC3F,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YACjC,OAAO,EAAE,YAAY,CAAC,OAAO;SAC9B;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC;YAC3C,OAAO,EAAE,sBAAsB,CAAC,OAAO;SACxC;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;YACtC,OAAO,EAAE,iBAAiB,CAAC,OAAO;SACnC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC;aACjC;SACF;QACD,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC;YACnC,OAAO,EAAE,cAAc,CAAC,IAAI;SAC7B;QACD,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,KAAK;SACf;KACF;IACD,QAAQ,EAAE,CAAC,UAAU,CAAC;IACtB,oBAAoB,EAAE,IAAI;CAC3B,CAAC","sourcesContent":["import {PackageManager} from \"@tsed/cli-core\";\nimport {ArchitectureConvention, PlatformType, ProjectConvention} from \"../../../interfaces\";\nimport {FeatureType} from \"./FeaturesPrompt\";\n\nexport const InitFileSchema = {\n type: \"object\",\n properties: {\n tsedVersion: {\n type: \"string\"\n },\n projectName: {\n type: \"string\",\n maxLength: 100\n },\n platform: {\n type: \"string\",\n description: \"The project name. By default, the project is the same as the name directory.\",\n enum: Object.values(PlatformType),\n default: PlatformType.EXPRESS\n },\n architecture: {\n type: \"string\",\n enum: Object.values(ArchitectureConvention),\n default: ArchitectureConvention.DEFAULT\n },\n convention: {\n type: \"string\",\n enum: Object.values(ProjectConvention),\n default: ProjectConvention.DEFAULT\n },\n features: {\n type: \"array\",\n items: {\n type: \"string\",\n enum: Object.values(FeatureType)\n }\n },\n packageManager: {\n type: \"string\",\n enum: Object.values(PackageManager),\n default: PackageManager.YARN\n },\n skipPrompt: {\n type: \"boolean\",\n default: false\n }\n },\n required: [\"features\"],\n additionalProperties: true\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InitCmdContext.js","sourceRoot":"","sources":["../../../../../src/commands/init/interfaces/InitCmdContext.ts"],"names":[],"mappings":"","sourcesContent":["import {CliDefaultOptions} from \"@tsed/cli-core\";\nimport {InitOptions} from \"./InitOptions\";\n\nexport interface InitCmdContext extends InitOptions, CliDefaultOptions, Record<string, any> {\n root: string;\n srcDir: string;\n}\n"]}
|