@sentry/nitro 11.11.0 → 11.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { _INTERNAL_setManagedTunnelDefaults } from '@sentry/core/server';
1
+ import { _INTERNAL_setTunnelDefaults } from '@sentry/core/server';
2
2
  import { instrumentServer } from './instruments/instrumentServer.js';
3
3
  import { setupSourceMaps } from './sourceMaps.js';
4
4
 
@@ -10,7 +10,7 @@ function createNitroModule(sentryOptions, sentryEnabledSourcemaps) {
10
10
  setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);
11
11
  if (nitro.options.dev) {
12
12
  const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath;
13
- _INTERNAL_setManagedTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });
13
+ _INTERNAL_setTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });
14
14
  }
15
15
  }
16
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import { _INTERNAL_setManagedTunnelDefaults as setManagedTunnelDefaults } from '@sentry/core/server';\nimport type { NitroModule } from 'nitro/types';\nimport type { SentryNitroOptions } from './config';\nimport { instrumentServer } from './instruments/instrumentServer';\nimport { setupSourceMaps } from './sourceMaps';\n\n/**\n * Creates a Nitro module to setup the Sentry SDK.\n */\nexport function createNitroModule(sentryOptions?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): NitroModule {\n return {\n name: 'sentry',\n setup: nitro => {\n instrumentServer(nitro);\n setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);\n\n // In dev, Vite's server takes each request in this process before Nitro handles it, and its `http.server` span\n // comes from the SDK `--import` set up here. The runtime plugin only reaches the client where Nitro runs.\n if (nitro.options.dev) {\n // `sentryTunnelBasePath` is set by `@sentry/solidstart`, whose app is served under Vite's `base`.\n const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath as string | undefined;\n setManagedTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });\n }\n },\n };\n}\n"],"names":["setManagedTunnelDefaults"],"mappings":";;;;AASO,SAAS,iBAAA,CAAkB,eAAoC,uBAAA,EAAgD;AACpH,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,OAAO,CAAA,KAAA,KAAS;AACd,MAAA,gBAAA,CAAiB,KAAK,CAAA;AACtB,MAAA,eAAA,CAAgB,KAAA,EAAO,eAAe,uBAAuB,CAAA;AAI7D,MAAA,IAAI,KAAA,CAAM,QAAQ,GAAA,EAAK;AAErB,QAAA,MAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,CAAQ,aAAA,CAAc,oBAAA;AACnD,QAAAA,kCAAA,CAAyB,EAAE,QAAA,EAAU,cAAA,IAAkB,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA;AAAA,MAChF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import { _INTERNAL_setTunnelDefaults as setTunnelDefaults } from '@sentry/core/server';\nimport type { NitroModule } from 'nitro/types';\nimport type { SentryNitroOptions } from './config';\nimport { instrumentServer } from './instruments/instrumentServer';\nimport { setupSourceMaps } from './sourceMaps';\n\n/**\n * Creates a Nitro module to setup the Sentry SDK.\n */\nexport function createNitroModule(sentryOptions?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): NitroModule {\n return {\n name: 'sentry',\n setup: nitro => {\n instrumentServer(nitro);\n setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);\n\n // In dev, Vite's server takes each request in this process before Nitro handles it, and its `http.server` span\n // comes from the SDK `--import` set up here. The runtime plugin only reaches the client where Nitro runs.\n if (nitro.options.dev) {\n // `sentryTunnelBasePath` is set by `@sentry/solidstart`, whose app is served under Vite's `base`.\n const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath as string | undefined;\n setTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });\n }\n },\n };\n}\n"],"names":["setTunnelDefaults"],"mappings":";;;;AASO,SAAS,iBAAA,CAAkB,eAAoC,uBAAA,EAAgD;AACpH,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,QAAA;AAAA,IACN,OAAO,CAAA,KAAA,KAAS;AACd,MAAA,gBAAA,CAAiB,KAAK,CAAA;AACtB,MAAA,eAAA,CAAgB,KAAA,EAAO,eAAe,uBAAuB,CAAA;AAI7D,MAAA,IAAI,KAAA,CAAM,QAAQ,GAAA,EAAK;AAErB,QAAA,MAAM,cAAA,GAAiB,KAAA,CAAM,OAAA,CAAQ,aAAA,CAAc,oBAAA;AACnD,QAAAA,2BAAA,CAAkB,EAAE,QAAA,EAAU,cAAA,IAAkB,KAAA,CAAM,OAAA,CAAQ,SAAS,CAAA;AAAA,MACzE;AAAA,IACF;AAAA,GACF;AACF;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"11.11.0","sideEffects":false}
1
+ {"type":"module","version":"11.12.0","sideEffects":false}
@@ -1,4 +1,4 @@
1
- import { _INTERNAL_setManagedTunnelDefaults, _INTERNAL_handleServedTunnelRequest } from '@sentry/core/server';
1
+ import { _INTERNAL_setTunnelDefaults } from '@sentry/core/server';
2
2
  import { definePlugin } from 'nitro';
3
3
  import { useRuntimeConfig } from 'nitro/runtime-config';
4
4
  import { tasks } from '#nitro/virtual/tasks';
@@ -9,9 +9,7 @@ const server = definePlugin((nitroApp) => {
9
9
  nitroApp.hooks.hook("error", captureErrorHook);
10
10
  instrumentTasks(tasks);
11
11
  const runtimeConfig = useRuntimeConfig();
12
- _INTERNAL_setManagedTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });
13
- const appFetch = nitroApp.fetch;
14
- nitroApp.fetch = (request) => _INTERNAL_handleServedTunnelRequest(request) ?? appFetch(request);
12
+ _INTERNAL_setTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });
15
13
  });
