@tsed/cli 6.0.0-alpha.1 → 6.0.0-alpha.10

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.
Files changed (116) hide show
  1. package/lib/esm/Cli.js +0 -13
  2. package/lib/esm/bin/tsed.js +15 -2
  3. package/lib/esm/commands/add/AddCmd.js +0 -1
  4. package/lib/esm/commands/generate/GenerateCmd.js +5 -6
  5. package/lib/esm/commands/generate/ProviderTypes.js +0 -1
  6. package/lib/esm/commands/index.js +0 -1
  7. package/lib/esm/commands/init/InitCmd.js +13 -7
  8. package/lib/esm/commands/init/config/FeaturesPrompt.js +1 -2
  9. package/lib/esm/commands/init/config/InitFileSchema.js +0 -1
  10. package/lib/esm/commands/init/interfaces/InitCmdContext.js +0 -1
  11. package/lib/esm/commands/init/interfaces/InitOptions.js +5 -2
  12. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +2 -2
  13. package/lib/esm/commands/init/mappers/mapToContext.js +0 -1
  14. package/lib/esm/commands/init/mappers/mapUniqFeatures.js +1 -1
  15. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js +0 -1
  16. package/lib/esm/commands/init/utils/hasFeature.js +0 -1
  17. package/lib/esm/commands/init/utils/isPlatform.js +0 -1
  18. package/lib/esm/commands/run/RunCmd.js +0 -1
  19. package/lib/esm/commands/update/UpdateCmd.js +0 -1
  20. package/lib/esm/constants/index.js +2 -3
  21. package/lib/esm/index.js +0 -1
  22. package/lib/esm/interfaces/ArchitectureConvention.js +1 -2
  23. package/lib/esm/interfaces/PlatformType.js +1 -2
  24. package/lib/esm/interfaces/ProjectConvention.js +1 -2
  25. package/lib/esm/interfaces/index.js +0 -1
  26. package/lib/esm/loaders/alias.hook.js +9 -0
  27. package/lib/esm/pipes/ClassNamePipe.js +2 -3
  28. package/lib/esm/pipes/OutputFilePathPipe.js +0 -1
  29. package/lib/esm/pipes/RoutePipe.js +3 -4
  30. package/lib/esm/pipes/index.js +0 -1
  31. package/lib/esm/platforms/InitPlatformsModule.js +0 -1
  32. package/lib/esm/platforms/supports/InitBasePlatform.js +0 -1
  33. package/lib/esm/platforms/supports/InitExpressPlatform.js +0 -1
  34. package/lib/esm/platforms/supports/InitKoaPlatform.js +0 -1
  35. package/lib/esm/runtimes/RuntimesModule.js +1 -1
  36. package/lib/esm/runtimes/index.js +0 -1
  37. package/lib/esm/runtimes/supports/BabelRuntime.js +3 -1
  38. package/lib/esm/runtimes/supports/BaseRuntime.js +3 -1
  39. package/lib/esm/runtimes/supports/BunRuntime.js +0 -1
  40. package/lib/esm/runtimes/supports/NodeRuntime.js +1 -2
  41. package/lib/esm/runtimes/supports/WebpackRuntime.js +3 -1
  42. package/lib/esm/services/ProvidersInfoService.js +1 -2
  43. package/lib/esm/utils/fillImports.js +5 -6
  44. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  45. package/lib/types/Cli.d.ts +1 -2
  46. package/lib/types/commands/add/AddCmd.d.ts +1 -1
  47. package/lib/types/commands/generate/GenerateCmd.d.ts +2 -1
  48. package/lib/types/commands/init/InitCmd.d.ts +3 -3
  49. package/lib/types/commands/init/config/FeaturesPrompt.d.ts +1 -1
  50. package/lib/types/commands/init/interfaces/InitCmdContext.d.ts +2 -2
  51. package/lib/types/commands/init/mappers/mapToContext.d.ts +1 -1
  52. package/lib/types/commands/init/mappers/mapUniqFeatures.d.ts +2 -2
  53. package/lib/types/commands/init/prompts/getFeaturesPrompt.d.ts +1 -1
  54. package/lib/types/commands/run/RunCmd.d.ts +1 -1
  55. package/lib/types/commands/update/UpdateCmd.d.ts +1 -1
  56. package/lib/types/constants/index.d.ts +1 -1
  57. package/lib/types/loaders/alias.hook.d.ts +2 -0
  58. package/lib/types/platforms/InitPlatformsModule.d.ts +1 -1
  59. package/lib/types/platforms/supports/InitExpressPlatform.d.ts +1 -1
  60. package/lib/types/platforms/supports/InitKoaPlatform.d.ts +1 -1
  61. package/lib/types/runtimes/supports/BabelRuntime.d.ts +1 -0
  62. package/lib/types/runtimes/supports/BaseRuntime.d.ts +1 -0
  63. package/lib/types/runtimes/supports/WebpackRuntime.d.ts +1 -0
  64. package/package.json +35 -35
  65. package/templates/init/.dockerignore.hbs +1 -0
  66. package/templates/init/.swcrc.hbs +1 -1
  67. package/templates/init/docker/bun/Dockerfile.hbs +2 -2
  68. package/templates/init/docker/npm/Dockerfile.hbs +5 -5
  69. package/templates/init/docker/pnpm/Dockerfile.hbs +5 -5
  70. package/templates/init/docker/yarn/Dockerfile.hbs +5 -5
  71. package/templates/init/docker/yarn_berry/Dockerfile.hbs +5 -5
  72. package/templates/init/pm2/bun/processes.config.cjs.hbs +23 -0
  73. package/templates/init/{processes.config.cjs.hbs → pm2/node-compiled/processes.config.cjs.hbs} +3 -4
  74. package/templates/init/pm2/node-loader/processes.config.cjs.hbs +24 -0
  75. package/lib/esm/Cli.js.map +0 -1
  76. package/lib/esm/bin/tsed.js.map +0 -1
  77. package/lib/esm/commands/add/AddCmd.js.map +0 -1
  78. package/lib/esm/commands/generate/GenerateCmd.js.map +0 -1
  79. package/lib/esm/commands/generate/ProviderTypes.js.map +0 -1
  80. package/lib/esm/commands/index.js.map +0 -1
  81. package/lib/esm/commands/init/InitCmd.js.map +0 -1
  82. package/lib/esm/commands/init/config/FeaturesPrompt.js.map +0 -1
  83. package/lib/esm/commands/init/config/InitFileSchema.js.map +0 -1
  84. package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +0 -1
  85. package/lib/esm/commands/init/interfaces/InitOptions.js.map +0 -1
  86. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +0 -1
  87. package/lib/esm/commands/init/mappers/mapToContext.js.map +0 -1
  88. package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +0 -1
  89. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +0 -1
  90. package/lib/esm/commands/init/utils/hasFeature.js.map +0 -1
  91. package/lib/esm/commands/init/utils/isPlatform.js.map +0 -1
  92. package/lib/esm/commands/run/RunCmd.js.map +0 -1
  93. package/lib/esm/commands/update/UpdateCmd.js.map +0 -1
  94. package/lib/esm/constants/index.js.map +0 -1
  95. package/lib/esm/index.js.map +0 -1
  96. package/lib/esm/interfaces/ArchitectureConvention.js.map +0 -1
  97. package/lib/esm/interfaces/PlatformType.js.map +0 -1
  98. package/lib/esm/interfaces/ProjectConvention.js.map +0 -1
  99. package/lib/esm/interfaces/index.js.map +0 -1
  100. package/lib/esm/pipes/ClassNamePipe.js.map +0 -1
  101. package/lib/esm/pipes/OutputFilePathPipe.js.map +0 -1
  102. package/lib/esm/pipes/RoutePipe.js.map +0 -1
  103. package/lib/esm/pipes/index.js.map +0 -1
  104. package/lib/esm/platforms/InitPlatformsModule.js.map +0 -1
  105. package/lib/esm/platforms/supports/InitBasePlatform.js.map +0 -1
  106. package/lib/esm/platforms/supports/InitExpressPlatform.js.map +0 -1
  107. package/lib/esm/platforms/supports/InitKoaPlatform.js.map +0 -1
  108. package/lib/esm/runtimes/RuntimesModule.js.map +0 -1
  109. package/lib/esm/runtimes/index.js.map +0 -1
  110. package/lib/esm/runtimes/supports/BabelRuntime.js.map +0 -1
  111. package/lib/esm/runtimes/supports/BaseRuntime.js.map +0 -1
  112. package/lib/esm/runtimes/supports/BunRuntime.js.map +0 -1
  113. package/lib/esm/runtimes/supports/NodeRuntime.js.map +0 -1
  114. package/lib/esm/runtimes/supports/WebpackRuntime.js.map +0 -1
  115. package/lib/esm/services/ProvidersInfoService.js.map +0 -1
  116. package/lib/esm/utils/fillImports.js.map +0 -1
