@tsed/cli 7.0.0-alpha.9 → 7.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.
@@ -4,5 +4,5 @@ import { InitCmd } from "./init/InitCmd.js";
4
4
  import { RunCmd } from "./run/RunCmd.js";
5
5
  import { CreateTemplateCommand } from "./template/CreateTemplateCommand.js";
6
6
  import { UpdateCmd } from "./update/UpdateCmd.js";
7
- declare const _default: (typeof AddCmd | typeof GenerateCmd | typeof InitCmd | typeof UpdateCmd | typeof CreateTemplateCommand | typeof RunCmd)[];
7
+ declare const _default: (typeof CreateTemplateCommand | typeof AddCmd | typeof GenerateCmd | typeof InitCmd | typeof RunCmd | typeof UpdateCmd)[];
8
8
  export default _default;
@@ -1,7 +1,8 @@
1
+ import "@tsed/logger-std";
1
2
  import "./templates/index.js";
2
- export * from "./Cli.js";
3
3
  export * from "./commands/add/AddCmd.js";
4
4
  export * from "./commands/generate/GenerateCmd.js";
5
+ export { default as commands } from "./commands/index.js";
5
6
  export * from "./commands/init/config/FeaturesPrompt.js";
6
7
  export * from "./commands/init/config/FeaturesPrompt.js";
7
8
  export * from "./commands/init/InitCmd.js";
@@ -17,3 +18,4 @@ export * from "./services/CliProjectService.js";
17
18
  export * from "./services/CliTemplatesService.js";
18
19
  export * from "./services/ProjectClient.js";
19
20
  export * from "./utils/defineTemplate.js";
