Skip to content

Commit 085d718

Browse files
chore: pre-shape repo into pnpm-workspace monorepo layout (#1254)
## Pre-shape the CLI repo into a pnpm-workspace monorepo Part of the **sentry-cli + sentry-mcp → `getsentry/toolkit` merge**. Closes #1238 · Master: #1248 This reshapes the repo into a pnpm workspace so it can be cleanly `git subtree`-imported into the renamed `toolkit` repo (#1239), **while keeping this repo fully operational (CI, releases, nightlies) throughout the transition** — which the dual-source CLI upgrade (#1244) depends on. ### Layout - CLI package → `packages/cli/` (`src`, `test`, `script`, `patches`, `plugins`, `install`, configs, `package.json`) - `docs/` → `apps/cli-docs/` - Root keeps GitHub/Craft-read files: `.github/`, `.craft.yml`, `LICENSE`, `CHANGELOG`, `.gitignore`, `.nojekyll` - New `pnpm-workspace.yaml` (`packages/*` + `apps/*`) and a thin **delegating root `package.json`** that forwards scripts to the `sentry` package and hoists the `pnpm` block - New minimal root `README`; CLI README → `packages/cli/README.md` ### Internal path fixes - Shared `script/paths.ts` (`DOCS_ROOT` etc.) for cross-package doc paths - Re-pointed `apps/cli-docs` public symlinks (`install`, skill files) to `packages/cli/` - `build.ts`/`bundle.ts` resolve the `@sentry/symbolic` WASM via module resolution and invoke fossilize via `pnpm exec` (both hoist to the workspace root) - `biome.jsonc` + `packages/cli/.gitignore` so Biome finds an ignore file - `.gitignore` path-anchored entries updated for the nested layout ### Workflows / release (root-relative where GitHub/Craft require it) - `ci.yml`, `docs-preview.yml`, `eval-skill-fork.yml`: paths-filter globs, `node_modules` cache paths, patches `hashFiles` glob, artifact paths (`packages/cli/dist-bin`, `apps/cli-docs/dist`), docs `working-directory`, version reads, `npm pack` dir - `.craft.yml` pre/post-release commands `cd packages/cli` ### `node-linker=isolated` (was `hoisted`) Under the workspace, `hoisted` let an **unpatched** transitive `@sentry/core@10.65.0` (via `@spotlightjs/spotlight` → `@sentry/node`) win the flat hoist over the **patched** direct `@sentry/core@10.63.0`, so the CLI bundled the unpatched copy (masked only by esbuild tree-shaking). `isolated` mode (pnpm default) keeps per-package variants so the patched copy is used. `check-patches.ts` now reads `patchedDependencies` from the workspace root and resolves the copy the CLI actually links via `require.resolve`. The patch files themselves are unchanged (they apply cleanly); `catalog:`-based dedup is deferred to #1240. ### Verification (local) - ✅ `typecheck`, `lint`, all `check:*` scripts - ✅ `build` (+ Linux binary smoke test, WASM asset loads, patched bundle verified) - ✅ `bundle` (npm library) - ✅ full unit suite — **399 files, 8474 passed, 13 skipped** CI on this PR is the authoritative check for the cross-platform binary matrix and release paths. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 21328ea commit 085d718

1,054 files changed

Lines changed: 310566 additions & 0 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-plugin/marketplace.json‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "sentry-cli",
3+
"owner": {
4+
"name": "Sentry"
5+
},
6+
"plugins": [
7+
{
8+
"name": "sentry-cli",
9+
"source": "./plugins/sentry-cli",
10+
"description": "Skills for using the Sentry CLI to interact with Sentry from the command line"
11+
}
12+
]
13+
}

‎.cursor/hooks.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"version": 1,
3+
"hooks": {
4+
"afterFileEdit": [
5+
{
6+
"command": "npx ultracite fix"
7+
}
8+
]
9+
}
10+
}