package/lib/esm/Cli.js CHANGED
@@ -1,7 +1,5 @@
1
1
  import { CliCore } from "@tsed/cli-core";
2
2
  import chalk from "chalk";
3
- // @ts-ignore
4
- import alias from "module-alias";
5
3
  import commands from "./commands/index.js";
6
4
  import { PKG, TEMPLATE_DIR } from "./constants/index.js";
7
5
  import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
@@ -52,18 +50,7 @@ export class Cli extends CliCore {
52
50
  };
53
51
  const { pkg } = opts;
54
52
  this.checkPrecondition(opts);
55
- this.createAliases();
56
53
  await this.updateNotifier(pkg);
57
54
  return super.bootstrap(opts, Cli);
58
55
  }
59
- static createAliases() {
60
- alias.addAliases({
61
- "@tsed/core": require.resolve("@tsed/core"),
62
- "@tsed/di": require.resolve("@tsed/di"),
63
- "@tsed/schema": require.resolve("@tsed/schema"),
64
- "@tsed/cli-core": require.resolve("@tsed/cli-core"),
65
- "@tsed/cli": require.resolve("@tsed/cli")
66
- });
67
- }
68
56
  }
69
- //# sourceMappingURL=Cli.js.map
@@ -1,7 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import { Cli } from "../Cli.js";
2
+ import { register } from "node:module";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
+ const EXT = process.env.CLI_MODE === "ts" ? "ts" : "js";
5
+ register(pathToFileURL(`${import.meta.dirname}/../loaders/alias.hook.${EXT}`), {
6
+ parentURL: import.meta.dirname,
7
+ data: {
8
+ "@tsed/core": fileURLToPath(import.meta.resolve("@tsed/core")),
9
+ "@tsed/di": fileURLToPath(import.meta.resolve("@tsed/di")),
10
+ "@tsed/schema": fileURLToPath(import.meta.resolve("@tsed/schema")),
11
+ "@tsed/cli-core": fileURLToPath(import.meta.resolve("@tsed/cli-core")),
12
+ "@tsed/cli": fileURLToPath(import.meta.resolve("@tsed/cli"))
13
+ },
14
+ transferList: []
15
+ });
16
+ const { Cli } = await import("../Cli.js");
3
17
  Cli.bootstrap({}).catch((error) => {
4
18
  console.error(error);
5
19
  process.exit(-1);
6
20
  });
