@sentry/nitro 11.12.0 → 11.13.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,18 +1,22 @@
1
- import { createNitroModule } from './module.js';
2
- import { configureSourcemapSettings } from './sourceMaps.js';
3
-
1
+ import { createNitroModule } from "./module.js";
2
+ import { configureSourcemapSettings } from "./sourceMaps.js";
3
+ // src/config.ts
4
+ /**
5
+ * Modifies the passed in Nitro configuration with automatic build-time instrumentation.
6
+ */
4
7
  function withSentryConfig(config, sentryOptions) {
5
- return setupSentryNitroModule(config, sentryOptions);
8
+ return setupSentryNitroModule(config, sentryOptions);
6
9
  }
10
+ /**
11
+ * Sets up the Sentry Nitro module, useful for meta framework integrations.
12
+ */
7
13
  function setupSentryNitroModule(config, moduleOptions, _serverConfigFile) {
8
- if (!config.tracingChannel) {
9
- config.tracingChannel = true;
10
- }
11
- const { sentryEnabledSourcemaps } = configureSourcemapSettings(config, moduleOptions);
12
- config.modules = config.modules || [];
13
- config.modules.push(createNitroModule(moduleOptions, sentryEnabledSourcemaps));
14
- return config;
14
+ if (!config.tracingChannel) config.tracingChannel = true;
15
+ const { sentryEnabledSourcemaps } = configureSourcemapSettings(config, moduleOptions);
16
+ config.modules = config.modules || [];
17
+ config.modules.push(createNitroModule(moduleOptions, sentryEnabledSourcemaps));
18
+ return config;
15
19
  }
16
-
17
20
  export { setupSentryNitroModule, withSentryConfig };
18
- //# sourceMappingURL=config.js.map
21
+
22
+ //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport type { NitroConfig } from 'nitro/types';\nimport { createNitroModule } from './module';\nimport { configureSourcemapSettings } from './sourceMaps';\n\nexport type SentryNitroOptions = BuildTimeOptionsBase;\n\n/**\n * Modifies the passed in Nitro configuration with automatic build-time instrumentation.\n */\nexport function withSentryConfig(config: NitroConfig, sentryOptions?: SentryNitroOptions): NitroConfig {\n return setupSentryNitroModule(config, sentryOptions);\n}\n\n/**\n * Sets up the Sentry Nitro module, useful for meta framework integrations.\n */\nexport function setupSentryNitroModule(\n config: NitroConfig,\n moduleOptions?: SentryNitroOptions,\n _serverConfigFile?: string,\n): NitroConfig {\n if (!config.tracingChannel) {\n config.tracingChannel = true;\n }\n\n const { sentryEnabledSourcemaps } = configureSourcemapSettings(config, moduleOptions);\n\n config.modules = config.modules || [];\n config.modules.push(createNitroModule(moduleOptions, sentryEnabledSourcemaps));\n\n return config;\n}\n"],"names":[],"mappings":";;;AAUO,SAAS,gBAAA,CAAiB,QAAqB,aAAA,EAAiD;AACrG,EAAA,OAAO,sBAAA,CAAuB,QAAQ,aAAa,CAAA;AACrD;AAKO,SAAS,sBAAA,CACd,MAAA,EACA,aAAA,EACA,iBAAA,EACa;AACb,EAAA,IAAI,CAAC,OAAO,cAAA,EAAgB;AAC1B,IAAA,MAAA,CAAO,cAAA,GAAiB,IAAA;AAAA,EAC1B;AAEA,EAAA,MAAM,EAAE,uBAAA,EAAwB,GAAI,0BAAA,CAA2B,QAAQ,aAAa,CAAA;AAEpF,EAAA,MAAA,CAAO,OAAA,GAAU,MAAA,CAAO,OAAA,IAAW,EAAC;AACpC,EAAA,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,iBAAA,CAAkB,aAAA,EAAe,uBAAuB,CAAC,CAAA;AAE7E,EAAA,OAAO,MAAA;AACT;;;;"}
1
+ {"version":3,"file":"config.js","names":[],"sources":["../../src/config.ts"],"sourcesContent":["import type { BuildTimeOptionsBase } from '@sentry/core';\nimport type { NitroConfig } from 'nitro/types';\nimport { createNitroModule } from './module';\nimport { configureSourcemapSettings } from './sourceMaps';\n\nexport type SentryNitroOptions = BuildTimeOptionsBase;\n\n/**\n * Modifies the passed in Nitro configuration with automatic build-time instrumentation.\n */\nexport function withSentryConfig(config: NitroConfig, sentryOptions?: SentryNitroOptions): NitroConfig {\n return setupSentryNitroModule(config, sentryOptions);\n}\n\n/**\n * Sets up the Sentry Nitro module, useful for meta framework integrations.\n */\nexport function setupSentryNitroModule(\n config: NitroConfig,\n moduleOptions?: SentryNitroOptions,\n _serverConfigFile?: string,\n): NitroConfig {\n if (!config.tracingChannel) {\n config.tracingChannel = true;\n }\n\n const { sentryEnabledSourcemaps } = configureSourcemapSettings(config, moduleOptions);\n\n config.modules = config.modules || [];\n config.modules.push(createNitroModule(moduleOptions, sentryEnabledSourcemaps));\n\n return config;\n}\n"],"mappings":";;;;;;AAUA,SAAgB,iBAAiB,QAAqB,eAAiD;CACrG,OAAO,uBAAuB,QAAQ,aAAa;AACrD;;;;AAKA,SAAgB,uBACd,QACA,eACA,mBACa;CACb,IAAI,CAAC,OAAO,gBACV,OAAO,iBAAiB;CAG1B,MAAM,EAAE,4BAA4B,2BAA2B,QAAQ,aAAa;CAEpF,OAAO,UAAU,OAAO,WAAW,CAAC;CACpC,OAAO,QAAQ,KAAK,kBAAkB,eAAe,uBAAuB,CAAC;CAE7E,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- export { setupSentryNitroModule, withSentryConfig } from './config.js';
2
- export * from '@sentry/node';
3
- export { init } from './sdk.js';
4
- //# sourceMappingURL=index.js.map
1
+ import { setupSentryNitroModule, withSentryConfig } from "./config.js";
2
+ import { init } from "./sdk.js";
3
+ export * from "@sentry/node";
4
+ export { init, setupSentryNitroModule, withSentryConfig };
@@ -1,10 +1,14 @@
1
- import { addPlugin } from '../utils/plugin.js';
2
- import { createResolver } from '../utils/resolver.js';
3
-
1
+ import { addPlugin } from "../utils/plugin.js";
2
+ import { createResolver } from "../utils/resolver.js";
3
+ // src/instruments/instrumentServer.ts
4
+ /**
5
+ * Sets up the Nitro server instrumentation plugin
6
+ * @param nitro - The Nitro instance.
7
+ */
4
8
  function instrumentServer(nitro) {
5
- const moduleResolver = createResolver(import.meta.url);
6
- addPlugin(nitro, moduleResolver.resolve("../runtime/plugins/server"));
9
+ const moduleResolver = createResolver(import.meta.url);
10
+ addPlugin(nitro, moduleResolver.resolve("../runtime/plugins/server"));
7
11
  }
8
-
9
12
  export { instrumentServer };
10
- //# sourceMappingURL=instrumentServer.js.map
13
+
14
+ //# sourceMappingURL=instrumentServer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentServer.js","sources":["../../../src/instruments/instrumentServer.ts"],"sourcesContent":["import type { Nitro } from 'nitro/types';\nimport { addPlugin } from '../utils/plugin';\nimport { createResolver } from '../utils/resolver';\n\n/**\n * Sets up the Nitro server instrumentation plugin\n * @param nitro - The Nitro instance.\n */\nexport function instrumentServer(nitro: Nitro): void {\n const moduleResolver = createResolver(import.meta.url);\n addPlugin(nitro, moduleResolver.resolve('../runtime/plugins/server'));\n}\n"],"names":[],"mappings":";;;AAQO,SAAS,iBAAiB,KAAA,EAAoB;AACnD,EAAA,MAAM,cAAA,GAAiB,cAAA,CAAe,MAAA,CAAA,IAAA,CAAY,GAAG,CAAA;AACrD,EAAA,SAAA,CAAU,KAAA,EAAO,cAAA,CAAe,OAAA,CAAQ,2BAA2B,CAAC,CAAA;AACtE;;;;"}
1
+ {"version":3,"file":"instrumentServer.js","names":[],"sources":["../../../src/instruments/instrumentServer.ts"],"sourcesContent":["import type { Nitro } from 'nitro/types';\nimport { addPlugin } from '../utils/plugin';\nimport { createResolver } from '../utils/resolver';\n\n/**\n * Sets up the Nitro server instrumentation plugin\n * @param nitro - The Nitro instance.\n */\nexport function instrumentServer(nitro: Nitro): void {\n const moduleResolver = createResolver(import.meta.url);\n addPlugin(nitro, moduleResolver.resolve('../runtime/plugins/server'));\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,iBAAiB,OAAoB;CACnD,MAAM,iBAAiB,eAAe,YAAY,GAAG;CACrD,UAAU,OAAO,eAAe,QAAQ,2BAA2B,CAAC;AACtE"}
@@ -1,20 +1,23 @@
1
- import { _INTERNAL_setTunnelDefaults } from '@sentry/core/server';
2
- import { instrumentServer } from './instruments/instrumentServer.js';
3
- import { setupSourceMaps } from './sourceMaps.js';
4
-
1
+ import { instrumentServer } from "./instruments/instrumentServer.js";
2
+ import { setupSourceMaps } from "./sourceMaps.js";
3
+ import { _INTERNAL_setTunnelDefaults } from "@sentry/core/server";
4
+ // src/module.ts
5
+ /**
6
+ * Creates a Nitro module to setup the Sentry SDK.
7
+ */
5
8
  function createNitroModule(sentryOptions, sentryEnabledSourcemaps) {
6
- return {
7
- name: "sentry",
8
- setup: (nitro) => {
9
- instrumentServer(nitro);
10
- setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);
11
- if (nitro.options.dev) {
12
- const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath;
13
- _INTERNAL_setTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });
14
- }
15
- }
16
- };
9
+ return {
10
+ name: "sentry",
11
+ setup: (nitro) => {
12
+ instrumentServer(nitro);
13
+ setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);
14
+ if (nitro.options.dev) {
15
+ const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath;
16
+ _INTERNAL_setTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });
17
+ }
18
+ }
19
+ };
17
20
  }
