create-omnify 0.0.1 → 0.0.2
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/index.mjs +12 -3
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -71,13 +71,22 @@ run(`git clone --branch ${ref} --depth 1 ${REPO} ${projectDir}`);
|
|
|
71
71
|
// Clean git history — fresh start
|
|
72
72
|
rmSync(resolve(projectDir, ".git"), { recursive: true, force: true });
|
|
73
73
|
|
|
74
|
+
// ── Detect package manager ───────────────────────────────────
|
|
75
|
+
function detectPM() {
|
|
76
|
+
const ua = process.env.npm_config_user_agent || "";
|
|
77
|
+
if (ua.startsWith("pnpm")) return "pnpm";
|
|
78
|
+
if (ua.startsWith("yarn")) return "yarn";
|
|
79
|
+
return "npm";
|
|
80
|
+
}
|
|
81
|
+
const pm = detectPM();
|
|
82
|
+
|
|
74
83
|
// ── Install ─────────────────────────────────────────────────
|
|
75
84
|
log("Running composer install...");
|
|
76
85
|
run("composer install --no-interaction --no-scripts", { cwd: projectDir });
|
|
77
86
|
run("composer run post-autoload-dump --no-interaction", { cwd: projectDir });
|
|
78
87
|
|
|
79
|
-
log(
|
|
80
|
-
run(
|
|
88
|
+
log(`Running ${pm} install...`);
|
|
89
|
+
run(`${pm} install`, { cwd: projectDir });
|
|
81
90
|
|
|
82
91
|
// ── Init git ────────────────────────────────────────────────
|
|
83
92
|
log("Initializing git...");
|
|
@@ -99,5 +108,5 @@ ${green(bold(" ✓ Project created!"))}
|
|
|
99
108
|
${bold("Next steps:")}
|
|
100
109
|
${yellow(`cd ${projectName}`)}
|
|
101
110
|
${yellow("php artisan migrate")}
|
|
102
|
-
${yellow(
|
|
111
|
+
${yellow(`${pm} run dev`)}
|
|
103
112
|
`);
|