@sentry/nitro 10.51.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/LICENSE +21 -0
- package/README.md +129 -0
- package/build/esm/config.js +32 -0
- package/build/esm/config.js.map +1 -0
- package/build/esm/index.js +4 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/instruments/instrumentServer.js +14 -0
- package/build/esm/instruments/instrumentServer.js.map +1 -0
- package/build/esm/module.js +18 -0
- package/build/esm/module.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/runtime/hooks/captureErrorHook.js +69 -0
- package/build/esm/runtime/hooks/captureErrorHook.js.map +1 -0
- package/build/esm/runtime/hooks/captureTracingEvents.js +264 -0
- package/build/esm/runtime/hooks/captureTracingEvents.js.map +1 -0
- package/build/esm/runtime/hooks/setServerTimingHeaders.js +29 -0
- package/build/esm/runtime/hooks/setServerTimingHeaders.js.map +1 -0
- package/build/esm/runtime/plugins/server.js +12 -0
- package/build/esm/runtime/plugins/server.js.map +1 -0
- package/build/esm/sdk.js +33 -0
- package/build/esm/sdk.js.map +1 -0
- package/build/esm/sourceMaps.js +192 -0
- package/build/esm/sourceMaps.js.map +1 -0
- package/build/esm/utils/plugin.js +10 -0
- package/build/esm/utils/plugin.js.map +1 -0
- package/build/esm/utils/resolver.js +24 -0
- package/build/esm/utils/resolver.js.map +1 -0
- package/build/types/common/debug-build.d.ts +7 -0
- package/build/types/common/debug-build.d.ts.map +1 -0
- package/build/types/config.d.ts +12 -0
- package/build/types/config.d.ts.map +1 -0
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -0
- package/build/types/instruments/instrumentServer.d.ts +7 -0
- package/build/types/instruments/instrumentServer.d.ts.map +1 -0
- package/build/types/module.d.ts +7 -0
- package/build/types/module.d.ts.map +1 -0
- package/build/types/runtime/hooks/captureErrorHook.d.ts +6 -0
- package/build/types/runtime/hooks/captureErrorHook.d.ts.map +1 -0
- package/build/types/runtime/hooks/captureTracingEvents.d.ts +5 -0
- package/build/types/runtime/hooks/captureTracingEvents.d.ts.map +1 -0
- package/build/types/runtime/hooks/setServerTimingHeaders.d.ts +7 -0
- package/build/types/runtime/hooks/setServerTimingHeaders.d.ts.map +1 -0
- package/build/types/runtime/plugins/server.d.ts +3 -0
- package/build/types/runtime/plugins/server.d.ts.map +1 -0
- package/build/types/sdk.d.ts +13 -0
- package/build/types/sdk.d.ts.map +1 -0
- package/build/types/sourceMaps.d.ts +17 -0
- package/build/types/sourceMaps.d.ts.map +1 -0
- package/build/types/utils/plugin.d.ts +6 -0
- package/build/types/utils/plugin.d.ts.map +1 -0
- package/build/types/utils/resolver.d.ts +13 -0
- package/build/types/utils/resolver.d.ts.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { definePlugin } from 'nitro';
|
|
2
|
+
import { captureErrorHook } from '../hooks/captureErrorHook.js';
|
|
3
|
+
import { captureTracingEvents } from '../hooks/captureTracingEvents.js';
|
|
4
|
+
|
|
5
|
+
const server = definePlugin(nitroApp => {
|
|
6
|
+
nitroApp.hooks.hook('error', captureErrorHook);
|
|
7
|
+
|
|
8
|
+
captureTracingEvents();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export { server as default };
|
|
12
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sources":["../../../../src/runtime/plugins/server.ts"],"sourcesContent":["import { definePlugin } from 'nitro';\nimport { captureErrorHook } from '../hooks/captureErrorHook';\nimport { captureTracingEvents } from '../hooks/captureTracingEvents';\n\nexport default definePlugin(nitroApp => {\n nitroApp.hooks.hook('error', captureErrorHook);\n\n captureTracingEvents();\n});\n"],"names":[],"mappings":";;;;AAIA,eAAe,YAAY,CAAC,QAAA,IAAY;AACxC,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC;;AAEhD,EAAE,oBAAoB,EAAE;AACxB,CAAC,CAAC;;;;"}
|
package/build/esm/sdk.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { applySdkMetadata } from '@sentry/core';
|
|
2
|
+
import { init as init$1, getDefaultIntegrations as getDefaultIntegrations$1 } from '@sentry/node';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Initializes the Nitro SDK
|
|
6
|
+
*/
|
|
7
|
+
function init(options = {}) {
|
|
8
|
+
const opts = {
|
|
9
|
+
...options,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
if (opts.defaultIntegrations === undefined) {
|
|
13
|
+
opts.defaultIntegrations = getDefaultIntegrations(opts);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
applySdkMetadata(opts, 'nitro', ['nitro', 'node']);
|
|
17
|
+
|
|
18
|
+
const client = init$1(opts);
|
|
19
|
+
|
|
20
|
+
return client;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get the default integrations for the Nitro SDK.
|
|
25
|
+
*
|
|
26
|
+
* @returns The default integrations for the Nitro SDK.
|
|
27
|
+
*/
|
|
28
|
+
function getDefaultIntegrations(options) {
|
|
29
|
+
return [...getDefaultIntegrations$1(options)];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { getDefaultIntegrations, init };
|
|
33
|
+
//# sourceMappingURL=sdk.js.map
|
|
@@ -0,0 +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":";;;AAKA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAA4B,EAAE,EAA0B;AACpF,EAAE,MAAM,IAAI,GAAgB;AAC5B,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,IAAI,IAAI,CAAC,mBAAA,KAAwB,SAAS,EAAE;AAC9C,IAAI,IAAI,CAAC,mBAAA,GAAsB,sBAAsB,CAAC,IAAI,CAAC;AAC3D,EAAE;;AAEF,EAAE,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;;AAEpD,EAAE,MAAM,MAAA,GAASA,MAAQ,CAAC,IAAI,CAAC;;AAE/B,EAAE,OAAO,MAAM;AACf;;AAEA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB,CAAC,OAAO,EAA0C;AACxF,EAAE,OAAO,CAAC,GAAGC,wBAA0B,CAAC,OAAO,CAAC,CAAC;AACjD;;;;"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { createSentryBuildPluginManager } from '@sentry/bundler-plugin-core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Registers a `compiled` hook to upload source maps after the build completes.
|
|
5
|
+
*/
|
|
6
|
+
function setupSourceMaps(nitro, options, sentryEnabledSourcemaps) {
|
|
7
|
+
// The `compiled` hook fires on EVERY rebuild during `nitro dev` watch mode.
|
|
8
|
+
// nitro.options.dev is reliably set by the time module setup runs.
|
|
9
|
+
if (shouldSkipSourcemapUpload(nitro, options)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
nitro.hooks.hook('compiled', async (_nitro) => {
|
|
14
|
+
await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Determines if sourcemap uploads should be skipped.
|
|
20
|
+
*/
|
|
21
|
+
function shouldSkipSourcemapUpload(nitro, options) {
|
|
22
|
+
return !!(
|
|
23
|
+
nitro.options.dev ||
|
|
24
|
+
nitro.options.preset === 'nitro-prerender' ||
|
|
25
|
+
nitro.options.sourcemap === false ||
|
|
26
|
+
(nitro.options.sourcemap ) === 'inline' ||
|
|
27
|
+
options?.sourcemaps?.disable === true
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Handles the actual source map upload after the build completes.
|
|
33
|
+
*/
|
|
34
|
+
async function handleSourceMapUpload(
|
|
35
|
+
nitro,
|
|
36
|
+
options,
|
|
37
|
+
sentryEnabledSourcemaps,
|
|
38
|
+
) {
|
|
39
|
+
const outputDir = nitro.options.output.serverDir;
|
|
40
|
+
const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);
|
|
41
|
+
|
|
42
|
+
const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {
|
|
43
|
+
buildTool: 'nitro',
|
|
44
|
+
loggerPrefix: '[@sentry/nitro]',
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
|
|
48
|
+
await sentryBuildPluginManager.createRelease();
|
|
49
|
+
|
|
50
|
+
await sentryBuildPluginManager.injectDebugIds([outputDir]);
|
|
51
|
+
|
|
52
|
+
if (options?.sourcemaps?.disable !== 'disable-upload') {
|
|
53
|
+
await sentryBuildPluginManager.uploadSourcemaps([outputDir], {
|
|
54
|
+
// We don't prepare the artifacts because we injected debug IDs manually before
|
|
55
|
+
prepareArtifacts: false,
|
|
56
|
+
});
|
|
57
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Normalizes the beginning of a path from e.g. ../../../ to ./
|
|
63
|
+
*/
|
|
64
|
+
function normalizePath(path) {
|
|
65
|
+
return path.replace(/^(\.\.\/)+/, './');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Removes a trailing slash from a path so glob patterns can be appended cleanly.
|
|
70
|
+
*/
|
|
71
|
+
function removeTrailingSlash(path) {
|
|
72
|
+
return path.replace(/\/$/, '');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Builds the plugin options for `createSentryBuildPluginManager` from the Sentry Nitro options.
|
|
77
|
+
*
|
|
78
|
+
* Only exported for testing purposes.
|
|
79
|
+
*/
|
|
80
|
+
// oxlint-disable-next-line complexity
|
|
81
|
+
function getPluginOptions(
|
|
82
|
+
options,
|
|
83
|
+
sentryEnabledSourcemaps,
|
|
84
|
+
outputDir,
|
|
85
|
+
) {
|
|
86
|
+
const defaultFilesToDelete =
|
|
87
|
+
sentryEnabledSourcemaps && outputDir ? [`${removeTrailingSlash(outputDir)}/**/*.map`] : undefined;
|
|
88
|
+
|
|
89
|
+
if (options?.debug && defaultFilesToDelete && options?.sourcemaps?.filesToDeleteAfterUpload === undefined) {
|
|
90
|
+
// eslint-disable-next-line no-console
|
|
91
|
+
console.log(
|
|
92
|
+
`[@sentry/nitro] Setting \`sourcemaps.filesToDeleteAfterUpload: ["${defaultFilesToDelete[0]}"]\` to delete generated source maps after they were uploaded to Sentry.`,
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
org: options?.org ?? process.env.SENTRY_ORG,
|
|
98
|
+
project: options?.project ?? process.env.SENTRY_PROJECT,
|
|
99
|
+
authToken: options?.authToken ?? process.env.SENTRY_AUTH_TOKEN,
|
|
100
|
+
url: options?.sentryUrl ?? process.env.SENTRY_URL,
|
|
101
|
+
headers: options?.headers,
|
|
102
|
+
telemetry: options?.telemetry ?? true,
|
|
103
|
+
debug: options?.debug ?? false,
|
|
104
|
+
silent: options?.silent ?? false,
|
|
105
|
+
errorHandler: options?.errorHandler,
|
|
106
|
+
sourcemaps: {
|
|
107
|
+
disable: options?.sourcemaps?.disable,
|
|
108
|
+
assets: options?.sourcemaps?.assets,
|
|
109
|
+
ignore: options?.sourcemaps?.ignore,
|
|
110
|
+
filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,
|
|
111
|
+
rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source) => normalizePath(source)),
|
|
112
|
+
},
|
|
113
|
+
release: options?.release,
|
|
114
|
+
bundleSizeOptimizations: options?.bundleSizeOptimizations,
|
|
115
|
+
_metaOptions: {
|
|
116
|
+
telemetry: {
|
|
117
|
+
metaFramework: 'nitro',
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/* Source map configuration rules:
|
|
124
|
+
1. User explicitly disabled source maps (sourcemap: false)
|
|
125
|
+
- Keep their setting, emit a warning that errors won't be unminified in Sentry
|
|
126
|
+
- We will not upload anything
|
|
127
|
+
2. User enabled source map generation (true)
|
|
128
|
+
- Keep their setting (don't modify besides uploading)
|
|
129
|
+
3. User did not set source maps (undefined)
|
|
130
|
+
- We enable source maps for Sentry
|
|
131
|
+
- Configure `filesToDeleteAfterUpload` to clean up .map files after upload
|
|
132
|
+
*/
|
|
133
|
+
function configureSourcemapSettings(
|
|
134
|
+
config,
|
|
135
|
+
moduleOptions,
|
|
136
|
+
) {
|
|
137
|
+
const sourcemapUploadDisabled = moduleOptions?.sourcemaps?.disable === true;
|
|
138
|
+
if (sourcemapUploadDisabled) {
|
|
139
|
+
return { sentryEnabledSourcemaps: false };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Nitro types `sourcemap` as `boolean`, but it forwards the value to Vite which also accepts `'hidden'` and `'inline'`.
|
|
143
|
+
const userSourcemap = (config ).sourcemap;
|
|
144
|
+
|
|
145
|
+
if (userSourcemap === false) {
|
|
146
|
+
// eslint-disable-next-line no-console
|
|
147
|
+
console.warn(
|
|
148
|
+
'[@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.',
|
|
149
|
+
);
|
|
150
|
+
return { sentryEnabledSourcemaps: false };
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (userSourcemap === 'inline') {
|
|
154
|
+
// eslint-disable-next-line no-console
|
|
155
|
+
console.warn(
|
|
156
|
+
'[@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.',
|
|
157
|
+
);
|
|
158
|
+
return { sentryEnabledSourcemaps: false };
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
let sentryEnabledSourcemaps = false;
|
|
162
|
+
if (userSourcemap === true || userSourcemap === 'hidden') {
|
|
163
|
+
if (moduleOptions?.debug) {
|
|
164
|
+
// eslint-disable-next-line no-console
|
|
165
|
+
console.log(
|
|
166
|
+
`[@sentry/nitro] Source maps are already enabled (\`sourcemap: ${JSON.stringify(userSourcemap)}\`). Sentry will upload them for error unminification.`,
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
// User did not explicitly set sourcemap, enable hidden source maps for Sentry.
|
|
171
|
+
// `'hidden'` emits .map files without adding a `//# sourceMappingURL=` comment to the output, avoiding public exposure.
|
|
172
|
+
(config ).sourcemap = 'hidden';
|
|
173
|
+
sentryEnabledSourcemaps = true;
|
|
174
|
+
if (moduleOptions?.debug) {
|
|
175
|
+
// eslint-disable-next-line no-console
|
|
176
|
+
console.log(
|
|
177
|
+
'[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload.',
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Nitro v3 has a `sourcemapMinify` plugin that destructively deletes `sourcesContent`,
|
|
183
|
+
// `x_google_ignoreList`, and clears `mappings` for any chunk containing `node_modules`.
|
|
184
|
+
// This makes sourcemaps unusable for Sentry.
|
|
185
|
+
config.experimental = config.experimental || {};
|
|
186
|
+
config.experimental.sourcemapMinify = false;
|
|
187
|
+
|
|
188
|
+
return { sentryEnabledSourcemaps };
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export { configureSourcemapSettings, getPluginOptions, setupSourceMaps };
|
|
192
|
+
//# sourceMappingURL=sourceMaps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMaps.js","sources":["../../src/sourceMaps.ts"],"sourcesContent":["import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugin-core';\nimport { createSentryBuildPluginManager } from '@sentry/bundler-plugin-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":";;AAKA;AACA;AACA;AACO,SAAS,eAAe,CAAC,KAAK,EAAS,OAAO,EAAuB,uBAAuB,EAAkB;AACrH;AACA;AACA,EAAE,IAAI,yBAAyB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;AACjD,IAAI;AACJ,EAAE;;AAEF,EAAE,KAAK,CAAC,KAAK,CA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KAAA,EAAA;AACA,EAAA;;AAEA,EAAA,IAAA,aAAA,KAAA,QAAA,EAAA;AACA;AACA,IAAA,OAAA,CAAA,IAAA;AACA,MAAA,4RAAA;AACA,KAAA;AACA,IAAA,OAAA,EAAA,uBAAA,EAAA,KAAA,EAAA;AACA,EAAA;;AAEA,EAAA,IAAA,uBAAA,GAAA,KAAA;AACA,EAAA,IAAA,aAAA,KAAA,IAAA,IAAA,aAAA,KAAA,QAAA,EAAA;AACA,IAAA,IAAA,aAAA,EAAA,KAAA,EAAA;AACA;AACA,MAAA,OAAA,CAAA,GAAA;AACA,QAAA,CAAA,8DAAA,EAAA,IAAA,CAAA,SAAA,CAAA,aAAA,CAAA,CAAA,sDAAA,CAAA;AACA,OAAA;AACA,IAAA;AACA,EAAA,CAAA,MAAA;AACA;AACA;AACA,IAAA,CAAA,MAAA,GAAA,SAAA,GAAA,QAAA;AACA,IAAA,uBAAA,GAAA,IAAA;AACA,IAAA,IAAA,aAAA,EAAA,KAAA,EAAA;AACA;AACA,MAAA,OAAA,CAAA,GAAA;AACA,QAAA,iHAAA;AACA,OAAA;AACA,IAAA;AACA,EAAA;;AAEA;AACA;AACA;AACA,EAAA,MAAA,CAAA,YAAA,GAAA,MAAA,CAAA,YAAA,IAAA,EAAA;AACA,EAAA,MAAA,CAAA,YAAA,CAAA,eAAA,GAAA,KAAA;;AAEA,EAAA,OAAA,EAAA,uBAAA,EAAA;AACA;;;;"}
|
|
@@ -0,0 +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":"AAEA;AACA;AACA;AACO,SAAS,SAAS,CAAC,KAAK,EAAS,MAAM,EAAgB;AAC9D,EAAE,KAAK,CAAC,OAAO,CAAC,OAAA,GAAU,KAAK,CAAC,OAAO,CAAC,OAAA,IAAW,EAAE;AACrD,EAAE,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC;AACpC;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
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
|
+
*/
|
|
12
|
+
function createResolver(base) {
|
|
13
|
+
let resolvedBase = base;
|
|
14
|
+
if (base.startsWith('file://')) {
|
|
15
|
+
resolvedBase = dirname(fileURLToPath(base));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
resolve: (...path) => resolve(resolvedBase, ...path),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { createResolver };
|
|
24
|
+
//# sourceMappingURL=resolver.js.map
|
|
@@ -0,0 +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 resolve: (...path) => resolve(resolvedBase, ...path),\n };\n}\n"],"names":[],"mappings":";;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,IAAI,EAAoB;AACvD,EAAE,IAAI,YAAA,GAAe,IAAI;AACzB,EAAE,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;AAClC,IAAI,YAAA,GAAe,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AAC/C,EAAE;;AAEF,EAAE,OAAO;AACT,IAAI,OAAO,EAAE,CAAC,GAAG,IAAI,KAAK,OAAO,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC;AACxD,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEBUG_BUILD: boolean;
|
|
7
|
+
//# sourceMappingURL=debug-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/common/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BuildTimeOptionsBase } from '@sentry/core';
|
|
2
|
+
import type { NitroConfig } from 'nitro/types';
|
|
3
|
+
export type SentryNitroOptions = BuildTimeOptionsBase;
|
|
4
|
+
/**
|
|
5
|
+
* Modifies the passed in Nitro configuration with automatic build-time instrumentation.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withSentryConfig(config: NitroConfig, sentryOptions?: SentryNitroOptions): NitroConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Sets up the Sentry Nitro module, useful for meta framework integrations.
|
|
10
|
+
*/
|
|
11
|
+
export declare function setupSentryNitroModule(config: NitroConfig, moduleOptions?: SentryNitroOptions, _serverConfigFile?: string): NitroConfig;
|
|
12
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEtD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,kBAAkB,GAAG,WAAW,CAErG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,WAAW,EACnB,aAAa,CAAC,EAAE,kBAAkB,EAClC,iBAAiB,CAAC,EAAE,MAAM,GACzB,WAAW,CAWb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentServer.d.ts","sourceRoot":"","sources":["../../../src/instruments/instrumentServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAGnD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NitroModule } from 'nitro/types';
|
|
2
|
+
import type { SentryNitroOptions } from './config';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a Nitro module to setup the Sentry SDK.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createNitroModule(sentryOptions?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): NitroModule;
|
|
7
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAAA,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,CAQpH"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CapturedErrorContext } from 'nitro/types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook that can be added in a Nitro plugin. It captures an error and sends it to Sentry.
|
|
4
|
+
*/
|
|
5
|
+
export declare function captureErrorHook(error: Error, errorContext: CapturedErrorContext): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=captureErrorHook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captureErrorHook.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"names":[],"mappings":"AAWA,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,CAoCtG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captureTracingEvents.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureTracingEvents.ts"],"names":[],"mappings":"AA8BA;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAQ3C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TracingRequestEvent as H3TracingRequestEvent } from 'h3/tracing';
|
|
2
|
+
/**
|
|
3
|
+
* Sets Server-Timing response headers for trace propagation to the client.
|
|
4
|
+
* The browser SDK reads these via the Performance API to connect pageload traces.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setServerTimingHeaders(event: H3TracingRequestEvent['event']): void;
|
|
7
|
+
//# sourceMappingURL=setServerTimingHeaders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setServerTimingHeaders.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/setServerTimingHeaders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,IAAI,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAE/E;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,GAAG,IAAI,CAmBlF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../src/runtime/plugins/server.ts"],"names":[],"mappings":";AAIA,wBAIG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Integration } from '@sentry/core';
|
|
2
|
+
import type { NodeClient, NodeOptions } from '@sentry/node';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes the Nitro SDK
|
|
5
|
+
*/
|
|
6
|
+
export declare function init(options?: NodeOptions | undefined): NodeClient | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Get the default integrations for the Nitro SDK.
|
|
9
|
+
*
|
|
10
|
+
* @returns The default integrations for the Nitro SDK.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getDefaultIntegrations(options: NodeOptions): Integration[] | undefined;
|
|
13
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG5D;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,UAAU,GAAG,SAAS,CAclF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,WAAW,EAAE,GAAG,SAAS,CAEtF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugin-core';
|
|
2
|
+
import type { Nitro, NitroConfig } from 'nitro/types';
|
|
3
|
+
import type { SentryNitroOptions } from './config';
|
|
4
|
+
/**
|
|
5
|
+
* Registers a `compiled` hook to upload source maps after the build completes.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setupSourceMaps(nitro: Nitro, options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean): void;
|
|
8
|
+
/**
|
|
9
|
+
* Builds the plugin options for `createSentryBuildPluginManager` from the Sentry Nitro options.
|
|
10
|
+
*
|
|
11
|
+
* Only exported for testing purposes.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPluginOptions(options?: SentryNitroOptions, sentryEnabledSourcemaps?: boolean, outputDir?: string): BundlerPluginOptions;
|
|
14
|
+
export declare function configureSourcemapSettings(config: NitroConfig, moduleOptions?: SentryNitroOptions): {
|
|
15
|
+
sentryEnabledSourcemaps: boolean;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=sourceMaps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMaps.d.ts","sourceRoot":"","sources":["../../src/sourceMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,EAAE,OAAO,GAAG,IAAI,CAUnH;AA2DD;;;;GAIG;AAEH,wBAAgB,gBAAgB,CAC9B,OAAO,CAAC,EAAE,kBAAkB,EAC5B,uBAAuB,CAAC,EAAE,OAAO,EACjC,SAAS,CAAC,EAAE,MAAM,GACjB,oBAAoB,CAoCtB;AAYD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,WAAW,EACnB,aAAa,CAAC,EAAE,kBAAkB,GACjC;IAAE,uBAAuB,EAAE,OAAO,CAAA;CAAE,CAqDtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../src/utils/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAG5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Resolver {
|
|
2
|
+
resolve(...path: string[]): string;
|
|
3
|
+
}
|
|
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
|
+
*/
|
|
12
|
+
export declare function createResolver(base: string): Resolver;
|
|
13
|
+
//# sourceMappingURL=resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../../src/utils/resolver.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CASrD"}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sentry/nitro",
|
|
3
|
+
"version": "10.51.0",
|
|
4
|
+
"description": "Official Sentry SDK for Nitro",
|
|
5
|
+
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
|
+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nitro",
|
|
7
|
+
"author": "Sentry",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"nitro",
|
|
11
|
+
"sentry",
|
|
12
|
+
"apm",
|
|
13
|
+
"tracing",
|
|
14
|
+
"error-tracking"
|
|
15
|
+
],
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18.19.1"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"/build"
|
|
21
|
+
],
|
|
22
|
+
"module": "build/esm/index.js",
|
|
23
|
+
"types": "build/types/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
"./package.json": "./package.json",
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./build/types/index.d.ts",
|
|
28
|
+
"default": "./build/esm/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"nitro": ">=3.0.0-0 <4.0.0 || 3.0.260311-beta || 3.0.260415-beta"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@sentry/bundler-plugin-core": "^5.2.0",
|
|
39
|
+
"@sentry/core": "10.51.0",
|
|
40
|
+
"@sentry/node": "10.51.0",
|
|
41
|
+
"@sentry/opentelemetry": "10.51.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"nitro": "^3.0.260415-beta",
|
|
45
|
+
"h3": "^2.0.1-rc.13"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "run-p build:transpile build:types",
|
|
49
|
+
"build:dev": "yarn build",
|
|
50
|
+
"build:transpile": "rollup -c rollup.npm.config.mjs",
|
|
51
|
+
"build:types": "run-s build:types:core",
|
|
52
|
+
"build:types:core": "tsc -p tsconfig.types.json",
|
|
53
|
+
"build:watch": "run-p build:transpile:watch build:types:watch",
|
|
54
|
+
"build:dev:watch": "yarn build:watch",
|
|
55
|
+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
|
|
56
|
+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
|
|
57
|
+
"build:tarball": "npm pack",
|
|
58
|
+
"clean": "rimraf build coverage sentry-nitro-*.tgz",
|
|
59
|
+
"lint": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --type-aware",
|
|
60
|
+
"lint:fix": "OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint . --fix --type-aware",
|
|
61
|
+
"lint:es-compatibility": "es-check es2022 ./build/esm/*.js --module",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"test:watch": "vitest --watch",
|
|
64
|
+
"yalc:publish": "yalc publish --push --sig"
|
|
65
|
+
},
|
|
66
|
+
"volta": {
|
|
67
|
+
"extends": "../../package.json"
|
|
68
|
+
},
|
|
69
|
+
"sideEffects": false,
|
|
70
|
+
"nx": {
|
|
71
|
+
"targets": {
|
|
72
|
+
"build:transpile": {
|
|
73
|
+
"dependsOn": [
|
|
74
|
+
"^build:transpile",
|
|
75
|
+
"^build:types",
|
|
76
|
+
"build:types"
|
|
77
|
+
],
|
|
78
|
+
"outputs": [
|
|
79
|
+
"{projectRoot}/build/esm"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|