18
-
19
21
  export { createNitroModule };
20
- //# sourceMappingURL=module.js.map
22
+
23
+ //# sourceMappingURL=module.js.map
@@ -1 +1 @@
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
+ {"version":3,"file":"module.js","names":["setTunnelDefaults"],"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"],"mappings":";;;;;;;AASA,SAAgB,kBAAkB,eAAoC,yBAAgD;CACpH,OAAO;EACL,MAAM;EACN,QAAO,UAAS;GACd,iBAAiB,KAAK;GACtB,gBAAgB,OAAO,eAAe,uBAAuB;GAI7D,IAAI,MAAM,QAAQ,KAAK;IAErB,MAAM,iBAAiB,MAAM,QAAQ,cAAc;IACnDA,4BAAkB,EAAE,UAAU,kBAAkB,MAAM,QAAQ,QAAQ,CAAC;GACzE;EACF;CACF;AACF"}
@@ -1 +1 @@
1
- {"type":"module","version":"11.12.0","sideEffects":false}
1
+ {"type":"module","version":"11.13.0","sideEffects":false}
@@ -1,40 +1,39 @@
1
- import { getClient, isAlreadyCaptured, captureException, parseUrl } from '@sentry/core';
2
- import { flushIfServerless } from '@sentry/core/server';
3
- import { HTTPError } from 'nitro/h3';
4
-
1
+ import { flushIfServerless } from "@sentry/core/server";
2
+ import { captureException, getClient, isAlreadyCaptured, parseUrl } from "@sentry/core";
3
+ import { HTTPError } from "nitro/h3";
4
+ // src/runtime/hooks/captureErrorHook.ts
5
+ /**
6
+ * Extracts the relevant context information from the error context (HTTPEvent in Nitro Error)
7
+ * and creates a structured context object.
8
+ */
5
9
  function extractErrorContext(errorContext) {
6
- const ctx = {};
7
- if (!errorContext) {
8
- return ctx;
9
- }
10
- if (errorContext.event) {
11
- ctx.method = errorContext.event.req.method;
12
- ctx.path = parseUrl(errorContext.event.req.url).path;
13
- }
14
- if (Array.isArray(errorContext.tags)) {
15
- ctx.tags = errorContext.tags;
16
- }
17
- return ctx;
10
+ const ctx = {};
11
+ if (!errorContext) return ctx;
12
+ if (errorContext.event) {
13
+ ctx.method = errorContext.event.req.method;
14
+ ctx.path = parseUrl(errorContext.event.req.url).path;
15
+ }
16
+ if (Array.isArray(errorContext.tags)) ctx.tags = errorContext.tags;
17
+ return ctx;
18
18
  }
19
+ /**
20
+ * Hook that can be added in a Nitro plugin. It captures an error and sends it to Sentry.
21
+ */
19
22
  async function captureErrorHook(error, errorContext) {
20
- const sentryClient = getClient();
21
- const sentryClientOptions = sentryClient?.getOptions();
22
- if (sentryClientOptions && "enableNitroErrorHandler" in sentryClientOptions && sentryClientOptions.enableNitroErrorHandler === false) {
23
- return;
24
- }
25
- if (HTTPError.isError(error) && error.status >= 300 && error.status < 500) {
26
- return;
27
- }
28
- if (HTTPError.isError(error) && isAlreadyCaptured(error.cause)) {
29
- return;
30
- }
31
- const structuredContext = extractErrorContext(errorContext);
32
- captureException(error, {
33
- captureContext: { contexts: { nitro: structuredContext } },
34
- mechanism: { handled: false, type: "auto.function.nitro.captureErrorHook" }
35
- });
36
- await flushIfServerless();
23
+ const sentryClientOptions = getClient()?.getOptions();
24
+ if (sentryClientOptions && "enableNitroErrorHandler" in sentryClientOptions && sentryClientOptions.enableNitroErrorHandler === false) return;
25
+ if (HTTPError.isError(error) && error.status >= 300 && error.status < 500) return;
26
+ if (HTTPError.isError(error) && isAlreadyCaptured(error.cause)) return;
27
+ const structuredContext = extractErrorContext(errorContext);
28
+ captureException(error, {
29
+ captureContext: { contexts: { nitro: structuredContext } },
30
+ mechanism: {
31
+ handled: false,
32
+ type: "auto.function.nitro.captureErrorHook"
33
+ }
34
+ });
35
+ await flushIfServerless();
37
36
  }
38
-
39
37
  export { captureErrorHook };