16
14
 
17
15
  export { server as default };
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sources":["../../../../src/runtime/plugins/server.ts"],"sourcesContent":["import {\n _INTERNAL_handleServedTunnelRequest as handleServedTunnelRequest,\n _INTERNAL_setManagedTunnelDefaults as setManagedTunnelDefaults,\n} from '@sentry/core/server';\nimport { definePlugin } from 'nitro';\nimport { useRuntimeConfig } from 'nitro/runtime-config';\n// @ts-expect-error - This is a virtual module\nimport { tasks } from '#nitro/virtual/tasks';\nimport { captureErrorHook } from '../hooks/captureErrorHook';\nimport { instrumentTasks } from '../utils/instrumentTasks';\n\nexport default definePlugin(nitroApp => {\n nitroApp.hooks.hook('error', captureErrorHook);\n instrumentTasks(tasks);\n\n // Nitro runs the app's `middleware/` before anything a module registers, so an auth middleware there would block\n // the tunnel. Every preset hands requests to `nitroApp.fetch` after the plugins ran, so wrapping it goes first,\n // before route rules and middleware. Requests still carry Nitro's `baseURL` here, so the tunnel is served under it,\n // unless a framework serves the app under another prefix: `@sentry/solidstart` sets `sentryTunnelBasePath` to Vite's\n // `base`.\n const runtimeConfig = useRuntimeConfig() as { app?: { baseURL?: string }; sentryTunnelBasePath?: string };\n setManagedTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });\n const appFetch = nitroApp.fetch;\n nitroApp.fetch = request => handleServedTunnelRequest(request) ?? appFetch(request);\n});\n"],"names":["setManagedTunnelDefaults","handleServedTunnelRequest"],"mappings":";;;;;;;AAWA,eAAe,aAAa,CAAA,QAAA,KAAY;AACtC,EAAA,QAAA,CAAS,KAAA,CAAM,IAAA,CAAK,OAAA,EAAS,gBAAgB,CAAA;AAC7C,EAAA,eAAA,CAAgB,KAAK,CAAA;AAOrB,EAAA,MAAM,gBAAgB,gBAAA,EAAiB;AACvC,EAAAA,kCAAA,CAAyB,EAAE,QAAA,EAAU,aAAA,CAAc,wBAAwB,aAAA,CAAc,GAAA,EAAK,SAAS,CAAA;AACvG,EAAA,MAAM,WAAW,QAAA,CAAS,KAAA;AAC1B,EAAA,QAAA,CAAS,QAAQ,CAAA,OAAA,KAAWC,mCAAA,CAA0B,OAAO,CAAA,IAAK,SAAS,OAAO,CAAA;AACpF,CAAC,CAAA;;;;"}
1
+ {"version":3,"file":"server.js","sources":["../../../../src/runtime/plugins/server.ts"],"sourcesContent":["import { _INTERNAL_setTunnelDefaults as setTunnelDefaults } from '@sentry/core/server';\nimport { definePlugin } from 'nitro';\nimport { useRuntimeConfig } from 'nitro/runtime-config';\n// @ts-expect-error - This is a virtual module\nimport { tasks } from '#nitro/virtual/tasks';\nimport { captureErrorHook } from '../hooks/captureErrorHook';\nimport { instrumentTasks } from '../utils/instrumentTasks';\n\nexport default definePlugin(nitroApp => {\n nitroApp.hooks.hook('error', captureErrorHook);\n instrumentTasks(tasks);\n\n // The runtime answers managed tunnel requests, under Nitro's `baseURL` unless a framework serves the app under\n // another prefix: `@sentry/solidstart` sets `sentryTunnelBasePath` to Vite's `base`.\n const runtimeConfig = useRuntimeConfig() as { app?: { baseURL?: string }; sentryTunnelBasePath?: string };\n setTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });\n});\n"],"names":["setTunnelDefaults"],"mappings":";;;;;;;AAQA,eAAe,aAAa,CAAA,QAAA,KAAY;AACtC,EAAA,QAAA,CAAS,KAAA,CAAM,IAAA,CAAK,OAAA,EAAS,gBAAgB,CAAA;AAC7C,EAAA,eAAA,CAAgB,KAAK,CAAA;AAIrB,EAAA,MAAM,gBAAgB,gBAAA,EAAiB;AACvC,EAAAA,2BAAA,CAAkB,EAAE,QAAA,EAAU,aAAA,CAAc,wBAAwB,aAAA,CAAc,GAAA,EAAK,SAAS,CAAA;AAClG,CAAC,CAAA;;;;"}
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@sentry/nitro",
3
- "version": "11.11.0",
3
+ "version": "11.12.0",
4
4
  "description": "Official Sentry SDK for Nitro",