7
- //# sourceMappingURL=tsed.js.map
@@ -59,4 +59,3 @@ AddCmd = __decorate([
59
59
  })
60
60
  ], AddCmd);
61
61
  export { AddCmd };
62
- //# sourceMappingURL=AddCmd.js.map
@@ -1,9 +1,9 @@
1
1
  var GenerateCmd_1;
2
2
  import { __decorate, __metadata } from "tslib";
3
3
  import { Command, Inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
4
- import { paramCase, pascalCase } from "change-case";
5
- import globby from "globby";
6
- import normalizePath from "normalize-path";
4
+ import { normalizePath } from "@tsed/normalize-path";
5
+ import { kebabCase, pascalCase } from "change-case";
6
+ import { globbySync } from "globby";
7
7
  import { basename, dirname, join } from "path";
8
8
  import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
9
9
  import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
@@ -131,7 +131,7 @@ let GenerateCmd = GenerateCmd_1 = class GenerateCmd {
131
131
  type = "prisma.service";
132
132
  }
133
133
  const symbolName = this.classNamePipe.transform({ name, type, format: ProjectConvention.DEFAULT });
134
- const symbolParamName = paramCase(symbolName);
134
+ const symbolParamName = kebabCase(symbolName);
135
135
  return fillImports({
136
136
  ...ctx,
137
137
  type,
@@ -183,7 +183,7 @@ let GenerateCmd = GenerateCmd_1 = class GenerateCmd {
183
183
  return [];
184
184
  }
185
185
  getDirectories(dir) {
186
- const directories = globby.sync("**/*", {
186
+ const directories = globbySync("**/*", {
187
187
  cwd: join(this.srcRenderService.rootDir, dir),
188
188
  ignore: ["__*"]
189
189
  });
@@ -251,4 +251,3 @@ GenerateCmd = GenerateCmd_1 = __decorate([
251
251
  __metadata("design:paramtypes", [ProvidersInfoService])
252
252
  ], GenerateCmd);
253
253
  export { GenerateCmd };
254
- //# sourceMappingURL=GenerateCmd.js.map
@@ -101,4 +101,3 @@ export const PROVIDER_TYPES = [
101
101
  model: "{{symbolName}}.repository"
102
102
  }
103
103
  ];
104
- //# sourceMappingURL=ProviderTypes.js.map
@@ -4,4 +4,3 @@ import { InitCmd } from "./init/InitCmd.js";
4
4
  import { RunCmd } from "./run/RunCmd.js";
5
5
  import { UpdateCmd } from "./update/UpdateCmd.js";
6
6
  export default [AddCmd, InitCmd, GenerateCmd, UpdateCmd, RunCmd];
7
- //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { CliExeca, CliFs, CliLoadFile, CliPackageJson, CliPlugins, CliService, Command, Configuration, createSubTasks, createTasksRunner, Inject, PackageManager, PackageManagersModule, ProjectPackageJson, RootRendererService } from "@tsed/cli-core";
3
- import { paramCase, pascalCase } from "change-case";
3
+ import { kebabCase, pascalCase } from "change-case";
4
4
  import { basename, join } from "path";
5
5
  import { DEFAULT_TSED_TAGS } from "../../constants/index.js";
6
6
  import { ArchitectureConvention } from "../../interfaces/ArchitectureConvention.js";
@@ -66,10 +66,10 @@ let InitCmd = class InitCmd {
66
66
  type: "input",
67
67
  name: "projectName",
68
68
  message: "What is your project name",
69
- default: paramCase(initialOptions.root),
69
+ default: kebabCase(initialOptions.root),
70
70
  when: initialOptions.root !== ".",
71
71
  transformer(input) {
72
- return paramCase(input);
72
+ return kebabCase(input);
73
73
  }
74
74
  },
75
75
  ...getFeaturesPrompt(runtimes, packageManagers.filter((o) => o !== "bun"), initialOptions)
@@ -184,7 +184,7 @@ let InitCmd = class InitCmd {
184
184
  ];
185
185
  }
186
186
  resolveRootDir(ctx) {
187
- const rootDirName = paramCase(ctx.projectName || basename(this.packageJson.dir));
187
+ const rootDirName = kebabCase(ctx.projectName || basename(this.packageJson.dir));
188
188
  if (this.packageJson.dir.endsWith(rootDirName)) {
189
189
  ctx.projectName = ctx.projectName || rootDirName;
190
190
  ctx.root = ".";
@@ -267,14 +267,20 @@ let InitCmd = class InitCmd {
267
267
  ctx = {
268
268
  ...ctx,
269
269
  node: runtime instanceof NodeRuntime,
270
- bun: runtime instanceof BunRuntime
270
+ bun: runtime instanceof BunRuntime,
271
+ compiled: runtime instanceof NodeRuntime && runtime.isCompiled()
271
272
  };
273
+ const pm2 = ctx.bun ? "bun" : ctx.compiled ? "node-compiled" : "node-loader";
272
274
  return this.rootRenderer.renderAll([
273
275
  ...runtime.files(),
274
276
  "/init/.dockerignore.hbs",
275
277
  "/init/.gitignore.hbs",
276
278
  "/init/.barrels.json.hbs",
277
- "/init/processes.config.cjs.hbs",
279
+ {
280
+ path: `/init/pm2/${pm2}/processes.config.cjs.hbs`,
281
+ output: `processes.config.cjs`,
282
+ replaces: [`pm2/${pm2}`]
283
+ },
278
284
  "/init/docker-compose.yml.hbs",
279
285
  {
280
286
  path: `/init/docker/${packageManager.name}/Dockerfile.hbs`,
@@ -282,6 +288,7 @@ let InitCmd = class InitCmd {
282
288
  replaces: [`docker/${packageManager.name}`]
283
289
  },
284
290
  "/init/README.md.hbs",
291
+ "/init/tsconfig.json.hbs",
285
292
  "/init/tsconfig.base.json.hbs",
286
293
  "/init/tsconfig.node.json.hbs",
287
294
  ctx.testing && "/init/tsconfig.spec.json.hbs",
@@ -420,4 +427,3 @@ InitCmd = __decorate([
420
427
  })
421
428
  ], InitCmd);
422
429
  export { InitCmd };
423
- //# sourceMappingURL=InitCmd.js.map
@@ -37,7 +37,7 @@ export var FeatureType;
37
37
  FeatureType["ESLINT"] = "eslint";
38
38
  FeatureType["LINT_STAGED"] = "lintstaged";
39
39
  FeatureType["PRETTIER"] = "prettier";
40
- })(FeatureType = FeatureType || (FeatureType = {}));
40
+ })(FeatureType || (FeatureType = {}));
41
41
  export const FeaturesMap = {
42
42
  [PlatformType.EXPRESS]: {
43
43
  name: "Express.js",
@@ -380,4 +380,3 @@ export const FeaturesPrompt = (availableRuntimes, availablePackageManagers) => [
380
380
  choices: availablePackageManagers
381
381
  }
382
382
  ];
383
- //# sourceMappingURL=FeaturesPrompt.js.map
@@ -47,4 +47,3 @@ export const InitFileSchema = {
47
47
  required: ["features"],
48
48
  additionalProperties: true
49
49
  };
50
- //# sourceMappingURL=InitFileSchema.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=InitCmdContext.js.map
@@ -1,2 +1,5 @@
1
- export {};
2
- //# sourceMappingURL=InitOptions.js.map
1
+ import { PackageManager } from "@tsed/cli-core";
2
+ import { ArchitectureConvention } from "../../../interfaces/ArchitectureConvention.js";
3
+ import { PlatformType } from "../../../interfaces/PlatformType.js";
4
+ import { ProjectConvention } from "../../../interfaces/ProjectConvention.js";
5
+ import { FeatureType } from "../config/FeaturesPrompt.js";
@@ -1,2 +1,2 @@
1
- export {};
2
- //# sourceMappingURL=InitPromptAnswers.js.map
1
+ import { PackageManager } from "@tsed/cli-core";
2
+ import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces/index.js";
@@ -9,4 +9,3 @@ export function mapToContext(options) {
9
9
  });
10
10
  return options;
11
11
  }
12
- //# sourceMappingURL=mapToContext.js.map
@@ -1,3 +1,4 @@
1
+ import { FeatureType } from "../config/FeaturesPrompt.js";
1
2
  export function mapUniqFeatures(answers) {
2
3
  const features = [];
3
4
  Object.entries(answers)
@@ -11,4 +12,3 @@ export function mapUniqFeatures(answers) {
11
12
  features: [...new Set(features).values()]
12
13
  };
13
14
  }
14
- //# sourceMappingURL=mapUniqFeatures.js.map
@@ -18,4 +18,3 @@ export function getFeaturesPrompt(runtimes, availablePackageManagers, options) {
18
18
  });
19
19
  });
