Skip to content

Commit 337c8da

Browse files
authored
docs: Add deprecation notices to bin scripts (#20570)
If there is only one `bin` script (which is the case for Remix and Profiling), it's possible to just run `npx @sentry/remix` and it will run this one script. But to make it more clear what's going to happen, we're introducing an argument `--upload-sourcemaps`. **Remix:** The script usage changes so we can rename the `bin` script in the next major version. **Profiling:** The script is going to be deleted and deprecation notices are added. Related to: #20422
1 parent 76d60a0 commit 337c8da

4 files changed

Lines changed: 22 additions & 6 deletions

File tree

packages/profiling-node/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,10 @@ Once you run `node esbuild.serverless.js` esbuild wil bundle and output the file
238238
the binaries will be copied. This is wasteful as you will likely only need one of these libraries to be available during
239239
runtime.
240240

241-
To prune the other libraries, profiling-node ships with a small utility script that helps you prune unused binaries. The
242-
script can be invoked via `sentry-prune-profiler-binaries`:
241+
> **Deprecation notice:** This script will be removed in the next major version. If you depend on it, please comment on
242+
> [this issue](https://github.com/getsentry/sentry-javascript/issues/20567).
243+
244+
To prune the other libraries, profiling-node ships with a small utility script that helps you prune unused binaries:
243245

244246
```bash
245247
npx --package=@sentry/profiling-node sentry-prune-profiler-binaries

packages/profiling-node/scripts/prune-profiler-binaries.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Arguments:\n
5656
process.exit(0);
5757
}
5858

59+
console.warn(
60+
'[Sentry] Warning: This script will be removed in the next major version. See: https://github.com/getsentry/sentry-javascript/issues/20567',
61+
);
62+
5963
const ARGV_ERRORS = [];
6064

6165
const NODE_TO_ABI = {

packages/remix/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ Sentry.captureEvent({
122122
The Remix SDK provides a script that automatically creates a release and uploads sourcemaps. To generate sourcemaps with
123123
Remix, you need to call `remix build` with the `--sourcemap` option.
124124

125-
On release, call `sentry-upload-sourcemaps` to upload source maps and create a release:
125+
On release, call the upload sourcemaps command to upload source maps and create a release:
126126

127127
```bash
128-
npx --package=@sentry/remix sentry-upload-sourcemaps
128+
npx @sentry/remix --upload-sourcemaps
129129
```
130130

131-
To see more details on how to use the command, call `npx --package=@sentry/remix sentry-upload-sourcemaps --help`.
131+
To see more details on how to use the command, run `npx @sentry/remix --upload-sourcemaps --help`.
132132

133133
For more advanced configuration,
134134
[directly use `sentry-cli` to upload source maps.](https://github.com/getsentry/sentry-cli).

packages/remix/scripts/sentry-upload-sourcemaps.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const DEFAULT_URL_PREFIX = '~/build/';
88
const DEFAULT_BUILD_PATH = 'public/build';
99

1010
const argv = yargs(process.argv.slice(2))
11+
.option('upload-sourcemaps', {
12+
type: 'boolean',
13+
describe: 'Specifies the upload sourcemaps command. Recommended for forward compatibility.',
14+
})
1115
.option('release', {
1216
type: 'string',
1317
describe:
@@ -48,7 +52,7 @@ const argv = yargs(process.argv.slice(2))
4852
default: true,
4953
})
5054
.usage(
51-
'Usage: $0\n' +
55+
'Usage: npx @sentry/remix --upload-sourcemaps\n' +
5256
' [--release RELEASE]\n' +
5357
' [--org ORG]\n' +
5458
' [--project PROJECT]\n' +
@@ -64,6 +68,12 @@ const argv = yargs(process.argv.slice(2))
6468
)
6569
.wrap(120).argv;
6670

71+
if (!argv.uploadSourcemaps) {
72+
process.stderr.write(
73+
'[Sentry] Warning: Calling this script without --upload-sourcemaps is deprecated. Use: `npx @sentry/remix --upload-sourcemaps`\n',
74+
);
75+
}
76+
6777
const buildPath = argv.buildPath || DEFAULT_BUILD_PATH;
6878
const urlPrefix = argv.urlPrefix || DEFAULT_URL_PREFIX;
6979

0 commit comments

Comments
 (0)