Skip to content

Commit a21bf7d

Browse files
committed
more dep cleanup
1 parent 749a829 commit a21bf7d

File tree

8 files changed

+444
-4110
lines changed

8 files changed

+444
-4110
lines changed

dev-packages/bundle-analyzer-scenarios/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
This repository contains a set of scenarios to check the SDK against webpack bundle analyzer.
44

5-
You can run the scenarios by running `yarn analyze` and selecting the scenario you want to run.
5+
You can run the scenarios by running `yarn analyze --scenario SCENARIO_NAME`. To view all avaliable scenarios, run
6+
`yarn analyze --list`.
67

78
If you want to have more granular analysis of modules, you can build the SDK packages with with `preserveModules` set to
89
`true`. You can do this via the `SENTRY_BUILD_PRESERVE_MODULES`.

dev-packages/bundle-analyzer-scenarios/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
"license": "MIT",
99
"private": true,
1010
"dependencies": {
11-
"html-webpack-plugin": "^5.5.0",
12-
"inquirer": "^8.2.0",
13-
"webpack": "^5.76.0",
14-
"webpack-bundle-analyzer": "^4.5.0"
11+
"html-webpack-plugin": "^5.6.0",
12+
"webpack": "^5.92.1",
13+
"webpack-bundle-analyzer": "^4.10.2"
1514
},
1615
"scripts": {
1716
"analyze": "node webpack.cjs"

dev-packages/bundle-analyzer-scenarios/webpack.cjs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
const path = require('path');
2-
const { promises } = require('fs');
1+
const path = require('node:path');
2+
const { promises } = require('node:fs');
3+
const { parseArgs } = require('node:util');
34

4-
const inquirer = require('inquirer');
55
const webpack = require('webpack');
66
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
77
const HtmlWebpackPlugin = require('html-webpack-plugin');
88

99
async function init() {
1010
const scenarios = await getScenariosFromDirectories();
1111

12-
const answers = await inquirer.prompt([
13-
{
14-
type: 'rawlist',
15-
name: 'scenario',
16-
message: 'Which scenario you want to run?',
17-
choices: scenarios,
18-
pageSize: scenarios.length,
19-
loop: false,
20-
},
21-
]);
12+
const { values } = parseArgs({
13+
args: process.argv.slice(2),
14+
options: { scenario: { type: 'string', short: 's' }, list: { type: 'boolean', short: 'l' } },
15+
});
16+
17+
if (values.list) {
18+
console.log('Available scenarios:', scenarios);
19+
process.exit(0);
20+
}
21+
22+
if (!scenarios.some(scenario => scenario === values.scenario)) {
23+
console.error('Invalid scenario:', values.scenario);
24+
console.error('Available scenarios:', scenarios);
25+
process.exit(1);
26+
}
2227

23-
console.log(`Bundling scenario: ${answers.scenario}`);
28+
console.log(`Bundling scenario: ${values.scenario}`);
2429

25-
await runWebpack(answers.scenario);
30+
await runWebpack(values.scenario);
2631
}
2732

2833
async function runWebpack(scenario) {

dev-packages/rollup-utils/plugins/npmPlugins.mjs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
* Sucrase plugin docs: https://github.com/rollup/plugins/tree/master/packages/sucrase
88
*/
99

10-
import * as fs from 'fs';
11-
import * as path from 'path';
12-
13-
import { codecovRollupPlugin } from '@codecov/rollup-plugin';
1410
import json from '@rollup/plugin-json';
1511
import replace from '@rollup/plugin-replace';
1612
import cleanup from 'rollup-plugin-cleanup';
@@ -160,19 +156,4 @@ export function makeRrwebBuildPlugin({ excludeShadowDom, excludeIframe } = {}) {
160156
});
161157
}
162158

163-
/**
164-
* Plugin that uploads bundle analysis to codecov.
165-
*
166-
* @param type The type of bundle being uploaded.
167-
* @param prefix The prefix for the codecov bundle name. Defaults to 'npm'.
168-
*/
169-
export function makeCodeCovPlugin() {
170-
const packageJson = JSON.parse(fs.readFileSync(path.resolve(process.cwd(), './package.json'), { encoding: 'utf8' }));
171-
return codecovRollupPlugin({
172-
enableBundleAnalysis: process.env.CODECOV_TOKEN !== undefined,
173-
bundleName: packageJson.name,
174-
uploadToken: process.env.CODECOV_TOKEN,
175-
});
176-
}
177-
178159
export { makeExtractPolyfillsPlugin } from './extractPolyfillsPlugin.mjs';

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,15 @@
133133
"vitest": "^1.6.0",
134134
"yalc": "^1.0.0-pre.53"
135135
},
136+
"//_resolutions_comment": [
137+
"Because new versions of strip-ansi, string-width, and wrap-ansi are ESM only packages,",
138+
"we need to resolve them to the CommonJS versions.",
139+
"This is a temporary solution until we can upgrade to a version of lerna that supports ESM packages"
140+
],
136141
"resolutions": {
137-
"gauge/strip-ansi": "6.0.1"
142+
"gauge/strip-ansi": "6.0.1",
143+
"wide-align/string-width": "4.2.3",
144+
"cliui/wrap-ansi": "7.0.0"
138145
},
139146
"version": "0.0.0",
140147
"name": "sentry-javascript",

packages/sveltekit/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
"@sentry/types": "8.12.0",
4545
"@sentry/utils": "8.12.0",
4646
"@sentry/vite-plugin": "2.20.1",
47-
"magic-string": "0.30.7",
47+
"magic-string": "0.30.10",
4848
"magicast": "0.2.8",
4949
"sorcery": "0.11.0"
5050
},
5151
"devDependencies": {
52-
"@babel/types": "7.20.7",
52+
"@babel/types": "7.24.7",
5353
"@sveltejs/kit": "^2.0.2",
5454
"svelte": "^4.2.8",
5555
"vite": "^5.0.10"

packages/sveltekit/src/vite/autoInstrument.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as fs from 'fs';
22
import * as path from 'path';
3-
/* eslint-disable @sentry-internal/sdk/no-optional-chaining */
43
import type { ExportNamedDeclaration } from '@babel/types';
54
import { parseModule } from 'magicast';
65
import type { Plugin } from 'vite';

0 commit comments

Comments
 (0)