@tsed/cli 6.0.0-alpha.9 → 6.0.0-beta.2

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 (96) hide show
  1. package/lib/esm/Cli.js +0 -1
  2. package/lib/esm/bin/tsed.js +2 -2
  3. package/lib/esm/commands/add/AddCmd.js +7 -16
  4. package/lib/esm/commands/generate/GenerateCmd.js +2 -3
  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 +18 -56
  8. package/lib/esm/commands/init/config/FeaturesPrompt.js +0 -1
  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 +0 -1
  12. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js +0 -1
  13. package/lib/esm/commands/init/mappers/mapToContext.js +0 -1
  14. package/lib/esm/commands/init/mappers/mapUniqFeatures.js +0 -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 +7 -15
  19. package/lib/esm/commands/update/UpdateCmd.js +8 -19
  20. package/lib/esm/constants/index.js +2 -3
  21. package/lib/esm/index.js +0 -1
  22. package/lib/esm/interfaces/ArchitectureConvention.js +0 -1
  23. package/lib/esm/interfaces/PlatformType.js +0 -1
  24. package/lib/esm/interfaces/ProjectConvention.js +0 -1
  25. package/lib/esm/interfaces/index.js +0 -1
  26. package/lib/esm/loaders/alias.hook.js +0 -1
  27. package/lib/esm/pipes/ClassNamePipe.js +7 -12
  28. package/lib/esm/pipes/OutputFilePathPipe.js +7 -15
  29. package/lib/esm/pipes/RoutePipe.js +0 -1
  30. package/lib/esm/pipes/index.js +0 -1
  31. package/lib/esm/platforms/InitPlatformsModule.js +5 -8
  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 +3 -10
  36. package/lib/esm/runtimes/index.js +0 -1
  37. package/lib/esm/runtimes/supports/BabelRuntime.js +0 -1
  38. package/lib/esm/runtimes/supports/BaseRuntime.js +0 -1
  39. package/lib/esm/runtimes/supports/BunRuntime.js +0 -1
  40. package/lib/esm/runtimes/supports/NodeRuntime.js +0 -1
  41. package/lib/esm/runtimes/supports/WebpackRuntime.js +0 -1
  42. package/lib/esm/services/ProvidersInfoService.js +0 -1
  43. package/lib/esm/utils/fillImports.js +1 -1
  44. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  45. package/lib/types/commands/add/AddCmd.d.ts +3 -3
  46. package/lib/types/commands/init/InitCmd.d.ts +3 -3
  47. package/lib/types/commands/run/RunCmd.d.ts +3 -3
  48. package/lib/types/commands/update/UpdateCmd.d.ts +5 -5
  49. package/lib/types/constants/index.d.ts +2 -2
  50. package/lib/types/pipes/ClassNamePipe.d.ts +2 -2
  51. package/lib/types/pipes/OutputFilePathPipe.d.ts +3 -4
  52. package/lib/types/platforms/InitPlatformsModule.d.ts +0 -1
  53. package/package.json +33 -32
  54. package/lib/esm/Cli.js.map +0 -1
  55. package/lib/esm/bin/tsed.js.map +0 -1
  56. package/lib/esm/commands/add/AddCmd.js.map +0 -1
  57. package/lib/esm/commands/generate/GenerateCmd.js.map +0 -1
  58. package/lib/esm/commands/generate/ProviderTypes.js.map +0 -1
  59. package/lib/esm/commands/index.js.map +0 -1
  60. package/lib/esm/commands/init/InitCmd.js.map +0 -1
  61. package/lib/esm/commands/init/config/FeaturesPrompt.js.map +0 -1
  62. package/lib/esm/commands/init/config/InitFileSchema.js.map +0 -1
  63. package/lib/esm/commands/init/interfaces/InitCmdContext.js.map +0 -1
  64. package/lib/esm/commands/init/interfaces/InitOptions.js.map +0 -1
  65. package/lib/esm/commands/init/interfaces/InitPromptAnswers.js.map +0 -1
  66. package/lib/esm/commands/init/mappers/mapToContext.js.map +0 -1
  67. package/lib/esm/commands/init/mappers/mapUniqFeatures.js.map +0 -1
  68. package/lib/esm/commands/init/prompts/getFeaturesPrompt.js.map +0 -1
  69. package/lib/esm/commands/init/utils/hasFeature.js.map +0 -1
  70. package/lib/esm/commands/init/utils/isPlatform.js.map +0 -1
  71. package/lib/esm/commands/run/RunCmd.js.map +0 -1
  72. package/lib/esm/commands/update/UpdateCmd.js.map +0 -1
  73. package/lib/esm/constants/index.js.map +0 -1
  74. package/lib/esm/index.js.map +0 -1
  75. package/lib/esm/interfaces/ArchitectureConvention.js.map +0 -1
  76. package/lib/esm/interfaces/PlatformType.js.map +0 -1
  77. package/lib/esm/interfaces/ProjectConvention.js.map +0 -1
  78. package/lib/esm/interfaces/index.js.map +0 -1
  79. package/lib/esm/loaders/alias.hook.js.map +0 -1
  80. package/lib/esm/pipes/ClassNamePipe.js.map +0 -1
  81. package/lib/esm/pipes/OutputFilePathPipe.js.map +0 -1
  82. package/lib/esm/pipes/RoutePipe.js.map +0 -1
  83. package/lib/esm/pipes/index.js.map +0 -1
  84. package/lib/esm/platforms/InitPlatformsModule.js.map +0 -1
  85. package/lib/esm/platforms/supports/InitBasePlatform.js.map +0 -1
  86. package/lib/esm/platforms/supports/InitExpressPlatform.js.map +0 -1
  87. package/lib/esm/platforms/supports/InitKoaPlatform.js.map +0 -1
  88. package/lib/esm/runtimes/RuntimesModule.js.map +0 -1
  89. package/lib/esm/runtimes/index.js.map +0 -1
  90. package/lib/esm/runtimes/supports/BabelRuntime.js.map +0 -1
  91. package/lib/esm/runtimes/supports/BaseRuntime.js.map +0 -1
  92. package/lib/esm/runtimes/supports/BunRuntime.js.map +0 -1
  93. package/lib/esm/runtimes/supports/NodeRuntime.js.map +0 -1
  94. package/lib/esm/runtimes/supports/WebpackRuntime.js.map +0 -1
  95. package/lib/esm/services/ProvidersInfoService.js.map +0 -1
  96. package/lib/esm/utils/fillImports.js.map +0 -1
