Skip to content

Commit df8cf6b

Browse files
authored
fix: replace latest-version with a single fetch request (#1217)
1 parent 932b504 commit df8cf6b

File tree

3 files changed

+9
-194
lines changed

3 files changed

+9
-194
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
"koa": "^3.0.1",
126126
"koa-bodyparser": "^4.3.0",
127127
"koa-tree-router": "^0.12.1",
128-
"latest-version": "^7.0.0",
129128
"npm-run-all2": "^8.0.4",
130129
"prettier": "^2.8.4",
131130
"rimraf": "^5.0.5",

scripts/update-sdk-versions.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import latestVersion from 'latest-version';
21
import { spawnSync } from 'child_process';
32
import { readFileSync, writeFileSync } from 'fs';
43
import { join } from 'path';
54
import { fileURLToPath } from 'url';
65

76
const __dirname = fileURLToPath(new URL('.', import.meta.url));
87

9-
const latest = await latestVersion('@sentry/core');
8+
const response = await fetch('https://registry.npmjs.org/@sentry/core/latest');
9+
const data = await response.json();
10+
const latest = data.version;
11+
1012
const packageJsonPath = join(__dirname, '..', 'package.json');
1113
const packageJson = JSON.parse(readFileSync(packageJsonPath, { encoding: 'utf8' }));
1214
const current = packageJson.dependencies['@sentry/core'];
@@ -41,3 +43,4 @@ if (current !== latest) {
4143
// Update parameter that has the version in it
4244
spawnSync('yarn', ['build'], { stdio: 'inherit' });
4345
}
46+

0 commit comments

Comments
 (0)