Skip to content

Commit 6c9bbdf

Browse files
authored
feat(repo): migrate build system to tsdown for proper ESM/CJS support (#1961)
1 parent f346169 commit 6c9bbdf

31 files changed

+1296
-852
lines changed

.github/workflows/ci-supabase-js.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,42 @@ jobs:
110110
parallel-finished: true
111111
fail-on-error: false
112112
continue-on-error: true
113+
114+
module-resolution:
115+
name: Module Resolution Tests
116+
runs-on: ubuntu-latest
117+
needs: build-package
118+
steps:
119+
- name: Checkout code
120+
uses: actions/checkout@v4
121+
with:
122+
filter: tree:0
123+
fetch-depth: 0
124+
125+
- name: Setup Node.js
126+
uses: actions/setup-node@v4
127+
with:
128+
node-version: ${{ env.NODE_VERSION }}
129+
cache: 'npm'
130+
131+
- name: Install dependencies
132+
run: npm ci
133+
134+
- name: Download build artifacts
135+
uses: actions/download-artifact@v4
136+
with:
137+
name: packages-dist
138+
path: ./packages/core
139+
140+
- name: Validate package exports (attw)
141+
run: npx nx test:exports supabase-js
142+
143+
- name: Test ESM imports
144+
run: npx nx test:esm supabase-js
145+
146+
- name: Test CJS requires
147+
run: npx nx test:cjs supabase-js
148+
113149
deno-tests:
114150
name: Deno Tests
115151
runs-on: ubuntu-latest

deno.lock

Lines changed: 3 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nx.json

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"{projectRoot}/webpack.config.[jt]s",
5151
"{projectRoot}/vite.config.[jt]s",
5252
"{projectRoot}/rollup.config.[jt]s",
53+
"{projectRoot}/tsdown.config.[jt]s",
5354
"{projectRoot}/tsconfig*.json",
5455
"{projectRoot}/package.json",
5556
"sharedGlobals"
@@ -74,30 +75,6 @@
7475
"cache": true,
7576
"outputs": ["{projectRoot}/dist"]
7677
},
77-
"build:main": {
78-
"inputs": ["production", "^production", "buildConfig"],
79-
"dependsOn": ["^build:main"],
80-
"cache": true,
81-
"outputs": ["{projectRoot}/dist/main", "{projectRoot}/dist/tsconfig.tsbuildinfo"]
82-
},
83-
"build:module": {
84-
"inputs": ["production", "^production", "buildConfig"],
85-
"dependsOn": ["^build:module"],
86-
"cache": true,
87-
"outputs": ["{projectRoot}/dist/module", "{projectRoot}/dist/tsconfig.module.tsbuildinfo"]
88-
},
89-
"build:umd": {
90-
"inputs": ["production", "^production", "buildConfig"],
91-
"dependsOn": ["^build:umd"],
92-
"cache": true,
93-
"outputs": ["{projectRoot}/dist/umd"]
94-
},
95-
"webpack:build": {
96-
"inputs": ["production", "^production", "buildConfig"],
97-
"dependsOn": ["^webpack:build"],
98-
"cache": true,
99-
"outputs": ["{projectRoot}/dist"]
100-
},
10178
"test": {
10279
"inputs": ["testing", "^production"],
10380
"dependsOn": ["^build"],
@@ -106,7 +83,7 @@
10683
},
10784
"test:types": {
10885
"inputs": ["testing", "^production"],
109-
"dependsOn": ["build:module"],
86+
"dependsOn": ["build"],
11087
"cache": true,
11188
"outputs": []
11289
},

0 commit comments

Comments
 (0)