Skip to content

Commit 09cc3e0

Browse files
chargomeclaude
andauthored
chore(build): Bump vite 5→6, vitest 1→2, vite-plugin-dts 3→4 (#273)
Bump the core build/test tooling across all workspace packages: - **vite** ^5.2.8 → ^6.4.1 - **vitest** ^1.4.0 → ^2.1.9 - **vite-plugin-dts** ^3.8.1 → ^4.5.4 - **rollup-plugin-terser** (deprecated) → **@rollup/plugin-terser** in rrweb-worker Added `cssFileName: 'style'` to the shared vite config to preserve the `style.css` output filename (Vite 6 changed the default to package-name-based). ### Dependabot alerts resolved **Fully resolved** (vulnerable version completely removed from lockfile): | Alert | Severity | Package | Summary | |-------|----------|---------|---------| | #113 | CRITICAL | `vitest` | Remote Code Execution when accessing a malicious website while Vitest API server is listening | | #203 | HIGH | `rollup` | Rollup 4 has Arbitrary File Write via Path Traversal | | #110 | MEDIUM | `vue-template-compiler` | Client-side XSS (no fix available — removed by vite-plugin-dts v4 dropping the dependency) | **Partially resolved** (some vulnerable entries removed, but package still exists via other dependency chains): | Alert | Severity | Package | Remaining source | |-------|----------|---------|-----------------| | #154, #146, #145, #141, #140, #139, #138, #126, #111 | MEDIUM/LOW | `vite` | `@sveltejs/vite-plugin-svelte@3` still pulls in vite@5 (needs Svelte 5 upgrade) | | #114 | MEDIUM | `esbuild` | `esbuild-plugin-umd-wrapper` still uses esbuild@0.18 | | #214 | HIGH | `serialize-javascript` | webpack (via `@size-limit`) still pulls in v6 | | #105, #104 | MEDIUM | `nanoid` | postcss (via vite internally) still uses nanoid@3 | | #165, #155 | HIGH/MEDIUM | `validator` | `@microsoft/api-extractor` (via vite-plugin-dts) — needs further investigation | The partially resolved alerts will be addressed in later phases (Svelte 5 upgrade, @size-limit bump, mop-up). closes https://linear.app/getsentry/issue/SDK-1095/bump-vitest-vite-56-1-critical-7-alerts --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: chargome <chargome@users.noreply.github.com>
1 parent 2bc97b4 commit 09cc3e0

28 files changed

Lines changed: 1590 additions & 609 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ jobs:
2121
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2222
fetch-depth: 0
2323

24-
- name: Setup Node.js lts/*
25-
uses: actions/setup-node@v3
24+
- name: Setup Node.js 20
25+
uses: actions/setup-node@v4
2626
with:
27-
node-version: lts/*
27+
node-version: 20
2828
cache: 'yarn'
2929

3030
- name: Install Dependencies
31-
run: yarn install --frozen-lockfile
31+
run: yarn install --frozen-lockfile --network-timeout 300000
32+
timeout-minutes: 10
3233

3334
- name: Build Project
3435
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all
@@ -58,14 +59,15 @@ jobs:
5859
- name: Checkout Repo
5960
uses: actions/checkout@v3
6061

61-
- name: Setup Node.js lts/*
62-
uses: actions/setup-node@v3
62+
- name: Setup Node.js 20
63+
uses: actions/setup-node@v4
6364
with:
64-
node-version: lts/*
65+
node-version: 20
6566
cache: 'yarn'
6667

6768
- name: Install Dependencies
68-
run: yarn install --frozen-lockfile
69+
run: yarn install --frozen-lockfile --network-timeout 300000
70+
timeout-minutes: 10
6971

7072
- name: Build Project
7173
run: NODE_OPTIONS='--max-old-space-size=4096' yarn build:all

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ dist-ts3.8
3939
# for vite
4040
vite.config.js.timestamp-*
4141
vite.config.ts.timestamp-*
42+
43+
# rrvideo temp output
44+
__rrvideo__temp__

packages/all/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
"devDependencies": {
5252
"puppeteer": "^20.9.0",
5353
"typescript": "^4.7.3",
54-
"vite": "^5.2.8",
55-
"vite-plugin-dts": "^3.8.1",
56-
"vitest": "^1.4.0"
54+
"vite": "^6.4.1",
55+
"vite-plugin-dts": "^4.5.4",
56+
"vitest": "^2.1.9"
5757
},
5858
"dependencies": {
5959
"@sentry-internal/rrweb": "2.41.0",

packages/packer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@
7373
],
7474
"devDependencies": {
7575
"typescript": "^4.7.3",
76-
"vite": "^5.2.8",
77-
"vite-plugin-dts": "^3.8.1",
78-
"vitest": "^1.4.0"
76+
"vite": "^6.4.1",
77+
"vite-plugin-dts": "^4.5.4",
78+
"vitest": "^2.1.9"
7979
},
8080
"dependencies": {
8181
"@sentry-internal/rrweb-types": "2.41.0",

packages/packer/test/packer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('unpack', () => {
3030
it('stop on unknown data format', () => {
3131
const consoleSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
3232

33-
expect(() => unpack('[""]')).toThrow('');
33+
expect(() => unpack('[""]')).toThrow();
3434

3535
expect(consoleSpy).toHaveBeenCalled();
3636
vi.resetAllMocks();

packages/plugins/rrweb-plugin-canvas-webrtc-record/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"devDependencies": {
4646
"@sentry-internal/rrweb": "2.41.0",
4747
"typescript": "^4.7.3",
48-
"vite": "^5.2.8",
49-
"vite-plugin-dts": "^3.8.1"
48+
"vite": "^6.4.1",
49+
"vite-plugin-dts": "^4.5.4"
5050
},
5151
"peerDependencies": {
5252
"@sentry-internal/rrweb": "^2.0.0-alpha.14"

packages/plugins/rrweb-plugin-canvas-webrtc-replay/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
"devDependencies": {
4646
"@sentry-internal/rrweb": "2.41.0",
4747
"typescript": "^4.7.3",
48-
"vite": "^5.2.8",
49-
"vite-plugin-dts": "^3.8.1"
48+
"vite": "^6.4.1",
49+
"vite-plugin-dts": "^4.5.4"
5050
},
5151
"peerDependencies": {
5252
"@sentry-internal/rrweb": "^2.0.0-alpha.14"

packages/plugins/rrweb-plugin-console-record/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
"@sentry-internal/rrweb": "2.41.0",
4949
"puppeteer": "^20.9.0",
5050
"typescript": "^4.7.3",
51-
"vite": "^5.2.8",
52-
"vite-plugin-dts": "^3.8.1",
53-
"vitest": "^1.4.0"
51+
"vite": "^6.4.1",
52+
"vite-plugin-dts": "^4.5.4",
53+
"vitest": "^2.1.9"
5454
},
5555
"peerDependencies": {
5656
"@sentry-internal/rrweb": "^2.0.0-alpha.14"

packages/plugins/rrweb-plugin-console-record/test/index.test.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,25 @@ export async function launchPuppeteer(
1919
});
2020
}
2121

22+
/**
23+
* Filter out console events originating from Vite's injected client script.
24+
* Vite 6 logs messages like "[vite] connected" or "[vite] failed to connect"
25+
* that pollute our snapshots.
26+
*/
27+
function filterViteClientEvents(snapshots: eventWithTime[]): eventWithTime[] {
28+
return snapshots.filter((event) => {
29+
if (event.type !== 6) return true;
30+
const trace = (event.data as any)?.payload?.trace;
31+
if (!Array.isArray(trace)) return true;
32+
return !trace.some((t: string) => t.includes('@vite/client'));
33+
});
34+
}
35+
2236
export function assertSnapshot(snapshots: eventWithTime[]) {
2337
expect(snapshots).toBeDefined();
24-
expect(stringifySnapshots(snapshots)).toMatchSnapshot();
38+
expect(
39+
stringifySnapshots(filterViteClientEvents(snapshots)),
40+
).toMatchSnapshot();
2541
}
2642

2743
describe('rrweb-plugin-console-record', () => {
@@ -35,8 +51,6 @@ describe('rrweb-plugin-console-record', () => {
3551
server = await createServer({
3652
preview: { port: 3000 },
3753
mode: 'test',
38-
// hmr calls `console.debug('[vite] connected')` and messes up our snapshots
39-
// so we disable it
4054
server: { hmr: false },
4155
});
4256
await server.listen();

packages/plugins/rrweb-plugin-console-replay/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"@rrweb/rrweb-plugin-console-record": "2.41.0",
4747
"@sentry-internal/rrweb": "2.41.0",
4848
"typescript": "^4.7.3",
49-
"vite": "^5.2.8",
50-
"vite-plugin-dts": "^3.8.1"
49+
"vite": "^6.4.1",
50+
"vite-plugin-dts": "^4.5.4"
5151
},
5252
"peerDependencies": {
5353
"@sentry-internal/rrweb": "^2.0.0-alpha.14"

0 commit comments

Comments
 (0)