@sentry/nuxt 11.0.0-beta.0 → 11.0.0-beta.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/common/devMode.js +16 -0
- package/build/cjs/common/devMode.js.map +1 -1
- package/build/cjs/module.js +32 -48
- package/build/cjs/module.js.map +1 -1
- package/build/cjs/server/sdk.js +15 -0
- package/build/cjs/server/sdk.js.map +1 -1
- package/build/cjs/vite/addServerConfig.js +106 -37
- package/build/cjs/vite/addServerConfig.js.map +1 -1
- package/build/cjs/vite/middlewareConfig.js +7 -6
- package/build/cjs/vite/middlewareConfig.js.map +1 -1
- package/build/cjs/vite/orchestrion.js +2 -1
- package/build/cjs/vite/orchestrion.js.map +1 -1
- package/build/cjs/vite/utils.js +34 -9
- package/build/cjs/vite/utils.js.map +1 -1
- package/build/esm/common/devMode.js +12 -1
- package/build/esm/common/devMode.js.map +1 -1
- package/build/esm/module.js +34 -50
- package/build/esm/module.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/server/sdk.js +17 -2
- package/build/esm/server/sdk.js.map +1 -1
- package/build/esm/vite/addServerConfig.js +108 -40
- package/build/esm/vite/addServerConfig.js.map +1 -1
- package/build/esm/vite/middlewareConfig.js +7 -6
- package/build/esm/vite/middlewareConfig.js.map +1 -1
- package/build/esm/vite/orchestrion.js +2 -1
- package/build/esm/vite/orchestrion.js.map +1 -1
- package/build/esm/vite/utils.js +33 -9
- package/build/esm/vite/utils.js.map +1 -1
- package/build/module/common/devMode.d.ts +12 -2
- package/build/module/common/types.d.ts +7 -0
- package/build/module/module.json +1 -1
- package/build/module/module.mjs +177 -99
- package/build/module/runtime/utils/instrumentDatabase.js +3 -2
- package/build/module/vite/addServerConfig.d.ts +23 -8
- package/build/module/vite/middlewareConfig.d.ts +2 -1
- package/build/module/vite/utils.d.ts +22 -3
- package/build/types/common/devMode.d.ts +12 -2
- package/build/types/common/devMode.d.ts.map +1 -1
- package/build/types/common/types.d.ts +7 -0
- package/build/types/common/types.d.ts.map +1 -1
- package/build/types/module.d.ts.map +1 -1
- package/build/types/runtime/utils/instrumentDatabase.d.ts.map +1 -1
- package/build/types/server/sdk.d.ts.map +1 -1
- package/build/types/vite/addServerConfig.d.ts +23 -8
- package/build/types/vite/addServerConfig.d.ts.map +1 -1
- package/build/types/vite/middlewareConfig.d.ts +2 -1
- package/build/types/vite/middlewareConfig.d.ts.map +1 -1
- package/build/types/vite/orchestrion.d.ts.map +1 -1
- package/build/types/vite/utils.d.ts +22 -3
- package/build/types/vite/utils.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { DB_SYSTEM_NAME, DB_NAMESPACE, SENTRY_OP, DB_QUERY_SUMMARY, DB_QUERY_TEXT } from '@sentry/conventions/attributes';
|
|
2
2
|
import { DB_QUERY } from '@sentry/conventions/op';
|
|
3
3
|
import { debug, startSpan, getClient, hasSpanStreamingEnabled, DB_SPAN_NAME_FALLBACK, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, captureException, addBreadcrumb } from '@sentry/core';
|
|
4
|
-
import {
|
|
4
|
+
import { flushIfServerless } from '@sentry/core/server';
|
|
5
|
+
import { getSqlQuerySummary, sanitizeSqlQuery } from '@sentry/server-utils';
|
|
5
6
|
import { getDatabaseSpanData } from './database-span-data.js';
|
|
6
7
|
|
|
7
8
|
const patchedStatement = /* @__PURE__ */ new WeakSet();
|
|
@@ -143,7 +144,7 @@ function createBreadcrumb(query) {
|
|
|
143
144
|
});
|
|
144
145
|
}
|
|
145
146
|
function createStartSpanOptions(query, data) {
|
|
146
|
-
const querySummary = query ?
|
|
147
|
+
const querySummary = query ? getSqlQuerySummary(sanitizeSqlQuery(query)) : void 0;
|
|
147
148
|
const client = getClient();
|
|
148
149
|
const name = client && hasSpanStreamingEnabled(client) ? querySummary || data[DB_NAMESPACE] || DB_SPAN_NAME_FALLBACK : query;
|
|
149
150
|
return {
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema';
|
|
2
2
|
import type { Nitro } from 'nitropack';
|
|
3
|
+
import type { InputPluginOption } from 'rollup';
|
|
3
4
|
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;
|
|
12
5
|
/**
|
|
13
6
|
* 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.
|
|
14
7
|
*
|
|
@@ -21,6 +14,16 @@ export declare function addServerConfigToBuild(moduleOptions: SentryNuxtModuleOp
|
|
|
21
14
|
* However, only limited tracing instrumentation is supported when doing this.
|
|
22
15
|
*/
|
|
23
16
|
export declare function addSentryTopImport(moduleOptions: SentryNuxtModuleOptions, nitro: Nitro): void;
|
|
17
|
+
/**
|
|
18
|
+
* Registers a Nitro plugin that statically imports the Sentry server config, so the SDK initializes
|
|
19
|
+
* at server startup without a `node --import` preload.
|
|
20
|
+
*/
|
|
21
|
+
export declare function addServerConfigPlugin(nuxt: Nuxt, serverConfigFile: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Writes a shim to the former `--import` config path, so existing `node --import` start commands
|
|
24
|
+
* keep working now that the config is bundled into the server build.
|
|
25
|
+
*/
|
|
26
|
+
export declare function addServerConfigShimWithWarning(nitro: Nitro): void;
|
|
24
27
|
/**
|
|
25
28
|
* This function modifies the Rollup configuration to include a plugin that wraps the entry file with a dynamic import (`import()`)
|
|
26
29
|
* and adds the Sentry server config with the static `import` declaration.
|
|
@@ -29,3 +32,15 @@ export declare function addSentryTopImport(moduleOptions: SentryNuxtModuleOption
|
|
|
29
32
|
* See: https://nodejs.org/api/module.html#enabling
|
|
30
33
|
*/
|
|
31
34
|
export declare function addDynamicImportEntryFileWrapper(nitro: Nitro, serverConfigFile: string, moduleOptions: Omit<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'> & Required<Pick<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'>>): void;
|
|
35
|
+
/**
|
|
36
|
+
* A Rollup plugin which wraps the server entry with a dynamic `import()`. This makes it possible to initialize Sentry first
|
|
37
|
+
* by using a regular `import` and load the server after that.
|
|
38
|
+
* This also works with serverless `handler` functions, as it re-exports the `handler`.
|
|
39
|
+
*
|
|
40
|
+
* Only exported for testing.
|
|
41
|
+
*/
|
|
42
|
+
export declare function wrapEntryWithDynamicImport({ resolvedSentryConfigPath, experimental_entrypointWrappedFunctions, debug, }: {
|
|
43
|
+
resolvedSentryConfigPath: string;
|
|
44
|
+
experimental_entrypointWrappedFunctions: string[];
|
|
45
|
+
debug?: boolean;
|
|
46
|
+
}): InputPluginOption;
|
|
@@ -7,5 +7,6 @@ export declare function addMiddlewareImports(): void;
|
|
|
7
7
|
* Adds middleware instrumentation to the Nitro build.
|
|
8
8
|
*
|
|
9
9
|
* @param nitro Nitro instance
|
|
10
|
+
* @param isNitroV3 Whether the app builds with Nitro v3 (Nuxt 5)
|
|
10
11
|
*/
|
|
11
|
-
export declare function addMiddlewareInstrumentation(nitro: Nitro): void;
|
|
12
|
+
export declare function addMiddlewareInstrumentation(nitro: Nitro, isNitroV3: boolean): void;
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema';
|
|
2
2
|
import type { SentryNuxtModuleOptions } from '../common/types';
|
|
3
3
|
/**
|
|
4
|
-
* Gets the major version of the
|
|
5
|
-
* Returns 2 as the default if
|
|
4
|
+
* Gets the major version of the Nitro package used by the app's Nuxt installation.
|
|
5
|
+
* Returns 2 as the default if the version cannot be determined.
|
|
6
|
+
*
|
|
7
|
+
* Nitro v2 is published as `nitropack`, v3 as `nitro`. Resolving `nitro` directly is
|
|
8
|
+
* unreliable: module resolution walks up the directory tree, so in a monorepo an
|
|
9
|
+
* unrelated `nitro` v3 above the app wins even when the app's Nuxt uses `nitropack` v2.
|
|
10
|
+
* Instead, follow the dependency chain Nuxt itself imports Nitro through:
|
|
11
|
+
* `nuxt` -> (`@nuxt/nitro-server` ->) `nitro` | `nitropack`.
|
|
6
12
|
*/
|
|
7
|
-
export declare function getNitroMajorVersion(): Promise<number>;
|
|
13
|
+
export declare function getNitroMajorVersion(rootDir: string): Promise<number>;
|
|
8
14
|
/**
|
|
9
15
|
* Find the default SDK init file for the given type (client or server).
|
|
10
16
|
*/
|
|
11
17
|
export declare function findDefaultSdkInitFile(type: 'server' | 'client', nuxt?: Nuxt, options?: SentryNuxtModuleOptions): Promise<string | undefined>;
|
|
12
18
|
export declare const SERVER_CONFIG_FILENAME = "sentry.server.config";
|
|
19
|
+
/** Whether a resolved Nitro preset targets Cloudflare (workerd). Nitro normalizes preset names, so any `cloudflare*` spelling matches. */
|
|
20
|
+
export declare function isCloudflarePreset(preset: string | undefined): boolean;
|
|
13
21
|
/** Builds the value for `node --import`. Node reads it as a URL, so it needs forward slashes on Windows too. */
|
|
14
22
|
export declare function toImportSpecifier(fromDir: string, filePath: string): string;
|
|
15
23
|
/**
|
|
@@ -47,6 +55,17 @@ export declare function constructWrappedFunctionExportQuery(exportedBindings: Re
|
|
|
47
55
|
* Constructs a code snippet with function reexports (can be used in Rollup plugins as a return value for `load()`)
|
|
48
56
|
*/
|
|
49
57
|
export declare function constructFunctionReExport(pathWithQuery: string, entryId: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* `load()` emits `file://` specifiers because Node's ESM loader rejects bare Windows
|
|
60
|
+
* paths (`ERR_UNSUPPORTED_ESM_URL_SCHEME`), but Rollup's resolver only understands
|
|
61
|
+
* filesystem paths. Returns `undefined` for a malformed `file://` URL.
|
|
62
|
+
*
|
|
63
|
+
* Only exported for testing.
|
|
64
|
+
*/
|
|
65
|
+
export declare function toResolvablePath(source: string): {
|
|
66
|
+
path: string;
|
|
67
|
+
wasFileUrl: boolean;
|
|
68
|
+
} | undefined;
|
|
50
69
|
/**
|
|
51
70
|
* Sets up alias to work around OpenTelemetry's incomplete ESM imports.
|
|
52
71
|
* https://github.com/getsentry/sentry-javascript/issues/15204
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
/** Global flag set by the generated
|
|
1
|
+
/** Global flag set by the generated runtime-flags module before the Sentry server config evaluates. */
|
|
2
2
|
export declare const NUXT_DEV_MODE_FLAG = "__SENTRY_NUXT_DEV_MODE__";
|
|
3
|
-
/**
|
|
3
|
+
/** Global flag set by the generated runtime-flags module during a prerender build. */
|
|
4
|
+
export declare const NUXT_PRERENDER_FLAG = "__SENTRY_NUXT_PRERENDER__";
|
|
5
|
+
/** Global flag set by the Nuxt server SDK after a successful `init`, to guard against a second init. */
|
|
6
|
+
export declare const NUXT_SERVER_INITIALIZED_FLAG = "__SENTRY_NUXT_SERVER_INITIALIZED__";
|
|
7
|
+
/** Whether the server runs in `nuxt dev`. */
|
|
4
8
|
export declare function isNuxtDevRuntime(): boolean;
|
|
9
|
+
/** Whether the server bundle is executed by the Nitro prerenderer at build time. */
|
|
10
|
+
export declare function isNuxtPrerenderRuntime(): boolean;
|
|
11
|
+
/** Whether a Nuxt server SDK `init` already ran in this process. */
|
|
12
|
+
export declare function isNuxtServerInitialized(): boolean;
|
|
13
|
+
/** Records that the Nuxt server SDK initialized in this process. */
|
|
14
|
+
export declare function markNuxtServerInitialized(): void;
|
|
5
15
|
//# sourceMappingURL=devMode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devMode.d.ts","sourceRoot":"","sources":["../../../src/common/devMode.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"devMode.d.ts","sourceRoot":"","sources":["../../../src/common/devMode.ts"],"names":[],"mappings":"AAEA,uGAAuG;AACvG,eAAO,MAAM,kBAAkB,6BAA6B,CAAC;AAE7D,sFAAsF;AACtF,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,wGAAwG;AACxG,eAAO,MAAM,4BAA4B,uCAAuC,CAAC;AAEjF,6CAA6C;AAC7C,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,oFAAoF;AACpF,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED,oEAAoE;AACpE,wBAAgB,uBAAuB,IAAI,OAAO,CAEjD;AAED,oEAAoE;AACpE,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD"}
|
|
@@ -51,6 +51,10 @@ export type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
51
51
|
* If `"experimental_dynamic-import"` is enabled, the Sentry SDK wraps the server entry file with `import()`.
|
|
52
52
|
*
|
|
53
53
|
* @default undefined
|
|
54
|
+
*
|
|
55
|
+
* @deprecated The Sentry server config is bundled into the Nitro server build by default now and
|
|
56
|
+
* initializes itself at server startup — no `node --import` preload and no inject mode needed.
|
|
57
|
+
* Remove this option to use the default behavior. It will be removed in a future major version.
|
|
54
58
|
*/
|
|
55
59
|
autoInjectServerSentry?: 'top-level-import' | 'experimental_dynamic-import';
|
|
56
60
|
/**
|
|
@@ -80,6 +84,9 @@ export type SentryNuxtModuleOptions = BuildTimeOptionsBase & {
|
|
|
80
84
|
* Any wrapped export is expected to be an async function.
|
|
81
85
|
*
|
|
82
86
|
* @default ['default', 'handler', 'server']
|
|
87
|
+
*
|
|
88
|
+
* @deprecated Only used with the deprecated `autoInjectServerSentry: 'experimental_dynamic-import'`
|
|
89
|
+
* mode. It will be removed in a future major version together with that mode.
|
|
83
90
|
*/
|
|
84
91
|
experimental_entrypointWrappedFunctions?: string[];
|
|
85
92
|
};
|
|
@@ -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,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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,sBAAsB,CAAC,EAAE,kBAAkB,GAAG,6BAA6B,CAAC;IAE5E;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;;;;;;;;;;OAaG;IACH,uCAAuC,CAAC,EAAE,MAAM,EAAE,CAAC;CACpD,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;AAe9D,MAAM,MAAM,aAAa,GAAG,uBAAuB,CAAC"}
|
|
@@ -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":"AAiBA,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":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAS,cAAc,EAAE,MAAM,cAAc,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;AAkBlE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,GAAG,SAAS,CA8CzE;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,14 +1,7 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema';
|
|
2
2
|
import type { Nitro } from 'nitropack';
|
|
3
|
+
import type { InputPluginOption } from 'rollup';
|
|
3
4
|
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;
|
|
12
5
|
/**
|
|
13
6
|
* 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.
|
|
14
7
|
*
|
|
@@ -21,6 +14,16 @@ export declare function addServerConfigToBuild(moduleOptions: SentryNuxtModuleOp
|
|
|
21
14
|
* However, only limited tracing instrumentation is supported when doing this.
|
|
22
15
|
*/
|
|
23
16
|
export declare function addSentryTopImport(moduleOptions: SentryNuxtModuleOptions, nitro: Nitro): void;
|
|
17
|
+
/**
|
|
18
|
+
* Registers a Nitro plugin that statically imports the Sentry server config, so the SDK initializes
|
|
19
|
+
* at server startup without a `node --import` preload.
|
|
20
|
+
*/
|
|
21
|
+
export declare function addServerConfigPlugin(nuxt: Nuxt, serverConfigFile: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Writes a shim to the former `--import` config path, so existing `node --import` start commands
|
|
24
|
+
* keep working now that the config is bundled into the server build.
|
|
25
|
+
*/
|
|
26
|
+
export declare function addServerConfigShimWithWarning(nitro: Nitro): void;
|
|
24
27
|
/**
|
|
25
28
|
* This function modifies the Rollup configuration to include a plugin that wraps the entry file with a dynamic import (`import()`)
|
|
26
29
|
* and adds the Sentry server config with the static `import` declaration.
|
|
@@ -29,4 +32,16 @@ export declare function addSentryTopImport(moduleOptions: SentryNuxtModuleOption
|
|
|
29
32
|
* See: https://nodejs.org/api/module.html#enabling
|
|
30
33
|
*/
|
|
31
34
|
export declare function addDynamicImportEntryFileWrapper(nitro: Nitro, serverConfigFile: string, moduleOptions: Omit<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'> & Required<Pick<SentryNuxtModuleOptions, 'experimental_entrypointWrappedFunctions'>>): void;
|
|
35
|
+
/**
|
|
36
|
+
* A Rollup plugin which wraps the server entry with a dynamic `import()`. This makes it possible to initialize Sentry first
|
|
37
|
+
* by using a regular `import` and load the server after that.
|
|
38
|
+
* This also works with serverless `handler` functions, as it re-exports the `handler`.
|
|
39
|
+
*
|
|
40
|
+
* Only exported for testing.
|
|
41
|
+
*/
|
|
42
|
+
export declare function wrapEntryWithDynamicImport({ resolvedSentryConfigPath, experimental_entrypointWrappedFunctions, debug, }: {
|
|
43
|
+
resolvedSentryConfigPath: string;
|
|
44
|
+
experimental_entrypointWrappedFunctions: string[];
|
|
45
|
+
debug?: boolean;
|
|
46
|
+
}): InputPluginOption;
|
|
32
47
|
//# sourceMappingURL=addServerConfig.d.ts.map
|
|
@@ -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":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEhD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAyB/D;;;;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;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAsEhF;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAyBjE;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,CAmBN;AAyCD;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,wBAAwB,EACxB,uCAAuC,EACvC,KAAK,GACN,EAAE;IACD,wBAAwB,EAAE,MAAM,CAAC;IACjC,uCAAuC,EAAE,MAAM,EAAE,CAAC;IAClD,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,GAAG,iBAAiB,CAwFpB"}
|
|
@@ -7,6 +7,7 @@ export declare function addMiddlewareImports(): void;
|
|
|
7
7
|
* Adds middleware instrumentation to the Nitro build.
|
|
8
8
|
*
|
|
9
9
|
* @param nitro Nitro instance
|
|
10
|
+
* @param isNitroV3 Whether the app builds with Nitro v3 (Nuxt 5)
|
|
10
11
|
*/
|
|
11
|
-
export declare function addMiddlewareInstrumentation(nitro: Nitro): void;
|
|
12
|
+
export declare function addMiddlewareInstrumentation(nitro: Nitro, isNitroV3: boolean): void;
|
|
12
13
|
//# sourceMappingURL=middlewareConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middlewareConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/middlewareConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAED
|
|
1
|
+
{"version":3,"file":"middlewareConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/middlewareConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CAO3C;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAYnF"}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"orchestrion.d.ts","sourceRoot":"","sources":["../../../src/vite/orchestrion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUzC;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,wBAAwB,CAAC,EAAE,OAAO,GAAG,IAAI,CAuC/G"}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import type { Nuxt } from '@nuxt/schema';
|
|
2
2
|
import type { SentryNuxtModuleOptions } from '../common/types';
|
|
3
3
|
/**
|
|
4
|
-
* Gets the major version of the
|
|
5
|
-
* Returns 2 as the default if
|
|
4
|
+
* Gets the major version of the Nitro package used by the app's Nuxt installation.
|
|
5
|
+
* Returns 2 as the default if the version cannot be determined.
|
|
6
|
+
*
|
|
7
|
+
* Nitro v2 is published as `nitropack`, v3 as `nitro`. Resolving `nitro` directly is
|
|
8
|
+
* unreliable: module resolution walks up the directory tree, so in a monorepo an
|
|
9
|
+
* unrelated `nitro` v3 above the app wins even when the app's Nuxt uses `nitropack` v2.
|
|
10
|
+
* Instead, follow the dependency chain Nuxt itself imports Nitro through:
|
|
11
|
+
* `nuxt` -> (`@nuxt/nitro-server` ->) `nitro` | `nitropack`.
|
|
6
12
|
*/
|
|
7
|
-
export declare function getNitroMajorVersion(): Promise<number>;
|
|
13
|
+
export declare function getNitroMajorVersion(rootDir: string): Promise<number>;
|
|
8
14
|
/**
|
|
9
15
|
* Find the default SDK init file for the given type (client or server).
|
|
10
16
|
*/
|
|
11
17
|
export declare function findDefaultSdkInitFile(type: 'server' | 'client', nuxt?: Nuxt, options?: SentryNuxtModuleOptions): Promise<string | undefined>;
|
|
12
18
|
export declare const SERVER_CONFIG_FILENAME = "sentry.server.config";
|
|
19
|
+
/** Whether a resolved Nitro preset targets Cloudflare (workerd). Nitro normalizes preset names, so any `cloudflare*` spelling matches. */
|
|
20
|
+
export declare function isCloudflarePreset(preset: string | undefined): boolean;
|
|
13
21
|
/** Builds the value for `node --import`. Node reads it as a URL, so it needs forward slashes on Windows too. */
|
|
14
22
|
export declare function toImportSpecifier(fromDir: string, filePath: string): string;
|
|
15
23
|
/**
|
|
@@ -47,6 +55,17 @@ export declare function constructWrappedFunctionExportQuery(exportedBindings: Re
|
|
|
47
55
|
* Constructs a code snippet with function reexports (can be used in Rollup plugins as a return value for `load()`)
|
|
48
56
|
*/
|
|
49
57
|
export declare function constructFunctionReExport(pathWithQuery: string, entryId: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* `load()` emits `file://` specifiers because Node's ESM loader rejects bare Windows
|
|
60
|
+
* paths (`ERR_UNSUPPORTED_ESM_URL_SCHEME`), but Rollup's resolver only understands
|
|
61
|
+
* filesystem paths. Returns `undefined` for a malformed `file://` URL.
|
|
62
|
+
*
|
|
63
|
+
* Only exported for testing.
|
|
64
|
+
*/
|
|
65
|
+
export declare function toResolvablePath(source: string): {
|
|
66
|
+
path: string;
|
|
67
|
+
wasFileUrl: boolean;
|
|
68
|
+
} | undefined;
|
|
50
69
|
/**
|
|
51
70
|
* Sets up alias to work around OpenTelemetry's incomplete ESM imports.
|
|
52
71
|
* https://github.com/getsentry/sentry-javascript/issues/15204
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/vite/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAKzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAG/D;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA2B3E;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,uBAAuB,GAChC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CA0B7B;AAED,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D,0IAA0I;AAC1I,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEtE;AAED,gHAAgH;AAChH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIlF;AAED,eAAO,MAAM,oBAAoB,gCAAgC,CAAC;AAClE,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAC3E,eAAO,MAAM,2BAA2B,wCAAwC,CAAC;AACjF,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CA2B5G;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,EACjD,0BAA0B,EAAE,MAAM,EAAE,EACpC,KAAK,CAAC,EAAE,OAAO,GACd,MAAM,CAmCR;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsBxF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAgBlG;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,UAAQ,GAAG,IAAI,CAY9E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/nuxt",
|
|
3
|
-
"version": "11.0.0-beta.
|
|
3
|
+
"version": "11.0.0-beta.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,15 +54,15 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@nuxt/kit": "^4.5.2",
|
|
57
|
-
"@sentry/browser": "11.0.0-beta.
|
|
58
|
-
"@sentry/cloudflare": "11.0.0-beta.
|
|
57
|
+
"@sentry/browser": "11.0.0-beta.2",
|
|
58
|
+
"@sentry/cloudflare": "11.0.0-beta.2",
|
|
59
59
|
"@sentry/conventions": "^0.20.0",
|
|
60
|
-
"@sentry/core": "11.0.0-beta.
|
|
61
|
-
"@sentry/node": "11.0.0-beta.
|
|
62
|
-
"@sentry/bundler-plugins": "11.0.0-beta.
|
|
63
|
-
"@sentry/server-runtime-injection": "11.0.0-beta.
|
|
64
|
-
"@sentry/server-utils": "11.0.0-beta.
|
|
65
|
-
"@sentry/vue": "11.0.0-beta.
|
|
60
|
+
"@sentry/core": "11.0.0-beta.2",
|
|
61
|
+
"@sentry/node": "11.0.0-beta.2",
|
|
62
|
+
"@sentry/bundler-plugins": "11.0.0-beta.2",
|
|
63
|
+
"@sentry/server-runtime-injection": "11.0.0-beta.2",
|
|
64
|
+
"@sentry/server-utils": "11.0.0-beta.2",
|
|
65
|
+
"@sentry/vue": "11.0.0-beta.2",
|
|
66
66
|
"local-pkg": "^1.1.2"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|