create-fsaa 0.1.2 → 0.1.4

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/lib/cli.mjs CHANGED
@@ -84,8 +84,9 @@ export async function run(argv) {
84
84
  return 0;
85
85
  default:
86
86
  if (!cmd) {
87
- console.log(HELP);
88
- return 0;
87
+ // `npm create fsaa@latest` invokes the bin with NO arguments — the
88
+ // create-* convention is that this STARTS the scaffold, like create-vite.
89
+ return initCmd({ flags, interactive: isInteractive() });
89
90
  }
90
91
  return unknown(cmd);
91
92
  }
package/lib/init.mjs CHANGED
@@ -68,12 +68,20 @@ export async function initCmd({ flags, interactive }) {
68
68
  // Windows: pnpm ships as pnpm.cmd; spawning a bare "pnpm" on win32 fails
69
69
  // (Node ≥18.20 refuses .cmd/.bat without shell). Use the .cmd shim there.
70
70
  const pnpmBin = process.platform === "win32" ? "pnpm.cmd" : "pnpm";
71
- console.log("> installing dependencies (this may take a minute)…");
72
- const r = spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit" });
71
+ let r = spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit" });
73
72
  if (r.error) {
74
- console.error('\nfsaa: pnpm not found on PATH — the FSAA contract pins pnpm.');
75
- console.error(' enable it: corepack enable pnpm or: npm i -g pnpm');
76
- return 1;
73
+ // pnpm missing from PATH — recover INSTEAD of nagging: run the pinned
74
+ // version through npx (npx exists wherever this CLI already runs).
75
+ const pinned = (pkg.packageManager || "pnpm@9.15.0").split("@")[1] || "9.15.0";
76
+ const npxBin = process.platform === "win32" ? "npx.cmd" : "npx";
77
+ console.log(` pnpm not on PATH — running the pinned pnpm@${pinned} through npx…`);
78
+ r = spawnSync(npxBin, ["-y", `pnpm@${pinned}`, "install"], { cwd: dest, stdio: "inherit" });
79
+ if (r.error) {
80
+ console.error(`\nfsaa: could not install dependencies automatically (npx unavailable).\n recover by hand: cd ${dest} && npm exec -y pnpm@${pinned} install`);
81
+ const e = new Error("install failed");
82
+ e.userError = true;
83
+ throw e;
84
+ }
77
85
  }
78
86
  if (r.status !== 0) {
79
87
  console.error(`fsaa: dependency install failed — the template files are in place.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fsaa",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
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>",