Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/e2e/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ All tests completed successfully. Your SDK changes work correctly with this test
- **Test app not found**: List available apps and ask user to clarify
- **Packed tarballs missing**: Run `yarn build:tarball` at the repo root, then `yarn test:prepare` in `dev-packages/e2e-tests`
- **Build failures**: Fix build errors before running tests
- **pnpm errors such as `packages field missing or empty`**: The app needs the pnpm version in its `volta.pnpm`. Run with Volta, which installs that version
- **`ERR_PNPM_IGNORED_BUILDS`**: A dependency has a build script that the app's `allowBuilds` does not list. Add it to the app's `pnpm-workspace.yaml`: `true` if the app needs the script, `false` if the script only prints a message

## Common Test Applications

Expand Down
6 changes: 3 additions & 3 deletions .cursor/environment.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "Sentry JavaScript SDK Development",
"install": "curl https://get.volta.sh | bash && export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && export VOLTA_FEATURE_PNPM=1 && yarn install",
"start": "export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && export VOLTA_FEATURE_PNPM=1",
"install": "curl https://get.volta.sh | bash && export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && yarn install",
"start": "export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\"",
"terminals": [
{
"name": "Development",
"command": "export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && export VOLTA_FEATURE_PNPM=1 && echo 'Volta setup complete. Node version:' && node --version && echo 'Yarn version:' && yarn --version",
"command": "export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && echo 'Volta setup complete. Node version:' && node --version && echo 'Yarn version:' && yarn --version",
"description": "Main development terminal with Volta environment configured"
}
]
Expand Down
29 changes: 5 additions & 24 deletions .github/actions/install-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
name: 'Install pnpm'
description: 'Installs the pnpm version that Volta pins for a package.'
inputs:
package-json:
description: 'The package.json to read `volta.pnpm` from. `volta.extends` is followed until a version is found.'
default: 'package.json'
description: 'Puts the pnpm version from the root devDependencies on PATH. Run it after the dependencies are installed.'

runs:
using: 'composite'
steps:
- name: Resolve pnpm version
id: pnpm-version
# The devDependency is the one pnpm version for CI and local runs. An app that needs another version sets
# `packageManager` in its package.json, and pnpm switches to that version.
- name: Add pnpm to PATH
shell: bash
env:
PACKAGE_JSON: ${{ inputs.package-json }}
# Keep in sync with `getPnpmMajor` in `dev-packages/e2e-tests/lib/pnpmOverrides.ts`. It writes the overrides in
# the format of the version it finds, so a different lookup breaks the install.
run: |
package_json="$PACKAGE_JSON"
until version=$(jq -er '.volta.pnpm' "$package_json"); do
extends=$(jq -er '.volta.extends' "$package_json") || {
echo "::error::No volta.pnpm in $PACKAGE_JSON or the files it extends"
exit 1
}
package_json="$(dirname "$package_json")/$extends"
done
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
with:
version: ${{ steps.pnpm-version.outputs.version }}
run: echo "$GITHUB_WORKSPACE/node_modules/pnpm" >> "$GITHUB_PATH"
15 changes: 4 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,6 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand Down Expand Up @@ -1055,10 +1052,6 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand All @@ -1085,6 +1078,8 @@ jobs:
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm

- name: Restore tarball artifacts
uses: actions/download-artifact@v8
Expand Down Expand Up @@ -1211,10 +1206,6 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand All @@ -1235,6 +1226,8 @@ jobs:
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm

- name: Restore tarball artifacts
uses: actions/download-artifact@v8
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ jobs:
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm
with:
package-json: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Node
uses: actions/setup-node@v7
with:
Expand All @@ -131,6 +127,8 @@ jobs:
with:
path: ${{ env.CACHED_BUILD_PATHS }}
key: canary-${{ env.HEAD_COMMIT }}
- name: Install pnpm
uses: ./.github/actions/install-pnpm

- name: Prepare e2e tests
run: yarn test:prepare
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
VITE_E2E_TEST_DSN: 'https://username@domain/123'
steps:
- uses: actions/checkout@v7
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- uses: actions/setup-node@v7
with:
node-version-file: 'package.json'
- run: yarn install --frozen-lockfile --ignore-engines
- name: Install pnpm
uses: ./.github/actions/install-pnpm
- run: yarn build:ci
- run: yarn build:tarball
- run: yarn test:prepare
Expand Down
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ Monorepo with 40+ packages in `@sentry/*`, managed with Yarn workspaces and Nx.

## Setup

