@sentry/nitro 10.53.0 → 10.54.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/config.js +1 -15
- package/build/esm/config.js.map +1 -1
- package/build/esm/instruments/instrumentServer.js +1 -5
- package/build/esm/instruments/instrumentServer.js.map +1 -1
- package/build/esm/module.js +3 -6
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/runtime/hooks/captureErrorHook.js +5 -29
- package/build/esm/runtime/hooks/captureErrorHook.js.map +1 -1
- package/build/esm/runtime/hooks/captureStorageEvents.js +34 -69
- package/build/esm/runtime/hooks/captureStorageEvents.js.map +1 -1
- package/build/esm/runtime/hooks/captureTracingEvents.js +50 -115
- package/build/esm/runtime/hooks/captureTracingEvents.js.map +1 -1
- package/build/esm/runtime/hooks/setServerTimingHeaders.js +3 -10
- package/build/esm/runtime/hooks/setServerTimingHeaders.js.map +1 -1
- package/build/esm/runtime/plugins/server.js +2 -3
- package/build/esm/runtime/plugins/server.js.map +1 -1
- package/build/esm/sdk.js +3 -16
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/sourceMaps.js +26 -107
- package/build/esm/sourceMaps.js.map +1 -1
- package/build/esm/utils/plugin.js +0 -3
- package/build/esm/utils/plugin.js.map +1 -1
- package/build/esm/utils/resolver.js +2 -11
- package/build/esm/utils/resolver.js.map +1 -1
- package/package.json +5 -5
package/build/esm/sourceMaps.js
CHANGED
|
@@ -1,98 +1,47 @@
|
|
|
1
1
|
import { createSentryBuildPluginManager } from '@sentry/bundler-plugin-core';
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Registers a `compiled` hook to upload source maps after the build completes.
|
|
5
|
-
*/
|
|
6
3
|
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
4
|
if (shouldSkipSourcemapUpload(nitro, options)) {
|
|
10
5
|
return;
|
|
11
6
|
}
|
|
12
|
-
|
|
13
|
-
nitro.hooks.hook('compiled', async (_nitro) => {
|
|
7
|
+
nitro.hooks.hook("compiled", async (_nitro) => {
|
|
14
8
|
await handleSourceMapUpload(_nitro, options, sentryEnabledSourcemaps);
|
|
15
9
|
});
|
|
16
10
|
}
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Determines if sourcemap uploads should be skipped.
|
|
20
|
-
*/
|
|
21
11
|
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
|
-
);
|
|
12
|
+
return !!(nitro.options.dev || nitro.options.preset === "nitro-prerender" || nitro.options.sourcemap === false || nitro.options.sourcemap === "inline" || options?.sourcemaps?.disable === true);
|
|
29
13
|
}
|
|
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
|
-
) {
|
|
14
|
+
async function handleSourceMapUpload(nitro, options, sentryEnabledSourcemaps) {
|
|
39
15
|
const outputDir = nitro.options.output.serverDir;
|
|
40
16
|
const pluginOptions = getPluginOptions(options, sentryEnabledSourcemaps, outputDir);
|
|
41
|
-
|
|
42
17
|
const sentryBuildPluginManager = createSentryBuildPluginManager(pluginOptions, {
|
|
43
|
-
buildTool:
|
|
44
|
-
loggerPrefix:
|
|
18
|
+
buildTool: "nitro",
|
|
19
|
+
loggerPrefix: "[@sentry/nitro]"
|
|
45
20
|
});
|
|
46
|
-
|
|
47
21
|
await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();
|
|
48
22
|
await sentryBuildPluginManager.createRelease();
|
|
49
|
-
|
|
50
23
|
await sentryBuildPluginManager.injectDebugIds([outputDir]);
|
|
51
|
-
|
|
52
|
-
if (options?.sourcemaps?.disable !== 'disable-upload') {
|
|
24
|
+
if (options?.sourcemaps?.disable !== "disable-upload") {
|
|
53
25
|
await sentryBuildPluginManager.uploadSourcemaps([outputDir], {
|
|
54
26
|
// We don't prepare the artifacts because we injected debug IDs manually before
|
|
55
|
-
prepareArtifacts: false
|
|
27
|
+
prepareArtifacts: false
|
|
56
28
|
});
|
|
57
29
|
await sentryBuildPluginManager.deleteArtifacts();
|
|
58
30
|
}
|
|
59
31
|
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Normalizes the beginning of a path from e.g. ../../../ to ./
|
|
63
|
-
*/
|
|
64
32
|
function normalizePath(path) {
|
|
65
|
-
return path.replace(/^(\.\.\/)+/,
|
|
33
|
+
return path.replace(/^(\.\.\/)+/, "./");
|
|
66
34
|
}
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Removes a trailing slash from a path so glob patterns can be appended cleanly.
|
|
70
|
-
*/
|
|
71
35
|
function removeTrailingSlash(path) {
|
|
72
|
-
return path.replace(/\/$/,
|
|
36
|
+
return path.replace(/\/$/, "");
|
|
73
37
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
38
|
+
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) {
|
|
91
41
|
console.log(
|
|
92
|
-
`[@sentry/nitro] Setting \`sourcemaps.filesToDeleteAfterUpload: ["${defaultFilesToDelete[0]}"]\` to delete generated source maps after they were uploaded to Sentry
|
|
42
|
+
`[@sentry/nitro] Setting \`sourcemaps.filesToDeleteAfterUpload: ["${defaultFilesToDelete[0]}"]\` to delete generated source maps after they were uploaded to Sentry.`
|
|
93
43
|
);
|
|
94
44
|
}
|
|
95
|
-
|
|
96
45
|
return {
|
|
97
46
|
org: options?.org ?? process.env.SENTRY_ORG,
|
|
98
47
|
project: options?.project ?? process.env.SENTRY_PROJECT,
|
|
@@ -108,83 +57,53 @@ function getPluginOptions(
|
|
|
108
57
|
assets: options?.sourcemaps?.assets,
|
|
109
58
|
ignore: options?.sourcemaps?.ignore,
|
|
110
59
|
filesToDeleteAfterUpload: options?.sourcemaps?.filesToDeleteAfterUpload ?? defaultFilesToDelete,
|
|
111
|
-
rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source) => normalizePath(source))
|
|
60
|
+
rewriteSources: options?.sourcemaps?.rewriteSources ?? ((source) => normalizePath(source))
|
|
112
61
|
},
|
|
113
62
|
release: options?.release,
|
|
114
63
|
bundleSizeOptimizations: options?.bundleSizeOptimizations,
|
|
115
64
|
_metaOptions: {
|
|
116
65
|
telemetry: {
|
|
117
|
-
metaFramework:
|
|
118
|
-
}
|
|
119
|
-
}
|
|
66
|
+
metaFramework: "nitro"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
120
69
|
};
|
|
121
70
|
}
|
|
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
|
-
) {
|
|
71
|
+
function configureSourcemapSettings(config, moduleOptions) {
|
|
137
72
|
const sourcemapUploadDisabled = moduleOptions?.sourcemaps?.disable === true;
|
|
138
73
|
if (sourcemapUploadDisabled) {
|
|
139
74
|
return { sentryEnabledSourcemaps: false };
|
|
140
75
|
}
|
|
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
|
-
|
|
76
|
+
const userSourcemap = config.sourcemap;
|
|
145
77
|
if (userSourcemap === false) {
|
|
146
|
-
// eslint-disable-next-line no-console
|
|
147
78
|
console.warn(
|
|
148
|
-
|
|
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."
|
|
149
80
|
);
|
|
150
81
|
return { sentryEnabledSourcemaps: false };
|
|
151
82
|
}
|
|
152
|
-
|
|
153
|
-
if (userSourcemap === 'inline') {
|
|
154
|
-
// eslint-disable-next-line no-console
|
|
83
|
+
if (userSourcemap === "inline") {
|
|
155
84
|
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.'
|
|
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.'
|
|
157
86
|
);
|
|
158
87
|
return { sentryEnabledSourcemaps: false };
|
|
159
88
|
}
|
|
160
|
-
|
|
161
89
|
let sentryEnabledSourcemaps = false;
|
|
162
|
-
if (userSourcemap === true || userSourcemap ===
|
|
90
|
+
if (userSourcemap === true || userSourcemap === "hidden") {
|
|
163
91
|
if (moduleOptions?.debug) {
|
|
164
|
-
// eslint-disable-next-line no-console
|
|
165
92
|
console.log(
|
|
166
|
-
`[@sentry/nitro] Source maps are already enabled (\`sourcemap: ${JSON.stringify(userSourcemap)}\`). Sentry will upload them for error unminification
|
|
93
|
+
`[@sentry/nitro] Source maps are already enabled (\`sourcemap: ${JSON.stringify(userSourcemap)}\`). Sentry will upload them for error unminification.`
|
|
167
94
|
);
|
|
168
95
|
}
|
|
169
96
|
} else {
|
|
170
|
-
|
|
171
|
-
// `'hidden'` emits .map files without adding a `//# sourceMappingURL=` comment to the output, avoiding public exposure.
|
|
172
|
-
(config ).sourcemap = 'hidden';
|
|
97
|
+
config.sourcemap = "hidden";
|
|
173
98
|
sentryEnabledSourcemaps = true;
|
|
174
99
|
if (moduleOptions?.debug) {
|
|
175
|
-
// eslint-disable-next-line no-console
|
|
176
100
|
console.log(
|
|
177
|
-
|
|
101
|
+
"[@sentry/nitro] Enabled hidden source map generation for Sentry. Source map files will be deleted after upload."
|
|
178
102
|
);
|
|
179
103
|
}
|
|
180
104
|
}
|
|
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
105
|
config.experimental = config.experimental || {};
|
|
186
106
|
config.experimental.sourcemapMinify = false;
|
|
187
|
-
|
|
188
107
|
return { sentryEnabledSourcemaps };
|
|
189
108
|
}
|
|
190
109
|
|
|
@@ -1 +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,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,MAAM,KAAY;AACxD,IAAI,MAAM,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,uBAAuB,CAAC;AACzE,EAAE,CAAC,CAAC;AACJ;;AAEA;AACA;AACA;AACA,SAAS,yBAAyB,CAAC,KAAK,EAAS,OAAO,EAAgC;AACxF,EAAE,OAAO,CAAC;AACV,IAAI,KAAK,CAAC,OAAO,CAAC,GAAA;AAClB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAA,KAAW,iBAAA;AAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,SAAA,KAAc,KA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AA,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;;;;"}
|
|
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":";;AAQO,SAAS,eAAA,CAAgB,KAAA,EAAc,OAAA,EAA8B,uBAAA,EAAyC;AAGnH,EAAA,IAAI,yBAAA,CAA0B,KAAA,EAAO,OAAO,CAAA,EAAG;AAC7C,IAAA;AAAA,EACF;AAEA,EAAA,KAAA,CAAM,KAAA,CAAM,IAAA,CAAK,UAAA,EAAY,OAAO,MAAA,KAAkB;AACpD,IAAA,MAAM,qBAAA,CAAsB,MAAA,EAAQ,O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A0B,IAAA;AAC1B,IAAA,IAAI,eAAe,KAAA,EAAO;AAExB,MAAA,OAAA,CAAQ,GAAA;AAAA,QACN;AAAA,OACF;AAAA,IACF;AAAA,EACF;AAKA,EAAA,MAAA,CAAO,YAAA,GAAe,MAAA,CAAO,YAAA,IAAgB,EAAC;AAC9C,EAAA,MAAA,CAAO,aAAa,eAAA,GAAkB,KAAA;AAEtC,EAAA,OAAO,EAAE,uBAAA,EAAwB;AACnC;;;;"}
|
|
@@ -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":"
|
|
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,22 +1,13 @@
|
|
|
1
1
|
import { dirname, resolve } from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
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
4
|
function createResolver(base) {
|
|
13
5
|
let resolvedBase = base;
|
|
14
|
-
if (base.startsWith(
|
|
6
|
+
if (base.startsWith("file://")) {
|
|
15
7
|
resolvedBase = dirname(fileURLToPath(base));
|
|
16
8
|
}
|
|
17
|
-
|
|
18
9
|
return {
|
|
19
|
-
resolve: (...path) => resolve(resolvedBase, ...path)
|
|
10
|
+
resolve: (...path) => resolve(resolvedBase, ...path)
|
|
20
11
|
};
|
|
21
12
|
}
|
|
22
13
|
|
|
@@ -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 resolve: (...path) => resolve(resolvedBase, ...path),\n };\n}\n"],"names":[],"mappings":";;;
|
|
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":";;;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,IACL,SAAS,CAAA,GAAI,IAAA,KAAS,OAAA,CAAQ,YAAA,EAAc,GAAG,IAAI;AAAA,GACrD;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/nitro",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.54.0",
|
|
4
4
|
"description": "Official Sentry SDK for Nitro",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nitro",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@sentry/bundler-plugin-core": "^5.3.0",
|
|
39
|
-
"@sentry/core": "10.
|
|
40
|
-
"@sentry/node": "10.
|
|
41
|
-
"@sentry/opentelemetry": "10.
|
|
39
|
+
"@sentry/core": "10.54.0",
|
|
40
|
+
"@sentry/node": "10.54.0",
|
|
41
|
+
"@sentry/opentelemetry": "10.54.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"nitro": "^3.0.260415-beta",
|
|
45
|
-
"h3": "^2.0.1-rc.
|
|
45
|
+
"h3": "^2.0.1-rc.22"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "run-p build:transpile build:types",
|