Skip to content

Commit 4621026

Browse files
committed
make it faster and better
1 parent 91a1ac7 commit 4621026

26 files changed

Lines changed: 609 additions & 291 deletions

.github/workflows/checks.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,6 @@ jobs:
145145
with:
146146
path: "**/node_modules"
147147
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
148-
- name: Use build cache
149-
uses: actions/cache@v4
150-
with:
151-
path: .nxcache
152-
key: build-cache-key-${{ runner.os }}-${{ github.run_id }}
153-
restore-keys: |
154-
build-cache-key-${{ runner.os }}-
155148
- name: Install dependencies
156149
run: yarn --frozen-lockfile --ignore-engines
157150
if: steps.dependency-cache.outputs.cache-hit != 'true'
@@ -182,13 +175,6 @@ jobs:
182175
with:
183176
path: "**/node_modules"
184177
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/yarn.lock') }}
185-
- name: Use build cache
186-
uses: actions/cache@v4
187-
with:
188-
path: .nxcache
189-
key: build-cache-key-${{ runner.os }}-${{ github.run_id }}
190-
restore-keys: |
191-
build-cache-key-${{ runner.os }}-
192178
- name: Install dependencies
193179
run: yarn --frozen-lockfile --ignore-engines
194180
if: steps.dependency-cache.outputs.cache-hit != 'true'

nx.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
33
"namedInputs": {
4+
"default": ["{projectRoot}/**/*", "sharedGlobals"],
45
"sharedGlobals": ["{workspaceRoot}/*.js", "{workspaceRoot}/*.json", "{workspaceRoot}/yarn.lock"]
56
},
67
"targetDefaults": {
@@ -13,18 +14,15 @@
1314
"lint": {
1415
"inputs": ["sharedGlobals"],
1516
"dependsOn": ["^build", "build"],
16-
"outputs": [],
1717
"cache": true
1818
},
1919
"test": {
20-
"inputs": ["sharedGlobals"],
21-
"outputs": [],
22-
"cache": true
20+
"inputs": ["default"],
21+
"cache": false
2322
},
2423
"check:types": {
2524
"inputs": ["sharedGlobals"],
26-
"dependsOn": ["^build"],
27-
"outputs": []
25+
"dependsOn": ["^build"]
2826
},
2927
"build:npm": {
3028
"dependsOn": ["build", "^build"]
@@ -33,5 +31,8 @@
3331
"cacheDirectory": ".nxcache",
3432
"tui": {
3533
"autoExit": true
34+
},
35+
"nxCloudOptions": {
36+
"detectFlakyTasks": false
3637
}
3738
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
"packages/tsconfigs",
1919
"packages/vite-plugin",
2020
"packages/webpack-plugin",
21+
"packages/integration-tests-next",
2122
"packages/integration-tests-next/fixtures/rolldown"
2223
],
2324
"scripts": {
25+
"postinstall": "patch-package",
2426
"build": "nx run-many --target=build --all",
2527
"build:watch": "nx run-many --target=build:watch --all",
2628
"build:graph": "nx graph",
@@ -43,7 +45,8 @@
4345
"npm-run-all": "^4.1.5",
4446
"nx": "22.5.2",
4547
"oxfmt": "^0.33.0",
46-
"ts-node": "^10.9.2"
48+
"ts-node": "^10.9.2",
49+
"patch-package": "^8.0.1"
4750
},
4851
"volta": {
4952
"node": "22.22.0",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles: readAllOutputFiles }) => {
5+
runRolldown();
6+
expect(readAllOutputFiles()).toMatchInlineSnapshot(`
7+
{
8+
"basic.js": "//#region src/basic.js
9+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[(new e.Error).stack]=function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];if(null!=a)for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])}return e}({},e._sentryModuleMetadata[(new e.Error).stack],{"_sentryBundlerPluginAppKey:1234567890abcdef":true});var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10+
11+
//#endregion",
12+
}
13+
`);
14+
});
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles: readAllOutputFiles }) => {
5+
runRolldown();
6+
expect(readAllOutputFiles()).toMatchInlineSnapshot(`
7+
{
8+
"basic.js": "//#region src/basic.js
9+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10+
11+
//#endregion",
12+
}
13+
`);
14+
});

