You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/sdk_dependency_upgrades.mdc
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ description: Use this rule if you are looking to upgrade a dependency in the Sen
3
3
globs:
4
4
alwaysApply: false
5
5
---
6
+
6
7
# Yarn v1 Dependency Upgrades
7
8
8
9
## Upgrade Process
@@ -45,10 +46,12 @@ Avoid upgrading top-level dependencies (defined in `package.json`), especially i
45
46
**STOP UPGRADE IMMEDIATELY** if upgrading any dependency with `opentelemetry` in the name and the new version or any of its dependencies uses forbidden OpenTelemetry versions.
46
47
47
48
**FORBIDDEN VERSION PATTERNS:**
49
+
48
50
- `2.x.x` versions (e.g., `2.0.0`, `2.1.0`)
49
51
- `0.2xx.x` versions (e.g., `0.200.0`, `0.201.0`)
50
52
51
53
When upgrading OpenTelemetry dependencies:
54
+
52
55
1. Check the dependency's `package.json` after upgrade
53
56
2. Verify the package itself doesn't use forbidden version patterns
54
57
3. Verify none of its dependencies use `@opentelemetry/*` packages with forbidden version patterns
@@ -153,6 +156,7 @@ yarn info <package-name> versions
153
156
```
154
157
155
158
The `yarn info` command provides detailed dependency information without requiring installation, making it particularly useful for:
159
+
156
160
- Verifying OpenTelemetry packages don't introduce forbidden version patterns (`2.x.x` or `0.2xx.x`)
157
161
- Checking what dependencies a package will bring in before upgrading
158
162
- Understanding package version history and compatibility
- Never merge directly into `master` (except emergency fixes)
48
48
- Avoid changing `package.json` files on `develop` during pending releases
49
+
- Never update dependencies, package.json content or build scripts unless explicitly asked for
50
+
- When asked to do a task on a set of files, always make sure that all occurences in the codebase are covered. Double check that no files have been forgotten.
51
+
- Unless explicitly asked for, make sure to cover all files, including files in `src/` and `test/` directories.
49
52
50
53
### Branch Naming
54
+
51
55
- Features: `feat/descriptive-name`
52
56
- Releases: `release/X.Y.Z`
53
57
@@ -56,27 +60,33 @@ This repository uses **Git Flow**. See [docs/gitflow.md](docs/gitflow.md) for de
56
60
This is a Lerna monorepo with 40+ packages in the `@sentry/*` namespace.
57
61
58
62
### Core Packages
63
+
59
64
- `packages/core/` - Base SDK with interfaces, type definitions, core functionality
60
-
- `packages/types/` - Shared TypeScript type definitions (active)
65
+
- `packages/types/` - Shared TypeScript type definitions - this is deprecated, never modify this package
61
66
- `packages/browser-utils/` - Browser-specific utilities and instrumentation
67
+
- `packages/node-core/` - Node Core SDK which contains most of the node-specific logic, excluding OpenTelemetry instrumentation.
62
68
63
69
### Platform SDKs
70
+
64
71
- `packages/browser/` - Browser SDK with bundled variants
65
-
- `packages/node/` - Node.js SDK with server-side integrations
72
+
- `packages/node/` - Node.js SDK. All general Node code should go into node-core, the node package itself only contains OpenTelemetry instrumentation on top of that.
- Requires initial `yarn build` after `yarn install` for TypeScript linking
107
121
- Integration tests use Playwright extensively
108
-
- Native profiling requires Python <3.12 for binary builds
122
+
- Never change the volta, yarn, or package manager setup in general unless explicitly asked for
123
+
124
+
### Notes for Background Tasks
125
+
126
+
- Make sure to use [volta](https://volta.sh/) for development. Volta is used to manage the node, yarn and pnpm version used.
127
+
- Make sure that [PNPM support is enabled in volta](https://docs.volta.sh/advanced/pnpm). This means that the `VOLTA_FEATURE_PNPM` environment variable has to be set to `1`.
128
+
- Yarn, Node and PNPM have to be used through volta, in the versions defined by the volta config. NEVER change any versions unless explicitly asked to.
109
129
110
130
## Testing Single Packages
131
+
111
132
- Test specific package: `cd packages/{package-name} && yarn test`
112
133
- Build specific package: `yarn build:dev:filter @sentry/{package-name}`
113
134
114
135
## Code Style Rules
136
+
115
137
- Follow existing code conventions in each package
116
138
- Check imports and dependencies - only use libraries already in the codebase
117
139
- Look at neighboring files for patterns and style
118
140
- Never introduce code that exposes secrets or keys
119
141
- Follow security best practices
120
142
121
143
## Before Every Commit Checklist
144
+
122
145
1. ✅ `yarn lint` (fix all issues)
123
146
2. ✅ `yarn test` (all tests pass)
124
147
3. ✅ `yarn build:dev` (builds successfully)
125
148
4. ✅ Target `develop` branch for PRs (not `master`)
126
149
127
150
## Documentation Sync
128
-
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.
151
+
152
+
**IMPORTANT**: When editing CLAUDE.md, also update .cursor/rules/sdk_development.mdc and vice versa to keep both files in sync.
0 commit comments