@sentry/nuxt 11.0.0-alpha.1 → 11.0.0-alpha.2
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/cjs/server/sdk.js +0 -23
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/vite/sourceMapDeletion.js +35 -0
- package/build/cjs/vite/sourceMapDeletion.js.map +1 -0
- package/build/cjs/vite/sourceMaps.js +13 -6
- package/build/cjs/vite/sourceMaps.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/sdk.js +2 -25
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/vite/sourceMapDeletion.js +32 -0
- package/build/esm/vite/sourceMapDeletion.js.map +1 -0
- package/build/esm/vite/sourceMaps.js +13 -6
- package/build/esm/vite/sourceMaps.js.map +1 -1
- package/build/module/common/types.d.ts +0 -9
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +41 -7
- package/build/module/runtime/hooks/wrapMiddlewareHandler.js +5 -5
- package/build/module/runtime/utils/instrumentStorage.js +11 -11
- package/build/module/vite/sourceMapDeletion.d.ts +3 -0
- package/build/types/common/types.d.ts +0 -9
- package/build/types/common/types.d.ts.map +1 -1
- package/build/types/index.types.d.ts +3 -0
- package/build/types/index.types.d.ts.map +1 -1
- package/build/types/runtime/hooks/wrapMiddlewareHandler.d.ts.map +1 -1
- package/build/types/runtime/utils/instrumentStorage.d.ts.map +1 -1
- package/build/types/server/sdk.d.ts.map +1 -1
- package/build/types/vite/sourceMapDeletion.d.ts +4 -0
- package/build/types/vite/sourceMapDeletion.d.ts.map +1 -0
- package/build/types/vite/sourceMaps.d.ts.map +1 -1
- package/package.json +10 -9
package/build/cjs/server/sdk.js
CHANGED
|
@@ -10,7 +10,6 @@ function init(options) {
|
|
|
10
10
|
envFallback = core.DEFAULT_ENVIRONMENT;
|
|
11
11
|
const sentryOptions = {
|
|
12
12
|
environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,
|
|
13
|
-
defaultIntegrations: getNuxtDefaultIntegrations(options),
|
|
14
13
|
...options
|
|
15
14
|
};
|
|
16
15
|
core.applySdkMetadata(sentryOptions, "nuxt", ["nuxt", "node"]);
|
|
@@ -51,28 +50,6 @@ function clientSourceMapErrorFilter(options) {
|
|
|
51
50
|
{ id: "NuxtClientSourceMapErrorFilter" }
|
|
52
51
|
);
|
|
53
52
|
}
|
|
54
|
-
function getNuxtDefaultIntegrations(options) {
|
|
55
|
-
return [
|
|
56
|
-
...node.getDefaultIntegrations(options).filter((integration) => integration.name !== "Http"),
|
|
57
|
-
// The httpIntegration is added as defaultIntegration, so users can still overwrite it
|
|
58
|
-
node.httpIntegration({
|
|
59
|
-
instrumentation: {
|
|
60
|
-
responseHook: () => {
|
|
61
|
-
core.vercelWaitUntil(flushSafelyWithTimeout());
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
})
|
|
65
|
-
];
|
|
66
|
-
}
|
|
67
|
-
async function flushSafelyWithTimeout() {
|
|
68
|
-
try {
|
|
69
|
-
debugBuild.DEBUG_BUILD && core.debug.log("Flushing events...");
|
|
70
|
-
await core.flush(2e3);
|
|
71
|
-
debugBuild.DEBUG_BUILD && core.debug.log("Done flushing events");
|
|
72
|
-
} catch (e) {
|
|
73
|
-
debugBuild.DEBUG_BUILD && core.debug.log("Error while flushing events:\n", e);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
53
|
function isCacheEvent(e) {
|
|
77
54
|
return e.contexts?.trace?.origin === "auto.cache.nuxt";
|
|
78
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor } from '@sentry/core';\nimport { applySdkMetadata, debug, DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT, getGlobalScope } from '@sentry/core';\nimport { init as initNode } from '@sentry/node';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n let envFallback: string;\n /*! rollup-include-cjs-only */\n envFallback = DEFAULT_ENVIRONMENT;\n /*! rollup-include-cjs-only-end */\n\n /*! rollup-include-esm-only */\n envFallback = import.meta.dev ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT;\n /*! rollup-include-esm-only-end */\n\n const sentryOptions = {\n environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options));\n getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options));\n\n return client;\n}\n\n/**\n * Filter out transactions for resource requests which we don't want to send to Sentry\n * for quota reasons.\n *\n * Only exported for testing\n */\nexport function lowQualityTransactionsFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n if (event.type !== 'transaction' || !event.transaction || isCacheEvent(event)) {\n return event;\n }\n\n // Check if this looks like a parametrized route (contains :param or :param() patterns)\n const hasRouteParameters = /\\/:[^(/\\s]*(\\([^)]*\\))?[^/\\s]*/.test(event.transaction);\n\n if (hasRouteParameters) {\n return event;\n }\n\n // We don't want to send transaction for file requests, so everything ending with a *.someExtension should be filtered out\n // path.extname will return an empty string for normal page requests\n if (path.extname(event.transaction)) {\n options.debug &&\n DEBUG_BUILD &&\n debug.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n );\n}\n\n/**\n * The browser devtools try to get the source maps, but as client source maps may not be available there is going to be an error (no problem for the application though).\n *\n * Only exported for testing\n */\nexport function clientSourceMapErrorFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n const errorMsg = event.exception?.values?.[0]?.value;\n if (errorMsg?.match(/^ENOENT: no such file or directory, open '.*\\/_nuxt\\/.*\\.js\\.map'/)) {\n options.debug && DEBUG_BUILD && debug.log('NuxtClientSourceMapErrorFilter filtered error: ', errorMsg);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtClientSourceMapErrorFilter' },\n );\n}\n\n/**\n * Checks if the event is a cache event.\n */\nfunction isCacheEvent(e: Event): boolean {\n return e.contexts?.trace?.origin === 'auto.cache.nuxt';\n}\n"],"names":["DEFAULT_ENVIRONMENT","applySdkMetadata","initNode","getGlobalScope","DEBUG_BUILD","debug"],"mappings":";;;;;;;AAYO,SAAS,KAAK,OAAA,EAAsD;AACzE,EAAA,IAAI,WAAA;AAAA,EACJ,WAAA,GAAAA,wBAAA;AACA,EAAA,MAAA,aAAc,GAAA;AAAA,IACd,WAAA,EAAA,OAAA,CAAA,WAAA,IAAA,OAAA,CAAA,GAAA,CAAA,kBAAA,IAAA,WAAA;AAAA,IAEA,GAAA;AACA,GAAA;AAAkD,EAClDC,qBAAA,CAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAEA,EAAA,MAAM,MAAA,GAAAC,SAAgB,CAAA,aAAA,CAAA;AAAA,EAAAC,mBACpB,EAAa,CAAA,iBAAQ,CAAA,4BAA2B,CAAA,OAAA,CAAsB,CAAA;AAAA,EAAAA,mBACnE,EAAA,CAAA,iBAAA,CAAA,0BAAA,CAAA,OAAA,CAAA,CAAA;AAAA,EACL,OAAA,MAAA;AAEA;AAEA,SAAM,4BAA+B,CAAA,OAAA,EAAA;AAErC,EAAA,OAAA,MAAA,CAAA,MAAiB;AACjB,KAAA,CAAA,KAAA,KAAA;AAEA,MAAA,IAAO,KAA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: 'Module' });
|
|
2
|
+
|
|
3
|
+
const core = require('@sentry/bundler-plugins/core');
|
|
4
|
+
|
|
5
|
+
function withoutSourceMapDeletion(options) {
|
|
6
|
+
return {
|
|
7
|
+
...options,
|
|
8
|
+
sourcemaps: {
|
|
9
|
+
...options.sourcemaps,
|
|
10
|
+
filesToDeleteAfterUpload: void 0
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
async function deleteSourceMapsAfterBuild(options) {
|
|
15
|
+
const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;
|
|
16
|
+
if (filesToDeleteAfterUpload === void 0) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const deletionOptions = {
|
|
20
|
+
...options,
|
|
21
|
+
sourcemaps: {
|
|
22
|
+
...options.sourcemaps,
|
|
23
|
+
filesToDeleteAfterUpload
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const sentryBuildPluginManager = core.createSentryBuildPluginManager(deletionOptions, {
|
|
27
|
+
buildTool: "nuxt",
|
|
28
|
+
loggerPrefix: "[Sentry Nuxt]"
|
|
29
|
+
});
|
|
30
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.deleteSourceMapsAfterBuild = deleteSourceMapsAfterBuild;
|
|
34
|
+
exports.withoutSourceMapDeletion = withoutSourceMapDeletion;
|
|
35
|
+
//# sourceMappingURL=sourceMapDeletion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMapDeletion.js","sources":["../../../src/vite/sourceMapDeletion.ts"],"sourcesContent":["import { createSentryBuildPluginManager, type Options } from '@sentry/bundler-plugins/core';\n\nexport function withoutSourceMapDeletion(options: Options): Options {\n return {\n ...options,\n sourcemaps: {\n ...options.sourcemaps,\n filesToDeleteAfterUpload: undefined,\n },\n };\n}\n\nexport async function deleteSourceMapsAfterBuild(options: Options): Promise<void> {\n const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;\n\n if (filesToDeleteAfterUpload === undefined) {\n return;\n }\n\n const deletionOptions: Options = {\n ...options,\n sourcemaps: {\n ...options.sourcemaps,\n filesToDeleteAfterUpload,\n },\n };\n\n const sentryBuildPluginManager = createSentryBuildPluginManager(deletionOptions, {\n buildTool: 'nuxt',\n loggerPrefix: '[Sentry Nuxt]',\n });\n\n await sentryBuildPluginManager.deleteArtifacts();\n}\n"],"names":["createSentryBuildPluginManager"],"mappings":";;;;AAEO,SAAS,yBAAyB,OAAA,EAA2B;AAClE,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,UAAA,EAAY;AAAA,MACV,GAAG,OAAA,CAAQ,UAAA;AAAA,MACX,wBAAA,EAA0B;AAAA;AAC5B,GACF;AACF;AAEA,eAAsB,2BAA2B,OAAA,EAAiC;AAChF,EAAA,MAAM,wBAAA,GAA2B,MAAM,OAAA,CAAQ,UAAA,EAAY,wBAAA;AAE3D,EAAA,IAAI,6BAA6B,MAAA,EAAW;AAC1C,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,eAAA,GAA2B;AAAA,IAC/B,GAAG,OAAA;AAAA,IACH,UAAA,EAAY;AAAA,MACV,GAAG,OAAA,CAAQ,UAAA;AAAA,MACX;AAAA;AACF,GACF;AAEA,EAAA,MAAM,wBAAA,GAA2BA,oCAA+B,eAAA,EAAiB;AAAA,IAC/E,SAAA,EAAW,MAAA;AAAA,IACX,YAAA,EAAc;AAAA,GACf,CAAA;AAED,EAAA,MAAM,yBAAyB,eAAA,EAAgB;AACjD;;;;;"}
|
|
@@ -2,9 +2,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
const rollup = require('@sentry/bundler-plugins/rollup');
|
|
4
4
|
const vite = require('@sentry/bundler-plugins/vite');
|
|
5
|
+
const core = require('@sentry/core');
|
|
6
|
+
const sourceMapDeletion = require('./sourceMapDeletion.js');
|
|
5
7
|
const sentryVitePlugin = require('./sentryVitePlugin.js');
|
|
6
8
|
|
|
7
9
|
function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
10
|
+
core.warnOnRemovedBuildOptions(moduleOptions, ["unstable_sentryBundlerPluginOptions"]);
|
|
8
11
|
const isDebug = moduleOptions.debug;
|
|
9
12
|
const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;
|
|
10
13
|
const shouldDeleteFilesFallback = { client: true, server: true };
|
|
@@ -32,7 +35,7 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
32
35
|
[
|
|
33
36
|
sentryVitePlugin.validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),
|
|
34
37
|
// Vite plugin is added on the client and server side (plugin runs for both builds)
|
|
35
|
-
...vite.sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
38
|
+
...vite.sentryVitePlugin(sourceMapDeletion.withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
36
39
|
],
|
|
37
40
|
{ dev: false, build: true }
|
|
38
41
|
// Only add source map plugin during build
|
|
@@ -51,10 +54,15 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
51
54
|
console.log("[Sentry] Adding Sentry Rollup plugin to the server runtime.");
|
|
52
55
|
}
|
|
53
56
|
nitroConfig.rollupConfig.plugins.push(
|
|
54
|
-
rollup.sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
57
|
+
rollup.sentryRollupPlugin(sourceMapDeletion.withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
55
58
|
);
|
|
56
59
|
}
|
|
57
60
|
});
|
|
61
|
+
nuxt.hook("close", async () => {
|
|
62
|
+
if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {
|
|
63
|
+
await sourceMapDeletion.deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
58
66
|
}
|
|
59
67
|
function normalizePath(path) {
|
|
60
68
|
return path.replace(/^(\.\.\/)+/, "./");
|
|
@@ -78,15 +86,14 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
78
86
|
release: {
|
|
79
87
|
name: moduleOptions.release?.name,
|
|
80
88
|
// Support all release options from BuildTimeOptionsBase
|
|
81
|
-
...moduleOptions.release
|
|
82
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions?.release
|
|
89
|
+
...moduleOptions.release
|
|
83
90
|
},
|
|
91
|
+
moduleMetadata: moduleOptions.moduleMetadata,
|
|
84
92
|
_metaOptions: {
|
|
85
93
|
telemetry: {
|
|
86
94
|
metaFramework: "nuxt"
|
|
87
95
|
}
|
|
88
96
|
},
|
|
89
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions,
|
|
90
97
|
sourcemaps: {
|
|
91
98
|
disable: moduleOptions.sourcemaps?.disable,
|
|
92
99
|
// The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')
|
|
@@ -96,7 +103,7 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
96
103
|
ignore: sourcemapsOptions.ignore ?? void 0,
|
|
97
104
|
filesToDeleteAfterUpload,
|
|
98
105
|
rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,
|
|
99
|
-
|
|
106
|
+
resolveSourceMap: sourcemapsOptions.resolveSourceMap
|
|
100
107
|
}
|
|
101
108
|
};
|
|
102
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';\nimport { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\nimport type { NitroConfig } from 'nitropack';\nimport type { Plugin } from 'vite';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { validateSourceMapsOptionsPlugin } from './sentryVitePlugin';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(\n moduleOptions: SentryNuxtModuleOptions,\n nuxt: Nuxt,\n addVitePlugin: (plugin: Plugin[], options?: { dev?: boolean; build?: boolean }) => void,\n): void {\n const isDebug = moduleOptions.debug;\n\n const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;\n\n // In case we overwrite the source map settings, we default to deleting the files\n const shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will overwrite with 'hidden', if needed.\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n // Mutate in place so the Vite plugin (which captured this object at registration time) sees the updated values\n shouldDeleteFilesFallback.client = previousSourceMapSettings.client === 'unset';\n shouldDeleteFilesFallback.server = previousSourceMapSettings.server === 'unset';\n\n if (isDebug && (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)) {\n const enabledDeleteFallbacks =\n shouldDeleteFilesFallback.client && shouldDeleteFilesFallback.server\n ? 'client-side and server-side'\n : shouldDeleteFilesFallback.server\n ? 'server-side'\n : 'client-side';\n\n if (!moduleOptions.sourcemaps?.filesToDeleteAfterUpload) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be automatically deleted after uploading them to Sentry.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be deleted according to your \\`sourcemaps.filesToDeleteAfterUpload\\` configuration. To use automatic deletion instead, leave \\`filesToDeleteAfterUpload\\` empty.`,\n );\n }\n }\n }\n });\n\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n addVitePlugin(\n [\n validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),\n // Vite plugin is added on the client and server side (plugin runs for both builds)\n ...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n ],\n { dev: false, build: true }, // Only add source map plugin during build\n );\n }\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {\n nitroConfig.rollupConfig ??= {};\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n );\n }\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 * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourcemapsOptions = moduleOptions.sourcemaps || {};\n const filesToDeleteAfterUpload = resolveFilesToDeleteAfterUpload(moduleOptions, shouldDeleteFilesFallback);\n\n return {\n applicationKey: moduleOptions.applicationKey,\n org: moduleOptions.org ?? process.env.SENTRY_ORG,\n project: moduleOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: moduleOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: moduleOptions.telemetry ?? true,\n url: moduleOptions.sentryUrl ?? process.env.SENTRY_URL,\n headers: moduleOptions.headers,\n debug: moduleOptions.debug ?? false,\n silent: moduleOptions.silent ?? false,\n errorHandler: moduleOptions.errorHandler,\n bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user\n release: {\n name: moduleOptions.release?.name,\n // Support all release options from BuildTimeOptionsBase\n ...moduleOptions.release,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n disable: moduleOptions.sourcemaps?.disable,\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourcemapsOptions.assets ?? undefined,\n ignore: sourcemapsOptions.ignore ?? undefined,\n filesToDeleteAfterUpload,\n rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/**\n * Determines which files to delete after upload. If the user set `filesToDeleteAfterUpload`, we use\n * that. Otherwise we only delete the source maps Sentry generated itself — i.e. the sides\n * (client/server) whose `sourcemap` setting resolved to `undefined`, where Sentry stepped in and\n * enabled `'hidden'`. Given Nuxt's default of `{ server: true, client: false }`, this isn't the\n * default case: it only kicks in when a side is left `undefined` (whole config or a single sub-key).\n * @see https://nuxt.com/docs/4.x/api/nuxt-config#sourcemap\n */\nfunction resolveFilesToDeleteAfterUpload(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): string | Array<string> | undefined {\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n const filesToDeleteAfterUpload = moduleOptions.sourcemaps?.filesToDeleteAfterUpload;\n\n if (typeof filesToDeleteAfterUpload === 'undefined' && shouldDeleteFilesAfterUpload && moduleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return filesToDeleteAfterUpload\n ? filesToDeleteAfterUpload\n : shouldDeleteFilesAfterUpload\n ? fallbackFilesToDelete\n : undefined;\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n const isDebug = sentryModuleOptions.debug;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap', isDebug);\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client', isDebug);\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server', isDebug);\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n }\n}\n\n/**\n * Validates that source map settings are consistent between Nuxt and Vite/Nitro configurations.\n * Logs a warning if conflicting settings are detected.\n *\n * @internal Only exported for testing.\n */\nexport function validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string, isDebug: boolean | undefined): void {\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your Vite configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(`[Sentry] Source map generation (\\`${settingKey}\\`) is disabled in your Vite configuration.`);\n }\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n}\n"],"names":["validateSourceMapsOptionsPlugin","sentryVitePlugin","sentryRollupPlugin"],"mappings":";;;;;;AAmBO,SAAS,eAAA,CACd,aAAA,EACA,IAAA,EACA,aAAA,EACM;AACN,EAAA,MAAM,UAAU,aAAA,CAAc,KAAA;AAE9B,EAAA,MAAM,iBAAA,GAAoB,aAAA,CAAc,UAAA,EAAY,OAAA,KAAY,IAAA;AAGhE,EAAA,MAAM,yBAAA,GAA4B,EAAE,MAAA,EAAQ,IAAA,EAAM,QAAQ,IAAA,EAAK;AAE/D,EAAA,IAAA,CAAK,IAAA,CAAK,gBAAgB,MAAM;AAC9B,IAAA,IAAI,iBAAA,IAAqB,CAAC,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAC,IAAA,CAAK,SAAS,QAAA,EAAU;AAOrE,MAAA,MAAM,yBAAA,GAA4B,2BAAA,CAA4B,IAAA,EAAM,aAAa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,YAAY,CAAA,oFAAA;AAAA,KAC9D;AAAA,EACF;AACF;AAEA,SAAS,+BAAA,CAAgC,YAAoB,OAAA,EAAoC;AAC/F,EAAA,IAAI,OAAA,EAAS;AAEX,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,mFAAA,EAAsF,UAAU,CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,KAC1X;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,UAAU,CAAA,2CAAA,CAA6C,CAAA;AAAA,EAC3G;AACF;AAEA,SAAS,yBAAA,CAA0B,YAAoB,YAAA,EAA4B;AAEjF,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,mEAAA,EAAsE,UAAU,CAAA,EAAA,EAAK,YAAY,CAAA,GAAA,CAAK,CAAA;AACpH;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';\nimport { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\nimport { warnOnRemovedBuildOptions } from '@sentry/core';\nimport type { NitroConfig } from 'nitropack';\nimport type { Plugin } from 'vite';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { deleteSourceMapsAfterBuild, withoutSourceMapDeletion } from './sourceMapDeletion';\nimport { validateSourceMapsOptionsPlugin } from './sentryVitePlugin';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(\n moduleOptions: SentryNuxtModuleOptions,\n nuxt: Nuxt,\n addVitePlugin: (plugin: Plugin[], options?: { dev?: boolean; build?: boolean }) => void,\n): void {\n // Warn here rather than in `getPluginOptions`, which runs once per bundler (Vite and Nitro's\n // Rollup) and would emit the same warning twice.\n warnOnRemovedBuildOptions(moduleOptions, ['unstable_sentryBundlerPluginOptions']);\n\n const isDebug = moduleOptions.debug;\n\n const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;\n\n // In case we overwrite the source map settings, we default to deleting the files\n const shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will overwrite with 'hidden', if needed.\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n // Mutate in place so the Vite plugin (which captured this object at registration time) sees the updated values\n shouldDeleteFilesFallback.client = previousSourceMapSettings.client === 'unset';\n shouldDeleteFilesFallback.server = previousSourceMapSettings.server === 'unset';\n\n if (isDebug && (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)) {\n const enabledDeleteFallbacks =\n shouldDeleteFilesFallback.client && shouldDeleteFilesFallback.server\n ? 'client-side and server-side'\n : shouldDeleteFilesFallback.server\n ? 'server-side'\n : 'client-side';\n\n if (!moduleOptions.sourcemaps?.filesToDeleteAfterUpload) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be automatically deleted after uploading them to Sentry.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be deleted according to your \\`sourcemaps.filesToDeleteAfterUpload\\` configuration. To use automatic deletion instead, leave \\`filesToDeleteAfterUpload\\` empty.`,\n );\n }\n }\n }\n });\n\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n addVitePlugin(\n [\n validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),\n // Vite plugin is added on the client and server side (plugin runs for both builds)\n ...sentryVitePlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))),\n ],\n { dev: false, build: true }, // Only add source map plugin during build\n );\n }\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {\n nitroConfig.rollupConfig ??= {};\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))),\n );\n }\n });\n\n nuxt.hook('close', async () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n await deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));\n }\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 * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourcemapsOptions = moduleOptions.sourcemaps || {};\n const filesToDeleteAfterUpload = resolveFilesToDeleteAfterUpload(moduleOptions, shouldDeleteFilesFallback);\n\n return {\n applicationKey: moduleOptions.applicationKey,\n org: moduleOptions.org ?? process.env.SENTRY_ORG,\n project: moduleOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: moduleOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: moduleOptions.telemetry ?? true,\n url: moduleOptions.sentryUrl ?? process.env.SENTRY_URL,\n headers: moduleOptions.headers,\n debug: moduleOptions.debug ?? false,\n silent: moduleOptions.silent ?? false,\n errorHandler: moduleOptions.errorHandler,\n bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user\n release: {\n name: moduleOptions.release?.name,\n // Support all release options from BuildTimeOptionsBase\n ...moduleOptions.release,\n },\n moduleMetadata: moduleOptions.moduleMetadata,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n\n sourcemaps: {\n disable: moduleOptions.sourcemaps?.disable,\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourcemapsOptions.assets ?? undefined,\n ignore: sourcemapsOptions.ignore ?? undefined,\n filesToDeleteAfterUpload,\n rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,\n resolveSourceMap: sourcemapsOptions.resolveSourceMap,\n },\n };\n}\n\n/**\n * Determines which files to delete after upload. If the user set `filesToDeleteAfterUpload`, we use\n * that. Otherwise we only delete the source maps Sentry generated itself — i.e. the sides\n * (client/server) whose `sourcemap` setting resolved to `undefined`, where Sentry stepped in and\n * enabled `'hidden'`. Given Nuxt's default of `{ server: true, client: false }`, this isn't the\n * default case: it only kicks in when a side is left `undefined` (whole config or a single sub-key).\n * @see https://nuxt.com/docs/4.x/api/nuxt-config#sourcemap\n */\nfunction resolveFilesToDeleteAfterUpload(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): string | Array<string> | undefined {\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n const filesToDeleteAfterUpload = moduleOptions.sourcemaps?.filesToDeleteAfterUpload;\n\n if (typeof filesToDeleteAfterUpload === 'undefined' && shouldDeleteFilesAfterUpload && moduleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return filesToDeleteAfterUpload\n ? filesToDeleteAfterUpload\n : shouldDeleteFilesAfterUpload\n ? fallbackFilesToDelete\n : undefined;\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n const isDebug = sentryModuleOptions.debug;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap', isDebug);\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client', isDebug);\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server', isDebug);\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n }\n}\n\n/**\n * Validates that source map settings are consistent between Nuxt and Vite/Nitro configurations.\n * Logs a warning if conflicting settings are detected.\n *\n * @internal Only exported for testing.\n */\nexport function validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string, isDebug: boolean | undefined): void {\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your Vite configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(`[Sentry] Source map generation (\\`${settingKey}\\`) is disabled in your Vite configuration.`);\n }\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n}\n"],"names":["warnOnRemovedBuildOptions","validateSourceMapsOptionsPlugin","sentryVitePlugin","withoutSourceMapDeletion","sentryRollupPlugin","deleteSourceMapsAfterBuild"],"mappings":";;;;;;;;AAqBO,SAAS,eAAA,CACd,aAAA,EACA,IAAA,EACA,aAAA,EACM;AAGN,EAAAA,8BAAA,CAA0B,aAAA,EAAe,CAAC,qCAAqC,CAAC,CAAA;AAEhF,EAAA,MAAM,UAAU,aAAA,CAAc,KAAA;AAE9B,EAAA,MAAM,iBAAA,GAAoB,aAAA,CAAc,UAAA,EAAY,OAAA,KAAY,IAAA;AAGhE,EAAA,MAAM,yBAAA,GAA4B,EAAE,MAAA,EAAQ,IAAA,EAAM,QAAQ,IAAA,EAAK;AAE/D,EAAA,IAAA,CAAK,IAAA,CAAK,gBAAgB,MAAM;AAC9B,IAAA,IAAI,iBAAA,IAAqB,CAAC,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAC,IAAA,CAAK,SAAS,QAAA,EAAU;AAOrE,MAAA,MAAM,yBAAA,GAA4B,2BAAA,CAA4B,IAAA,EAAM,aAAa,CAAA;AAGjF,MAAA,yB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,iBAAiB,CAAA,+OAAA;AAAA,KAC5M;AAAA,EACF;AACF;AAEA,SAAS,8BAAA,CACP,uBAAA,EACA,UAAA,EACA,YAAA,EACM;AACN,EAAA,IAAI,wBAAwB,KAAA,EAAO;AAEjC,IAAA,OAAA,CAAQ,GAAA;AAAA,MACN,CAAA,WAAA,EAAc,UAAU,CAAA,qBAAA,EAAwB,YAAY,CAAA,oFAAA;AAAA,KAC9D;AAAA,EACF;AACF;AAEA,SAAS,+BAAA,CAAgC,YAAoB,OAAA,EAAoC;AAC/F,EAAA,IAAI,OAAA,EAAS;AAEX,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,mFAAA,EAAsF,UAAU,CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,KAC1X;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,UAAU,CAAA,2CAAA,CAA6C,CAAA;AAAA,EAC3G;AACF;AAEA,SAAS,yBAAA,CAA0B,YAAoB,YAAA,EAA4B;AAEjF,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,mEAAA,EAAsE,UAAU,CAAA,EAAA,EAAK,YAAY,CAAA,GAAA,CAAK,CAAA;AACpH;;;;;;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.0.0-alpha.
|
|
1
|
+
{"type":"module","version":"11.0.0-alpha.2"}
|
package/build/esm/server/sdk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
|
-
import { applySdkMetadata, getGlobalScope,
|
|
3
|
-
import { init as init$1
|
|
2
|
+
import { applySdkMetadata, getGlobalScope, debug, DEV_ENVIRONMENT, DEFAULT_ENVIRONMENT } from '@sentry/core';
|
|
3
|
+
import { init as init$1 } from '@sentry/node';
|
|
4
4
|
import { DEBUG_BUILD } from '../common/debug-build.js';
|
|
5
5
|
|
|
6
6
|
function init(options) {
|
|
@@ -8,7 +8,6 @@ function init(options) {
|
|
|
8
8
|
envFallback = import.meta.dev ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT;
|
|
9
9
|
const sentryOptions = {
|
|
10
10
|
environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,
|
|
11
|
-
defaultIntegrations: getNuxtDefaultIntegrations(options),
|
|
12
11
|
...options
|
|
13
12
|
};
|
|
14
13
|
applySdkMetadata(sentryOptions, "nuxt", ["nuxt", "node"]);
|
|
@@ -49,28 +48,6 @@ function clientSourceMapErrorFilter(options) {
|
|
|
49
48
|
{ id: "NuxtClientSourceMapErrorFilter" }
|
|
50
49
|
);
|
|
51
50
|
}
|
|
52
|
-
function getNuxtDefaultIntegrations(options) {
|
|
53
|
-
return [
|
|
54
|
-
...getDefaultIntegrations(options).filter((integration) => integration.name !== "Http"),
|
|
55
|
-
// The httpIntegration is added as defaultIntegration, so users can still overwrite it
|
|
56
|
-
httpIntegration({
|
|
57
|
-
instrumentation: {
|
|
58
|
-
responseHook: () => {
|
|
59
|
-
vercelWaitUntil(flushSafelyWithTimeout());
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
];
|
|
64
|
-
}
|
|
65
|
-
async function flushSafelyWithTimeout() {
|
|
66
|
-
try {
|
|
67
|
-
DEBUG_BUILD && debug.log("Flushing events...");
|
|
68
|
-
await flush(2e3);
|
|
69
|
-
DEBUG_BUILD && debug.log("Done flushing events");
|
|
70
|
-
} catch (e) {
|
|
71
|
-
DEBUG_BUILD && debug.log("Error while flushing events:\n", e);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
51
|
function isCacheEvent(e) {
|
|
75
52
|
return e.contexts?.trace?.origin === "auto.cache.nuxt";
|
|
76
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../../../src/server/sdk.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { Client, Event, EventProcessor } from '@sentry/core';\nimport { applySdkMetadata, debug, DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT, getGlobalScope } from '@sentry/core';\nimport { init as initNode } from '@sentry/node';\nimport { DEBUG_BUILD } from '../common/debug-build';\nimport type { SentryNuxtServerOptions } from '../common/types';\n\n/**\n * Initializes the server-side of the Nuxt SDK\n *\n * @param options Configuration options for the SDK.\n */\nexport function init(options: SentryNuxtServerOptions): Client | undefined {\n let envFallback: string;\n /*! rollup-include-cjs-only */\n envFallback = DEFAULT_ENVIRONMENT;\n /*! rollup-include-cjs-only-end */\n\n /*! rollup-include-esm-only */\n envFallback = import.meta.dev ? DEV_ENVIRONMENT : DEFAULT_ENVIRONMENT;\n /*! rollup-include-esm-only-end */\n\n const sentryOptions = {\n environment: options.environment ?? process.env.SENTRY_ENVIRONMENT ?? envFallback,\n ...options,\n };\n\n applySdkMetadata(sentryOptions, 'nuxt', ['nuxt', 'node']);\n\n const client = initNode(sentryOptions);\n\n getGlobalScope().addEventProcessor(lowQualityTransactionsFilter(options));\n getGlobalScope().addEventProcessor(clientSourceMapErrorFilter(options));\n\n return client;\n}\n\n/**\n * Filter out transactions for resource requests which we don't want to send to Sentry\n * for quota reasons.\n *\n * Only exported for testing\n */\nexport function lowQualityTransactionsFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n if (event.type !== 'transaction' || !event.transaction || isCacheEvent(event)) {\n return event;\n }\n\n // Check if this looks like a parametrized route (contains :param or :param() patterns)\n const hasRouteParameters = /\\/:[^(/\\s]*(\\([^)]*\\))?[^/\\s]*/.test(event.transaction);\n\n if (hasRouteParameters) {\n return event;\n }\n\n // We don't want to send transaction for file requests, so everything ending with a *.someExtension should be filtered out\n // path.extname will return an empty string for normal page requests\n if (path.extname(event.transaction)) {\n options.debug &&\n DEBUG_BUILD &&\n debug.log('NuxtLowQualityTransactionsFilter filtered transaction: ', event.transaction);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtLowQualityTransactionsFilter' },\n );\n}\n\n/**\n * The browser devtools try to get the source maps, but as client source maps may not be available there is going to be an error (no problem for the application though).\n *\n * Only exported for testing\n */\nexport function clientSourceMapErrorFilter(options: SentryNuxtServerOptions): EventProcessor {\n return Object.assign(\n (event => {\n const errorMsg = event.exception?.values?.[0]?.value;\n if (errorMsg?.match(/^ENOENT: no such file or directory, open '.*\\/_nuxt\\/.*\\.js\\.map'/)) {\n options.debug && DEBUG_BUILD && debug.log('NuxtClientSourceMapErrorFilter filtered error: ', errorMsg);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'NuxtClientSourceMapErrorFilter' },\n );\n}\n\n/**\n * Checks if the event is a cache event.\n */\nfunction isCacheEvent(e: Event): boolean {\n return e.contexts?.trace?.origin === 'auto.cache.nuxt';\n}\n"],"names":["initNode"],"mappings":";;;;;AAYO,SAAS,KAAK,OAAA,EAAsD;AACzE,EAAA,IAAI,WAAA;AAAA,EACJ,WAAA,GAAA,MAAA,CAAA,IAAA,CAAA,GAAA,GAAA,eAAA,GAAA,mBAAA;AACA,EAAA,MAAA,aAAc,GAAA;AAAA,IACd,WAAA,EAAA,OAAA,CAAA,WAAA,IAAA,OAAA,CAAA,GAAA,CAAA,kBAAA,IAAA,WAAA;AAAA,IAEA,GAAA;AACA,GAAA;AAAkD,EAClD,gBAAA,CAAA,aAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;AAEA,EAAA,MAAM,MAAA,GAAAA,MAAgB,CAAA,aAAA,CAAA;AAAA,EAAA,cACpB,EAAa,CAAA,iBAAQ,CAAA,4BAA2B,CAAA,OAAA,CAAsB,CAAA;AAAA,EAAA,cACnE,EAAA,CAAA,iBAAA,CAAA,0BAAA,CAAA,OAAA,CAAA,CAAA;AAAA,EACL,OAAA,MA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CAAA,QAAA,EAAA,KAAA,EAAA,MAAA,KAAA,iBAAA;AAAA;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';
|
|
2
|
+
|
|
3
|
+
function withoutSourceMapDeletion(options) {
|
|
4
|
+
return {
|
|
5
|
+
...options,
|
|
6
|
+
sourcemaps: {
|
|
7
|
+
...options.sourcemaps,
|
|
8
|
+
filesToDeleteAfterUpload: void 0
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
async function deleteSourceMapsAfterBuild(options) {
|
|
13
|
+
const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;
|
|
14
|
+
if (filesToDeleteAfterUpload === void 0) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const deletionOptions = {
|
|
18
|
+
...options,
|
|
19
|
+
sourcemaps: {
|
|
20
|
+
...options.sourcemaps,
|
|
21
|
+
filesToDeleteAfterUpload
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const sentryBuildPluginManager = createSentryBuildPluginManager(deletionOptions, {
|
|
25
|
+
buildTool: "nuxt",
|
|
26
|
+
loggerPrefix: "[Sentry Nuxt]"
|
|
27
|
+
});
|
|
28
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { deleteSourceMapsAfterBuild, withoutSourceMapDeletion };
|
|
32
|
+
//# sourceMappingURL=sourceMapDeletion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMapDeletion.js","sources":["../../../src/vite/sourceMapDeletion.ts"],"sourcesContent":["import { createSentryBuildPluginManager, type Options } from '@sentry/bundler-plugins/core';\n\nexport function withoutSourceMapDeletion(options: Options): Options {\n return {\n ...options,\n sourcemaps: {\n ...options.sourcemaps,\n filesToDeleteAfterUpload: undefined,\n },\n };\n}\n\nexport async function deleteSourceMapsAfterBuild(options: Options): Promise<void> {\n const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;\n\n if (filesToDeleteAfterUpload === undefined) {\n return;\n }\n\n const deletionOptions: Options = {\n ...options,\n sourcemaps: {\n ...options.sourcemaps,\n filesToDeleteAfterUpload,\n },\n };\n\n const sentryBuildPluginManager = createSentryBuildPluginManager(deletionOptions, {\n buildTool: 'nuxt',\n loggerPrefix: '[Sentry Nuxt]',\n });\n\n await sentryBuildPluginManager.deleteArtifacts();\n}\n"],"names":[],"mappings":";;AAEO,SAAS,yBAAyB,OAAA,EAA2B;AAClE,EAAA,OAAO;AAAA,IACL,GAAG,OAAA;AAAA,IACH,UAAA,EAAY;AAAA,MACV,GAAG,OAAA,CAAQ,UAAA;AAAA,MACX,wBAAA,EAA0B;AAAA;AAC5B,GACF;AACF;AAEA,eAAsB,2BAA2B,OAAA,EAAiC;AAChF,EAAA,MAAM,wBAAA,GAA2B,MAAM,OAAA,CAAQ,UAAA,EAAY,wBAAA;AAE3D,EAAA,IAAI,6BAA6B,MAAA,EAAW;AAC1C,IAAA;AAAA,EACF;AAEA,EAAA,MAAM,eAAA,GAA2B;AAAA,IAC/B,GAAG,OAAA;AAAA,IACH,UAAA,EAAY;AAAA,MACV,GAAG,OAAA,CAAQ,UAAA;AAAA,MACX;AAAA;AACF,GACF;AAEA,EAAA,MAAM,wBAAA,GAA2B,+BAA+B,eAAA,EAAiB;AAAA,IAC/E,SAAA,EAAW,MAAA;AAAA,IACX,YAAA,EAAc;AAAA,GACf,CAAA;AAED,EAAA,MAAM,yBAAyB,eAAA,EAAgB;AACjD;;;;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { sentryRollupPlugin } from '@sentry/bundler-plugins/rollup';
|
|
2
2
|
import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
|
|
3
|
+
import { warnOnRemovedBuildOptions } from '@sentry/core';
|
|
4
|
+
import { withoutSourceMapDeletion, deleteSourceMapsAfterBuild } from './sourceMapDeletion.js';
|
|
3
5
|
import { validateSourceMapsOptionsPlugin } from './sentryVitePlugin.js';
|
|
4
6
|
|
|
5
7
|
function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
8
|
+
warnOnRemovedBuildOptions(moduleOptions, ["unstable_sentryBundlerPluginOptions"]);
|
|
6
9
|
const isDebug = moduleOptions.debug;
|
|
7
10
|
const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;
|
|
8
11
|
const shouldDeleteFilesFallback = { client: true, server: true };
|
|
@@ -30,7 +33,7 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
30
33
|
[
|
|
31
34
|
validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),
|
|
32
35
|
// Vite plugin is added on the client and server side (plugin runs for both builds)
|
|
33
|
-
...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
36
|
+
...sentryVitePlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
34
37
|
],
|
|
35
38
|
{ dev: false, build: true }
|
|
36
39
|
// Only add source map plugin during build
|
|
@@ -49,10 +52,15 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
49
52
|
console.log("[Sentry] Adding Sentry Rollup plugin to the server runtime.");
|
|
50
53
|
}
|
|
51
54
|
nitroConfig.rollupConfig.plugins.push(
|
|
52
|
-
sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
55
|
+
sentryRollupPlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
53
56
|
);
|
|
54
57
|
}
|
|
55
58
|
});
|
|
59
|
+
nuxt.hook("close", async () => {
|
|
60
|
+
if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {
|
|
61
|
+
await deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));
|
|
62
|
+
}
|
|
63
|
+
});
|
|
56
64
|
}
|
|
57
65
|
function normalizePath(path) {
|
|
58
66
|
return path.replace(/^(\.\.\/)+/, "./");
|
|
@@ -76,15 +84,14 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
76
84
|
release: {
|
|
77
85
|
name: moduleOptions.release?.name,
|
|
78
86
|
// Support all release options from BuildTimeOptionsBase
|
|
79
|
-
...moduleOptions.release
|
|
80
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions?.release
|
|
87
|
+
...moduleOptions.release
|
|
81
88
|
},
|
|
89
|
+
moduleMetadata: moduleOptions.moduleMetadata,
|
|
82
90
|
_metaOptions: {
|
|
83
91
|
telemetry: {
|
|
84
92
|
metaFramework: "nuxt"
|
|
85
93
|
}
|
|
86
94
|
},
|
|
87
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions,
|
|
88
95
|
sourcemaps: {
|
|
89
96
|
disable: moduleOptions.sourcemaps?.disable,
|
|
90
97
|
// The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')
|
|
@@ -94,7 +101,7 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
94
101
|
ignore: sourcemapsOptions.ignore ?? void 0,
|
|
95
102
|
filesToDeleteAfterUpload,
|
|
96
103
|
rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,
|
|
97
|
-
|
|
104
|
+
resolveSourceMap: sourcemapsOptions.resolveSourceMap
|
|
98
105
|
}
|
|
99
106
|
};
|
|
100
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';\nimport { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\nimport type { NitroConfig } from 'nitropack';\nimport type { Plugin } from 'vite';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { validateSourceMapsOptionsPlugin } from './sentryVitePlugin';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(\n moduleOptions: SentryNuxtModuleOptions,\n nuxt: Nuxt,\n addVitePlugin: (plugin: Plugin[], options?: { dev?: boolean; build?: boolean }) => void,\n): void {\n const isDebug = moduleOptions.debug;\n\n const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;\n\n // In case we overwrite the source map settings, we default to deleting the files\n const shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will overwrite with 'hidden', if needed.\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n // Mutate in place so the Vite plugin (which captured this object at registration time) sees the updated values\n shouldDeleteFilesFallback.client = previousSourceMapSettings.client === 'unset';\n shouldDeleteFilesFallback.server = previousSourceMapSettings.server === 'unset';\n\n if (isDebug && (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)) {\n const enabledDeleteFallbacks =\n shouldDeleteFilesFallback.client && shouldDeleteFilesFallback.server\n ? 'client-side and server-side'\n : shouldDeleteFilesFallback.server\n ? 'server-side'\n : 'client-side';\n\n if (!moduleOptions.sourcemaps?.filesToDeleteAfterUpload) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be automatically deleted after uploading them to Sentry.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be deleted according to your \\`sourcemaps.filesToDeleteAfterUpload\\` configuration. To use automatic deletion instead, leave \\`filesToDeleteAfterUpload\\` empty.`,\n );\n }\n }\n }\n });\n\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n addVitePlugin(\n [\n validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),\n // Vite plugin is added on the client and server side (plugin runs for both builds)\n ...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n ],\n { dev: false, build: true }, // Only add source map plugin during build\n );\n }\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {\n nitroConfig.rollupConfig ??= {};\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)),\n );\n }\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 * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourcemapsOptions = moduleOptions.sourcemaps || {};\n const filesToDeleteAfterUpload = resolveFilesToDeleteAfterUpload(moduleOptions, shouldDeleteFilesFallback);\n\n return {\n applicationKey: moduleOptions.applicationKey,\n org: moduleOptions.org ?? process.env.SENTRY_ORG,\n project: moduleOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: moduleOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: moduleOptions.telemetry ?? true,\n url: moduleOptions.sentryUrl ?? process.env.SENTRY_URL,\n headers: moduleOptions.headers,\n debug: moduleOptions.debug ?? false,\n silent: moduleOptions.silent ?? false,\n errorHandler: moduleOptions.errorHandler,\n bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user\n release: {\n name: moduleOptions.release?.name,\n // Support all release options from BuildTimeOptionsBase\n ...moduleOptions.release,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.release,\n },\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n ...moduleOptions?.unstable_sentryBundlerPluginOptions,\n\n sourcemaps: {\n disable: moduleOptions.sourcemaps?.disable,\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourcemapsOptions.assets ?? undefined,\n ignore: sourcemapsOptions.ignore ?? undefined,\n filesToDeleteAfterUpload,\n rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,\n ...moduleOptions?.unstable_sentryBundlerPluginOptions?.sourcemaps,\n },\n };\n}\n\n/**\n * Determines which files to delete after upload. If the user set `filesToDeleteAfterUpload`, we use\n * that. Otherwise we only delete the source maps Sentry generated itself — i.e. the sides\n * (client/server) whose `sourcemap` setting resolved to `undefined`, where Sentry stepped in and\n * enabled `'hidden'`. Given Nuxt's default of `{ server: true, client: false }`, this isn't the\n * default case: it only kicks in when a side is left `undefined` (whole config or a single sub-key).\n * @see https://nuxt.com/docs/4.x/api/nuxt-config#sourcemap\n */\nfunction resolveFilesToDeleteAfterUpload(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): string | Array<string> | undefined {\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n const filesToDeleteAfterUpload = moduleOptions.sourcemaps?.filesToDeleteAfterUpload;\n\n if (typeof filesToDeleteAfterUpload === 'undefined' && shouldDeleteFilesAfterUpload && moduleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return filesToDeleteAfterUpload\n ? filesToDeleteAfterUpload\n : shouldDeleteFilesAfterUpload\n ? fallbackFilesToDelete\n : undefined;\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n const isDebug = sentryModuleOptions.debug;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap', isDebug);\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client', isDebug);\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server', isDebug);\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n }\n}\n\n/**\n * Validates that source map settings are consistent between Nuxt and Vite/Nitro configurations.\n * Logs a warning if conflicting settings are detected.\n *\n * @internal Only exported for testing.\n */\nexport function validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string, isDebug: boolean | undefined): void {\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your Vite configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(`[Sentry] Source map generation (\\`${settingKey}\\`) is disabled in your Vite configuration.`);\n }\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n}\n"],"names":[],"mappings":";;;;AAmBO,SAAS,eAAA,CACd,aAAA,EACA,IAAA,EACA,aAAA,EACM;AACN,EAAA,MAAM,UAAU,aAAA,CAAc,KAAA;AAE9B,EAAA,MAAM,iBAAA,GAAoB,aAAA,CAAc,UAAA,EAAY,OAAA,KAAY,IAAA;AAGhE,EAAA,MAAM,yBAAA,GAA4B,EAAE,MAAA,EAAQ,IAAA,EAAM,QAAQ,IAAA,EAAK;AAE/D,EAAA,IAAA,CAAK,IAAA,CAAK,gBAAgB,MAAM;AAC9B,IAAA,IAAI,iBAAA,IAAqB,CAAC,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAC,IAAA,CAAK,SAAS,QAAA,EAAU;AAOrE,MAAA,MAAM,yBAAA,GAA4B,2BAAA,CAA4B,IAAA,EAAM,aAAa,CAAA;AAGjF,MAAA,yBAAA,CAA0B,MAAA,GAAS,0BAA0B,MAAA,KAAW,OAAA;AACxE,MAAA,yBAAA,C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AC/F,EAAA,IAAI,OAAA,EAAS;AAEX,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,mFAAA,EAAsF,UAAU,CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,KAC1X;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,UAAU,CAAA,2CAAA,CAA6C,CAAA;AAAA,EAC3G;AACF;AAEA,SAAS,yBAAA,CAA0B,YAAoB,YAAA,EAA4B;AAEjF,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,mEAAA,EAAsE,UAAU,CAAA,EAAA,EAAK,YAAY,CAAA,GAAA,CAAK,CAAA;AACpH;;;;"}
|
|
1
|
+
{"version":3,"file":"sourceMaps.js","sources":["../../../src/vite/sourceMaps.ts"],"sourcesContent":["import type { Nuxt } from '@nuxt/schema';\nimport { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';\nimport { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';\nimport { warnOnRemovedBuildOptions } from '@sentry/core';\nimport type { NitroConfig } from 'nitropack';\nimport type { Plugin } from 'vite';\nimport type { SentryNuxtModuleOptions } from '../common/types';\nimport { deleteSourceMapsAfterBuild, withoutSourceMapDeletion } from './sourceMapDeletion';\nimport { validateSourceMapsOptionsPlugin } from './sentryVitePlugin';\n\n/**\n * Whether the user enabled (true, 'hidden', 'inline') or disabled (false) source maps\n */\nexport type UserSourceMapSetting = 'enabled' | 'disabled' | 'unset' | undefined;\n\n/** A valid source map setting */\nexport type SourceMapSetting = boolean | 'hidden' | 'inline';\n\n/**\n * Setup source maps for Sentry inside the Nuxt module during build time (in Vite for Nuxt and Rollup for Nitro).\n */\nexport function setupSourceMaps(\n moduleOptions: SentryNuxtModuleOptions,\n nuxt: Nuxt,\n addVitePlugin: (plugin: Plugin[], options?: { dev?: boolean; build?: boolean }) => void,\n): void {\n // Warn here rather than in `getPluginOptions`, which runs once per bundler (Vite and Nitro's\n // Rollup) and would emit the same warning twice.\n warnOnRemovedBuildOptions(moduleOptions, ['unstable_sentryBundlerPluginOptions']);\n\n const isDebug = moduleOptions.debug;\n\n const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;\n\n // In case we overwrite the source map settings, we default to deleting the files\n const shouldDeleteFilesFallback = { client: true, server: true };\n\n nuxt.hook('modules:done', () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n // Changing this setting will propagate:\n // - for client to viteConfig.build.sourceMap\n // - for server to viteConfig.build.sourceMap and nitro.sourceMap\n // On server, nitro.rollupConfig.output.sourcemap remains unaffected from this change.\n\n // ONLY THIS nuxt.sourcemap.(server/client) setting is the one Sentry will overwrite with 'hidden', if needed.\n const previousSourceMapSettings = changeNuxtSourceMapSettings(nuxt, moduleOptions);\n\n // Mutate in place so the Vite plugin (which captured this object at registration time) sees the updated values\n shouldDeleteFilesFallback.client = previousSourceMapSettings.client === 'unset';\n shouldDeleteFilesFallback.server = previousSourceMapSettings.server === 'unset';\n\n if (isDebug && (shouldDeleteFilesFallback.client || shouldDeleteFilesFallback.server)) {\n const enabledDeleteFallbacks =\n shouldDeleteFilesFallback.client && shouldDeleteFilesFallback.server\n ? 'client-side and server-side'\n : shouldDeleteFilesFallback.server\n ? 'server-side'\n : 'client-side';\n\n if (!moduleOptions.sourcemaps?.filesToDeleteAfterUpload) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be automatically deleted after uploading them to Sentry.`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] We enabled \\`'hidden'\\` source maps for your ${enabledDeleteFallbacks} build. Source map files will be deleted according to your \\`sourcemaps.filesToDeleteAfterUpload\\` configuration. To use automatic deletion instead, leave \\`filesToDeleteAfterUpload\\` empty.`,\n );\n }\n }\n }\n });\n\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n addVitePlugin(\n [\n validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),\n // Vite plugin is added on the client and server side (plugin runs for both builds)\n ...sentryVitePlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))),\n ],\n { dev: false, build: true }, // Only add source map plugin during build\n );\n }\n\n nuxt.hook('nitro:config', (nitroConfig: NitroConfig) => {\n if (sourceMapsEnabled && !nitroConfig.dev && !nuxt.options?._prepare) {\n nitroConfig.rollupConfig ??= {};\n\n if (nitroConfig.rollupConfig.plugins === null || nitroConfig.rollupConfig.plugins === undefined) {\n nitroConfig.rollupConfig.plugins = [];\n } else if (!Array.isArray(nitroConfig.rollupConfig.plugins)) {\n // `rollupConfig.plugins` can be a single plugin, so we want to put it into an array so that we can push our own plugin\n nitroConfig.rollupConfig.plugins = [nitroConfig.rollupConfig.plugins];\n }\n\n validateNitroSourceMapSettings(nuxt, nitroConfig, moduleOptions);\n\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log('[Sentry] Adding Sentry Rollup plugin to the server runtime.');\n }\n\n // Add Sentry plugin\n // Runs only on server-side (Nitro)\n nitroConfig.rollupConfig.plugins.push(\n sentryRollupPlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))),\n );\n }\n });\n\n nuxt.hook('close', async () => {\n if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {\n await deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));\n }\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 * Generates source maps upload options for the Sentry Vite and Rollup plugin.\n *\n * Only exported for Testing purposes.\n */\nexport function getPluginOptions(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): SentryVitePluginOptions | SentryRollupPluginOptions {\n const sourcemapsOptions = moduleOptions.sourcemaps || {};\n const filesToDeleteAfterUpload = resolveFilesToDeleteAfterUpload(moduleOptions, shouldDeleteFilesFallback);\n\n return {\n applicationKey: moduleOptions.applicationKey,\n org: moduleOptions.org ?? process.env.SENTRY_ORG,\n project: moduleOptions.project ?? process.env.SENTRY_PROJECT,\n authToken: moduleOptions.authToken ?? process.env.SENTRY_AUTH_TOKEN,\n telemetry: moduleOptions.telemetry ?? true,\n url: moduleOptions.sentryUrl ?? process.env.SENTRY_URL,\n headers: moduleOptions.headers,\n debug: moduleOptions.debug ?? false,\n silent: moduleOptions.silent ?? false,\n errorHandler: moduleOptions.errorHandler,\n bundleSizeOptimizations: moduleOptions.bundleSizeOptimizations, // todo: test if this can be overridden by the user\n release: {\n name: moduleOptions.release?.name,\n // Support all release options from BuildTimeOptionsBase\n ...moduleOptions.release,\n },\n moduleMetadata: moduleOptions.moduleMetadata,\n _metaOptions: {\n telemetry: {\n metaFramework: 'nuxt',\n },\n },\n\n sourcemaps: {\n disable: moduleOptions.sourcemaps?.disable,\n // The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')\n // We cannot determine automatically how the build folder looks like (depends on the preset), so we have to accept that source maps are uploaded multiple times (with the vitePlugin for Nuxt and the rollupPlugin for Nitro).\n // If we could know where the server/client assets are located, we could do something like this (based on the Nitro preset): isNitro ? ['./.output/server/**/*'] : ['./.output/public/**/*'],\n assets: sourcemapsOptions.assets ?? undefined,\n ignore: sourcemapsOptions.ignore ?? undefined,\n filesToDeleteAfterUpload,\n rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,\n resolveSourceMap: sourcemapsOptions.resolveSourceMap,\n },\n };\n}\n\n/**\n * Determines which files to delete after upload. If the user set `filesToDeleteAfterUpload`, we use\n * that. Otherwise we only delete the source maps Sentry generated itself — i.e. the sides\n * (client/server) whose `sourcemap` setting resolved to `undefined`, where Sentry stepped in and\n * enabled `'hidden'`. Given Nuxt's default of `{ server: true, client: false }`, this isn't the\n * default case: it only kicks in when a side is left `undefined` (whole config or a single sub-key).\n * @see https://nuxt.com/docs/4.x/api/nuxt-config#sourcemap\n */\nfunction resolveFilesToDeleteAfterUpload(\n moduleOptions: SentryNuxtModuleOptions,\n shouldDeleteFilesFallback?: { client: boolean; server: boolean },\n): string | Array<string> | undefined {\n const shouldDeleteFilesAfterUpload = shouldDeleteFilesFallback?.client || shouldDeleteFilesFallback?.server;\n const fallbackFilesToDelete = [\n ...(shouldDeleteFilesFallback?.client ? ['.*/**/public/**/*.map'] : []),\n ...(shouldDeleteFilesFallback?.server\n ? ['.*/**/server/**/*.map', '.*/**/output/**/*.map', '.*/**/function/**/*.map']\n : []),\n ];\n\n const filesToDeleteAfterUpload = moduleOptions.sourcemaps?.filesToDeleteAfterUpload;\n\n if (typeof filesToDeleteAfterUpload === 'undefined' && shouldDeleteFilesAfterUpload && moduleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] Setting \\`sentry.sourcemaps.filesToDeleteAfterUpload: [${fallbackFilesToDelete\n // Logging it as strings in the array\n .map(path => `\"${path}\"`)\n .join(', ')}]\\` to delete generated source maps after they were uploaded to Sentry.`,\n );\n }\n\n return filesToDeleteAfterUpload\n ? filesToDeleteAfterUpload\n : shouldDeleteFilesAfterUpload\n ? fallbackFilesToDelete\n : undefined;\n}\n\n/* There are multiple ways to set up source maps (https://github.com/getsentry/sentry-javascript/issues/13993 and https://github.com/getsentry/sentry-javascript/pull/15859)\n 1. User explicitly disabled source maps\n - keep this setting (emit a warning that errors won't be unminified in Sentry)\n - We will not upload anything\n 2. users enabled source map generation (true, hidden, inline).\n - keep this setting (don't do anything - like deletion - besides uploading)\n 3. users did not set source maps generation\n - we enable 'hidden' source maps generation\n - configure `filesToDeleteAfterUpload` to delete all .map files (we emit a log about this)\n\n Users only have to explicitly enable client source maps. Sentry only overwrites the base Nuxt source map settings as they propagate.\n */\n\n/** only exported for tests */\nexport function extractNuxtSourceMapSetting(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting; client?: SourceMapSetting } } },\n runtime: 'client' | 'server' | undefined,\n): SourceMapSetting | undefined {\n if (!runtime) {\n return undefined;\n } else {\n return typeof nuxt.options?.sourcemap === 'boolean' || typeof nuxt.options?.sourcemap === 'string'\n ? nuxt.options.sourcemap\n : nuxt.options?.sourcemap?.[runtime];\n }\n}\n\n/** only exported for testing */\nexport function changeNuxtSourceMapSettings(\n nuxt: Nuxt,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): { client: UserSourceMapSetting; server: UserSourceMapSetting } {\n nuxt.options.sourcemap = nuxt.options.sourcemap ?? { server: undefined, client: undefined };\n\n let previousUserSourceMapSetting: { client: UserSourceMapSetting; server: UserSourceMapSetting } = {\n client: undefined,\n server: undefined,\n };\n\n const nuxtSourceMap = nuxt.options.sourcemap;\n const isDebug = sentryModuleOptions.debug;\n\n if (typeof nuxtSourceMap === 'string' || typeof nuxtSourceMap === 'boolean' || typeof nuxtSourceMap === 'undefined') {\n switch (nuxtSourceMap) {\n case false:\n warnExplicitlyDisabledSourceMap('sourcemap', isDebug);\n previousUserSourceMapSetting = { client: 'disabled', server: 'disabled' };\n break;\n\n case 'hidden':\n case true:\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap', (nuxtSourceMap as true).toString());\n previousUserSourceMapSetting = { client: 'enabled', server: 'enabled' };\n break;\n case undefined:\n nuxt.options.sourcemap = { server: 'hidden', client: 'hidden' };\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting = { client: 'unset', server: 'unset' };\n break;\n }\n } else {\n if (nuxtSourceMap.client === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.client', isDebug);\n previousUserSourceMapSetting.client = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.client)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.client', nuxtSourceMap.client.toString());\n previousUserSourceMapSetting.client = 'enabled';\n } else {\n nuxt.options.sourcemap.client = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.client', 'hidden');\n previousUserSourceMapSetting.client = 'unset';\n }\n\n if (nuxtSourceMap.server === false) {\n warnExplicitlyDisabledSourceMap('sourcemap.server', isDebug);\n previousUserSourceMapSetting.server = 'disabled';\n } else if (['hidden', true].includes(nuxtSourceMap.server)) {\n logKeepEnabledSourceMapSetting(sentryModuleOptions, 'sourcemap.server', nuxtSourceMap.server.toString());\n previousUserSourceMapSetting.server = 'enabled';\n } else {\n nuxt.options.sourcemap.server = 'hidden';\n isDebug && logSentryEnablesSourceMap('sourcemap.server', 'hidden');\n previousUserSourceMapSetting.server = 'unset';\n }\n }\n\n return previousUserSourceMapSetting;\n}\n\n/** Logs warnings about potentially conflicting source map settings.\n * Configures `sourcemapExcludeSources` in Nitro to make source maps usable in Sentry.\n *\n * only exported for testing\n */\nexport function validateNitroSourceMapSettings(\n nuxt: { options: { sourcemap?: SourceMapSetting | { server?: SourceMapSetting } } },\n nitroConfig: NitroConfig,\n sentryModuleOptions: SentryNuxtModuleOptions,\n): void {\n const isDebug = sentryModuleOptions.debug;\n const nuxtSourceMap = extractNuxtSourceMapSetting(nuxt, 'server');\n\n // NITRO CONFIG ---\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: 'nitro.sourceMap',\n otherSettingValue: nitroConfig.sourceMap,\n });\n\n // ROLLUP CONFIG ---\n\n nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};\n nitroConfig.rollupConfig.output = nitroConfig.rollupConfig.output || { sourcemap: undefined };\n const nitroRollupSourceMap = nitroConfig.rollupConfig.output.sourcemap;\n\n // We don't override nitro.rollupConfig.output.sourcemap (undefined by default, but overrides all other server-side source map settings)\n if (typeof nitroRollupSourceMap !== 'undefined' && ['hidden', 'inline', true, false].includes(nitroRollupSourceMap)) {\n const settingKey = 'nitro.rollupConfig.output.sourcemap';\n\n validateDifferentSourceMapSettings({\n nuxtSettingKey: 'sourcemap.server',\n nuxtSettingValue: nuxtSourceMap,\n otherSettingKey: settingKey,\n otherSettingValue: nitroRollupSourceMap,\n });\n }\n\n nitroConfig.rollupConfig.output.sourcemapExcludeSources = false;\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.log(\n '[Sentry] Set `sourcemapExcludeSources: false` in the Nuxt config (`nitro.rollupConfig.output`). Source maps will now include the actual code to be able to un-minify code snippets in Sentry.',\n );\n }\n}\n\n/**\n * Validates that source map settings are consistent between Nuxt and Vite/Nitro configurations.\n * Logs a warning if conflicting settings are detected.\n *\n * @internal Only exported for testing.\n */\nexport function validateDifferentSourceMapSettings({\n nuxtSettingKey,\n nuxtSettingValue,\n otherSettingKey,\n otherSettingValue,\n}: {\n nuxtSettingKey: string;\n nuxtSettingValue?: SourceMapSetting;\n otherSettingKey: string;\n otherSettingValue?: SourceMapSetting;\n}): void {\n if (nuxtSettingValue !== otherSettingValue) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation settings are conflicting. Sentry uses \\`${nuxtSettingKey}: ${nuxtSettingValue}\\`. However, a conflicting setting was discovered (\\`${otherSettingKey}: ${otherSettingValue}\\`). This setting was probably explicitly set in your configuration. Sentry won't override this setting but it may affect source maps generation and upload. Without source maps, code snippets on the Sentry Issues page will remain minified.`,\n );\n }\n}\n\nfunction logKeepEnabledSourceMapSetting(\n sentryNuxtModuleOptions: SentryNuxtModuleOptions,\n settingKey: string,\n settingValue: string,\n): void {\n if (sentryNuxtModuleOptions.debug) {\n // eslint-disable-next-line no-console\n console.log(\n `[Sentry] \\`${settingKey}\\` is enabled with \\`${settingValue}\\`. This will correctly un-minify the code snippet on the Sentry Issue Details page.`,\n );\n }\n}\n\nfunction warnExplicitlyDisabledSourceMap(settingKey: string, isDebug: boolean | undefined): void {\n if (isDebug) {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry] Source map generation is currently disabled in your Vite configuration (\\`${settingKey}: false \\`). This setting is either a default setting or was explicitly set in your configuration. Sentry won't override this setting. Without source maps, code snippets on the Sentry Issues page will remain minified. To show unminified code, enable source maps in \\`${settingKey}\\` (e.g. by setting them to \\`hidden\\`).`,\n );\n } else {\n // eslint-disable-next-line no-console\n console.warn(`[Sentry] Source map generation (\\`${settingKey}\\`) is disabled in your Vite configuration.`);\n }\n}\n\nfunction logSentryEnablesSourceMap(settingKey: string, settingValue: string): void {\n // eslint-disable-next-line no-console\n console.log(`[Sentry] Enabled source map generation in the build options with \\`${settingKey}: ${settingValue}\\`.`);\n}\n"],"names":[],"mappings":";;;;;;AAqBO,SAAS,eAAA,CACd,aAAA,EACA,IAAA,EACA,aAAA,EACM;AAGN,EAAA,yBAAA,CAA0B,aAAA,EAAe,CAAC,qCAAqC,CAAC,CAAA;AAEhF,EAAA,MAAM,UAAU,aAAA,CAAc,KAAA;AAE9B,EAAA,MAAM,iBAAA,GAAoB,aAAA,CAAc,UAAA,EAAY,OAAA,KAAY,IAAA;AAGhE,EAAA,MAAM,yBAAA,GAA4B,EAAE,MAAA,EAAQ,IAAA,EAAM,QAAQ,IAAA,EAAK;AAE/D,EAAA,IAAA,CAAK,IAAA,CAAK,gBAAgB,MAAM;AAC9B,IAAA,IAAI,iBAAA,IAAqB,CAAC,IAAA,CAAK,OAAA,CAAQ,OAAO,CAAC,IAAA,CAAK,SAAS,QAAA,EAAU;AAOrE,MAAA,MAAM,yBAAA,GAA4B,2BAAA,CAA4B,IAAA,EAAM,aAAa,CAAA;AAGjF,MAAA,yBAAA,CAA0B,MAAA,GAAS,0BAA0B,MAAA,KAAW,OAAA;AACxE,MAAA,yBAAA,CAA0B,MAAA,GAAS,0BAA0B,MAAA,KAAW,OAAA;AAExE,MAAA,IAAI,OAAA,KAAY,yBAAA,CAA0B,MAAA,IAAU,yBAAA,CAA0B,MAAA,CAAA,EAAS;A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U,CAAA,qBAAA,EAAwB,YAAY,CAAA,oFAAA;AAAA,KAC9D;AAAA,EACF;AACF;AAEA,SAAS,+BAAA,CAAgC,YAAoB,OAAA,EAAoC;AAC/F,EAAA,IAAI,OAAA,EAAS;AAEX,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,mFAAA,EAAsF,UAAU,CAAA,2QAAA,EAA8Q,UAAU,CAAA,wCAAA;AAAA,KAC1X;AAAA,EACF,CAAA,MAAO;AAEL,IAAA,OAAA,CAAQ,IAAA,CAAK,CAAA,kCAAA,EAAqC,UAAU,CAAA,2CAAA,CAA6C,CAAA;AAAA,EAC3G;AACF;AAEA,SAAS,yBAAA,CAA0B,YAAoB,YAAA,EAA4B;AAEjF,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,mEAAA,EAAsE,UAAU,CAAA,EAAA,EAAK,YAAY,CAAA,GAAA,CAAK,CAAA;AACpH;;;;"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { BuildTimeOptionsBase } from '@sentry/core';
|
|
2
2
|
import type { init as initNode } from '@sentry/node';
|
|
3
|
-
import type { SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';
|
|
4
|
-
import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';
|
|
5
3
|
import type { init as initVue } from '@sentry/vue';
|
|
6
4
|
export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'>;
|
|
7
5
|
export type SentryNuxtServerOptions = Parameters<typeof initNode>[0] & {
|
|
@@ -84,11 +82,4 @@ export type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
84
82
|
* @default ['default', 'handler', 'server']
|
|
85
83
|
*/
|
|
86
84
|
experimental_entrypointWrappedFunctions?: string[];
|
|
87
|
-
/**
|
|
88
|
-
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/bundler-plugins/rollup`) and Sentry Vite Plugin (`@sentry/bundler-plugins/vite`) that ship with the Sentry Nuxt SDK.
|
|
89
|
-
* You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin.
|
|
90
|
-
*
|
|
91
|
-
* Please note that this option is unstable and may change in a breaking way in any release.
|
|
92
|
-
*/
|
|
93
|
-
unstable_sentryBundlerPluginOptions?: SentryRollupPluginOptions & SentryVitePluginOptions;
|
|
94
85
|
};
|
package/build/module/module.json
CHANGED
package/build/module/module.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolvePath, createResolver, useNuxt, addServerPlugin, addServerImports, defineNuxtModule, addPluginTemplate, addPlugin, addVitePlugin, addTemplate } from '@nuxt/kit';
|
|
2
|
-
import { consoleSandbox, debug } from '@sentry/core';
|
|
2
|
+
import { consoleSandbox, debug, warnOnRemovedBuildOptions } from '@sentry/core';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
5
|
import * as fs from 'fs';
|
|
@@ -7,6 +7,7 @@ import { INSTRUMENTED_MODULE_NAMES } from '@sentry/server-utils/orchestrion/conf
|
|
|
7
7
|
import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/rollup';
|
|
8
8
|
import { sentryRollupPlugin } from '@sentry/bundler-plugins/rollup';
|
|
9
9
|
import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
|
|
10
|
+
import { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';
|
|
10
11
|
|
|
11
12
|
async function getNitroMajorVersion() {
|
|
12
13
|
try {
|
|
@@ -384,6 +385,34 @@ function setupOrchestrion(nuxt, hasServerConfig, buildTimeInstrumentation) {
|
|
|
384
385
|
});
|
|
385
386
|
}
|
|
386
387
|
|
|
388
|
+
function withoutSourceMapDeletion(options) {
|
|
389
|
+
return {
|
|
390
|
+
...options,
|
|
391
|
+
sourcemaps: {
|
|
392
|
+
...options.sourcemaps,
|
|
393
|
+
filesToDeleteAfterUpload: void 0
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
async function deleteSourceMapsAfterBuild(options) {
|
|
398
|
+
const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;
|
|
399
|
+
if (filesToDeleteAfterUpload === void 0) {
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
const deletionOptions = {
|
|
403
|
+
...options,
|
|
404
|
+
sourcemaps: {
|
|
405
|
+
...options.sourcemaps,
|
|
406
|
+
filesToDeleteAfterUpload
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
const sentryBuildPluginManager = createSentryBuildPluginManager(deletionOptions, {
|
|
410
|
+
buildTool: "nuxt",
|
|
411
|
+
loggerPrefix: "[Sentry Nuxt]"
|
|
412
|
+
});
|
|
413
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
414
|
+
}
|
|
415
|
+
|
|
387
416
|
function validateSourceMapsOptionsPlugin(options) {
|
|
388
417
|
const { nuxt, moduleOptions, sourceMapsEnabled } = options;
|
|
389
418
|
const isDebug = moduleOptions.debug;
|
|
@@ -411,6 +440,7 @@ function validateSourceMapsOptionsPlugin(options) {
|
|
|
411
440
|
}
|
|
412
441
|
|
|
413
442
|
function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
443
|
+
warnOnRemovedBuildOptions(moduleOptions, ["unstable_sentryBundlerPluginOptions"]);
|
|
414
444
|
const isDebug = moduleOptions.debug;
|
|
415
445
|
const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;
|
|
416
446
|
const shouldDeleteFilesFallback = { client: true, server: true };
|
|
@@ -438,7 +468,7 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
438
468
|
[
|
|
439
469
|
validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),
|
|
440
470
|
// Vite plugin is added on the client and server side (plugin runs for both builds)
|
|
441
|
-
...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
471
|
+
...sentryVitePlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
442
472
|
],
|
|
443
473
|
{ dev: false, build: true }
|
|
444
474
|
// Only add source map plugin during build
|
|
@@ -457,10 +487,15 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
457
487
|
console.log("[Sentry] Adding Sentry Rollup plugin to the server runtime.");
|
|
458
488
|
}
|
|
459
489
|
nitroConfig.rollupConfig.plugins.push(
|
|
460
|
-
sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
490
|
+
sentryRollupPlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
461
491
|
);
|
|
462
492
|
}
|
|
463
493
|
});
|
|
494
|
+
nuxt.hook("close", async () => {
|
|
495
|
+
if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {
|
|
496
|
+
await deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));
|
|
497
|
+
}
|
|
498
|
+
});
|
|
464
499
|
}
|
|
465
500
|
function normalizePath(path) {
|
|
466
501
|
return path.replace(/^(\.\.\/)+/, "./");
|
|
@@ -484,15 +519,14 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
484
519
|
release: {
|
|
485
520
|
name: moduleOptions.release?.name,
|
|
486
521
|
// Support all release options from BuildTimeOptionsBase
|
|
487
|
-
...moduleOptions.release
|
|
488
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions?.release
|
|
522
|
+
...moduleOptions.release
|
|
489
523
|
},
|
|
524
|
+
moduleMetadata: moduleOptions.moduleMetadata,
|
|
490
525
|
_metaOptions: {
|
|
491
526
|
telemetry: {
|
|
492
527
|
metaFramework: "nuxt"
|
|
493
528
|
}
|
|
494
529
|
},
|
|
495
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions,
|
|
496
530
|
sourcemaps: {
|
|
497
531
|
disable: moduleOptions.sourcemaps?.disable,
|
|
498
532
|
// The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')
|
|
@@ -502,7 +536,7 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
502
536
|
ignore: sourcemapsOptions.ignore ?? void 0,
|
|
503
537
|
filesToDeleteAfterUpload,
|
|
504
538
|
rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,
|
|
505
|
-
|
|
539
|
+
resolveSourceMap: sourcemapsOptions.resolveSourceMap
|
|
506
540
|
}
|
|
507
541
|
};
|
|
508
542
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
3
|
-
import { debug, getClient, httpHeadersToSpanAttributes, startSpan, SPAN_STATUS_OK, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, flushIfServerless
|
|
1
|
+
import { SENTRY_SEGMENT_NAME_SOURCE, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
+
import { MIDDLEWARE } from '@sentry/conventions/op';
|
|
3
|
+
import { debug, getClient, httpHeadersToSpanAttributes, startSpan, SPAN_STATUS_OK, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, flushIfServerless } from '@sentry/core';
|
|
4
4
|
|
|
5
5
|
function wrapMiddlewareHandlerWithSentry(handler, fileName) {
|
|
6
6
|
if (!isEventHandlerObject(handler)) {
|
|
@@ -74,8 +74,8 @@ function normalizeHandlers(handlers, normalizer) {
|
|
|
74
74
|
}
|
|
75
75
|
function getSpanAttributes(event, middlewareName, hookName, index) {
|
|
76
76
|
const attributes = {
|
|
77
|
-
[SENTRY_OP]:
|
|
78
|
-
[
|
|
77
|
+
[SENTRY_OP]: MIDDLEWARE,
|
|
78
|
+
[SENTRY_SEGMENT_NAME_SOURCE]: "custom",
|
|
79
79
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.middleware.nuxt",
|
|
80
80
|
"nuxt.middleware.name": middlewareName,
|
|
81
81
|
"nuxt.middleware.hook.name": hookName ?? "handler"
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
2
|
+
import { CACHE_REMOVE, CACHE_PUT, CACHE_GET } from '@sentry/conventions/op';
|
|
3
3
|
import { debug, startSpan, SPAN_STATUS_OK, SEMANTIC_ATTRIBUTE_CACHE_HIT, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, flushIfServerless, SEMANTIC_ATTRIBUTE_CACHE_KEY, isObjectLike } from '@sentry/core';
|
|
4
4
|
|
|
5
5
|
const CACHE_HIT_METHODS = /* @__PURE__ */ new Set(["hasItem", "getItem", "getItemRaw", "getItems"]);
|
|
6
6
|
const METHOD_SPAN_OPS = {
|
|
7
|
-
hasItem:
|
|
8
|
-
getItem:
|
|
9
|
-
getItemRaw:
|
|
10
|
-
getItems:
|
|
11
|
-
getKeys:
|
|
12
|
-
setItem:
|
|
13
|
-
setItemRaw:
|
|
14
|
-
setItems:
|
|
15
|
-
removeItem:
|
|
16
|
-
clear:
|
|
7
|
+
hasItem: CACHE_GET,
|
|
8
|
+
getItem: CACHE_GET,
|
|
9
|
+
getItemRaw: CACHE_GET,
|
|
10
|
+
getItems: CACHE_GET,
|
|
11
|
+
getKeys: CACHE_GET,
|
|
12
|
+
setItem: CACHE_PUT,
|
|
13
|
+
setItemRaw: CACHE_PUT,
|
|
14
|
+
setItems: CACHE_PUT,
|
|
15
|
+
removeItem: CACHE_REMOVE,
|
|
16
|
+
clear: CACHE_REMOVE
|
|
17
17
|
};
|
|
18
18
|
async function createStoragePlugin(useStorage, userStorageMounts) {
|
|
19
19
|
const storage = useStorage();
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { BuildTimeOptionsBase } from '@sentry/core';
|
|
2
2
|
import type { init as initNode } from '@sentry/node';
|
|
3
|
-
import type { SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup';
|
|
4
|
-
import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';
|
|
5
3
|
import type { init as initVue } from '@sentry/vue';
|
|
6
4
|
export type SentryNuxtClientOptions = Omit<Parameters<typeof initVue>[0] & object, 'app'>;
|
|
7
5
|
export type SentryNuxtServerOptions = Parameters<typeof initNode>[0] & {
|
|
@@ -84,12 +82,5 @@ export type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
84
82
|
* @default ['default', 'handler', 'server']
|
|
85
83
|
*/
|
|
86
84
|
experimental_entrypointWrappedFunctions?: string[];
|
|
87
|
-
/**
|
|
88
|
-
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/bundler-plugins/rollup`) and Sentry Vite Plugin (`@sentry/bundler-plugins/vite`) that ship with the Sentry Nuxt SDK.
|
|
89
|
-
* You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin.
|
|
90
|
-
*
|
|
91
|
-
* Please note that this option is unstable and may change in a breaking way in any release.
|
|
92
|
-
*/
|
|
93
|
-
unstable_sentryBundlerPluginOptions?: SentryRollupPluginOptions & SentryVitePluginOptions;
|
|
94
85
|
};
|
|
95
86
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,aAAa,CAAC;AAInD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,CAAC;AAC1F,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG;IACrE;;;;;;;;;;OAUG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;IAC3D;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,sBAAsB,CAAC,EAAE,kBAAkB,GAAG,6BAA6B,CAAC;IAE5E;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;OAUG;IACH,uCAAuC,CAAC,EAAE,MAAM,EAAE,CAAC;CACpD,CAAC"}
|
|
@@ -8,6 +8,9 @@ export declare function init(options: Options | SentryNuxtClientOptions | Sentry
|
|
|
8
8
|
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
9
9
|
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
10
10
|
export declare const spanStreamingIntegration: typeof clientSdk.spanStreamingIntegration;
|
|
11
|
+
export declare const startSpan: typeof clientSdk.startSpan;
|
|
12
|
+
export declare const startSpanManual: typeof clientSdk.startSpanManual;
|
|
13
|
+
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;
|
|
11
14
|
export declare const withStaticSpan: typeof clientSdk.withStaticSpan;
|
|
12
15
|
export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
|
|
13
16
|
export declare const getDefaultIntegrations: (options: Options) => Integration[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.types.d.ts","sourceRoot":"","sources":["../../src/index.types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACvF,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAIjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,uBAAuB,GAAG,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;AACvH,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,wBAAwB,EAAE,OAAO,SAAS,CAAC,wBAAwB,CAAC;AACzF,MAAM,CAAC,OAAO,CAAC,MAAM,cAAc,EAAE,OAAO,SAAS,CAAC,cAAc,CAAC;AAErE,MAAM,CAAC,OAAO,CAAC,MAAM,gBAAgB,EAAE,OAAO,SAAS,CAAC,gBAAgB,CAAC;AACzE,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,WAAW,EAAE,CAAC;AACjF,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,WAAW,CAAC;AAErD,MAAM,CAAC,OAAO,CAAC,MAAM,MAAM,EAAE,OAAO,SAAS,CAAC,MAAM,GAAG,OAAO,S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AC;AAC7F,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC;AAC7E,MAAM,CAAC,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMiddlewareHandler.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/wrapMiddlewareHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapMiddlewareHandler.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/wrapMiddlewareHandler.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAEV,YAAY,EACZ,kBAAkB,EAInB,MAAM,IAAI,CAAC;AAeZ;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,SAAS,YAAY,GAAG,kBAAkB,EAChG,OAAO,EAAE,QAAQ,EACjB,QAAQ,EAAE,MAAM,GACf,QAAQ,CA+BV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentStorage.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/instrumentStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrumentStorage.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/instrumentStorage.ts"],"names":[],"mappings":"AA4EA;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA6B/G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAS,cAAc,
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAS,cAAc,EAAE,MAAM,cAAc,CAAC;AAIlE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAuBzE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CA0B7F;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAY3F"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Options } from '@sentry/bundler-plugins/core';
|
|
2
|
+
export declare function withoutSourceMapDeletion(options: Options): Options;
|
|
3
|
+
export declare function deleteSourceMapsAfterBuild(options: Options): Promise<void>;
|
|
4
|
+
//# sourceMappingURL=sourceMapDeletion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceMapDeletion.d.ts","sourceRoot":"","sources":["../../../src/vite/sourceMapDeletion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAE5F,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAQlE;AAED,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceMaps.d.ts","sourceRoot":"","sources":["../../../src/vite/sourceMaps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAsB,KAAK,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AACpG,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"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EAAE,gBAAgB,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,EAC9G,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GACvC,gBAAgB,GAAG,SAAS,CAQ9B;AAED,iCAAiC;AACjC,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,mBAAmB,EAAE,uBAAuB,GAC3C;IAAE,MAAM,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAyDhE;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE;IAAE,OAAO,EAAE;QAAE,SAAS,CAAC,EAAE,gBAAgB,GAAG;YAAE,MAAM,CAAC,EAAE,gBAAgB,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,EACnF,WAAW,EAAE,WAAW,EACxB,mBAAmB,EAAE,uBAAuB,GAC3C,IAAI,CAsCN;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,GAClB,EAAE;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,gBAAgB,CAAC;CACtC,GAAG,IAAI,CAOP"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/nuxt",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.2",
|
|
4
4
|
"description": "Official Sentry SDK for Nuxt",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/nuxt",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nuxt/kit": "^4.5.2",
|
|
57
|
-
"@sentry/browser": "11.0.0-alpha.
|
|
58
|
-
"@sentry/cloudflare": "11.0.0-alpha.
|
|
59
|
-
"@sentry/conventions": "^0.
|
|
60
|
-
"@sentry/core": "11.0.0-alpha.
|
|
61
|
-
"@sentry/node": "11.0.0-alpha.
|
|
62
|
-
"@sentry/bundler-plugins": "11.0.0-alpha.
|
|
63
|
-
"@sentry/server-utils": "11.0.0-alpha.
|
|
64
|
-
"@sentry/vue": "11.0.0-alpha.
|
|
57
|
+
"@sentry/browser": "11.0.0-alpha.2",
|
|
58
|
+
"@sentry/cloudflare": "11.0.0-alpha.2",
|
|
59
|
+
"@sentry/conventions": "^0.20.0",
|
|
60
|
+
"@sentry/core": "11.0.0-alpha.2",
|
|
61
|
+
"@sentry/node": "11.0.0-alpha.2",
|
|
62
|
+
"@sentry/bundler-plugins": "11.0.0-alpha.2",
|
|
63
|
+
"@sentry/server-utils": "11.0.0-alpha.2",
|
|
64
|
+
"@sentry/vue": "11.0.0-alpha.2",
|
|
65
65
|
"local-pkg": "^1.1.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"clean": "rimraf build coverage sentry-nuxt-*.tgz",
|
|
86
86
|
"lint:fix": "oxlint . --fix --type-aware",
|
|
87
87
|
"lint": "oxlint . --type-aware",
|
|
88
|
+
"lint:types": "oxlint src --type-aware --type-check",
|
|
88
89
|
"lint:es-compatibility": "es-check es2020 ./build/cjs/*.js && es-check es2020 ./build/esm/*.js --module && es-check es2020 ./build/module/*.mjs --module",
|
|
89
90
|
"test": "yarn test:unit",
|
|
90
91
|
"test:unit": "vitest run",
|