create-fsaa 0.2.4 → 0.2.6
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/init.mjs +14 -3
- package/package.json +1 -1
package/lib/init.mjs
CHANGED
|
@@ -28,8 +28,12 @@ export async function initCmd({ flags, interactive }) {
|
|
|
28
28
|
template = template || "next";
|
|
29
29
|
const manager = "pnpm"; // contract pin (single-lockfile rule lives on pnpm)
|
|
30
30
|
|
|
31
|
-
// wrong answers made impossible, not rejected: normalize
|
|
32
|
-
|
|
31
|
+
// wrong answers made impossible, not rejected: normalize the name ALWAYS —
|
|
32
|
+
// the old lowercase-only gate skipped names that pass `^[a-z0-9][a-z0-9._-]*$`
|
|
33
|
+
// yet still fail validation (trailing "-" / "." e.g. "my-app-") and names
|
|
34
|
+
// that would never turn kebab-case ("pay_on"). normalizeName is idempotent
|
|
35
|
+
// on already-valid names, so running it unconditionally changes nothing there.
|
|
36
|
+
if (typeof name === "string") {
|
|
33
37
|
const fixed = normalizeName(name);
|
|
34
38
|
if (fixed && fixed !== name) {
|
|
35
39
|
console.log(` (name normalized: ${name} -> ${fixed})`);
|
|
@@ -79,7 +83,14 @@ export async function initCmd({ flags, interactive }) {
|
|
|
79
83
|
const win = process.platform === "win32";
|
|
80
84
|
const pnpmBin = win ? "pnpm.cmd" : "pnpm";
|
|
81
85
|
console.log("> installing dependencies (this may take a minute)…");
|
|
82
|
-
|
|
86
|
+
// With shell:true a missing pnpm does NOT set r.error — cmd.exe prints
|
|
87
|
+
// "'pnpm.cmd' is not recognized" and exits non-zero. Probe first so the
|
|
88
|
+
// npx fallback triggers on a real "pnpm missing", not on an install failure.
|
|
89
|
+
const probe = spawnSync(pnpmBin, ["--version"], { cwd: dest, stdio: "ignore", shell: win });
|
|
90
|
+
const pnpmMissing = Boolean(probe.error) || probe.status !== 0;
|
|
91
|
+
let r = pnpmMissing
|
|
92
|
+
? { error: new Error("pnpm not found") }
|
|
93
|
+
: spawnSync(pnpmBin, ["install"], { cwd: dest, stdio: "inherit", shell: win });
|
|
83
94
|
if (r.error) {
|
|
84
95
|
// pnpm missing from PATH — recover INSTEAD of nagging: run the pinned
|
|
85
96
|
// 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.
|
|
3
|
+
"version": "0.2.6",
|
|
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>",
|