Skip to content

Commit c79c696

Browse files
committed
chore: Remove uneeded deps from main package.json
While working on my OTEL bump PR, I noticed some deps we no longer need. - @codecov/rollup-plugin can be removed because we dont use codecov bundle analysis atm - es-check can be removed because we don't check for es5 bundles anymore - replace-in-file can be removed for a simpler script with modern node apis Also bumped size-limit deps
1 parent 1217911 commit c79c696

File tree

3 files changed

+114
-326
lines changed

3 files changed

+114
-326
lines changed

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
],
9292
"devDependencies": {
9393
"@biomejs/biome": "^1.4.0",
94-
"@codecov/rollup-plugin": "0.0.1-beta.5",
9594
"@rollup/plugin-commonjs": "^25.0.7",
9695
"@rollup/plugin-esm-shim": "^0.1.5",
9796
"@rollup/plugin-json": "^6.1.0",
@@ -101,8 +100,8 @@
101100
"@rollup/plugin-terser": "^0.4.4",
102101
"@rollup/plugin-typescript": "^11.1.6",
103102
"@rollup/pluginutils": "^5.1.0",
104-
"@size-limit/file": "~11.1.0",
105-
"@size-limit/webpack": "~11.1.0",
103+
"@size-limit/file": "~11.1.4",
104+
"@size-limit/webpack": "~11.1.4",
106105
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
107106
"@types/jest": "^27.4.1",
108107
"@types/jsdom": "^21.1.6",
@@ -111,7 +110,6 @@
111110
"codecov": "^3.6.5",
112111
"deepmerge": "^4.2.2",
113112
"downlevel-dts": "~0.11.0",
114-
"es-check": "7.1.0",
115113
"eslint": "7.32.0",
116114
"jest": "^27.5.1",
117115
"jest-environment-node": "^27.5.1",
@@ -121,12 +119,11 @@
121119
"nodemon": "^2.0.16",
122120
"npm-run-all": "^4.1.5",
123121
"prettier": "^3.1.1",
124-
"replace-in-file": "^4.0.0",
125122
"rimraf": "^3.0.2",
126123
"rollup": "^4.13.0",
127124
"rollup-plugin-cleanup": "^3.2.1",
128125
"rollup-plugin-license": "^3.3.1",
129-
"size-limit": "~11.1.0",
126+
"size-limit": "~11.1.4",
130127
"sucrase": "^3.35.0",
131128
"ts-jest": "^27.1.4",
132129
"ts-node": "10.9.1",

scripts/versionbump.js

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
const replace = require('replace-in-file');
1+
const { readFile, writeFile } = require('node:fs').promises;
22
const pjson = require(`${process.cwd()}/package.json`);
33

4-
const files = process.argv.slice(2);
5-
if (files.length === 0) {
6-
console.error('Please provide files to bump');
7-
process.exit(1);
8-
}
4+
const REPLACE_REGEX = /\d+\.\d+.\d+(?:-\w+(?:\.\w+)?)?/g;
5+
6+
async function run() {
7+
const files = process.argv.slice(2);
8+
if (files.length === 0) {
9+
// eslint-disable-next-line no-console
10+
console.error('[versionbump] Please provide files to bump');
11+
process.exit(1);
12+
}
913

10-
replace({
11-
files: files,
12-
from: /\d+\.\d+.\d+(?:-\w+(?:\.\w+)?)?/g,
13-
to: pjson.version,
14-
})
15-
.then(changedFiles => {
16-
console.log('Modified files:', changedFiles.join(', '));
17-
})
18-
.catch(error => {
19-
console.error('Error occurred:', error);
14+
try {
15+
await Promise.all(
16+
files.map(async file => {
17+
const data = String(await readFile(file, 'utf8'));
18+
await writeFile(file, data.replace(REPLACE_REGEX, pjson.version));
19+
}),
20+
);
21+
22+
// eslint-disable-next-line no-console
23+
console.log(`[versionbump] Bumped version for ${files.join(', ')}`);
24+
} catch (error) {
25+
// eslint-disable-next-line no-console
26+
console.error('[versionbump] Error occurred:', error);
2027
process.exit(1);
21-
});
28+
}
29+
}
30+
31+
run();

0 commit comments

Comments
 (0)