Skip to content

Commit 2f879af

Browse files
Lms24getsantry[bot]Luca Forstner
authored
Add sourcemaps wizard instructions to uploading source maps docs (#7304)
Add docs for the new source maps wizard. The wizard will walk users through configuring source maps upload by running ``` npx @sentry/wizard@latest -i sourcemaps ``` In this patch, the wizard instructions are added to these pages: - Source Maps index page - Affected bundler plugin pages (Webpack, Vite, Rollup, esbuild, tsc, sentry-cli) Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com> Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
1 parent dc88bac commit 2f879af

File tree

11 files changed

+117
-28
lines changed

11 files changed

+117
-28
lines changed

src/includes/sentry-cli-sourcemaps.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 2. Configure Sentry CLI
1+
### 2. Configure Sentry CLI
22

33
<Note>
44

@@ -22,7 +22,7 @@ SENTRY_ORG=___ORG_SLUG___
2222
SENTRY_PROJECT=___PROJECT_SLUG___
2323
```
2424

25-
## 3. Inject Debug IDs Into Artifacts
25+
### 3. Inject Debug IDs Into Artifacts
2626

2727
Debug IDs are used to match the stack frame of an event with its corresponding minified source and source map file. Visit [What are Artifact Bundles](/platforms/javascript/sourcemaps/troubleshooting_js/artifact-bundles/) if you want to learn more about Artifact Bundles and Debug IDs.
2828

@@ -32,7 +32,7 @@ To inject Debug IDs, use the following command:
3232
sentry-cli sourcemaps inject /path/to/directory
3333
```
3434

35-
### Verify Debug IDs Were Injected in Artifacts
35+
#### Verify Debug IDs Were Injected in Artifacts
3636

3737
Minified source files should contain at the end a comment named `debugId` like:
3838

@@ -52,21 +52,21 @@ Source maps should contain a field named `debug_id` like:
5252
}
5353
```
5454

55-
## 4. Upload Artifact Bundle
55+
### 4. Upload Artifact Bundle
5656

5757
After you've injected Debug IDs into your artifacts, upload them using the following command.
5858

5959
```bash
6060
sentry-cli sourcemaps upload /path/to/directory
6161
```
6262

63-
### Verify That Artifact Bundles Were Uploaded
63+
#### Verify That Artifact Bundles Were Uploaded
6464

6565
Open up Sentry and navigate to **Project Settings > Source Maps**. If you choose “Artifact Bundles” in the tabbed navigation, you'll see all the artifact bundles that have been successfully uploaded to Sentry.
6666

67-
## Optional Steps
67+
### Optional Steps
6868

69-
### Associating `release` with Artifact Bundle
69+
#### Associating `release` with Artifact Bundle
7070

7171
Provide a `release` property in your SDK options.
7272

@@ -90,7 +90,7 @@ Running `upload` with `--release` **doesn't automatically create a release in Se
9090

9191
</Note>
9292

93-
### Associating `dist` with Artifact Bundle
93+
#### Associating `dist` with Artifact Bundle
9494

9595
In addition to `release`, you can also add a `dist` to your uploaded artifacts, to set the distribution identifier for uploaded files. To do so, run the `sourcemaps upload` command with the additional `--dist` option.
9696

@@ -100,7 +100,7 @@ The distribution identifier is used to distinguish between multiple files of the
100100
sentry-cli sourcemaps upload --release=<release_name> --dist=<dist_name> /path/to/directory
101101
```
102102

103-
## 5. Deploy your Application
103+
### 5. Deploy your Application
104104

105105
If you're following this guide from your local machine, then you've successfully:
106106

src/includes/sourcemaps-cli-step-one.mdx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<Include name="debug-id-requirement.mdx" />
2-
3-
## 1. Generate Source Maps
1+
### 1. Generate Source Maps
42

