fix(web): resolve CHROME_EXTENSION_URL via the mapped @lib alias - #1648
Open
Agnik47 wants to merge 1 commit into
Open
fix(web): resolve CHROME_EXTENSION_URL via the mapped @lib alias#1648Agnik47 wants to merge 1 commit into
Agnik47 wants to merge 1 commit into
Conversation
Three web components imported the Chrome extension URL through
`@repo/lib/constants`, an alias that nothing maps. `apps/web/tsconfig.json`
maps `@repo/ui/*`, `@ui/*`, `@lib/*` and `@hooks/*`, but not `@repo/lib/*`,
so resolution fell through to the package's own exports map `{"./*": "./*"}`.
That points at the extensionless `packages/lib/constants`, and TypeScript's
`bundler` resolution does not append extensions after an exports-map
substitution:
error TS2307: Cannot find module '@repo/lib/constants'
or its corresponding type declarations.
Bundlers resolve extensions more permissively, so these still built at
runtime, but the imports were unsound and contributed to the red
`check-types` run.
Switch all three to `@lib/constants`, matching the 233 other uses of the
mapped alias across the app. `@repo/lib/` now has no remaining occurrences
in the repository.
Closes supermemoryai#1548
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ahq7SvSerSAVxkQR6GhuS
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 #1548
Problem
Three web components import the Chrome extension URL through an alias that nothing maps:
apps/web/tsconfig.jsonmaps@repo/ui/*,@ui/*,@lib/*and@hooks/*— but not@repo/lib/*. Resolution therefore falls through to the package's own exports map,{"./*": "./*"}, which points at the extensionlesspackages/lib/constants. TypeScript'sbundlerresolution does not append extensions after an exports-map substitution, so the import fails to type-check.Webpack/Turbopack apply extension resolution more permissively, so these still bundle at runtime — but the imports are unsound and contribute to the red
check-typesrun (#1544).Fix
Switch the three imports to
@lib/constants, matching every other consumer in the app:apps/web/components/integrations/chrome-detail.tsxapps/web/components/nova/nova-empty-state.tsxapps/web/components/onboarding/x-bookmarks-detail-view.tsxVerification
tscprobe importing both alias forms againstapps/web/tsconfig.json: only the@repo/form raises TS2307;@lib/constantsresolves cleanly.@repo/lib/now has 0 remaining occurrences repo-wide;@lib/is already used in 233 places.biome checkpasses on all three files.Scope
This clears 3 of the errors tracked in #1544 — it does not by itself make
check-typesgreen.🤖 Generated with Claude Code
https://claude.ai/code/session_018ahq7SvSerSAVxkQR6GhuS