-
Notifications
You must be signed in to change notification settings - Fork 544
feat(repo): migrate build system to tsdown for proper ESM/CJS support #1961
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
Merged
Conversation
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
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
3753ded to
d771752
Compare
39618a1 to
ab1c306
Compare
7 tasks
ab1c306 to
97872e7
Compare
grdsdev
approved these changes
Dec 16, 2025
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
This PR migrates the build system for postgrest-js, storage-js, and supabase-js from the legacy tsc + wrapper.mjs approach to tsdown, fixing critical ESM module resolution issues that caused production outages for users.
Background
I initially planned to use tsup, but discovered it's no longer actively maintained. The
tsuprepository itself recommends usingtsdown(its actively maintained successor built on Rolldown).Issues Fixed
All three issues stem from PR #1914 which introduced wrapper.mjs as a workaround. This PR properly fixes the underlying issue.
What Changed
Build Output Structure
Before:
After:
Package Exports
Before:
{ "main": "dist/main/index.js", "module": "dist/esm/wrapper.mjs", "types": "dist/module/index.d.ts", "exports": { ".": { "types": "./dist/module/index.d.ts", "import": "./dist/esm/wrapper.mjs", "require": "./dist/main/index.js" } } }After:
{ "main": "dist/index.cjs", "module": "dist/index.mjs", "types": "dist/index.d.cts", "exports": { ".": { "import": { "types": "./dist/index.d.mts", "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" } }, "./dist/*": "./dist/*", "./package.json": "./package.json" } }Files Changed
Removed (no longer needed)
Added
New Tests
To prevent regression, this PR adds comprehensive module resolution tests:
CI now runs a dedicated module-resolution job that validates:
Backward Compatibility
Related: