@cedarjs/cli-helpers 5.0.0-canary.2478 → 5.0.0-canary.2480

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.
@@ -48,4 +48,15 @@ export declare function runWorkspaceBin(workspace: string, bin: string, args?: s
48
48
  * - pnpm: `pnpm dlx <command> [args]`
49
49
  */
50
50
  export declare function dlx(command: string, args?: string[], options?: ExecaOptions): execa.ExecaChildProcess<string>;
51
+ /**
52
+ * Returns spawn-compatible `[cmd, args]` for running a node script through the
53
+ * current package manager. Use with `child_process.spawn` (not execa).
54
+ *
55
+ * Yarn PnP requires wrapping node via `yarn node` so module resolution works.
56
+ *
57
+ * - yarn: `yarn node <script>`
58
+ * - npm: `node <script>`
59
+ * - pnpm: `pnpm exec node <script>`
60
+ */
61
+ export declare function getNodeRunnerArgs(scriptPath: string): [string, string[]];
51
62
  //# sourceMappingURL=exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/packageManager/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,WAAW,IAAI,gBAAgB,EAChC,MAAM,OAAO,CAAA;AAId;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAWvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAsBvB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAc3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCASvB"}
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../../src/packageManager/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,WAAW,IAAI,gBAAgB,EAChC,MAAM,OAAO,CAAA;AAId;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAWvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAsBvB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAc3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCASvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAYxE"}
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var exec_exports = {};
30
30
  __export(exec_exports, {
31
31
  dlx: () => dlx,
32
+ getNodeRunnerArgs: () => getNodeRunnerArgs,
32
33
  runBin: () => runBin,
33
34
  runBinSync: () => runBinSync,
34
35
  runScript: () => runScript,
@@ -104,9 +105,20 @@ function dlx(command, args = [], options) {
104
105
  }
105
106
  return (0, import_execa.default)(pm, ["dlx", command, ...args], options);
106
107
  }
108
+ function getNodeRunnerArgs(scriptPath) {
109
+ const pm = (0, import_packageManager.getPackageManager)();
110
+ if (pm === "npm") {
111
+ return ["node", [scriptPath]];
112
+ }
113
+ if (pm === "pnpm") {
114
+ return ["pnpm", ["exec", "node", scriptPath]];
115
+ }
116
+ return ["yarn", ["node", scriptPath]];
117
+ }
107
118
  // Annotate the CommonJS export names for ESM import in node:
108
119
  0 && (module.exports = {
109
120
  dlx,
121
+ getNodeRunnerArgs,
110
122
  runBin,
111
123
  runBinSync,
112
124
  runScript,
@@ -48,4 +48,15 @@ export declare function runWorkspaceBin(workspace: string, bin: string, args?: s
48
48
  * - pnpm: `pnpm dlx <command> [args]`
49
49
  */
50
50
  export declare function dlx(command: string, args?: string[], options?: ExecaOptions): execa.ExecaChildProcess<string>;
51
+ /**
52
+ * Returns spawn-compatible `[cmd, args]` for running a node script through the
53
+ * current package manager. Use with `child_process.spawn` (not execa).
54
+ *
55
+ * Yarn PnP requires wrapping node via `yarn node` so module resolution works.
56
+ *
57
+ * - yarn: `yarn node <script>`
58
+ * - npm: `node <script>`
59
+ * - pnpm: `pnpm exec node <script>`
60
+ */
61
+ export declare function getNodeRunnerArgs(scriptPath: string): [string, string[]];
51
62
  //# sourceMappingURL=exec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/packageManager/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,WAAW,IAAI,gBAAgB,EAChC,MAAM,OAAO,CAAA;AAId;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAWvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAsBvB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAc3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCASvB"}
1
+ {"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/packageManager/exec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EACV,OAAO,IAAI,YAAY,EACvB,WAAW,IAAI,gBAAgB,EAChC,MAAM,OAAO,CAAA;AAId;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAWvB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAW3B;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAsBvB;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;GAEG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,gBAAgB,sCAc3B;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCAcvB;AAED;;;;;;GAMG;AACH,wBAAgB,GAAG,CACjB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,YAAY,mCASvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAYxE"}
@@ -65,8 +65,19 @@ function dlx(command, args = [], options) {
65
65
  }
66
66
  return execa(pm, ["dlx", command, ...args], options);
67
67
  }
68
+ function getNodeRunnerArgs(scriptPath) {
69
+ const pm = getPackageManager();
70
+ if (pm === "npm") {
71
+ return ["node", [scriptPath]];
72
+ }
73
+ if (pm === "pnpm") {
74
+ return ["pnpm", ["exec", "node", scriptPath]];
75
+ }
76
+ return ["yarn", ["node", scriptPath]];
77
+ }
68
78
  export {
69
79
  dlx,
80
+ getNodeRunnerArgs,
70
81
  runBin,
71
82
  runBinSync,
72
83
  runScript,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli-helpers",
3
- "version": "5.0.0-canary.2478",
3
+ "version": "5.0.0-canary.2480",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -95,8 +95,8 @@
95
95
  },
96
96
  "dependencies": {
97
97
  "@babel/core": "^7.26.10",
98
- "@cedarjs/project-config": "5.0.0-canary.2478",
99
- "@cedarjs/telemetry": "5.0.0-canary.2478",
98
+ "@cedarjs/project-config": "5.0.0-canary.2480",
99
+ "@cedarjs/telemetry": "5.0.0-canary.2480",
100
100
  "@listr2/prompt-adapter-enquirer": "4.2.1",
101
101
  "@opentelemetry/api": "1.9.1",
102
102
  "ansis": "4.2.0",
@@ -115,7 +115,7 @@
115
115
  "yargs-parser": "21.1.1"
116
116
  },
117
117
  "devDependencies": {
118
- "@cedarjs/framework-tools": "5.0.0-canary.2478",
118
+ "@cedarjs/framework-tools": "5.0.0-canary.2480",
119
119
  "@types/dotenv-defaults": "^5.0.0",
120
120
  "@types/lodash": "4.17.24",
121
121
  "@types/pascalcase": "1.0.3",