Skip to content

refactor(lib): fully remove barrel imports from @pagespace/lib - #1087

Closed
2witstudios wants to merge 10 commits into
masterfrom
pu/removing-barrel-imports
Closed

2witstudios wants to merge 10 commits into
masterfrom
pu/removing-barrel-imports

Conversation

@2witstudios

Copy link
Copy Markdown
Owner

Summary

This PR completes the removal of all barrel re-export aggregators from @pagespace/lib, replacing every high-level barrel import (@pagespace/lib, @pagespace/lib/server, @pagespace/lib/auth, @pagespace/lib/permissions, @pagespace/lib/integrations, @pagespace/lib/client-safe, @pagespace/lib/security, @pagespace/lib/content, @pagespace/lib/notifications) with direct subpath imports across all apps and test files.

Why this matters:

  • Barrel imports cause every consumer to load the full module graph even when only one export is needed, bloating bundle sizes and slowing cold starts
  • They obscure the actual dependency graph, making it hard to understand what a file actually needs
  • After #1077 established real subdir paths in exports, the barrels became dead weight — this PR cleans them out

What changed:

  • packages/lib/package.json: Removed barrel export aliases; all exports are now direct subpath entries
  • apps/web/src/**: ~250 source files + test files updated to use specific subpaths (e.g. @pagespace/lib/auth/session-service instead of @pagespace/lib/auth)
  • apps/realtime/src/**, apps/processor/src/**, apps/control-plane/src/**, apps/marketing/src/**: Same treatment
  • scripts/migrate-barrel-imports.mjs: Migration script used to automate the bulk of changes
  • All test mocks updated to target the exact subpath imported by the source (Vitest mock interception only works when the mock path exactly matches the import path)

Pre-existing test failures (not caused by this PR, pass in CI with test DB):

  • admin-role-version.test.ts — DB integration test, requires PostgreSQL
  • gift-subscription/route.security.test.ts — DB integration test, requires PostgreSQL
  • fetch-bridge.test.ts — network timeout, requires real network
  • packages/lib rate-limit-cache.integration.test.ts — DB integration test

Test plan

  • pnpm --filter web typecheck passes with zero errors
  • pnpm --filter web exec vitest run — 379 test files pass, 3 pre-existing DB-dependent failures unchanged
  • packages/lib vitest run — 152 test files pass, 1 pre-existing DB-dependent failure unchanged
  • All mock paths verified to match exact import paths in source files
  • Branch pushed and clean

Reviewer notes

Please use /aidd:review to conduct a thorough review of this PR. The key things to verify:

  1. No barrel paths remain — check that no source file still imports from @pagespace/lib root, @pagespace/lib/server, @pagespace/lib/auth (as a barrel), @pagespace/lib/permissions (as a barrel), etc.
  2. Test mock correctness — each vi.mock path must exactly match what the source file under test imports; any mismatch means the mock silently does nothing
  3. No accidental scope changes — the diff is large but mechanical; each change is import { X } from '@pagespace/lib/barrel' → import { X } from '@pagespace/lib/specific/subpath'

🤖 Generated with Claude Code

2witstudios and others added 7 commits April 22, 2026 19:54
Replace 12 flat export aliases in @pagespace/lib with paths
that match the actual source layout:
- ./secure-compare, ./device-auth-utils, ./broadcast-auth,
  ./verification-utils → ./auth/*
- ./activity-tracker, ./ai-monitoring,
  ./ai-context-calculator → ./monitoring/*
- ./logger-config, ./logger-database, ./logger-browser,
  ./logger → ./logging/*
- ./api-utils → ./utils/api-utils

Updates 114 import statements across apps/web, apps/realtime,
and apps/processor. Both exports and typesVersions fields in
package.json updated in lockstep.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The first pass only caught static `from '...'` imports.
vi.mock(), vi.doMock(), await import(), and vitest.config
alias maps also contained the old flat paths. Replace all
remaining occurrences across apps/web, apps/realtime, and
apps/processor.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All three trackAuthEvent calls (web, desktop, iOS platforms) were passing
the raw email address. maskEmail was already imported from @pagespace/lib/server
and used in logger calls in the same file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Migrates 533 files across apps/web, apps/processor, apps/realtime, and
apps/control-plane from high-level barrel re-exports (server, auth,
integrations, notifications) to direct subpath imports.

Adds missing package.json exports/typesVersions entries for:
- integrations/repositories/provider-repository
- integrations/credentials/encrypt-credentials
- integrations/oauth/oauth-handler
- integrations/providers
- integrations/converter/openapi

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arrel removal

After removing barrel imports from @pagespace/lib, test mocks targeting old
barrel paths (e.g. @pagespace/lib/auth, @pagespace/lib/server) no longer
intercept the source code which now imports from specific subpaths.

Updates all affected test files to mock the exact subpath each source file
imports from, and fixes residual broken mock patterns (e.g. `...actual`
spread without vi.importActual) introduced by the migration script.

Also fixes TypeScript typecheck error in admin-role-version.test.ts caused
by the same broken pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Too many files!

This PR contains 300 files, which is 150 over the limit of 150.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: be467911-769e-4529-a8ac-c7cc21a1de42

📥 Commits

Reviewing files that changed from the base of the PR and between c2f85d4 and dea6c89.

📒 Files selected for processing (300)
  • .gitignore
  • apps/control-plane/src/middleware/api-key-auth.ts
  • apps/control-plane/src/validation/tenant-validation.ts
  • apps/marketing/src/app/api/contact/__tests__/route.test.ts
  • apps/processor/src/__tests__/cors-validation.test.ts
  • apps/processor/src/__tests__/server.test.ts
  • apps/processor/src/api/__tests__/ingest.test.ts
  • apps/processor/src/middleware/__tests__/auth.test.ts
  • apps/processor/src/middleware/__tests__/resource-binding.test.ts
  • apps/processor/src/middleware/auth.ts
  • apps/processor/src/services/__tests__/authorization.test.ts
  • apps/processor/src/services/__tests__/rbac-delete.test.ts
  • apps/processor/src/services/__tests__/siem-adapter.test.ts
  • apps/processor/src/services/__tests__/siem-chain-hashers.test.ts
  • apps/processor/src/services/__tests__/siem-pipeline.e2e.test.ts
  • apps/processor/src/services/authorization.ts
  • apps/processor/src/services/rbac.ts
  • apps/processor/src/services/siem-adapter.ts
  • apps/processor/src/utils/__tests__/security.test.ts
  • apps/processor/src/utils/security.ts
  • apps/processor/src/workers/__tests__/siem-delivery-worker.test.ts
  • apps/processor/src/workers/siem-delivery-worker.ts
  • apps/processor/tests/auth-middleware.test.ts
  • apps/realtime/src/__tests__/index.test.ts
  • apps/realtime/src/__tests__/kick-api.test.ts
  • apps/realtime/src/__tests__/kick-handler.test.ts
  • apps/realtime/src/__tests__/origin-validation.test.ts
  • apps/realtime/src/__tests__/per-event-auth.test.ts
  • apps/realtime/src/__tests__/rooms.test.ts
  • apps/realtime/src/index.ts
  • apps/realtime/src/per-event-auth.ts
  • apps/realtime/src/presence-tracker.ts
  • apps/web/middleware.ts
  • apps/web/src/app/api/account/__tests__/delete-route.test.ts
  • apps/web/src/app/api/account/__tests__/get-patch-route.test.ts
  • apps/web/src/app/api/account/avatar/__tests__/route.test.ts
  • apps/web/src/app/api/account/avatar/route.ts
  • apps/web/src/app/api/account/devices/[deviceId]/__tests__/route.test.ts
  • apps/web/src/app/api/account/devices/[deviceId]/route.ts
  • apps/web/src/app/api/account/devices/__tests__/route.test.ts
  • apps/web/src/app/api/account/devices/route.ts
  • apps/web/src/app/api/account/drives-status/__tests__/route.test.ts
  • apps/web/src/app/api/account/drives-status/route.ts
  • apps/web/src/app/api/account/export/__tests__/route.test.ts
  • apps/web/src/app/api/account/export/route.ts
  • apps/web/src/app/api/account/handle-drive/__tests__/route.test.ts
  • apps/web/src/app/api/account/handle-drive/route.ts
  • apps/web/src/app/api/account/route.ts
  • apps/web/src/app/api/activities/[activityId]/__tests__/route.test.ts
  • apps/web/src/app/api/activities/[activityId]/rollback-to-point/__tests__/route.test.ts
  • apps/web/src/app/api/activities/[activityId]/rollback-to-point/route.ts
  • apps/web/src/app/api/activities/[activityId]/rollback/__tests__/route.test.ts
  • apps/web/src/app/api/activities/[activityId]/rollback/route.ts
  • apps/web/src/app/api/activities/[activityId]/route.ts
  • apps/web/src/app/api/activities/__tests__/route.test.ts
  • apps/web/src/app/api/activities/actors/__tests__/route.test.ts
  • apps/web/src/app/api/activities/actors/route.ts
  • apps/web/src/app/api/activities/export/__tests__/route.test.ts
  • apps/web/src/app/api/activities/export/route.ts
  • apps/web/src/app/api/activities/route.ts
  • apps/web/src/app/api/activity/summary/__tests__/route.test.ts
  • apps/web/src/app/api/activity/summary/route.ts
  • apps/web/src/app/api/admin/audit-logs/__tests__/search-security.test.ts
  • apps/web/src/app/api/admin/audit-logs/export/route.ts
  • apps/web/src/app/api/admin/audit-logs/integrity/route.ts
  • apps/web/src/app/api/admin/audit-logs/route.ts
  • apps/web/src/app/api/admin/contact/route.ts
  • apps/web/src/app/api/admin/schema/route.ts
  • apps/web/src/app/api/admin/users/[userId]/data/__tests__/route.test.ts
  • apps/web/src/app/api/admin/users/[userId]/data/route.ts
  • apps/web/src/app/api/admin/users/[userId]/export/__tests__/route.test.ts
  • apps/web/src/app/api/admin/users/[userId]/export/route.ts
  • apps/web/src/app/api/admin/users/[userId]/gift-subscription/__tests__/route.pii.test.ts
  • apps/web/src/app/api/admin/users/[userId]/gift-subscription/__tests__/route.security.test.ts
  • apps/web/src/app/api/admin/users/[userId]/gift-subscription/route.ts
  • apps/web/src/app/api/admin/users/create/route.ts
  • apps/web/src/app/api/admin/users/route.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/[grantId]/__tests__/route.test.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/[grantId]/route.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/__tests__/route.test.ts
  • apps/web/src/app/api/agents/[agentId]/integrations/route.ts
  • apps/web/src/app/api/ai/abort/__tests__/route.test.ts
  • apps/web/src/app/api/ai/abort/route.ts
  • apps/web/src/app/api/ai/chat/__tests__/mcp-scope.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/undo/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/[messageId]/undo/route.ts
  • apps/web/src/app/api/ai/chat/messages/__tests__/mcp-scope.test.ts
  • apps/web/src/app/api/ai/chat/messages/__tests__/route.test.ts
  • apps/web/src/app/api/ai/chat/messages/route.ts
  • apps/web/src/app/api/ai/chat/route.ts
  • apps/web/src/app/api/ai/global/[id]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/messages/[messageId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/global/[id]/messages/route.ts
  • apps/web/src/app/api/ai/global/[id]/route.ts
  • apps/web/src/app/api/ai/global/[id]/usage/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/[id]/usage/route.ts
  • apps/web/src/app/api/ai/global/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/active/__tests__/route.test.ts
  • apps/web/src/app/api/ai/global/active/route.ts
  • apps/web/src/app/api/ai/global/route.ts
  • apps/web/src/app/api/ai/lmstudio/models/__tests__/route.test.ts
  • apps/web/src/app/api/ai/lmstudio/models/route.ts
  • apps/web/src/app/api/ai/ollama/models/__tests__/route.test.ts
  • apps/web/src/app/api/ai/ollama/models/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/config/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/config/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/messages/[messageId]/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/messages/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/[conversationId]/route.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/[agentId]/conversations/route.ts
  • apps/web/src/app/api/ai/page-agents/consult/route.ts
  • apps/web/src/app/api/ai/page-agents/create/__tests__/route.test.ts
  • apps/web/src/app/api/ai/page-agents/create/route.ts
  • apps/web/src/app/api/ai/page-agents/multi-drive/route.ts
  • apps/web/src/app/api/ai/settings/__tests__/route.test.ts
  • apps/web/src/app/api/ai/settings/route.ts
  • apps/web/src/app/api/auth/__tests__/csrf.test.ts
  • apps/web/src/app/api/auth/__tests__/device-refresh.test.ts
  • apps/web/src/app/api/auth/__tests__/google-callback-redirect.test.ts
  • apps/web/src/app/api/auth/__tests__/logout.test.ts
  • apps/web/src/app/api/auth/__tests__/mcp-tokens.test.ts
  • apps/web/src/app/api/auth/__tests__/mobile-oauth-google-exchange.test.ts
  • apps/web/src/app/api/auth/__tests__/mobile-refresh.test.ts
  • apps/web/src/app/api/auth/__tests__/session-fixation.test.ts
  • apps/web/src/app/api/auth/__tests__/verify-email.test.ts
  • apps/web/src/app/api/auth/apple/callback/__tests__/route.test.ts
  • apps/web/src/app/api/auth/apple/callback/route.ts
  • apps/web/src/app/api/auth/apple/native/__tests__/route.test.ts
  • apps/web/src/app/api/auth/apple/native/route.ts
  • apps/web/src/app/api/auth/apple/signin/__tests__/route.test.ts
  • apps/web/src/app/api/auth/apple/signin/route.ts
  • apps/web/src/app/api/auth/csrf/route.ts
  • apps/web/src/app/api/auth/desktop/exchange/__tests__/route.test.ts
  • apps/web/src/app/api/auth/desktop/exchange/route.ts
  • apps/web/src/app/api/auth/device/__tests__/refresh-deviceid.test.ts
  • apps/web/src/app/api/auth/device/refresh/__tests__/route.test.ts
  • apps/web/src/app/api/auth/device/refresh/route.ts
  • apps/web/src/app/api/auth/device/register/__tests__/route.test.ts
  • apps/web/src/app/api/auth/device/register/route.ts
  • apps/web/src/app/api/auth/google/__tests__/google-callback-redirect.test.ts
  • apps/web/src/app/api/auth/google/__tests__/one-tap.test.ts
  • apps/web/src/app/api/auth/google/__tests__/open-redirect-protection.test.ts
  • apps/web/src/app/api/auth/google/callback/__tests__/route.test.ts
  • apps/web/src/app/api/auth/google/callback/route.ts
  • apps/web/src/app/api/auth/google/native/__tests__/route.test.ts
  • apps/web/src/app/api/auth/google/native/route.ts
  • apps/web/src/app/api/auth/google/one-tap/__tests__/route.test.ts
  • apps/web/src/app/api/auth/google/one-tap/route.ts
  • apps/web/src/app/api/auth/google/signin/__tests__/route.test.ts
  • apps/web/src/app/api/auth/google/signin/route.ts
  • apps/web/src/app/api/auth/logout/route.ts
  • apps/web/src/app/api/auth/magic-link/send/__tests__/route.test.ts
  • apps/web/src/app/api/auth/magic-link/send/route.ts
  • apps/web/src/app/api/auth/magic-link/verify/__tests__/desktop-verify.test.ts
  • apps/web/src/app/api/auth/magic-link/verify/__tests__/route.test.ts
  • apps/web/src/app/api/auth/magic-link/verify/route.ts
  • apps/web/src/app/api/auth/mcp-tokens/[tokenId]/__tests__/route.test.ts
  • apps/web/src/app/api/auth/mcp-tokens/[tokenId]/route.ts
  • apps/web/src/app/api/auth/mcp-tokens/__tests__/route.test.ts
  • apps/web/src/app/api/auth/mcp-tokens/route.ts
  • apps/web/src/app/api/auth/me/route.ts
  • apps/web/src/app/api/auth/mobile/oauth/google/exchange/route.ts
  • apps/web/src/app/api/auth/mobile/refresh/route.ts
  • apps/web/src/app/api/auth/passkey/[passkeyId]/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/[passkeyId]/route.ts
  • apps/web/src/app/api/auth/passkey/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/authenticate/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/authenticate/options/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/authenticate/options/route.ts
  • apps/web/src/app/api/auth/passkey/authenticate/route.ts
  • apps/web/src/app/api/auth/passkey/register/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/register/handoff/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/register/handoff/route.ts
  • apps/web/src/app/api/auth/passkey/register/options/__tests__/route.test.ts
  • apps/web/src/app/api/auth/passkey/register/options/route.ts
  • apps/web/src/app/api/auth/passkey/register/route.ts
  • apps/web/src/app/api/auth/passkey/route.ts
  • apps/web/src/app/api/auth/resend-verification/__tests__/route.test.ts
  • apps/web/src/app/api/auth/resend-verification/route.ts
  • apps/web/src/app/api/auth/signup-passkey/__tests__/route.test.ts
  • apps/web/src/app/api/auth/signup-passkey/options/__tests__/route.test.ts
  • apps/web/src/app/api/auth/signup-passkey/options/route.ts
  • apps/web/src/app/api/auth/signup-passkey/route.ts
  • apps/web/src/app/api/auth/socket-token/__tests__/route.test.ts
  • apps/web/src/app/api/auth/socket-token/route.ts
  • apps/web/src/app/api/auth/verify-email/route.ts
  • apps/web/src/app/api/auth/ws-token/__tests__/route.test.ts
  • apps/web/src/app/api/auth/ws-token/route.ts
  • apps/web/src/app/api/calendar/events/[eventId]/__tests__/can-edit-event.test.ts
  • apps/web/src/app/api/calendar/events/[eventId]/attendees/route.ts
  • apps/web/src/app/api/calendar/events/[eventId]/route.ts
  • apps/web/src/app/api/calendar/events/route.ts
  • apps/web/src/app/api/channels/[pageId]/messages/[messageId]/reactions/route.ts
  • apps/web/src/app/api/channels/[pageId]/messages/route.ts
  • apps/web/src/app/api/channels/[pageId]/read/route.ts
  • apps/web/src/app/api/channels/[pageId]/upload/route.ts
  • apps/web/src/app/api/compiled-css/route.ts
  • apps/web/src/app/api/connections/[connectionId]/__tests__/route.test.ts
  • apps/web/src/app/api/connections/[connectionId]/route.ts
  • apps/web/src/app/api/connections/__tests__/route.test.ts
  • apps/web/src/app/api/connections/route.ts
  • apps/web/src/app/api/connections/search/__tests__/route.test.ts
  • apps/web/src/app/api/connections/search/route.ts
  • apps/web/src/app/api/contact/__tests__/route.test.ts
  • apps/web/src/app/api/contact/route.ts
  • apps/web/src/app/api/cron/calendar-sync/__tests__/route.test.ts
  • apps/web/src/app/api/cron/calendar-sync/route.ts
  • apps/web/src/app/api/cron/calendar-triggers/__tests__/route.test.ts
  • apps/web/src/app/api/cron/calendar-triggers/route.ts
  • apps/web/src/app/api/cron/cleanup-orphaned-files/__tests__/route.test.ts
  • apps/web/src/app/api/cron/cleanup-orphaned-files/route.ts
  • apps/web/src/app/api/cron/cleanup-tokens/__tests__/route.test.ts
  • apps/web/src/app/api/cron/cleanup-tokens/route.ts
  • apps/web/src/app/api/cron/purge-ai-usage-logs/__tests__/route.test.ts
  • apps/web/src/app/api/cron/purge-ai-usage-logs/route.ts
  • apps/web/src/app/api/cron/purge-deleted-messages/__tests__/route.test.ts
  • apps/web/src/app/api/cron/purge-deleted-messages/route.ts
  • apps/web/src/app/api/cron/retention-cleanup/__tests__/route.test.ts
  • apps/web/src/app/api/cron/retention-cleanup/route.ts
  • apps/web/src/app/api/cron/sweep-expired/__tests__/route.test.ts
  • apps/web/src/app/api/cron/sweep-expired/route.ts
  • apps/web/src/app/api/cron/verify-audit-chain/__tests__/route.test.ts
  • apps/web/src/app/api/cron/verify-audit-chain/route.ts
  • apps/web/src/app/api/cron/workflows/__tests__/route.test.ts
  • apps/web/src/app/api/cron/workflows/route.ts
  • apps/web/src/app/api/debug/chat-messages/__tests__/route.test.ts
  • apps/web/src/app/api/debug/chat-messages/route.ts
  • apps/web/src/app/api/drives/[driveId]/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/access/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/access/route.ts
  • apps/web/src/app/api/drives/[driveId]/agents/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/agents/route.ts
  • apps/web/src/app/api/drives/[driveId]/assignees/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/assignees/route.ts
  • apps/web/src/app/api/drives/[driveId]/backups/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/backups/route.ts
  • apps/web/src/app/api/drives/[driveId]/history/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/history/route.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/[connectionId]/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/[connectionId]/route.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/__tests__/audit-filters.test.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/audit-filters.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/export/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/export/route.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/audit/route.ts
  • apps/web/src/app/api/drives/[driveId]/integrations/route.ts
  • apps/web/src/app/api/drives/[driveId]/members/[userId]/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/members/[userId]/route.ts
  • apps/web/src/app/api/drives/[driveId]/members/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/members/invite/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/members/invite/route.ts
  • apps/web/src/app/api/drives/[driveId]/members/route.ts
  • apps/web/src/app/api/drives/[driveId]/pages/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/pages/route.ts
  • apps/web/src/app/api/drives/[driveId]/permissions-tree/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/permissions-tree/route.ts
  • apps/web/src/app/api/drives/[driveId]/restore/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/restore/route.ts
  • apps/web/src/app/api/drives/[driveId]/roles/[roleId]/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/roles/[roleId]/route.ts
  • apps/web/src/app/api/drives/[driveId]/roles/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/roles/reorder/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/roles/reorder/route.ts
  • apps/web/src/app/api/drives/[driveId]/roles/route.ts
  • apps/web/src/app/api/drives/[driveId]/route.ts
  • apps/web/src/app/api/drives/[driveId]/search/glob/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/search/glob/route.ts
  • apps/web/src/app/api/drives/[driveId]/search/regex/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/search/regex/route.ts
  • apps/web/src/app/api/drives/[driveId]/trash/__tests__/route.test.ts
  • apps/web/src/app/api/drives/[driveId]/trash/route.ts
  • apps/web/src/app/api/drives/__tests__/route.test.ts
  • apps/web/src/app/api/drives/route.ts
  • apps/web/src/app/api/feedback/__tests__/route.test.ts
  • apps/web/src/app/api/feedback/route.ts
  • apps/web/src/app/api/files/[id]/convert-to-document/__tests__/route.test.ts
  • apps/web/src/app/api/files/[id]/convert-to-document/route.ts
  • apps/web/src/app/api/files/[id]/download/__tests__/route.test.ts
  • apps/web/src/app/api/files/[id]/download/route.ts
  • apps/web/src/app/api/files/[id]/view/__tests__/route.test.ts
  • apps/web/src/app/api/files/[id]/view/route.ts
  • apps/web/src/app/api/health/__tests__/route.test.ts
  • apps/web/src/app/api/health/route.ts
  • apps/web/src/app/api/inbox/route.ts
  • apps/web/src/app/api/integrations/connections/[connectionId]/grants/route.ts
  • apps/web/src/app/api/integrations/google-calendar/calendars/route.ts
  • apps/web/src/app/api/integrations/google-calendar/callback/__tests__/route.test.ts
  • apps/web/src/app/api/integrations/google-calendar/callback/route.ts
  • apps/web/src/app/api/integrations/google-calendar/connect/route.ts
  • apps/web/src/app/api/integrations/google-calendar/disconnect/route.ts
  • apps/web/src/app/api/integrations/google-calendar/settings/route.ts
  • apps/web/src/app/api/integrations/google-calendar/status/route.ts
  • apps/web/src/app/api/integrations/google-calendar/sync/route.ts

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pu/removing-barrel-imports

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread scripts/fix-wrong-imports.mjs Fixed
Comment thread scripts/migrate-barrel-imports.mjs Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b1a84ae4e9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/lib/dist Outdated
@@ -0,0 +1 @@
/Users/jono/production/PageSpace/packages/lib/dist

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove machine-specific symlink for lib dist

Do not commit packages/lib/dist as an absolute symlink to /Users/jono/...: that target only exists on one machine, so every other environment gets a broken @pagespace/lib package root/subpath resolution and downstream TypeScript/runtime failures when imports resolve through dist. Commiting this link makes builds non-portable across CI and other developers.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7131b27 — removed both symlinks from git tracking with git rm --cached. These are local pnpm worktree artifacts that were accidentally staged by git add -A in the migration commit. They are not in .gitignore as symlinks (only dist/ directories are ignored, not symlinks named dist).

Comment thread packages/db/dist Outdated
@@ -0,0 +1 @@
/Users/jono/production/PageSpace/packages/db/dist

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Replace absolute symlink for db dist with portable artifact

packages/db/dist is also introduced as an absolute symlink to /Users/jono/..., which is not valid outside the author’s workstation. Any workflow that resolves @pagespace/db via its package entry points will fail in other environments because the linked dist tree does not exist there.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 7131b27 — same as packages/lib/dist, removed from git tracking.

2witstudios and others added 3 commits April 23, 2026 07:22
packages/lib/dist and packages/db/dist were committed as absolute
symlinks pointing to /Users/jono/... — valid only on the author's
machine, breaking CI and all other environments.

Removed from git tracking. The symlinks are local worktree artifacts
created by pnpm workspace that must not be committed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds escapeRegExp helper to both migration scripts to properly escape
special characters in strings interpolated into RegExp constructors.

Addresses CodeQL findings:
- scripts/fix-wrong-imports.mjs:132 — Incomplete string escaping
- scripts/migrate-barrel-imports.mjs:433 — Regular expression injection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prevents accidental re-commit of packages/lib/dist and packages/db/dist
symlinks which are local pnpm workspace artifacts, not source files.
The existing `dist/` pattern only ignores real directories, not symlinks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@2witstudios

Copy link
Copy Markdown
Owner Author

Closing in favor of a 6-PR series that stays under CodeRabbit's review limit and groups changes by logical subsystem:

All work from this PR is preserved in those branches. Merge order: #1088 first, then #1089–#1093 in any order.

@2witstudios

Copy link
Copy Markdown
Owner Author

Closing in favor of a 6-PR series grouped by logical subsystem:

All work from this PR is preserved in those branches. Merge order: #1088 first, then #1089–#1093 in any order.

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.

2 participants