5
- "repository": "git://github.com/getsentry/sentry-javascript.git",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git://github.com/getsentry/sentry-javascript.git"
8
+ },
6
9
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nitro",
7
10
  "author": "Sentry",
8
11
  "license": "MIT",
@@ -35,19 +38,33 @@
35
38
  "nitro": ">=3.0.0-0 <4.0.0 || 3.0.260311-beta || 3.0.260415-beta || 3.0.260429-beta || 3.0.260522-beta || 3.0.260603-beta || 3.0.260610-beta || 3.0.260903-beta"
36
39
  },
37
40
  "dependencies": {
38
- "@sentry/bundler-plugins": "11.11.0",
39
- "@sentry/conventions": "^0.30.0",
40
- "@sentry/core": "11.11.0",
41
- "@sentry/node": "11.11.0",
42
- "@sentry/server-runtime-injection": "11.11.0",
43
- "@sentry/server-utils": "11.11.0"
41
+ "@sentry/bundler-plugins": "11.12.0",
42
+ "@sentry/conventions": "^0.32.0",
43
+ "@sentry/core": "11.12.0",
44
+ "@sentry/node": "11.12.0",
45
+ "@sentry/server-runtime-injection": "11.12.0",
46
+ "@sentry/server-utils": "11.12.0"
44
47
  },
45
48
  "devDependencies": {
46
- "@sentry-internal/rollup-utils": "11.11.0",
49
+ "@sentry-internal/rollup-utils": "11.12.0",
47
50
  "h3": "^2.0.1-rc.20",
48
51
  "nitro": "^3.0.260415-beta",
49
- "srvx": "^0.11.22",
50
- "unstorage": "^2.0.0-alpha.7"
52
+ "srvx": "^0.11.22"
53
+ },
54
+ "sideEffects": false,
55
+ "nx": {
56
+ "targets": {
57
+ "build:transpile": {
58
+ "dependsOn": [
59
+ "^build:transpile",
60
+ "^build:types",
61
+ "build:types"
62
+ ],
63
+ "outputs": [
64
+ "{projectRoot}/build/esm"
65
+ ]
66
+ }
67
+ }
51
68
  },
52
69
  "scripts": {
53
70
  "build": "run-p build:transpile build:types",
@@ -59,8 +76,8 @@
59
76
  "build:dev:watch": "pnpm run build:watch",
60
77
  "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
61
78
  "build:types:watch": "tsc -p tsconfig.types.json --watch",
62
- "build:tarball": "npm pack",
63
- "clean": "rimraf build coverage sentry-nitro-*.tgz",
79
+ "build:tarball": "pnpm pack",
80
+ "clean": "node ../../scripts/rm.mjs build coverage sentry-nitro-*.tgz",
64
81
  "lint": "oxlint . --type-aware",
65
82
  "lint:types": "oxlint src --type-aware --type-check",
66
83
  "lint:fix": "oxlint . --fix --type-aware",
@@ -68,20 +85,5 @@
68
85
  "test": "vitest run",
69
86
  "test:watch": "vitest --watch",
70
87
  "yalc:publish": "yalc publish --push --sig"
71
- },
72
- "sideEffects": false,
73
- "nx": {
74
- "targets": {
75
- "build:transpile": {
76
- "dependsOn": [
77
- "^build:transpile",
78
- "^build:types",
79
- "build:types"
80
- ],
81
- "outputs": [
82
- "{projectRoot}/build/esm"
83
- ]
84
- }
85
- }
86
88
  }
87
- }
89
+ }