create-nexusts 0.7.0 → 0.7.1

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.
Files changed (2) hide show
  1. package/index.js +24 -7
  2. 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
- // Run @nexusts/core init in the target directory.
79
- const initArgs = ["@nexusts/core", "init", "--no-interaction", ...args.slice(1)];
80
- const child = spawn(runner, initArgs, {
81
- cwd: target,
82
- stdio: "inherit",
83
- shell: process.platform === "win32",
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nexusts",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Scaffold a new NexusTS project — npm create nexusts@latest, bunx create-nexusts, or npx create-nexusts",
5
5
  "bin": {
6
6
  "create-nexusts": "index.js"