‎.cursor/rules/ultracite.mdc‎

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
description: Ultracite Rules - AI-Ready Formatter and Linter
3+
globs: "**/*.{ts,tsx,js,jsx,json,jsonc,html,vue,svelte,astro,css,yaml,yml,graphql,gql,md,mdx,grit}"
4+
alwaysApply: false
5+
---
6+
7+
# Ultracite Code Standards
8+
9+
This project uses **Ultracite**, a zero-config Biome preset that enforces strict code quality standards through automated formatting and linting.
10+
11+
## Quick Reference
12+
13+
- **Format code**: `npx ultracite fix`
14+
- **Check for issues**: `npx ultracite check`
15+
- **Diagnose setup**: `npx ultracite doctor`
16+
17+
Biome (the underlying engine) provides extremely fast Rust-based linting and formatting. Most issues are automatically fixable.
18+
19+
---
20+
21+
## Core Principles
22+
23+
Write code that is **accessible, performant, type-safe, and maintainable**. Focus on clarity and explicit intent over brevity.
24+
25+
### Type Safety & Explicitness
26+
27+
- Use explicit types for function parameters and return values when they enhance clarity
28+
- Prefer `unknown` over `any` when the type is genuinely unknown
29+
- Use const assertions (`as const`) for immutable values and literal types
30+
- Leverage TypeScript's type narrowing instead of type assertions
31+
- Use meaningful variable names instead of magic numbers - extract constants with descriptive names
32+
33+
### Modern JavaScript/TypeScript
34+
35+
- Use arrow functions for callbacks and short functions
36+
- Prefer `for...of` loops over `.forEach()` and indexed `for` loops
37+
- Use optional chaining (`?.`) and nullish coalescing (`??`) for safer property access
38+
- Prefer template literals over string concatenation
39+
- Use destructuring for object and array assignments
40+
- Use `const` by default, `let` only when reassignment is needed, never `var`
41+
42+
### Async & Promises
43+
44+
- Always `await` promises in async functions - don't forget to use the return value
45+
- Use `async/await` syntax instead of promise chains for better readability
46+
- Handle errors appropriately in async code with try-catch blocks
47+
- Don't use async functions as Promise executors
48+
49+
### Error Handling & Debugging
50+
51+
- Remove `console.log`, `debugger`, and `alert` statements from production code
52+
- Throw `Error` objects with descriptive messages, not strings or other values
53+
- Use `try-catch` blocks meaningfully - don't catch errors just to rethrow them
54+
- Prefer early returns over nested conditionals for error cases
55+
56+
### Code Organization
57+
58+
- Keep functions focused and under reasonable cognitive complexity limits
59+
- Extract complex conditions into well-named boolean variables
60+
- Use early returns to reduce nesting
61+
- Prefer simple conditionals over nested ternary operators
62+
- Group related code together and separate concerns
63+
64+
### Security
65+
66+
- Add `rel="noopener"` when using `target="_blank"` on links
67+
- Avoid `dangerouslySetInnerHTML` unless absolutely necessary
68+
- Don't use `eval()` or assign directly to `document.cookie`
69+
- Validate and sanitize user input
70+
71+
### Performance
72+
73+
- Avoid spread syntax in accumulators within loops
74+
- Use top-level regex literals instead of creating them in loops
75+
- Prefer specific imports over namespace imports
76+
- Avoid barrel files (index files that re-export everything)
77+
- Use proper image components (e.g., Next.js `<Image>`) over `<img>` tags
78+
79+
---
80+
81+
## Testing
82+
83+
- Write assertions inside `it()` or `test()` blocks
84+
- Avoid done callbacks in async tests - use async/await instead
85+
- Don't use `.only` or `.skip` in committed code
86+
- Keep test suites reasonably flat - avoid excessive `describe` nesting
87+
88+
## When Biome Can't Help
89+
90+
Biome's linter will catch most issues automatically. Focus your attention on:
91+
92+
1. **Business logic correctness** - Biome can't validate your algorithms
93+
2. **Meaningful naming** - Use descriptive names for functions, variables, and types
94+
3. **Architecture decisions** - Component structure, data flow, and API design
95+
4. **Edge cases** - Handle boundary conditions and error states
96+
5. **User experience** - Accessibility, performance, and usability considerations
97+
6. **Documentation** - Add comments for complex logic, but prefer self-documenting code
98+
99+
---
100+
101+
Most formatting and common issues are automatically fixed by Biome. Run `npx ultracite fix` before committing to ensure compliance.

