@tsed/cli 7.0.0-beta.4 → 7.0.0-beta.6
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.
- package/lib/esm/bin/ts-mode.js +10 -0
- package/lib/esm/bin/tsed.js +1 -1
- package/lib/esm/commands/init/config/InitSchema.js +1 -1
- package/lib/esm/commands/mcp/schema/InitMCPSchema.js +1 -1
- package/lib/esm/commands/mcp/tools/initProjectTool.js +0 -1
- package/lib/esm/commands/run/RunCmd.js +2 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/bin/ts-mode.d.ts +1 -0
- package/lib/types/bin/tsed.d.ts +1 -1
- package/lib/types/commands/mcp/tools/generateTool.d.ts +39 -17
- package/lib/types/commands/mcp/tools/getTemplateTool.d.ts +39 -17
- package/lib/types/commands/mcp/tools/initProjectTool.d.ts +39 -17
- package/lib/types/commands/mcp/tools/listTemplatesTool.d.ts +39 -17
- package/lib/types/commands/mcp/tools/setWorkspaceTool.d.ts +39 -17
- package/package.json +10 -9
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
if (process.env.CLI_MODE === "ts") {
|
|
2
|
+
try {
|
|
3
|
+
await import("@swc-node/register/esm-register");
|
|
4
|
+
}
|
|
5
|
+
catch (error) {
|
|
6
|
+
console.error("CLI_MODE=ts requires '@swc-node/register'. Install it and @swc/core to continue.");
|
|
7
|
+
process.env.CLI_MODE = undefined;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export {};
|
package/lib/esm/bin/tsed.js
CHANGED
|
@@ -7,7 +7,7 @@ import { RuntimesModule } from "../../../runtimes/RuntimesModule.js";
|
|
|
7
7
|
import { FeaturesMap, FeatureType } from "../../init/config/FeaturesPrompt.js";
|
|
8
8
|
export const InitSchema = () => s
|
|
9
9
|
.object({
|
|
10
|
-
root: s.string().
|
|
10
|
+
root: s.string().description("Current working directory to initialize Ts.ED project").default("."),
|
|
11
11
|
projectName: s
|
|
12
12
|
.string()
|
|
13
13
|
.optional()
|
|
@@ -5,5 +5,5 @@ export const InitMCPSchema = () => {
|
|
|
5
5
|
.object({
|
|
6
6
|
cwd: s.string().required().description("Current working directory to initialize Ts.ED project")
|
|
7
7
|
})
|
|
8
|
-
.merge(InitSchema().omit("root", "
|
|
8
|
+
.merge(InitSchema().omit("root", "skipPrompt", "file"));
|
|
9
9
|
};
|
|
@@ -40,7 +40,6 @@ export const initProjectTool = defineTool({
|
|
|
40
40
|
skipPrompt: true,
|
|
41
41
|
...input
|
|
42
42
|
};
|
|
43
|
-
cliService.load();
|
|
44
43
|
await cliService.exec("init", initialOptions, context());
|
|
45
44
|
// Collect rendered files from templates service (same pattern as generateTool)
|
|
46
45
|
const rendered = templates.getRenderedFiles();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliFs, command, inject, normalizePath, ProjectPackageJson } from "@tsed/cli-core";
|
|
2
|
+
import { logger } from "@tsed/di";
|
|
2
3
|
import { CliRunScript } from "../../services/CliRunScript.js";
|
|
3
4
|
export class RunCmd {
|
|
4
5
|
constructor() {
|
|
@@ -10,6 +11,7 @@ export class RunCmd {
|
|
|
10
11
|
const cmd = "node";
|
|
11
12
|
const args = ["--import", "@swc-node/register/esm-register"];
|
|
12
13
|
const path = normalizePath("src/bin/index.ts");
|
|
14
|
+
logger().info(`Run ${cmd} ${[...args, path, ctx.command, ...ctx.rawArgs].join(" ")}`);
|
|
13
15
|
await this.runScript.run(cmd, [...args, path, ctx.command, ...ctx.rawArgs], {
|
|
14
16
|
env: process.env
|
|
15
17
|
});
|