@sentry/nuxt 11.0.0-alpha.1 → 11.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/build/cjs/common/devMode.js +12 -0
- package/build/cjs/common/devMode.js.map +1 -0
- package/build/cjs/module.js +9 -5
- package/build/cjs/module.js.map +1 -1
- package/build/cjs/server/sdk.js +2 -25
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/vite/addServerConfig.js +33 -4
- package/build/cjs/vite/addServerConfig.js.map +1 -1
- package/build/cjs/vite/orchestrion.js +3 -0
- package/build/cjs/vite/orchestrion.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/cjs/vite/utils.js +7 -11
- package/build/cjs/vite/utils.js.map +1 -1
- package/build/esm/common/devMode.js +9 -0
- package/build/esm/common/devMode.js.map +1 -0
- package/build/esm/module.js +11 -7
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/sdk.js +6 -27
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/vite/addServerConfig.js +31 -4
- package/build/esm/vite/addServerConfig.js.map +1 -1
- package/build/esm/vite/orchestrion.js +3 -0
- package/build/esm/vite/orchestrion.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/esm/vite/utils.js +6 -12
- package/build/esm/vite/utils.js.map +1 -1
- package/build/module/common/devMode.d.ts +4 -0
- package/build/module/common/types.d.ts +0 -9
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +87 -25
- package/build/module/runtime/hooks/captureErrorHook.js +2 -1
- package/build/module/runtime/hooks/wrapMiddlewareHandler.js +6 -5
- package/build/module/runtime/utils/instrumentDatabase.js +26 -6
- package/build/module/runtime/utils/instrumentStorage.js +21 -15
- package/build/module/runtime/utils/patchEventHandler.js +2 -1
- package/build/module/vite/addServerConfig.d.ts +9 -0
- package/build/module/vite/sourceMapDeletion.d.ts +3 -0
- package/build/module/vite/utils.d.ts +3 -1
- package/build/types/common/devMode.d.ts +5 -0
- package/build/types/common/devMode.d.ts.map +1 -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 -1
- package/build/types/index.types.d.ts.map +1 -1
- package/build/types/module.d.ts.map +1 -1
- package/build/types/runtime/hooks/captureErrorHook.d.ts.map +1 -1
- package/build/types/runtime/hooks/wrapMiddlewareHandler.d.ts.map +1 -1
- package/build/types/runtime/utils/instrumentDatabase.d.ts.map +1 -1
- package/build/types/runtime/utils/instrumentStorage.d.ts.map +1 -1
- package/build/types/runtime/utils/patchEventHandler.d.ts.map +1 -1
- package/build/types/server/sdk.d.ts.map +1 -1
- package/build/types/vite/addServerConfig.d.ts +9 -0
- package/build/types/vite/addServerConfig.d.ts.map +1 -1
- package/build/types/vite/orchestrion.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/build/types/vite/utils.d.ts +3 -1
- package/build/types/vite/utils.d.ts.map +1 -1
- package/package.json +11 -9
package/build/module/module.mjs
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { resolvePath, createResolver, useNuxt, addServerPlugin, addServerImports, defineNuxtModule, addPluginTemplate, addPlugin, addVitePlugin
|
|
2
|
-
import { consoleSandbox, debug } from '@sentry/core';
|
|
1
|
+
import { resolvePath, createResolver, addTemplate, useNuxt, addServerPlugin, addServerImports, defineNuxtModule, addPluginTemplate, addPlugin, addVitePlugin } from '@nuxt/kit';
|
|
2
|
+
import { consoleSandbox, debug, warnOnRemovedBuildOptions } from '@sentry/core';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
import { existsSync } from 'node:fs';
|
|
5
|
+
import { pathToFileURL } from 'node:url';
|
|
5
6
|
import * as fs from 'fs';
|
|
6
7
|
import { INSTRUMENTED_MODULE_NAMES } from '@sentry/server-utils/orchestrion/config';
|
|
7
8
|
import { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/rollup';
|
|
8
9
|
import { sentryRollupPlugin } from '@sentry/bundler-plugins/rollup';
|
|
9
10
|
import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
|
|
11
|
+
import { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core';
|
|
12
|
+
|
|
13
|
+
const NUXT_DEV_MODE_FLAG = "__SENTRY_NUXT_DEV_MODE__";
|
|
10
14
|
|
|
11
15
|
async function getNitroMajorVersion() {
|
|
12
16
|
try {
|
|
@@ -22,17 +26,7 @@ async function getNitroMajorVersion() {
|
|
|
22
26
|
}
|
|
23
27
|
async function findDefaultSdkInitFile(type, nuxt, options) {
|
|
24
28
|
const possibleFileExtensions = ["ts", "js", "mjs", "cjs", "mts", "cts"];
|
|
25
|
-
const relativePaths =
|
|
26
|
-
if (type === "server") {
|
|
27
|
-
for (const ext of possibleFileExtensions) {
|
|
28
|
-
relativePaths.push(`sentry.${type}.config.${ext}`);
|
|
29
|
-
relativePaths.push(path.join("public", `instrument.${type}.${ext}`));
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
for (const ext of possibleFileExtensions) {
|
|
33
|
-
relativePaths.push(`sentry.${type}.config.${ext}`);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
29
|
+
const relativePaths = possibleFileExtensions.map((ext) => `sentry.${type}.config.${ext}`);
|
|
36
30
|
const layers = [...nuxt?.options._layers ?? []].reverse();
|
|
37
31
|
for (const layer of layers) {
|
|
38
32
|
for (const relativePath of relativePaths) {
|
|
@@ -51,6 +45,10 @@ async function findDefaultSdkInitFile(type, nuxt, options) {
|
|
|
51
45
|
}
|
|
52
46
|
return void 0;
|
|
53
47
|
}
|
|
48
|
+
const SERVER_CONFIG_FILENAME = "sentry.server.config";
|
|
49
|
+
function toImportSpecifier(fromDir, filePath) {
|
|
50
|
+
return `./${path.relative(fromDir, filePath).split(/[\\/]/).join("/")}`;
|
|
51
|
+
}
|
|
54
52
|
function getFilenameFromNodeStartCommand(nodeCommand) {
|
|
55
53
|
const regex = /[^/\\]+\.[^/\\]+$/;
|
|
56
54
|
const match = nodeCommand.match(regex);
|
|
@@ -134,7 +132,31 @@ function addOTelCommonJSImportAlias(nuxt, isNitroV3 = false) {
|
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
|
|
137
|
-
const
|
|
135
|
+
const DEV_SERVER_CONFIG_PATH = `dev/${SERVER_CONFIG_FILENAME}.mjs`;
|
|
136
|
+
function addDevServerConfigFile(nuxt, serverConfigFile) {
|
|
137
|
+
const configPath = createResolver(nuxt.options.rootDir).resolve(`/${serverConfigFile}`);
|
|
138
|
+
const importSpecifier = toImportSpecifier(
|
|
139
|
+
nuxt.options.rootDir,
|
|
140
|
+
path.join(nuxt.options.buildDir, DEV_SERVER_CONFIG_PATH)
|
|
141
|
+
);
|
|
142
|
+
const failureMessage = `[Sentry] Could not load \`${path.basename(configPath)}\`, so Sentry is disabled during development. Node loads this file without a build step, so it supports neither path aliases (like #import) nor non-erasable TypeScript syntax (like enums).`;
|
|
143
|
+
addTemplate({
|
|
144
|
+
filename: DEV_SERVER_CONFIG_PATH,
|
|
145
|
+
write: true,
|
|
146
|
+
getContents: () => [
|
|
147
|
+
"// Generated by @sentry/nuxt. Preload it to enable Sentry during development:",
|
|
148
|
+
`// NODE_OPTIONS='--import ${importSpecifier}' nuxt dev`,
|
|
149
|
+
// A static import would hoist above this assignment, and would make a broken config crash the dev server.
|
|
150
|
+
`globalThis.${NUXT_DEV_MODE_FLAG} = true;`,
|
|
151
|
+
"try {",
|
|
152
|
+
` await import(${JSON.stringify(pathToFileURL(configPath).href)});`,
|
|
153
|
+
"} catch (error) {",
|
|
154
|
+
` console.warn(${JSON.stringify(failureMessage)}, error);`,
|
|
155
|
+
"}",
|
|
156
|
+
""
|
|
157
|
+
].join("\n")
|
|
158
|
+
});
|
|
159
|
+
}
|
|
138
160
|
function addServerConfigToBuild(moduleOptions, nitro, serverConfigFile) {
|
|
139
161
|
nitro.hooks.hook("rollup:before", (nitro2, rollupConfig) => {
|
|
140
162
|
if (rollupConfig?.plugins === null || rollupConfig?.plugins === void 0) {
|
|
@@ -366,6 +388,9 @@ function setupOrchestrion(nuxt, hasServerConfig, buildTimeInstrumentation) {
|
|
|
366
388
|
if (nuxt.options?._prepare) {
|
|
367
389
|
return;
|
|
368
390
|
}
|
|
391
|
+
if (nuxt.options?.dev) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
369
394
|
const isCloudflare = !!nitroConfig.preset?.replace(/-/g, "_").startsWith("cloudflare");
|
|
370
395
|
if (!hasServerConfig && !isCloudflare) {
|
|
371
396
|
return;
|
|
@@ -384,6 +409,34 @@ function setupOrchestrion(nuxt, hasServerConfig, buildTimeInstrumentation) {
|
|
|
384
409
|
});
|
|
385
410
|
}
|
|
386
411
|
|
|
412
|
+
function withoutSourceMapDeletion(options) {
|
|
413
|
+
return {
|
|
414
|
+
...options,
|
|
415
|
+
sourcemaps: {
|
|
416
|
+
...options.sourcemaps,
|
|
417
|
+
filesToDeleteAfterUpload: void 0
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
async function deleteSourceMapsAfterBuild(options) {
|
|
422
|
+
const filesToDeleteAfterUpload = await options.sourcemaps?.filesToDeleteAfterUpload;
|
|
423
|
+
if (filesToDeleteAfterUpload === void 0) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
const deletionOptions = {
|
|
427
|
+
...options,
|
|
428
|
+
sourcemaps: {
|
|
429
|
+
...options.sourcemaps,
|
|
430
|
+
filesToDeleteAfterUpload
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
const sentryBuildPluginManager = createSentryBuildPluginManager(deletionOptions, {
|
|
434
|
+
buildTool: "nuxt",
|
|
435
|
+
loggerPrefix: "[Sentry Nuxt]"
|
|
436
|
+
});
|
|
437
|
+
await sentryBuildPluginManager.deleteArtifacts();
|
|
438
|
+
}
|
|
439
|
+
|
|
387
440
|
function validateSourceMapsOptionsPlugin(options) {
|
|
388
441
|
const { nuxt, moduleOptions, sourceMapsEnabled } = options;
|
|
389
442
|
const isDebug = moduleOptions.debug;
|
|
@@ -411,6 +464,7 @@ function validateSourceMapsOptionsPlugin(options) {
|
|
|
411
464
|
}
|
|
412
465
|
|
|
413
466
|
function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
467
|
+
warnOnRemovedBuildOptions(moduleOptions, ["unstable_sentryBundlerPluginOptions"]);
|
|
414
468
|
const isDebug = moduleOptions.debug;
|
|
415
469
|
const sourceMapsEnabled = moduleOptions.sourcemaps?.disable !== true;
|
|
416
470
|
const shouldDeleteFilesFallback = { client: true, server: true };
|
|
@@ -438,7 +492,7 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
438
492
|
[
|
|
439
493
|
validateSourceMapsOptionsPlugin({ nuxt, moduleOptions, sourceMapsEnabled }),
|
|
440
494
|
// Vite plugin is added on the client and server side (plugin runs for both builds)
|
|
441
|
-
...sentryVitePlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
495
|
+
...sentryVitePlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
442
496
|
],
|
|
443
497
|
{ dev: false, build: true }
|
|
444
498
|
// Only add source map plugin during build
|
|
@@ -457,10 +511,15 @@ function setupSourceMaps(moduleOptions, nuxt, addVitePlugin) {
|
|
|
457
511
|
console.log("[Sentry] Adding Sentry Rollup plugin to the server runtime.");
|
|
458
512
|
}
|
|
459
513
|
nitroConfig.rollupConfig.plugins.push(
|
|
460
|
-
sentryRollupPlugin(getPluginOptions(moduleOptions, shouldDeleteFilesFallback))
|
|
514
|
+
sentryRollupPlugin(withoutSourceMapDeletion(getPluginOptions(moduleOptions, shouldDeleteFilesFallback)))
|
|
461
515
|
);
|
|
462
516
|
}
|
|
463
517
|
});
|
|
518
|
+
nuxt.hook("close", async () => {
|
|
519
|
+
if (sourceMapsEnabled && !nuxt.options.dev && !nuxt.options?._prepare) {
|
|
520
|
+
await deleteSourceMapsAfterBuild(getPluginOptions(moduleOptions, shouldDeleteFilesFallback));
|
|
521
|
+
}
|
|
522
|
+
});
|
|
464
523
|
}
|
|
465
524
|
function normalizePath(path) {
|
|
466
525
|
return path.replace(/^(\.\.\/)+/, "./");
|
|
@@ -484,15 +543,14 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
484
543
|
release: {
|
|
485
544
|
name: moduleOptions.release?.name,
|
|
486
545
|
// Support all release options from BuildTimeOptionsBase
|
|
487
|
-
...moduleOptions.release
|
|
488
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions?.release
|
|
546
|
+
...moduleOptions.release
|
|
489
547
|
},
|
|
548
|
+
moduleMetadata: moduleOptions.moduleMetadata,
|
|
490
549
|
_metaOptions: {
|
|
491
550
|
telemetry: {
|
|
492
551
|
metaFramework: "nuxt"
|
|
493
552
|
}
|
|
494
553
|
},
|
|
495
|
-
...moduleOptions?.unstable_sentryBundlerPluginOptions,
|
|
496
554
|
sourcemaps: {
|
|
497
555
|
disable: moduleOptions.sourcemaps?.disable,
|
|
498
556
|
// The server/client files are in different places depending on the nitro preset (e.g. '.output/server' or '.netlify/functions-internal/server')
|
|
@@ -502,7 +560,7 @@ function getPluginOptions(moduleOptions, shouldDeleteFilesFallback) {
|
|
|
502
560
|
ignore: sourcemapsOptions.ignore ?? void 0,
|
|
503
561
|
filesToDeleteAfterUpload,
|
|
504
562
|
rewriteSources: sourcemapsOptions.rewriteSources ?? normalizePath,
|
|
505
|
-
|
|
563
|
+
resolveSourceMap: sourcemapsOptions.resolveSourceMap
|
|
506
564
|
}
|
|
507
565
|
};
|
|
508
566
|
}
|
|
@@ -725,6 +783,9 @@ var module$1 = defineNuxtModule({
|
|
|
725
783
|
addMiddlewareImports();
|
|
726
784
|
addStorageInstrumentation(nuxt, !isNitroV3);
|
|
727
785
|
addDatabaseInstrumentation(nuxt.options.nitro, !isNitroV3, moduleOptions);
|
|
786
|
+
if (isNitroV3) {
|
|
787
|
+
addDevServerConfigFile(nuxt, serverConfigFile);
|
|
788
|
+
}
|
|
728
789
|
}
|
|
729
790
|
if (clientConfigFile || serverConfigFile) {
|
|
730
791
|
setupSourceMaps(moduleOptions, nuxt, addVitePlugin);
|
|
@@ -769,8 +830,6 @@ var module$1 = defineNuxtModule({
|
|
|
769
830
|
}
|
|
770
831
|
if (serverConfigFile) {
|
|
771
832
|
addMiddlewareInstrumentation(nitro);
|
|
772
|
-
}
|
|
773
|
-
if (serverConfigFile?.includes(".server.config")) {
|
|
774
833
|
consoleSandbox(() => {
|
|
775
834
|
const serverDir = nitro.options.output.serverDir;
|
|
776
835
|
if (serverDir.includes(".netlify") || !!process.env.NETLIFY) {
|
|
@@ -785,18 +844,21 @@ var module$1 = defineNuxtModule({
|
|
|
785
844
|
}
|
|
786
845
|
});
|
|
787
846
|
if (moduleOptions.autoInjectServerSentry !== "experimental_dynamic-import") {
|
|
788
|
-
|
|
847
|
+
if (!(isNitroV3 && nitro.options.dev)) {
|
|
848
|
+
addServerConfigToBuild(moduleOptions, nitro, serverConfigFile);
|
|
849
|
+
}
|
|
789
850
|
if (moduleOptions.debug) {
|
|
790
851
|
const serverDirResolver = createResolver(nitro.options.output.serverDir);
|
|
791
852
|
const serverConfigPath = serverDirResolver.resolve("sentry.server.config.mjs");
|
|
792
|
-
const serverConfigRelativePath =
|
|
853
|
+
const serverConfigRelativePath = toImportSpecifier(nitro.options.rootDir, serverConfigPath);
|
|
854
|
+
const devConfigRelativePath = isNitroV3 ? toImportSpecifier(nuxt.options.rootDir, path.join(nuxt.options.buildDir, DEV_SERVER_CONFIG_PATH)) : serverConfigRelativePath;
|
|
793
855
|
consoleSandbox(() => {
|
|
794
856
|
console.log(
|
|
795
857
|
`[Sentry] Using \`${serverConfigFile}\` for server-side Sentry configuration. To activate Sentry on the Nuxt server-side, this file must be preloaded when starting your application. Make sure to add this where you deploy and/or run your application. Read more here: https://docs.sentry.io/platforms/javascript/guides/nuxt/install/.`
|
|
796
858
|
);
|
|
797
859
|
if (nitro.options.dev) {
|
|
798
860
|
console.log(
|
|
799
|
-
`[Sentry] During development, preload Sentry with the NODE_OPTIONS environment variable: \`NODE_OPTIONS='--import ${
|
|
861
|
+
`[Sentry] During development, preload Sentry with the NODE_OPTIONS environment variable: \`NODE_OPTIONS='--import ${devConfigRelativePath}' nuxt dev\`. The file is generated in the build directory (usually '.nuxt'). If you delete the build directory, run \`nuxt prepare\` to regenerate it.`
|
|
800
862
|
);
|
|
801
863
|
} else {
|
|
802
864
|
console.log(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getClient, getCurrentScope, captureException
|
|
1
|
+
import { getClient, getCurrentScope, captureException } from '@sentry/core';
|
|
2
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
2
3
|
import { H3Error } from 'h3';
|
|
3
4
|
import { extractErrorContext } from '../utils.js';
|
|
4
5
|
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
|
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 } from '@sentry/core';
|
|
4
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
4
5
|
|
|
5
6
|
function wrapMiddlewareHandlerWithSentry(handler, fileName) {
|
|
6
7
|
if (!isEventHandlerObject(handler)) {
|
|
@@ -74,8 +75,8 @@ function normalizeHandlers(handlers, normalizer) {
|
|
|
74
75
|
}
|
|
75
76
|
function getSpanAttributes(event, middlewareName, hookName, index) {
|
|
76
77
|
const attributes = {
|
|
77
|
-
[SENTRY_OP]:
|
|
78
|
-
[
|
|
78
|
+
[SENTRY_OP]: MIDDLEWARE,
|
|
79
|
+
[SENTRY_SEGMENT_NAME_SOURCE]: "custom",
|
|
79
80
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.middleware.nuxt",
|
|
80
81
|
"nuxt.middleware.name": middlewareName,
|
|
81
82
|
"nuxt.middleware.hook.name": hookName ?? "handler"
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DB_SYSTEM_NAME, DB_NAMESPACE, SENTRY_OP, DB_QUERY_SUMMARY, DB_QUERY_TEXT } from '@sentry/conventions/attributes';
|
|
2
|
+
import { DB_QUERY } from '@sentry/conventions/op';
|
|
3
|
+
import { debug, startSpan, getClient, hasSpanStreamingEnabled, DB_SPAN_NAME_FALLBACK, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, captureException, addBreadcrumb } from '@sentry/core';
|
|
4
|
+
import { _INTERNAL_getSqlQuerySummary, _INTERNAL_sanitizeSqlQuery, flushIfServerless } from '@sentry/core/server';
|
|
2
5
|
import { getDatabaseSpanData } from './database-span-data.js';
|
|
3
6
|
|
|
4
7
|
const patchedStatement = /* @__PURE__ */ new WeakSet();
|
|
@@ -27,7 +30,7 @@ function instrumentDatabase(db, config) {
|
|
|
27
30
|
return;
|
|
28
31
|
}
|
|
29
32
|
const metadata = {
|
|
30
|
-
|
|
33
|
+
[DB_SYSTEM_NAME]: config?.connector ?? db.dialect,
|
|
31
34
|
...getDatabaseSpanData(config)
|
|
32
35
|
};
|
|
33
36
|
db.prepare = new Proxy(db.prepare, {
|
|
@@ -38,7 +41,8 @@ function instrumentDatabase(db, config) {
|
|
|
38
41
|
});
|
|
39
42
|
db.sql = new Proxy(db.sql, {
|
|
40
43
|
apply(target, thisArg, args) {
|
|
41
|
-
const
|
|
44
|
+
const [strings, ...values] = args;
|
|
45
|
+
const query = strings ? buildSqlTemplateQuery(strings, values) : "";
|
|
42
46
|
const opts = createStartSpanOptions(query, metadata);
|
|
43
47
|
return startSpan(
|
|
44
48
|
opts,
|
|
@@ -56,6 +60,18 @@ function instrumentDatabase(db, config) {
|
|
|
56
60
|
});
|
|
57
61
|
db.__sentry_instrumented__ = true;
|
|
58
62
|
}
|
|
63
|
+
function buildSqlTemplateQuery(strings, values) {
|
|
64
|
+
let query = strings[0] || "";
|
|
65
|
+
for (let i = 1; i < strings.length; i++) {
|
|
66
|
+
const chunk = strings[i] ?? "";
|
|
67
|
+
if (query.endsWith("{") && chunk.startsWith("}")) {
|
|
68
|
+
query = `${query.slice(0, -1)}${values[i - 1]}${chunk.slice(1)}`;
|
|
69
|
+
} else {
|
|
70
|
+
query += `?${chunk}`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return query.trim();
|
|
74
|
+
}
|
|
59
75
|
function instrumentPreparedStatement(statement, query, data) {
|
|
60
76
|
statement.bind = new Proxy(statement.bind, {
|
|
61
77
|
apply(target, thisArg, args) {
|
|
@@ -127,12 +143,16 @@ function createBreadcrumb(query) {
|
|
|
127
143
|
});
|
|
128
144
|
}
|
|
129
145
|
function createStartSpanOptions(query, data) {
|
|
146
|
+
const querySummary = query ? _INTERNAL_getSqlQuerySummary(_INTERNAL_sanitizeSqlQuery(query)) : void 0;
|
|
147
|
+
const client = getClient();
|
|
148
|
+
const name = client && hasSpanStreamingEnabled(client) ? querySummary || data[DB_NAMESPACE] || DB_SPAN_NAME_FALLBACK : query;
|
|
130
149
|
return {
|
|
131
|
-
name
|
|
150
|
+
name,
|
|
132
151
|
attributes: {
|
|
133
|
-
|
|
152
|
+
[DB_QUERY_TEXT]: query,
|
|
153
|
+
[DB_QUERY_SUMMARY]: querySummary,
|
|
134
154
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: SENTRY_ORIGIN,
|
|
135
|
-
[
|
|
155
|
+
[SENTRY_OP]: DB_QUERY,
|
|
136
156
|
...data
|
|
137
157
|
}
|
|
138
158
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
3
|
-
import { debug, startSpan, SPAN_STATUS_OK, SEMANTIC_ATTRIBUTE_CACHE_HIT, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
1
|
+
import { CACHE_OPERATION, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
+
import { CACHE_REMOVE, CACHE_PUT, CACHE_GET } from '@sentry/conventions/op';
|
|
3
|
+
import { debug, startSpan, SPAN_STATUS_OK, SEMANTIC_ATTRIBUTE_CACHE_HIT, SPAN_STATUS_ERROR, captureException, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, CACHE_OPERATION_NAMES, SEMANTIC_ATTRIBUTE_CACHE_KEY, getClient, hasSpanStreamingEnabled, isObjectLike } from '@sentry/core';
|
|
4
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
4
5
|
|
|
5
6
|
const CACHE_HIT_METHODS = /* @__PURE__ */ new Set(["hasItem", "getItem", "getItemRaw", "getItems"]);
|
|
6
7
|
const METHOD_SPAN_OPS = {
|
|
7
|
-
hasItem:
|
|
8
|
-
getItem:
|
|
9
|
-
getItemRaw:
|
|
10
|
-
getItems:
|
|
11
|
-
getKeys:
|
|
12
|
-
setItem:
|
|
13
|
-
setItemRaw:
|
|
14
|
-
setItems:
|
|
15
|
-
removeItem:
|
|
16
|
-
clear:
|
|
8
|
+
hasItem: CACHE_GET,
|
|
9
|
+
getItem: CACHE_GET,
|
|
10
|
+
getItemRaw: CACHE_GET,
|
|
11
|
+
getItems: CACHE_GET,
|
|
12
|
+
getKeys: CACHE_GET,
|
|
13
|
+
setItem: CACHE_PUT,
|
|
14
|
+
setItemRaw: CACHE_PUT,
|
|
15
|
+
setItems: CACHE_PUT,
|
|
16
|
+
removeItem: CACHE_REMOVE,
|
|
17
|
+
clear: CACHE_REMOVE
|
|
17
18
|
};
|
|
18
19
|
async function createStoragePlugin(useStorage, userStorageMounts) {
|
|
19
20
|
const storage = useStorage();
|
|
@@ -102,16 +103,21 @@ function wrapStorageMount(storage) {
|
|
|
102
103
|
}
|
|
103
104
|
function createSpanStartOptions(methodName, driver, mountBase, args) {
|
|
104
105
|
const keys = getCacheKeys(args?.[0], mountBase);
|
|
106
|
+
const cacheOperation = METHOD_SPAN_OPS[methodName];
|
|
107
|
+
const cacheOperationName = CACHE_OPERATION_NAMES[cacheOperation];
|
|
105
108
|
const attributes = {
|
|
106
|
-
[SENTRY_OP]:
|
|
109
|
+
[SENTRY_OP]: cacheOperation,
|
|
110
|
+
[CACHE_OPERATION]: cacheOperationName,
|
|
107
111
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.cache.nuxt",
|
|
108
112
|
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: keys.length > 1 ? keys : keys[0],
|
|
109
113
|
"db.operation.name": methodName,
|
|
110
114
|
"db.collection.name": mountBase.replace(/:$/, ""),
|
|
111
115
|
"db.system.name": driver.name ?? "unknown"
|
|
112
116
|
};
|
|
117
|
+
const client = getClient();
|
|
113
118
|
return {
|
|
114
|
-
|
|
119
|
+
// With span streaming, span names have to be low cardinality, so we can't fall back to the cache keys.
|
|
120
|
+
name: client && hasSpanStreamingEnabled(client) ? cacheOperation : keys.join(", "),
|
|
115
121
|
attributes
|
|
116
122
|
};
|
|
117
123
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { getIsolationScope, getDefaultIsolationScope, debug, withIsolationScope
|
|
1
|
+
import { getIsolationScope, getDefaultIsolationScope, debug, withIsolationScope } from '@sentry/core';
|
|
2
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
2
3
|
|
|
3
4
|
function patchEventHandler(handler) {
|
|
4
5
|
return new Proxy(handler, {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { Nuxt } from '@nuxt/schema';
|
|
1
2
|
import type { Nitro } from 'nitropack';
|
|
2
3
|
import type { SentryNuxtModuleOptions } from '../common/types';
|
|
4
|
+
/** Path of the generated dev-mode config file, relative to the Nuxt build directory. */
|
|
5
|
+
export declare const DEV_SERVER_CONFIG_PATH = "dev/sentry.server.config.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Writes the file users preload with `node --import` to enable Sentry in `nuxt dev` (for Nuxt 5 with Nitro 3).
|
|
8
|
+
*
|
|
9
|
+
* In dev-mode, Nitro v3 has no server bundle to emit into, so Node loads the server config file as it is written.
|
|
10
|
+
*/
|
|
11
|
+
export declare function addDevServerConfigFile(nuxt: Nuxt, serverConfigFile: string): void;
|
|
3
12
|
/**
|
|
4
13
|
* Adds the `sentry.server.config.ts` file as `sentry.server.config.mjs` to the `.output` directory to be able to reference this file in the node --import option.
|
|
5
14
|
*
|
|
@@ -7,9 +7,11 @@ import type { SentryNuxtModuleOptions } from '../common/types';
|
|
|
7
7
|
export declare function getNitroMajorVersion(): Promise<number>;
|
|
8
8
|
/**
|
|
9
9
|
* Find the default SDK init file for the given type (client or server).
|
|
10
|
-
* The sentry.server.config file is prioritized over the instrument.server file.
|
|
11
10
|
*/
|
|
12
11
|
export declare function findDefaultSdkInitFile(type: 'server' | 'client', nuxt?: Nuxt, options?: SentryNuxtModuleOptions): Promise<string | undefined>;
|
|
12
|
+
export declare const SERVER_CONFIG_FILENAME = "sentry.server.config";
|
|
13
|
+
/** Builds the value for `node --import`. Node reads it as a URL, so it needs forward slashes on Windows too. */
|
|
14
|
+
export declare function toImportSpecifier(fromDir: string, filePath: string): string;
|
|
13
15
|
/**
|
|
14
16
|
* Extracts the filename from a node command with a path.
|
|
15
17
|
*/
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Global flag set by the generated `<buildDir>/dev/sentry.server.config.mjs`. */
|
|
2
|
+
export declare const NUXT_DEV_MODE_FLAG = "__SENTRY_NUXT_DEV_MODE__";
|
|
3
|
+
/** Whether the SDK was preloaded by the generated `nuxt dev` server config file. */
|
|
4
|
+
export declare function isNuxtDevRuntime(): boolean;
|
|
5
|
+
//# sourceMappingURL=devMode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devMode.d.ts","sourceRoot":"","sources":["../../../src/common/devMode.ts"],"names":[],"mappings":"AAEA,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,oFAAoF;AACpF,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C"}
|
|
@@ -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"}
|
|
@@ -7,7 +7,9 @@ export * from './index.server';
|
|
|
7
7
|
export declare function init(options: Options | SentryNuxtClientOptions | SentryNuxtServerOptions): Client | undefined;
|
|
8
8
|
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
9
9
|
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
10
|
-
export declare const
|
|
10
|
+
export declare const startSpan: typeof clientSdk.startSpan;
|
|
11
|
+
export declare const startSpanManual: typeof clientSdk.startSpanManual;
|
|
12
|
+
export declare const startInactiveSpan: typeof clientSdk.startInactiveSpan;
|
|
11
13
|
export declare const withStaticSpan: typeof clientSdk.withStaticSpan;
|
|
12
14
|
export declare const withStreamedSpan: typeof clientSdk.withStreamedSpan;
|
|
13
15
|
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,U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AAM,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,SAAS,CAAC,MAAM,CAAC;AAE/E,MAAM,CAAC,OAAO,CAAC,MAAM,qBAAqB,EAAE,OAAO,SAAS,CAAC,qBAAqB,CAAC;AACnF,MAAM,CAAC,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,SAAS,CAAC,uBAAuB,CAAC;AACvF,MAAM,CAAC,OAAO,CAAC,MAAM,gCAAgC,EAAE,OAAO,SAAS,CAAC,gCAAgC,CAAC;AACzG,MAAM,CAAC,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,SAAS,CAAC,sBAAsB,CAAC;AACrF,MAAM,CAAC,OAAO,CAAC,MAAM,0BAA0B,EAAE,OAAO,SAAS,CAAC,0BAA0B,CAAC;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":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAoB9D,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureErrorHook.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"captureErrorHook.d.ts","sourceRoot":"","sources":["../../../../src/runtime/hooks/captureErrorHook.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG5D;;GAEG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgD5G"}
|
|
@@ -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":"instrumentDatabase.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/instrumentDatabase.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instrumentDatabase.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/instrumentDatabase.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,QAAQ,EAAqB,MAAM,KAAK,CAAC;AACvD,OAAO,EAAE,KAAK,wBAAwB,EAA8C,MAAM,sBAAsB,CAAC;AAiBjH;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,EACvC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,GACvD,IAAI,CAqBN"}
|
|
@@ -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":"AA+EA;;;;;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":"patchEventHandler.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/patchEventHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patchEventHandler.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils/patchEventHandler.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,cAAc,SAAS,QAAQ,EAAE,OAAO,EAAE,cAAc,GAAG,cAAc,CAqB1G"}
|
|
@@ -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;AAKlE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAsBzE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CA0B7F;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,uBAAuB,GAAG,cAAc,CAY3F"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { Nuxt } from '@nuxt/schema';
|
|
1
2
|
import type { Nitro } from 'nitropack';
|
|
2
3
|
import type { SentryNuxtModuleOptions } from '../common/types';
|
|
4
|
+
/** Path of the generated dev-mode config file, relative to the Nuxt build directory. */
|
|
5
|
+
export declare const DEV_SERVER_CONFIG_PATH = "dev/sentry.server.config.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Writes the file users preload with `node --import` to enable Sentry in `nuxt dev` (for Nuxt 5 with Nitro 3).
|
|
8
|
+
*
|
|
9
|
+
* In dev-mode, Nitro v3 has no server bundle to emit into, so Node loads the server config file as it is written.
|
|
10
|
+
*/
|
|
11
|
+
export declare function addDevServerConfigFile(nuxt: Nuxt, serverConfigFile: string): void;
|
|
3
12
|
/**
|
|
4
13
|
* Adds the `sentry.server.config.ts` file as `sentry.server.config.mjs` to the `.output` directory to be able to reference this file in the node --import option.
|
|
5
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addServerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/addServerConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"addServerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/addServerConfig.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAc/D,wFAAwF;AACxF,eAAO,MAAM,sBAAsB,iCAAsC,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CA4BjF;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,uBAAuB,EACtC,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,MAAM,GACvB,IAAI,CAWN;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,uBAAuB,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CA0C7F;AAED;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,MAAM,EACxB,aAAa,EAAE,IAAI,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,GACrF,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,yCAAyC,CAAC,CAAC,GACnF,IAAI,CAkBN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrion.d.ts","sourceRoot":"","sources":["../../../src/vite/orchestrion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASzC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,wBAAwB,CAAC,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"orchestrion.d.ts","sourceRoot":"","sources":["../../../src/vite/orchestrion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASzC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,wBAAwB,CAAC,EAAE,OAAO,GAAG,IAAI,CAwC/G"}
|
|
@@ -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
|
+
{"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;AAE9F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CA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,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"}
|
|
@@ -7,9 +7,11 @@ import type { SentryNuxtModuleOptions } from '../common/types';
|
|
|
7
7
|
export declare function getNitroMajorVersion(): Promise<number>;
|
|
8
8
|
/**
|
|
9
9
|
* Find the default SDK init file for the given type (client or server).
|
|
10
|
-
* The sentry.server.config file is prioritized over the instrument.server file.
|
|
11
10
|
*/
|
|
12
11
|
export declare function findDefaultSdkInitFile(type: 'server' | 'client', nuxt?: Nuxt, options?: SentryNuxtModuleOptions): Promise<string | undefined>;
|
|
12
|
+
export declare const SERVER_CONFIG_FILENAME = "sentry.server.config";
|
|
13
|
+
/** Builds the value for `node --import`. Node reads it as a URL, so it needs forward slashes on Windows too. */
|
|
14
|
+
export declare function toImportSpecifier(fromDir: string, filePath: string): string;
|
|
13
15
|
/**
|
|
14
16
|
* Extracts the filename from a node command with a path.
|
|
15
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/vite/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAIzC,OAAO,KA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