40
- //# sourceMappingURL=captureErrorHook.js.map
38
+
39
+ //# sourceMappingURL=captureErrorHook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"captureErrorHook.js","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"sourcesContent":["import { captureException, getClient, isAlreadyCaptured, parseUrl } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport { HTTPError } from 'nitro/h3';\nimport type { CapturedErrorContext } from 'nitro/types';\n\n/**\n * Extracts the relevant context information from the error context (HTTPEvent in Nitro Error)\n * and creates a structured context object.\n */\nfunction extractErrorContext(errorContext: CapturedErrorContext | undefined): Record<string, unknown> {\n const ctx: Record<string, unknown> = {};\n\n if (!errorContext) {\n return ctx;\n }\n\n if (errorContext.event) {\n ctx.method = errorContext.event.req.method;\n ctx.path = parseUrl(errorContext.event.req.url).path;\n }\n\n if (Array.isArray(errorContext.tags)) {\n ctx.tags = errorContext.tags;\n }\n\n return ctx;\n}\n\n/**\n * Hook that can be added in a Nitro plugin. It captures an error and sends it to Sentry.\n */\nexport async function captureErrorHook(error: Error, errorContext: CapturedErrorContext): Promise<void> {\n const sentryClient = getClient();\n const sentryClientOptions = sentryClient?.getOptions();\n\n if (\n sentryClientOptions &&\n 'enableNitroErrorHandler' in sentryClientOptions &&\n sentryClientOptions.enableNitroErrorHandler === false\n ) {\n return;\n }\n\n // Do not report HTTPErrors with 3xx or 4xx status codes\n if (HTTPError.isError(error) && error.status >= 300 && error.status < 500) {\n return;\n }\n\n // Nitro wraps errors thrown in handlers in an `HTTPError`, so an error the SDK already captured (for example in a\n // task) would be reported a second time through the wrapper.\n if (HTTPError.isError(error) && isAlreadyCaptured(error.cause)) {\n return;\n }\n\n const structuredContext = extractErrorContext(errorContext);\n\n captureException(error, {\n captureContext: { contexts: { nitro: structuredContext } },\n mechanism: { handled: false, type: 'auto.function.nitro.captureErrorHook' },\n });\n\n await flushIfServerless();\n}\n"],"names":[],"mappings":";;;;AASA,SAAS,oBAAoB,YAAA,EAAyE;AACpG,EAAA,MAAM,MAA+B,EAAC;AAEtC,EAAA,IAAI,CAAC,YAAA,EAAc;AACjB,IAAA,OAAO,GAAA;AAAA,EACT;AAEA,EAAA,IAAI,aAAa,KAAA,EAAO;AACtB,IAAA,GAAA,CAAI,MAAA,GAAS,YAAA,CAAa,KAAA,CAAM,GAAA,CAAI,MAAA;AACpC,IAAA,GAAA,CAAI,OAAO,QAAA,CAAS,YAAA,CAAa,KAAA,CAAM,GAAA,CAAI,GAAG,CAAA,CAAE,IAAA;AAAA,EAClD;AAEA,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,YAAA,CAAa,IAAI,CAAA,EAAG;AACpC,IAAA,GAAA,CAAI,OAAO,YAAA,CAAa,IAAA;AAAA,EAC1B;AAEA,EAAA,OAAO,GAAA;AACT;AAKA,eAAsB,gBAAA,CAAiB,OAAc,YAAA,EAAmD;AACtG,EAAA,MAAM,eAAe,SAAA,EAAU;AAC/B,EAAA,MAAM,mBAAA,GAAsB,cAAc,UAAA,EAAW;AAErD,EAAA,IACE,mBAAA,IACA,yBAAA,IAA6B,mBAAA,IAC7B,mBAAA,CAAoB,4BAA4B,KAAA,EAChD;AACA,IAAA;AAAA,EACF;AAGA,EAAA,IAAI,SAAA,CAAU,QAAQ,KAAK,CAAA,IAAK,MAAM,MAAA,IAAU,GAAA,IAAO,KAAA,CAAM,MAAA,GAAS,GAAA,EAAK;AACzE,IAAA;AAAA,EACF;AAIA,EAAA,IAAI,UAAU,OAAA,CAAQ,KAAK,KAAK,iBAAA,CAAkB,KAAA,CAAM,KAAK,CAAA,EAAG;AAC9D,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,iBAAA,GAAoB,oBAAoB,YAAY,CAAA;AAE1D,EAAA,gBAAA,CAAiB,KAAA,EAAO;AAAA,IACtB,gBAAgB,EAAE,QAAA,EAAU,EAAE,KAAA,EAAO,mBAAkB,EAAE;AAAA,IACzD,SAAA,EAAW,EAAE,OAAA,EAAS,KAAA,EAAO,MAAM,sCAAA;AAAuC,GAC3E,CAAA;AAED,EAAA,MAAM,iBAAA,EAAkB;AAC1B;;;;"}
1
+ {"version":3,"file":"captureErrorHook.js","names":[],"sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"sourcesContent":["import { captureException, getClient, isAlreadyCaptured, parseUrl } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport { HTTPError } from 'nitro/h3';\nimport type { CapturedErrorContext } from 'nitro/types';\n\n/**\n * Extracts the relevant context information from the error context (HTTPEvent in Nitro Error)\n * and creates a structured context object.\n */\nfunction extractErrorContext(errorContext: CapturedErrorContext | undefined): Record<string, unknown> {\n const ctx: Record<string, unknown> = {};\n\n if (!errorContext) {\n return ctx;\n }\n\n if (errorContext.event) {\n ctx.method = errorContext.event.req.method;\n ctx.path = parseUrl(errorContext.event.req.url).path;\n }\n\n if (Array.isArray(errorContext.tags)) {\n ctx.tags = errorContext.tags;\n }\n\n return ctx;\n}\n\n/**\n * Hook that can be added in a Nitro plugin. It captures an error and sends it to Sentry.\n */\nexport async function captureErrorHook(error: Error, errorContext: CapturedErrorContext): Promise<void> {\n const sentryClient = getClient();\n const sentryClientOptions = sentryClient?.getOptions();\n\n if (\n sentryClientOptions &&\n 'enableNitroErrorHandler' in sentryClientOptions &&\n sentryClientOptions.enableNitroErrorHandler === false\n ) {\n return;\n }\n\n // Do not report HTTPErrors with 3xx or 4xx status codes\n if (HTTPError.isError(error) && error.status >= 300 && error.status < 500) {\n return;\n }\n\n // Nitro wraps errors thrown in handlers in an `HTTPError`, so an error the SDK already captured (for example in a\n // task) would be reported a second time through the wrapper.\n if (HTTPError.isError(error) && isAlreadyCaptured(error.cause)) {\n return;\n }\n\n const structuredContext = extractErrorContext(errorContext);\n\n captureException(error, {\n captureContext: { contexts: { nitro: structuredContext } },\n mechanism: { handled: false, type: 'auto.function.nitro.captureErrorHook' },\n });\n\n await flushIfServerless();\n}\n"],"mappings":";;;;;;;;AASA,SAAS,oBAAoB,cAAyE;CACpG,MAAM,MAA+B,CAAC;CAEtC,IAAI,CAAC,cACH,OAAO;CAGT,IAAI,aAAa,OAAO;EACtB,IAAI,SAAS,aAAa,MAAM,IAAI;EACpC,IAAI,OAAO,SAAS,aAAa,MAAM,IAAI,GAAG,CAAC,CAAC;CAClD;CAEA,IAAI,MAAM,QAAQ,aAAa,IAAI,GACjC,IAAI,OAAO,aAAa;CAG1B,OAAO;AACT;;;;AAKA,eAAsB,iBAAiB,OAAc,cAAmD;CAEtG,MAAM,sBADe,UACkB,CAAC,EAAE,WAAW;CAErD,IACE,uBACA,6BAA6B,uBAC7B,oBAAoB,4BAA4B,OAEhD;CAIF,IAAI,UAAU,QAAQ,KAAK,KAAK,MAAM,UAAU,OAAO,MAAM,SAAS,KACpE;CAKF,IAAI,UAAU,QAAQ,KAAK,KAAK,kBAAkB,MAAM,KAAK,GAC3D;CAGF,MAAM,oBAAoB,oBAAoB,YAAY;CAE1D,iBAAiB,OAAO;EACtB,gBAAgB,EAAE,UAAU,EAAE,OAAO,kBAAkB,EAAE;EACzD,WAAW;GAAE,SAAS;GAAO,MAAM;EAAuC;CAC5E,CAAC;CAED,MAAM,kBAAkB;AAC1B"}
@@ -1,16 +1,16 @@
1
- import { _INTERNAL_setTunnelDefaults } from '@sentry/core/server';
2
- import { definePlugin } from 'nitro';
3
- import { useRuntimeConfig } from 'nitro/runtime-config';
4
- import { tasks } from '#nitro/virtual/tasks';
5
- import { captureErrorHook } from '../hooks/captureErrorHook.js';
6
- import { instrumentTasks } from '../utils/instrumentTasks.js';
7
-
8
- const server = definePlugin((nitroApp) => {
9
- nitroApp.hooks.hook("error", captureErrorHook);
10
- instrumentTasks(tasks);
11
- const runtimeConfig = useRuntimeConfig();
12
- _INTERNAL_setTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });
1
+ import { captureErrorHook } from "../hooks/captureErrorHook.js";
2
+ import { instrumentTasks } from "../utils/instrumentTasks.js";
3
+ import { _INTERNAL_setTunnelDefaults } from "@sentry/core/server";
4
+ import { definePlugin } from "nitro";
5
+ import { useRuntimeConfig } from "nitro/runtime-config";
6
+ import { tasks } from "#nitro/virtual/tasks";
7
+ // src/runtime/plugins/server.ts
8
+ var server_default = definePlugin((nitroApp) => {
9
+ nitroApp.hooks.hook("error", captureErrorHook);
10
+ instrumentTasks(tasks);
11
+ const runtimeConfig = useRuntimeConfig();
12
+ _INTERNAL_setTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });
13
13
  });
14
+ export { server_default as default };
14
15
 
15
- export { server as default };
16
- //# sourceMappingURL=server.js.map
16
+ //# sourceMappingURL=server.js.map
@@ -1 +1 @@
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;;;;"}
1
+ {"version":3,"file":"server.js","names":["setTunnelDefaults"],"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"],"mappings":";;;;;;;AAQA,IAAA,iBAAe,cAAa,aAAY;CACtC,SAAS,MAAM,KAAK,SAAS,gBAAgB;CAC7C,gBAAgB,KAAK;CAIrB,MAAM,gBAAgB,iBAAiB;CACvCA,4BAAkB,EAAE,UAAU,cAAc,wBAAwB,cAAc,KAAK,QAAQ,CAAC;AAClG,CAAC"}
@@ -1,35 +1,39 @@
1
- import { captureException } from '@sentry/core';
2
- import { flushIfServerless } from '@sentry/core/server';
3
-
1
+ import { flushIfServerless } from "@sentry/core/server";
2
+ import { captureException } from "@sentry/core";
3
+ // src/runtime/utils/instrumentTasks.ts
4
+ /**
5
+ * Wraps the `run` function of every registered Nitro task to capture errors it throws.
6
+ *
7
+ * Nitro's scheduler catches task errors and only logs them, so they never reach the `error` hook.
8
+ */
4
9
  function instrumentTasks(tasks) {
5
- for (const [name, task] of Object.entries(tasks)) {
6
- const originalResolve = task.resolve;
7
- if (!originalResolve) {
8
- continue;
9
- }
10
- task.resolve = async () => {
11
- const handler = await originalResolve();
12
- if (typeof handler?.run !== "function") {
13
- return handler;
14
- }
15
- return {
16
- ...handler,
17
- run: async (event) => {
18
- try {
19
- return await handler.run(event);
20
- } catch (error) {
21
- captureException(error, {
22
- captureContext: { contexts: { nitro: { task: name } } },
23
- mechanism: { handled: false, type: "auto.function.nitro.task" }
24
- });
25
- await flushIfServerless();
26
- throw error;
27
- }
28
- }
29
- };
30
- };
31
- }
10
+ for (const [name, task] of Object.entries(tasks)) {
11
+ const originalResolve = task.resolve;
12
+ if (!originalResolve) continue;
13
+ task.resolve = async () => {
14
+ const handler = await originalResolve();
15
+ if (typeof handler?.run !== "function") return handler;
16
+ return {
17
+ ...handler,
18
+ run: async (event) => {
19
+ try {
20
+ return await handler.run(event);
21
+ } catch (error) {
22
+ captureException(error, {
23
+ captureContext: { contexts: { nitro: { task: name } } },
24
+ mechanism: {
25
+ handled: false,
26
+ type: "auto.function.nitro.task"
27
+ }
28
+ });
29
+ await flushIfServerless();
30
+ throw error;
31
+ }
32
+ }
33
+ };
34
+ };
35
+ }
32
36
  }
33
-
34
37
  export { instrumentTasks };