20
20
  }
21
- //# sourceMappingURL=getFeaturesPrompt.js.map
@@ -5,4 +5,3 @@ export function hasValue(expression, value) {
5
5
  export function hasFeature(feature) {
6
6
  return (ctx) => !!ctx.features.find((item) => item === feature);
7
7
  }
8
- //# sourceMappingURL=hasFeature.js.map
@@ -1,4 +1,3 @@
1
1
  export function isPlatform(...types) {
2
2
  return (ctx) => [types].includes(ctx.platform);
3
3
  }
4
- //# sourceMappingURL=isPlatform.js.map
@@ -46,4 +46,3 @@ RunCmd = __decorate([
46
46
  })
47
47
  ], RunCmd);
48
48
  export { RunCmd };
49
- //# sourceMappingURL=RunCmd.js.map
@@ -117,4 +117,3 @@ UpdateCmd = __decorate([
117
117
  })
118
118
  ], UpdateCmd);
119
119
  export { UpdateCmd };
120
- //# sourceMappingURL=UpdateCmd.js.map
@@ -1,6 +1,6 @@
1
1
  import { dirname, join } from "path";
2
- import readPkgUp from "read-pkg-up";
3
- const { path, packageJson } = readPkgUp.sync({
2
+ import { readPackageUpSync } from "read-pkg-up";
3
+ const { path, packageJson } = readPackageUpSync({
4
4
  cwd: join(import.meta.dirname, "..", "..")
5
5
  });
6
6
  export const PKG = packageJson;
@@ -9,4 +9,3 @@ export const DEFAULT_TSED_TAGS = "latest";
9
9
  export const IGNORE_VERSIONS = ["6.0.0"];
10
10
  export const IGNORE_TAGS = false; // /alpha|beta/
11
11
  export const TEMPLATE_DIR = join(dirname(path), "templates");
12
- //# sourceMappingURL=index.js.map
package/lib/esm/index.js CHANGED
@@ -13,4 +13,3 @@ export * from "./interfaces/index.js";
13
13
  export * from "./pipes/index.js";
14
14
  export * from "./runtimes/index.js";
15
15
  export * from "./services/ProvidersInfoService.js";
16
- //# sourceMappingURL=index.js.map
@@ -2,5 +2,4 @@ export var ArchitectureConvention;
2
2
  (function (ArchitectureConvention) {
3
3
  ArchitectureConvention["DEFAULT"] = "arc_default";
4
4
  ArchitectureConvention["FEATURE"] = "feature";
5
- })(ArchitectureConvention = ArchitectureConvention || (ArchitectureConvention = {}));
6
- //# sourceMappingURL=ArchitectureConvention.js.map
5
+ })(ArchitectureConvention || (ArchitectureConvention = {}));
@@ -2,5 +2,4 @@ export var PlatformType;
2
2
  (function (PlatformType) {
3
3
  PlatformType["EXPRESS"] = "express";
4
4
  PlatformType["KOA"] = "koa";
5
- })(PlatformType = PlatformType || (PlatformType = {}));
6
- //# sourceMappingURL=PlatformType.js.map
5
+ })(PlatformType || (PlatformType = {}));
@@ -2,5 +2,4 @@ export var ProjectConvention;
2
2
  (function (ProjectConvention) {
3
3
  ProjectConvention["DEFAULT"] = "conv_default";
4
4
  ProjectConvention["ANGULAR"] = "angular";
5
- })(ProjectConvention = ProjectConvention || (ProjectConvention = {}));
6
- //# sourceMappingURL=ProjectConvention.js.map
5
+ })(ProjectConvention || (ProjectConvention = {}));
@@ -1,4 +1,3 @@
1
1
  export * from "./ArchitectureConvention.js";
