chore(db): remove dead seed files and rewire consumers#464
chore(db): remove dead seed files and rewire consumers#464BigGillyStyle wants to merge 2 commits into
Conversation
Delete the vestigial packages/db/src/seed.ts (its seed() only reset id sequences; local-seed.ts has superseded it) and the unused packages/shared/src/common/seed.ts (fakeEnum/fakeEnums/fakeArray had zero importers). Rewire migrate.ts (drop --seed) and reset-test-db.ts (drop the unreachable "project" branch + seedType param). Remove the db:seed scripts and the now-orphaned @faker-js/faker dependency/catalog entry. Keep test-seed.ts and local-seed.ts, both still actively wired. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 3 minutes and 2 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@BigGillyStyle thanks for jumping on this! In layman's terms, are you mainly removing the seeding we've had in there since day 1? because it's not used anymore? |
There was a problem hiding this comment.
Pull request overview
This PR removes legacy/dead seed utilities (including a vestigial DB seed entrypoint containing real user data) and rewires the remaining tooling/docs to use the actively supported local/test seed paths.
Changes:
- Deleted the legacy DB seed entrypoint and removed
--seedhandling from migrations plusdb:seedscripts. - Simplified
reset-test-dbto always usetestSeedand removed the unusedseedTypeplumbing. - Removed unused shared seed helpers and dropped
@faker-js/fakerfrom the workspace/dependency graph; updated local dev docs accordingly.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pnpm-workspace.yaml | Removes @faker-js/faker from the central pnpm catalog. |
| pnpm-lock.yaml | Removes @faker-js/faker from lockfile catalogs/importers/packages/snapshots. |
| packages/shared/src/common/seed.ts | Deletes unused faker-based seed helper utilities. |
| packages/shared/package.json | Drops the unused @faker-js/faker dependency. |
| packages/db/src/utils/run-reset-test-db.ts | Updates the reset-test-db runner to match the new resetTestDb signature. |
| packages/db/src/utils/reset-test-db.ts | Removes seedType and the legacy project seed path; always uses testSeed. |
| packages/db/src/seed.ts | Deletes the legacy seed script. |
| packages/db/src/migrate.ts | Removes the legacy --seed flag behavior and seed import. |
| packages/db/package.json | Removes the seed script entry. |
| package.json | Removes the root db:seed script and keeps db:seed:local. |
| docs/LOCAL_DEV_SETUP.md | Updates local dev docs to point to pnpm db:seed:local. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
| console.log("Migrating database", databaseName, { | ||
| shouldReset, | ||
| shouldSeed, | ||
| config, | ||
| }); | ||
| await migrator(params?.db ?? getDb(), config); | ||
|
|
||
| if (shouldSeed) { | ||
| console.log("Seeding database..."); | ||
| if (params?.seedType === "test") { | ||
| await testSeed(params?.db ?? getDb()); | ||
| } else { | ||
| // Import and run project seed | ||
| const { seed } = await import("../seed"); | ||
| await seed(); | ||
| } | ||
| await testSeed(params?.db ?? getDb()); | ||
| } |
Closes #368
What
Removes two dead/vestigial seed files and rewires everything that referenced them.
packages/db/src/seed.ts— itsseed()only re-synced Postgres id sequences (the rest of the file was commented out), andlocal-seed.ts(pnpm db:seed:local) has superseded it for real local seeding.packages/shared/src/common/seed.ts—fakeEnum/fakeEnums/fakeArrayhad zero importers.@faker-js/fakerwas used only here, so the dependency and its pnpm catalog entry are now removed too.Rewiring
migrate.ts— dropped theseedimport and the--seedflag handling.reset-test-db.ts— removed the unreachable"project"seed branch and theseedTypeparam; it now always callstestSeedwhen seeding (the sole caller already only passedseedType: "test").run-reset-test-db.ts— dropped the now-invalidseedType: "test"argument.db:seedscripts from the root andpackages/dbpackage.json.docs/LOCAL_DEV_SETUP.mdto point atdb:seed:local.Kept (still actively wired)
packages/db/src/test-seed.ts— used bypnpm reset-test-dbin test/CI.packages/db/src/local-seed.ts— used bypnpm db:seed:local,scripts/local-setup.sh, and docs.Verification
pnpm -F @acme/db typecheck/pnpm -F @acme/shared typecheck— cleanpnpm -F @acme/db lint— cleancommon/seed/@faker-js/faker/from "./seed"/db:seed— no residual references;fakercount in lockfile is0🤖 Generated with Claude Code