@sveltebuilder/cli
v0.0.13
Published
CLI for ongoing SvelteBuilder project management — syncs Drizzle schemas from installed modules into Supabase migrations and seed data.
Maintainers
Readme
@sveltebuilder/cli
Ongoing project management CLI for SvelteBuilder projects. create-sveltebuilder depends on this package internally — sync logic is never duplicated between initial scaffolding and later module additions.
Install
Usually you don't install this directly — npm create sveltebuilder@latest adds it to your project automatically. To use it standalone:
npm install -D @sveltebuilder/cliUsage
sveltebuilder sync:supabase # generate Supabase migrations from Drizzle schemas
sveltebuilder sync:drizzle # assemble Drizzle schema for the Native template (not yet implemented)
sveltebuilder sync # deprecated alias for sync:supabasesveltebuilder sync:supabase:
- Discovers every installed module's schema manifest under
.sveltebuilder/registry/*.json. - Topologically sorts them by each manifest's
afterdependencies (hermes schema first, then domain modules). - Writes a barrel file (
.sveltebuilder/schema.ts) and a generateddrizzle.config.ts. - Runs
drizzle-kit generateto produce Supabase migrations, appends each module's supplemental SQL (RLS policies, triggers, cross-module FK constraints), and rewritessupabase/config.toml'smigrations.schema_paths. - Assembles
supabase/seed.sqlfrom the base hermes seed data plus each module's seed SQL.
Programmatic API
import { syncSupabase, syncDrizzle } from '@sveltebuilder/cli/api';create-sveltebuilder calls syncSupabase directly as the final step of scaffolding a new project.
Part of the SvelteBuilder ecosystem
See the SvelteBuilder README for how schema ordering, modules, and the scaffold templates fit together.
