Skip to content

Commit 079318f

Browse files
Merge 3f708dc into a6c28d0
2 parents a6c28d0 + 3f708dc commit 079318f

291 files changed

Lines changed: 138 additions & 906 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.claude/CLOUD.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ These cannot live in the repo and must be set once per environment:
2323

2424
## Notes
2525

26-
- Node/pnpm versions come from `package.json` (Volta locally). In the cloud we use the sandbox Node runtime, and the setup script installs the pinned pnpm version when the sandbox has none.
26+
- Node.js/pnpm versions come from `package.json` (`devEngines.runtime` and `packageManager`, managed by pnpm locally). In the cloud we use the sandbox Node.js runtime, and the setup script installs the pinned pnpm version when the sandbox has none.
2727
- The full production `pnpm run build` is not run at startup; `build:dev` (transpile + types) is enough for editing and running unit tests. Run `pnpm run build` manually if you need bundles.

‎.cursor/environment.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "Sentry JavaScript SDK Development",
3-
"install": "curl https://get.volta.sh | bash && export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && export VOLTA_FEATURE_PNPM=1 && pnpm install",
4-
"start": "export VOLTA_HOME=\"$HOME/.volta\" && export PATH=\"$VOLTA_HOME/bin:$PATH\" && export VOLTA_FEATURE_PNPM=1",
3+
"install": "curl -fsSL https://get.pnpm.io/install.sh | sh - && export PNPM_HOME=\"$HOME/.local/share/pnpm\" && export PATH=\"$PNPM_HOME/bin:$PATH\" && pnpm runtime set node 24 -g -y && pnpm install",
4+
"start": "export PNPM_HOME=\"$HOME/.local/share/pnpm\" && export PATH=\"$PNPM_HOME/bin:$PATH\"",
55
"terminals": [
66
{
77
"name": "Development",
8-
"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 'pnpm version:' && pnpm --version",
9-
"description": "Main development terminal with Volta environment configured"
8+
"command": "export PNPM_HOME=\"$HOME/.local/share/pnpm\" && export PATH=\"$PNPM_HOME/bin:$PATH\" && echo 'pnpm setup complete. Node version:' && node --version && echo 'pnpm version:' && pnpm --version",
9+
"description": "Main development terminal with pnpm-managed node"
1010
}
1111
]
1212
}

‎.github/actions/prepare-e2e-test/action.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ inputs:
2222
runs:
2323
using: 'composite'
2424
steps:
25+
# Uses the repo's root node pin for the steps before the app is copied (installing pnpm, `test:prepare`,
26+
# `test:validate`, `ci:copy-to-temp`). The app's own node version is set up after the copy below.
2527
- name: Set up Node
2628
uses: actions/setup-node@v7
2729
with:
28-
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ inputs.test-application }}/package.json'
30+
node-version-file: 'package.json'
2931
- name: Set up Bun
3032
if:
3133
inputs.test-application == 'node-exports-test-app' || contains(inputs.test-application, 'bun') || inputs.runtime
@@ -102,6 +104,14 @@ runs:
102104
shell: bash
103105
working-directory: dev-packages/e2e-tests
104106

107+
# Reads the node version that `ci:copy-to-temp` wrote into the copied app's `devEngines.runtime`: the app's own pin
108+
# if it has one, otherwise the one inherited from the repo root. setup-node can't look up parent directories, so the
109+
# temp copy has to carry the resolved version.
110+
- name: Set up Node for the E2E app
111+
uses: actions/setup-node@v7
112+
with:
113+
node-version-file: '${{ runner.temp }}/test-application/package.json'
114+
105115
- name: Add pnpm overrides
106116
run:
107117
pnpm run ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace

‎.github/workflows/canary.yml‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,12 @@ jobs:
122122
ref: ${{ env.HEAD_COMMIT }}
123123
- name: Install pnpm
124124
uses: ./.github/actions/install-pnpm
125+
# Uses the repo's root node pin for the steps before the app is copied (`test:prepare`, `test:validate`,
126+
# `ci:copy-to-temp`). The app's own node version is set up after the copy below.
125127
- name: Set up Node
126128
uses: actions/setup-node@v7
127129
with:
128-
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
130+
node-version-file: 'package.json'
129131

130132
- name: Restore canary cache
131133
uses: actions/cache/restore@v6.1.0
@@ -147,6 +149,14 @@ jobs:
147149
}}/test-application
148150
working-directory: dev-packages/e2e-tests
149151

152+
# Reads the node version that `ci:copy-to-temp` wrote into the copied app's `devEngines.runtime`: the app's own pin
153+
# if it has one, otherwise the one inherited from the repo root. setup-node can't look up parent directories, so
154+
# the temp copy has to carry the resolved version.
155+
- name: Set up Node for the E2E app
156+
uses: actions/setup-node@v7
157+
with:
158+
node-version-file: '${{ runner.temp }}/test-application/package.json'
159+
150160
- name: Add pnpm overrides
151161
run:
152162
pnpm run ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace

‎AGENTS.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ Monorepo with 40+ packages in `@sentry/*`, managed with pnpm workspaces and Nx.
44

55
## Setup
66

