@sentry/nitro 11.10.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.
- package/build/esm/module.js +3 -2
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/runtime/hooks/captureErrorHook.js +4 -1
- package/build/esm/runtime/hooks/captureErrorHook.js.map +1 -1
- package/build/esm/runtime/plugins/server.js +6 -4
- package/build/esm/runtime/plugins/server.js.map +1 -1
- package/build/esm/runtime/utils/instrumentTasks.js +35 -0
- package/build/esm/runtime/utils/instrumentTasks.js.map +1 -0
- package/build/types/module.d.ts.map +1 -1
- package/build/types/runtime/hooks/captureErrorHook.d.ts.map +1 -1
- package/build/types/runtime/utils/instrumentTasks.d.ts +12 -0
- package/build/types/runtime/utils/instrumentTasks.d.ts.map +1 -0
- package/package.json +31 -29
package/build/esm/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
|
|
@@ -9,7 +9,8 @@ function createNitroModule(sentryOptions, sentryEnabledSourcemaps) {
|
|
|
9
9
|
instrumentServer(nitro);
|
|
10
10
|
setupSourceMaps(nitro, sentryOptions, sentryEnabledSourcemaps);
|
|
11
11
|
if (nitro.options.dev) {
|
|
12
|
-
|
|
12
|
+
const tunnelBasePath = nitro.options.runtimeConfig.sentryTunnelBasePath;
|
|
13
|
+
_INTERNAL_setTunnelDefaults({ basePath: tunnelBasePath || nitro.options.baseURL });
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
};
|
package/build/esm/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../../src/module.ts"],"sourcesContent":["import {
|
|
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;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.
|
|
1
|
+
{"type":"module","version":"11.12.0","sideEffects":false}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getClient, captureException, parseUrl } from '@sentry/core';
|
|
1
|
+
import { getClient, isAlreadyCaptured, captureException, parseUrl } from '@sentry/core';
|
|
2
2
|
import { flushIfServerless } from '@sentry/core/server';
|
|
3
3
|
import { HTTPError } from 'nitro/h3';
|
|
4
4
|
|
|
@@ -25,6 +25,9 @@ async function captureErrorHook(error, errorContext) {
|
|
|
25
25
|
if (HTTPError.isError(error) && error.status >= 300 && error.status < 500) {
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
|
+
if (HTTPError.isError(error) && isAlreadyCaptured(error.cause)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
28
31
|
const structuredContext = extractErrorContext(errorContext);
|
|
29
32
|
captureException(error, {
|
|
30
33
|
captureContext: { contexts: { nitro: structuredContext } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureErrorHook.js","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"sourcesContent":["import { captureException, getClient, 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 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;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","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,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _INTERNAL_setTunnelDefaults } from '@sentry/core/server';
|
|
2
2
|
import { definePlugin } from 'nitro';
|
|
3
3
|
import { useRuntimeConfig } from 'nitro/runtime-config';
|
|
4
|
+
import { tasks } from '#nitro/virtual/tasks';
|
|
4
5
|
import { captureErrorHook } from '../hooks/captureErrorHook.js';
|
|
6
|
+
import { instrumentTasks } from '../utils/instrumentTasks.js';
|
|
5
7
|
|
|
6
8
|
const server = definePlugin((nitroApp) => {
|
|
7
9
|
nitroApp.hooks.hook("error", captureErrorHook);
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
instrumentTasks(tasks);
|
|
11
|
+
const runtimeConfig = useRuntimeConfig();
|
|
12
|
+
_INTERNAL_setTunnelDefaults({ basePath: runtimeConfig.sentryTunnelBasePath || runtimeConfig.app?.baseURL });
|
|
11
13
|
});
|
|
12
14
|
|
|
13
15
|
export { server as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":["../../../../src/runtime/plugins/server.ts"],"sourcesContent":["import {
|
|
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;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { captureException } from '@sentry/core';
|
|
2
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
3
|
+
|
|
4
|
+
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
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { instrumentTasks };
|
|
35
|
+
//# sourceMappingURL=instrumentTasks.js.map
|
|
@@ -0,0 +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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,EAAE,OAAO,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,CAAC,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,EAAE,OAAO,GAAG,WAAW,CAgBpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureErrorHook.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAyBxD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"captureErrorHook.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAyBxD;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BtG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Task } from 'nitro/types';
|
|
2
|
+
type TaskRegistry = Record<string, {
|
|
3
|
+
resolve?: () => Promise<Task>;
|
|
4
|
+
}>;
|
|
5
|
+
/**
|
|
6
|
+
* Wraps the `run` function of every registered Nitro task to capture errors it throws.
|
|
7
|
+
*
|
|
8
|
+
* Nitro's scheduler catches task errors and only logs them, so they never reach the `error` hook.
|
|
9
|
+
*/
|
|
10
|
+
export declare function instrumentTasks(tasks: TaskRegistry): void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=instrumentTasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentTasks.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/instrumentTasks.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,CA+BzD"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/nitro",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.12.0",
|
|
4
4
|
"description": "Official Sentry SDK for Nitro",
|
|
5
|
-
"repository":
|
|
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.
|
|
39
|
-
"@sentry/conventions": "^0.
|
|
40
|
-
"@sentry/core": "11.
|
|
41
|
-
"@sentry/node": "11.
|
|
42
|
-
"@sentry/server-runtime-injection": "11.
|
|
43
|
-
"@sentry/server-utils": "11.
|
|
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.
|
|
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
|
-
|
|
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": "
|
|
63
|
-
"clean": "
|
|
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
|
+
}
|