Skip to content

Commit 8f32e18

Browse files
logaretmclaude
andauthored
feat(nitro): Nitro SDK (#19224)
This PR just isolates the mundane changes needed for a new SDK to keep the next stacked PRs clean, it adds the Nitro SDK to the monorepo. This PR is a base of a stack, the stacked PRs will be merged into it. I thought this will be easier to review. --- **This PR is part of a stack:** - #20358 - #19224 👈 - #19225 - #19304 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d6e3e41 commit 8f32e18

58 files changed

Lines changed: 2636 additions & 194 deletions

Some content is hidden

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

.craft.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ targets:
139139
- name: npm
140140
id: '@sentry/react-router'
141141
includeNames: /^sentry-react-router-\d.*\.tgz$/
142+
- name: npm
143+
id: '@sentry/nitro'
144+
includeNames: /^sentry-nitro-\d.*\.tgz$/
142145

143146
## 7. Other Packages
144147
## 7.1
@@ -256,3 +259,9 @@ targets:
256259
packageUrl: 'https://www.npmjs.com/package/@sentry/elysia'
257260
mainDocsUrl: 'https://docs.sentry.io/platforms/javascript/guides/elysia/'
258261
onlyIfPresent: /^sentry-elysia-\d.*\.tgz$/
262+
'npm:@sentry/nitro':
263+
name: 'Sentry Nitro SDK'
264+
sdkName: 'sentry.javascript.nitro'
265+
packageUrl: 'https://www.npmjs.com/package/@sentry/nitro'
266+
mainDocsUrl: 'https://docs.sentry.io/platforms/javascript/guides/nitro/'
267+
onlyIfPresent: /^sentry-nitro-\d.*\.tgz$/

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ body:
5252
- '@sentry/google-cloud-serverless'
5353
- '@sentry/nestjs'
5454
- '@sentry/nextjs'
55+
- '@sentry/nitro'
5556
- '@sentry/nuxt'
5657
- '@sentry/react'
5758
- '@sentry/react-router'

.github/workflows/canary.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ jobs:
120120
- test-application: 'nestjs-microservices'
121121
build-command: 'test:build-latest'
122122
label: 'nestjs-microservices (latest)'
123+
- test-application: 'nitro-3'
124+
build-command: 'test:build-canary'
125+
label: 'nitro-3 (canary)'
123126

124127
steps:
125128
- name: Check out current commit

.github/workflows/issue-package-label.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
"@sentry.nestjs": {
6666
"label": "Nest.js"
6767
},
68+
"@sentry.nitro": {
69+
"label": "Nitro"
70+
},
6871
"@sentry.nextjs": {
6972
"label": "Next.js"
7073
},

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
- **feat(nitro): Add `@sentry/nitro` SDK**
6+
7+
A new `@sentry/nitro` package provides first-class Sentry support for [Nitro](https://nitro.build/) applications, with HTTP handler and error instrumentation, middleware tracing, request isolation, and build-time source map uploading via `withSentryConfig`.
8+
Read more in the [Nitro SDK docs](https://docs.sentry.io/platforms/javascript/guides/nitro/) and the [Nitro SDK readme](https://github.com/getsentry/sentry-javascript/blob/develop/packages/nitro/README.md).
9+
510
## 10.50.0
611

712
### Important Changes

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ package. Please refer to the README and instructions of those SDKs for more deta
5858
- [`@sentry/gatsby`](https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby): SDK for Gatsby
5959
- [`@sentry/nestjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nestjs): SDK for NestJS
6060
- [`@sentry/nextjs`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nextjs): SDK for Next.js
61+
- [`@sentry/nitro`](https://github.com/getsentry/sentry-javascript/tree/master/packages/nitro): SDK for Nitro
6162
- [`@sentry/remix`](https://github.com/getsentry/sentry-javascript/tree/master/packages/remix): SDK for Remix
6263
- [`@sentry/tanstackstart-react`](https://github.com/getsentry/sentry-javascript/tree/master/packages/tanstackstart-react): SDK for TanStack Start React
6364
- [`@sentry/aws-serverless`](https://github.com/getsentry/sentry-javascript/tree/master/packages/aws-serverless): SDK
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Nitro E2E Test</title>
6+
</head>
7+
<body>
8+
<h1>Nitro E2E Test App</h1>
9+
<script type="module" src="/src/main.ts"></script>
10+
</body>
11+
</html>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import * as Sentry from '@sentry/nitro';
2+
3+
Sentry.init({
4+
environment: 'qa', // dynamic sampling bias to keep transactions
5+
dsn: process.env.E2E_TEST_DSN,
6+
tunnel: `http://localhost:3031/`, // proxy server
7+
tracesSampleRate: 1,
8+
});
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "nitro-3",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"scripts": {
7+
"build": "vite build",
8+
"start": "PORT=3030 NODE_OPTIONS='--import ./instrument.mjs' node .output/server/index.mjs",
9+
"clean": "npx rimraf node_modules pnpm-lock.yaml .output",
10+
"test": "playwright test",
11+
"test:build": "pnpm install && pnpm build",
12+
"test:assert": "pnpm test"
13+
},
14+
"dependencies": {
15+
"@sentry/browser": "latest || *",
16+
"@sentry/nitro": "latest || *"
17+
},
18+
"devDependencies": {
19+
"@playwright/test": "~1.56.0",
20+
"@sentry-internal/test-utils": "link:../../../test-utils",
21+
"@sentry/core": "latest || *",
22+
"nitro": "^3.0.260415-beta",
23+
"rolldown": "latest",
24+
"vite": "latest"
25+
},
26+
"volta": {
27+
"extends": "../../package.json"
28+
}
29+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
2+
3+
const config = getPlaywrightConfig({
4+
startCommand: `pnpm start`,
5+
});
6+
7+
export default config;

0 commit comments

Comments
 (0)