@tsed/cli 6.1.13 → 6.1.14

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.
@@ -1,9 +1,10 @@
1
- import { type CliDefaultOptions, type CommandProvider, ProjectPackageJson, SrcRendererService } from "@tsed/cli-core";
1
+ import { type CliDefaultOptions, type CommandProvider, ProjectPackageJson } from "@tsed/cli-core";
2
2
  import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
3
3
  import { ClassNamePipe } from "../../pipes/ClassNamePipe.js";
4
4
  import { OutputFilePathPipe } from "../../pipes/OutputFilePathPipe.js";
5
5
  import { RoutePipe } from "../../pipes/RoutePipe.js";
6
6
  import { ProvidersInfoService } from "../../services/ProvidersInfoService.js";
7
+ import { SrcRendererService } from "../../services/Renderer.js";
7
8
  export interface GenerateCmdContext extends CliDefaultOptions {
8
9
  type: string;
9
10
  name: string;
@@ -1,7 +1,8 @@
1
- import { CliExeca, CliFs, CliLoadFile, CliPlugins, CliService, type CommandProvider, PackageManagersModule, ProjectPackageJson, type QuestionOptions, RootRendererService, type Task } from "@tsed/cli-core";
1
+ import { CliExeca, CliFs, CliLoadFile, CliPlugins, CliService, type CommandProvider, PackageManagersModule, ProjectPackageJson, type QuestionOptions, type Task } from "@tsed/cli-core";
2
2
  import { OutputFilePathPipe } from "../../pipes/OutputFilePathPipe.js";
3
3
  import { InitPlatformsModule } from "../../platforms/InitPlatformsModule.js";
4
4
  import { RuntimesModule } from "../../runtimes/RuntimesModule.js";
5
+ import { RootRendererService } from "../../services/Renderer.js";
5
6
  import type { InitCmdContext } from "./interfaces/InitCmdContext.js";
6
7
  import type { InitOptions } from "./interfaces/InitOptions.js";
7
8
  export declare class InitCmd implements CommandProvider {
@@ -1,4 +1,5 @@
1
- import { CliFs, CliRunScript, type CommandProvider, ProjectPackageJson, type Tasks } from "@tsed/cli-core";
1
+ import { CliFs, type CommandProvider, ProjectPackageJson, type Tasks } from "@tsed/cli-core";
2
+ import { CliRunScript } from "../../services/CliRunScript.js";
2
3
  export interface RunCmdContext {
3
4
  production: boolean;
4
5
  command: string;
@@ -13,3 +13,4 @@ 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
+ export * from "./services/Renderer.js";
@@ -0,0 +1,3 @@
1
+ export declare class CliRunScript {
2
+ run(cmd: string, args: string[], options?: any): Promise<any>;
3
+ }
@@ -0,0 +1,44 @@
1
+ import "../utils/hbs/index.js";
2
+ import { CliFs } from "@tsed/cli-core";
3
+ import { Observable } from "rxjs";
4
+ export interface RenderOptions {
5
+ path: string;
6
+ templateDir: string;
7
+ rootDir: string;
8
+ output: string;
9
+ baseDir: string;
10
+ basename: string;
11
+ replaces?: string[];
12
+ }
13
+ export declare abstract class Renderer {
14
+ templateDir: string;
15
+ readonly fs: CliFs;
16
+ readonly cache: Set<string>;
17
+ abstract get rootDir(): string;
18
+ loadPartials(cwd: string): Promise<void>;
19
+ render(path: string, data: any, options?: Partial<RenderOptions>): Promise<void>;
20
+ renderAll(paths: (string | RenderOptions)[], data: any, options?: Partial<RenderOptions>): Observable<unknown>;
21
+ write(content: string, options: any): Promise<void>;
22
+ templateExists(path: string, options?: Partial<RenderOptions>): boolean;
23
+ scan(pattern: string[], options?: any): Promise<string[]>;
24
+ relativeFrom(path: string): string;
25
+ update(path: string, actions: {
26
+ type?: string;
27
+ content: string;
28
+ pattern?: RegExp;
29
+ }[]): Promise<void>;
30
+ protected mapOptions(path: string, options: Partial<RenderOptions>): {
31
+ output: string;
32
+ templateDir: string;
33
+ rootDir: string;
34
+ };
35
+ }
36
+ export declare class RootRendererService extends Renderer {
37
+ get rootDir(): string;
38
+ }
39
+ export declare class SrcRendererService extends Renderer {
40
+ get rootDir(): string;
41
+ }
42
+ export declare class ScriptsRendererService extends Renderer {
43
+ get rootDir(): string;
44
+ }
@@ -0,0 +1 @@
1
+ export declare const helpers: any;
@@ -0,0 +1 @@
1
+ export declare const helpers: any;
@@ -0,0 +1 @@
1
+ export declare const helpers: any;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare const helpers: any;
@@ -0,0 +1 @@
1
+ export declare const helpers: any;
@@ -0,0 +1 @@
1
+ export declare function insertAfter(fileContent: string, content: string, pattern: RegExp): string;
@@ -0,0 +1 @@
1
+ export declare function insertImport(fileContent: string, content: string): string;
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": "6.1.13",
4
+ "version": "6.1.14",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -63,10 +63,11 @@
63
63
  "node": ">=14"
64
64
  },
65
65
  "dependencies": {
66
+ "@npmcli/run-script": "9.0.0",
66
67
  "@swc-node/register": "^1.10.9",
67
68
  "@swc/core": "1.7.26",
68
69
  "@swc/helpers": "^0.5.13",
69
- "@tsed/cli-core": "6.1.13",
70
+ "@tsed/cli-core": "6.1.14",
70
71
  "@tsed/core": ">=8.0.0",
71
72
  "@tsed/di": ">=8.0.0",
72
73
  "@tsed/hooks": ">=8.0.0",
@@ -75,14 +76,19 @@
75
76
  "@tsed/schema": ">=8.0.0",
76
77
  "chalk": "^5.3.0",
77
78
  "change-case": "^5.4.4",
79
+ "consolidate": "^1.0.4",
80
+ "create-frame": "^1.0.0",
78
81
  "globby": "^14.0.2",
82
+ "handlebars": "^4.7.8",
83
+ "handlebars-utils": "^1.0.6",
79
84
  "read-pkg-up": "^11.0.0",
80
85
  "semver": "^7.6.3",
81
86
  "tslib": "^2.7.0"
82
87
  },
83
88
  "devDependencies": {
84
- "@tsed/typescript": "6.1.13",
89
+ "@tsed/typescript": "6.1.14",
85
90
  "@types/change-case": "^2.3.1",
91
+ "@types/consolidate": "0.14.4",
86
92
  "cross-env": "7.0.3",
87
93
  "typescript": "5.6.2",
88
94
  "vitest": "2.1.1"