package/lib/esm/Cli.js CHANGED
@@ -54,4 +54,3 @@ export class Cli extends CliCore {
54
54
  return super.bootstrap(opts, Cli);
55
55
  }
56
56
  }
57
- //# sourceMappingURL=Cli.js.map
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { register } from "node:module";
3
3
  import { fileURLToPath, pathToFileURL } from "node:url";
4
- register(pathToFileURL(`${import.meta.dirname}/../loaders/alias.hook.js`), {
4
+ const EXT = process.env.CLI_MODE === "ts" ? "ts" : "js";
5
+ register(pathToFileURL(`${import.meta.dirname}/../loaders/alias.hook.${EXT}`), {
5
6
  parentURL: import.meta.dirname,
6
7
  data: {
7
8
  "@tsed/core": fileURLToPath(import.meta.resolve("@tsed/core")),
@@ -17,4 +18,3 @@ Cli.bootstrap({}).catch((error) => {
17
18
  console.error(error);
18
19
  process.exit(-1);
19
20
  });
20
- //# sourceMappingURL=tsed.js.map
@@ -1,7 +1,11 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { CliPlugins, Command, createSubTasks, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
3
- import { Inject } from "@tsed/di";
1
+ import { __decorate } from "tslib";
2
+ import { CliPlugins, Command, createSubTasks, inject, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
4
3
  let AddCmd = class AddCmd {
4
+ constructor() {
5
+ this.cliPlugins = inject(CliPlugins);
6
+ this.packageJson = inject(ProjectPackageJson);
7
+ this.packageManagers = inject(PackageManagersModule);
8
+ }
5
9
  $prompt(initialOptions) {
6
10
  return [
7
11
  {
@@ -34,18 +38,6 @@ let AddCmd = class AddCmd {
34
38
  ];
35
39
  }
36
40
  };
37
- __decorate([
38
- Inject(CliPlugins),
39
- __metadata("design:type", CliPlugins)
40
- ], AddCmd.prototype, "cliPlugins", void 0);
41
- __decorate([
42
- Inject(ProjectPackageJson),
43
- __metadata("design:type", ProjectPackageJson)
44
- ], AddCmd.prototype, "packageJson", void 0);
45
- __decorate([
46
- Inject(PackageManagersModule),
47
- __metadata("design:type", PackageManagersModule)
48
- ], AddCmd.prototype, "packageManagers", void 0);
49
41
  AddCmd = __decorate([
50
42
  Command({
51
43
  name: "add",
@@ -59,4 +51,3 @@ AddCmd = __decorate([
59
51
  })
60
52
  ], AddCmd);
61
53
  export { AddCmd };
62
- //# sourceMappingURL=AddCmd.js.map
@@ -1,6 +1,6 @@
1
1
  var GenerateCmd_1;
2
2
  import { __decorate, __metadata } from "tslib";
3
- import { Command, Inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
3
+ import { Command, Inject, inject, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
4
4
  import { normalizePath } from "@tsed/normalize-path";
5
5
  import { kebabCase, pascalCase } from "change-case";
6
6
  import { globbySync } from "globby";
@@ -230,7 +230,7 @@ GenerateCmd = GenerateCmd_1 = __decorate([
230
230
  }
231
231
  },
232
232
  options: {
233
- "-r, --route <route>": {
233
+ "--route <route>": {
234
234
  type: String,
235
235
  description: "The route for the controller generated file"
236
236
  },
@@ -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,5 +1,5 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { CliExeca, CliFs, CliLoadFile, CliPackageJson, CliPlugins, CliService, Command, Configuration, createSubTasks, createTasksRunner, Inject, PackageManager, PackageManagersModule, ProjectPackageJson, RootRendererService } from "@tsed/cli-core";
1
+ import { __decorate } from "tslib";
2
+ import { CliExeca, CliFs, CliLoadFile, cliPackageJson, CliPlugins, CliService, Command, Configuration, createSubTasks, createTasksRunner, Inject, inject, PackageManager, PackageManagersModule, ProjectPackageJson, RootRendererService } from "@tsed/cli-core";
3
3
  import { kebabCase, pascalCase } from "change-case";
4
4
  import { basename, join } from "path";
5
5
  import { DEFAULT_TSED_TAGS } from "../../constants/index.js";
@@ -17,6 +17,21 @@ import { InitFileSchema } from "./config/InitFileSchema.js";
17
17
  import { mapToContext } from "./mappers/mapToContext.js";
18
18
  import { getFeaturesPrompt } from "./prompts/getFeaturesPrompt.js";
19
19
  let InitCmd = class InitCmd {
20
+ constructor() {
21
+ this.configuration = inject(Configuration);
22
+ this.cliPlugins = inject(CliPlugins);
23
+ this.packageJson = inject(ProjectPackageJson);
24
+ this.packageManagers = inject(PackageManagersModule);
25
+ this.runtimes = inject(RuntimesModule);
26
+ this.platforms = inject(InitPlatformsModule);
27
+ this.cliPackageJson = cliPackageJson();
28
+ this.cliService = inject(CliService);
29
+ this.cliLoadFile = inject(CliLoadFile);
30
+ this.rootRenderer = inject(RootRendererService);
31
+ this.outputFilePathPipe = inject(OutputFilePathPipe);
32
+ this.execa = inject(CliExeca);
33
+ this.fs = inject(CliFs);
34
+ }
20
35
  checkPrecondition(ctx) {
21
36
  const isValid = (types, value) => (value ? Object.values(types).includes(value) : true);
22
37
  if (!isValid(PlatformType, ctx.platform)) {
@@ -211,7 +226,7 @@ let InitCmd = class InitCmd {
211
226
  "@tsed/openspec": ctx.tsedVersion,
212
227
  "@tsed/platform-cache": ctx.tsedVersion,
213
228
  "@tsed/platform-exceptions": ctx.tsedVersion,
214
- "@tsed/platform-log-middleware": ctx.tsedVersion,
229
+ "@tsed/platform-log-request": ctx.tsedVersion,
215
230
  "@tsed/platform-middlewares": ctx.tsedVersion,
216
231
  "@tsed/platform-params": ctx.tsedVersion,
217
232
  "@tsed/platform-response-filter": ctx.tsedVersion,
@@ -308,58 +323,6 @@ let InitCmd = class InitCmd {
308
323
  });
309
324
  }
310
325
  };
311
- __decorate([
312
- Configuration(),
313
- __metadata("design:type", Object)
314
- ], InitCmd.prototype, "configuration", void 0);
315
- __decorate([
316
- Inject(),
317
- __metadata("design:type", CliPlugins)
318
- ], InitCmd.prototype, "cliPlugins", void 0);
319
- __decorate([
320
- Inject(),
321
- __metadata("design:type", ProjectPackageJson)
322
- ], InitCmd.prototype, "packageJson", void 0);
323
- __decorate([
324
- Inject(),
325
- __metadata("design:type", PackageManagersModule)
326
- ], InitCmd.prototype, "packageManagers", void 0);
327
- __decorate([
328
- Inject(),
329
- __metadata("design:type", RuntimesModule)
330
- ], InitCmd.prototype, "runtimes", void 0);
331
- __decorate([
332
- Inject(),
333
- __metadata("design:type", InitPlatformsModule)
334
- ], InitCmd.prototype, "platforms", void 0);
335
- __decorate([
336
- CliPackageJson(),
337
- __metadata("design:type", Object)
338
- ], InitCmd.prototype, "cliPackageJson", void 0);
339
- __decorate([
340
- Inject(),
341
- __metadata("design:type", CliService)
342
- ], InitCmd.prototype, "cliService", void 0);
343
- __decorate([
344
- Inject(),
345
- __metadata("design:type", CliLoadFile)
346
- ], InitCmd.prototype, "cliLoadFile", void 0);
347
- __decorate([
348
- Inject(),
349
- __metadata("design:type", RootRendererService)
350
- ], InitCmd.prototype, "rootRenderer", void 0);
351
- __decorate([
352
- Inject(),
353
- __metadata("design:type", OutputFilePathPipe)
354
- ], InitCmd.prototype, "outputFilePathPipe", void 0);
355
- __decorate([
356
- Inject(),
357
- __metadata("design:type", CliExeca)
358
- ], InitCmd.prototype, "execa", void 0);
359
- __decorate([
360
- Inject(),
361
- __metadata("design:type", CliFs)
362
- ], InitCmd.prototype, "fs", void 0);
363
326
  InitCmd = __decorate([
364
327
  Command({
365
328
  name: "init",
@@ -427,4 +390,3 @@ InitCmd = __decorate([
427
390
  })
428
391
  ], InitCmd);
429
392
  export { InitCmd };
430
- //# sourceMappingURL=InitCmd.js.map
@@ -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
@@ -3,4 +3,3 @@ import { ArchitectureConvention } from "../../../interfaces/ArchitectureConventi
3
3
  import { PlatformType } from "../../../interfaces/PlatformType.js";
4
4
  import { ProjectConvention } from "../../../interfaces/ProjectConvention.js";
5
5
  import { FeatureType } from "../config/FeaturesPrompt.js";
6
- //# sourceMappingURL=InitOptions.js.map
@@ -1,3 +1,2 @@
1
1
  import { PackageManager } from "@tsed/cli-core";
2
2
  import { ArchitectureConvention, PlatformType, ProjectConvention } from "../../../interfaces/index.js";
3
- //# sourceMappingURL=InitPromptAnswers.js.map
@@ -9,4 +9,3 @@ export function mapToContext(options) {
9
9
  });
10
10
  return options;
11
11
  }
12
- //# sourceMappingURL=mapToContext.js.map
@@ -12,4 +12,3 @@ export function mapUniqFeatures(answers) {
12
12
  features: [...new Set(features).values()]
13
13
  };
14
14
  }
15
- //# 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
@@ -1,7 +1,12 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { CliFs, CliRunScript, Command, normalizePath, ProjectPackageJson } from "@tsed/cli-core";
1
+ import { __decorate } from "tslib";
2
+ import { CliFs, CliRunScript, Command, inject, normalizePath, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { Inject } from "@tsed/di";
4
4
  let RunCmd = class RunCmd {
5
+ constructor() {
6
+ this.fs = inject(CliFs);
7
+ this.projectPackageJson = inject(ProjectPackageJson);
8
+ this.runScript = inject(CliRunScript);
9
+ }
5
10
  async $exec(ctx) {
6
11
  const cmd = "node";
7
12
  const args = ["--import", "@swc-node/register/register-esm"];
@@ -12,18 +17,6 @@ let RunCmd = class RunCmd {
12
17
  return [];
13
18
  }
14
19
  };
15
- __decorate([
16
- Inject(),
17
- __metadata("design:type", CliFs)
18
- ], RunCmd.prototype, "fs", void 0);
19
- __decorate([
20
- Inject(),
21
- __metadata("design:type", ProjectPackageJson)
22
- ], RunCmd.prototype, "projectPackageJson", void 0);
23
- __decorate([
24
- Inject(),
25
- __metadata("design:type", CliRunScript)
26
- ], RunCmd.prototype, "runScript", void 0);
27
20
  RunCmd = __decorate([
28
21
  Command({
29
22
  name: "run",
@@ -46,4 +39,3 @@ RunCmd = __decorate([
46
39
  })
47
40
  ], RunCmd);
48
41
  export { RunCmd };
49
- //# sourceMappingURL=RunCmd.js.map
@@ -1,5 +1,5 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { CliPackageJson, Command, createSubTasks, Inject, NpmRegistryClient, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
1
+ import { __decorate } from "tslib";
2
+ import { CliPackageJson, Command, createSubTasks, Inject, inject, NpmRegistryClient, PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { getValue } from "@tsed/core";
4
4
  import semver from "semver";
5
5
  import { IGNORE_TAGS, IGNORE_VERSIONS, MINIMAL_TSED_VERSION } from "../../constants/index.js";
@@ -15,6 +15,12 @@ function shouldUpdate(pkg) {
15
15
  return pkg.includes("@tsed") && !pkg.includes("@tsed/cli") && !pkg.includes("@tsed/logger");
16
16
  }
17
17
  let UpdateCmd = class UpdateCmd {
18
+ constructor() {
19
+ this.npmRegistryClient = inject(NpmRegistryClient);
20
+ this.projectPackage = inject(ProjectPackageJson);
21
+ this.packageManagers = inject(PackageManagersModule);
22
+ this.cliPackage = inject(CliPackageJson);
23
+ }
18
24
  async $prompt(initialOptions) {
19
25
  const versions = await this.getAvailableVersions();
20
26
  return [
@@ -92,22 +98,6 @@ let UpdateCmd = class UpdateCmd {
92
98
  return version && isGreaterThan(version, this.cliPackage.version) ? version : this.cliPackage.version;
93
99
  }
94
100
  };
95
- __decorate([
96
- Inject(NpmRegistryClient),
97
- __metadata("design:type", NpmRegistryClient)
98
- ], UpdateCmd.prototype, "npmRegistryClient", void 0);
99
- __decorate([
100
- Inject(ProjectPackageJson),
101
- __metadata("design:type", ProjectPackageJson)
102
- ], UpdateCmd.prototype, "projectPackage", void 0);
103
- __decorate([
104
- Inject(PackageManagersModule),
105
- __metadata("design:type", PackageManagersModule)
106
- ], UpdateCmd.prototype, "packageManagers", void 0);
107
- __decorate([
108
- CliPackageJson(),
109
- __metadata("design:type", Object)
110
- ], UpdateCmd.prototype, "cliPackage", void 0);
111
101
  UpdateCmd = __decorate([
112
102
  Command({
113
103
  name: "update",
@@ -117,4 +107,3 @@ UpdateCmd = __decorate([
117
107
  })
118
108
  ], UpdateCmd);
119
109
  export { UpdateCmd };
120
- //# sourceMappingURL=UpdateCmd.js.map
@@ -4,9 +4,8 @@ const { path, packageJson } = readPackageUpSync({
4
4
  cwd: join(import.meta.dirname, "..", "..")
5
5
  });
6
6
  export const PKG = packageJson;
7
- export const MINIMAL_TSED_VERSION = "7";
8
- export const DEFAULT_TSED_TAGS = "latest";
7
+ export const MINIMAL_TSED_VERSION = "8";
8
+ export const DEFAULT_TSED_TAGS = "beta";
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
@@ -3,4 +3,3 @@ export var ArchitectureConvention;
3
3
  ArchitectureConvention["DEFAULT"] = "arc_default";
4
4
  ArchitectureConvention["FEATURE"] = "feature";
5
5
  })(ArchitectureConvention || (ArchitectureConvention = {}));
6
- //# sourceMappingURL=ArchitectureConvention.js.map
@@ -3,4 +3,3 @@ export var PlatformType;
3
3
  PlatformType["EXPRESS"] = "express";
4
4
  PlatformType["KOA"] = "koa";
5
5
  })(PlatformType || (PlatformType = {}));
6
- //# sourceMappingURL=PlatformType.js.map
@@ -3,4 +3,3 @@ export var ProjectConvention;
3
3
  ProjectConvention["DEFAULT"] = "conv_default";
4
4
  ProjectConvention["ANGULAR"] = "angular";
5
5
  })(ProjectConvention || (ProjectConvention = {}));
6
- //# sourceMappingURL=ProjectConvention.js.map
@@ -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
@@ -7,4 +7,3 @@ export async function initialize(aliases) {
7
7
  export function resolve(specifier, context, nextResolve) {
8
8
  return resolver(specifier, context, nextResolve);
9
9
  }
10
- //# sourceMappingURL=alias.hook.js.map
@@ -1,11 +1,15 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Injectable, ProjectPackageJson } from "@tsed/cli-core";
3
- import { Inject } from "@tsed/di";
1
+ import { __decorate } from "tslib";
2
+ import { ProjectPackageJson } from "@tsed/cli-core";
3
+ import { inject, Injectable } from "@tsed/di";
4
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";
8
8
  let ClassNamePipe = class ClassNamePipe {
9
+ constructor() {
10
+ this.providers = inject(ProvidersInfoService);
11
+ this.projectPackageJson = inject(ProjectPackageJson);
12
+ }
9
13
  transform(options) {
10
14
  const format = options.format || this.projectPackageJson.preferences.convention || ProjectConvention.DEFAULT;
11
15
  const meta = this.providers.get(options.type)?.model || "{{symbolName}}.{{symbolType}}?";
@@ -26,16 +30,7 @@ let ClassNamePipe = class ClassNamePipe {
26
30
  return [...names].join(".").toLowerCase();
27
31
  }
28
32
  };
29
- __decorate([
30
- Inject(),
31
- __metadata("design:type", ProvidersInfoService)
32
- ], ClassNamePipe.prototype, "providers", void 0);
33
- __decorate([
34
- Inject(),
35
- __metadata("design:type", ProjectPackageJson)
36
- ], ClassNamePipe.prototype, "projectPackageJson", void 0);
37
33
  ClassNamePipe = __decorate([
38
34
  Injectable()
39
35
  ], ClassNamePipe);
40
36
  export { ClassNamePipe };
41
- //# sourceMappingURL=ClassNamePipe.js.map
@@ -1,13 +1,15 @@
1
- import { __decorate, __metadata } from "tslib";
2
- import { Injectable, ProjectPackageJson } from "@tsed/cli-core";
1
+ import { __decorate } from "tslib";
2
+ import { inject, Injectable, ProjectPackageJson } from "@tsed/cli-core";
3
3
  import { Inject } from "@tsed/di";
4
4
  import { dirname, join } from "path";
5
5
  import { ArchitectureConvention, ProjectConvention } from "../interfaces/index.js";
6
6
  import { ProvidersInfoService } from "../services/ProvidersInfoService.js";
7
7
  import { ClassNamePipe } from "./ClassNamePipe.js";
8
8
  let OutputFilePathPipe = class OutputFilePathPipe {
9
- constructor(classNamePipe) {
10
- this.classNamePipe = classNamePipe;
9
+ constructor() {
10
+ this.providers = inject(ProvidersInfoService);
11
+ this.projectPackageJson = inject(ProjectPackageJson);
12
+ this.classNamePipe = inject(ClassNamePipe);
11
13
  }
12
14
  transform(options) {
13
15
  options.format = options.format || this.projectPackageJson.preferences.convention || ProjectConvention.DEFAULT;
@@ -19,17 +21,7 @@ let OutputFilePathPipe = class OutputFilePathPipe {
19
21
  return join(baseDir, options.subDir || "", featureDir, this.classNamePipe.transform(options));
20
22
  }
21
23
  };
22
- __decorate([
23
- Inject(),
24
- __metadata("design:type", ProvidersInfoService)
25
- ], OutputFilePathPipe.prototype, "providers", void 0);
26
- __decorate([
27
- Inject(),
28
- __metadata("design:type", ProjectPackageJson)
29
- ], OutputFilePathPipe.prototype, "projectPackageJson", void 0);
30
24
  OutputFilePathPipe = __decorate([
31
- Injectable(),
32
- __metadata("design:paramtypes", [ClassNamePipe])
25
+ Injectable()
33
26
  ], OutputFilePathPipe);
34
27
  export { OutputFilePathPipe };
35
- //# sourceMappingURL=OutputFilePathPipe.js.map
@@ -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
@@ -1,11 +1,11 @@
1
- import { __decorate, __metadata, __param } from "tslib";
2
- import { Inject } from "@tsed/cli-core";
1
+ import { __decorate } from "tslib";
2
+ import { Inject, injectMany } from "@tsed/cli-core";
3
3
  import { Module } from "@tsed/di";
4
4
  import { InitExpressPlatform } from "./supports/InitExpressPlatform.js";
5
5
  import { InitKoaPlatform } from "./supports/InitKoaPlatform.js";
6
6
  let InitPlatformsModule = class InitPlatformsModule {
7
- constructor(platforms) {
8
- this.platforms = platforms;
7
+ constructor() {
8
+ this.platforms = injectMany("platform:init");
9
9
  }
10
10
  get(name) {
11
11
  return this.platforms.find((platform) => platform.name === name);
@@ -14,9 +14,6 @@ let InitPlatformsModule = class InitPlatformsModule {
14
14
  InitPlatformsModule = __decorate([
15
15
  Module({
16
16
  imports: [InitExpressPlatform, InitKoaPlatform]
17
- }),
18
- __param(0, Inject("platform:init")),
19
- __metadata("design:paramtypes", [Array])
17
+ })
20
18
  ], InitPlatformsModule);
21
19
  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
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata, __param } from "tslib";
2
2
  import { PackageManagersModule, ProjectPackageJson } from "@tsed/cli-core";
3
- import { Inject, Module } from "@tsed/di";
3
+ import { Inject, inject, Module } from "@tsed/di";
4
4
  import { BabelRuntime } from "./supports/BabelRuntime.js";
5
5
  import { BaseRuntime } from "./supports/BaseRuntime.js";
6
6
  import { BunRuntime } from "./supports/BunRuntime.js";
@@ -9,6 +9,8 @@ import { WebpackRuntime } from "./supports/WebpackRuntime.js";
9
9
  let RuntimesModule = class RuntimesModule {
10
10
  constructor(runtimes) {
11
11
  this.runtimes = runtimes;
12
+ this.projectPackageJson = inject(ProjectPackageJson);
13
+ this.packagesManager = inject(PackageManagersModule);
12
14
  this.runtimes = runtimes.filter((manager) => manager.has());
13
15
  }
14
16
  init(ctx) {
@@ -42,14 +44,6 @@ let RuntimesModule = class RuntimesModule {
42
44
  };
43
45
  }
44
46
  };
45
- __decorate([
46
- Inject(),
47
- __metadata("design:type", ProjectPackageJson)
48
- ], RuntimesModule.prototype, "projectPackageJson", void 0);
49
- __decorate([
50
- Inject(),
51
- __metadata("design:type", PackageManagersModule)
52
- ], RuntimesModule.prototype, "packagesManager", void 0);
53
47
  RuntimesModule = __decorate([
54
48
  Module({
55
49
  imports: [NodeRuntime, BabelRuntime, WebpackRuntime, BunRuntime]
@@ -58,4 +52,3 @@ RuntimesModule = __decorate([
58
52
  __metadata("design:paramtypes", [Array])
59
53
  ], RuntimesModule);
60
54
  export { RuntimesModule };
61
- //# 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
@@ -45,4 +45,3 @@ BabelRuntime = __decorate([
45
45
  })
46
46
  ], BabelRuntime);
47
47
  export { BabelRuntime };
48
- //# sourceMappingURL=BabelRuntime.js.map
@@ -41,4 +41,3 @@ __decorate([
41
41
  Inject(CliExeca),
42
42
  __metadata("design:type", CliExeca)
43
43
  ], BaseRuntime.prototype, "cliExeca", void 0);
44
- //# sourceMappingURL=BaseRuntime.js.map
@@ -29,4 +29,3 @@ BunRuntime = __decorate([
29
29
  })
30
30
  ], BunRuntime);
31
31
  export { BunRuntime };
32
- //# sourceMappingURL=BunRuntime.js.map
@@ -41,4 +41,3 @@ NodeRuntime = __decorate([
41
41
  })
42
42
  ], NodeRuntime);
43
43
  export { NodeRuntime };
44
- //# sourceMappingURL=NodeRuntime.js.map
@@ -36,4 +36,3 @@ WebpackRuntime = __decorate([
36
36
  })
37
37
  ], WebpackRuntime);
38
38
  export { WebpackRuntime };
39
- //# sourceMappingURL=WebpackRuntime.js.map
@@ -44,4 +44,3 @@ ProvidersInfoService = __decorate([
44
44
  Injectable()
45
45
  ], ProvidersInfoService);
46
46
  export { ProvidersInfoService };
47
- //# sourceMappingURL=ProvidersInfoService.js.map
@@ -13,6 +13,7 @@ export function fillImports(ctx) {
13
13
  ctx.graphql && "./src/resolvers"
14
14
  ].filter(Boolean));
15
15
  ctx.imports = [
16
+ { from: "@tsed/platform-log-request", comment: " // remove this import if you don't want log request" },
16
17
  ctx.express && { from: "@tsed/platform-express", comment: " // /!\\ keep this import" },
17
18
  ctx.koa && { from: "@tsed/platform-koa", comment: " // /!\\ keep this import" },
18
19
  { from: "@tsed/ajv" },
@@ -33,4 +34,3 @@ export function fillImports(ctx) {
33
34
  ].filter(Boolean);
34
35
  return ctx;
35
36
  }
36
- //# sourceMappingURL=fillImports.js.map