fix: default db:generate scaffold to --pglite#29
Open
zigzag-dev26 wants to merge 1 commit into
Open
Conversation
Closes seveibar#2 The `pgstrap init` scaffold currently writes `db:generate -> "pgstrap generate"`, which requires a running Postgres to succeed. Flipping the default to `pgstrap generate --pglite` lets new projects run `bun run db:generate` straight after init with zero external dependencies (the `--pglite` flag is already supported by the CLI and runs against an in-memory PGlite instance, as documented in README.md). Net change: +2 / -2 across `src/init.ts` and `tests/init.test.ts`. @algora-pbc /claim seveibar#2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2
Summary
The
pgstrap initscaffold currently writesdb:generate -> "pgstrap generate"to package.json, which requires a running Postgres to succeed. That makes the very firstbun run db:generateafter init fail unless the user already has Postgres set up — defeating the purpose of the scaffold.Flipping the default to
pgstrap generate --pglitelets new projects runbun run db:generateimmediately after init with zero external dependencies. The--pgliteflag is already supported by the CLI (src/cli.ts:38) and runs against an in-memory PGlite instance, which is already a project dependency. README.md line 58 already documents this exact invocation.Diff
Net change: +2 / -2, two files.
src/init.ts— switch the scaffolded script frompgstrap generatetopgstrap generate --pglitetests/init.test.ts— update the assertion to matchNo new dependencies, no behavior change for existing projects (only affects the scaffold output of
pgstrap init).Verification
bun test bun run format:check bun run build@algora-pbc /claim #2