Add idempotent local demo catalog seed #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-13-demo-seed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #13. Unblocks the store static-build verification in #9.
Problem
pnpm --filter garage-store build(output: "export") fails when the catalog has zero published items:Next.js 16.2.10 is current — no upgrade available or needed.
generateStaticParams()is present; the exporter simply needs at least one published product to prerender. This is a data prerequisite, not a code defect.Change
apps/management/scripts/seed-demo.mts: local-only script that upserts published demo inventory items by slug.apps/management/package.json:db:seed:demoscript.Design:
inventory_slug_uniqindex; re-runs don't duplicate.DATABASE_URL(substring check); override withSEED_DEMO_ALLOW_REMOTE=1.Usage
Verification
DATABASE_URL(exit 1) unless overridden.pnpm --filter garage-store buildsucceeds; generatesapps/store/out/index.htmlandapps/store/out/products/{oli-mesin-10w-40,filter-oli-universal}.html;/products/[slug]prerendered as SSG.biome checkclean.Scope note
Closes #13 (build unblocked + repeatable local verification). Does NOT close #9: production secrets/env verification, image deploy, real catalog data, canonical links, legacy notice, and archiving garage-store remain. Demo products are for local testing only — do not deploy them to production.
Add idempotent local demo catalog seed (#13)to Add idempotent local demo catalog seed