21
+ export { CliCore } from "@tsed/cli-core";
@@ -4,7 +4,7 @@ import { CliTemplatesService, type TemplateRenderOptions, type TemplateRenderRet
4
4
  export declare class CliProjectService {
5
5
  readonly templates: CliTemplatesService;
6
6
  private project;
7
- private rootDir;
7
+ get rootDir(): string;
8
8
  get srcDir(): string;
9
9
  getRelativePath(path: string): string;
10
10
  getServerFileName(): "server" | "Server";
@@ -20,8 +20,9 @@ export type TemplateRenderReturnType = {
20
20
  };
21
21
  export declare class CliTemplatesService {
22
22
  #private;
23
- readonly rootDir: string;
24
23
  readonly fs: CliFs;
24
+ readonly renderedFiles: TemplateRenderReturnType[];
25
+ get rootDir(): string;
25
26
  get srcDir(): string;
26
27
  get templatesDir(): string;
27
28
  $onInit(): Promise<void>;
@@ -30,4 +31,5 @@ export declare class CliTemplatesService {
30
31
  find(id?: string): any[];
31
32
  get(id: string): any;
32
33
  render(templateId: string, data: TemplateRenderOptions): Promise<TemplateRenderReturnType | undefined>;
34
+ protected pushRenderResult(renderedFile: TemplateRenderReturnType): TemplateRenderReturnType;
33
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli",
3
3
  "description": "CLI to bootstrap your Ts.ED project",
4
- "version": "7.0.0-alpha.9",
4
+ "version": "7.0.0-beta.2",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -22,10 +22,12 @@
22
22
  "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
23
23
  },
24
24
  "bin": {
25
- "tsed": "lib/esm/bin/tsed.js"
25
+ "tsed": "lib/esm/bin/tsed.js",
26
+ "tsed-mcp": "lib/esm/bin/tsed-mcp.js"
26
27
  },
27
28
  "files": [
28
29
  "lib/esm/bin/tsed.js",
30
+ "lib/esm/bin/tsed-mcp.js",
29
31
  "lib/esm/bin",
30
32
  "lib",
31
33
  "templates"
@@ -48,21 +50,22 @@
48
50
  "@swc-node/register": "^1.10.9",
49
51
  "@swc/core": "1.7.26",
50
52
  "@swc/helpers": "^0.5.13",
51
- "@tsed/cli-core": "7.0.0-alpha.9",
52
- "@tsed/core": ">=8.17.3",
53
- "@tsed/di": ">=8.17.3",
54
- "@tsed/hooks": ">=8.17.3",
53
+ "@tsed/cli-core": "7.0.0-beta.2",
54
+ "@tsed/core": ">=8.18.0",
55
+ "@tsed/di": ">=8.18.0",
56
+ "@tsed/hooks": ">=8.18.0",
55
57
  "@tsed/logger": ">=8.0.3",
56
58
  "@tsed/logger-std": ">=8.0.3",
57
- "@tsed/normalize-path": ">=8.17.3",
58
- "@tsed/openspec": ">=8.17.3",
59
- "@tsed/schema": ">=8.17.3",
59
+ "@tsed/normalize-path": ">=8.18.0",
60
+ "@tsed/openspec": ">=8.18.0",
61
+ "@tsed/schema": ">=8.18.0",
60
62
  "chalk": "^5.3.0",
61
63
  "change-case": "^5.4.4",
62
64
  "consolidate": "^1.0.4",
63
65
  "create-frame": "^1.0.0",
64
66
  "fs-extra": "^11.2.0",
65
67
  "globby": "^14.0.2",
68
+ "json-schema-to-zod": "2.6.1",
66
69
  "read-pkg-up": "^11.0.0",
67
70
  "rxjs": "^7.8.1",
68
71
  "semver": "^7.6.3",
@@ -70,7 +73,7 @@
70
73
  "tslib": "^2.7.0"
71
74
  },
72
75
  "devDependencies": {
73
- "@tsed/typescript": "7.0.0-alpha.9",
76
+ "@tsed/typescript": "7.0.0-beta.2",
74
77
  "@types/change-case": "^2.3.1",
75
78
  "@types/consolidate": "0.14.4",
76
79
  "cross-env": "7.0.3",
@@ -117,6 +120,6 @@
117
120
  "author": "Romain Lenzotti",
118
121
  "license": "MIT",
119
122
  "publishConfig": {
120
- "tag": "alpha"
123
+ "tag": "beta"
121
124
  }
122
125
  }
package/lib/esm/Cli.js DELETED
@@ -1,58 +0,0 @@
1
- import "@tsed/logger-std";
2
- import "./templates/index.js";
3
- import { CliCore } from "@tsed/cli-core";
4
- import chalk from "chalk";
5
- import commands from "./commands/index.js";
6
- import { PKG, TEMPLATE_DIR } from "./constants/index.js";
7
- import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
8
- export class Cli extends CliCore {
9
- static { this.defaults = {
10
- name: "tsed",
11
- pkg: PKG,
12
- templateDir: TEMPLATE_DIR,
13
- plugins: true,
14
- commands,
15
- defaultProjectPreferences() {
16
- return {
17
- convention: ProjectConvention.DEFAULT,
18
- architecture: ArchitectureConvention.DEFAULT
19
- };
20
- },
21
- project: {
22
- reinstallAfterRun: true
23
- },
24
- logger: {
25
- level: "info"
26
- }
27
- }; }
28
- static checkPackage(pkg) {
29
- if (!pkg) {
30
- console.log(chalk.red(`settings.pkg is required. Require the package.json of your CLI when you bootstrap the CLI.`));
31
- process.exit(1);
32
- }
33
- }
34
- static checkName(name) {
35
- if (!name) {
36
- console.log(chalk.red(`settings.name is required. Add the name of your CLI.`));
37
- process.exit(1);
38
- }
39
- }
40
- static checkPrecondition(settings) {
41
- const { pkg } = settings;
42
- this.checkPackage(pkg);
43
- this.checkName(pkg.name);
44
- if (pkg?.engines?.node) {
45
- this.checkNodeVersion(pkg.engines.node, pkg.name);
46
- }
47
- }
48
- static async bootstrap(settings = {}) {
49
- const opts = {
50
- ...Cli.defaults,
51
- ...settings
52
- };
53
- const { pkg } = opts;
54
- this.checkPrecondition(opts);
55
- await this.updateNotifier(pkg);
56
- return super.bootstrap(opts, Cli);
57
- }
58
- }
@@ -1,27 +0,0 @@
1
- import "@tsed/logger-std";
2
- import "./templates/index.js";
3
- import { CliCore } from "@tsed/cli-core";
4
- import { ArchitectureConvention, ProjectConvention } from "./interfaces/index.js";
5
- export declare class Cli extends CliCore {
6
- static defaults: {
7
- name: string;
8
- pkg: import("read-pkg-up").NormalizedPackageJson;
9
- templateDir: string;
10
- plugins: boolean;
11
- commands: (typeof import("./index.js").AddCmd | typeof import("./index.js").GenerateCmd | typeof import("./index.js").InitCmd | typeof import("./index.js").UpdateCmd | typeof import("./commands/template/CreateTemplateCommand.js").CreateTemplateCommand | typeof import("./commands/run/RunCmd.js").RunCmd)[];
12
- defaultProjectPreferences(): {
13
- convention: ProjectConvention;
14
- architecture: ArchitectureConvention;
15
- };
16
- project: {
17
- reinstallAfterRun: boolean;
18
- };
19
- logger: {
20
- level: string;
21
- };
22
- };
23
- static checkPackage(pkg: any): void;
24
- static checkName(name: string): void;
25
- static checkPrecondition(settings: any): void;
26
- static bootstrap(settings?: any): Promise<CliCore>;
27
- }