35
- //# sourceMappingURL=instrumentTasks.js.map
38
+
39
+ //# sourceMappingURL=instrumentTasks.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentTasks.js","sources":["../../../../src/runtime/utils/instrumentTasks.ts"],"sourcesContent":["import { captureException } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport type { Task } from 'nitro/types';\n\ntype TaskRegistry = Record<string, { resolve?: () => Promise<Task> }>;\n\n/**\n * Wraps the `run` function of every registered Nitro task to capture errors it throws.\n *\n * Nitro's scheduler catches task errors and only logs them, so they never reach the `error` hook.\n */\nexport function instrumentTasks(tasks: TaskRegistry): void {\n for (const [name, task] of Object.entries(tasks)) {\n const originalResolve = task.resolve;\n if (!originalResolve) {\n continue;\n }\n\n task.resolve = async () => {\n const handler = await originalResolve();\n if (typeof handler?.run !== 'function') {\n return handler;\n }\n\n // `resolve` returns the same cached module object on every call, so return a copy instead of wrapping `run` again.\n return {\n ...handler,\n run: async event => {\n try {\n return await handler.run(event);\n } catch (error) {\n captureException(error, {\n captureContext: { contexts: { nitro: { task: name } } },\n mechanism: { handled: false, type: 'auto.function.nitro.task' },\n });\n await flushIfServerless();\n throw error;\n }\n },\n };\n };\n }\n}\n"],"names":[],"mappings":";;;AAWO,SAAS,gBAAgB,KAAA,EAA2B;AACzD,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,IAAI,KAAK,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,EAAG;AAChD,IAAA,MAAM,kBAAkB,IAAA,CAAK,OAAA;AAC7B,IAAA,IAAI,CAAC,eAAA,EAAiB;AACpB,MAAA;AAAA,IACF;AAEA,IAAA,IAAA,CAAK,UAAU,YAAY;AACzB,MAAA,MAAM,OAAA,GAAU,MAAM,eAAA,EAAgB;AACtC,MAAA,IAAI,OAAO,OAAA,EAAS,GAAA,KAAQ,UAAA,EAAY;AACtC,QAAA,OAAO,OAAA;AAAA,MACT;AAGA,MAAA,OAAO;AAAA,QACL,GAAG,OAAA;AAAA,QACH,GAAA,EAAK,OAAM,KAAA,KAAS;AAClB,UAAA,IAAI;AACF,YAAA,OAAO,MAAM,OAAA,CAAQ,GAAA,CAAI,KAAK,CAAA;AAAA,UAChC,SAAS,KAAA,EAAO;AACd,YAAA,gBAAA,CAAiB,KAAA,EAAO;AAAA,cACtB,cAAA,EAAgB,EAAE,QAAA,EAAU,EAAE,OAAO,EAAE,IAAA,EAAM,IAAA,EAAK,EAAE,EAAE;AAAA,cACtD,SAAA,EAAW,EAAE,OAAA,EAAS,KAAA,EAAO,MAAM,0BAAA;AAA2B,aAC/D,CAAA;AACD,YAAA,MAAM,iBAAA,EAAkB;AACxB,YAAA,MAAM,KAAA;AAAA,UACR;AAAA,QACF;AAAA,OACF;AAAA,IACF,CAAA;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"instrumentTasks.js","names":[],"sources":["../../../../src/runtime/utils/instrumentTasks.ts"],"sourcesContent":["import { captureException } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport type { Task } from 'nitro/types';\n\ntype TaskRegistry = Record<string, { resolve?: () => Promise<Task> }>;\n\n/**\n * Wraps the `run` function of every registered Nitro task to capture errors it throws.\n *\n * Nitro's scheduler catches task errors and only logs them, so they never reach the `error` hook.\n */\nexport function instrumentTasks(tasks: TaskRegistry): void {\n for (const [name, task] of Object.entries(tasks)) {\n const originalResolve = task.resolve;\n if (!originalResolve) {\n continue;\n }\n\n task.resolve = async () => {\n const handler = await originalResolve();\n if (typeof handler?.run !== 'function') {\n return handler;\n }\n\n // `resolve` returns the same cached module object on every call, so return a copy instead of wrapping `run` again.\n return {\n ...handler,\n run: async event => {\n try {\n return await handler.run(event);\n } catch (error) {\n captureException(error, {\n captureContext: { contexts: { nitro: { task: name } } },\n mechanism: { handled: false, type: 'auto.function.nitro.task' },\n });\n await flushIfServerless();\n throw error;\n }\n },\n };\n };\n }\n}\n"],"mappings":";;;;;;;;AAWA,SAAgB,gBAAgB,OAA2B;CACzD,KAAK,MAAM,CAAC,MAAM,SAAS,OAAO,QAAQ,KAAK,GAAG;EAChD,MAAM,kBAAkB,KAAK;EAC7B,IAAI,CAAC,iBACH;EAGF,KAAK,UAAU,YAAY;GACzB,MAAM,UAAU,MAAM,gBAAgB;GACtC,IAAI,OAAO,SAAS,QAAQ,YAC1B,OAAO;GAIT,OAAO;IACL,GAAG;IACH,KAAK,OAAM,UAAS;KAClB,IAAI;MACF,OAAO,MAAM,QAAQ,IAAI,KAAK;KAChC,SAAS,OAAO;MACd,iBAAiB,OAAO;OACtB,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,EAAE,EAAE;OACtD,WAAW;QAAE,SAAS;QAAO,MAAM;OAA2B;MAChE,CAAC;MACD,MAAM,kBAAkB;MACxB,MAAM;KACR;IACF;GACF;EACF;CACF;AACF"}
package/build/esm/sdk.js CHANGED
@@ -1,20 +1,23 @@
1
- import { applySdkMetadata } from '@sentry/core';
2
- import { init as init$1, getDefaultIntegrations as getDefaultIntegrations$1 } from '@sentry/node';
3
-
1
+ import { getDefaultIntegrations as getDefaultIntegrations$1, init as init$1 } from "@sentry/node";
2
+ import { applySdkMetadata } from "@sentry/core";
3
+ // src/sdk.ts
4
+ /**
5
+ * Initializes the Nitro SDK
6
+ */
4
7
  function init(options = {}) {
5
- const opts = {
6
- ...options
7
- };
8
- if (opts.defaultIntegrations === void 0) {
9
- opts.defaultIntegrations = getDefaultIntegrations(opts);
10
- }
11
- applySdkMetadata(opts, "nitro", ["nitro", "node"]);
12
- const client = init$1(opts);
13
- return client;
8
+ const opts = { ...options };
9
+ if (opts.defaultIntegrations === void 0) opts.defaultIntegrations = getDefaultIntegrations(opts);
10
+ applySdkMetadata(opts, "nitro", ["nitro", "node"]);
11
+ return init$1(opts);
14
12
  }
13
+ /**
14
+ * Get the default integrations for the Nitro SDK.
15
+ *
16
+ * @returns The default integrations for the Nitro SDK.
17
+ */
15
18
  function getDefaultIntegrations(options) {
16
- return [...getDefaultIntegrations$1(options)];
19
+ return [...getDefaultIntegrations$1(options)];
17
20
  }
18
-
19
21
  export { getDefaultIntegrations, init };
20
- //# sourceMappingURL=sdk.js.map
22
+
23
+ //# sourceMappingURL=sdk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrations as getDefaultNodeIntegrations, init as nodeInit } from '@sentry/node';\n\n/**\n * Initializes the Nitro SDK\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n const opts: NodeOptions = {\n ...options,\n };\n\n if (opts.defaultIntegrations === undefined) {\n opts.defaultIntegrations = getDefaultIntegrations(opts);\n }\n\n applySdkMetadata(opts, 'nitro', ['nitro', 'node']);\n\n const client = nodeInit(opts);\n\n return client;\n}\n\n/**\n * Get the default integrations for the Nitro SDK.\n *\n * @returns The default integrations for the Nitro SDK.\n */\nexport function getDefaultIntegrations(options: NodeOptions): Integration[] | undefined {\n return [...getDefaultNodeIntegrations(options)];\n}\n"],"names":["nodeInit","getDefaultNodeIntegrations"],"mappings":";;;AAQO,SAAS,IAAA,CAAK,OAAA,GAAmC,EAAC,EAA2B;AAClF,EAAA,MAAM,IAAA,GAAoB;AAAA,IACxB,GAAG;AAAA,GACL;AAEA,EAAA,IAAI,IAAA,CAAK,wBAAwB,MAAA,EAAW;AAC1C,IAAA,IAAA,CAAK,mBAAA,GAAsB,uBAAuB,IAAI,CAAA;AAAA,EACxD;AAEA,EAAA,gBAAA,CAAiB,IAAA,EAAM,OAAA,EAAS,CAAC,OAAA,EAAS,MAAM,CAAC,CAAA;AAEjD,EAAA,MAAM,MAAA,GAASA,OAAS,IAAI,CAAA;AAE5B,EAAA,OAAO,MAAA;AACT;AAOO,SAAS,uBAAuB,OAAA,EAAiD;AACtF,EAAA,OAAO,CAAC,GAAGC,wBAAA,CAA2B,OAAO,CAAC,CAAA;AAChD;;;;"}
1
+ {"version":3,"file":"sdk.js","names":["nodeInit","getDefaultNodeIntegrations"],"sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrations as getDefaultNodeIntegrations, init as nodeInit } from '@sentry/node';\n\n/**\n * Initializes the Nitro SDK\n */\nexport function init(options: NodeOptions | undefined = {}): NodeClient | undefined {\n const opts: NodeOptions = {\n ...options,\n };\n\n if (opts.defaultIntegrations === undefined) {\n opts.defaultIntegrations = getDefaultIntegrations(opts);\n }\n\n applySdkMetadata(opts, 'nitro', ['nitro', 'node']);\n\n const client = nodeInit(opts);\n\n return client;\n}\n\n/**\n * Get the default integrations for the Nitro SDK.\n *\n * @returns The default integrations for the Nitro SDK.\n */\nexport function getDefaultIntegrations(options: NodeOptions): Integration[] | undefined {\n return [...getDefaultNodeIntegrations(options)];\n}\n"],"mappings":";;;;;;AAQA,SAAgB,KAAK,UAAmC,CAAC,GAA2B;CAClF,MAAM,OAAoB,EACxB,GAAG,QACL;CAEA,IAAI,KAAK,wBAAwB,KAAA,GAC/B,KAAK,sBAAsB,uBAAuB,IAAI;CAGxD,iBAAiB,MAAM,SAAS,CAAC,SAAS,MAAM,CAAC;CAIjD,OAFeA,OAAS,IAEZ;AACd;;;;;;AAOA,SAAgB,uBAAuB,SAAiD;CACtF,OAAO,CAAC,GAAGC,yBAA2B,OAAO,CAAC;AAChD"}
@@ -1,111 +1,103 @@
1
- import { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';
2
-
1
+ import { createSentryBuildPluginManager } from "@sentry/bundler-plugins/core";
2
+ // src/sourceMaps.ts
3
+ /**
4
+ * Registers a `compiled` hook to upload source maps after the build completes.
5
+ */
3
6
  function setupSourceMaps(nitro, options, sentryEnabledSourcemaps) {
4
- if (shouldSkipSourcemapUpload(nitro, options)) {
5
- return;
6
- }
7
- nitro.hooks.hook("compiled", async (_nitro) => {
8
- await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);
9
- });
7
+ if (shouldSkipSourcemapUpload(nitro, options)) return;
8
+ nitro.hooks.hook("compiled", async (_nitro) => {
9
+ await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);
10
+ });
10
11
  }
