Change importModuleSpecifierEnding default to .js#222
Open
captbaritone wants to merge 1 commit intopr/4-schema-coordinatesfrom
Open
Change importModuleSpecifierEnding default to .js#222captbaritone wants to merge 1 commit intopr/4-schema-coordinatesfrom
captbaritone wants to merge 1 commit intopr/4-schema-coordinatesfrom
Conversation
11c827f to
0b1e70e
Compare
bc7833a to
7a32241
Compare
0b1e70e to
ab52ac2
Compare
7a32241 to
49bf6b4
Compare
ab52ac2 to
f34c610
Compare
49bf6b4 to
d998819
Compare
f34c610 to
25f70c6
Compare
d998819 to
905f540
Compare
25f70c6 to
f613a6d
Compare
905f540 to
f52a2fe
Compare
f613a6d to
2be3dbc
Compare
f52a2fe to
1e912db
Compare
2be3dbc to
c244f9a
Compare
1e912db to
9c9dcd8
Compare
c244f9a to
74ce122
Compare
Change the default value of `importModuleSpecifierEnding` from `""` to `".js"`. This makes the generated TypeScript schema file work correctly for both CommonJS and ES module projects out of the box, since `.js` extensions are valid in CJS and required in ESM. - Update configSpecRaw.json default and description - Update generated TGratsConfig.ts types - Remove now-redundant explicit `.js` setting from example tsconfigs - Set explicit `""` for next-js (uses webpack bundler resolution) - Update all test snapshots to reflect new default
9c9dcd8 to
d577bb1
Compare
74ce122 to
a22cfe2
Compare
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.
Summary
importModuleSpecifierEndingfrom""to".js".jsextensions work for both CJS and ESM, making this the better defaultimportModuleSpecifierEnding: ".js"from example tsconfigsimportModuleSpecifierEnding: ""for next-js example (uses webpack/bundler resolution).js)Part 5 of 5 — split from #217. Builds on #221.
Test plan
pnpm run buildpassespnpm run test --write && pnpm run testpassespnpm run lintpasses