Skip to content

fix: Properly configure SDK to be distributed as ESM#2028

Merged
tusharpandey13 merged 1 commit intomainfrom
fix/module-distribution
Apr 3, 2025
Merged

fix: Properly configure SDK to be distributed as ESM#2028
tusharpandey13 merged 1 commit intomainfrom
fix/module-distribution

Conversation

@frederikprijck
Copy link
Member

@frederikprijck frederikprijck commented Apr 2, 2025

Our SDK isnt correctly configured to publish ESM:

  • we need to use default, not import
  • we need to define type: module in the package.json
  • we need to ensure we define file extensions when importing from files

This can cause issues as it may mean certain tools have to rely on auto resolving the module loading and failing as they think our SDK is CJS, but it is ESM.

Solves #1945

@frederikprijck frederikprijck force-pushed the fix/module-distribution branch from 84da922 to 624dc14 Compare April 2, 2025 13:47
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 57.14286% with 3 lines in your changes missing coverage. Please review.

Project coverage is 74.82%. Comparing base (e8f2515) to head (624dc14).

Files with missing lines Patch % Lines
src/client/helpers/get-access-token.ts 0.00% 0 Missing and 1 partial ⚠️
src/client/index.ts 0.00% 0 Missing and 1 partial ⚠️
src/server/index.ts 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2028   +/-   ##
=======================================
  Coverage   74.82%   74.82%           
=======================================
  Files          21       21           
  Lines        1863     1863           
  Branches      289      289           
=======================================
  Hits         1394     1394           
  Misses        462      462           
  Partials        7        7           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tusharpandey13 tusharpandey13 merged commit af99098 into main Apr 3, 2025
12 checks passed
@tusharpandey13 tusharpandey13 deleted the fix/module-distribution branch April 3, 2025 05:28
@frederikprijck frederikprijck mentioned this pull request Apr 3, 2025
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.

4 participants