Skip to content

Commit 749a829

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 aafb4e7 commit 749a829

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
@@ -92,7 +92,6 @@
9292
],
9393
"devDependencies": {
9494
"@biomejs/biome": "^1.4.0",
95-
"@codecov/rollup-plugin": "0.0.1-beta.5",
9695
"@rollup/plugin-commonjs": "^25.0.7",
9796
"@rollup/plugin-esm-shim": "^0.1.5",
9897
"@rollup/plugin-json": "^6.1.0",
@@ -102,8 +101,8 @@
102101
"@rollup/plugin-terser": "^0.4.4",
103102
"@rollup/plugin-typescript": "^11.1.6",
104103
"@rollup/pluginutils": "^5.1.0",
105-
"@size-limit/file": "~11.1.0",
106-
"@size-limit/webpack": "~11.1.0",
104+
"@size-limit/file": "~11.1.4",
105+
"@size-limit/webpack": "~11.1.4",
107106
"@strictsoftware/typedoc-plugin-monorepo": "^0.3.1",
108107
"@types/jest": "^27.4.1",
109108
"@types/jsdom": "^21.1.6",
@@ -112,7 +111,6 @@
112111
"codecov": "^3.6.5",
113112
"deepmerge": "^4.2.2",
114113
"downlevel-dts": "~0.11.0",
115-
"es-check": "7.1.0",
116114
"eslint": "7.32.0",
117115
"jest": "^27.5.1",
118116
"jest-environment-node": "^27.5.1",
@@ -122,12 +120,11 @@
122120
"nodemon": "^2.0.16",
123121
"npm-run-all": "^4.1.5",
124122
"prettier": "^3.1.1",
125-
"replace-in-file": "^4.0.0",
126123
"rimraf": "^3.0.2",
127124
"rollup": "^4.13.0",
128125
"rollup-plugin-cleanup": "^3.2.1",
129126
"rollup-plugin-license": "^3.3.1",
130-
"size-limit": "~11.1.0",
127+
"size-limit": "~11.1.4",
131128
"sucrase": "^3.35.0",
132129
"ts-jest": "^27.1.4",
133130
"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)