-
-
Notifications
You must be signed in to change notification settings - Fork 835
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
fix: viem/node esm/cjs conflict #2298
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: 836ff50 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7357716
to
79abf44
Compare
@@ -6,8 +6,10 @@ | |||
"bench": "vitest bench", | |||
"bench:ci": "CI=true vitest bench", | |||
"build": "bun run clean && bun run build:cjs && bun run build:esm && bun run build:types", | |||
"build:cjs": "tsc --project ./tsconfig.build.json --module commonjs --outDir ./src/_cjs --removeComments --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./src/_cjs/package.json", | |||
"build:cjs": "bun run build:trustedSetups:start && tsc --project ./tsconfig.build.json --module commonjs --outDir ./src/_cjs --removeComments --verbatimModuleSyntax false && printf '{\"type\":\"commonjs\"}' > ./src/_cjs/package.json && bun run build:trustedSetups:end", |
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.
move commonjs version trustedSetups_cjs.ts
to trustedSetups.ts
, then cleans up at the end
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2298 +/- ##
==========================================
- Coverage 99.70% 99.69% -0.01%
==========================================
Files 680 680
Lines 57684 57692 +8
Branches 2749 2749
==========================================
+ Hits 57511 57518 +7
Misses 156 156
- Partials 17 18 +1 ☔ View full report in Codecov by Sentry. |
Adds CJS and ESM versions of
trustedSetups.ts
and uses specific one based on the build type.Fixes #2297
Alternative approach could be creating a
'viem/node/trustedSetups'
entrypoint, chucking the compiled files in there, and exporting those in'viem/node'
.PR-Codex overview
This PR focuses on adding support for ESM (ECMAScript Modules) for trusted setups in the project.
Detailed summary
src/node/trustedSetups_esm.ts
for ESM supporttsconfig.build.json
for ESM module resolution