12
+ /**
13
+ * Determines if sourcemap uploads should be skipped.
14
+ */
11
15
  function shouldSkipSourcemapUpload(nitro, options) {
12
- return !!(nitro.options.dev || nitro.options.preset === "nitro-prerender" || nitro.options.sourcemap === false || nitro.options.sourcemap === "inline" || options?.sourcemaps?.disable === true);
16
+ return !!(nitro.options.dev || nitro.options.preset === "nitro-prerender" || nitro.options.sourcemap === false || nitro.options.sourcemap === "inline" || options?.sourcemaps?.disable === true);
13
17
  }
18
+ /**
19
+ * Handles the actual source map upload after the build completes.
20
+ */
14
21
  async function handleSourceMapUpload(nitro, options, sentryEnabledSourcemaps) {
15
- const outputDir = nitro.options.output.serverDir;
16
- const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);
17
- const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {
18
- buildTool: "nitro",
19
- loggerPrefix: "[@sentry/nitro]"
20
- });
21
- await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
22
- await sentryBuildPluginManager.createRelease();
23
- await sentryBuildPluginManager.injectDebugIds([outputDir]);
24
- if (options?.sourcemaps?.disable !== "disable-upload") {
25
- await sentryBuildPluginManager.uploadSourcemaps([outputDir], {
26
- // We don't prepare the artifacts because we injected debug IDs manually before
27
- prepareArtifacts: false
28
- });
29
- await sentryBuildPluginManager.deleteArtifacts();
30
- }
22
+ const outputDir = nitro.options.output.serverDir;
23
+ const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);
24
+ const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {
25
+ buildTool: "nitro",
26
+ loggerPrefix: "[@sentry/nitro]"
27
+ });
28
+ await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
29
+ await sentryBuildPluginManager.createRelease();
30
+ await sentryBuildPluginManager.injectDebugIds([outputDir]);
31
+ if (options?.sourcemaps?.disable !== "disable-upload") {
32
+ await sentryBuildPluginManager.uploadSourcemaps([outputDir], { prepareArtifacts: false });
33
+ await sentryBuildPluginManager.deleteArtifacts();
34
+ }
31
35
  }
36
+ /**
37
+ * Normalizes the beginning of a path from e.g. ../../../ to ./
38
+ */
32
39
  function normalizePath(path) {
33
- return path.replace(/^(\.\.\/)+/, "./");
40
+ return path.replace(/^(\.\.\/)+/, "./");
34
41
  }
42
+ /**
43
+ * Removes a trailing slash from a path so glob patterns can be appended cleanly.
44
+ */
35
45
  function removeTrailingSlash(path) {
36
- return path.replace(/\/$/, "");
46
+ return path.replace(/\/$/, "");
37
47
  }
48
+ /**
49
+ * Builds the plugin options for `createSentryBuildPluginManager` from the Sentry Nitro options.
50
+ *
51
+ * Only exported for testing purposes.
52
+ */
38
53
  function getPluginOptions(options, sentryEnabledSourcemaps, outputDir) {
39
- const defaultFilesToDelete = sentryEnabledSourcemaps && outputDir ? [`${removeTrailingSlash(outputDir)}/**/*.map`] : void 0;
40
- if (options?.debug && defaultFilesToDelete && options?.sourcemaps?.filesToDeleteAfterUpload === void 0) {
41
- console.log(
42
- `[@sentry/nitro] Setting \`sourcemaps.filesToDeleteAfterUpload: ["${defaultFilesToDelete[0]}"]\` to delete generated source maps after they were uploaded to Sentry.`
43
- );
44
- }
45
- return {
46
- org: options?.org ?? process.env.SENTRY_ORG,
47
- project: options?.project ?? process.env.SENTRY_PROJECT,
48
- authToken: options?.authToken ?? process.env.SENTRY_AUTH_TOKEN,
49
- url: options?.sentryUrl ?? process.env.SENTRY_URL,
50
- headers: options?.headers,
51
- telemetry: options?.telemetry ?? true,
52
- debug: options?.debug ?? false,
53
- silent: options?.silent ?? false,
54
- errorHandler: options?.errorHandler,
55
- sourcemaps: {
56
- disable: options?.sourcemaps?.disable,
57
- assets: options?.sourcemaps?.assets,
58
- ignore: options?.sourcemaps?.ignore,
59
- filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,
60
- rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source) => normalizePath(source))
61
- },
62
- release: options?.release,
63
- bundleSizeOptimizations: options?.bundleSizeOptimizations,
64
- _metaOptions: {
65
- telemetry: {
66
- metaFramework: "nitro"
67
- }
68
- }
69
- };
54
+ const defaultFilesToDelete = sentryEnabledSourcemaps && outputDir ? [`${removeTrailingSlash(outputDir)}/**/*.map`] : void 0;
55
+ if (options?.debug && defaultFilesToDelete && options?.sourcemaps?.filesToDeleteAfterUpload === void 0) console.log(`[@sentry/nitro] Setting \`sourcemaps.filesToDeleteAfterUpload: ["${defaultFilesToDelete[0]}"]\` to delete generated source maps after they were uploaded to Sentry.`);
56
+ return {
57
+ org: options?.org ?? process.env.SENTRY_ORG,
58
+ project: options?.project ?? process.env.SENTRY_PROJECT,
59
+ authToken: options?.authToken ?? process.env.SENTRY_AUTH_TOKEN,
60
+ url: options?.sentryUrl ?? process.env.SENTRY_URL,
61
+ headers: options?.headers,
62
+ telemetry: options?.telemetry ?? true,
63
+ debug: options?.debug ?? false,
64
+ silent: options?.silent ?? false,
65
+ errorHandler: options?.errorHandler,
66
+ sourcemaps: {
67
+ disable: options?.sourcemaps?.disable,
68
+ assets: options?.sourcemaps?.assets,
69
+ ignore: options?.sourcemaps?.ignore,
70
+ filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,
71
+ rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source) => normalizePath(source))
72
+ },
73
+ release: options?.release,
74
+ bundleSizeOptimizations: options?.bundleSizeOptimizations,
75
+ _metaOptions: { telemetry: { metaFramework: "nitro" } }
76
+ };
70
77
  }
71
78
  function configureSourcemapSettings(config, moduleOptions) {
72
- const sourcemapUploadDisabled = moduleOptions?.sourcemaps?.disable === true;
73
- if (sourcemapUploadDisabled) {
74
- return { sentryEnabledSourcemaps: false };
75
- }
76
- const userSourcemap = config.sourcemap;
77
- if (userSourcemap === false) {
78
- console.warn(
79
- "[@sentry/nitro] You have explicitly disabled source maps (`sourcemap: false`). Sentry will not upload source maps, and errors will not be unminified. To let Sentry handle source maps, remove the `sourcemap` option from your Nitro config, or use `sourcemaps: { disable: true }` in your Sentry options to silence this warning."
80
- );
81
- return { sentryEnabledSourcemaps: false };
82
- }
83
- if (userSourcemap === "inline") {
84
- console.warn(
85
- '[@sentry/nitro] You have set `sourcemap: "inline"`. Inline source maps are embedded in the output bundle, so there are no `.map` files to upload. Sentry will not upload source maps. Set `sourcemap: "hidden"` (or leave it unset) to let Sentry upload source maps and un-minify errors.'
86
- );
87
- return { sentryEnabledSourcemaps: false };
88
- }
89
- let sentryEnabledSourcemaps = false;
90
- if (userSourcemap === true || userSourcemap === "hidden") {
91
- if (moduleOptions?.debug) {
92
- console.log(
93
- `[@sentry/nitro] Source maps are already enabled (\`sourcemap: ${JSON.stringify(userSourcemap)}\`). Sentry will upload them for error unminification.`
94
- );
95
- }
96
- } else {
97
- config.sourcemap = "hidden";
98
- sentryEnabledSourcemaps = true;
99
- if (moduleOptions?.debug) {
100
- console.log(
101
- "[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload."
102
- );
103
- }
104
- }
105
- config.experimental = config.experimental || {};
106
- config.experimental.sourcemapMinify = false;
107
- return { sentryEnabledSourcemaps };
79
+ if (moduleOptions?.sourcemaps?.disable === true) return { sentryEnabledSourcemaps: false };
80
+ const userSourcemap = config.sourcemap;
81
+ if (userSourcemap === false) {
82
+ console.warn("[@sentry/nitro] You have explicitly disabled source maps (`sourcemap: false`). Sentry will not upload source maps, and errors will not be unminified. To let Sentry handle source maps, remove the `sourcemap` option from your Nitro config, or use `sourcemaps: { disable: true }` in your Sentry options to silence this warning.");
83
+ return { sentryEnabledSourcemaps: false };
84
+ }
85
+ if (userSourcemap === "inline") {
86
+ console.warn("[@sentry/nitro] You have set `sourcemap: \"inline\"`. Inline source maps are embedded in the output bundle, so there are no `.map` files to upload. Sentry will not upload source maps. Set `sourcemap: \"hidden\"` (or leave it unset) to let Sentry upload source maps and un-minify errors.");
87
+ return { sentryEnabledSourcemaps: false };
88
+ }
89
+ let sentryEnabledSourcemaps = false;
90
+ if (userSourcemap === true || userSourcemap === "hidden") {
91
+ if (moduleOptions?.debug) console.log(`[@sentry/nitro] Source maps are already enabled (\`sourcemap: ${JSON.stringify(userSourcemap)}\`). Sentry will upload them for error unminification.`);
92
+ } else {
93
+ config.sourcemap = "hidden";
94
+ sentryEnabledSourcemaps = true;
95
+ if (moduleOptions?.debug) console.log("[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload.");
96
+ }
97
+ config.experimental = config.experimental || {};
98
+ config.experimental.sourcemapMinify = false;
99
+ return { sentryEnabledSourcemaps };
108
100
  }