‎.cursor/skills/sentry-cli/SKILL.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../plugins/sentry-cli/skills/sentry-cli/SKILL.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../plugins/sentry-cli/skills/sentry-cli/references

‎.env.example‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copy this to .env.local and fill in your values
2+
# SENTRY_CLIENT_ID=your-sentry-oauth-client-id # Only needed for self-hosted or a custom OAuth app
3+
# SENTRY_URL=https://sentry.io # Uncomment for self-hosted
4+
5+
# Test credentials (for running E2E tests)
6+
SENTRY_TEST_AUTH_TOKEN=your-sentry-user-token
7+
SENTRY_TEST_ORG=your-test-org
8+
SENTRY_TEST_PROJECT=your-test-project

‎.gitignore‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Package-level ignores for git. The workspace-root .gitignore mirrors these
2+
# with `packages/cli/`-prefixed patterns (that root file is what Biome reads,
3+
# since biome.jsonc sets `vcs.root: "../.."`). This file exists so plain `git`
4+
# ignores build artifacts within the package regardless of the root file.
5+
6+
# dependencies
7+
node_modules
8+
9+
# build output
10+
out
11+
dist
12+
dist-bin
13+
dist-build
14+
*.tgz
15+
16+
# fossilize build cache
17+
.node-cache
18+
19+
# code coverage
20+
coverage
21+
coverage-isolated
22+
*.lcov
23+
24+
# test artifacts
25+
*.junit.xml
26+
test/skill-eval/results.json
27+
28+
# local bench baselines
29+
.bench/
30+
31+
# caches
32+
*.tsbuildinfo
33+
34+
# generated files (rebuilt at build time)
35+
src/generated/
36+
src/sdk.generated.ts
37+
src/sdk.generated.d.cts
38+
!src/generated/banner-sixel.ts

‎.vscode/settings.json‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"[javascript]": {
4+
"editor.defaultFormatter": "biomejs.biome"
5+
},
6+
"[typescript]": {
7+
"editor.defaultFormatter": "biomejs.biome"
8+
},
9+
"[javascriptreact]": {
10+
"editor.defaultFormatter": "biomejs.biome"
11+
},
12+
"[typescriptreact]": {
13+
"editor.defaultFormatter": "biomejs.biome"
14+
},
15+
"[json]": {
16+
"editor.defaultFormatter": "biomejs.biome"
17+
},
18+
"[jsonc]": {
19+
"editor.defaultFormatter": "biomejs.biome"
20+
},
21+
"[css]": {
22+
"editor.defaultFormatter": "biomejs.biome"
23+
},
24+
"[graphql]": {
25+
"editor.defaultFormatter": "biomejs.biome"
26+
},
27+
"typescript.tsdk": "node_modules/typescript/lib",
28+
"editor.formatOnSave": true,
29+
"editor.formatOnPaste": true,
30+
"emmet.showExpandedAbbreviation": "never",
31+
"editor.codeActionsOnSave": {
32+
"source.fixAll.biome": "explicit",
33+
"source.organizeImports.biome": "explicit"
34+
},
35+
"[mdx]": {
36+
"editor.defaultFormatter": "unifiedjs.vscode-mdx"
37+
}
38+
}

0 commit comments

Comments
 (0)