create-fsaa 0.2.4 → 0.2.5

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/lib/init.mjs +8 -1
  2. package/package.json +1 -1
package/lib/init.mjs CHANGED
@@ -79,7 +79,14 @@ export async function initCmd({ flags, interactive }) {
79
79
  const win = process.platform === "win32";
80
80
  const pnpmBin = win ? "pnpm.cmd" : "pnpm";
81
81
  console.log("> installing dependencies (this may take a minute)…");
82
- let r = spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit", shell: win });
82
+ // With shell:true a missing pnpm does NOT set r.error — cmd.exe prints
83
+ // "'pnpm.cmd' is not recognized" and exits non-zero. Probe first so the
84
+ // npx fallback triggers on a real "pnpm missing", not on an install failure.
85
+ const probe = spawnSync(pnpmBin, ["--version"], { cwd: dest, stdio: "ignore", shell: win });
86
+ const pnpmMissing = Boolean(probe.error) || probe.status !== 0;
87
+ let r = pnpmMissing
88
+ ? { error: new Error("pnpm not found") }
89
+ : spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit", shell: win });
83
90
  if (r.error) {
84
91
  // pnpm missing from PATH — recover INSTEAD of nagging: run the pinned
85
92
  // version through npx (npx exists wherever this CLI already runs).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fsaa",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "FSAA \u2014 Feature-Sliced Atomic Architecture. Run `npm create fsaa` (this package) to scaffold an FSAA app from the official starter templates; `fsaa g <slice>` generates canonical slices.",
5
5
  "license": "MIT",
6
6
  "author": "Veaceslav Bezusco <Aramex86@users.noreply.github.com>",