2
2
  export * from "./PlatformType.js";
3
3
  export * from "./ProjectConvention.js";
4
- //# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
1
+ import generateAliasesResolver from "esm-module-alias";
2
+ let resolver = null;
3
+ export async function initialize(aliases) {
4
+ // Receives data from `register`.
5
+ resolver = generateAliasesResolver(aliases);
6
+ }
7
+ export function resolve(specifier, context, nextResolve) {
8
+ return resolver(specifier, context, nextResolve);
9
+ }
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Injectable, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { Inject } from "@tsed/di";
4
- import { paramCase, pascalCase } from "change-case";
4
+ import { kebabCase, pascalCase } from "change-case";
5
5
  import { basename } from "path";
6
6
  import { ProjectConvention } from "../interfaces/ProjectConvention.js";
7
7
  import { ProvidersInfoService } from "../services/ProvidersInfoService.js";
@@ -10,7 +10,7 @@ let ClassNamePipe = class ClassNamePipe {
10
10
  const format = options.format || this.projectPackageJson.preferences.convention || ProjectConvention.DEFAULT;
11
11
  const meta = this.providers.get(options.type)?.model || "{{symbolName}}.{{symbolType}}?";
12
12
  const type = options.type.split(":").at(-1);
13
- const symbolName = paramCase(basename(options.name)).replace(`-${type}`, "");
13
+ const symbolName = kebabCase(basename(options.name)).replace(`-${type}`, "");
14
14
  const names = meta.split(".").reduce((acc, key) => {
15
15
  return key
16
16
  .replace(/{{symbolName}}/gi, symbolName)
@@ -38,4 +38,3 @@ ClassNamePipe = __decorate([
38
38
  Injectable()
39
39
  ], ClassNamePipe);
40
40
  export { ClassNamePipe };
41
- //# sourceMappingURL=ClassNamePipe.js.map
@@ -32,4 +32,3 @@ OutputFilePathPipe = __decorate([
32
32
  __metadata("design:paramtypes", [ClassNamePipe])
33
33
  ], OutputFilePathPipe);
34
34
  export { OutputFilePathPipe };
35
- //# sourceMappingURL=OutputFilePathPipe.js.map
@@ -1,16 +1,16 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { Injectable } from "@tsed/cli-core";
3
- import { paramCase } from "change-case";
3
+ import { kebabCase } from "change-case";
4
4
  let RoutePipe = class RoutePipe {
5
5
  transform(route) {
6
6
  const r = route
7
7
  .split("/")
8
8
  .reduce((paths, path) => {
9
- const word = paramCase(path);
9
+ const word = kebabCase(path);
10
10
  if (paths.includes(`${word}s`) || paths.includes(word)) {
11
11
  return paths;
12
12
  }
13
- return [...paths, paramCase(path)];
13
+ return [...paths, kebabCase(path)];
14
14
  }, [])
15
15
  .join("/");
16
16
  return `/${r}`.replace(/\/\//gi, "/");
@@ -20,4 +20,3 @@ RoutePipe = __decorate([
20
20
  Injectable()
21
21
  ], RoutePipe);
22
22
  export { RoutePipe };
23
- //# sourceMappingURL=RoutePipe.js.map
@@ -1,4 +1,3 @@
1
1
  export * from "./ClassNamePipe.js";
2
2
  export * from "./OutputFilePathPipe.js";
3
3
  export * from "./RoutePipe.js";
4
- //# sourceMappingURL=index.js.map
@@ -19,4 +19,3 @@ InitPlatformsModule = __decorate([
19
19
  __metadata("design:paramtypes", [Array])
20
20
  ], InitPlatformsModule);
21
21
  export { InitPlatformsModule };
22
- //# sourceMappingURL=InitPlatformsModule.js.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=InitBasePlatform.js.map
@@ -31,4 +31,3 @@ InitExpressPlatform = __decorate([
31
31
  })
32
32
  ], InitExpressPlatform);
33
33
  export { InitExpressPlatform };
34
- //# sourceMappingURL=InitExpressPlatform.js.map
@@ -35,4 +35,3 @@ InitKoaPlatform = __decorate([
35
35
  })
36
36
  ], InitKoaPlatform);
37
37
  export { InitKoaPlatform };
38
- //# sourceMappingURL=InitKoaPlatform.js.map
@@ -2,6 +2,7 @@ import { __decorate, __metadata, __param } from "tslib";
2
2
  import { PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { Inject, Module } from "@tsed/di";
4
4
  import { BabelRuntime } from "./supports/BabelRuntime.js";
5
+ import { BaseRuntime } from "./supports/BaseRuntime.js";
5
6
  import { BunRuntime } from "./supports/BunRuntime.js";
6
7
  import { NodeRuntime } from "./supports/NodeRuntime.js";
7
8
  import { WebpackRuntime } from "./supports/WebpackRuntime.js";
@@ -57,4 +58,3 @@ RuntimesModule = __decorate([
57
58
  __metadata("design:paramtypes", [Array])
58
59
  ], RuntimesModule);
59
60
  export { RuntimesModule };
60
- //# sourceMappingURL=RuntimesModule.js.map
@@ -4,4 +4,3 @@ export * from "./supports/BaseRuntime.js";
4
4
  export * from "./supports/BunRuntime.js";
5
5
  export * from "./supports/NodeRuntime.js";
6
6
  export * from "./supports/WebpackRuntime.js";
7
- //# sourceMappingURL=index.js.map
@@ -8,6 +8,9 @@ let BabelRuntime = class BabelRuntime extends NodeRuntime {
8
8
  this.name = "babel";
9
9
  this.order = 1;
10
10
  }
11
+ isCompiled() {
12
+ return false;
13
+ }
11
14
  files() {
12
15
  return ["/init/.babelrc.hbs"];
13
16
  }
@@ -42,4 +45,3 @@ BabelRuntime = __decorate([
42
45
  })
43
46
  ], BabelRuntime);
44
47
  export { BabelRuntime };
45
- //# sourceMappingURL=BabelRuntime.js.map
@@ -8,6 +8,9 @@ export class BaseRuntime {
8
8
  get packageManager() {
9
9
  return this.packageManagers.get();
10
10
  }
11
+ isCompiled() {
12
+ return true;
13
+ }
11
14
  files() {
12
15
  return [];
13
16
  }
@@ -38,4 +41,3 @@ __decorate([
38
41
  Inject(CliExeca),
39
42
  __metadata("design:type", CliExeca)
40
43
  ], BaseRuntime.prototype, "cliExeca", void 0);
41
- //# sourceMappingURL=BaseRuntime.js.map
@@ -29,4 +29,3 @@ BunRuntime = __decorate([
29
29
  })
30
30
  ], BunRuntime);
