create-kide-app 0.0.18 → 0.0.20
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.js +9 -7
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -29,7 +29,7 @@ const runAsync = (cmd, cwd) =>
|
|
|
29
29
|
|
|
30
30
|
// --- Package manager detection ---
|
|
31
31
|
|
|
32
|
-
const pm = { name: "pnpm", exec: "pnpm dlx", run: "pnpm", install: "pnpm install" };
|
|
32
|
+
const pm = { name: "pnpm", exec: "pnpm exec", dlx: "pnpm dlx", run: "pnpm", install: "pnpm install" };
|
|
33
33
|
|
|
34
34
|
// --- Main ---
|
|
35
35
|
|
|
@@ -206,9 +206,9 @@ async function main() {
|
|
|
206
206
|
[
|
|
207
207
|
"Seeding for Cloudflare requires a D1 database.",
|
|
208
208
|
"",
|
|
209
|
-
` ${pm.
|
|
209
|
+
` ${pm.dlx} wrangler d1 create ${projectName}-db`,
|
|
210
210
|
" # Add the database_id to wrangler.toml",
|
|
211
|
-
` ${pm.
|
|
211
|
+
` ${pm.dlx} wrangler d1 migrations apply ${projectName}-db --local`,
|
|
212
212
|
` ${pm.run} cms:seed`,
|
|
213
213
|
].join("\n"),
|
|
214
214
|
"Seed manually",
|
|
@@ -308,8 +308,10 @@ async function main() {
|
|
|
308
308
|
try {
|
|
309
309
|
execSync(`${pm.exec} drizzle-kit generate`, { cwd: projectDir, stdio: "pipe" });
|
|
310
310
|
s.stop("Migrations generated");
|
|
311
|
-
} catch {
|
|
311
|
+
} catch (err) {
|
|
312
312
|
s.stop("Migration generation failed");
|
|
313
|
+
if (err.stderr) console.error(err.stderr.toString().slice(-800));
|
|
314
|
+
if (err.stdout) console.error(err.stdout.toString().slice(-800));
|
|
313
315
|
}
|
|
314
316
|
|
|
315
317
|
s.start("Applying migrations to remote D1");
|
|
@@ -369,15 +371,15 @@ async function main() {
|
|
|
369
371
|
const remaining = [];
|
|
370
372
|
if (!cf.d1Created) {
|
|
371
373
|
remaining.push(
|
|
372
|
-
` ${pm.
|
|
374
|
+
` ${pm.dlx} wrangler d1 create ${projectName}-db`,
|
|
373
375
|
" # Copy the database_id to wrangler.toml",
|
|
374
376
|
);
|
|
375
377
|
}
|
|
376
378
|
if (!cf.r2Created) {
|
|
377
|
-
remaining.push(` ${pm.
|
|
379
|
+
remaining.push(` ${pm.dlx} wrangler r2 bucket create ${projectName}-assets`);
|
|
378
380
|
}
|
|
379
381
|
if (!cf.migrationsApplied) {
|
|
380
|
-
remaining.push(` ${pm.
|
|
382
|
+
remaining.push(` ${pm.dlx} wrangler d1 migrations apply ${projectName}-db --remote`);
|
|
381
383
|
}
|
|
382
384
|
if (!cf.deployed) {
|
|
383
385
|
remaining.push(` ${pm.run} run deploy`);
|