109
-
110
101
  export { configureSourcemapSettings, getPluginOptions, setupSourceMaps };
111
- //# sourceMappingURL=sourceMaps.js.map
102
+
103
+ //# sourceMappingURL=sourceMaps.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sourceMaps.js","sources":["../../src/sourceMaps.ts"],"sourcesContent":["import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugins/core';\nimport { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';\nimport type { Nitro, NitroConfig } from 'nitro/types';\nimport type { SentryNitroOptions } from './config';\n\n/**\n * Registers a `compiled` hook to upload source maps after the build completes.\n */\nexport function setupSourceMaps(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): void {\n // The `compiled` hook fires on EVERY rebuild during `nitro dev` watch mode.\n // nitro.options.dev is reliably set by the time module setup runs.\n if (shouldSkipSourcemapUpload(nitro, options)) {\n return;\n }\n\n nitro.hooks.hook('compiled', async (_nitro: Nitro) => {\n await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);\n });\n}\n\n/**\n * Determines if sourcemap uploads should be skipped.\n */\nfunction shouldSkipSourcemapUpload(nitro: Nitro, options?: SentryNitroOptions): boolean {\n return !!(\n nitro.options.dev ||\n nitro.options.preset === 'nitro-prerender' ||\n nitro.options.sourcemap === false ||\n (nitro.options.sourcemap as unknown) === 'inline' ||\n options?.sourcemaps?.disable === true\n );\n}\n\n/**\n * Handles the actual source map upload after the build completes.\n */\nasync function handleSourceMapUpload(\n nitro: Nitro,\n options?: SentryNitroOptions,\n sentryEnabledSourcemaps?: boolean,\n): Promise<void> {\n const outputDir = nitro.options.output.serverDir;\n const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);\n\n const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {\n buildTool: 'nitro',\n loggerPrefix: '[@sentry/nitro]',\n });\n\n await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();\n await sentryBuildPluginManager.createRelease();\n\n await sentryBuildPluginManager.injectDebugIds([outputDir]);\n\n if (options?.sourcemaps?.disable !== 'disable-upload') {\n await sentryBuildPluginManager.uploadSourcemaps([outputDir], {\n // We don't prepare the artifacts because we injected debug IDs manually before\n prepareArtifacts: false,\n });\n await sentryBuildPluginManager.deleteArtifacts();\n }\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Removes a trailing slash from a path so glob patterns can be appended cleanly.\n */\nfunction removeTrailingSlash(path: string): string {\n return path.replace(/\\/$/, '');\n}\n\n/**\n * Builds the plugin options for `createSentryBuildPluginManager` from the Sentry Nitro options.\n *\n * Only exported for testing purposes.\n */\n// oxlint-disable-next-line complexity\nexport function getPluginOptions(\n options?: SentryNitroOptions,\n sentryEnabledSourcemaps?: boolean,\n outputDir?: string,\n): BundlerPluginOptions {\n const defaultFilesToDelete =\n sentryEnabledSourcemaps && outputDir ? [`${removeTrailingSlash(outputDir)}/**/*.map`] : undefined;\n\n if (options?.debug && defaultFilesToDelete && options?.sourcemaps?.filesToDeleteAfterUpload === undefined) {\n // eslint-disable-next-line no-console\n console.log(\n `[@sentry/nitro] Setting \\`sourcemaps.filesToDeleteAfterUpload: [\"${defaultFilesToDelete[0]}\"]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return {\n org: options?.org ?? process.env.SENTRY_ORG,\n project: options?.project ?? process.env.SENTRY_PROJECT,\n authToken: options?.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n url: options?.sentryUrl ?? process.env.SENTRY_URL,\n headers: options?.headers,\n telemetry: options?.telemetry ?? true,\n debug: options?.debug ?? false,\n silent: options?.silent ?? false,\n errorHandler: options?.errorHandler,\n sourcemaps: {\n disable: options?.sourcemaps?.disable,\n assets: options?.sourcemaps?.assets,\n ignore: options?.sourcemaps?.ignore,\n filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,\n rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source: string) => normalizePath(source)),\n },\n release: options?.release,\n bundleSizeOptimizations: options?.bundleSizeOptimizations,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nitro',\n },\n },\n };\n}\n\n/* Source map configuration rules:\n 1. User explicitly disabled source maps (sourcemap: false)\n - Keep their setting, emit a warning that errors won't be unminified in Sentry\n - We will not upload anything\n 2. User enabled source map generation (true)\n - Keep their setting (don't modify besides uploading)\n 3. User did not set source maps (undefined)\n - We enable source maps for Sentry\n - Configure `filesToDeleteAfterUpload` to clean up .map files after upload\n*/\nexport function configureSourcemapSettings(\n config: NitroConfig,\n moduleOptions?: SentryNitroOptions,\n): { sentryEnabledSourcemaps: boolean } {\n const sourcemapUploadDisabled = moduleOptions?.sourcemaps?.disable === true;\n if (sourcemapUploadDisabled) {\n return { sentryEnabledSourcemaps: false };\n }\n\n // Nitro types `sourcemap` as `boolean`, but it forwards the value to Vite which also accepts `'hidden'` and `'inline'`.\n const userSourcemap = (config as { sourcemap?: boolean | 'hidden' | 'inline' }).sourcemap;\n\n if (userSourcemap === false) {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/nitro] You have explicitly disabled source maps (`sourcemap: false`). Sentry will not upload source maps, and errors will not be unminified. To let Sentry handle source maps, remove the `sourcemap` option from your Nitro config, or use `sourcemaps: { disable: true }` in your Sentry options to silence this warning.',\n );\n return { sentryEnabledSourcemaps: false };\n }\n\n if (userSourcemap === 'inline') {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/nitro] You have set `sourcemap: \"inline\"`. Inline source maps are embedded in the output bundle, so there are no `.map` files to upload. Sentry will not upload source maps. Set `sourcemap: \"hidden\"` (or leave it unset) to let Sentry upload source maps and un-minify errors.',\n );\n return { sentryEnabledSourcemaps: false };\n }\n\n let sentryEnabledSourcemaps = false;\n if (userSourcemap === true || userSourcemap === 'hidden') {\n if (moduleOptions?.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[@sentry/nitro] Source maps are already enabled (\\`sourcemap: ${JSON.stringify(userSourcemap)}\\`). Sentry will upload them for error unminification.`,\n );\n }\n } else {\n // User did not explicitly set sourcemap, enable hidden source maps for Sentry.\n // `'hidden'` emits .map files without adding a `//# sourceMappingURL=` comment to the output, avoiding public exposure.\n (config as { sourcemap?: unknown }).sourcemap = 'hidden';\n sentryEnabledSourcemaps = true;\n if (moduleOptions?.debug) {\n // eslint-disable-next-line no-console\n console.log(\n '[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload.',\n );\n }\n }\n\n // Nitro v3 has a `sourcemapMinify` plugin that destructively deletes `sourcesContent`,\n // `x_google_ignoreList`, and clears `mappings` for any chunk containing `node_modules`.\n // This makes sourcemaps unusable for Sentry.\n config.experimental = config.experimental || {};\n config.experimental.sourcemapMinify = false;\n\n return { sentryEnabledSourcemaps };\n}\n"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"sourceMaps.js","names":[],"sources":["../../src/sourceMaps.ts"],"sourcesContent":["import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugins/core';\nimport { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';\nimport type { Nitro, NitroConfig } from 'nitro/types';\nimport type { SentryNitroOptions } from './config';\n\n/**\n * Registers a `compiled` hook to upload source maps after the build completes.\n */\nexport function setupSourceMaps(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): void {\n // The `compiled` hook fires on EVERY rebuild during `nitro dev` watch mode.\n // nitro.options.dev is reliably set by the time module setup runs.\n if (shouldSkipSourcemapUpload(nitro, options)) {\n return;\n }\n\n nitro.hooks.hook('compiled', async (_nitro: Nitro) => {\n await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);\n });\n}\n\n/**\n * Determines if sourcemap uploads should be skipped.\n */\nfunction shouldSkipSourcemapUpload(nitro: Nitro, options?: SentryNitroOptions): boolean {\n return !!(\n nitro.options.dev ||\n nitro.options.preset === 'nitro-prerender' ||\n nitro.options.sourcemap === false ||\n (nitro.options.sourcemap as unknown) === 'inline' ||\n options?.sourcemaps?.disable === true\n );\n}\n\n/**\n * Handles the actual source map upload after the build completes.\n */\nasync function handleSourceMapUpload(\n nitro: Nitro,\n options?: SentryNitroOptions,\n sentryEnabledSourcemaps?: boolean,\n): Promise<void> {\n const outputDir = nitro.options.output.serverDir;\n const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);\n\n const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {\n buildTool: 'nitro',\n loggerPrefix: '[@sentry/nitro]',\n });\n\n await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();\n await sentryBuildPluginManager.createRelease();\n\n await sentryBuildPluginManager.injectDebugIds([outputDir]);\n\n if (options?.sourcemaps?.disable !== 'disable-upload') {\n await sentryBuildPluginManager.uploadSourcemaps([outputDir], {\n // We don't prepare the artifacts because we injected debug IDs manually before\n prepareArtifacts: false,\n });\n await sentryBuildPluginManager.deleteArtifacts();\n }\n}\n\n/**\n * Normalizes the beginning of a path from e.g. ../../../ to ./\n */\nfunction normalizePath(path: string): string {\n return path.replace(/^(\\.\\.\\/)+/, './');\n}\n\n/**\n * Removes a trailing slash from a path so glob patterns can be appended cleanly.\n */\nfunction removeTrailingSlash(path: string): string {\n return path.replace(/\\/$/, '');\n}\n\n/**\n * Builds the plugin options for `createSentryBuildPluginManager` from the Sentry Nitro options.\n *\n * Only exported for testing purposes.\n */\n// oxlint-disable-next-line complexity\nexport function getPluginOptions(\n options?: SentryNitroOptions,\n sentryEnabledSourcemaps?: boolean,\n outputDir?: string,\n): BundlerPluginOptions {\n const defaultFilesToDelete =\n sentryEnabledSourcemaps && outputDir ? [`${removeTrailingSlash(outputDir)}/**/*.map`] : undefined;\n\n if (options?.debug && defaultFilesToDelete && options?.sourcemaps?.filesToDeleteAfterUpload === undefined) {\n // eslint-disable-next-line no-console\n console.log(\n `[@sentry/nitro] Setting \\`sourcemaps.filesToDeleteAfterUpload: [\"${defaultFilesToDelete[0]}\"]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return {\n org: options?.org ?? process.env.SENTRY_ORG,\n project: options?.project ?? process.env.SENTRY_PROJECT,\n authToken: options?.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n url: options?.sentryUrl ?? process.env.SENTRY_URL,\n headers: options?.headers,\n telemetry: options?.telemetry ?? true,\n debug: options?.debug ?? false,\n silent: options?.silent ?? false,\n errorHandler: options?.errorHandler,\n sourcemaps: {\n disable: options?.sourcemaps?.disable,\n assets: options?.sourcemaps?.assets,\n ignore: options?.sourcemaps?.ignore,\n filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,\n rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source: string) => normalizePath(source)),\n },\n release: options?.release,\n bundleSizeOptimizations: options?.bundleSizeOptimizations,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nitro',\n },\n },\n };\n}\n\n/* Source map configuration rules:\n 1. User explicitly disabled source maps (sourcemap: false)\n - Keep their setting, emit a warning that errors won't be unminified in Sentry\n - We will not upload anything\n 2. User enabled source map generation (true)\n - Keep their setting (don't modify besides uploading)\n 3. User did not set source maps (undefined)\n - We enable source maps for Sentry\n - Configure `filesToDeleteAfterUpload` to clean up .map files after upload\n*/\nexport function configureSourcemapSettings(\n config: NitroConfig,\n moduleOptions?: SentryNitroOptions,\n): { sentryEnabledSourcemaps: boolean } {\n const sourcemapUploadDisabled = moduleOptions?.sourcemaps?.disable === true;\n if (sourcemapUploadDisabled) {\n return { sentryEnabledSourcemaps: false };\n }\n\n // Nitro types `sourcemap` as `boolean`, but it forwards the value to Vite which also accepts `'hidden'` and `'inline'`.\n const userSourcemap = (config as { sourcemap?: boolean | 'hidden' | 'inline' }).sourcemap;\n\n if (userSourcemap === false) {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/nitro] You have explicitly disabled source maps (`sourcemap: false`). Sentry will not upload source maps, and errors will not be unminified. To let Sentry handle source maps, remove the `sourcemap` option from your Nitro config, or use `sourcemaps: { disable: true }` in your Sentry options to silence this warning.',\n );\n return { sentryEnabledSourcemaps: false };\n }\n\n if (userSourcemap === 'inline') {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/nitro] You have set `sourcemap: \"inline\"`. Inline source maps are embedded in the output bundle, so there are no `.map` files to upload. Sentry will not upload source maps. Set `sourcemap: \"hidden\"` (or leave it unset) to let Sentry upload source maps and un-minify errors.',\n );\n return { sentryEnabledSourcemaps: false };\n }\n\n let sentryEnabledSourcemaps = false;\n if (userSourcemap === true || userSourcemap === 'hidden') {\n if (moduleOptions?.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[@sentry/nitro] Source maps are already enabled (\\`sourcemap: ${JSON.stringify(userSourcemap)}\\`). Sentry will upload them for error unminification.`,\n );\n }\n } else {\n // User did not explicitly set sourcemap, enable hidden source maps for Sentry.\n // `'hidden'` emits .map files without adding a `//# sourceMappingURL=` comment to the output, avoiding public exposure.\n (config as { sourcemap?: unknown }).sourcemap = 'hidden';\n sentryEnabledSourcemaps = true;\n if (moduleOptions?.debug) {\n // eslint-disable-next-line no-console\n console.log(\n '[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload.',\n );\n }\n }\n\n // Nitro v3 has a `sourcemapMinify` plugin that destructively deletes `sourcesContent`,\n // `x_google_ignoreList`, and clears `mappings` for any chunk containing `node_modules`.\n // This makes sourcemaps unusable for Sentry.\n config.experimental = config.experimental || {};\n config.experimental.sourcemapMinify = false;\n\n return { sentryEnabledSourcemaps };\n}\n"],"mappings":";;;;;AAQA,SAAgB,gBAAgB,OAAc,SAA8B,yBAAyC;CAGnH,IAAI,0BAA0B,OAAO,OAAO,GAC1C;CAGF,MAAM,MAAM,KAAK,YAAY,OAAO,WAAkB;EACpD,MAAM,sBAAsB,QAAQ,SAAS,uBAAuB;CACtE,CAAC;AACH;;;;AAKA,SAAS,0BAA0B,OAAc,SAAuC;CACtF,OAAO,CAAC,EACN,MAAM,QAAQ,OACd,MAAM,QAAQ,WAAW,qBACzB,MAAM,QAAQ,cAAc,SAC3B,MAAM,QAAQ,cAA0B,YACzC,SAAS,YAAY,YAAY;AAErC;;;;AAKA,eAAe,sBACb,OACA,SACA,yBACe;CACf,MAAM,YAAY,MAAM,QAAQ,OAAO;CACvC,MAAM,gBAAgB,iBAAiB,SAAS,yBAAyB,SAAS;CAElF,MAAM,2BAA2B,+BAA+B,eAAe;EAC7E,WAAW;EACX,cAAc;CAChB,CAAC;CAED,MAAM,yBAAyB,UAAU,iCAAiC;CAC1E,MAAM,yBAAyB,cAAc;CAE7C,MAAM,yBAAyB,eAAe,CAAC,SAAS,CAAC;CAEzD,IAAI,SAAS,YAAY,YAAY,kBAAkB;EACrD,MAAM,yBAAyB,iBAAiB,CAAC,SAAS,GAAG,EAE3D,kBAAkB,MACpB,CAAC;EACD,MAAM,yBAAyB,gBAAgB;CACjD;AACF;;;;AAKA,SAAS,cAAc,MAAsB;CAC3C,OAAO,KAAK,QAAQ,cAAc,IAAI;AACxC;;;;AAKA,SAAS,oBAAoB,MAAsB;CACjD,OAAO,KAAK,QAAQ,OAAO,EAAE;AAC/B;;;;;;AAQA,SAAgB,iBACd,SACA,yBACA,WACsB;CACtB,MAAM,uBACJ,2BAA2B,YAAY,CAAC,GAAG,oBAAoB,SAAS,EAAE,UAAU,IAAI,KAAA;CAE1F,IAAI,SAAS,SAAS,wBAAwB,SAAS,YAAY,6BAA6B,KAAA,GAE9F,QAAQ,IACN,oEAAoE,qBAAqB,GAAG,yEAC9F;CAGF,OAAO;EACL,KAAK,SAAS,OAAO,QAAQ,IAAI;EACjC,SAAS,SAAS,WAAW,QAAQ,IAAI;EACzC,WAAW,SAAS,aAAa,QAAQ,IAAI;EAC7C,KAAK,SAAS,aAAa,QAAQ,IAAI;EACvC,SAAS,SAAS;EAClB,WAAW,SAAS,aAAa;EACjC,OAAO,SAAS,SAAS;EACzB,QAAQ,SAAS,UAAU;EAC3B,cAAc,SAAS;EACvB,YAAY;GACV,SAAS,SAAS,YAAY;GAC9B,QAAQ,SAAS,YAAY;GAC7B,QAAQ,SAAS,YAAY;GAC7B,0BAA0B,SAAS,YAAY,4BAA4B;GAC3E,gBAAgB,SAAS,YAAY,oBAAoB,WAAmB,cAAc,MAAM;EAClG;EACA,SAAS,SAAS;EAClB,yBAAyB,SAAS;EAClC,cAAc,EACZ,WAAW,EACT,eAAe,QACjB,EACF;CACF;AACF;AAYA,SAAgB,2BACd,QACA,eACsC;CAEtC,IADgC,eAAe,YAAY,YAAY,MAErE,OAAO,EAAE,yBAAyB,MAAM;CAI1C,MAAM,gBAAiB,OAAyD;CAEhF,IAAI,kBAAkB,OAAO;EAE3B,QAAQ,KACN,sUACF;EACA,OAAO,EAAE,yBAAyB,MAAM;CAC1C;CAEA,IAAI,kBAAkB,UAAU;EAE9B,QAAQ,KACN,gSACF;EACA,OAAO,EAAE,yBAAyB,MAAM;CAC1C;CAEA,IAAI,0BAA0B;CAC9B,IAAI,kBAAkB,QAAQ,kBAAkB,UAC1C;MAAA,eAAe,OAEjB,QAAQ,IACN,iEAAiE,KAAK,UAAU,aAAa,EAAE,uDACjG;CAAA,OAEG;EAGJ,OAAmC,YAAY;EAChD,0BAA0B;EAC1B,IAAI,eAAe,OAEjB,QAAQ,IACN,iHACF;CAEJ;CAKA,OAAO,eAAe,OAAO,gBAAgB,CAAC;CAC9C,OAAO,aAAa,kBAAkB;CAEtC,OAAO,EAAE,wBAAwB;AACnC"}
@@ -1,7 +1,11 @@
1
+ // src/utils/plugin.ts
2
+ /**
3
+ * Adds a Nitro plugin
4
+ */
1
5
  function addPlugin(nitro, plugin) {
2
- nitro.options.plugins = nitro.options.plugins || [];
3
- nitro.options.plugins.push(plugin);
6
+ nitro.options.plugins = nitro.options.plugins || [];
7
+ nitro.options.plugins.push(plugin);
4
8
  }
