Skip to content

Commit

Permalink
feat: Add pnpm installation to all JS snippets (#10578)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad authored Jul 4, 2024
1 parent 3a028db commit 708a42c
Show file tree
Hide file tree
Showing 91 changed files with 508 additions and 189 deletions.
14 changes: 11 additions & 3 deletions docs/cli/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION="{{@inject apps.version

This will automatically download the correct version of `sentry-cli` for your operating system and install it. If necessary, it will prompt for your admin password for `sudo`. For a different installation location or for systems without `sudo` (like Windows), you can `export INSTALL_DIR=/custom/installation/path` before running this command.

To verify its installed correctly you can bring up the help:
To verify it's installed correctly you can bring up the help:

```bash
sentry-cli --help
Expand All @@ -37,17 +37,25 @@ sentry-cli --help

There is also the option to install `sentry-cli` via npm for specialized use cases. This, for instance, is useful for build servers. The package is called `@sentry/cli` and in the post installation it will download the appropriate release binary:

```bash
```bash {tabTitle:npm}
npm install @sentry/cli
```

```bash {tabTitle:yarn}
yarn add @sentry/cli
```

```bash {tabTitle:pnpm}
pnpm add @sentry/cli
```

You can then find it in the `.bin` folder:

```bash
./node_modules/.bin/sentry-cli --help
```

In case you want to install this with npm system wide with sudo you will need to pass `-unsafe-perm` to it:
In case you want to install this with npm system wide with sudo you will need to pass `--unsafe-perm` to it:

```bash
sudo npm install -g @sentry/cli --unsafe-perm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ Please open an issue in the [Sentry Testkit repository](https://zivl.github.io/s
## Installation

```bash {tabTitle:npm}
npm install --save-dev sentry-testkit
npm install sentry-testkit --save-dev
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add sentry-testkit --dev
```

```bash {tabTitle:pnpm}
pnpm add sentry-testkit --save-dev
```

### Using in tests

<SignInNote />
Expand Down
10 changes: 7 additions & 3 deletions docs/platforms/javascript/common/best-practices/web-workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,20 @@ notSupported:

Sentry's Browser SDK supports [Web Workers API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). To capture unhandled errors from Web Workers:

Install `@sentry/browser` using `yarn` or `npm`:
Install `@sentry/browser` using your package manager:

```bash {tabTitle:npm}
npm install --save @sentry/browser
npm install @sentry/browser --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/browser
```

```bash {tabTitle:pnpm}
pnpm add @sentry/browser
```

Then you can use it:

<SignInNote />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ In this case, you need to set `skipOpenTelemetrySetup: true` in your `Sentry.ini
1. First, install the `@sentry/opentelemetry` package.

```bash {tabTitle:npm}
npm install --save @sentry/opentelemetry
npm install @sentry/opentelemetry --save
```

```bash {tabTitle:yarn}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___
Install the Sentry Webpack plugin:

```shell {tabTitle:npm}
npm install --save-dev @sentry/webpack-plugin
npm install @sentry/webpack-plugin --save-dev
```

```shell {tabTitle:Yarn}
yarn add -D @sentry/webpack-plugin
```shell {tabTitle:yarn}
yarn add @sentry/webpack-plugin --dev
```

```shell {tabTitle:pnpm}
pnpm add -D @sentry/webpack-plugin
pnpm add @sentry/webpack-plugin --save-dev
```


Expand Down Expand Up @@ -106,15 +106,15 @@ Learn more about configuring the plugin in our [Sentry webpack plugin documentat
Install the Sentry esbuild plugin:

```shell {tabTitle:npm}
npm install --save-dev @sentry/esbuild-plugin
npm install @sentry/esbuild-plugin --save-dev
```

```shell {tabTitle:Yarn}
yarn add -D @sentry/esbuild-plugin
```shell {tabTitle:yarn}
yarn add @sentry/esbuild-plugin --dev
```

```shell {tabTitle:pnpm}
pnpm add -D @sentry/esbuild-plugin
pnpm add @sentry/esbuild-plugin --save-dev
```

Then, follow the [official Nx documentation](https://nx.dev/nx-api/angular/executors/browser-esbuild#examples) to register the Sentry esbuild plugin (`@sentry/esbuild-plugin`) in your `project.json` file. For example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ Before you start configuring the source maps upload, make sure that you're [gene
Install the custom webpack builder for Angular and the Sentry webpack plugin:

```shell {tabTitle:npm}
npm install --save-dev @angular-builders/custom-webpack @sentry/webpack-plugin
npm install @angular-builders/custom-webpack @sentry/webpack-plugin --save-dev
```

```shell {tabTitle:Yarn}
yarn add --dev @angular-builders/custom-webpack @sentry/webpack-plugin
```shell {tabTitle:yarn}
yarn add @angular-builders/custom-webpack @sentry/webpack-plugin --dev
```

```shell {tabTitle:pnpm}
pnpm add @angular-builders/custom-webpack @sentry/webpack-plugin --save-dev
```

## Configure
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/angular/angular1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ From version 7 onwards, the Sentry JavaScript SDK will not support AngularJS 1.x
Install `@sentry/browser` and `@sentry/integrations` using `yarn` or `npm`:

```bash {tabTitle:npm}
npm install --save @sentry/browser@6 @sentry/integrations@6
npm install @sentry/browser@6 @sentry/integrations@6 --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/browser@6 @sentry/integrations@6
```

```bash {tabTitle:pnpm}
pnpm add @sentry/browser@6 @sentry/integrations@6
```

and afterwards using it like this:

<SignInNote />
Expand Down
4 changes: 2 additions & 2 deletions docs/platforms/javascript/guides/astro/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ This guide also explains how to further customize your SDK setup.
## Manual Installation

```bash {tabTitle:npm}
npm install --save @sentry/astro
npm install @sentry/astro --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/astro
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/aws-serverless` (minimum version `8.0.0`) package
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/aws-serverless @sentry/profiling-node
npm install @sentry/aws-serverless @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/aws-serverless @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/aws-serverless @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add the `nodeProfilingIntegration` to your integrations, and set the `profilesSampleRate`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/connect/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
3 changes: 1 addition & 2 deletions docs/platforms/javascript/guides/electron/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ Once configured, all unhandled exceptions and native crashes are automatically c
Our Sentry Wizard can help with the setup process. Make sure you have installed the `@sentry/wizard` npm package globally, then run:

```shell
npm install -g @sentry/wizard
sentry-wizard --integration electron
npx @sentry/wizard@latest -i electron
```

This will guide you through the installation and configuration process and suggest useful tools for development. If you instead prefer to setup manually, keep reading.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/express/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/fastify/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
10 changes: 7 additions & 3 deletions docs/platforms/javascript/guides/gatsby/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ categories:
options={["error-monitoring", "performance", "session-replay"]}
/>

To use Sentry with your Gatsby application, you will need to use `@sentry/gatsby` (Sentrys Gatsby SDK):
To use Sentry with your Gatsby application, you will need to use `@sentry/gatsby` (Sentry's Gatsby SDK):

```bash {tabTitle:npm}
npm install --save @sentry/gatsby
npm install @sentry/gatsby --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/gatsby
```

```bash {tabTitle:pnpm}
pnpm add @sentry/gatsby
```

<Note>

`@sentry/gatsby` is a wrapper around the `@sentry/react` package, with added functionality related to Gatsby. All methods available in the `@sentry/react` package can also be imported from `@sentry/gatsby`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/google-cloud-serverless` (minimum version `8.0.0`)
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/google-cloud-serverless @sentry/profiling-node
npm install @sentry/google-cloud-serverless @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/google-cloud-serverless @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/google-cloud-serverless @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add the `nodeProfilingIntegration` to your integrations, and set the `profilesSampleRate`.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/hapi/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/koa/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/node` (minimum version `7.44.1`) package installed
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/node @sentry/profiling-node
npm install @sentry/node @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/node @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/node @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
8 changes: 6 additions & 2 deletions docs/platforms/javascript/guides/nestjs/profiling/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ You have to have the `@sentry/nestjs` package installed.
</Note>

```bash {tabTitle:npm}
npm install --save @sentry/nestjs @sentry/profiling-node
npm install @sentry/nestjs @sentry/profiling-node --save
```

```bash {tabTitle:Yarn}
```bash {tabTitle:yarn}
yarn add @sentry/nestjs @sentry/profiling-node
```

```bash {tabTitle:pnpm}
pnpm add @sentry/nestjs @sentry/profiling-node
```

## Enabling Profiling

To enable profiling, import `@sentry/profiling-node`, add `ProfilingIntegration` to your `integrations`, and set the `profilesSampleRate`.
Expand Down
Loading

0 comments on commit 708a42c

Please sign in to comment.