Skip to content

Commit 6944cf7

Browse files
authored
feat: Build with Rolldown (#872)
1 parent 144e922 commit 6944cf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+380
-1665
lines changed

.github/workflows/checks.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
run: yarn --frozen-lockfile --ignore-engines
3434
if: steps.dependency-cache.outputs.cache-hit != 'true'
3535
- run: yarn build
36+
- name: Upload build artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: dist-artifacts-${{ github.run_id }}
40+
path: packages/*/dist
41+
retention-days: 1
3642

3743
type-check:
3844
needs: build
@@ -112,6 +118,11 @@ jobs:
112118
- name: Install dependencies
113119
run: yarn --frozen-lockfile --ignore-engines
114120
if: steps.dependency-cache.outputs.cache-hit != 'true'
121+
- name: Download build artifacts
122+
uses: actions/download-artifact@v4
123+
with:
124+
name: dist-artifacts-${{ github.run_id }}
125+
path: packages
115126
- run: yarn test:unit
116127

117128
test-integration:
@@ -154,6 +165,11 @@ jobs:
154165
- name: Install dependencies
155166
run: yarn --frozen-lockfile --ignore-engines
156167
if: steps.dependency-cache.outputs.cache-hit != 'true'
168+
- name: Download build artifacts
169+
uses: actions/download-artifact@v4
170+
with:
171+
name: dist-artifacts-${{ github.run_id }}
172+
path: packages
157173
- run: yarn test:integration
158174

159175
test-e2e:
@@ -187,6 +203,11 @@ jobs:
187203
- name: Install dependencies
188204
run: yarn --frozen-lockfile --ignore-engines
189205
if: steps.dependency-cache.outputs.cache-hit != 'true'
206+
- name: Download build artifacts
207+
uses: actions/download-artifact@v4
208+
with:
209+
name: dist-artifacts-${{ github.run_id }}
210+
path: packages
190211
- run: yarn test:e2e
191212

192213
lint:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ yarn-error.log
99
.nxcache
1010
packages/**/yarn.lock
1111

12-
.DS_Store
12+
.DS_Store
13+
packages/bundler-plugin-core/src/version.ts

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
packages/e2e-tests/scenarios/*/ref/**/*
22
packages/bundler-plugin-core/test/fixtures
33
.nxcache
4+
# current prettier version doesn't support import assertions
5+
rollup.config.mjs

nx.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
},
2626
"test": {
2727
"inputs": ["sharedGlobals"],
28-
"dependsOn": ["^build"],
2928
"outputs": []
3029
},
3130
"check:types": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"ts-node": "^10.9.2"
3737
},
3838
"volta": {
39-
"node": "18.20.8",
39+
"node": "22.22.0",
4040
"yarn": "1.22.22"
4141
}
4242
}

packages/babel-plugin-component-annotate/.babelrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/babel-plugin-component-annotate/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const jestPackageJson = require("jest/package.json");
44
module.exports = {
55
root: true,
66
extends: ["@sentry-internal/eslint-config/jest", "@sentry-internal/eslint-config/base"],
7-
ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.js"],
7+
ignorePatterns: [".eslintrc.js", "dist", "jest.config.js", "rollup.config.mjs"],
88
parserOptions: {
99
tsconfigRootDir: __dirname,
1010
project: ["./src/tsconfig.json", "./test/tsconfig.json"],

packages/babel-plugin-component-annotate/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
"scripts": {
3535
"build": "premove ./out && run-p build:rollup build:types",
3636
"build:watch": "run-p build:rollup:watch build:types:watch",
37-
"build:rollup": "rollup --config rollup.config.js",
38-
"build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen",
37+
"build:rollup": "rolldown --config rollup.config.mjs",
38+
"build:rollup:watch": "rolldown --config rollup.config.mjs --watch --no-watch.clearScreen",
3939
"build:types": "tsc --project types.tsconfig.json",
4040
"build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
4141
"build:npm": "npm pack",
@@ -51,11 +51,7 @@
5151
},
5252
"devDependencies": {
5353
"@babel/core": "7.18.5",
54-
"@babel/preset-env": "7.18.2",
5554
"@babel/preset-react": "^7.23.3",
56-
"@babel/preset-typescript": "7.17.12",
57-
"@rollup/plugin-babel": "5.3.1",
58-
"@rollup/plugin-node-resolve": "13.3.0",
5955
"@sentry-internal/eslint-config": "4.9.1",
6056
"@sentry-internal/sentry-bundler-plugin-tsconfig": "4.9.1",
6157
"@swc/core": "^1.2.205",
@@ -66,7 +62,7 @@
6662
"eslint": "^8.18.0",
6763
"jest": "^28.1.1",
6864
"premove": "^4.0.0",
69-
"rollup": "2.75.7",
65+
"rolldown": "^1.0.0-rc.4",
7066
"ts-node": "^10.9.1",
7167
"typescript": "^4.7.4"
7268
},

packages/babel-plugin-component-annotate/rollup.config.js

Lines changed: 0 additions & 48 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import packageJson from "./package.json" with { type: "json" };
2+
import modulePackage from "module";
3+
4+
export default {
5+
platform: "node",
6+
input: ["src/index.ts"],
7+
external: Object.keys(packageJson.dependencies ?? []),
8+
output: [
9+
{
10+
file: packageJson.module,
11+
format: "esm",
12+
exports: "named",
13+
sourcemap: true,
14+
},
15+
{
16+
file: packageJson.main,
17+
format: "cjs",
18+
exports: "named",
19+
sourcemap: true,
20+
},
21+
],
22+
};

0 commit comments

Comments
 (0)