-
Notifications
You must be signed in to change notification settings - Fork 1.9k
chore: switch to module ESNext + moduleResolution bundler #2095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mattzcarey
wants to merge
5
commits into
main
Choose a base branch
from
chore/bundler-tsconfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e2d61e9
chore: switch to module ESNext + moduleResolution bundler
mattzcarey a7b812c
chore: unify quickstart tsconfigs with shared base, fix doc drift
mattzcarey 9f5e8f2
chore(quickstart): override types to [node], drop phantom vitest dep
mattzcarey 6a711b2
chore(quickstart): bump docs target/lib to ESNext, drop dead scripts/…
mattzcarey d7b1c47
chore(codemod): strip .js from relative TS imports in new codemod pac…
mattzcarey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| // Auth configuration | ||
| export type { CreateDemoAuthOptions, DemoAuth } from './auth.js'; | ||
| export { createDemoAuth } from './auth.js'; | ||
| export type { CreateDemoAuthOptions, DemoAuth } from './auth'; | ||
| export { createDemoAuth } from './auth'; | ||
|
|
||
| // Auth server setup + demo token verifier (pass to `requireBearerAuth` from @modelcontextprotocol/express) | ||
| export type { SetupAuthServerOptions } from './authServer.js'; | ||
| export { createProtectedResourceMetadataRouter, demoTokenVerifier, getAuth, setupAuthServer } from './authServer.js'; | ||
| export type { SetupAuthServerOptions } from './authServer'; | ||
| export { createProtectedResourceMetadataRouter, demoTokenVerifier, getAuth, setupAuthServer } from './authServer'; |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The rationale comment at
common/eslint-config/eslint.config.mjs:39("Let the TS resolver handle NodeNext-style imports like "./foo.js"") now contradicts the import convention this PR establishes — CLAUDE.md was updated to say "no.jsextension on relative imports (project usesmoduleResolution: bundler)". Theextensionsresolver setting itself is still useful; only the comment is stale and should be updated or removed so future contributors aren't told the project still writes./foo.jsimports.Extended reasoning...
What the bug is
This PR flips the project's module resolution from
NodeNexttobundlerand strips.jsextensions from every relative TypeScript import acrosspackages/,examples/,scripts/, andtest/. It also updatesCLAUDE.mdline 39 to document the new convention: "ES module style, no.jsextension on relative imports (project usesmoduleResolution: bundler)". However,common/eslint-config/eslint.config.mjswas not touched, and line 39 there still reads:After this PR there are no NodeNext-style
./foo.jsrelative imports left in the repo (the PR's stated goal was to remove them all), so the comment now describes a convention the project explicitly migrated away from.How it manifests
A contributor reading the eslint config — for example, while debugging an import-resolution lint error — would conclude from this comment that the project still writes relative imports with a
.jsextension and that the resolver setting exists to support that. That conclusion is the opposite of whatCLAUDE.mdnow says and what every.tsfile in the repo now does. Two pieces of in-repo documentation now actively contradict each other.Why nothing catches it
The comment is plain prose inside a
.mjsconfig file.pnpm lint:allandpnpm typecheck:allonly verify code behavior, not whether comments accurately describe the surrounding configuration. There is nosync:snippets-style guard for config-file comments.Step-by-step proof
CLAUDE.mdline 39 said: "ES module style, include.jsextension" — consistent with the eslint comment.CLAUDE.mdline 39 to: "ES module style, no.jsextension on relative imports (project usesmoduleResolution: bundler)".common/tsconfig/tsconfig.jsonfrommodule: NodeNext/moduleResolution: NodeNexttomodule: ESNext/moduleResolution: bundler.common/eslint-config/eslint.config.mjs:39is unchanged:// Let the TS resolver handle NodeNext-style imports like "./foo.js".CLAUDE.md.Why the
extensionssetting itself is fineThe
extensionsarray tellseslint-import-resolver-typescriptwhich file extensions to try when resolving an import specifier to a source file on disk. Even with extensionless imports undermoduleResolution: bundler, the resolver still needs this list to map./footofoo.ts/foo.tsx/ etc. So the setting should stay; only the reason given for it is stale.Impact and fix
No functional impact — purely documentation drift. But the PR explicitly migrates the project's import convention and updates
CLAUDE.mdto match; leaving a contradicting comment in a sibling config file is exactly the kind of partial migration that confuses the next contributor. Update the comment to something like:or simply remove the comment, since the setting is fairly self-explanatory.