- [Volta](https://volta.sh/) for Node.js/Yarn/PNPM version management
- Requires `VOLTA_FEATURE_PNPM=1`
- [Volta](https://volta.sh/) for Node.js/Yarn version management. pnpm (for E2E tests) is a root devDependency
- After cloning: `yarn install && yarn build`
- Never change Volta, Yarn, or package manager versions unless explicitly asked

Expand Down
9 changes: 4 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ Developer Documentation.

## Setting up an Environment

We use [Volta](https://volta.sh/) to ensure we use consistent versions of node, yarn and pnpm.

Make sure to also enable [pnpm support in Volta](https://docs.volta.sh/advanced/pnpm) if you want to run the E2E tests
locally.
We use [Volta](https://volta.sh/) to ensure we use consistent versions of node and yarn. `yarn install` also installs
the pnpm version that the E2E tests use.

`sentry-javascript` is a monorepo containing several packages, managed with Yarn workspaces and Nx. To get started,
install all dependencies, and then perform an initial build, so TypeScript can read all of the linked type definitions.
Expand Down Expand Up @@ -80,7 +78,8 @@ E2E tests verify SDK behavior in real-world framework scenarios.
### Prerequisites

1. **Docker**: Required for some E2E tests
2. **Volta with pnpm support**: Enable pnpm in Volta by setting `VOLTA_FEATURE_PNPM=1` in your environment. See [Volta pnpm docs](https://docs.volta.sh/advanced/pnpm).
2. **Volta**: The E2E tests run each app on the node version that it pins. Without Volta, they use your current node
version.

### Step-by-Step Instructions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@
"dependencies": {
"esbuild": "0.28.0",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
Comment thread
mydea marked this conversation as resolved.
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allowBuilds:
esbuild: true
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,5 @@
"@sentry/bundler-plugins": "11.7.0",
"react": "19.2.4",
"rolldown": "1.0.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-node-resolve": "15.2.3",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-node-resolve": "16.0.3",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@
"vite": "4.5.14",
"@vitejs/plugin-react": "5.2.0",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allowBuilds:
esbuild: true
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,5 @@
"dependencies": {
"vite": "6.4.1",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allowBuilds:
esbuild: true
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@
"vite": "7.3.1",
"@vitejs/plugin-react": "5.2.0",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allowBuilds:
esbuild: true
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,5 @@
"vite": "8.0.16",
"@vitejs/plugin-react": "6.0.1",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,5 @@
"webpack-cli": "6.0.1",
"@babel/preset-react": "7.23.3",
"@sentry/bundler-plugins": "11.7.0"
},
"pnpm": {
"overrides": {
"@sentry/bundler-plugins": "file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz",
"@sentry/core": "file:../../../../packages/core/sentry-core-11.7.0.tgz",
"sentry": "file:../sentry-stub"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minimumReleaseAge: 0
overrides:
'@sentry/bundler-plugins': 'file:../../../../packages/bundler-plugins/sentry-bundler-plugins-11.7.0.tgz'
'@sentry/core': 'file:../../../../packages/core/sentry-core-11.7.0.tgz'
'sentry': 'file:../sentry-stub'
13 changes: 10 additions & 3 deletions dev-packages/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ A variant runs its `build-command` and `assert-command`. Without them, it runs t

We build our packages, pack them into tarballs (`yarn build:tarball`), and create symlinks in the `packed/` directory
that point to the versioned tarballs. When a test application is run, pnpm overrides are injected into its
`package.json` to pin all `@sentry/*` and `@sentry-internal/*` packages to those local tarballs. This means test apps
`pnpm-workspace.yaml` to pin all `@sentry/*` and `@sentry-internal/*` packages to those local tarballs. This means test apps
install the packages as if they were published, but from the local build output instead of a registry.

The E2E test script looks for test applications in the `test-applications` folder. These are standalone apps that use
Expand All @@ -118,8 +118,15 @@ Make sure to add a `test:build` and `test:assert` command to the new app's `pack
Sentry packages are automatically resolved to the local build via pnpm overrides injected at test time, so no manual
registry configuration is needed.

Apps use the root pnpm version. To use another one, set `volta.pnpm` in the app's `package.json`. Volta (locally) and
CI (`.github/actions/install-pnpm`) both install that version.
Each app has a `pnpm-workspace.yaml` for its pnpm settings, because pnpm ignores the `pnpm` and `resolutions` fields in
`package.json`. Copy it from a similar app. It needs `minimumReleaseAge: 0` and an `allowBuilds` entry for each
dependency with a build script: `true` if the app needs the script, `false` if the script only prints a message. pnpm
fails the install (`ERR_PNPM_IGNORED_BUILDS`) for a build script that `allowBuilds` does not list.

Apps use the pnpm version from the root `devDependencies`. To use another version, set `packageManager` in the app's
`package.json` (for example `"packageManager": "pnpm@10.34.6"`), and use the settings of that version in its
`pnpm-workspace.yaml`. pnpm then switches to that version, locally and in CI. The lowest supported version is pnpm 10,
because pnpm 9 does not read overrides from `pnpm-workspace.yaml`.

### Test apps that deploy a real Cloudflare Worker

Expand Down
Loading
Loading