Repository navigation
fix(0.x): emit type module marker in _types package.json - #579
Merged
Merged
Conversation
Supersedes #467. Co-authored-by: Javad Tavakoli <16999504+javadtavakoli@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-d920-74b4-aabe-ef8b2e6421b2 Co-authored-by: jxom <jake@tempo.xyz>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks done
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Merged
This branch was successfully deployed
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.
Supersedes #467 (thanks @javadtavakoli; credited as co-author).
build:typesnow writes{"type":"module"}tosrc/_types/package.json, matching the_esmand_cjsmarkers. The published rootpackage.jsonhas notype, so_types/**/*.d.tscurrently resolve as CommonJS and ESM consumers on TypeScriptnode16(ornodenextbefore TypeScript 5.8) get TS1479/TS1541 insidenode_modules/ox/_types.This is the same change viem shipped in wevm/viem#4903, and matches how
abitypetypes already resolve.Tradeoff: one
typesfile serves bothimportanddefault, so after this change CommonJS consumers onnode16see TS1479 onimport ... from 'ox'in their own files (runtimerequirestill works). The changeset tells them to usenodenextorbundlerresolution.main(1.x) is unaffected: it is ESM-only with"type": "module"at the root.Checked with a packed tarball (
pnpm build,scripts/prepublish.ts,npm pack) andtsc --noEmit --stricton TypeScript 5.9.3:node16nodenextox/_typesox@mainESM