Skip to content

Change importModuleSpecifierEnding default to .js#222

Open
captbaritone wants to merge 1 commit intopr/4-schema-coordinatesfrom
pr/5-import-specifier-default
Open

Change importModuleSpecifierEnding default to .js#222
captbaritone wants to merge 1 commit intopr/4-schema-coordinatesfrom
pr/5-import-specifier-default

Conversation

@captbaritone
Copy link
Owner

Summary

  • Change default value of importModuleSpecifierEnding from "" to ".js"
  • .js extensions work for both CJS and ESM, making this the better default
  • Update config description to reflect the new default
  • Remove now-redundant explicit importModuleSpecifierEnding: ".js" from example tsconfigs
  • Set explicit importModuleSpecifierEnding: "" for next-js example (uses webpack/bundler resolution)
  • Update all test snapshots (generated TS imports now include .js)
  • Update LLM docs for configuration

Part 5 of 5 — split from #217. Builds on #221.

Test plan

  • pnpm run build passes
  • pnpm run test --write && pnpm run test passes
  • pnpm run lint passes

@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from 11c827f to 0b1e70e Compare March 10, 2026 21:36
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch 2 times, most recently from bc7833a to 7a32241 Compare March 10, 2026 22:29
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from 0b1e70e to ab52ac2 Compare March 10, 2026 22:29
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from 7a32241 to 49bf6b4 Compare March 10, 2026 22:38
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from ab52ac2 to f34c610 Compare March 10, 2026 22:38
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from 49bf6b4 to d998819 Compare March 10, 2026 22:43
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from f34c610 to 25f70c6 Compare March 10, 2026 22:43
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from d998819 to 905f540 Compare March 10, 2026 22:45
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from 25f70c6 to f613a6d Compare March 10, 2026 22:45
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from 905f540 to f52a2fe Compare March 10, 2026 22:53
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from f613a6d to 2be3dbc Compare March 10, 2026 22:53
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from f52a2fe to 1e912db Compare March 10, 2026 22:59
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from 2be3dbc to c244f9a Compare March 10, 2026 22:59
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from 1e912db to 9c9dcd8 Compare March 10, 2026 23:45
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from c244f9a to 74ce122 Compare March 10, 2026 23:45
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
@captbaritone captbaritone force-pushed the pr/4-schema-coordinates branch from 9c9dcd8 to d577bb1 Compare March 11, 2026 00:08
@captbaritone captbaritone force-pushed the pr/5-import-specifier-default branch from 74ce122 to a22cfe2 Compare March 11, 2026 00:08
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