53
You will need to generate source maps with the tooling of your choice. See examples from other guides linked under [Uploading Source Maps](https://docs.sentry.io/platforms/javascript/sourcemaps/?uploading-source-maps).
64

src/includes/sourcemaps-typescript.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ This guide is only applicable if you're using `tsc` to compile your project. If
66

77
</Note>
88

9-
## 1. Generate Source Maps
9+
## Automatic Setup
10+
11+
The easiest way to configure uploading source maps with `tsc` and `sentry-cli` is by using the Sentry Wizard:
12+
13+
<Include name="sourcemaps-wizard-instructions.mdx" />
14+
15+
If you want to configure source maps upload manually instead, follow the steps below.
16+
17+
## Manual Setup
18+
19+
### 1. Generate Source Maps
1020

1121
First, configure the TypeScript compiler to output source maps:
1222

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
```bash
2+
npx @sentry/wizard@latest -i sourcemaps
3+
```
4+
5+
The wizard will guide you through the following steps:
6+
7+
- Logging into Sentry and selecting a project
8+
- Installing the necessary Sentry packages
9+
- Configuring your build tool to generate and upload source maps
10+
- Configuring your CI to upload source maps
11+
12+
<Alert level="warning">
13+
14+
Configuring source maps upload with the Sentry Wizard is still experimental and [under development](https://github.com/getsentry/sentry-wizard/issues/290).
15+
Let us know on [GitHub](https://github.com/getsentry/sentry-wizard/issues/new/choose) if you have feedback or issues.
16+
17+
</Alert>

src/platform-includes/sourcemaps/overview/javascript.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
## Uploading Source Maps
22

3-
We've compiled a list of guides on how to upload source maps to Sentry for the most popular JavaScript build tools:
3+
The easiest way to configure uploading source maps is by using the Sentry Wizard:
4+
5+
<Include name="sourcemaps-wizard-instructions.mdx" />
6+
7+
If you want to configure source maps upload manually, follow the guide for your bundler or build tool below.
48

59
### Sentry Bundler Support
610

src/platform-includes/sourcemaps/overview/javascript.svelte.mdx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ If you are on an older version and you want to upload source maps we recommend u
88

99
</Note>
1010

11-
This page is a guide on how to create releases and upload source maps to Sentry when bundling your Svelte app.
11+
### Using the Sentry Wizard
12+
13+
The easiest way to configure uploading source maps is by using the Sentry Wizard:
14+
15+
<Include name="sourcemaps-wizard-instructions.mdx" />
16+
17+
If you want to configure source maps upload manually, follow the guide for your bundler or build tool below.
18+
19+
### Manually Configuring Source Maps Upload
1220

1321
To generate source maps with your Svelte project, you need to set the source map [compiler options](https://svelte.dev/docs#compile-time-svelte-compile) in your Svelte config:
1422

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
In this guide, you'll learn how to successfully upload source maps using our `sentry-cli` tool.
22

3+
<Include name="debug-id-requirement.mdx" />
4+
5+
## Automatic Setup
6+
7+
The easiest way to configure uploading source maps with Sentry CLI is by using the Sentry Wizard:
8+
9+
<Include name="sourcemaps-wizard-instructions.mdx" />
10+
11+
If you want to configure source maps upload with the CLI, follow the steps below.
12+
13+
## Manual Setup
14+
315
<Include name="sourcemaps-cli-step-one.mdx" />

src/platform-includes/sourcemaps/upload/esbuild/javascript.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ If you are on an older version and you want to upload source maps we recommend u
88

99
You can use the Sentry esbuild plugin to automatically create releases and upload source maps to Sentry when bundling your app.
1010

11-
## Install
11+
## Automatic Setup
12+
13+
The easiest way to configure uploading source maps with esbuild is by using the Sentry Wizard:
14+
15+
<Include name="sourcemaps-wizard-instructions.mdx" />
16+
17+
If you want to configure source maps upload with esbuild manually, follow the steps below.
18+
19+
## Manual Setup
20+
21+
Install the Sentry esbuild plugin:
1222

1323
```bash {tabTitle:npm}
1424
npm install @sentry/esbuild-plugin --save-dev
@@ -18,7 +28,7 @@ npm install @sentry/esbuild-plugin --save-dev
1828
yarn add @sentry/esbuild-plugin --dev
1929
```
2030

21-
## Configure
31+
### Configure
2232

2333
Learn more about configuring the plugin in our [Sentry esbuild Plugin documentation](https://www.npmjs.com/package/@sentry/esbuild-plugin).
2434

@@ -46,6 +56,6 @@ require("esbuild").build({
4656
<Note>
4757

4858
The Sentry esbuild plugin doesn't upload source maps in watch-mode/development-mode.
49-
We recommend running a production build to test your implementation.
59+
We recommend running a production build to test your configuration.
5060

5161
</Note>

src/platform-includes/sourcemaps/upload/rollup/javascript.mdx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ If you are on an older version and you want to upload source maps we recommend u
88

99
You can use the Sentry Rollup plugin to automatically create releases and upload source maps to Sentry when bundling your app.
1010

11-
## Installation
11+
## Automatic Setup
12+
13+
The easiest way to configure uploading source maps with rollup is by using the Sentry Wizard:
14+
15+
<Include name="sourcemaps-wizard-instructions.mdx" />
16+
17+
If you want to configure source maps upload with rollup manually, follow the steps below.
18+
19+
## Manual Setup
20+
21+
Install the Sentry Rollup plugin:
1222

1323
```bash {tabTitle:npm}
1424
npm install @sentry/rollup-plugin --save-dev
@@ -28,6 +38,9 @@ Example:
2838
import { sentryRollupPlugin } from "@sentry/rollup-plugin";
2939

3040
export default {
41+
output: {
42+
sourcemap: true, // Source map generation must be turned on
43+
},
3144
plugins: [
3245
// Put the Sentry rollup plugin after all other plugins
3346
sentryRollupPlugin({
@@ -39,8 +52,5 @@ export default {
3952
authToken: process.env.SENTRY_AUTH_TOKEN,
4053
}),
4154
],
42-
output: {
43-
sourcemap: true, // Source map generation must be turned on
44-
},
4555
};
4656
```

src/platform-includes/sourcemaps/upload/vite/javascript.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@ If you are on an older version and you want to upload source maps we recommend u
88

99
You can use the Sentry Vite plugin to automatically create releases and upload source maps to Sentry when bundling your app.
1010

11-
## Installation
11+
## Automatic Setup
12+
13+
The easiest way to configure uploading source maps with Vite is by using the Sentry Wizard:
14+
15+
<Include name="sourcemaps-wizard-instructions.mdx" />
16+
17+
If you want to configure source maps upload with Vite manually, follow the steps below.
18+
19+
## Manual Setup
20+
21+
Install the Sentry Vite plugin:
1222

1323
```bash {tabTitle:npm}
1424
npm install @sentry/vite-plugin --save-dev
@@ -18,7 +28,7 @@ npm install @sentry/vite-plugin --save-dev
1828
yarn add @sentry/vite-plugin --dev
1929
```
2030

21-
## Configuration
31+
### Configuration
2232

2333
Learn more about configuring the plugin in our [Sentry Vite Plugin documentation](https://www.npmjs.com/package/@sentry/vite-plugin).
2434

@@ -49,6 +59,6 @@ export default defineConfig({
4959
<Note>
5060

5161
The Sentry Vite plugin doesn't upload source maps in watch-mode/development-mode.
52-
We recommend running a production build to test your implementation.
62+
We recommend running a production build to test your configuration.
5363

5464
</Note>

0 commit comments

Comments
 (0)