7-
- [Volta](https://volta.sh/) for Node.js/pnpm version management
8-
- Requires `VOLTA_FEATURE_PNPM=1`
7+
- pnpm manages Node.js and pnpm versions (see `CONTRIBUTING.md`): Node.js in `devEngines.runtime`, pnpm in `packageManager`
98
- After cloning: `pnpm install && pnpm run build`
10-
- Never change Volta, pnpm, or package manager versions unless explicitly asked
9+
- Never change Node.js, pnpm, or package manager versions unless explicitly asked
1110

1211
### Code Intelligence
1312

‎CONTRIBUTING.md‎

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,30 @@ you get started, but if you have further questions, please feel free to reach ou
1818

1919
## Setting up an Environment
2020

21-
We use [Volta](https://volta.sh/) to ensure we use consistent versions of node and pnpm. Volta manages pnpm only when
22-
[pnpm support](https://docs.volta.sh/advanced/pnpm) is enabled, so add `export VOLTA_FEATURE_PNPM=1` to your shell
23-
profile (for example `~/.zshrc`).
21+
`sentry-javascript` is a monorepo containing several packages, managed with pnpm workspaces and Nx. pnpm installs the
22+
Node.js and pnpm versions the repo pins.
2423

25-
`sentry-javascript` is a monorepo containing several packages, managed with pnpm workspaces and Nx. To get started,
26-
install all dependencies, and then perform an initial build, so TypeScript can read all of the linked type definitions.
24+
1. Install pnpm 12 or newer, see the [pnpm installation docs](https://pnpm.io/installation).
25+
2. Install a default Node.js version through pnpm:
2726

28-
```
29-
$ pnpm install
30-
$ pnpm run build
31-
```
27+
```sh
28+
pnpm runtime set node 24 -g
29+
```
30+
31+
If this fails with `ERR_PNPM_GLOBAL_BIN_DIR_NOT_IN_PATH` (for example because pnpm came from npm or Homebrew instead
32+
of the install script), run [`pnpm setup`](https://pnpm.io/cli/setup) to add pnpm's global bin directory to your
33+
`PATH`, restart your shell, and try again.
3234

33-
With that, the repo is fully set up and you are ready to run all commands.
35+
3. Install all dependencies, and then perform an initial build, so TypeScript can read all of the linked type
36+
definitions:
37+
38+
```sh
39+
pnpm install
40+
pnpm run build
41+
```
42+
43+
With that, the repo is fully set up and you are ready to run all commands. If you used Volta before, or `node --version`
44+
doesn't match the repo, see [Node.js and pnpm Versions](#nodejs-and-pnpm-versions).
3445

3546
## Building Packages
3647

@@ -83,8 +94,8 @@ E2E tests verify SDK behavior in real-world framework scenarios.
8394
### Prerequisites
8495

8596
1. **Docker**: Required for some E2E tests
86-
2. **Volta**: The E2E tests run each app on the node version that it pins. Without Volta, they use your current node
87-
version.
97+
2. **pnpm-managed Node.js** (see [Setting up an Environment](#setting-up-an-environment)): The E2E tests run each app on
98+
the Node.js version that it pins. Without pnpm's `node` shim, they use your current Node.js version.
8899

89100
### Step-by-Step Instructions
90101

@@ -216,3 +227,21 @@ See [PR Reviews](./docs/pr-reviews.md).
216227
_These steps are only relevant to Sentry employees when preparing and publishing a new SDK release._
217228

218229
[See the docs for publishing a release](./docs/publishing-a-release.md)
230+
231+
## Node.js and pnpm Versions
232+
233+
- The root `package.json` pins Node.js in `devEngines.runtime` and pnpm in `packageManager`. CI reads the same fields.
234+
- pnpm's `node` command runs the Node.js version of the nearest `package.json` that pins one
235+
([project-aware global bins](https://pnpm.io/global-packages#project-aware-global-bins)). Packages and E2E test apps
236+
inherit the root version, and can override it with their own `devEngines.runtime`.
237+
238+
If `node --version` or `pnpm --version` doesn't match the repo, run `which node pnpm`. Both should be in
239+
`$PNPM_HOME/bin`. If not, another tool (Volta, nvm, fnm, corepack, Homebrew Node.js) comes first in your `PATH`. Remove it,
240+
or move `$PNPM_HOME/bin` before it.
241+
242+
### Migrating from Volta
243+
244+
The repo no longer has a `volta` field, so Volta runs its default Node.js instead of the version the repo pins.
245+
[Uninstall Volta](https://docs.volta.sh/advanced/uninstall) and follow the
246+
[setup](#setting-up-an-environment). If other projects still need Volta, keep it, but put `$PNPM_HOME/bin` before
247+
`~/.volta/bin` in your `PATH`, and use `volta run node` in those projects.

‎dev-packages/browser-integration-tests/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,5 @@
8080
"@types/node": "^20.19.0",
8181
"eslint-plugin-regexp": "^3.1.0",
8282
"glob": "^13.0.6"
83-
},
84-
"volta": {
85-
"extends": "../../package.json"
8683
}
8784
}

‎dev-packages/bun-integration-tests/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,5 @@
2828
"@types/pg": "^8.20.0",
2929
"bun-types": "^1.2.9",
3030
"vitest": "^4.1.11"
31-
},
32-
"volta": {
33-
"extends": "../../package.json"
3431
}
3532
}

‎dev-packages/bundler-plugin-integration-tests/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@
1919
"sentry": "^0.45.0",
2020
"typescript": "~6.0.3",
2121
"vitest": "^4.1.11"
22-
},
23-
"volta": {
24-
"extends": "../../package.json"
2522
}
2623
}

‎dev-packages/bundler-tests/package.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,5 @@
1919
"vitest": "^4.1.11",
2020
"webpack": "^5.0.0"
2121
},
22-
"volta": {
23-
"extends": "../../package.json"
24-
},
2522
"type": "module"
2623
}

0 commit comments

Comments
 (0)