packages/integration-tests-next/fixtures/rolldown/basic-sourcemaps.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,12 @@ export default defineConfig({
77
file: "out/basic-sourcemaps/basic.js",
88
sourcemap: true,
99
},
10-
plugins: [sentryRollupPlugin({ telemetry: false })],
10+
plugins: [
11+
sentryRollupPlugin({
12+
telemetry: false,
13+
authToken: "fake-auth",
14+
org: "fake-org",
15+
project: "fake-project",
16+
}),
17+
],
1118
});
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles: readAllOutputFiles }) => {
5+
runRolldown();
6+
expect(readAllOutputFiles()).toMatchInlineSnapshot(`
7+
{
8+
"basic.js": "//#region src/basic.js
9+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10+
11+
//#endregion
12+
//# sourceMappingURL=basic.js.map",
13+
"basic.js.map": "{"version":3,"file":"basic.js","names":[],"sources":["../../src/basic.js"],"sourcesContent":["// eslint-disable-next-line no-console\\nconsole.log(\\"hello world\\");\\n"],"mappings":";scACA,OAAA,CAAQ,GAAA,CAAI,CAAA,KAAA,CAAA,KAAA,CAAA,CAAc"}",
14+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
15+
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
16+
["releases","finalize","CURRENT_SHA"],
17+
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],
18+
",
19+
}
20+
`);
21+
});

packages/integration-tests-next/fixtures/rolldown/basic.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,12 @@ export default defineConfig({
66
output: {
77
file: "out/basic/basic.js",
88
},
9-
plugins: [sentryRollupPlugin({ telemetry: false })],
9+
plugins: [
10+
sentryRollupPlugin({
11+
telemetry: false,
12+
authToken: "fake-auth",
13+
org: "fake-org",
14+
project: "fake-project",
15+
}),
16+
],
1017
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles: readAllOutputFiles }) => {
5+
runRolldown();
6+
expect(readAllOutputFiles()).toMatchInlineSnapshot(`
7+
{
8+
"basic.js": "//#region src/basic.js
9+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b699d9c1-b033-4536-aa25-233c92609b54",e._sentryDebugIdIdentifier="sentry-dbid-b699d9c1-b033-4536-aa25-233c92609b54");}catch(e){}}();console.log("hello world");
10+
11+
//#endregion",
12+
"sentry-cli-mock.json": "["releases","new","CURRENT_SHA"],
13+
["releases","set-commits","CURRENT_SHA","--auto","--ignore-missing"],
14+
["releases","finalize","CURRENT_SHA"],
15+
["sourcemaps","upload","-p","fake-project","--release","CURRENT_SHA","sentry-bundler-plugin-upload-path","--ignore","node_modules","--no-rewrite"],
16+
",
17+
}
18+
`);
19+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles: readAllOutputFiles }) => {
5+
runRolldown();
6+
expect(readAllOutputFiles()).toMatchInlineSnapshot(`
7+
{
8+
"app.js": "!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"CURRENT_SHA"};var n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ea5adc74-2664-4c38-8492-6e4971efd2be",e._sentryDebugIdIdentifier="sentry-dbid-ea5adc74-2664-4c38-8492-6e4971efd2be");}catch(e){}}();import { jsx, jsxs } from "../node_modules/react/jsx-runtime.js";
9+
10+
//#region src/component-a.jsx
11+
function ComponentA() {
12+
return /* @__PURE__ */ jsx("span", { children: "Component A" });
13+
}
14+
15+
//#endregion
16+
//#region src/app.jsx
17+
function App() {
18+
return /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx(ComponentA, {}), ";"] });
19+
}
20+
21+
//#endregion
22+
export { App as default };",
23+
}
24+
`);
25+
});

0 commit comments

Comments
 (0)