@tsed/cli 7.0.0-beta.5 → 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.
@@ -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 {};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import "@swc-node/register/esm-register";
2
+ import "./ts-mode.js";
3
3
  import { register } from "node:module";
4
4
  import { join } from "node:path";
5
5
  import { pathToFileURL } from "node:url";
@@ -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
  });