5
-
6
9
  export { addPlugin };
7
- //# sourceMappingURL=plugin.js.map
10
+
11
+ //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["../../../src/utils/plugin.ts"],"sourcesContent":["import type { Nitro } from 'nitro/types';\n\n/**\n * Adds a Nitro plugin\n */\nexport function addPlugin(nitro: Nitro, plugin: string): void {\n nitro.options.plugins = nitro.options.plugins || [];\n nitro.options.plugins.push(plugin);\n}\n"],"names":[],"mappings":"AAKO,SAAS,SAAA,CAAU,OAAc,MAAA,EAAsB;AAC5D,EAAA,KAAA,CAAM,OAAA,CAAQ,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,WAAW,EAAC;AAClD,EAAA,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAA;AACnC;;;;"}
1
+ {"version":3,"file":"plugin.js","names":[],"sources":["../../../src/utils/plugin.ts"],"sourcesContent":["import type { Nitro } from 'nitro/types';\n\n/**\n * Adds a Nitro plugin\n */\nexport function addPlugin(nitro: Nitro, plugin: string): void {\n nitro.options.plugins = nitro.options.plugins || [];\n nitro.options.plugins.push(plugin);\n}\n"],"mappings":";;;;AAKA,SAAgB,UAAU,OAAc,QAAsB;CAC5D,MAAM,QAAQ,UAAU,MAAM,QAAQ,WAAW,CAAC;CAClD,MAAM,QAAQ,QAAQ,KAAK,MAAM;AACnC"}
@@ -1,18 +1,19 @@
1
- import { dirname, resolve } from 'node:path';
2
- import { fileURLToPath } from 'node:url';
3
-
1
+ import { dirname, resolve } from "node:path";
2
+ import { fileURLToPath } from "node:url";
3
+ // src/utils/resolver.ts
4
+ /**
5
+ * Creates a resolver for the given base path.
6
+ * @example
7
+ * ```ts
8
+ * const resolver = createResolver(import.meta.url);
9
+ * resolver.resolve('foo/bar.js');
10
+ * ```
11
+ */
4
12
  function createResolver(base) {
5
- let resolvedBase = base;
6
- if (base.startsWith("file://")) {
7
- resolvedBase = dirname(fileURLToPath(base));
8
- }
9
- return {
10
- // Nitro writes plugin paths verbatim into a generated `import "…"` statement, where the
11
- // backslashes of a Windows path read as escape sequences (`C:\Users` becomes `C:Users`).
12
- // Forward slashes resolve on every platform, so normalize to them.
13
- resolve: (...path) => resolve(resolvedBase, ...path).replace(/\\/g, "/")
14
- };
13
+ let resolvedBase = base;
14
+ if (base.startsWith("file://")) resolvedBase = dirname(fileURLToPath(base));
15
+ return { resolve: (...path) => resolve(resolvedBase, ...path).replace(/\\/g, "/") };
15
16
  }
