Skip to content

Commit b96cc52

Browse files
committed
feat(remix): Add release / sourcemap upload script.
1 parent f9e320e commit b96cc52

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

packages/remix/package.json

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/remix",
77
"author": "Sentry",
88
"license": "MIT",
9+
"bin": {
10+
"sentry-upload-sourcemaps": "scripts/upload-sourcemaps.js"
11+
},
912
"engines": {
1013
"node": ">=14"
1114
},
@@ -23,24 +26,16 @@
2326
"@sentry/tracing": "7.3.0",
2427
"@sentry/types": "7.3.0",
2528
"@sentry/utils": "7.3.0",
26-
"@sentry/webpack-plugin": "1.18.9",
2729
"tslib": "^1.9.3"
2830
},
2931
"devDependencies": {
3032
"@remix-run/node": "^1.4.3",
31-
"@remix-run/react": "^1.4.3",
32-
"@types/webpack": "^4.41.31"
33+
"@remix-run/react": "^1.4.3"
3334
},
3435
"peerDependencies": {
3536
"@remix-run/node": "^1.4.3",
3637
"@remix-run/react": "^1.4.3",
37-
"react": "16.x || 17.x || 18.x",
38-
"webpack": ">=4.0.0"
39-
},
40-
"peerDependenciesMeta": {
41-
"webpack": {
42-
"optional": true
43-
}
38+
"react": "16.x || 17.x || 18.x"
4439
},
4540
"scripts": {
4641
"build": "run-p build:rollup build:types",
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /usr/bin/env node
2+
/* eslint-disable no-console */
3+
const SentryCli = require('@sentry/cli');
4+
const argv = require('yargs/yargs')(process.argv.slice(2))
5+
.option('release', { type: 'string', describe: 'The release number', demandOption: true })
6+
.option('urlPrefix', { type: 'string', describe: 'The url prefix for the sourcemaps' })
7+
.option('buildPath', { type: 'string', describe: 'The path to the build directory' })
8+
.usage('Usage: $0 --release RELEASE [--urlPrefix URL_PREFIX] [--buildPath BUILD_PATH]').argv;
9+
10+
const RELEASE = argv.release;
11+
12+
if (!RELEASE) {
13+
console.error('No release provided.');
14+
process.exit(1);
15+
}
16+
17+
const URL_PREFIX = argv.urlPrefix || '~/build/';
18+
const BUILD_PATH = argv.buildPath || 'public/build';
19+
20+
const sentry = new SentryCli();
21+
22+
async function createRelease() {
23+
await sentry.releases.new(RELEASE);
24+
25+
await sentry.releases.uploadSourceMaps(RELEASE, {
26+
urlPrefix: URL_PREFIX,
27+
include: [BUILD_PATH],
28+
});
29+
30+
await sentry.releases.finalize(RELEASE);
31+
}
32+
33+
createRelease();

0 commit comments

Comments
 (0)