ship-create 1.6.0 → 1.6.1

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/create.mjs +14 -8
  2. package/package.json +1 -1
package/create.mjs CHANGED
@@ -66,8 +66,8 @@ const I18N = {
66
66
  qProblem: "What is the #1 problem they face today?",
67
67
  qValue: "What makes them say 'I need this'? (the aha moment)",
68
68
  scaffolding: (slug) => `Scaffolding ./${slug} ...`,
69
- installing: "Installing packages (this takes ~30 seconds)...",
70
- installFail: (slug) => `npm install failed. Run it manually:\n cd ${slug} && npm install`,
69
+ installing: (pm) => `Installing packages with ${pm} ...`,
70
+ installFail: (slug, pm) => `${pm} install failed. Run it manually:\n cd ${slug} && ${pm} install`,
71
71
  folderExists: (slug) => `Folder ./${slug} already exists — pick a different name and run again.`,
72
72
  templatesMissing:"Bundled templates missing. Try: npx ship-create@latest",
73
73
  done: (slug) => `
@@ -97,8 +97,8 @@ const I18N = {
97
97
  qProblem: "ปัญหาอันดับ 1 ที่พวกเขาเจออยู่ทุกวันคืออะไร?",
98
98
  qValue: "อะไรทำให้พวกเขาบอกว่า 'ฉันต้องการสิ่งนี้!'? (จุด aha moment)",
99
99
  scaffolding: (slug) => `กำลัง scaffold ./${slug} ...`,
100
- installing: "กำลังติดตั้ง packages (ใช้เวลาประมาณ 30 วินาที)...",
101
- installFail: (slug) => `npm install ล้มเหลว รันเองได้ที่:\n cd ${slug} && npm install`,
100
+ installing: (pm) => `กำลังติดตั้ง packages ด้วย ${pm} ...`,
101
+ installFail: (slug, pm) => `${pm} install ล้มเหลว รันเองได้ที่:\n cd ${slug} && ${pm} install`,
102
102
  folderExists: (slug) => `โฟลเดอร์ ./${slug} มีอยู่แล้ว — เลือกชื่ออื่นแล้วรันใหม่`,
103
103
  templatesMissing:"ไม่พบ template ที่ bundle ไว้ ลองรัน: npx ship-create@latest",
104
104
  done: (slug) => `
@@ -284,6 +284,11 @@ function copyRecursiveExcluding(src, dest, excludeNames) {
284
284
  }
285
285
  }
286
286
 
287
+ function detectPackageManager() {
288
+ const result = spawnSync("pnpm", ["--version"], { shell: true, encoding: "utf8" });
289
+ return result.status === 0 ? "pnpm" : "npm";
290
+ }
291
+
287
292
  function toKebabCase(str) {
288
293
  return str
289
294
  .trim()
@@ -599,15 +604,16 @@ async function main() {
599
604
  if (fs.existsSync(src)) fs.copyFileSync(src, path.join(docsDir, f));
600
605
  }
601
606
 
602
- // ── npm install ────────────────────────────────────────────────────────────
603
- console.log(` ${C.dim}${t.installing}${C.reset}\n`);
604
- const install = spawnSync("npm", ["install"], {
607
+ // ── install ────────────────────────────────────────────────────────────────
608
+ const pm = detectPackageManager();
609
+ console.log(` ${C.dim}${t.installing(pm)}${C.reset}\n`);
610
+ const install = spawnSync(pm, ["install"], {
605
611
  cwd: outDir,
606
612
  stdio: "inherit",
607
613
  shell: true,
608
614
  });
609
615
  if (install.status !== 0) {
610
- console.log(`\n ${t.installFail(projectSlug)}`);
616
+ console.log(`\n ${t.installFail(projectSlug, pm)}`);
611
617
  }
612
618
 
613
619
  // ── Done ───────────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ship-create",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Scaffold a new project the SHIP Method way — Structure, Human Flow, Instruction, Publish. No git clone, no API key, just one command.",
5
5
  "type": "module",
6
6
  "license": "MIT",