create-kide-app 0.3.5 → 0.3.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.
Files changed (2) hide show
  1. package/index.js +14 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -735,12 +735,25 @@ async function main() {
735
735
  s.stop("Schema generation failed — run `cms:generate` manually");
736
736
  }
737
737
 
738
+ // --- Apply schema to the local database (local target only; Cloudflare's D1
739
+ // needs Worker bindings). Without this, only `pnpm dev` (which pushes on boot)
740
+ // works out of the box — `pnpm build && pnpm preview` would hit a table-less DB.
741
+
742
+ if (target === "local") {
743
+ s.start("Preparing database");
744
+ try {
745
+ await runAsync(`${pm.run} cms:push`, projectDir);
746
+ s.stop("Database ready");
747
+ } catch {
748
+ s.stop("Database push failed — run `pnpm cms:push` manually");
749
+ }
750
+ }
751
+
738
752
  // --- Seed starter content (local target only) ---
739
753
 
740
754
  if (starter && seedRequested && target === "local") {
741
755
  s.start("Seeding example content");
742
756
  try {
743
- await runAsync(`${pm.run} cms:push`, projectDir);
744
757
  await runAsync(`${pm.exec} kide seed`, projectDir);
745
758
  s.stop("Example content seeded");
746
759
  } catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-kide-app",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "Scaffold a new Kide CMS project",
5
5
  "author": "Matti Hernesniemi",
6
6
  "license": "MIT",