@tsed/cli 7.0.0-alpha.9 → 7.0.0-beta.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.
@@ -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";
@@ -22,6 +22,7 @@ export declare class CliTemplatesService {
22
22
  #private;
23
23
  readonly rootDir: string;
24
24
  readonly fs: CliFs;
25
+ readonly renderedFiles: TemplateRenderReturnType[];
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.1",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -48,7 +48,7 @@
48
48
  "@swc-node/register": "^1.10.9",
49
49
  "@swc/core": "1.7.26",
50
50
  "@swc/helpers": "^0.5.13",
51
- "@tsed/cli-core": "7.0.0-alpha.9",
51
+ "@tsed/cli-core": "7.0.0-beta.1",
52
52
  "@tsed/core": ">=8.17.3",
53
53
  "@tsed/di": ">=8.17.3",
54
54
  "@tsed/hooks": ">=8.17.3",
@@ -70,7 +70,7 @@
70
70
  "tslib": "^2.7.0"
71
71
  },
72
72
  "devDependencies": {
73
- "@tsed/typescript": "7.0.0-alpha.9",
73
+ "@tsed/typescript": "7.0.0-beta.1",
74
74
  "@types/change-case": "^2.3.1",
75
75
  "@types/consolidate": "0.14.4",
76
76
  "cross-env": "7.0.3",
@@ -117,6 +117,6 @@
117
117
  "author": "Romain Lenzotti",
118
118
  "license": "MIT",
119
119
  "publishConfig": {
120
- "tag": "alpha"
120
+ "tag": "beta"
121
121
  }
122
122
  }
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
- }