Skip to content

Commit dfa1552

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

34 files changed

+774
-299
lines changed

.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: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
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": {
78
"build": {
8-
"inputs": ["sharedGlobals"],
9+
"inputs": ["default"],
910
"dependsOn": ["^build"],
1011
"outputs": ["{projectRoot}/dist"],
1112
"cache": true
1213
},
1314
"lint": {
14-
"inputs": ["sharedGlobals"],
15+
"inputs": ["default"],
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": {
25-
"inputs": ["sharedGlobals"],
26-
"dependsOn": ["^build"],
27-
"outputs": []
24+
"inputs": ["default"],
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 }) => {
5+
runRolldown();
6+
expect(readOutputFiles()).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 }) => {
5+
runRolldown();
6+
expect(readOutputFiles()).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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => {
5+
runRolldown();
6+
expect(readOutputFiles()).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+
22+
const output = runFileInNode("basic.js");
23+
expect(output).toBe("hello world\n");
24+
});

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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { expect } from "vitest";
2+
import { test } from "./utils";
3+
4+
test(import.meta.url, ({ runRolldown, readOutputFiles, runFileInNode }) => {
5+
runRolldown();
6+
expect(readOutputFiles()).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+
20+
const output = runFileInNode("basic.js");
21+
expect(output).toBe("hello world\n");
22+
});
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
2+
import { defineConfig } from "rolldown";
3+
4+
export default defineConfig({
5+
input: "src/basic.js",
6+
output: {
7+
file: "out/build-info/basic.js",
8+
},
9+
plugins: [
10+
sentryRollupPlugin({
11+
telemetry: false,
12+
release: {
13+
name: "build-information-injection-test",
14+
},
15+
_experiments: { injectBuildInformation: true },
16+
}),
17+
],
18+
});

0 commit comments

Comments
 (0)