31
31
  export { BunRuntime };
32
- //# sourceMappingURL=BunRuntime.js.map
@@ -12,7 +12,7 @@ let NodeRuntime = class NodeRuntime extends BaseRuntime {
12
12
  return ["/init/.swcrc.hbs", "/init/nodemon.json.hbs"];
13
13
  }
14
14
  startDev(main) {
15
- return `nodemon --import @swc-node/register/register-esm ${main}`;
15
+ return `nodemon ${main}`;
16
16
  }
17
17
  startProd(main) {
18
18
  return `${this.cmd} --import @swc-node/register/register-esm ${main.replace("dist", "src")}`;
@@ -41,4 +41,3 @@ NodeRuntime = __decorate([
41
41
  })
42
42
  ], NodeRuntime);
43
43
  export { NodeRuntime };
44
- //# sourceMappingURL=NodeRuntime.js.map
@@ -8,6 +8,9 @@ let WebpackRuntime = class WebpackRuntime extends BabelRuntime {
8
8
  this.name = "webpack";
9
9
  this.order = 2;
10
10
  }
11
+ isCompiled() {
12
+ return true;
13
+ }
11
14
  files() {
12
15
  return [...super.files(), "/init/webpack.config.js.hbs"];
13
16
  }
@@ -33,4 +36,3 @@ WebpackRuntime = __decorate([
33
36
  })