16
-
17
17
  export { createResolver };
18
- //# sourceMappingURL=resolver.js.map
18
+
19
+ //# sourceMappingURL=resolver.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolver.js","sources":["../../../src/utils/resolver.ts"],"sourcesContent":["import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface Resolver {\n resolve(...path: string[]): string;\n}\n\n/**\n * Creates a resolver for the given base path.\n * @example\n * ```ts\n * const resolver = createResolver(import.meta.url);\n * resolver.resolve('foo/bar.js');\n * ```\n */\nexport function createResolver(base: string): Resolver {\n let resolvedBase = base;\n if (base.startsWith('file://')) {\n resolvedBase = dirname(fileURLToPath(base));\n }\n\n return {\n // Nitro writes plugin paths verbatim into a generated `import \"…\"` statement, where the\n // backslashes of a Windows path read as escape sequences (`C:\\Users` becomes `C:Users`).\n // Forward slashes resolve on every platform, so normalize to them.\n resolve: (...path) => resolve(resolvedBase, ...path).replace(/\\\\/g, '/'),\n };\n}\n"],"names":[],"mappings":";;;AAeO,SAAS,eAAe,IAAA,EAAwB;AACrD,EAAA,IAAI,YAAA,GAAe,IAAA;AACnB,EAAA,IAAI,IAAA,CAAK,UAAA,CAAW,SAAS,CAAA,EAAG;AAC9B,IAAA,YAAA,GAAe,OAAA,CAAQ,aAAA,CAAc,IAAI,CAAC,CAAA;AAAA,EAC5C;AAEA,EAAA,OAAO;AAAA;AAAA;AAAA;AAAA,IAIL,OAAA,EAAS,CAAA,GAAI,IAAA,KAAS,OAAA,CAAQ,YAAA,EAAc,GAAG,IAAI,CAAA,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG;AAAA,GACzE;AACF;;;;"}
1
+ {"version":3,"file":"resolver.js","names":[],"sources":["../../../src/utils/resolver.ts"],"sourcesContent":["import { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nexport interface Resolver {\n resolve(...path: string[]): string;\n}\n\n/**\n * Creates a resolver for the given base path.\n * @example\n * ```ts\n * const resolver = createResolver(import.meta.url);\n * resolver.resolve('foo/bar.js');\n * ```\n */\nexport function createResolver(base: string): Resolver {\n let resolvedBase = base;\n if (base.startsWith('file://')) {\n resolvedBase = dirname(fileURLToPath(base));\n }\n\n return {\n // Nitro writes plugin paths verbatim into a generated `import \"…\"` statement, where the\n // backslashes of a Windows path read as escape sequences (`C:\\Users` becomes `C:Users`).\n // Forward slashes resolve on every platform, so normalize to them.\n resolve: (...path) => resolve(resolvedBase, ...path).replace(/\\\\/g, '/'),\n };\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,eAAe,MAAwB;CACrD,IAAI,eAAe;CACnB,IAAI,KAAK,WAAW,SAAS,GAC3B,eAAe,QAAQ,cAAc,IAAI,CAAC;CAG5C,OAAO,EAIL,UAAU,GAAG,SAAS,QAAQ,cAAc,GAAG,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG,EACzE;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/nitro",
3
- "version": "11.12.0",
3
+ "version": "11.13.0",
4
4
  "description": "Official Sentry SDK for Nitro",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,15 +38,15 @@
38
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"
39
39
  },
40
40
  "dependencies": {
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"
41
+ "@sentry/bundler-plugins": "11.13.0",
42
+ "@sentry/conventions": "^0.33.0",
43
+ "@sentry/core": "11.13.0",
44
+ "@sentry/node": "11.13.0",
45
+ "@sentry/server-runtime-injection": "11.13.0",
46
+ "@sentry/server-utils": "11.13.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@sentry-internal/rollup-utils": "11.12.0",
49
+ "@sentry-internal/rollup-utils": "11.13.0",
50
50
  "h3": "^2.0.1-rc.20",
51
51
  "nitro": "^3.0.260415-beta",
52
52
  "srvx": "^0.11.22"
@@ -67,23 +67,19 @@
67
67
  }
68
68
  },
69
69
  "scripts": {
70
- "build": "run-p build:transpile build:types",
70
+ "build": "pnpm run \"/^build:(transpile|types)$/\"",
71
71
  "build:dev": "pnpm run build",
72
- "build:transpile": "rollup -c rollup.npm.config.mjs",
73
- "build:types": "run-s build:types:core",
72
+ "build:transpile": "rolldown -c rollup.npm.config.mjs",
73
+ "build:types": "pnpm run build:types:core",
74
74
  "build:types:core": "tsc -p tsconfig.types.json",
75
- "build:watch": "run-p build:transpile:watch build:types:watch",
76
- "build:dev:watch": "pnpm run build:watch",
77
- "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
78
- "build:types:watch": "tsc -p tsconfig.types.json --watch",
79
75
  "build:tarball": "pnpm pack",
80
76
  "clean": "node ../../scripts/rm.mjs build coverage sentry-nitro-*.tgz",
81
77
  "lint": "oxlint . --type-aware",
82
78
  "lint:types": "oxlint src --type-aware --type-check",
83
79
  "lint:fix": "oxlint . --fix --type-aware",
84
- "lint:es-compatibility": "es-check es2022 ./build/esm/*.js --module",
80
+ "lint:es-compatibility": "node ../../scripts/es-check.mjs es2022",
85
81
  "test": "vitest run",
86
82
  "test:watch": "vitest --watch",
87
- "yalc:publish": "yalc publish --push --sig"
83
+ "yalc:publish": "pnpm dlx yalc publish --push --sig"
88
84
  }
89
85
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}