create-nexusts 0.7.0 → 0.7.2
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/index.js +24 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -75,13 +75,30 @@ console.log(`\n ✦ Scaffolding ${name}...\n`);
|
|
|
75
75
|
const isBun = typeof Bun !== "undefined";
|
|
76
76
|
const runner = isBun ? "bunx" : "npx";
|
|
77
77
|
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
// Determine if we're running inside the monorepo (local development).
|
|
79
|
+
// If so, use the local CLI directly instead of downloading from npm.
|
|
80
|
+
const monorepoRoot = resolve(import.meta.dirname, "..", "..");
|
|
81
|
+
const cliEntry = join(monorepoRoot, "packages", "cli", "src", "index.ts");
|
|
82
|
+
const isLocalDev = existsSync(cliEntry);
|
|
83
|
+
|
|
84
|
+
let child;
|
|
85
|
+
if (isLocalDev) {
|
|
86
|
+
// Local dev: run the CLI directly from the monorepo.
|
|
87
|
+
const initArgs = ["init", "--no-interaction", ...args.slice(1)];
|
|
88
|
+
child = spawn(process.argv[0], [cliEntry, ...initArgs], {
|
|
89
|
+
cwd: target,
|
|
90
|
+
stdio: "inherit",
|
|
91
|
+
shell: process.platform === "win32",
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
// Published: run @nexusts/cli init via the package runner.
|
|
95
|
+
const initArgs = ["@nexusts/cli", "init", "--no-interaction", ...args.slice(1)];
|
|
96
|
+
child = spawn(runner, initArgs, {
|
|
97
|
+
cwd: target,
|
|
98
|
+
stdio: "inherit",
|
|
99
|
+
shell: process.platform === "win32",
|
|
100
|
+
});
|
|
101
|
+
}
|
|
85
102
|
|
|
86
103
|
child.on("exit", (code) => {
|
|
87
104
|
if (code === 0) {
|