create-fsaa 0.1.4 → 0.1.7
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/download.mjs +4 -3
- package/lib/init.mjs +9 -7
- package/package.json +1 -1
package/lib/download.mjs
CHANGED
|
@@ -53,13 +53,14 @@ function moveDir(src, dest) {
|
|
|
53
53
|
` (safeguard: refuse to overwrite; run fsaa in an empty or non-existent directory)`,
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
// fs-only move: rename first
|
|
57
|
-
//
|
|
56
|
+
// fs-only move: rename first, cpSync fallback for anything Windows throws at
|
|
57
|
+
// a freshly-extracted dir on rename (EXDEV cross-device, EPERM/EBUSY from an
|
|
58
|
+
// antivirus/indexing scan holding a handle). Copy-then-cleanup self-heals all.
|
|
58
59
|
try {
|
|
59
60
|
renameSync(src, dest);
|
|
60
61
|
return;
|
|
61
62
|
} catch (err) {
|
|
62
|
-
if (
|
|
63
|
+
if (!["EXDEV", "EPERM", "EACCES", "EBUSY", "ENOTEMPTY", "EISDIR"].includes(err?.code)) throw err;
|
|
63
64
|
}
|
|
64
65
|
cpSync(src, dest, { recursive: true });
|
|
65
66
|
rmSync(src, { recursive: true, force: true });
|
package/lib/init.mjs
CHANGED
|
@@ -65,17 +65,19 @@ export async function initCmd({ flags, interactive }) {
|
|
|
65
65
|
pkg.name = name;
|
|
66
66
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n");
|
|
67
67
|
|
|
68
|
-
// Windows: pnpm ships as pnpm.cmd
|
|
69
|
-
//
|
|
70
|
-
const
|
|
71
|
-
|
|
68
|
+
// Windows: pnpm ships as pnpm.cmd, and Node ≥18.20 REFUSES to spawn .cmd/.bat
|
|
69
|
+
// without the shell option (EINVAL). So: .cmd name + shell on win32.
|
|
70
|
+
const win = process.platform === "win32";
|
|
71
|
+
const pnpmBin = win ? "pnpm.cmd" : "pnpm";
|
|
72
|
+
console.log("> installing dependencies (this may take a minute)…");
|
|
73
|
+
let r = spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit", shell: win });
|
|
72
74
|
if (r.error) {
|
|
73
75
|
// pnpm missing from PATH — recover INSTEAD of nagging: run the pinned
|
|
74
76
|
// version through npx (npx exists wherever this CLI already runs).
|
|
75
|
-
const pinned = (pkg.packageManager || "pnpm@
|
|
76
|
-
const npxBin =
|
|
77
|
+
const pinned = (pkg.packageManager || "pnpm@10.34.9").split("@")[1] || "10.34.9";
|
|
78
|
+
const npxBin = win ? "npx.cmd" : "npx";
|
|
77
79
|
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" });
|
|
80
|
+
r = spawnSync(npxBin, ["-y", `pnpm@${pinned}`, "install"], { cwd: dest, stdio: "inherit", shell: win });
|
|
79
81
|
if (r.error) {
|
|
80
82
|
console.error(`\nfsaa: could not install dependencies automatically (npx unavailable).\n recover by hand: cd ${dest} && npm exec -y pnpm@${pinned} install`);
|
|
81
83
|
const e = new Error("install failed");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fsaa",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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>",
|