34
37
  ], WebpackRuntime);
35
38
  export { WebpackRuntime };
36
- //# sourceMappingURL=WebpackRuntime.js.map
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { Injectable, nameOf } from "@tsed/cli-core";
2
+ import { Injectable, nameOf, Type } from "@tsed/cli-core";
3
3
  let ProvidersInfoService = class ProvidersInfoService {
4
4
  constructor() {
5
5
  this.map = new Map();
@@ -44,4 +44,3 @@ ProvidersInfoService = __decorate([
44
44
  Injectable()
45
45
  ], ProvidersInfoService);
46
46
  export { ProvidersInfoService };
47
- //# sourceMappingURL=ProvidersInfoService.js.map
@@ -6,11 +6,11 @@ export function fillImports(ctx) {
6
6
  });
7
7
  const isFeature = ctx.architecture === ArchitectureConvention.FEATURE;
8
8
  ctx.barrels = JSON.stringify([
9
- isFeature ? "./src/rest/index.js" : "./src/controllers/rest/index.js",
10
- ctx.swagger && (isFeature ? "./src/pages/index.js" : "./src/controllers/pages/index.js"),
11
- ctx.oidc && "./src/interactions/index.js",
12
- ctx.graphql && "./src/datasources/index.js",
13
- ctx.graphql && "./src/resolvers/index.js"
9
+ isFeature ? "./src/rest" : "./src/controllers/rest",
10
+ ctx.swagger && (isFeature ? "./src/pages" : "./src/controllers/pages"),
11
+ ctx.oidc && "./src/interactions",
12
+ ctx.graphql && "./src/datasources",
13
+ ctx.graphql && "./src/resolvers"
14
14
  ].filter(Boolean));
15
15
  ctx.imports = [
16
16
  ctx.express && { from: "@tsed/platform-express", comment: " // /!\\ keep this import" },
@@ -33,4 +33,3 @@ export function fillImports(ctx) {
33
33
  ].filter(Boolean);
34
34
  return ctx;
35
35
  }
36
- //# sourceMappingURL=fillImports.js.map