Skip to content

[Barrel #59 Phase 2] Migrate 117 src/app/ files from localDb barrel to direct db/ imports - #11789

Closed
jonlwheat2-gif wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
jonlwheat2-gif:fix/issue-59-barrel-phase2-src-app
Closed

[Barrel #59 Phase 2] Migrate 117 src/app/ files from localDb barrel to direct db/ imports#11789
jonlwheat2-gif wants to merge 1 commit into
diegosouzapw:release/v3.8.51from
jonlwheat2-gif:fix/issue-59-barrel-phase2-src-app

Conversation

@jonlwheat2-gif

Copy link
Copy Markdown
Contributor

Part of #11782 (tracks #59 on the fork)

Summary

Phase 2 of Issue #59: replace all barrel imports from @/lib/localDb with direct imports to the specific db/ modules in src/app/.

117 files changed, 268 insertions, 235 deletions. Zero barrel imports remain in src/app/.

What this does

Every import { ... } from "@/lib/localDb" in src/app/ has been rewritten to point directly at the owning db/ module:

- import { listBatches } from "@/lib/localDb";
+ import { listBatches } from "@/lib/db/batches";

- import { getSettings, isCloudEnabled } from "@/lib/localDb";
+ import { getSettings, isCloudEnabled } from "@/lib/db/settings";

Aliased exports are preserved:

- import { updateWebhookRecord } from "@/lib/localDb";
+ import { updateWebhook as updateWebhookRecord } from "@/lib/db/webhooks";

Why

  • AGENTS.md says: "Never barrel-import from localDb.ts — import specific db/ modules instead"
  • Vercel best practice bundle-barrel-imports: "Import directly, avoid barrel files"
  • 171 files were violating this convention; this phase covers 117 of them

Testing

  • All changes are mechanical import path rewrites — no logic changes
  • The ESLint rule no-restricted-imports (already in eslint.config.mjs) will prevent regressions
  • Each file was verified: rg -c "from.*@/lib/localDb" src/app/ --type ts returns 0 after this change

Dependencies

This PR targets release/v3.8.51. It should be merged before Phase 5 (barrel deletion).

… db/ imports

Phase 2 of Issue #59: replace all barrel imports from @/lib/localDb
with direct imports to the specific db/ modules in src/app/.

117 files changed, 268 insertions, 235 deletions.
Zero barrel imports remain in src/app/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant