From 41028d4de377339f9d688fe4e2e485e2ab3eea4a Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Wed, 26 Jun 2024 13:37:08 -0400 Subject: [PATCH 1/8] #noissue add yarn.lock --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 215fa9e7..a4603d03 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12777,7 +12777,7 @@ vite-node@1.2.2: picocolors "^1.0.0" vite "^5.0.0" -vite@^5.0.0, vite@^5.1.0-beta.6: +vite@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/vite/-/vite-5.1.1.tgz#294e39b199d669981efc7e0261b14f78ec80819e" integrity sha512-wclpAgY3F1tR7t9LL5CcHC41YPkQIpKUGeIuT8MdNwNZr6OqOTLs7JX5vIHAtzqLWXts0T+GDrh9pN2arneKqg== From f711f37c1a01b6fc4fce616e76db2bcf3129e7c3 Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Thu, 27 Jun 2024 15:45:29 -0400 Subject: [PATCH 2/8] CNETDEV-37718 initial v8 migrations --- package.json | 13 ++++----- src/hooks.ts | 2 +- src/module.ts | 2 +- src/options.ts | 65 ++++++++++++++++++++++++++++--------------- src/types/sentry.d.ts | 2 +- tsconfig.json | 6 ++-- 6 files changed, 54 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 327f17a7..5757c816 100755 --- a/package.json +++ b/package.json @@ -59,11 +59,10 @@ } }, "dependencies": { - "@sentry/core": "^7.100.0", - "@sentry/integrations": "^7.100.0", - "@sentry/node": "^7.100.0", - "@sentry/utils": "^7.100.0", - "@sentry/vue": "^7.100.0", + "@sentry/core": "^8.13.0", + "@sentry/node": "^8.13.0", + "@sentry/utils": "^8.13.0", + "@sentry/vue": "^8.13.0", "consola": "^3.2.3", "defu": "^6.1.4", "hash-sum": "^2.0.0", @@ -79,8 +78,8 @@ "@nuxtjs/eslint-config-typescript": "12.1.0", "@nuxtjs/module-test-utils": "1.6.3", "@release-it/conventional-changelog": "8.0.1", - "@sentry/profiling-node": "7.100.0", - "@sentry/webpack-plugin": "2.14.0", + "@sentry/profiling-node": "^8.13.0", + "@sentry/webpack-plugin": "^2.20.1", "@size-limit/file": "11.0.2", "@types/hash-sum": "1.0.2", "@types/lodash.mergewith": "4.6.9", diff --git a/src/hooks.ts b/src/hooks.ts index 134aed80..14f4fefa 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -83,7 +83,7 @@ export async function webpackConfigHook (nuxt: Nuxt, webpackConfigs: WebpackConf if (!publishRelease.release) { publishRelease.release = {} } - publishRelease.release.name = publishRelease.release.name || options.config.release || await resolveRelease(options) + publishRelease.release.name = publishRelease.release.name || options.config.release || (await resolveRelease(options)) if (!publishRelease.release.name) { // We've already tried to determine "release" manually using Sentry CLI so to avoid webpack plugin crashing, we'll just bail here. logger.warn('Sentry release will not be published because "config.release" or "publishRelease.release.name" was not set nor it ' + diff --git a/src/module.ts b/src/module.ts index a8a55f11..bf3b8237 100644 --- a/src/module.ts +++ b/src/module.ts @@ -88,7 +88,7 @@ export default defineNuxtModule({ 'lodash.mergewith', '@sentry/browser', '@sentry/core', - '@sentry/integrations', + // '@sentry/integrations', '@sentry/utils', '@sentry/vue', ] diff --git a/src/options.ts b/src/options.ts index 03a11713..983e97ae 100644 --- a/src/options.ts +++ b/src/options.ts @@ -3,10 +3,10 @@ import type { ConsolaInstance } from 'consola' import { defu } from 'defu' import initJiti from 'jiti' import { relative } from 'pathe' -import { Integrations as SentryNodeIntegrations, autoDiscoverNodePerformanceMonitoringIntegrations } from '@sentry/node' -import type Sentry from '@sentry/node' +import { getDefaultIntegrations, httpIntegration } from '@sentry/node' +import type * as Sentry from '@sentry/node' import * as SentryCore from '@sentry/core' -import * as PluggableIntegrations from '@sentry/integrations' +import * as PluggableIntegrations from '@sentry/vue' import type { Integration, Options } from '@sentry/types' import type { LazyConfiguration, TracingConfiguration } from './types/configuration' import type { AllIntegrations, BrowserIntegrations, ClientCoreIntegrations, ClientIntegrations, ClientPluggableIntegrations, NodeIntegrations, NodeProfilingIntegrations, ServerCoreIntegrations, ServerIntegrations, ServerPluggableIntegrations } from './types/sentry' @@ -38,6 +38,16 @@ export const BROWSER_INTEGRATIONS: BooleanMap = { HttpContext: true, Replay: true, TryCatch: true, + // Integrations that are now exported from @sentry/browser + CaptureConsole: true, + ContextLines: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + HttpClient: true, + ReportingObserver: true, + RewriteFrames: true, + SessionTiming: true, } // Optional in Vue - https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/plugin/ @@ -81,6 +91,13 @@ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Prisma: true, Spotlight: true, Undici: true, + // Integrations that are now exported from @sentry/node and @sentry/browser: + CaptureConsole: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + RewriteFrames: true, + SessionTiming: true, } // Optional in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/pluggable-integrations/ @@ -100,7 +117,7 @@ const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { Apollo: 'Apollo', Breadcrumbs: 'breadcrumbsIntegration', CaptureConsole: 'captureConsoleIntegration', - Console: 'Console', + Console: 'consoleIntegration', Context: 'Context', ContextLines: 'contextLinesIntegration', Debug: 'debugIntegration', @@ -111,17 +128,17 @@ const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { GlobalHandlers: 'globalHandlersIntegration', GraphQL: 'GraphQL', Hapi: 'Hapi', - Http: 'Http', + Http: 'httpIntegration', HttpClient: 'httpClientIntegration', HttpContext: 'httpContextIntegration', InboundFilters: 'inboundFiltersIntegration', LinkedErrors: 'linkedErrorsIntegration', - LocalVariables: 'LocalVariables', + LocalVariables: 'localVariablesIntegration', Modules: 'Modules', Mongo: 'Mongo', Mysql: 'Mysql', - OnUncaughtException: 'OnUncaughtException', - OnUnhandledRejection: 'OnUnhandledRejection', + OnUncaughtException: 'onUncaughtExceptionIntegration', + OnUnhandledRejection: 'onUnhandledRejectionIntegration', Postgres: 'Postgres', Prisma: 'Prisma', ProfilingIntegration: 'ProfilingIntegration', @@ -135,17 +152,17 @@ const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { Undici: 'Undici', } -function mapClientIntegrationToImportName (key: keyof ClientIntegrations): string { +function mapIntegrationToImportName (key: keyof IntegrationToImportMapping): string { return INTEGRATION_TO_IMPORT_NAME_MAP[key] } -function mapServerIntegrationToImportName (key: keyof ServerIntegrations): string { - if (key === 'ContextLines') { - return 'ContextLines' - } +// function mapServerIntegrationToImportName (key: keyof ServerIntegrations): string { +// if (key === 'ContextLines') { +// return 'ContextLines' +// } - return INTEGRATION_TO_IMPORT_NAME_MAP[key] -} +// return INTEGRATION_TO_IMPORT_NAME_MAP[key] +// } // External and optional Node.js integration - https://docs.sentry.io/platforms/node/profiling/ export const SERVER_PROFILING_INTEGRATION: keyof Pick = 'ProfilingIntegration' @@ -327,18 +344,19 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< const importsBrowser: string[] = [] const importsCore: string[] = [] - const importsPluggable: string[] = [] + // const importsPluggable: string[] = [] const integrations = getEnabledIntegrations(options.clientIntegrations) .reduce((res, key) => { - const importName = mapClientIntegrationToImportName(key) + const importName = mapIntegrationToImportName(key) if (key in BROWSER_INTEGRATIONS) { importsBrowser.push(importName) } else if (key in BROWSER_CORE_INTEGRATIONS) { importsCore.push(importName) } else if (key in BROWSER_PLUGGABLE_INTEGRATIONS) { - importsPluggable.push(importName) + // importsPluggable.push(importName) + importsBrowser.push(importName) } res[importName] = options.clientIntegrations[key] @@ -348,7 +366,7 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< const imports = { '~@sentry/browser': importsBrowser, '~@sentry/core': importsCore, - '~@sentry/integrations': importsPluggable, + // '~@sentry/integrations': importsPluggable, '~@sentry/vue': ['init', ...(options.tracing ? ['browserTracingIntegration'] : [])], } @@ -435,12 +453,13 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< } } + // console.log(PluggableIntegrations) + const resolvedIntegrations = [ // Automatically instrument Node.js libraries and frameworks - ...(options.tracing ? autoDiscoverNodePerformanceMonitoringIntegrations() : []), ...getEnabledIntegrations(options.serverIntegrations) .map((name) => { - const importName = mapServerIntegrationToImportName(name) + const importName = mapIntegrationToImportName(name) const opt = options.serverIntegrations[name] try { if (isServerCoreIntegration(name)) { @@ -448,10 +467,10 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< // eslint-disable-next-line import/namespace return Object.keys(opt as Record).length ? SentryCore[importName](opt) : SentryCore[importName]() } else if (isServerNodeIntegration(name)) { - // @ts-expect-error Some integrations don't take arguments but it doesn't hurt to pass one. - return Object.keys(opt as Record).length ? new SentryNodeIntegrations[name](opt) : new SentryNodeIntegrations[name]() + return getDefaultIntegrations(opt).find(integration => integration.name === name) } else if (isServerPlugabbleIntegration(name)) { // @ts-expect-error Some integrations don't take arguments but it doesn't hurt to pass one. + // console.log(PluggableIntegrations[importName]) // eslint-disable-next-line import/namespace return Object.keys(opt as Record).length ? PluggableIntegrations[importName](opt) : PluggableIntegrations[importName]() } else { diff --git a/src/types/sentry.d.ts b/src/types/sentry.d.ts index 09c3cb1d..6176b99c 100644 --- a/src/types/sentry.d.ts +++ b/src/types/sentry.d.ts @@ -22,7 +22,7 @@ import { reportingObserverIntegration, rewriteFramesIntegration, sessionTimingIntegration, -} from '@sentry/integrations' +} from '@sentry/vue' import { Integrations, } from '@sentry/node' diff --git a/tsconfig.json b/tsconfig.json index c89f6efe..561d0557 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,9 +15,9 @@ "~@sentry/core": [ "./node_modules/@sentry/core" ], - "~@sentry/integrations": [ - "./node_modules/@sentry/integrations" - ], + // "~@sentry/integrations": [ + // "./node_modules/@sentry/integrations" + // ], "~@sentry/utils": [ "./node_modules/@sentry/utils" ], From 11acf2a35f2b21618d6a9102ba93e3bf0fd31a92 Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Fri, 28 Jun 2024 12:22:45 -0400 Subject: [PATCH 3/8] CNETDEV-37718 fix handlers and some clean up --- src/hooks.ts | 10 +- src/module.ts | 22 +- src/options.ts | 100 +++-- yarn.lock | 1117 +++++++++++++++++++++++++++++++++++++++--------- 4 files changed, 959 insertions(+), 290 deletions(-) diff --git a/src/hooks.ts b/src/hooks.ts index 14f4fefa..efaf5420 100644 --- a/src/hooks.ts +++ b/src/hooks.ts @@ -11,7 +11,6 @@ import type { Nuxt } from './kit-shim' import type { ModuleConfiguration } from './types/configuration' import { clientSentryEnabled, serverSentryEnabled, canInitialize } from './utils' import { resolveRelease, ResolvedClientOptions, resolveClientOptions, ResolvedServerOptions, resolveServerOptions } from './options' -import type { SentryHandlerProxy } from './options' const RESOLVED_RELEASE_FILENAME = 'sentry.release.config.mjs' @@ -98,7 +97,7 @@ export async function webpackConfigHook (nuxt: Nuxt, webpackConfigs: WebpackConf } } -export async function initializeServerSentry (nuxt: Nuxt, moduleOptions: ModuleConfiguration, sentryHandlerProxy: SentryHandlerProxy, logger: ConsolaInstance): Promise { +export async function initializeServerSentry (nuxt: Nuxt, moduleOptions: ModuleConfiguration, logger: ConsolaInstance): Promise { if (process.sentry) { return } @@ -118,11 +117,8 @@ export async function initializeServerSentry (nuxt: Nuxt, moduleOptions: ModuleC if (canInitialize(moduleOptions)) { Sentry.init(config) - sentryHandlerProxy.errorHandler = Sentry.Handlers.errorHandler() - sentryHandlerProxy.requestHandler = Sentry.Handlers.requestHandler(moduleOptions.requestHandlerConfig) - if (serverOptions.tracing) { - sentryHandlerProxy.tracingHandler = Sentry.Handlers.tracingHandler() - } + // https://docs.sentry.io/platforms/javascript/guides/express/migration/v7-to-v8/#updated-sdk-initialization + nuxt.hook('render:setupMiddleware', (app: any) => app.use(() => Sentry.setupExpressErrorHandler(app))) } } diff --git a/src/module.ts b/src/module.ts index bf3b8237..ab82182a 100644 --- a/src/module.ts +++ b/src/module.ts @@ -7,7 +7,6 @@ import type { Configuration as WebpackConfig } from 'webpack' import { defineNuxtModule, isNuxt2, useLogger } from './kit-shim' import { envToBool, boolToText, callOnce, canInitialize, clientSentryEnabled, serverSentryEnabled } from './utils' import { buildHook, initializeServerSentry, shutdownServerSentry, webpackConfigHook } from './hooks' -import type { SentryHandlerProxy } from './options' import type { ModuleConfiguration, ModuleOptions, ModulePublicRuntimeConfig } from './types' export type { ModuleOptions, ModulePublicRuntimeConfig } @@ -88,7 +87,6 @@ export default defineNuxtModule({ 'lodash.mergewith', '@sentry/browser', '@sentry/core', - // '@sentry/integrations', '@sentry/utils', '@sentry/vue', ] @@ -97,24 +95,6 @@ export default defineNuxtModule({ } if (serverSentryEnabled(options)) { - /** - * Proxy that provides a dummy request handler before Sentry is initialized and gets replaced with Sentry's own - * handler after initialization. Otherwise server-side request tracing would not work as it depends on Sentry being - * initialized already during handler creation. - */ - const sentryHandlerProxy: SentryHandlerProxy = { - errorHandler: (error, _, __, next) => { next(error) }, - requestHandler: (_, __, next) => { next() }, - tracingHandler: (_, __, next) => { next() }, - } - // @ts-expect-error Nuxt 2 only hook - nuxt.hook('render:setupMiddleware', app => app.use((req, res, next) => { sentryHandlerProxy.requestHandler(req, res, next) })) - if (options.tracing) { - // @ts-expect-error Nuxt 2 only hook - nuxt.hook('render:setupMiddleware', app => app.use((req, res, next) => { sentryHandlerProxy.tracingHandler(req, res, next) })) - } - // @ts-expect-error Nuxt 2 only hook - nuxt.hook('render:errorMiddleware', app => app.use((error, req, res, next) => { sentryHandlerProxy.errorHandler(error, req, res, next) })) // @ts-expect-error Nuxt 2 only hook nuxt.hook('generate:routeFailed', ({ route, errors }) => { type routeGeneretorError = { @@ -139,7 +119,7 @@ export default defineNuxtModule({ if (isNuxt2()) { const isBuilding = nuxt.options._build && !nuxt.options.dev const initHook = isBuilding ? 'build:compile' : 'ready' - nuxt.hook(initHook, () => initializeServerSentry(nuxt, options, sentryHandlerProxy, logger)) + nuxt.hook(initHook, () => initializeServerSentry(nuxt, options, logger)) const shutdownHook = isBuilding ? 'build:done' : 'close' const shutdownServerSentryOnce = callOnce(() => shutdownServerSentry()) nuxt.hook(shutdownHook, shutdownServerSentryOnce) diff --git a/src/options.ts b/src/options.ts index 983e97ae..68001b1c 100644 --- a/src/options.ts +++ b/src/options.ts @@ -3,10 +3,11 @@ import type { ConsolaInstance } from 'consola' import { defu } from 'defu' import initJiti from 'jiti' import { relative } from 'pathe' -import { getDefaultIntegrations, httpIntegration } from '@sentry/node' +// import { getDefaultIntegrations } from '@sentry/node' +import * as SentryNode from '@sentry/node' import type * as Sentry from '@sentry/node' import * as SentryCore from '@sentry/core' -import * as PluggableIntegrations from '@sentry/vue' +// import * as PluggableIntegrations from '@sentry/vue' import type { Integration, Options } from '@sentry/types' import type { LazyConfiguration, TracingConfiguration } from './types/configuration' import type { AllIntegrations, BrowserIntegrations, ClientCoreIntegrations, ClientIntegrations, ClientPluggableIntegrations, NodeIntegrations, NodeProfilingIntegrations, ServerCoreIntegrations, ServerIntegrations, ServerPluggableIntegrations } from './types/sentry' @@ -16,12 +17,6 @@ import { canInitialize } from './utils' const jiti = initJiti(fileURLToPath(import.meta.url)) -export interface SentryHandlerProxy { - errorHandler: ReturnType - requestHandler: ReturnType - tracingHandler: ReturnType -} - type BooleanMap> = Record type IntegrationToImportMapping = Record @@ -51,23 +46,30 @@ export const BROWSER_INTEGRATIONS: BooleanMap = { } // Optional in Vue - https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/plugin/ -export const BROWSER_PLUGGABLE_INTEGRATIONS: BooleanMap = { - CaptureConsole: true, - ContextLines: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - HttpClient: true, - ReportingObserver: true, - RewriteFrames: true, - SessionTiming: true, -} +// export const BROWSER_PLUGGABLE_INTEGRATIONS: BooleanMap = { +// CaptureConsole: true, +// ContextLines: true, +// Debug: true, +// Dedupe: true, +// ExtraErrorData: true, +// HttpClient: true, +// ReportingObserver: true, +// RewriteFrames: true, +// SessionTiming: true, +// } const SERVER_CORE_INTEGRATIONS: BooleanMap = { FunctionToString: true, InboundFilters: true, LinkedErrors: true, RequestData: true, + // Integrations that are now exported from @sentry/node and @sentry/browser: + CaptureConsole: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + RewriteFrames: true, + SessionTiming: true, } // Enabled by default in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/ @@ -91,26 +93,19 @@ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Prisma: true, Spotlight: true, Undici: true, - // Integrations that are now exported from @sentry/node and @sentry/browser: - CaptureConsole: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - RewriteFrames: true, - SessionTiming: true, } // Optional in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/pluggable-integrations/ -const SERVER_PLUGGABLE_INTEGRATIONS: BooleanMap = { - CaptureConsole: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - HttpClient: true, - ReportingObserver: true, - RewriteFrames: true, - SessionTiming: true, -} +// const SERVER_PLUGGABLE_INTEGRATIONS: BooleanMap = { +// CaptureConsole: true, +// Debug: true, +// Dedupe: true, +// ExtraErrorData: true, +// HttpClient: true, +// ReportingObserver: true, +// RewriteFrames: true, +// SessionTiming: true, +// } const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { Anr: 'Anr', @@ -187,9 +182,9 @@ function isBrowserDefaultIntegration (name: string): name is keyof BrowserIntegr return name in BROWSER_INTEGRATIONS } -function isBrowserPluggableIntegration (name: string): name is keyof ClientPluggableIntegrations { - return name in BROWSER_PLUGGABLE_INTEGRATIONS -} +// function isBrowserPluggableIntegration (name: string): name is keyof ClientPluggableIntegrations { +// return name in BROWSER_PLUGGABLE_INTEGRATIONS +// } function isServerCoreIntegration (name: string): name is keyof ServerCoreIntegrations { return name in SERVER_CORE_INTEGRATIONS @@ -199,9 +194,9 @@ function isServerNodeIntegration (name: string): name is keyof NodeIntegrations return name in SERVER_NODE_INTEGRATIONS } -function isServerPlugabbleIntegration (name: string): name is keyof ServerPluggableIntegrations { - return name in SERVER_PLUGGABLE_INTEGRATIONS -} +// function isServerPlugabbleIntegration (name: string): name is keyof ServerPluggableIntegrations { +// return name in SERVER_PLUGGABLE_INTEGRATIONS +// } async function getApiMethods (packageName: string): Promise { const packageApi = await import(packageName) @@ -326,7 +321,8 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< resolveTracingOptions(options) for (const name of getIntegrationsKeys(options.clientIntegrations)) { - if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name) && !isBrowserPluggableIntegration(name)) { + // if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name) && !isBrowserPluggableIntegration(name)) { + if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name)) { logger.warn(`Sentry clientIntegration "${name}" is not recognized and will be ignored.`) delete options.clientIntegrations[name] } @@ -354,9 +350,9 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< importsBrowser.push(importName) } else if (key in BROWSER_CORE_INTEGRATIONS) { importsCore.push(importName) - } else if (key in BROWSER_PLUGGABLE_INTEGRATIONS) { + // } else if (key in BROWSER_PLUGGABLE_INTEGRATIONS) { // importsPluggable.push(importName) - importsBrowser.push(importName) + // importsBrowser.push(importName) } res[importName] = options.clientIntegrations[key] @@ -419,7 +415,8 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< options.config = defu(getServerRuntimeConfig(nuxt, options), options.serverConfig, options.config) for (const name of getIntegrationsKeys(options.serverIntegrations)) { - if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && !isServerPlugabbleIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { + // if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && !isServerPlugabbleIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { + if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { logger.warn(`Sentry serverIntegration "${name}" is not recognized and will be ignored.`) delete options.serverIntegrations[name] } @@ -453,8 +450,6 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< } } - // console.log(PluggableIntegrations) - const resolvedIntegrations = [ // Automatically instrument Node.js libraries and frameworks ...getEnabledIntegrations(options.serverIntegrations) @@ -467,12 +462,13 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< // eslint-disable-next-line import/namespace return Object.keys(opt as Record).length ? SentryCore[importName](opt) : SentryCore[importName]() } else if (isServerNodeIntegration(name)) { - return getDefaultIntegrations(opt).find(integration => integration.name === name) - } else if (isServerPlugabbleIntegration(name)) { + // return getDefaultIntegrations(opt).find(integration => integration.name === name) // @ts-expect-error Some integrations don't take arguments but it doesn't hurt to pass one. - // console.log(PluggableIntegrations[importName]) // eslint-disable-next-line import/namespace - return Object.keys(opt as Record).length ? PluggableIntegrations[importName](opt) : PluggableIntegrations[importName]() + return Object.keys(opt as Record).length ? SentryNode[importName](opt) : SentryNode[importName]() + // } else if (isServerPlugabbleIntegration(name)) { + // // eslint-disable-next-line import/namespace + // return Object.keys(opt as Record).length ? PluggableIntegrations[importName](opt) : PluggableIntegrations[importName]() } else { throw new Error(`Unsupported server integration "${name}"`) } diff --git a/yarn.lock b/yarn.lock index a4603d03..5b36c726 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@ampproject/remapping@^2.1.0", "@ampproject/remapping@^2.2.0": +"@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== @@ -15,7 +15,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.8.3": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.21.4", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.8.3": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== @@ -23,31 +23,44 @@ "@babel/highlight" "^7.23.4" chalk "^2.4.2" +"@babel/code-frame@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.24.7.tgz#882fd9e09e8ee324e496bd040401c6f046ef4465" + integrity sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA== + dependencies: + "@babel/highlight" "^7.24.7" + picocolors "^1.0.0" + "@babel/compat-data@^7.22.6", "@babel/compat-data@^7.23.3", "@babel/compat-data@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== -"@babel/core@7.18.5": - version "7.18.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.5.tgz#c597fa680e58d571c28dda9827669c78cdd7f000" - integrity sha512-MGY8vg3DxMnctw0LdvSEojOsumc70g0t18gNyUdAZqB1Rpd1Bqo/svHGvt+UJ6JcGX+DIekGFDxxIWofBxLCnQ== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-compilation-targets" "^7.18.2" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helpers" "^7.18.2" - "@babel/parser" "^7.18.5" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.5" - "@babel/types" "^7.18.4" - convert-source-map "^1.7.0" +"@babel/compat-data@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.24.7.tgz#d23bbea508c3883ba8251fb4164982c36ea577ed" + integrity sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw== + +"@babel/core@^7.18.5": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.24.7.tgz#b676450141e0b52a3d43bc91da86aa608f950ac4" + integrity sha512-nykK+LEK86ahTkX/3TgauT0ikKoNCfKHEaZYTUVupJdTLzGNvrblu4u6fa7DhZONAltdf8e662t/abY8idrd/g== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.7" + "@babel/helper-compilation-targets" "^7.24.7" + "@babel/helper-module-transforms" "^7.24.7" + "@babel/helpers" "^7.24.7" + "@babel/parser" "^7.24.7" + "@babel/template" "^7.24.7" + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" + json5 "^2.2.3" + semver "^6.3.1" "@babel/core@^7.23.7": version "7.23.9" @@ -70,7 +83,7 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.18.2", "@babel/generator@^7.23.6": +"@babel/generator@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== @@ -80,6 +93,16 @@ "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" +"@babel/generator@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.7.tgz#1654d01de20ad66b4b4d99c135471bc654c55e6d" + integrity sha512-oipXieGC3i45Y1A41t4tAqpnEZWgB/lC6Ehh6+rOviR5XWpTtMmLN+fGjz9vOiNRt0p6RtO6DtD0pdU3vpqdSA== + dependencies: + "@babel/types" "^7.24.7" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.18.6", "@babel/helper-annotate-as-pure@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz#e7f06737b197d580a01edf75d97e2c8be99d3882" @@ -94,7 +117,7 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-compilation-targets@^7.18.2", "@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": +"@babel/helper-compilation-targets@^7.22.15", "@babel/helper-compilation-targets@^7.22.6", "@babel/helper-compilation-targets@^7.23.6": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== @@ -105,6 +128,17 @@ lru-cache "^5.1.1" semver "^6.3.1" +"@babel/helper-compilation-targets@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.24.7.tgz#4eb6c4a80d6ffeac25ab8cd9a21b5dfa48d503a9" + integrity sha512-ctSdRHBi20qWOfy27RUb4Fhp07KSJ3sXcuSvTrXrc4aG8NSYDo1ici3Vhg9bg69y5bj0Mr1lh0aeEgTvc12rMg== + dependencies: + "@babel/compat-data" "^7.24.7" + "@babel/helper-validator-option" "^7.24.7" + browserslist "^4.22.2" + lru-cache "^5.1.1" + semver "^6.3.1" + "@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0", "@babel/helper-create-class-features-plugin@^7.22.15", "@babel/helper-create-class-features-plugin@^7.23.9": version "7.23.10" resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.10.tgz#25d55fafbaea31fd0e723820bb6cc3df72edf7ea" @@ -145,6 +179,13 @@ resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== +"@babel/helper-environment-visitor@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.24.7.tgz#4b31ba9551d1f90781ba83491dd59cf9b269f7d9" + integrity sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-function-name@^7.22.5", "@babel/helper-function-name@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" @@ -153,6 +194,14 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.23.0" +"@babel/helper-function-name@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.24.7.tgz#75f1e1725742f39ac6584ee0b16d94513da38dd2" + integrity sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" @@ -160,6 +209,13 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-hoist-variables@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.24.7.tgz#b4ede1cde2fd89436397f30dc9376ee06b0f25ee" + integrity sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-member-expression-to-functions@^7.22.15", "@babel/helper-member-expression-to-functions@^7.23.0": version "7.23.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz#9263e88cc5e41d39ec18c9a3e0eced59a3e7d366" @@ -174,7 +230,15 @@ dependencies: "@babel/types" "^7.22.15" -"@babel/helper-module-transforms@^7.18.0", "@babel/helper-module-transforms@^7.23.3": +"@babel/helper-module-imports@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.24.7.tgz#f2f980392de5b84c3328fc71d38bd81bbb83042b" + integrity sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + +"@babel/helper-module-transforms@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== @@ -185,6 +249,17 @@ "@babel/helper-split-export-declaration" "^7.22.6" "@babel/helper-validator-identifier" "^7.22.20" +"@babel/helper-module-transforms@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.24.7.tgz#31b6c9a2930679498db65b685b1698bfd6c7daf8" + integrity sha512-1fuJEwIrp+97rM4RWdO+qrRsZlAeL1lQJoPqtCYWv0NL115XM93hIH4CSRln2w52SqvmY5hqdtauB6QFCDiZNQ== + dependencies: + "@babel/helper-environment-visitor" "^7.24.7" + "@babel/helper-module-imports" "^7.24.7" + "@babel/helper-simple-access" "^7.24.7" + "@babel/helper-split-export-declaration" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + "@babel/helper-optimise-call-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz#f21531a9ccbff644fdd156b4077c16ff0c3f609e" @@ -222,6 +297,14 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-simple-access@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.24.7.tgz#bcade8da3aec8ed16b9c4953b74e506b51b5edb3" + integrity sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg== + dependencies: + "@babel/traverse" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/helper-skip-transparent-expression-wrappers@^7.20.0", "@babel/helper-skip-transparent-expression-wrappers@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz#007f15240b5751c537c40e77abb4e89eeaaa8847" @@ -236,21 +319,43 @@ dependencies: "@babel/types" "^7.22.5" +"@babel/helper-split-export-declaration@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.24.7.tgz#83949436890e07fa3d6873c61a96e3bbf692d856" + integrity sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA== + dependencies: + "@babel/types" "^7.24.7" + "@babel/helper-string-parser@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== +"@babel/helper-string-parser@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz#4d2d0f14820ede3b9807ea5fc36dfc8cd7da07f2" + integrity sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg== + "@babel/helper-validator-identifier@^7.19.1", "@babel/helper-validator-identifier@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== +"@babel/helper-validator-identifier@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz#75b889cfaf9e35c2aaf42cf0d72c8e91719251db" + integrity sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w== + "@babel/helper-validator-option@^7.23.5": version "7.23.5" resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== +"@babel/helper-validator-option@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.24.7.tgz#24c3bb77c7a425d1742eec8fb433b5a1b38e62f6" + integrity sha512-yy1/KvjhV/ZCL+SM7hBrvnZJ3ZuT9OuZgIJAGpPEToANvc3iM6iDvBnRjtElWibHU6n8/LPR/EjX9EtIEYO3pw== + "@babel/helper-wrap-function@^7.22.20": version "7.22.20" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.22.20.tgz#15352b0b9bfb10fc9c76f79f6342c00e3411a569" @@ -260,7 +365,7 @@ "@babel/template" "^7.22.15" "@babel/types" "^7.22.19" -"@babel/helpers@^7.18.2", "@babel/helpers@^7.23.9": +"@babel/helpers@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.9.tgz#c3e20bbe7f7a7e10cb9b178384b4affdf5995c7d" integrity sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ== @@ -269,6 +374,14 @@ "@babel/traverse" "^7.23.9" "@babel/types" "^7.23.9" +"@babel/helpers@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.24.7.tgz#aa2ccda29f62185acb5d42fb4a3a1b1082107416" + integrity sha512-NlmJJtvcw72yRJRcnCmGvSi+3jDEg8qFu3z0AFoymmzLx5ERVWyzd9kVXr7Th9/8yIJi2Zc6av4Tqz3wFs8QWg== + dependencies: + "@babel/template" "^7.24.7" + "@babel/types" "^7.24.7" + "@babel/highlight@^7.23.4": version "7.23.4" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" @@ -278,11 +391,26 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.18.5", "@babel/parser@^7.20.7", "@babel/parser@^7.23.5", "@babel/parser@^7.23.9": +"@babel/highlight@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.24.7.tgz#a05ab1df134b286558aae0ed41e6c5f731bf409d" + integrity sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw== + dependencies: + "@babel/helper-validator-identifier" "^7.24.7" + chalk "^2.4.2" + js-tokens "^4.0.0" + picocolors "^1.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.20.7", "@babel/parser@^7.23.5", "@babel/parser@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== +"@babel/parser@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" + integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.23.3.tgz#5cd1c87ba9380d0afb78469292c954fee5d2411a" @@ -1017,7 +1145,7 @@ resolved "https://registry.yarnpkg.com/@babel/standalone/-/standalone-7.23.10.tgz#f28dd3129291d9a26b873930f6d73815401ad540" integrity sha512-xqWviI/pt1Zb/d+6ilWa5IDL2mkDzsBnlHbreqnfyP3/QB/ofQ1bNVcHj8YQX154Rf/xZKR6y0s1ydVF3nAS8g== -"@babel/template@^7.16.7", "@babel/template@^7.22.15", "@babel/template@^7.23.9": +"@babel/template@^7.22.15", "@babel/template@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== @@ -1026,7 +1154,16 @@ "@babel/parser" "^7.23.9" "@babel/types" "^7.23.9" -"@babel/traverse@^7.18.5", "@babel/traverse@^7.23.9": +"@babel/template@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.24.7.tgz#02efcee317d0609d2c07117cb70ef8fb17ab7315" + integrity sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/parser" "^7.24.7" + "@babel/types" "^7.24.7" + +"@babel/traverse@^7.23.9": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" integrity sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg== @@ -1042,7 +1179,23 @@ debug "^4.3.1" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.18.4", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.4.4": +"@babel/traverse@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.24.7.tgz#de2b900163fa741721ba382163fe46a936c40cf5" + integrity sha512-yb65Ed5S/QAcewNPh0nZczy9JdYXkkAbIsEo+P7BE7yO3txAY30Y/oPa3QkQ5It3xVG2kpKMg9MsdxZaO31uKA== + dependencies: + "@babel/code-frame" "^7.24.7" + "@babel/generator" "^7.24.7" + "@babel/helper-environment-visitor" "^7.24.7" + "@babel/helper-function-name" "^7.24.7" + "@babel/helper-hoist-variables" "^7.24.7" + "@babel/helper-split-export-declaration" "^7.24.7" + "@babel/parser" "^7.24.7" + "@babel/types" "^7.24.7" + debug "^4.3.1" + globals "^11.1.0" + +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.19", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.23.9", "@babel/types@^7.4.4": version "7.23.9" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== @@ -1051,6 +1204,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.24.7": + version "7.24.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.24.7.tgz#6027fe12bc1aa724cd32ab113fb7f1988f1f66f2" + integrity sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q== + dependencies: + "@babel/helper-string-parser" "^7.24.7" + "@babel/helper-validator-identifier" "^7.24.7" + to-fast-properties "^2.0.0" + "@csstools/cascade-layer-name-parser@^1.0.5", "@csstools/cascade-layer-name-parser@^1.0.7": version "1.0.7" resolved "https://registry.yarnpkg.com/@csstools/cascade-layer-name-parser/-/cascade-layer-name-parser-1.0.7.tgz#9cfc36de9716d219492eb0e5ee75348b2213a8fd" @@ -1516,6 +1678,15 @@ "@jridgewell/sourcemap-codec" "^1.4.10" "@jridgewell/trace-mapping" "^0.3.9" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" @@ -1526,6 +1697,11 @@ resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + "@jridgewell/source-map@^0.3.3": version "0.3.5" resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.5.tgz#a3bb4d5c6825aab0d281268f47f6ad5853431e91" @@ -1534,7 +1710,7 @@ "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.13", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== @@ -1547,6 +1723,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@ljharb/through@^2.3.11": version "2.3.12" resolved "https://registry.yarnpkg.com/@ljharb/through/-/through-2.3.12.tgz#c418c43060eee193adce48b15c2206096a28e9ea" @@ -2091,6 +2275,234 @@ dependencies: "@octokit/openapi-types" "^19.1.0" +"@opentelemetry/api-logs@0.52.1": + version "0.52.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.52.1.tgz#52906375da4d64c206b0c4cb8ffa209214654ecc" + integrity sha512-qnSqB2DQ9TPP96dl8cDubDvrUyWc0/sK81xHTK8eSUspzDM3bsewX903qclQFvVhgStjRWdC5bLb3kQqMkfV5A== + dependencies: + "@opentelemetry/api" "^1.0.0" + +"@opentelemetry/api@^1.0.0", "@opentelemetry/api@^1.6.0", "@opentelemetry/api@^1.8", "@opentelemetry/api@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" + integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== + +"@opentelemetry/context-async-hooks@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/context-async-hooks/-/context-async-hooks-1.25.1.tgz#810bff2fcab84ec51f4684aff2d21f6c057d9e73" + integrity sha512-UW/ge9zjvAEmRWVapOP0qyCvPulWU6cQxGxDbWEFfGOj1VBBZAuOqTo3X6yWmDTD3Xe15ysCZChHncr2xFMIfQ== + +"@opentelemetry/core@1.25.1", "@opentelemetry/core@^1.1.0", "@opentelemetry/core@^1.25.1", "@opentelemetry/core@^1.8.0": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/core/-/core-1.25.1.tgz#ff667d939d128adfc7c793edae2f6bca177f829d" + integrity sha512-GeT/l6rBYWVQ4XArluLVB6WWQ8flHbdb6r2FCHC3smtdOAbrJBIv35tpV/yp9bmYUJf+xmZpu9DRTIeJVhFbEQ== + dependencies: + "@opentelemetry/semantic-conventions" "1.25.1" + +"@opentelemetry/instrumentation-connect@0.37.0": + version "0.37.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-connect/-/instrumentation-connect-0.37.0.tgz#ab1bc3d33058bfc647d4b158295b589d11d619df" + integrity sha512-SeQktDIH5rNzjiEiazWiJAIXkmnLOnNV7wwHpahrqE0Ph+Z3heqMfxRtoMtbdJSIYLfcNZYO51AjxZ00IXufdw== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + "@types/connect" "3.4.36" + +"@opentelemetry/instrumentation-express@0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-express/-/instrumentation-express-0.40.1.tgz#b4c31a352691b060b330e4c028a8ef5472b89e27" + integrity sha512-+RKMvVe2zw3kIXRup9c1jFu3T4d0fs5aKy015TpiMyoCKX1UMu3Z0lfgYtuyiSTANvg5hZnDbWmQmqSPj9VTvg== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation-fastify@0.37.0": + version "0.37.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-fastify/-/instrumentation-fastify-0.37.0.tgz#c9537050d222d89ad4c3930b7b21a58016206f6d" + integrity sha512-WRjwzNZgupSzbEYvo9s+QuHJRqZJjVdNxSEpGBwWK8RKLlHGwGVAu0gcc2gPamJWUJsGqPGvahAPWM18ZkWj6A== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation-graphql@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-graphql/-/instrumentation-graphql-0.41.0.tgz#b3f1c7e0bb18400b1336f781f209f6b73608bd89" + integrity sha512-R/gXeljgIhaRDKquVkKYT5QHPnFouM8ooyePZEP0kqyaVAedtR1V7NfAUJbxfTG5fBQa5wdmLjvu63+tzRXZCA== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + +"@opentelemetry/instrumentation-hapi@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.39.0.tgz#c6a43440baac714aba57d12ee363b72a02378eed" + integrity sha512-ik2nA9Yj2s2ay+aNY+tJsKCsEx6Tsc2g/MK0iWBW5tibwrWKTy1pdVt5sB3kd5Gkimqj23UV5+FH2JFcQLeKug== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation-http@0.52.1": + version "0.52.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.52.1.tgz#12061501601838d1c912f9c29bdd40a13a7e44cf" + integrity sha512-dG/aevWhaP+7OLv4BQQSEKMJv8GyeOp3Wxl31NHqE8xo9/fYMfEljiZphUHIfyg4gnZ9swMyWjfOQs5GUQe54Q== + dependencies: + "@opentelemetry/core" "1.25.1" + "@opentelemetry/instrumentation" "0.52.1" + "@opentelemetry/semantic-conventions" "1.25.1" + semver "^7.5.2" + +"@opentelemetry/instrumentation-ioredis@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.41.0.tgz#41b60babdce893df7466b13a8896a71c81a80813" + integrity sha512-rxiLloU8VyeJGm5j2fZS8ShVdB82n7VNP8wTwfUQqDwRfHCnkzGr+buKoxuhGD91gtwJ91RHkjHA1Eg6RqsUTg== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/redis-common" "^0.36.2" + "@opentelemetry/semantic-conventions" "^1.23.0" + +"@opentelemetry/instrumentation-koa@0.41.0": + version "0.41.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-koa/-/instrumentation-koa-0.41.0.tgz#31d75ebc4c53c9c902f7ef3f73e52d575fce9628" + integrity sha512-mbPnDt7ELvpM2S0vixYUsde7122lgegLOJQxx8iJQbB8YHal/xnTh9v7IfArSVzIDo+E+080hxZyUZD4boOWkw== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + "@types/koa" "2.14.0" + "@types/koa__router" "12.0.3" + +"@opentelemetry/instrumentation-mongodb@0.45.0": + version "0.45.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongodb/-/instrumentation-mongodb-0.45.0.tgz#d6373e30f3e83eba87f7e6e2ea72c1351467d6b5" + integrity sha512-xnZP9+ayeB1JJyNE9cIiwhOJTzNEsRhXVdLgfzmrs48Chhhk026mQdM5CITfyXSCfN73FGAIB8d91+pflJEfWQ== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/sdk-metrics" "^1.9.1" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation-mongoose@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mongoose/-/instrumentation-mongoose-0.39.0.tgz#2d5070bb0838769b8dd099b6402f42e1269f527a" + integrity sha512-J1r66A7zJklPPhMtrFOO7/Ud2p0Pv5u8+r23Cd1JUH6fYPmftNJVsLp2urAt6PHK4jVqpP/YegN8wzjJ2mZNPQ== + dependencies: + "@opentelemetry/core" "^1.8.0" + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation-mysql2@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql2/-/instrumentation-mysql2-0.39.0.tgz#1719441f58e3f3418c2c3a7b15b48c187d8e3f90" + integrity sha512-Iypuq2z6TCfriAXCIZjRq8GTFCKhQv5SpXbmI+e60rYdXw8NHtMH4NXcGF0eKTuoCsC59IYSTUvDQYDKReaszA== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + "@opentelemetry/sql-common" "^0.40.1" + +"@opentelemetry/instrumentation-mysql@0.39.0": + version "0.39.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-mysql/-/instrumentation-mysql-0.39.0.tgz#b55afe5b1249363f42c6092529466b057297ab94" + integrity sha512-8snHPh83rhrDf31v9Kq0Nf+ts8hdr7NguuszRqZomZBHgE0+UyXZSkXHAAFZoBPPRMGyM68uaFE5hVtFl+wOcA== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + "@types/mysql" "2.15.22" + +"@opentelemetry/instrumentation-nestjs-core@0.38.0": + version "0.38.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-nestjs-core/-/instrumentation-nestjs-core-0.38.0.tgz#d4296936723f1dfbd11747a84a87d17a3da0bc74" + integrity sha512-M381Df1dM8aqihZz2yK+ugvMFK5vlHG/835dc67Sx2hH4pQEQYDA2PpFPTgc9AYYOydQaj7ClFQunESimjXDgg== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.23.0" + +"@opentelemetry/instrumentation-pg@0.42.0": + version "0.42.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-pg/-/instrumentation-pg-0.42.0.tgz#a73de6c057b4a8b99c964d2bbf2fdad304284be9" + integrity sha512-sjgcM8CswYy8zxHgXv4RAZ09DlYhQ+9TdlourUs63Df/ek5RrB1ZbjznqW7PB6c3TyJJmX6AVtPTjAsROovEjA== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/semantic-conventions" "^1.22.0" + "@opentelemetry/sql-common" "^0.40.1" + "@types/pg" "8.6.1" + "@types/pg-pool" "2.0.4" + +"@opentelemetry/instrumentation-redis-4@0.40.0": + version "0.40.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-redis-4/-/instrumentation-redis-4-0.40.0.tgz#4a1bc9bebfb869de8d982b1a1a5b550bdb68d15b" + integrity sha512-0ieQYJb6yl35kXA75LQUPhHtGjtQU9L85KlWa7d4ohBbk/iQKZ3X3CFl5jC5vNMq/GGPB3+w3IxNvALlHtrp7A== + dependencies: + "@opentelemetry/instrumentation" "^0.52.0" + "@opentelemetry/redis-common" "^0.36.2" + "@opentelemetry/semantic-conventions" "^1.22.0" + +"@opentelemetry/instrumentation@0.52.1", "@opentelemetry/instrumentation@^0.49 || ^0.50 || ^0.51 || ^0.52.0", "@opentelemetry/instrumentation@^0.52.0", "@opentelemetry/instrumentation@^0.52.1": + version "0.52.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.52.1.tgz#2e7e46a38bd7afbf03cf688c862b0b43418b7f48" + integrity sha512-uXJbYU/5/MBHjMp1FqrILLRuiJCs3Ofk0MeRDk8g1S1gD47U8X3JnSwcMO1rtRo1x1a7zKaQHaoYu49p/4eSKw== + dependencies: + "@opentelemetry/api-logs" "0.52.1" + "@types/shimmer" "^1.0.2" + import-in-the-middle "^1.8.1" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" + +"@opentelemetry/instrumentation@^0.43.0": + version "0.43.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.43.0.tgz#749521415df03396f969bf42341fcb4acd2e9c7b" + integrity sha512-S1uHE+sxaepgp+t8lvIDuRgyjJWisAb733198kwQTUc9ZtYQ2V2gmyCtR1x21ePGVLoMiX/NWY7WA290hwkjJQ== + dependencies: + "@types/shimmer" "^1.0.2" + import-in-the-middle "1.4.2" + require-in-the-middle "^7.1.1" + semver "^7.5.2" + shimmer "^1.2.1" + +"@opentelemetry/redis-common@^0.36.2": + version "0.36.2" + resolved "https://registry.yarnpkg.com/@opentelemetry/redis-common/-/redis-common-0.36.2.tgz#906ac8e4d804d4109f3ebd5c224ac988276fdc47" + integrity sha512-faYX1N0gpLhej/6nyp6bgRjzAKXn5GOEMYY7YhciSfCoITAktLUtQ36d24QEWNA1/WA1y6qQunCe0OhHRkVl9g== + +"@opentelemetry/resources@1.25.1", "@opentelemetry/resources@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.25.1.tgz#bb9a674af25a1a6c30840b755bc69da2796fefbb" + integrity sha512-pkZT+iFYIZsVn6+GzM0kSX+u3MSLCY9md+lIJOoKl/P+gJFfxJte/60Usdp8Ce4rOs8GduUpSPNe1ddGyDT1sQ== + dependencies: + "@opentelemetry/core" "1.25.1" + "@opentelemetry/semantic-conventions" "1.25.1" + +"@opentelemetry/sdk-metrics@^1.9.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-metrics/-/sdk-metrics-1.25.1.tgz#50c985ec15557a9654334e7fa1018dc47a8a56b7" + integrity sha512-9Mb7q5ioFL4E4dDrc4wC/A3NTHDat44v4I3p2pLPSxRvqUbDIQyMVr9uK+EU69+HWhlET1VaSrRzwdckWqY15Q== + dependencies: + "@opentelemetry/core" "1.25.1" + "@opentelemetry/resources" "1.25.1" + lodash.merge "^4.6.2" + +"@opentelemetry/sdk-trace-base@^1.22", "@opentelemetry/sdk-trace-base@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.25.1.tgz#cbc1e60af255655d2020aa14cde17b37bd13df37" + integrity sha512-C8k4hnEbc5FamuZQ92nTOp8X/diCY56XUTnMiv9UTuJitCzaNNHAVsdm5+HLCdI8SLQsLWIrG38tddMxLVoftw== + dependencies: + "@opentelemetry/core" "1.25.1" + "@opentelemetry/resources" "1.25.1" + "@opentelemetry/semantic-conventions" "1.25.1" + +"@opentelemetry/semantic-conventions@1.25.1", "@opentelemetry/semantic-conventions@^1.17.0", "@opentelemetry/semantic-conventions@^1.22.0", "@opentelemetry/semantic-conventions@^1.23.0", "@opentelemetry/semantic-conventions@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/semantic-conventions/-/semantic-conventions-1.25.1.tgz#0deecb386197c5e9c2c28f2f89f51fb8ae9f145e" + integrity sha512-ZDjMJJQRlyk8A1KZFCc+bCbsyrn1wTwdNt56F7twdfUfnHUZUq77/WfONCj8p72NZOyP7pNTdUWSTYC3GTbuuQ== + +"@opentelemetry/sql-common@^0.40.1": + version "0.40.1" + resolved "https://registry.yarnpkg.com/@opentelemetry/sql-common/-/sql-common-0.40.1.tgz#93fbc48d8017449f5b3c3274f2268a08af2b83b6" + integrity sha512-nSDlnHSqzC3pXn/wZEZVLuAuJ1MYMXPBwtv2qAbCa3847SaHItdE7SzUq/Jtb0KZmh1zfAbNi3AAMjztTT4Ugg== + dependencies: + "@opentelemetry/core" "^1.1.0" + "@pnpm/config.env-replace@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz#ab29da53df41e8948a00f2433f085f54de8b3a4c" @@ -2117,6 +2529,15 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.24.tgz#58601079e11784d20f82d0585865bb42305c4df3" integrity sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ== +"@prisma/instrumentation@5.16.0": + version "5.16.0" + resolved "https://registry.yarnpkg.com/@prisma/instrumentation/-/instrumentation-5.16.0.tgz#ee50f851945364c43e4067b84fe4071235ca3dd2" + integrity sha512-MVzNRW2ikWvVNnMIEgQMcwWxpFD+XF2U2h0Qz7MjutRqJxrhWexWV2aSi2OXRaU8UL5wzWw7pnjdKUzYhWauLg== + dependencies: + "@opentelemetry/api" "^1.8" + "@opentelemetry/instrumentation" "^0.49 || ^0.50 || ^0.51 || ^0.52.0" + "@opentelemetry/sdk-trace-base" "^1.22" + "@release-it/conventional-changelog@8.0.1": version "8.0.1" resolved "https://registry.yarnpkg.com/@release-it/conventional-changelog/-/conventional-changelog-8.0.1.tgz#7aba0162769a001b11fa72ab05ca3f108c2657e3" @@ -2247,66 +2668,74 @@ resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.6.tgz#2c1fb69e02a3f1506f52698cfdc3a8b6386df9a6" integrity sha512-jqzNLhNDvIZOrt69Ce4UjGRpXJBzhUBzawMwnaDAwyHriki3XollsewxWzOzz+4yOFDkuJHtTsZFwMxhYJWmLQ== -"@sentry-internal/feedback@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-7.100.0.tgz#38d8d4cb8ac3e6e24d91b13878bd6208a55bcab3" - integrity sha512-SMW2QhNKOuSjw8oPtvryDlJjiwrNyAKljbgtMk057os/fd8QMp38Yt1ImqLCM4B2rTQZ6REJ6hRGRTRcfqoG+w== - dependencies: - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry-internal/replay-canvas@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-7.100.0.tgz#b462346832631ed5a9446686419113ff331bd984" - integrity sha512-DePinj5IgNiC4RZv0yX0DLccMZebfFdKl3zHwDeLBeZqtMz9VrPzchv57IWP+5MI1+iuOn+WOg4oTNBUG6hFRw== - dependencies: - "@sentry/core" "7.100.0" - "@sentry/replay" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry-internal/tracing@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.100.0.tgz#01f0925a287a6e5d0becd731ab361cabbd27c007" - integrity sha512-qf4W1STXky9WOQYoPSw2AmCBDK4FzvAyq5yeD2sLU7OCUEfbRUcN0lQljUvmWRKv/jTIAyeU5icDLJPZuR50nA== - dependencies: - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry/babel-plugin-component-annotate@2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.14.0.tgz#e62f448dd3c922a6d32e9f1c0a5ae85fa6ec22c2" - integrity sha512-FWU4+Lx6fgxjAkwmc3S9j1Q/6pqKZyZzfi52B+8WMNw7a5QjGXgxc5ucBazZYgrcsJKCFBp4QG3PPxNAieFimQ== - -"@sentry/browser@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.100.0.tgz#adf57f660baa6190a7e1709605f73b94818ee04b" - integrity sha512-XpM0jEVe6DJWXjMSOjtJxsSNR/XnJKrlcuyoI4Re3qLG+noEF5QLc0r3VJkySXPRFnmdW05sLswQ6a/n9Sijmg== - dependencies: - "@sentry-internal/feedback" "7.100.0" - "@sentry-internal/replay-canvas" "7.100.0" - "@sentry-internal/tracing" "7.100.0" - "@sentry/core" "7.100.0" - "@sentry/replay" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry/bundler-plugin-core@2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.14.0.tgz#8814ed1a4b290bce914c98e0316199ba44712abe" - integrity sha512-jVM47EPs8Na2z5HOWgthLFhpHLU9hwL2wY4TzHEnS1Bj+ODgXFa8QcIxQR2SO+W+L8YhSbY7z+BpPsYTpeZWUg== - dependencies: - "@babel/core" "7.18.5" - "@sentry/babel-plugin-component-annotate" "2.14.0" +"@sentry-internal/browser-utils@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/browser-utils/-/browser-utils-8.13.0.tgz#b7c3bdd49d2382f60dde31745716d29dd419b6ba" + integrity sha512-lqq8BYbbs9KTlDuyB5NjdZB6P/llqQs32KUgaCQ/k5DFB4Zf56+BFHXObnMHxwx375X1uixtnEphagWZa+nsLQ== + dependencies: + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry-internal/feedback@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/feedback/-/feedback-8.13.0.tgz#100eeeb558536e2390ded8fb58cba3984ac41abd" + integrity sha512-YyJ6SzpTonixvguAg0H9vkEp7Jq8ZeVY8M4n47ClR0+TtaAUp04ZhcJpHKF7PwBIAzc7DRr2XP112tmWgiVEcg== + dependencies: + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry-internal/replay-canvas@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay-canvas/-/replay-canvas-8.13.0.tgz#fce0fb82ab85badb421244d75bc616948fb6db64" + integrity sha512-lPlfWVIHX+gW4S8a/UOVutuqMyQhlkNUAay0W21MVhZJT5Mtj0p21D/Cz7nrOQRDIiLNq90KAGK2tLxx5NkiWA== + dependencies: + "@sentry-internal/replay" "8.13.0" + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry-internal/replay@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry-internal/replay/-/replay-8.13.0.tgz#84e57e3596e24ad0bc31eb61540c81c3737c09ff" + integrity sha512-DJ1jF/Pab0FH4SeCvSGCnGAu/s0wJvhBWM5VjQp7Jjmcfunp+R3vJibqU8gAVZU1nYRLaqprLdIXrSyP2Km8nQ== + dependencies: + "@sentry-internal/browser-utils" "8.13.0" + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry/babel-plugin-component-annotate@2.20.1": + version "2.20.1" + resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.20.1.tgz#204c63ed006a048f48f633876e1b8bacf87a9722" + integrity sha512-4mhEwYTK00bIb5Y9UWIELVUfru587Vaeg0DQGswv4aIRHIiMKLyNqCEejaaybQ/fNChIZOKmvyqXk430YVd7Qg== + +"@sentry/browser@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-8.13.0.tgz#38329ff716d681d8dc5445c1660698b186d05723" + integrity sha512-/tp7HZ5qjwDLtwooPMoexdAi2PG7gMNY0bHeMlwy20hs8mclC8RW8ZiJA6czXHfgnbmvxfrHaY53IJyz//JnlA== + dependencies: + "@sentry-internal/browser-utils" "8.13.0" + "@sentry-internal/feedback" "8.13.0" + "@sentry-internal/replay" "8.13.0" + "@sentry-internal/replay-canvas" "8.13.0" + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry/bundler-plugin-core@2.20.1": + version "2.20.1" + resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.20.1.tgz#c9dd35e2177a4c22ecf675558eb84fbc2607e465" + integrity sha512-6ipbmGzHekxeRCbp7eoefr6bdd/lW4cNA9eNnrmd9+PicubweGaZZbH2NjhFHsaxzgOezwipDHjrTaap2kTHgw== + dependencies: + "@babel/core" "^7.18.5" + "@sentry/babel-plugin-component-annotate" "2.20.1" "@sentry/cli" "^2.22.3" - "@sentry/node" "^7.60.0" - "@sentry/utils" "^7.60.0" dotenv "^16.3.1" - find-up "5.0.0" - glob "9.3.2" - magic-string "0.27.0" + find-up "^5.0.0" + glob "^9.3.2" + magic-string "0.30.8" unplugin "1.0.1" "@sentry/cli-darwin@2.28.0": @@ -2363,80 +2792,98 @@ "@sentry/cli-win32-i686" "2.28.0" "@sentry/cli-win32-x64" "2.28.0" -"@sentry/core@7.100.0", "@sentry/core@^7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.100.0.tgz#5b28c7b3e41e45e4d50e3bdea5d35434fd78e86b" - integrity sha512-eWRPuP0Zdj4a2F7SybqNjf13LGOVgGwvW6sojweQp9oxGAfCPp/EMDGBhlpYbMJeLbzmqzJ4ZFHIedaiEC+7kg== - dependencies: - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry/integrations@^7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/integrations/-/integrations-7.100.0.tgz#6620cce950dce7c1f3e63d5b047b320a7d25b3c7" - integrity sha512-aO9wgnqlbav7FECKNcgTxQSGGSsMeYH9mV0cniuu520cDAhmVxtA+PqlnS3nsJZJj4cKjX6MWA2SbBG0szKmkw== - dependencies: - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - localforage "^1.8.1" - -"@sentry/node@^7.100.0", "@sentry/node@^7.60.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.100.0.tgz#52e7be6d5afd396f7516f004b712ff345976f87d" - integrity sha512-8cf9wFNo/9I++60MVAf6tuKn/N5JCZ/Z8NDUzutnWWdQBLSx+LhZYNPntN3WkHl6Q7PBHGw3mU1Bc+rF48MeSQ== - dependencies: - "@sentry-internal/tracing" "7.100.0" - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" - -"@sentry/profiling-node@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/profiling-node/-/profiling-node-7.100.0.tgz#f078d47af6fbf0c92fbd2e37160e152e05dc3e11" - integrity sha512-48TMIiMtPTeCf9YBw5YkE0zoyJX4TpzcouR+SCMt7ot8QLPX26jVMezgnxeRTu8kYOvNRmeca6iZi73LVuAQxQ== - dependencies: +"@sentry/core@8.13.0", "@sentry/core@^8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.13.0.tgz#5b2a83402013b828bf2c49c82e751ca490f8669a" + integrity sha512-N9Qg4ZGxZWp8eb2eUUHVVKgjBLtFIjS805nG92s6yJmkvOpKm6mLtcUaT/iDf3Hta6nG+xRkhbE3r+Z4cbXG8w== + dependencies: + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry/node@8.13.0", "@sentry/node@^8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.13.0.tgz#5c41099b755a7c1f422c72ccbb5cbd93d6ecae94" + integrity sha512-OeZ7K90RhyxfwfreerIi4cszzHrPRRH36STJno2+p3sIGbG5VScOccqXzYEOAqHpByxnti4KQN34BLAT2BFOEA== + dependencies: + "@opentelemetry/api" "^1.9.0" + "@opentelemetry/context-async-hooks" "^1.25.1" + "@opentelemetry/core" "^1.25.1" + "@opentelemetry/instrumentation" "^0.52.1" + "@opentelemetry/instrumentation-connect" "0.37.0" + "@opentelemetry/instrumentation-express" "0.40.1" + "@opentelemetry/instrumentation-fastify" "0.37.0" + "@opentelemetry/instrumentation-graphql" "0.41.0" + "@opentelemetry/instrumentation-hapi" "0.39.0" + "@opentelemetry/instrumentation-http" "0.52.1" + "@opentelemetry/instrumentation-ioredis" "0.41.0" + "@opentelemetry/instrumentation-koa" "0.41.0" + "@opentelemetry/instrumentation-mongodb" "0.45.0" + "@opentelemetry/instrumentation-mongoose" "0.39.0" + "@opentelemetry/instrumentation-mysql" "0.39.0" + "@opentelemetry/instrumentation-mysql2" "0.39.0" + "@opentelemetry/instrumentation-nestjs-core" "0.38.0" + "@opentelemetry/instrumentation-pg" "0.42.0" + "@opentelemetry/instrumentation-redis-4" "0.40.0" + "@opentelemetry/resources" "^1.25.1" + "@opentelemetry/sdk-trace-base" "^1.25.1" + "@opentelemetry/semantic-conventions" "^1.25.1" + "@prisma/instrumentation" "5.16.0" + "@sentry/core" "8.13.0" + "@sentry/opentelemetry" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + optionalDependencies: + opentelemetry-instrumentation-fetch-node "1.2.0" + +"@sentry/opentelemetry@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.13.0.tgz#2fb4910b10f8af67749c41f636bf3610c2690203" + integrity sha512-NYn/HNE/SxFXe8pfnxJknhrrRzYRMHNssCoi5M1CeR5G7F2BGxxVmaGsd8j0WyTCpUS4i97G4vhYtDGxHvWN6w== + dependencies: + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" + +"@sentry/profiling-node@^8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/profiling-node/-/profiling-node-8.13.0.tgz#e63652bb015f4d312a83bc74672ed2cf28c89527" + integrity sha512-6qirN71xlMahcm4m25XZLnjQdvs0EaFym/9MdLqcsAa3gAHZtw6h+IDapUzBWRXVOrU1OR5oQdh2tlFthsDtew== + dependencies: + "@sentry/core" "8.13.0" + "@sentry/node" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" detect-libc "^2.0.2" - node-abi "^3.52.0" - -"@sentry/replay@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/replay/-/replay-7.100.0.tgz#4f2e35155626ab286692ade3e31da282c73bd402" - integrity sha512-6Yo56J+x+eedaMXri8pPlFxXOofnSXVdsUuFj+kJ7lC/qHrwIbgC5g1ONEK/WlYwpVH4gA0aNnCa5AOkMu+ZTg== - dependencies: - "@sentry-internal/tracing" "7.100.0" - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" + node-abi "^3.61.0" -"@sentry/types@7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.100.0.tgz#a16f60d78613bd9810298e9e8d80134be58b24f8" - integrity sha512-c+RHwZwpKeBk7h8sUX4nQcelxBz8ViCojifnbEe3tcn8O15HOLvZqRKgLLOiff3MoErxiv4oxs0sPbEFRm/IvA== +"@sentry/types@8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.13.0.tgz#0753700af93592b65272e63c396b3c0202dd3105" + integrity sha512-r63s/H5gvQnQM9tTGBXz2xErUbxZALh4e2Lg/1aHj4zIvGLBjA2z5qWsh6TEZYbpmgAyGShLDr6+rWeUVf9yBQ== -"@sentry/utils@7.100.0", "@sentry/utils@^7.100.0", "@sentry/utils@^7.60.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.100.0.tgz#a9d36c01eede117c3e17b0350d399a87934e9c66" - integrity sha512-LAhZMEGq3C125prZN/ShqeXpRfdfgJkl9RAKjfq8cmMFsF7nsF72dEHZgIwrZ0lgNmtaWAB83AwJcyN83RwOxQ== +"@sentry/utils@8.13.0", "@sentry/utils@^8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.13.0.tgz#b2cce61705ea95a639db932f000247bddf13aa16" + integrity sha512-PxV0v9VbGWH9zP37P5w2msLUFDr287nYjoY2XVF+RSolyiTs1CQNI5ZMUO3o4MsSac/dpXxjyrZXQd72t/jRYA== dependencies: - "@sentry/types" "7.100.0" + "@sentry/types" "8.13.0" -"@sentry/vue@^7.100.0": - version "7.100.0" - resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-7.100.0.tgz#16fa47aedfb1358d2cf76d910a76e64f7b7eeb54" - integrity sha512-qBx2vAgDFroh6wCoHgDgk5R0jTn+im/8G2Xs0SwkCiuZvvUikCd5ggZQLX3dIal0/y03GAKpcWLEtQXpwAgaqA== +"@sentry/vue@^8.13.0": + version "8.13.0" + resolved "https://registry.yarnpkg.com/@sentry/vue/-/vue-8.13.0.tgz#58e1ce2415f84263934ee5afe6c26aecf922fc11" + integrity sha512-1CTInl9jeh9dDyrL2dOUUiLN9KvvdEibBPXxqz/nGIignT/sVO8ZJzFPctsyh9COF63FN3zfy65xBE4U/Ad6oA== dependencies: - "@sentry/browser" "7.100.0" - "@sentry/core" "7.100.0" - "@sentry/types" "7.100.0" - "@sentry/utils" "7.100.0" + "@sentry/browser" "8.13.0" + "@sentry/core" "8.13.0" + "@sentry/types" "8.13.0" + "@sentry/utils" "8.13.0" -"@sentry/webpack-plugin@2.14.0": - version "2.14.0" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.14.0.tgz#6351ced08b19a4627995ebbcbe3f15c92fcad761" - integrity sha512-6lYxabSSkoMqz+zsACamYfu8amLSIiYFj+CQBLvWKSW7N6wJvaZKfFVHj5bGlmU7K0X0eJyQdxdk6VfLg129Jw== +"@sentry/webpack-plugin@^2.20.1": + version "2.20.1" + resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.20.1.tgz#285d325a0a1bd0a534126b97e0190da9486ff7f6" + integrity sha512-U6LzoE09Ndt0OCWROoRaZqqIHGxyMRdKpBhbqoBqyyfVwXN/zGW3I/cWZ1e8rreiKFj+2+c7+X0kOS+NGMTUrg== dependencies: - "@sentry/bundler-plugin-core" "2.14.0" + "@sentry/bundler-plugin-core" "2.20.1" unplugin "1.0.1" uuid "^9.0.0" @@ -2482,6 +2929,13 @@ resolved "https://registry.yarnpkg.com/@trysound/sax/-/sax-0.2.0.tgz#cccaab758af56761eb7bf37af6f03f326dd798ad" integrity sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA== +"@types/accepts@*": + version "1.3.7" + resolved "https://registry.yarnpkg.com/@types/accepts/-/accepts-1.3.7.tgz#3b98b1889d2b2386604c2bbbe62e4fb51e95b265" + integrity sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ== + dependencies: + "@types/node" "*" + "@types/babel__core@7.20.5": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -2550,6 +3004,28 @@ dependencies: "@types/node" "*" +"@types/connect@3.4.36": + version "3.4.36" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.36.tgz#e511558c15a39cb29bd5357eebb57bd1459cd1ab" + integrity sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w== + dependencies: + "@types/node" "*" + +"@types/content-disposition@*": + version "0.5.8" + resolved "https://registry.yarnpkg.com/@types/content-disposition/-/content-disposition-0.5.8.tgz#6742a5971f490dc41e59d277eee71361fea0b537" + integrity sha512-QVSSvno3dE0MgO76pJhmv4Qyi/j0Yk9pBp0Y7TJ2Tlj+KCgJWY6qX7nnxCOLkZ3VYRSIk1WTxCvwUSdx6CCLdg== + +"@types/cookies@*": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@types/cookies/-/cookies-0.9.0.tgz#a2290cfb325f75f0f28720939bee854d4142aee2" + integrity sha512-40Zk8qR147RABiQ7NQnBzWzDcjKzNrntB5BAmeGCb2p/MIyOE+4BVvc17wumsUqUw00bJYqoXFHYygQnEFh4/Q== + dependencies: + "@types/connect" "*" + "@types/express" "*" + "@types/keygrip" "*" + "@types/node" "*" + "@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" @@ -2608,6 +3084,11 @@ "@types/relateurl" "*" "@types/uglify-js" "*" +"@types/http-assert@*": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@types/http-assert/-/http-assert-1.5.5.tgz#dfb1063eb7c240ee3d3fe213dac5671cfb6a8dbf" + integrity sha512-4+tE/lwdAahgZT1g30Jkdm9PzFRde0xwxBNUyRsCitRvCQB90iuA2uJYdUnhnANRcqGXaWOGY4FEoxeElNAK2g== + "@types/http-cache-semantics@^4.0.2": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" @@ -2628,6 +3109,53 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/keygrip@*": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/keygrip/-/keygrip-1.0.6.tgz#1749535181a2a9b02ac04a797550a8787345b740" + integrity sha512-lZuNAY9xeJt7Bx4t4dx0rYCDqGPW8RXhQZK1td7d4H6E9zYbLoOtjBvfwdTKpsyxQI/2jv+armjX/RW+ZNpXOQ== + +"@types/koa-compose@*": + version "3.2.8" + resolved "https://registry.yarnpkg.com/@types/koa-compose/-/koa-compose-3.2.8.tgz#dec48de1f6b3d87f87320097686a915f1e954b57" + integrity sha512-4Olc63RY+MKvxMwVknCUDhRQX1pFQoBZ/lXcRLP69PQkEpze/0cr8LNqJQe5NFb/b19DWi2a5bTi2VAlQzhJuA== + dependencies: + "@types/koa" "*" + +"@types/koa@*": + version "2.15.0" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.15.0.tgz#eca43d76f527c803b491731f95df575636e7b6f2" + integrity sha512-7QFsywoE5URbuVnG3loe03QXuGajrnotr3gQkXcEBShORai23MePfFYdhz90FEtBBpkyIYQbVD+evKtloCgX3g== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + +"@types/koa@2.14.0": + version "2.14.0" + resolved "https://registry.yarnpkg.com/@types/koa/-/koa-2.14.0.tgz#8939e8c3b695defc12f2ef9f38064509e564be18" + integrity sha512-DTDUyznHGNHAl+wd1n0z1jxNajduyTh8R53xoewuerdBzGo6Ogj6F2299BFtrexJw4NtgjsI5SMPCmV9gZwGXA== + dependencies: + "@types/accepts" "*" + "@types/content-disposition" "*" + "@types/cookies" "*" + "@types/http-assert" "*" + "@types/http-errors" "*" + "@types/keygrip" "*" + "@types/koa-compose" "*" + "@types/node" "*" + +"@types/koa__router@12.0.3": + version "12.0.3" + resolved "https://registry.yarnpkg.com/@types/koa__router/-/koa__router-12.0.3.tgz#3fb74ea1991cadd6c6712b6106657aa6e64afca4" + integrity sha512-5YUJVv6NwM1z7m6FuYpKfNLTZ932Z6EF6xy2BbtpJSyn13DKNQEkXVffFVSnJHxvwwWh2SAeumpjAYUELqgjyw== + dependencies: + "@types/koa" "*" + "@types/less@3.0.6": version "3.0.6" resolved "https://registry.yarnpkg.com/@types/less/-/less-3.0.6.tgz#279b51245ba787c810a0d286226c5900cd5e6765" @@ -2650,6 +3178,13 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.5.tgz#1ef302e01cf7d2b5a0fa526790c9123bf1d06690" integrity sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w== +"@types/mysql@2.15.22": + version "2.15.22" + resolved "https://registry.yarnpkg.com/@types/mysql/-/mysql-2.15.22.tgz#8705edb9872bf4aa9dbc004cd494e00334e5cdb4" + integrity sha512-wK1pzsJVVAjYCSZWQoWHziQZbNggXFDUEIGf54g4ZM/ERuP86uGdWeKZWMYlqTPMZfHJJvLPyogXGvCOg87yLQ== + dependencies: + "@types/node" "*" + "@types/node@*", "@types/node@18.19.15": version "18.19.15" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.15.tgz#313a9d75435669a57fc28dc8694e7f4c4319f419" @@ -2679,6 +3214,31 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.2.tgz#5950e50960793055845e956c427fc2b0d70c5239" integrity sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw== +"@types/pg-pool@2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/pg-pool/-/pg-pool-2.0.4.tgz#b5c60f678094ff3acf3442628a7f708928fcf263" + integrity sha512-qZAvkv1K3QbmHHFYSNRYPkRjOWRLBYrL4B9c+wG0GSVGBw0NtJwPcgx/DSddeDJvRGMHCEQ4VMEVfuJ/0gZ3XQ== + dependencies: + "@types/pg" "*" + +"@types/pg@*": + version "8.11.6" + resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.11.6.tgz#a2d0fb0a14b53951a17df5197401569fb9c0c54b" + integrity sha512-/2WmmBXHLsfRqzfHW7BNZ8SbYzE8OSk7i3WjFYvfgRHj7S1xj+16Je5fUKv3lVdVzk/zn9TXOqf+avFCFIE0yQ== + dependencies: + "@types/node" "*" + pg-protocol "*" + pg-types "^4.0.1" + +"@types/pg@8.6.1": + version "8.6.1" + resolved "https://registry.yarnpkg.com/@types/pg/-/pg-8.6.1.tgz#099450b8dc977e8197a44f5229cedef95c8747f9" + integrity sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w== + dependencies: + "@types/node" "*" + pg-protocol "*" + pg-types "^2.2.0" + "@types/pug@2.0.10": version "2.0.10" resolved "https://registry.yarnpkg.com/@types/pug/-/pug-2.0.10.tgz#52f8dbd6113517aef901db20b4f3fca543b88c1f" @@ -2743,6 +3303,11 @@ "@types/mime" "*" "@types/node" "*" +"@types/shimmer@^1.0.2": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.0.5.tgz#491d8984d4510e550bfeb02d518791d7f59d2b88" + integrity sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww== + "@types/source-list-map@*": version "0.1.6" resolved "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.6.tgz#164e169dd061795b50b83c19e4d3be09f8d3a454" @@ -3222,6 +3787,16 @@ accepts@~1.3.5, accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" +acorn-import-assertions@^1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz#507276249d684797c84e0734ef84860334cfb1ac" + integrity sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA== + +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -4248,6 +4823,11 @@ citty@^0.1.2, citty@^0.1.5: dependencies: consola "^3.2.3" +cjs-module-lexer@^1.2.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.3.1.tgz#c485341ae8fd999ca4ee5af2d7a1c9ae01e0099c" + integrity sha512-a3KdPAANPbNE4ZUv9h6LckSl9zLsYOP4MBmhIPkRaeyybt+r4UghLvq+xw/YwUcC1gqylCkL4rdVs3Lwupjm4Q== + class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -4677,11 +5257,6 @@ conventional-recommended-bump@^9.0.0: git-semver-tags "^7.0.0" meow "^12.0.1" -convert-source-map@^1.7.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" - integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== - convert-source-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" @@ -6332,14 +6907,6 @@ find-cache-dir@^3.0.0, find-cache-dir@^3.3.1: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@5.0.0, find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -6355,6 +6922,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + find-up@^6.3.0: version "6.3.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-6.3.0.tgz#2abab3d3280b2dc7ac10199ef324c4e002c8c790" @@ -6735,16 +7310,6 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@9.3.2: - version "9.3.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.2.tgz#8528522e003819e63d11c979b30896e0eaf52eda" - integrity sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA== - dependencies: - fs.realpath "^1.0.0" - minimatch "^7.4.1" - minipass "^4.2.4" - path-scurry "^1.6.1" - glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.1.7, glob@^7.2.0: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -6768,6 +7333,16 @@ glob@^8.0.3, glob@^8.1.0: minimatch "^5.0.1" once "^1.3.0" +glob@^9.3.2: + version "9.3.5" + resolved "https://registry.yarnpkg.com/glob/-/glob-9.3.5.tgz#ca2ed8ca452781a3009685607fdf025a899dfe21" + integrity sha512-e1LleDykUz2Iu+MTYdkSsuWX8lvAjAcs0Xef0lNIu0S2wOAzuTxCJtcd9S3cijlwYF18EsU3rzb8jPVobxDh9Q== + dependencies: + fs.realpath "^1.0.0" + minimatch "^8.0.2" + minipass "^4.2.4" + path-scurry "^1.6.1" + global-dirs@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.1.tgz#0c488971f066baceda21447aecb1a8b911d22485" @@ -7268,11 +7843,6 @@ ignore@^5.1.1, ignore@^5.2.0, ignore@^5.2.4, ignore@^5.3.0: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== -immediate@~3.0.5: - version "3.0.6" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" - integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== - immutable@^4.0.0: version "4.3.5" resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.5.tgz#f8b436e66d59f99760dc577f5c99a4fd2a5cc5a0" @@ -7286,6 +7856,26 @@ import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" +import-in-the-middle@1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz#2a266676e3495e72c04bbaa5ec14756ba168391b" + integrity sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw== + dependencies: + acorn "^8.8.2" + acorn-import-assertions "^1.9.0" + cjs-module-lexer "^1.2.2" + module-details-from-path "^1.0.3" + +import-in-the-middle@^1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.8.1.tgz#8b51c2cc631b64e53e958d7048d2d9463ce628f8" + integrity sha512-yhRwoHtiLGvmSozNOALgjRPFI6uYsds60EoMqqnXyyv+JOIW/BrrLejuTGBt+bq0T5tLzOHrN0T7xYTm4Qt/ng== + dependencies: + acorn "^8.8.2" + acorn-import-attributes "^1.9.5" + cjs-module-lexer "^1.2.2" + module-details-from-path "^1.0.3" + import-lazy@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153" @@ -7929,7 +8519,7 @@ json5@^1.0.1, json5@^1.0.2: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.2.1, json5@^2.2.3: +json5@^2.1.2, json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -8039,13 +8629,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -lie@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lie/-/lie-3.1.1.tgz#9a436b2cc7746ca59de7a41fa469b3efb76bd87e" - integrity sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw== - dependencies: - immediate "~3.0.5" - lilconfig@3.0.0, lilconfig@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-3.0.0.tgz#f8067feb033b5b74dab4602a5f5029420be749bc" @@ -8135,13 +8718,6 @@ local-pkg@^0.5.0: mlly "^1.4.2" pkg-types "^1.0.3" -localforage@^1.8.1: - version "1.10.0" - resolved "https://registry.yarnpkg.com/localforage/-/localforage-1.10.0.tgz#5c465dc5f62b2807c3a84c0c6a1b1b3212781dd4" - integrity sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg== - dependencies: - lie "3.1.1" - locate-path@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" @@ -8339,12 +8915,12 @@ macos-release@^3.1.0: resolved "https://registry.yarnpkg.com/macos-release/-/macos-release-3.2.0.tgz#dcee82b6a4932971b1538dbf6f3aabc4a903b613" integrity sha512-fSErXALFNsnowREYZ49XCdOHF8wOPWuFOGQrAhP7x5J/BqQv+B02cNsTykGpDgRVx43EKg++6ANmTaGTtW+hUA== -magic-string@0.27.0: - version "0.27.0" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" - integrity sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA== +magic-string@0.30.8: + version "0.30.8" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.8.tgz#14e8624246d2bedba70d5462aa99ac9681844613" + integrity sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ== dependencies: - "@jridgewell/sourcemap-codec" "^1.4.13" + "@jridgewell/sourcemap-codec" "^1.4.15" magic-string@^0.30.3, magic-string@^0.30.4, magic-string@^0.30.5: version "0.30.7" @@ -8596,10 +9172,10 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" -minimatch@^7.4.1: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== +minimatch@^8.0.2: + version "8.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-8.0.4.tgz#847c1b25c014d4e9a7f68aaf63dedd668a626229" + integrity sha512-W0Wvr9HyFXZRGIDgCicunpQ299OKXs9RgZfaukz4qAW/pJhcpUfupc9c+OObPOFueNy8VSrZgEmDtk6Kh4WzDA== dependencies: brace-expansion "^2.0.1" @@ -8726,6 +9302,11 @@ mlly@^1.2.0, mlly@^1.4.0, mlly@^1.4.2, mlly@^1.5.0: pkg-types "^1.0.3" ufo "^1.3.2" +module-details-from-path@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.3.tgz#114c949673e2a8a35e9d35788527aa37b679da2b" + integrity sha512-ySViT69/76t8VhE1xXHK6Ch4NcDd26gx0MzKXLO+F7NOtnqH68d9zF94nT8ZWSxXh8ELOERsnJO/sWt1xZYw5A== + move-concurrently@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/move-concurrently/-/move-concurrently-1.0.1.tgz#be2c005fda32e0b29af1f05d7c4b33214c701f92" @@ -8849,10 +9430,10 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" -node-abi@^3.52.0: - version "3.54.0" - resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.54.0.tgz#f6386f7548817acac6434c6cba02999c9aebcc69" - integrity sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA== +node-abi@^3.61.0: + version "3.65.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.65.0.tgz#ca92d559388e1e9cab1680a18c1a18757cdac9d3" + integrity sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA== dependencies: semver "^7.3.5" @@ -9143,6 +9724,11 @@ object.values@^1.1.7: define-properties "^1.2.0" es-abstract "^1.22.1" +obuf@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e" + integrity sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg== + on-finished@2.4.1, on-finished@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" @@ -9203,6 +9789,15 @@ opener@1.5.2, opener@^1.5.2: resolved "https://registry.yarnpkg.com/opener/-/opener-1.5.2.tgz#5d37e1f35077b9dcac4301372271afdeb2a13598" integrity sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A== +opentelemetry-instrumentation-fetch-node@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/opentelemetry-instrumentation-fetch-node/-/opentelemetry-instrumentation-fetch-node-1.2.0.tgz#5beaad33b622f7021c61733af864fb505cd35626" + integrity sha512-aiSt/4ubOTyb1N5C2ZbGrBvaJOXIZhZvpRPYuUVxQJe27wJZqf/o65iPrqgLcgfeOLaQ8cS2Q+762jrYvniTrA== + dependencies: + "@opentelemetry/api" "^1.6.0" + "@opentelemetry/instrumentation" "^0.43.0" + "@opentelemetry/semantic-conventions" "^1.17.0" + optimize-css-assets-webpack-plugin@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/optimize-css-assets-webpack-plugin/-/optimize-css-assets-webpack-plugin-6.0.1.tgz#7719bceabba1f3891ec3ae04efb81a1cc99cd793" @@ -9583,6 +10178,45 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== +pg-int8@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" + integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== + +pg-numeric@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pg-numeric/-/pg-numeric-1.0.2.tgz#816d9a44026086ae8ae74839acd6a09b0636aa3a" + integrity sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw== + +pg-protocol@*: + version "1.6.1" + resolved "https://registry.yarnpkg.com/pg-protocol/-/pg-protocol-1.6.1.tgz#21333e6d83b01faaebfe7a33a7ad6bfd9ed38cb3" + integrity sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg== + +pg-types@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-2.2.0.tgz#2d0250d636454f7cfa3b6ae0382fdfa8063254a3" + integrity sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA== + dependencies: + pg-int8 "1.0.1" + postgres-array "~2.0.0" + postgres-bytea "~1.0.0" + postgres-date "~1.0.4" + postgres-interval "^1.1.0" + +pg-types@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/pg-types/-/pg-types-4.0.2.tgz#399209a57c326f162461faa870145bb0f918b76d" + integrity sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng== + dependencies: + pg-int8 "1.0.1" + pg-numeric "1.0.2" + postgres-array "~3.0.1" + postgres-bytea "~3.0.0" + postgres-date "~2.1.0" + postgres-interval "^3.0.0" + postgres-range "^1.1.1" + picocolors@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" @@ -10432,6 +11066,55 @@ postcss@^8.2.1, postcss@^8.2.15, postcss@^8.4.14, postcss@^8.4.26, postcss@^8.4. picocolors "^1.0.0" source-map-js "^1.0.2" +postgres-array@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-2.0.0.tgz#48f8fce054fbc69671999329b8834b772652d82e" + integrity sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA== + +postgres-array@~3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/postgres-array/-/postgres-array-3.0.2.tgz#68d6182cb0f7f152a7e60dc6a6889ed74b0a5f98" + integrity sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog== + +postgres-bytea@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-1.0.0.tgz#027b533c0aa890e26d172d47cf9ccecc521acd35" + integrity sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w== + +postgres-bytea@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postgres-bytea/-/postgres-bytea-3.0.0.tgz#9048dc461ac7ba70a6a42d109221619ecd1cb089" + integrity sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw== + dependencies: + obuf "~1.1.2" + +postgres-date@~1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-1.0.7.tgz#51bc086006005e5061c591cee727f2531bf641a8" + integrity sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q== + +postgres-date@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/postgres-date/-/postgres-date-2.1.0.tgz#b85d3c1fb6fb3c6c8db1e9942a13a3bf625189d0" + integrity sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA== + +postgres-interval@^1.1.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-1.2.0.tgz#b460c82cb1587507788819a06aa0fffdb3544695" + integrity sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ== + dependencies: + xtend "^4.0.0" + +postgres-interval@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/postgres-interval/-/postgres-interval-3.0.0.tgz#baf7a8b3ebab19b7f38f07566c7aab0962f0c86a" + integrity sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw== + +postgres-range@^1.1.1: + version "1.1.4" + resolved "https://registry.yarnpkg.com/postgres-range/-/postgres-range-1.1.4.tgz#a59c5f9520909bcec5e63e8cf913a92e4c952863" + integrity sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w== + prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -11001,6 +11684,15 @@ require-from-string@^2.0.2: resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== +require-in-the-middle@^7.1.1: + version "7.3.0" + resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz#ce64a1083647dc07b3273b348357efac8a9945c9" + integrity sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw== + dependencies: + debug "^4.1.1" + module-details-from-path "^1.0.3" + resolve "^1.22.1" + resolve-alpn@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" @@ -11314,7 +12006,7 @@ semver@7.5.4, semver@^7.0.0, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver dependencies: lru-cache "^6.0.0" -semver@^6.0.0, semver@^6.1.0, semver@^6.3.0, semver@^6.3.1: +semver@^6.0.0, semver@^6.1.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -11471,6 +12163,11 @@ shelljs@0.8.5: interpret "^1.0.0" rechoir "^0.6.2" +shimmer@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337" + integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw== + side-channel@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.5.tgz#9a84546599b48909fb6af1211708d23b1946221b" From 8d62764baaaa22d395c30eb6c0f7560a8a66005a Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Fri, 28 Jun 2024 15:23:08 -0400 Subject: [PATCH 4/8] CNETDEV-37718 fixing some types and imports --- src/module.ts | 1 - src/options.ts | 102 ++++++++------------------------- src/templates/client.shared.js | 3 +- src/types/configuration.d.ts | 13 ++--- src/types/sentry.d.ts | 81 ++++++++++++++++---------- test/options.test.ts | 7 +-- 6 files changed, 84 insertions(+), 123 deletions(-) diff --git a/src/module.ts b/src/module.ts index ab82182a..11398fb6 100644 --- a/src/module.ts +++ b/src/module.ts @@ -50,7 +50,6 @@ export default defineNuxtModule({ }, serverConfig: {}, clientConfig: {}, - requestHandlerConfig: {}, }), async setup (options, nuxt) { const defaultsPublishRelease: SentryWebpackPluginOptions = { diff --git a/src/options.ts b/src/options.ts index 68001b1c..545f6318 100644 --- a/src/options.ts +++ b/src/options.ts @@ -3,14 +3,11 @@ import type { ConsolaInstance } from 'consola' import { defu } from 'defu' import initJiti from 'jiti' import { relative } from 'pathe' -// import { getDefaultIntegrations } from '@sentry/node' import * as SentryNode from '@sentry/node' -import type * as Sentry from '@sentry/node' import * as SentryCore from '@sentry/core' -// import * as PluggableIntegrations from '@sentry/vue' import type { Integration, Options } from '@sentry/types' import type { LazyConfiguration, TracingConfiguration } from './types/configuration' -import type { AllIntegrations, BrowserIntegrations, ClientCoreIntegrations, ClientIntegrations, ClientPluggableIntegrations, NodeIntegrations, NodeProfilingIntegrations, ServerCoreIntegrations, ServerIntegrations, ServerPluggableIntegrations } from './types/sentry' +import type { AllIntegrations, BrowserIntegrations, ClientCoreIntegrations, ClientIntegrations, NodeIntegrations, NodeProfilingIntegrations, ServerCoreIntegrations } from './types/sentry' import type { ModuleConfiguration } from './types' import { Nuxt, resolveAlias } from './kit-shim' import { canInitialize } from './utils' @@ -45,19 +42,6 @@ export const BROWSER_INTEGRATIONS: BooleanMap = { SessionTiming: true, } -// Optional in Vue - https://docs.sentry.io/platforms/javascript/guides/vue/configuration/integrations/plugin/ -// export const BROWSER_PLUGGABLE_INTEGRATIONS: BooleanMap = { -// CaptureConsole: true, -// ContextLines: true, -// Debug: true, -// Dedupe: true, -// ExtraErrorData: true, -// HttpClient: true, -// ReportingObserver: true, -// RewriteFrames: true, -// SessionTiming: true, -// } - const SERVER_CORE_INTEGRATIONS: BooleanMap = { FunctionToString: true, InboundFilters: true, @@ -68,6 +52,8 @@ const SERVER_CORE_INTEGRATIONS: BooleanMap = { Debug: true, Dedupe: true, ExtraErrorData: true, + HttpClient: true, + ReportingObserver: true, RewriteFrames: true, SessionTiming: true, } @@ -75,7 +61,7 @@ const SERVER_CORE_INTEGRATIONS: BooleanMap = { // Enabled by default in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Anr: true, - Apollo: true, + // Apollo: true, Console: true, Context: true, ContextLines: true, @@ -95,70 +81,50 @@ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Undici: true, } -// Optional in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/pluggable-integrations/ -// const SERVER_PLUGGABLE_INTEGRATIONS: BooleanMap = { -// CaptureConsole: true, -// Debug: true, -// Dedupe: true, -// ExtraErrorData: true, -// HttpClient: true, -// ReportingObserver: true, -// RewriteFrames: true, -// SessionTiming: true, -// } - const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { - Anr: 'Anr', - Apollo: 'Apollo', + Anr: 'anrIntegration', + // Apollo: 'Apollo', Breadcrumbs: 'breadcrumbsIntegration', CaptureConsole: 'captureConsoleIntegration', Console: 'consoleIntegration', - Context: 'Context', + Context: 'nodeContextIntegration', ContextLines: 'contextLinesIntegration', Debug: 'debugIntegration', Dedupe: 'dedupeIntegration', - Express: 'Express', + Express: 'expressIntegration', ExtraErrorData: 'extraErrorDataIntegration', FunctionToString: 'functionToStringIntegration', GlobalHandlers: 'globalHandlersIntegration', - GraphQL: 'GraphQL', - Hapi: 'Hapi', + GraphQL: 'graphqlIntegration', + Hapi: 'hapiIntegration', Http: 'httpIntegration', HttpClient: 'httpClientIntegration', HttpContext: 'httpContextIntegration', InboundFilters: 'inboundFiltersIntegration', LinkedErrors: 'linkedErrorsIntegration', LocalVariables: 'localVariablesIntegration', - Modules: 'Modules', - Mongo: 'Mongo', - Mysql: 'Mysql', + Modules: 'modulesIntegration', + Mongo: 'mongoIntegration', + Mysql: 'mysqlIntegration', OnUncaughtException: 'onUncaughtExceptionIntegration', OnUnhandledRejection: 'onUnhandledRejectionIntegration', - Postgres: 'Postgres', - Prisma: 'Prisma', - ProfilingIntegration: 'ProfilingIntegration', + Postgres: 'postgresIntegration', + Prisma: 'prismaIntegration', + ProfilingIntegration: 'nodeProfilingIntegration', Replay: 'replayIntegration', ReportingObserver: 'reportingObserverIntegration', RequestData: 'requestDataIntegration', RewriteFrames: 'rewriteFramesIntegration', SessionTiming: 'sessionTimingIntegration', - Spotlight: 'Spotlight', + Spotlight: 'spotlightIntegration', TryCatch: 'browserApiErrorsIntegration', - Undici: 'Undici', + Undici: 'nativeNodeFetchIntegration', } function mapIntegrationToImportName (key: keyof IntegrationToImportMapping): string { return INTEGRATION_TO_IMPORT_NAME_MAP[key] } -// function mapServerIntegrationToImportName (key: keyof ServerIntegrations): string { -// if (key === 'ContextLines') { -// return 'ContextLines' -// } - -// return INTEGRATION_TO_IMPORT_NAME_MAP[key] -// } - // External and optional Node.js integration - https://docs.sentry.io/platforms/node/profiling/ export const SERVER_PROFILING_INTEGRATION: keyof Pick = 'ProfilingIntegration' @@ -182,10 +148,6 @@ function isBrowserDefaultIntegration (name: string): name is keyof BrowserIntegr return name in BROWSER_INTEGRATIONS } -// function isBrowserPluggableIntegration (name: string): name is keyof ClientPluggableIntegrations { -// return name in BROWSER_PLUGGABLE_INTEGRATIONS -// } - function isServerCoreIntegration (name: string): name is keyof ServerCoreIntegrations { return name in SERVER_CORE_INTEGRATIONS } @@ -194,10 +156,6 @@ function isServerNodeIntegration (name: string): name is keyof NodeIntegrations return name in SERVER_NODE_INTEGRATIONS } -// function isServerPlugabbleIntegration (name: string): name is keyof ServerPluggableIntegrations { -// return name in SERVER_PLUGGABLE_INTEGRATIONS -// } - async function getApiMethods (packageName: string): Promise { const packageApi = await import(packageName) @@ -273,13 +231,12 @@ function resolveTracingOptions (options: ModuleConfiguration): void { const defaultTracingOptions: TracingConfiguration = { tracesSampleRate: 1.0, - browserTracing: {}, + browserTracing: { + routeLabel: 'name', + }, vueOptions: { trackComponents: true, }, - vueRouterInstrumentationOptions: { - routeLabel: 'name', - }, } options.tracing = defu(options.tracing, defaultTracingOptions) @@ -321,7 +278,6 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< resolveTracingOptions(options) for (const name of getIntegrationsKeys(options.clientIntegrations)) { - // if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name) && !isBrowserPluggableIntegration(name)) { if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name)) { logger.warn(`Sentry clientIntegration "${name}" is not recognized and will be ignored.`) delete options.clientIntegrations[name] @@ -340,7 +296,6 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< const importsBrowser: string[] = [] const importsCore: string[] = [] - // const importsPluggable: string[] = [] const integrations = getEnabledIntegrations(options.clientIntegrations) .reduce((res, key) => { @@ -350,9 +305,6 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< importsBrowser.push(importName) } else if (key in BROWSER_CORE_INTEGRATIONS) { importsCore.push(importName) - // } else if (key in BROWSER_PLUGGABLE_INTEGRATIONS) { - // importsPluggable.push(importName) - // importsBrowser.push(importName) } res[importName] = options.clientIntegrations[key] @@ -362,7 +314,6 @@ export async function resolveClientOptions (nuxt: Nuxt, moduleOptions: Readonly< const imports = { '~@sentry/browser': importsBrowser, '~@sentry/core': importsCore, - // '~@sentry/integrations': importsPluggable, '~@sentry/vue': ['init', ...(options.tracing ? ['browserTracingIntegration'] : [])], } @@ -399,7 +350,7 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< if (options.tracing) { resolveTracingOptions(options) - options.serverIntegrations = defu(options.serverIntegrations, { Http: { tracing: true } }) + options.serverIntegrations = defu(options.serverIntegrations, { Http: {} }) } if (typeof (options.serverConfig) === 'string') { @@ -415,7 +366,6 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< options.config = defu(getServerRuntimeConfig(nuxt, options), options.serverConfig, options.config) for (const name of getIntegrationsKeys(options.serverIntegrations)) { - // if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && !isServerPlugabbleIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { logger.warn(`Sentry serverIntegration "${name}" is not recognized and will be ignored.`) delete options.serverIntegrations[name] @@ -441,8 +391,8 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< delete options.serverIntegrations[SERVER_PROFILING_INTEGRATION] if (enabled) { try { - const { ProfilingIntegration } = await (import('@sentry/profiling-node').then(m => m.default || m)) - customIntegrations.push(new ProfilingIntegration()) + const { nodeProfilingIntegration } = await (import('@sentry/profiling-node').then(m => m.default || m)) + customIntegrations.push(nodeProfilingIntegration()) } catch (error) { logger.error(`To use the ${SERVER_PROFILING_INTEGRATION} integration you need to install the "@sentry/profiling-node" dependency.`) throw new Error((error as Error).message) @@ -462,13 +412,9 @@ export async function resolveServerOptions (nuxt: Nuxt, moduleOptions: Readonly< // eslint-disable-next-line import/namespace return Object.keys(opt as Record).length ? SentryCore[importName](opt) : SentryCore[importName]() } else if (isServerNodeIntegration(name)) { - // return getDefaultIntegrations(opt).find(integration => integration.name === name) // @ts-expect-error Some integrations don't take arguments but it doesn't hurt to pass one. // eslint-disable-next-line import/namespace return Object.keys(opt as Record).length ? SentryNode[importName](opt) : SentryNode[importName]() - // } else if (isServerPlugabbleIntegration(name)) { - // // eslint-disable-next-line import/namespace - // return Object.keys(opt as Record).length ? PluggableIntegrations[importName](opt) : PluggableIntegrations[importName]() } else { throw new Error(`Unsupported server integration "${name}"`) } diff --git a/src/templates/client.shared.js b/src/templates/client.shared.js index a1b1a7d5..05759b22 100644 --- a/src/templates/client.shared.js +++ b/src/templates/client.shared.js @@ -55,11 +55,10 @@ export<%= (options.clientConfigPath || options.customClientIntegrations) ? ' asy ] <% if (options.tracing) { - const { browserTracing, vueOptions, vueRouterInstrumentationOptions, ...tracingOptions } = options.tracing + const { browserTracing, vueOptions, ...tracingOptions } = options.tracing %> resolvedIntegrations.push(browserTracingIntegration({ router: ctx.app.router, - ...<%= serialize(vueRouterInstrumentationOptions) %>, ...<%= serialize(browserTracing) %>, })) merge(config, <%= serialize(vueOptions) %>, <%= serialize(tracingOptions) %>) diff --git a/src/types/configuration.d.ts b/src/types/configuration.d.ts index e5e85159..6867ecca 100644 --- a/src/types/configuration.d.ts +++ b/src/types/configuration.d.ts @@ -1,8 +1,8 @@ import { Options as SentryOptions } from '@sentry/types' -import { browserTracingIntegration, vueRouterInstrumentation } from '@sentry/vue' -import { Options as SentryVueOptions, TracingOptions as SentryVueTracingOptions } from '@sentry/vue/types/types' +import { browserTracingIntegration, vueIntegration } from '@sentry/vue' +// import { Options as SentryVueOptions } from '@sentry/vue/build/types/types' import { SentryWebpackPluginOptions } from '@sentry/webpack-plugin' -import { NodeOptions, Handlers } from '@sentry/node' +import { NodeOptions } from '@sentry/node' import { Configuration as WebpackOptions } from 'webpack' import { ClientIntegrations, ServerIntegrations } from './sentry' @@ -17,12 +17,12 @@ export interface LazyConfiguration { export interface TracingConfiguration extends Pick { browserTracing?: Parameters[0] - vueOptions?: Partial - vueRouterInstrumentationOptions?: Parameters[1] + vueOptions?: Partial>[0] } export interface ModuleConfiguration { - clientConfig: Partial | string + // clientConfig: Partial | string + clientConfig: Record | string clientIntegrations: ClientIntegrations config: SentryOptions customClientIntegrations: string @@ -43,7 +43,6 @@ export interface ModuleConfiguration { serverConfig: NodeOptions | string serverIntegrations: ServerIntegrations sourceMapStyle: WebpackOptions['devtool'] - requestHandlerConfig: Handlers.RequestHandlerOptions } export type PartialModuleConfiguration = Partial diff --git a/src/types/sentry.d.ts b/src/types/sentry.d.ts index 6176b99c..395acc76 100644 --- a/src/types/sentry.d.ts +++ b/src/types/sentry.d.ts @@ -1,4 +1,4 @@ -import { IntegrationFn, IntegrationClass, Integration } from '@sentry/types' +import { IntegrationFn } from '@sentry/types' import { breadcrumbsIntegration, browserApiErrorsIntegration, @@ -14,7 +14,7 @@ import { } from '@sentry/core' import { captureConsoleIntegration, - contextLinesIntegration, + contextLinesIntegration as vueContextLinesIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, @@ -24,11 +24,27 @@ import { sessionTimingIntegration, } from '@sentry/vue' import { - Integrations, + anrIntegration, + consoleIntegration, + contextLinesIntegration, + expressIntegration, + graphqlIntegration, + hapiIntegration, + httpIntegration, + localVariablesIntegration, + modulesIntegration, + mongoIntegration, + mysqlIntegration, + nativeNodeFetchIntegration, + nodeContextIntegration, + onUncaughtExceptionIntegration, + onUnhandledRejectionIntegration, + postgresIntegration, + prismaIntegration, + spotlightIntegration, } from '@sentry/node' type IntegrationConfig = Parameters[0] | Record | false -type ClassIntegrationConfig> = ConstructorParameters[0] | Record | false export type BrowserIntegrations = { Breadcrumbs?: IntegrationConfig @@ -36,6 +52,15 @@ export type BrowserIntegrations = { HttpContext?: IntegrationConfig Replay?: IntegrationConfig TryCatch?: IntegrationConfig + CaptureConsole?: IntegrationConfig + ContextLines?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig } export type CoreIntegrations = { @@ -43,11 +68,7 @@ export type CoreIntegrations = { InboundFilters?: IntegrationConfig LinkedErrors?: IntegrationConfig RequestData?: IntegrationConfig -} - -export type PluggableIntegrations = { CaptureConsole?: IntegrationConfig - ContextLines?: IntegrationConfig Debug?: IntegrationConfig Dedupe?: IntegrationConfig ExtraErrorData?: IntegrationConfig @@ -62,33 +83,31 @@ export type NodeProfilingIntegrations = { } export type NodeIntegrations = { - Anr?: ClassIntegrationConfig - Apollo?: ClassIntegrationConfig - Console?: ClassIntegrationConfig - Context?: ClassIntegrationConfig - ContextLines?: ClassIntegrationConfig - Express?: ClassIntegrationConfig - GraphQL?: ClassIntegrationConfig - Hapi?: ClassIntegrationConfig - Http?: ClassIntegrationConfig - LocalVariables?: ClassIntegrationConfig - Modules?: ClassIntegrationConfig - Mongo?: ClassIntegrationConfig - Mysql?: ClassIntegrationConfig - OnUncaughtException?: ClassIntegrationConfig - OnUnhandledRejection?: ClassIntegrationConfig - Postgres?: ClassIntegrationConfig - Prisma?: ClassIntegrationConfig - Spotlight?: ClassIntegrationConfig - Undici?: ClassIntegrationConfig + Anr?: IntegrationConfig + // Apollo?: IntegrationConfig + Console?: IntegrationConfig + Context?: IntegrationConfig + ContextLines?: IntegrationConfig + Express?: IntegrationConfig + GraphQL?: IntegrationConfig + Hapi?: IntegrationConfig + Http?: IntegrationConfig + LocalVariables?: IntegrationConfig + Modules?: IntegrationConfig + Mongo?: IntegrationConfig + Mysql?: IntegrationConfig + OnUncaughtException?: IntegrationConfig + OnUnhandledRejection?: IntegrationConfig + Postgres?: IntegrationConfig + Prisma?: IntegrationConfig + Spotlight?: IntegrationConfig + Undici?: IntegrationConfig } export type ClientCoreIntegrations = Pick -export type ClientPluggableIntegrations = PluggableIntegrations -export type ClientIntegrations = ClientCoreIntegrations & ClientPluggableIntegrations & BrowserIntegrations +export type ClientIntegrations = ClientCoreIntegrations & BrowserIntegrations export type ServerCoreIntegrations = CoreIntegrations -export type ServerPluggableIntegrations = Omit -export type ServerIntegrations = ServerCoreIntegrations & ServerPluggableIntegrations & NodeProfilingIntegrations & NodeIntegrations +export type ServerIntegrations = ServerCoreIntegrations & NodeProfilingIntegrations & NodeIntegrations export type AllIntegrations = ClientIntegrations & ServerIntegrations diff --git a/test/options.test.ts b/test/options.test.ts index cd20aa94..ebcd7d11 100644 --- a/test/options.test.ts +++ b/test/options.test.ts @@ -152,14 +152,13 @@ describe('Resolve Server Options', () => { tracesSampleRate: 1, }, tracing: { - browserTracing: {}, + browserTracing: { + routeLabel: 'name', + }, tracesSampleRate: 1, vueOptions: { trackComponents: true, }, - vueRouterInstrumentationOptions: { - routeLabel: 'name', - }, }, }) expect(resolvedOptions.config.integrations).not.toBeUndefined() From d7b07ea8b75345c1fdf467f9ecdbdc16b468b2e6 Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Mon, 1 Jul 2024 10:34:28 -0400 Subject: [PATCH 5/8] CNETDEV-37718 move server node integrations into server node map --- src/options.ts | 18 +++++++++--------- src/types/sentry.d.ts | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/options.ts b/src/options.ts index 545f6318..61cd926b 100644 --- a/src/options.ts +++ b/src/options.ts @@ -47,15 +47,6 @@ const SERVER_CORE_INTEGRATIONS: BooleanMap = { InboundFilters: true, LinkedErrors: true, RequestData: true, - // Integrations that are now exported from @sentry/node and @sentry/browser: - CaptureConsole: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - HttpClient: true, - ReportingObserver: true, - RewriteFrames: true, - SessionTiming: true, } // Enabled by default in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/ @@ -79,6 +70,15 @@ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Prisma: true, Spotlight: true, Undici: true, + // Integrations that are now exported from @sentry/node and @sentry/browser: + CaptureConsole: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + HttpClient: true, + ReportingObserver: true, + RewriteFrames: true, + SessionTiming: true, } const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { diff --git a/src/types/sentry.d.ts b/src/types/sentry.d.ts index 395acc76..b1c5b762 100644 --- a/src/types/sentry.d.ts +++ b/src/types/sentry.d.ts @@ -68,14 +68,6 @@ export type CoreIntegrations = { InboundFilters?: IntegrationConfig LinkedErrors?: IntegrationConfig RequestData?: IntegrationConfig - CaptureConsole?: IntegrationConfig - Debug?: IntegrationConfig - Dedupe?: IntegrationConfig - ExtraErrorData?: IntegrationConfig - HttpClient?: IntegrationConfig - ReportingObserver?: IntegrationConfig - RewriteFrames?: IntegrationConfig - SessionTiming?: IntegrationConfig } export type NodeProfilingIntegrations = { @@ -102,6 +94,14 @@ export type NodeIntegrations = { Prisma?: IntegrationConfig Spotlight?: IntegrationConfig Undici?: IntegrationConfig + CaptureConsole?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig } export type ClientCoreIntegrations = Pick From 7acf3770978ec9cf1c52a52b1aa459e40bf3cf23 Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Mon, 1 Jul 2024 11:00:09 -0400 Subject: [PATCH 6/8] CNETDEV-37718 remove commented out code --- src/options.ts | 2 -- src/types/configuration.d.ts | 1 + src/types/sentry.d.ts | 1 - tsconfig.json | 3 --- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/options.ts b/src/options.ts index 61cd926b..6668ccad 100644 --- a/src/options.ts +++ b/src/options.ts @@ -52,7 +52,6 @@ const SERVER_CORE_INTEGRATIONS: BooleanMap = { // Enabled by default in Node.js - https://docs.sentry.io/platforms/node/configuration/integrations/default-integrations/ const SERVER_NODE_INTEGRATIONS: BooleanMap = { Anr: true, - // Apollo: true, Console: true, Context: true, ContextLines: true, @@ -83,7 +82,6 @@ const SERVER_NODE_INTEGRATIONS: BooleanMap = { const INTEGRATION_TO_IMPORT_NAME_MAP: IntegrationToImportMapping = { Anr: 'anrIntegration', - // Apollo: 'Apollo', Breadcrumbs: 'breadcrumbsIntegration', CaptureConsole: 'captureConsoleIntegration', Console: 'consoleIntegration', diff --git a/src/types/configuration.d.ts b/src/types/configuration.d.ts index 6867ecca..3b90152c 100644 --- a/src/types/configuration.d.ts +++ b/src/types/configuration.d.ts @@ -21,6 +21,7 @@ export interface TracingConfiguration extends Pick | string clientConfig: Record | string clientIntegrations: ClientIntegrations diff --git a/src/types/sentry.d.ts b/src/types/sentry.d.ts index b1c5b762..30c10756 100644 --- a/src/types/sentry.d.ts +++ b/src/types/sentry.d.ts @@ -76,7 +76,6 @@ export type NodeProfilingIntegrations = { export type NodeIntegrations = { Anr?: IntegrationConfig - // Apollo?: IntegrationConfig Console?: IntegrationConfig Context?: IntegrationConfig ContextLines?: IntegrationConfig diff --git a/tsconfig.json b/tsconfig.json index 561d0557..0f607769 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,9 +15,6 @@ "~@sentry/core": [ "./node_modules/@sentry/core" ], - // "~@sentry/integrations": [ - // "./node_modules/@sentry/integrations" - // ], "~@sentry/utils": [ "./node_modules/@sentry/utils" ], From 34dfe78885f7e0dac423f5896bac852333f17b5f Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Mon, 1 Jul 2024 14:25:22 -0400 Subject: [PATCH 7/8] CNETDEV-37718 add dist files for package installation --- .gitignore | 2 +- dist/module.cjs | 5 + dist/module.d.mts | 178 + dist/module.d.ts | 178 + dist/module.json | 5 + dist/module.mjs | 766 + dist/templates/client.shared.js | 92 + dist/templates/options.ejs | 7 + dist/templates/plugin.client.js | 10 + dist/templates/plugin.lazy.js | 172 + dist/templates/plugin.mocked.js | 15 + dist/templates/plugin.server.js | 46 + dist/types.d.mts | 18 + dist/types.d.ts | 18 + test/fixture/default/dist/.nojekyll | 0 test/fixture/default/dist/200.html | 9 + test/fixture/default/dist/_nuxt/456a286.js | 3626 ++ test/fixture/default/dist/_nuxt/621f2a2.js | 90 + test/fixture/default/dist/_nuxt/7086ea0.js | 23129 +++++++++++++ test/fixture/default/dist/_nuxt/8b2f757.js | 34352 +++++++++++++++++++ test/fixture/default/dist/_nuxt/8fb4066.js | 223 + test/fixture/default/dist/index.html | 11 + 22 files changed, 62951 insertions(+), 1 deletion(-) create mode 100644 dist/module.cjs create mode 100644 dist/module.d.mts create mode 100644 dist/module.d.ts create mode 100644 dist/module.json create mode 100644 dist/module.mjs create mode 100644 dist/templates/client.shared.js create mode 100644 dist/templates/options.ejs create mode 100644 dist/templates/plugin.client.js create mode 100644 dist/templates/plugin.lazy.js create mode 100644 dist/templates/plugin.mocked.js create mode 100644 dist/templates/plugin.server.js create mode 100644 dist/types.d.mts create mode 100644 dist/types.d.ts create mode 100644 test/fixture/default/dist/.nojekyll create mode 100644 test/fixture/default/dist/200.html create mode 100644 test/fixture/default/dist/_nuxt/456a286.js create mode 100644 test/fixture/default/dist/_nuxt/621f2a2.js create mode 100644 test/fixture/default/dist/_nuxt/7086ea0.js create mode 100644 test/fixture/default/dist/_nuxt/8b2f757.js create mode 100644 test/fixture/default/dist/_nuxt/8fb4066.js create mode 100644 test/fixture/default/dist/index.html diff --git a/.gitignore b/.gitignore index 49940026..9e1df016 100755 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,7 @@ node_modules **/.yarn/*state* # Generated dirs -dist +# dist # Nuxt .nuxt diff --git a/dist/module.cjs b/dist/module.cjs new file mode 100644 index 00000000..5a320cb8 --- /dev/null +++ b/dist/module.cjs @@ -0,0 +1,5 @@ +module.exports = function(...args) { + return import('./module.mjs').then(m => m.default.call(this, ...args)) +} +const _meta = module.exports.meta = require('./module.json') +module.exports.getMeta = () => Promise.resolve(_meta) diff --git a/dist/module.d.mts b/dist/module.d.mts new file mode 100644 index 00000000..d9aba96f --- /dev/null +++ b/dist/module.d.mts @@ -0,0 +1,178 @@ +import { IntegrationFn, Options } from '@sentry/types'; +import { captureConsoleIntegration, contextLinesIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, httpClientIntegration, reportingObserverIntegration, rewriteFramesIntegration, sessionTimingIntegration, browserTracingIntegration, vueIntegration } from '@sentry/vue'; +import { SentryWebpackPluginOptions } from '@sentry/webpack-plugin'; +import * as SentryNode from '@sentry/node'; +import { anrIntegration, consoleIntegration, nodeContextIntegration, contextLinesIntegration as contextLinesIntegration$1, expressIntegration, graphqlIntegration, hapiIntegration, httpIntegration, localVariablesIntegration, modulesIntegration, mongoIntegration, mysqlIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, postgresIntegration, prismaIntegration, spotlightIntegration, nativeNodeFetchIntegration, NodeOptions } from '@sentry/node'; +import { Configuration } from 'webpack'; +import { breadcrumbsIntegration, globalHandlersIntegration, httpContextIntegration, replayIntegration, browserApiErrorsIntegration } from '@sentry/browser'; +import * as SentryTypes from '@sentry/core'; +import { functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration } from '@sentry/core'; + +type IntegrationConfig = Parameters[0] | Record | false + +type BrowserIntegrations = { + Breadcrumbs?: IntegrationConfig + GlobalHandlers?: IntegrationConfig + HttpContext?: IntegrationConfig + Replay?: IntegrationConfig + TryCatch?: IntegrationConfig + CaptureConsole?: IntegrationConfig + ContextLines?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig +} + +type CoreIntegrations = { + FunctionToString?: IntegrationConfig + InboundFilters?: IntegrationConfig + LinkedErrors?: IntegrationConfig + RequestData?: IntegrationConfig +} + +type NodeProfilingIntegrations = { + ProfilingIntegration?: IntegrationConfig // Dummy type since we don't want to depend on `@sentry/profiling-node` +} + +type NodeIntegrations = { + Anr?: IntegrationConfig + Console?: IntegrationConfig + Context?: IntegrationConfig + ContextLines?: IntegrationConfig + Express?: IntegrationConfig + GraphQL?: IntegrationConfig + Hapi?: IntegrationConfig + Http?: IntegrationConfig + LocalVariables?: IntegrationConfig + Modules?: IntegrationConfig + Mongo?: IntegrationConfig + Mysql?: IntegrationConfig + OnUncaughtException?: IntegrationConfig + OnUnhandledRejection?: IntegrationConfig + Postgres?: IntegrationConfig + Prisma?: IntegrationConfig + Spotlight?: IntegrationConfig + Undici?: IntegrationConfig + CaptureConsole?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig +} + +type ClientCoreIntegrations = Pick +type ClientIntegrations = ClientCoreIntegrations & BrowserIntegrations + +type ServerCoreIntegrations = CoreIntegrations +type ServerIntegrations = ServerCoreIntegrations & NodeProfilingIntegrations & NodeIntegrations + +interface LazyConfiguration { + chunkName?: string + injectLoadHook?: boolean + injectMock?: boolean + mockApiMethods?: boolean | string[] + webpackPrefetch?: boolean + webpackPreload?: boolean +} + +interface TracingConfiguration extends Pick { + browserTracing?: Parameters[0] + vueOptions?: Partial>[0] +} + +interface ModuleConfiguration { + // Comment out and type with 'any' for now - '@sentry/vue/build/types/types' does not exist + // clientConfig: Partial | string + clientConfig: Record | string + clientIntegrations: ClientIntegrations + config: Options + customClientIntegrations: string + customServerIntegrations: string + disableClientRelease: boolean + disableClientSide: boolean + disabled: boolean + disableServerRelease: boolean + disableServerSide: boolean + dsn: string + tracing: boolean | TracingConfiguration + initialize: boolean + lazy: boolean | LazyConfiguration + logMockCalls: boolean + /** See available options at https://docs.sentry.io/platforms/node/sourcemaps/uploading/webpack/ */ + publishRelease: boolean | SentryWebpackPluginOptions + runtimeConfigKey: string + serverConfig: NodeOptions | string + serverIntegrations: ServerIntegrations + sourceMapStyle: Configuration['devtool'] +} + +type PartialModuleConfiguration = Partial + +type ModulePublicRuntimeConfig = Pick + +type Sentry = typeof SentryTypes +type NodeSentry = typeof SentryNode + +// add type to Vue context +declare module 'vue/types/vue' { + interface Vue { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +// App Context and NuxtAppOptions +declare module '@nuxt/types' { + interface Context { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } + + interface NuxtOptions { + sentry?: PartialModuleConfiguration + } + + interface NuxtAppOptions { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +declare module '@nuxt/types/config/runtime' { + interface NuxtRuntimeConfig { + sentry?: ModulePublicRuntimeConfig + } +} + +// add types for Vuex Store +declare module 'vuex/types' { + interface Store { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +declare global { + namespace NodeJS { + interface Process { + sentry: NodeSentry + } + } +} + +type ModuleOptions = PartialModuleConfiguration + +declare const _default: unknown; + +export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default }; diff --git a/dist/module.d.ts b/dist/module.d.ts new file mode 100644 index 00000000..d9aba96f --- /dev/null +++ b/dist/module.d.ts @@ -0,0 +1,178 @@ +import { IntegrationFn, Options } from '@sentry/types'; +import { captureConsoleIntegration, contextLinesIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, httpClientIntegration, reportingObserverIntegration, rewriteFramesIntegration, sessionTimingIntegration, browserTracingIntegration, vueIntegration } from '@sentry/vue'; +import { SentryWebpackPluginOptions } from '@sentry/webpack-plugin'; +import * as SentryNode from '@sentry/node'; +import { anrIntegration, consoleIntegration, nodeContextIntegration, contextLinesIntegration as contextLinesIntegration$1, expressIntegration, graphqlIntegration, hapiIntegration, httpIntegration, localVariablesIntegration, modulesIntegration, mongoIntegration, mysqlIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, postgresIntegration, prismaIntegration, spotlightIntegration, nativeNodeFetchIntegration, NodeOptions } from '@sentry/node'; +import { Configuration } from 'webpack'; +import { breadcrumbsIntegration, globalHandlersIntegration, httpContextIntegration, replayIntegration, browserApiErrorsIntegration } from '@sentry/browser'; +import * as SentryTypes from '@sentry/core'; +import { functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration } from '@sentry/core'; + +type IntegrationConfig = Parameters[0] | Record | false + +type BrowserIntegrations = { + Breadcrumbs?: IntegrationConfig + GlobalHandlers?: IntegrationConfig + HttpContext?: IntegrationConfig + Replay?: IntegrationConfig + TryCatch?: IntegrationConfig + CaptureConsole?: IntegrationConfig + ContextLines?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig +} + +type CoreIntegrations = { + FunctionToString?: IntegrationConfig + InboundFilters?: IntegrationConfig + LinkedErrors?: IntegrationConfig + RequestData?: IntegrationConfig +} + +type NodeProfilingIntegrations = { + ProfilingIntegration?: IntegrationConfig // Dummy type since we don't want to depend on `@sentry/profiling-node` +} + +type NodeIntegrations = { + Anr?: IntegrationConfig + Console?: IntegrationConfig + Context?: IntegrationConfig + ContextLines?: IntegrationConfig + Express?: IntegrationConfig + GraphQL?: IntegrationConfig + Hapi?: IntegrationConfig + Http?: IntegrationConfig + LocalVariables?: IntegrationConfig + Modules?: IntegrationConfig + Mongo?: IntegrationConfig + Mysql?: IntegrationConfig + OnUncaughtException?: IntegrationConfig + OnUnhandledRejection?: IntegrationConfig + Postgres?: IntegrationConfig + Prisma?: IntegrationConfig + Spotlight?: IntegrationConfig + Undici?: IntegrationConfig + CaptureConsole?: IntegrationConfig + Debug?: IntegrationConfig + Dedupe?: IntegrationConfig + ExtraErrorData?: IntegrationConfig + HttpClient?: IntegrationConfig + ReportingObserver?: IntegrationConfig + RewriteFrames?: IntegrationConfig + SessionTiming?: IntegrationConfig +} + +type ClientCoreIntegrations = Pick +type ClientIntegrations = ClientCoreIntegrations & BrowserIntegrations + +type ServerCoreIntegrations = CoreIntegrations +type ServerIntegrations = ServerCoreIntegrations & NodeProfilingIntegrations & NodeIntegrations + +interface LazyConfiguration { + chunkName?: string + injectLoadHook?: boolean + injectMock?: boolean + mockApiMethods?: boolean | string[] + webpackPrefetch?: boolean + webpackPreload?: boolean +} + +interface TracingConfiguration extends Pick { + browserTracing?: Parameters[0] + vueOptions?: Partial>[0] +} + +interface ModuleConfiguration { + // Comment out and type with 'any' for now - '@sentry/vue/build/types/types' does not exist + // clientConfig: Partial | string + clientConfig: Record | string + clientIntegrations: ClientIntegrations + config: Options + customClientIntegrations: string + customServerIntegrations: string + disableClientRelease: boolean + disableClientSide: boolean + disabled: boolean + disableServerRelease: boolean + disableServerSide: boolean + dsn: string + tracing: boolean | TracingConfiguration + initialize: boolean + lazy: boolean | LazyConfiguration + logMockCalls: boolean + /** See available options at https://docs.sentry.io/platforms/node/sourcemaps/uploading/webpack/ */ + publishRelease: boolean | SentryWebpackPluginOptions + runtimeConfigKey: string + serverConfig: NodeOptions | string + serverIntegrations: ServerIntegrations + sourceMapStyle: Configuration['devtool'] +} + +type PartialModuleConfiguration = Partial + +type ModulePublicRuntimeConfig = Pick + +type Sentry = typeof SentryTypes +type NodeSentry = typeof SentryNode + +// add type to Vue context +declare module 'vue/types/vue' { + interface Vue { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +// App Context and NuxtAppOptions +declare module '@nuxt/types' { + interface Context { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } + + interface NuxtOptions { + sentry?: PartialModuleConfiguration + } + + interface NuxtAppOptions { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +declare module '@nuxt/types/config/runtime' { + interface NuxtRuntimeConfig { + sentry?: ModulePublicRuntimeConfig + } +} + +// add types for Vuex Store +declare module 'vuex/types' { + interface Store { + readonly $sentry: Sentry + $sentryLoad(): Promise + $sentryReady(): Promise + } +} + +declare global { + namespace NodeJS { + interface Process { + sentry: NodeSentry + } + } +} + +type ModuleOptions = PartialModuleConfiguration + +declare const _default: unknown; + +export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default }; diff --git a/dist/module.json b/dist/module.json new file mode 100644 index 00000000..6a062725 --- /dev/null +++ b/dist/module.json @@ -0,0 +1,5 @@ +{ + "name": "@nuxtjs/sentry", + "configKey": "sentry", + "version": "8.0.7" +} \ No newline at end of file diff --git a/dist/module.mjs b/dist/module.mjs new file mode 100644 index 00000000..24c2a7f4 --- /dev/null +++ b/dist/module.mjs @@ -0,0 +1,766 @@ +import { fileURLToPath } from 'node:url'; +import { defu } from 'defu'; +import { resolvePath } from 'mlly'; +import * as Sentry from '@sentry/node'; +import { withScope, captureException } from '@sentry/node'; +import { existsSync } from 'node:fs'; +import { consola } from 'consola'; +import hash from 'hash-sum'; +import { parse, basename, resolve, normalize, relative } from 'pathe'; +import { resolveAlias as resolveAlias$1 } from 'pathe/utils'; +import { fileURLToPath as fileURLToPath$1 } from 'url'; +import { resolve as resolve$1 } from 'path'; +import initJiti from 'jiti'; +import * as SentryCore from '@sentry/core'; + +const nuxtCtx = { + value: null +}; +function useNuxt() { + const instance = nuxtCtx.value; + if (!instance) { + throw new Error("Nuxt instance is unavailable!"); + } + return instance; +} +function tryUseNuxt() { + return nuxtCtx.value; +} +const NUXT2_SHIMS_KEY = "__nuxt2_shims_sentry_key__"; +function nuxt2Shims(nuxt) { + if (nuxt[NUXT2_SHIMS_KEY]) { + return; + } + nuxt[NUXT2_SHIMS_KEY] = true; + nuxt.hooks = nuxt; + if (!nuxtCtx.value) { + nuxtCtx.value = nuxt; + nuxt.hook("close", () => { + nuxtCtx.value = null; + }); + } +} +function defineNuxtModule(definition) { + if (!definition.meta) { + definition.meta = {}; + } + if (definition.meta.configKey === void 0) { + definition.meta.configKey = definition.meta.name; + } + function getOptions(inlineOptions) { + const nuxt = useNuxt(); + const configKey = definition.meta.configKey || definition.meta.name; + const _defaults = definition.defaults instanceof Function ? definition.defaults(nuxt) : definition.defaults; + const _options = defu(inlineOptions, nuxt.options[configKey], _defaults); + return Promise.resolve(_options); + } + async function normalizedModule(inlineOptions) { + const nuxt = this.nuxt; + const uniqueKey = definition.meta.name || definition.meta.configKey; + if (uniqueKey) { + nuxt.options._requiredModules = nuxt.options._requiredModules || {}; + if (nuxt.options._requiredModules[uniqueKey]) { + return false; + } + nuxt.options._requiredModules[uniqueKey] = true; + } + nuxt2Shims(nuxt); + const _options = await getOptions(inlineOptions); + const res = await definition.setup?.call(null, _options, nuxt) ?? {}; + return defu(res, {}); + } + normalizedModule.getMeta = () => Promise.resolve(definition.meta); + normalizedModule.getOptions = getOptions; + return normalizedModule; +} +const logger$1 = consola; +function useLogger(tag) { + return tag ? logger$1.withTag(tag) : logger$1; +} +function resolveAlias(path, alias) { + if (!alias) { + alias = tryUseNuxt()?.options.alias || {}; + } + return resolveAlias$1(path, alias); +} +function normalizePlugin(plugin) { + if (typeof plugin === "string") { + plugin = { src: plugin }; + } else { + plugin = { ...plugin }; + } + if (!plugin.src) { + throw new Error("Invalid plugin. src option is required: " + JSON.stringify(plugin)); + } + const nonTopLevelPlugin = plugin.src.match(/\/plugins\/[^/]+\/index\.[^/]+$/i); + if (nonTopLevelPlugin && nonTopLevelPlugin.length > 0 && !useNuxt().options.plugins.find((i) => (typeof i === "string" ? i : i.src).endsWith(nonTopLevelPlugin[0]))) { + console.warn(`[warn] [nuxt] [deprecation] You are using a plugin that is within a subfolder of your plugins directory without adding it to your config explicitly. You can move it to the top-level plugins directory, or include the file '~${nonTopLevelPlugin[0]}' in your plugins config (https://nuxt.com/docs/api/configuration/nuxt-config#plugins-1) to remove this warning.`); + } + plugin.src = normalize(resolveAlias(plugin.src)); + if (plugin.ssr) { + plugin.mode = "server"; + } + if (!plugin.mode) { + const [, mode = "all"] = plugin.src.match(/\.(server|client)(\.\w+)*$/) || []; + plugin.mode = mode; + } + return plugin; +} +function addPlugin(_plugin, opts = {}) { + const nuxt = useNuxt(); + const plugin = normalizePlugin(_plugin); + nuxt.options.plugins = nuxt.options.plugins.filter((p) => normalizePlugin(p).src !== plugin.src); + nuxt.options.plugins[opts.append ? "push" : "unshift"](plugin); + return plugin; +} +function addPluginTemplate(plugin, opts = {}) { + const normalizedPlugin = typeof plugin === "string" ? { src: plugin } : { ...plugin, src: addTemplate(plugin).dst }; + return addPlugin(normalizedPlugin, opts); +} +function addTemplate(_template) { + const nuxt = useNuxt(); + const template = normalizeTemplate(_template); + nuxt.options.build.templates = nuxt.options.build.templates.filter((p) => normalizeTemplate(p).filename !== template.filename); + nuxt.options.build.templates.push(template); + return template; +} +function normalizeTemplate(template) { + if (!template) { + throw new Error("Invalid template: " + JSON.stringify(template)); + } + if (typeof template === "string") { + template = { src: template }; + } else { + template = { ...template }; + } + if (template.src) { + if (!existsSync(template.src)) { + throw new Error("Template not found: " + template.src); + } + if (!template.filename) { + const srcPath = parse(template.src); + template.filename = template.fileName || `${basename(srcPath.dir)}.${srcPath.name}.${hash(template.src)}${srcPath.ext}`; + } + } + if (!template.src && !template.getContents) { + throw new Error("Invalid template. Either getContents or src options should be provided: " + JSON.stringify(template)); + } + if (!template.filename) { + throw new Error("Invalid template. Either filename should be provided: " + JSON.stringify(template)); + } + if (template.filename.endsWith(".d.ts")) { + template.write = true; + } + if (!template.dst) { + const nuxt = useNuxt(); + template.dst = resolve(nuxt.options.buildDir, template.filename); + } + return template; +} +function addWebpackPlugin(plugin, options) { + extendWebpackConfig((config) => { + config.plugins = config.plugins || []; + if (Array.isArray(plugin)) { + config.plugins.push(...plugin); + } else { + config.plugins.push(plugin); + } + }, options); +} +function extendWebpackConfig(fn, options = {}) { + const nuxt = useNuxt(); + if (options.dev === false && nuxt.options.dev) { + return; + } + if (options.build === false && nuxt.options.build) { + return; + } + nuxt.hook("webpack:config", (configs) => { + if (options.server !== false) { + const config = configs.find((i) => i.name === "server"); + if (config) { + fn(config); + } + } + if (options.client !== false) { + const config = configs.find((i) => i.name === "client"); + if (config) { + fn(config); + } + } + }); +} + +const boolToText = (value) => value ? "enabled" : "disabled"; +const envToBool = (env) => Boolean(env && env.toLowerCase() !== "false" && env !== "0"); +const canInitialize = (options) => Boolean(options.initialize && options.dsn); +const clientSentryEnabled = (options) => !options.disabled && !options.disableClientSide; +const serverSentryEnabled = (options) => !options.disabled && !options.disableServerSide; +function callOnce(fn) { + let called = false; + return function callOnceWrapper(...subargs) { + if (!called) { + called = true; + return fn(...subargs); + } + }; +} + +const jiti = initJiti(fileURLToPath(import.meta.url)); +const BROWSER_CORE_INTEGRATIONS = { + FunctionToString: true, + InboundFilters: true, + LinkedErrors: true +}; +const BROWSER_INTEGRATIONS = { + Breadcrumbs: true, + GlobalHandlers: true, + HttpContext: true, + Replay: true, + TryCatch: true, + // Integrations that are now exported from @sentry/browser + CaptureConsole: true, + ContextLines: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + HttpClient: true, + ReportingObserver: true, + RewriteFrames: true, + SessionTiming: true +}; +const SERVER_CORE_INTEGRATIONS = { + FunctionToString: true, + InboundFilters: true, + LinkedErrors: true, + RequestData: true +}; +const SERVER_NODE_INTEGRATIONS = { + Anr: true, + Console: true, + Context: true, + ContextLines: true, + Express: true, + GraphQL: true, + Hapi: true, + Http: true, + LocalVariables: true, + Modules: true, + Mongo: true, + Mysql: true, + OnUncaughtException: true, + OnUnhandledRejection: true, + Postgres: true, + Prisma: true, + Spotlight: true, + Undici: true, + // Integrations that are now exported from @sentry/node and @sentry/browser: + CaptureConsole: true, + Debug: true, + Dedupe: true, + ExtraErrorData: true, + HttpClient: true, + ReportingObserver: true, + RewriteFrames: true, + SessionTiming: true +}; +const INTEGRATION_TO_IMPORT_NAME_MAP = { + Anr: "anrIntegration", + Breadcrumbs: "breadcrumbsIntegration", + CaptureConsole: "captureConsoleIntegration", + Console: "consoleIntegration", + Context: "nodeContextIntegration", + ContextLines: "contextLinesIntegration", + Debug: "debugIntegration", + Dedupe: "dedupeIntegration", + Express: "expressIntegration", + ExtraErrorData: "extraErrorDataIntegration", + FunctionToString: "functionToStringIntegration", + GlobalHandlers: "globalHandlersIntegration", + GraphQL: "graphqlIntegration", + Hapi: "hapiIntegration", + Http: "httpIntegration", + HttpClient: "httpClientIntegration", + HttpContext: "httpContextIntegration", + InboundFilters: "inboundFiltersIntegration", + LinkedErrors: "linkedErrorsIntegration", + LocalVariables: "localVariablesIntegration", + Modules: "modulesIntegration", + Mongo: "mongoIntegration", + Mysql: "mysqlIntegration", + OnUncaughtException: "onUncaughtExceptionIntegration", + OnUnhandledRejection: "onUnhandledRejectionIntegration", + Postgres: "postgresIntegration", + Prisma: "prismaIntegration", + ProfilingIntegration: "nodeProfilingIntegration", + Replay: "replayIntegration", + ReportingObserver: "reportingObserverIntegration", + RequestData: "requestDataIntegration", + RewriteFrames: "rewriteFramesIntegration", + SessionTiming: "sessionTimingIntegration", + Spotlight: "spotlightIntegration", + TryCatch: "browserApiErrorsIntegration", + Undici: "nativeNodeFetchIntegration" +}; +function mapIntegrationToImportName(key) { + return INTEGRATION_TO_IMPORT_NAME_MAP[key]; +} +const SERVER_PROFILING_INTEGRATION = "ProfilingIntegration"; +function getEnabledIntegrations(integrations) { + return getIntegrationsKeys(integrations).filter((key) => integrations[key]); +} +function getDisabledIntegrationKeys(integrations) { + return getIntegrationsKeys(integrations).filter((key) => integrations[key] === false); +} +function getIntegrationsKeys(integrations) { + return Object.keys(integrations); +} +function isBrowserCoreIntegration(name) { + return name in BROWSER_CORE_INTEGRATIONS; +} +function isBrowserDefaultIntegration(name) { + return name in BROWSER_INTEGRATIONS; +} +function isServerCoreIntegration(name) { + return name in SERVER_CORE_INTEGRATIONS; +} +function isServerNodeIntegration(name) { + return name in SERVER_NODE_INTEGRATIONS; +} +async function getApiMethods(packageName) { + const packageApi = await import(packageName); + const apiMethods = []; + for (const key in packageApi) { + if (key === "default") { + for (const subKey in packageApi[key]) { + if (typeof packageApi[key][subKey] === "function") { + apiMethods.push(subKey); + } + } + continue; + } + if (typeof packageApi[key] === "function") { + apiMethods.push(key); + } + } + return apiMethods; +} +async function resolveRelease(moduleOptions) { + if (!("release" in moduleOptions.config)) { + try { + const SentryCli = await import('@sentry/cli').then((m) => m.default || m); + const cli = new SentryCli(); + return (await cli.releases.proposeVersion()).trim(); + } catch { + } + } +} +function resolveClientLazyOptions(options, apiMethods, logger) { + if (!options.lazy) { + return; + } + const defaultLazyOptions = { + injectMock: true, + injectLoadHook: false, + mockApiMethods: true, + chunkName: "sentry", + webpackPrefetch: false, + webpackPreload: false + }; + options.lazy = defu(options.lazy, defaultLazyOptions); + if (!options.lazy.injectMock) { + options.lazy.mockApiMethods = []; + } else if (options.lazy.mockApiMethods === true) { + options.lazy.mockApiMethods = apiMethods; + } else if (Array.isArray(options.lazy.mockApiMethods)) { + const mockMethods = options.lazy.mockApiMethods; + options.lazy.mockApiMethods = mockMethods.filter((method) => apiMethods.includes(method)); + const notfoundMethods = mockMethods.filter((method) => !apiMethods.includes(method)); + if (notfoundMethods.length) { + logger.warn("Some specified methods to mock weren't found in @sentry/vue:", notfoundMethods); + } + if (!options.lazy.mockApiMethods.includes("captureException")) { + options.lazy.mockApiMethods.push("captureException"); + } + } +} +function resolveTracingOptions(options) { + if (!options.tracing) { + return; + } + const defaultTracingOptions = { + tracesSampleRate: 1, + browserTracing: { + routeLabel: "name" + }, + vueOptions: { + trackComponents: true + } + }; + options.tracing = defu(options.tracing, defaultTracingOptions); + if (options.config.tracesSampleRate === void 0) { + options.config.tracesSampleRate = options.tracing.tracesSampleRate; + } +} +async function resolveClientOptions(nuxt, moduleOptions, logger) { + const options = defu(moduleOptions); + let clientConfigPath; + if (typeof options.clientConfig === "string") { + clientConfigPath = resolveAlias(options.clientConfig); + clientConfigPath = relative(nuxt.options.buildDir, clientConfigPath); + } else { + options.config = defu(options.clientConfig, options.config); + } + const apiMethods = await getApiMethods("@sentry/vue"); + resolveClientLazyOptions(options, apiMethods, logger); + resolveTracingOptions(options); + for (const name of getIntegrationsKeys(options.clientIntegrations)) { + if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name)) { + logger.warn(`Sentry clientIntegration "${name}" is not recognized and will be ignored.`); + delete options.clientIntegrations[name]; + } + } + let customClientIntegrations; + if (options.customClientIntegrations) { + if (typeof options.customClientIntegrations === "string") { + customClientIntegrations = resolveAlias(options.customClientIntegrations); + customClientIntegrations = relative(nuxt.options.buildDir, customClientIntegrations); + } else { + logger.warn(`Invalid customClientIntegrations option. Expected a file path, got "${typeof options.customClientIntegrations}".`); + } + } + const importsBrowser = []; + const importsCore = []; + const integrations = getEnabledIntegrations(options.clientIntegrations).reduce((res, key) => { + const importName = mapIntegrationToImportName(key); + if (key in BROWSER_INTEGRATIONS) { + importsBrowser.push(importName); + } else if (key in BROWSER_CORE_INTEGRATIONS) { + importsCore.push(importName); + } + res[importName] = options.clientIntegrations[key]; + return res; + }, {}); + const imports = { + "~@sentry/browser": importsBrowser, + "~@sentry/core": importsCore, + "~@sentry/vue": ["init", ...options.tracing ? ["browserTracingIntegration"] : []] + }; + return { + dev: nuxt.options.dev, + runtimeConfigKey: options.runtimeConfigKey, + config: { + dsn: options.dsn, + ...options.config + }, + clientConfigPath, + DISABLED_INTEGRATION_KEYS: getDisabledIntegrationKeys(options.clientIntegrations), + lazy: options.lazy, + apiMethods, + customClientIntegrations, + logMockCalls: options.logMockCalls, + // for mocked only + tracing: options.tracing, + imports, + initialize: canInitialize(options), + integrations + }; +} +async function resolveServerOptions(nuxt, moduleOptions, logger) { + const options = defu(moduleOptions); + if (options.tracing) { + resolveTracingOptions(options); + options.serverIntegrations = defu(options.serverIntegrations, { Http: {} }); + } + if (typeof options.serverConfig === "string") { + const resolvedPath = resolveAlias(options.serverConfig); + try { + const mod = jiti(resolvedPath); + options.serverConfig = (mod.default || mod)(); + } catch (error) { + logger.error(`Error handling the serverConfig plugin: +${error}`); + } + } + options.config = defu(getServerRuntimeConfig(nuxt, options), options.serverConfig, options.config); + for (const name of getIntegrationsKeys(options.serverIntegrations)) { + if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { + logger.warn(`Sentry serverIntegration "${name}" is not recognized and will be ignored.`); + delete options.serverIntegrations[name]; + } + } + let customIntegrations = []; + if (options.customServerIntegrations) { + const resolvedPath = resolveAlias(options.customServerIntegrations); + try { + const mod = jiti(resolvedPath); + customIntegrations = (mod.default || mod)(); + if (!Array.isArray(customIntegrations)) { + logger.error(`Invalid value returned from customServerIntegrations plugin. Expected an array, got "${typeof customIntegrations}".`); + } + } catch (error) { + logger.error(`Error handling the customServerIntegrations plugin: +${error}`); + } + } + if (SERVER_PROFILING_INTEGRATION in options.serverIntegrations) { + const enabled = options.serverIntegrations[SERVER_PROFILING_INTEGRATION]; + delete options.serverIntegrations[SERVER_PROFILING_INTEGRATION]; + if (enabled) { + try { + const { nodeProfilingIntegration } = await import('@sentry/profiling-node').then((m) => m.default || m); + customIntegrations.push(nodeProfilingIntegration()); + } catch (error) { + logger.error(`To use the ${SERVER_PROFILING_INTEGRATION} integration you need to install the "@sentry/profiling-node" dependency.`); + throw new Error(error.message); + } + } + } + const resolvedIntegrations = [ + // Automatically instrument Node.js libraries and frameworks + ...getEnabledIntegrations(options.serverIntegrations).map((name) => { + const importName = mapIntegrationToImportName(name); + const opt = options.serverIntegrations[name]; + try { + if (isServerCoreIntegration(name)) { + return Object.keys(opt).length ? SentryCore[importName](opt) : SentryCore[importName](); + } else if (isServerNodeIntegration(name)) { + return Object.keys(opt).length ? Sentry[importName](opt) : Sentry[importName](); + } else { + throw new Error(`Unsupported server integration "${name}"`); + } + } catch (error) { + throw new Error(`Failed initializing server integration "${name}". +${error}`); + } + }), + ...customIntegrations + ]; + const disabledIntegrationKeys = getDisabledIntegrationKeys(options.serverIntegrations); + options.config.integrations = (defaultIntegrations) => { + return [ + ...defaultIntegrations.filter((integration) => !disabledIntegrationKeys.includes(integration.name)), + ...resolvedIntegrations + ]; + }; + return { + config: { + dsn: options.dsn, + ...options.config + }, + apiMethods: await getApiMethods("@sentry/node"), + lazy: options.lazy, + logMockCalls: options.logMockCalls, + // for mocked only + tracing: options.tracing + }; +} +function getServerRuntimeConfig(nuxt, options) { + const { publicRuntimeConfig } = nuxt.options; + const { runtimeConfigKey } = options; + if (publicRuntimeConfig && typeof publicRuntimeConfig !== "function" && runtimeConfigKey in publicRuntimeConfig) { + return defu( + publicRuntimeConfig[runtimeConfigKey].serverConfig, + publicRuntimeConfig[runtimeConfigKey].config + ); + } +} + +const RESOLVED_RELEASE_FILENAME = "sentry.release.config.mjs"; +async function buildHook(nuxt, moduleOptions, logger) { + const release = await resolveRelease(moduleOptions); + const templateDir = fileURLToPath$1(new URL("./templates", import.meta.url)); + const pluginOptionClient = clientSentryEnabled(moduleOptions) && canInitialize(moduleOptions) ? moduleOptions.lazy ? "lazy" : "client" : "mocked"; + const clientOptions = defu({ config: { release } }, await resolveClientOptions(nuxt, moduleOptions, logger)); + addPluginTemplate({ + src: resolve$1(templateDir, `plugin.${pluginOptionClient}.js`), + filename: "sentry.client.js", + mode: "client", + options: clientOptions + }); + if (pluginOptionClient !== "mocked") { + addTemplate({ + src: resolve$1(templateDir, "client.shared.js"), + filename: "sentry.client.shared.js", + options: clientOptions + }); + } + const pluginOptionServer = serverSentryEnabled(moduleOptions) ? "server" : "mocked"; + const serverOptions = defu({ config: { release } }, await resolveServerOptions(nuxt, moduleOptions, logger)); + addPluginTemplate({ + src: resolve$1(templateDir, `plugin.${pluginOptionServer}.js`), + filename: "sentry.server.js", + mode: "server", + options: serverOptions + }); + if (serverSentryEnabled(moduleOptions)) { + addTemplate({ + src: resolve$1(templateDir, "options.ejs"), + filename: RESOLVED_RELEASE_FILENAME, + options: { release } + }); + } + if (!clientOptions.dev && !clientOptions.config.debug) { + const webpack = await import('webpack').then((m) => m.default || m); + addWebpackPlugin(new webpack.DefinePlugin({ + __SENTRY_DEBUG__: "false" + })); + } +} +async function webpackConfigHook(nuxt, webpackConfigs, options, logger) { + let WebpackPlugin; + try { + WebpackPlugin = await import('@sentry/webpack-plugin').then((m) => m.default || m); + } catch { + throw new Error('The "@sentry/webpack-plugin" package must be installed as a dev dependency to use the "publishRelease" option.'); + } + const publishRelease = defu(options.publishRelease); + if (!publishRelease.sourcemaps) { + publishRelease.sourcemaps = {}; + } + if (!publishRelease.sourcemaps.ignore) { + publishRelease.sourcemaps.ignore = []; + } + if (!Array.isArray(publishRelease.sourcemaps.ignore)) { + publishRelease.sourcemaps.ignore = [publishRelease.sourcemaps.ignore]; + } + if (!publishRelease.release) { + publishRelease.release = {}; + } + publishRelease.release.name = publishRelease.release.name || options.config.release || await resolveRelease(options); + if (!publishRelease.release.name) { + logger.warn('Sentry release will not be published because "config.release" or "publishRelease.release.name" was not set nor it was possible to determine it automatically from the repository.'); + return; + } + for (const config of webpackConfigs) { + config.devtool = options.sourceMapStyle; + config.plugins = config.plugins || []; + config.plugins.push(WebpackPlugin.sentryWebpackPlugin(publishRelease)); + } +} +async function initializeServerSentry(nuxt, moduleOptions, logger) { + if (process.sentry) { + return; + } + let release; + try { + const path = resolve$1(nuxt.options.buildDir, RESOLVED_RELEASE_FILENAME); + release = (await import(path)).release; + } catch { + } + const serverOptions = await resolveServerOptions(nuxt, moduleOptions, logger); + const config = defu({ release }, serverOptions.config); + process.sentry = Sentry; + if (canInitialize(moduleOptions)) { + Sentry.init(config); + nuxt.hook("render:setupMiddleware", (app) => app.use(() => Sentry.setupExpressErrorHandler(app))); + } +} +async function shutdownServerSentry() { + if (process.sentry) { + await process.sentry.close(); + process.sentry = void 0; + } +} + +const logger = useLogger("nuxt:sentry"); +const moduleDir = fileURLToPath(new URL("./", import.meta.url)); +const module = defineNuxtModule({ + meta: { + name: "@nuxtjs/sentry", + configKey: "sentry" + }, + defaults: (nuxt) => ({ + lazy: false, + dsn: process.env.SENTRY_DSN || "", + disabled: envToBool(process.env.SENTRY_DISABLED) || false, + initialize: envToBool(process.env.SENTRY_INITIALIZE) || true, + runtimeConfigKey: "sentry", + disableClientSide: envToBool(process.env.SENTRY_DISABLE_CLIENT_SIDE) || false, + disableServerSide: envToBool(process.env.SENTRY_DISABLE_SERVER_SIDE) || false, + publishRelease: envToBool(process.env.SENTRY_PUBLISH_RELEASE) || false, + disableServerRelease: envToBool(process.env.SENTRY_DISABLE_SERVER_RELEASE) || false, + disableClientRelease: envToBool(process.env.SENTRY_DISABLE_CLIENT_RELEASE) || false, + logMockCalls: true, + sourceMapStyle: "hidden-source-map", + tracing: false, + clientIntegrations: { + ExtraErrorData: {}, + ReportingObserver: { types: ["crash"] } + }, + serverIntegrations: { + Dedupe: {}, + ExtraErrorData: {}, + RewriteFrames: { root: nuxt.options.rootDir } + }, + customClientIntegrations: "", + customServerIntegrations: "", + config: { + environment: nuxt.options.dev ? "development" : "production" + }, + serverConfig: {}, + clientConfig: {} + }), + async setup(options, nuxt) { + const defaultsPublishRelease = { + sourcemaps: { + ignore: [ + "node_modules/**/*" + ] + } + }; + if (options.publishRelease) { + options.publishRelease = defu(options.publishRelease, defaultsPublishRelease); + } + if (canInitialize(options) && (clientSentryEnabled(options) || serverSentryEnabled(options))) { + const status = `(client side: ${boolToText(clientSentryEnabled(options))}, server side: ${boolToText(serverSentryEnabled(options))})`; + logger.success(`Sentry reporting is enabled ${status}`); + } else { + let why; + if (options.disabled) { + why = '"disabled" option has been set'; + } else if (!options.dsn) { + why = "no DSN has been provided"; + } else if (!options.initialize) { + why = '"initialize" option has been set to false'; + } else { + why = "both client and server side clients are disabled"; + } + logger.info(`Sentry reporting is disabled (${why})`); + } + const aliasedDependencies = [ + "lodash.mergewith", + "@sentry/browser", + "@sentry/core", + "@sentry/utils", + "@sentry/vue" + ]; + for (const dep of aliasedDependencies) { + nuxt.options.alias[`~${dep}`] = (await resolvePath(dep, { url: moduleDir })).replace(/\/cjs\//, "/esm/"); + } + if (serverSentryEnabled(options)) { + nuxt.hook("generate:routeFailed", ({ route, errors }) => { + errors.forEach(({ error }) => withScope((scope) => { + scope.setExtra("route", route); + captureException(error); + })); + }); + { + const isBuilding = nuxt.options._build && !nuxt.options.dev; + const initHook = isBuilding ? "build:compile" : "ready"; + nuxt.hook(initHook, () => initializeServerSentry(nuxt, options, logger)); + const shutdownHook = isBuilding ? "build:done" : "close"; + const shutdownServerSentryOnce = callOnce(() => shutdownServerSentry()); + nuxt.hook(shutdownHook, shutdownServerSentryOnce); + } + } + nuxt.hook("build:before", () => buildHook(nuxt, options, logger)); + if (options.publishRelease && !options.disabled && !nuxt.options.dev) { + { + nuxt.hook("webpack:config", (webpackConfigs) => webpackConfigHook(nuxt, webpackConfigs, options, logger)); + } + } + } +}); + +export { module as default }; diff --git a/dist/templates/client.shared.js b/dist/templates/client.shared.js new file mode 100644 index 00000000..05759b22 --- /dev/null +++ b/dist/templates/client.shared.js @@ -0,0 +1,92 @@ +import merge from '~lodash.mergewith' +import * as CoreSdk from '~@sentry/core' +import { captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } from '~@sentry/browser' +<% +for (const [package, imports] of Object.entries(options.imports)) { + if (imports.length) { + %>import { <%= imports.join(', ') %> } from '<%= package %>' +<% + } +} +if (options.clientConfigPath) {%>import getClientConfig from '<%= options.clientConfigPath %>' +<%} +if (options.customClientIntegrations) {%>import getCustomIntegrations from '<%= options.customClientIntegrations %>' +<%}%> + +export { init } +export const SentrySdk = { ...CoreSdk, ...{ captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } } + +/** @type {string[]} */ +const DISABLED_INTEGRATION_KEYS = <%= serialize(options.DISABLED_INTEGRATION_KEYS) %> + +/** + * @typedef {Parameters[0]} InitConfig + * @param {import('@nuxt/types').Context} ctx + * @return {Promise} + */ +export<%= (options.clientConfigPath || options.customClientIntegrations) ? ' async' : '' %> function getConfig (ctx) { + /** @type {InitConfig} */ + const config = { + <%= Object + .entries(options.config) + .map(([key, option]) => { + const value = typeof option === 'function' ? serializeFunction(option) : serialize(option) + return `${key}:${value}` + }) + .join(',\n ') %>, + } + + /** @type {NonNullable['integrations']} */ + const resolvedIntegrations = [ + <%= Object + .entries(options.integrations) + .filter(([name]) => name !== 'Vue') + .map(([name, integration]) => { + const integrationOptions = Object + .entries(integration) + .map(([key, option]) => { + const value = typeof option === 'function' ? serializeFunction(option) : serialize(option) + return `${key}:${value}` + }) + + return `${name}(${integrationOptions.length ? '{ ' + integrationOptions.join(',') + ' }' : ''})` + }) + .join(',\n ') %>, + ] + <% + if (options.tracing) { + const { browserTracing, vueOptions, ...tracingOptions } = options.tracing + %> + resolvedIntegrations.push(browserTracingIntegration({ + router: ctx.app.router, + ...<%= serialize(browserTracing) %>, + })) + merge(config, <%= serialize(vueOptions) %>, <%= serialize(tracingOptions) %>) + <% } %> + + <% if (options.clientConfigPath) { %> + const clientConfig = await getClientConfig(ctx) + clientConfig ? merge(config, clientConfig) : console.error(`[@nuxtjs/sentry] Invalid value returned from the clientConfig plugin.`) + <% } %> + + <% if (options.customClientIntegrations) { %> + const customIntegrations = await getCustomIntegrations(ctx) + if (Array.isArray(customIntegrations)) { + resolvedIntegrations.push(...customIntegrations) + } else { + console.error(`[@nuxtjs/sentry] Invalid value returned from customClientIntegrations plugin. Expected an array, got "${typeof customIntegrations}".`) + } + <% } %> + config.integrations = (defaultIntegrations) => { + return [ + ...defaultIntegrations.filter(integration => !DISABLED_INTEGRATION_KEYS.includes(integration.name)), + ...resolvedIntegrations, + ] + } + const runtimeConfigKey = <%= serialize(options.runtimeConfigKey) %> + if (ctx.$config && runtimeConfigKey && ctx.$config[runtimeConfigKey]) { + merge(config, ctx.$config[runtimeConfigKey].config, ctx.$config[runtimeConfigKey].clientConfig) + } + + return config +} diff --git a/dist/templates/options.ejs b/dist/templates/options.ejs new file mode 100644 index 00000000..eaec7491 --- /dev/null +++ b/dist/templates/options.ejs @@ -0,0 +1,7 @@ +/* eslint-disable */ +<% +for (const [key, value] of Object.entries(options)) { +%>export const <%= key %> = <%= serialize(value) %> +<% +} +%> diff --git a/dist/templates/plugin.client.js b/dist/templates/plugin.client.js new file mode 100644 index 00000000..cd5e35ff --- /dev/null +++ b/dist/templates/plugin.client.js @@ -0,0 +1,10 @@ +import Vue from 'vue' +import { getConfig, init, SentrySdk } from './sentry.client.shared' + +/** @type {import('@nuxt/types').Plugin} */ +export default async function (ctx, inject) { + const config = await getConfig(ctx) + init({ Vue, ...config }) + inject('sentry', SentrySdk) + ctx.$sentry = SentrySdk +} diff --git a/dist/templates/plugin.lazy.js b/dist/templates/plugin.lazy.js new file mode 100644 index 00000000..b2ba37b2 --- /dev/null +++ b/dist/templates/plugin.lazy.js @@ -0,0 +1,172 @@ +import Vue from 'vue' + +<% if (options.lazy.injectMock) { %> +const API_METHODS = <%= JSON.stringify(options.lazy.mockApiMethods)%> +let delayedCalls = [] +let SentryMock = {} +<% } %> +let sentryReadyResolve +let loadInitiated = false +let loadCompleted = false + +<% if (options.lazy.injectMock) { %> +let delayedGlobalErrors = [] +let delayedUnhandledRejections = [] +/** @param {ErrorEvent} event */ +const delayGlobalError = function (event) { + delayedGlobalErrors.push([event.message, event.filename, event.lineno, event.colno, event.error]) +} +const delayUnhandledRejection = function (event) { + if ('reason' in event && event.reason) { + event = event.reason + } else if ('detail' in event && event.detail && 'reason' in event.detail && event.detail.reason) { + event = event.detail.reason + } + delayedUnhandledRejections.push(event) +} + +const vueErrorHandler = Vue.config.errorHandler + +Vue.config.errorHandler = (error, vm, info) => { + if (!loadCompleted) { + if (vm) { + vm.$sentry.captureException(error) + } + + if (Vue.util) { + Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm) + } + console.error(error) + } + + if (vueErrorHandler) { + return vueErrorHandler(error, vm, info) + } +} +<% } %> + +export default function SentryPlugin (ctx, inject) { + <% if (options.lazy.injectMock) { %> + API_METHODS.forEach((key) => { + SentryMock[key] = (...args) => delayedCalls.push([key, args]) + }) + + window.addEventListener('error', delayGlobalError) + window.addEventListener('unhandledrejection', delayUnhandledRejection) + + inject('sentry', SentryMock) + ctx.$sentry = SentryMock + <% } %> + + const loadSentryHook = () => attemptLoadSentry(ctx, inject) + + <% if (options.lazy.injectLoadHook) { %> + inject('sentryLoad', loadSentryHook) + ctx.$sentryLoad = loadSentryHook + <% } else { %> + window.<%= globals.readyCallback %>(loadSentryHook) + <% } %> + + const sentryReadyPromise = new Promise((resolve) => { + sentryReadyResolve = resolve + }) + + const sentryReady = () => sentryReadyPromise + + inject('sentryReady', sentryReady) + ctx.$sentryReady = sentryReady +} + +async function attemptLoadSentry (ctx, inject) { + if (loadInitiated) { + return + } + + loadInitiated = true + + if (!window.<%= globals.nuxt %>) { + <% if (options.dev) { %> + console.warn('$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?') + <% } + if (options.lazy.injectLoadHook) { %>window.<%= globals.readyCallback %>(() => loadSentry(ctx, inject)) + <% } else { %>// Wait for onNuxtReady hook to trigger. + <% } %>return + } + + await loadSentry(ctx, inject) +} + +async function loadSentry (ctx, inject) { + if (loadCompleted) { + return + } + + <% + const magicComments = [`webpackChunkName: '${options.lazy.chunkName}'`] + if (options.lazy.webpackPrefetch) { + magicComments.push('webpackPrefetch: true') + } + if (options.lazy.webpackPreload) { + magicComments.push('webpackPreload: true') + } + %> + const { getConfig, init, SentrySdk } = await import(/* <%= magicComments.join(', ') %> */ './sentry.client.shared') + <% if (options.initialize) {%> + const config = await getConfig(ctx) + init({ Vue, ...config }) + <% } %> + + loadCompleted = true + <% if (options.lazy.injectMock) { %> + window.removeEventListener('error', delayGlobalError) + window.removeEventListener('unhandledrejection', delayUnhandledRejection) + if (delayedGlobalErrors.length) { + if (window.onerror) { + console.info('Reposting global errors after Sentry has loaded') + for (const errorArgs of delayedGlobalErrors) { + window.onerror.apply(window, errorArgs) + } + } + delayedGlobalErrors = [] + } + if (delayedUnhandledRejections.length) { + if (window.onunhandledrejection) { + console.info('Reposting unhandled promise rejection errors after Sentry has loaded') + for (const reason of delayedUnhandledRejections) { + window.onunhandledrejection(reason) + } + } + delayedUnhandledRejections = [] + } + delayedCalls.forEach(([methodName, args]) => SentrySdk[methodName].apply(SentrySdk, args)) + <% } %> + forceInject(ctx, inject, 'sentry', SentrySdk) + sentryReadyResolve(SentrySdk) + + // help gc + <% if (options.lazy.injectMock) { %> + // Avoid crashes in case the reference to the mocked object is being used after the actual Sentry instance has loaded. + API_METHODS.forEach((key) => { + SentryMock[key] = (...args) => SentrySdk[key].apply(SentrySdk, args) + }) + + // Dont unset delayedCalls & SentryMock during development - this will cause HMR issues. + <% if (!options.dev) { %> + delayedCalls = undefined + SentryMock = undefined + <% } else { %> + delayedCalls = [] + <% } %> + <% } %> + sentryReadyResolve = undefined +} + +// Custom inject function that is able to overwrite previously injected values, +// which original inject doesn't allow to do. +// This method is adapted from the inject method in nuxt/vue-app/template/index.js +function forceInject (ctx, inject, key, value) { + inject(key, value) + const injectKey = '$' + key + ctx[injectKey] = value + window.<%= globals.nuxt %>.$options[injectKey] = value +} diff --git a/dist/templates/plugin.mocked.js b/dist/templates/plugin.mocked.js new file mode 100644 index 00000000..af27ebe6 --- /dev/null +++ b/dist/templates/plugin.mocked.js @@ -0,0 +1,15 @@ +const apiMethods = <%= JSON.stringify(options.apiMethods)%> + +/** @type {import('@nuxt/types').Plugin} */ +export default function (ctx, inject) { + const SentryMock = {} + apiMethods.forEach(key => { + SentryMock[key] = <%= options.logMockCalls + ? '(...args) => console.warn(`$sentry.${key}() called, but Sentry plugin is disabled. Arguments:`, args)' + : '_ => _'%> + }) + + // Inject mocked sentry to the context as $sentry (this is used in case sentry is disabled) + inject('sentry', SentryMock) + ctx.$sentry = SentryMock +} diff --git a/dist/templates/plugin.server.js b/dist/templates/plugin.server.js new file mode 100644 index 00000000..7e68523b --- /dev/null +++ b/dist/templates/plugin.server.js @@ -0,0 +1,46 @@ +<% if (options.tracing) { %> +import { getActiveSpan, getDynamicSamplingContextFromSpan, spanToTraceHeader } from '~@sentry/core' +import { dynamicSamplingContextToSentryBaggageHeader } from '~@sentry/utils' +<% } %> + +/** @type {import('@nuxt/types').Plugin} */ +export default function (ctx, inject) { + const sentry = process.sentry || null + if (!sentry) { + return + } + inject('sentry', sentry) + ctx.$sentry = sentry + <% if (options.tracing) { %> + connectBackendTraces(ctx) + <% } %> + <% if (options.lazy) { %> + const sentryReady = () => Promise.resolve(sentry) + inject('sentryReady', sentryReady) + ctx.$sentryReady = sentryReady + <% } %> +} + +<% if (options.tracing) { %> +/** @param {import('@nuxt/types').Context} ctx */ +function connectBackendTraces (ctx) { + const { head } = ctx.app + if (!head || head instanceof Function) { + console.warn('[@nuxtjs/sentry] can not connect backend and frontend traces because app.head is a function or missing!') + return + } + const span = getActiveSpan() + if (!span) { + return + } + head.meta = head.meta || [] + head.meta.push({ hid: 'sentry-trace', name: 'sentry-trace', content: spanToTraceHeader(span) }) + const dsc = getDynamicSamplingContextFromSpan(span) + if (dsc) { + const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc) + if (baggage) { + head.meta.push({ hid: 'sentry-baggage', name: 'baggage', content: baggage }) + } + } +} +<% } %> diff --git a/dist/types.d.mts b/dist/types.d.mts new file mode 100644 index 00000000..7dd39c96 --- /dev/null +++ b/dist/types.d.mts @@ -0,0 +1,18 @@ + +import type { ModuleOptions, ModulePublicRuntimeConfig } from './module.js' + + +declare module '@nuxt/schema' { + interface NuxtConfig { ['sentry']?: Partial } + interface NuxtOptions { ['sentry']?: ModuleOptions } + interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} +} + +declare module 'nuxt/schema' { + interface NuxtConfig { ['sentry']?: Partial } + interface NuxtOptions { ['sentry']?: ModuleOptions } + interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} +} + + +export type { ModuleOptions, ModulePublicRuntimeConfig, default } from './module.js' diff --git a/dist/types.d.ts b/dist/types.d.ts new file mode 100644 index 00000000..9ea9c960 --- /dev/null +++ b/dist/types.d.ts @@ -0,0 +1,18 @@ + +import type { ModuleOptions, ModulePublicRuntimeConfig } from './module' + + +declare module '@nuxt/schema' { + interface NuxtConfig { ['sentry']?: Partial } + interface NuxtOptions { ['sentry']?: ModuleOptions } + interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} +} + +declare module 'nuxt/schema' { + interface NuxtConfig { ['sentry']?: Partial } + interface NuxtOptions { ['sentry']?: ModuleOptions } + interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} +} + + +export type { ModuleOptions, ModulePublicRuntimeConfig, default } from './module' diff --git a/test/fixture/default/dist/.nojekyll b/test/fixture/default/dist/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/test/fixture/default/dist/200.html b/test/fixture/default/dist/200.html new file mode 100644 index 00000000..39bf5123 --- /dev/null +++ b/test/fixture/default/dist/200.html @@ -0,0 +1,9 @@ + + + + + + +
Loading...
+ + diff --git a/test/fixture/default/dist/_nuxt/456a286.js b/test/fixture/default/dist/_nuxt/456a286.js new file mode 100644 index 00000000..e4972c7a --- /dev/null +++ b/test/fixture/default/dist/_nuxt/456a286.js @@ -0,0 +1,3626 @@ +(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[0],{ + +/***/ 12: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export createGetCounter */ +/* unused harmony export empty */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return globalHandleError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return interopDefault; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return hasFetch; }); +/* unused harmony export purifyData */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getChildrenComponentInstancesUsingFetch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return applyAsyncData; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return sanitizeComponent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getMatchedComponents; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return getMatchedComponentsInstances; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return flatMapComponents; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return resolveRouteComponents; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return getRouteData; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return setContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return middlewareSeries; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return promisify; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getLocation; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return compile; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return getQueryDiff; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return normalizeError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addLifecycleHook; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return urlJoin; }); +/* unused harmony export stripTrailingSlash */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return isSamePath; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return setScrollRestoration; }); +/* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38); +/* harmony import */ var _babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24); +/* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(52); +/* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54); +/* harmony import */ var regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(83); +/* harmony import */ var regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(regenerator_runtime_runtime_js__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(167); +/* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(68); +/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(139); +/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(140); +/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(84); +/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(168); +/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(285); +/* harmony import */ var core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_join_js__WEBPACK_IMPORTED_MODULE_11__); +/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(113); +/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_12__); +/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(144); +/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_13__); +/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(95); +/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_14__); +/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(143); +/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_15__); +/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(361); +/* harmony import */ var core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_entries_js__WEBPACK_IMPORTED_MODULE_16__); +/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(117); +/* harmony import */ var core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptor_js__WEBPACK_IMPORTED_MODULE_17__); +/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(118); +/* harmony import */ var core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_get_own_property_descriptors_js__WEBPACK_IMPORTED_MODULE_18__); +/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(70); +/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_19__); +/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(96); +/* harmony import */ var core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_keys_js__WEBPACK_IMPORTED_MODULE_20__); +/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(50); +/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_21__); +/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(363); +/* harmony import */ var core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_constructor_js__WEBPACK_IMPORTED_MODULE_22__); +/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(69); +/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_23__); +/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(114); +/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_24__); +/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(212); +/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_25__); +/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(115); +/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_26__); +/* harmony import */ var core_js_modules_es_string_repeat_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(365); +/* harmony import */ var core_js_modules_es_string_repeat_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_repeat_js__WEBPACK_IMPORTED_MODULE_27__); +/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(145); +/* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_28__); +/* harmony import */ var core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(288); +/* harmony import */ var core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_search_js__WEBPACK_IMPORTED_MODULE_29__); +/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(289); +/* harmony import */ var core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_starts_with_js__WEBPACK_IMPORTED_MODULE_30__); +/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(116); +/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_31__); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(14); +/* harmony import */ var ufo__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(72); + + + + + +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// window.{{globals.loadedCallback}} hook +// Useful for jsdom testing or plugins (https://github.com/tmpvar/jsdom#dealing-with-asynchronous-script-loading) +if (true) { + window.onNuxtReadyCbs = []; + window.onNuxtReady = function (cb) { + window.onNuxtReadyCbs.push(cb); + }; +} +function createGetCounter(counterObject) { + var defaultKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + return function getCounter() { + var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultKey; + if (counterObject[id] === undefined) { + counterObject[id] = 0; + } + return counterObject[id]++; + }; +} +function empty() {} +function globalHandleError(error) { + if (vue__WEBPACK_IMPORTED_MODULE_32__[/* default */ "a"].config.errorHandler) { + vue__WEBPACK_IMPORTED_MODULE_32__[/* default */ "a"].config.errorHandler(error); + } +} +function interopDefault(promise) { + return promise.then(function (m) { + return m.default || m; + }); +} +function hasFetch(vm) { + return vm.$options && typeof vm.$options.fetch === 'function' && !vm.$options.fetch.length; +} +function purifyData(data) { + if (true) { + return data; + } + return Object.entries(data).filter(function (_ref) { + var _ref2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + var valid = !(value instanceof Function) && !(value instanceof Promise); + if (!valid) { + console.warn("".concat(key, " is not able to be stringified. This will break in a production environment.")); + } + return valid; + }).reduce(function (obj, _ref3) { + var _ref4 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_ref3, 2), + key = _ref4[0], + value = _ref4[1]; + obj[key] = value; + return obj; + }, {}); +} +function getChildrenComponentInstancesUsingFetch(vm) { + var instances = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var children = vm.$children || []; + var _iterator = _createForOfIteratorHelper(children), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var child = _step.value; + if (child.$fetch) { + instances.push(child); + } + if (child.$children) { + getChildrenComponentInstancesUsingFetch(child, instances); + } + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + return instances; +} +function applyAsyncData(Component, asyncData) { + if ( + // For SSR, we once all this function without second param to just apply asyncData + // Prevent doing this for each SSR request + !asyncData && Component.options.__hasNuxtData) { + return; + } + var ComponentData = Component.options._originDataFn || Component.options.data || function () { + return {}; + }; + Component.options._originDataFn = ComponentData; + Component.options.data = function () { + var data = ComponentData.call(this, this); + if (this.$ssrContext) { + asyncData = this.$ssrContext.asyncData[Component.cid]; + } + return _objectSpread(_objectSpread({}, data), asyncData); + }; + Component.options.__hasNuxtData = true; + if (Component._Ctor && Component._Ctor.options) { + Component._Ctor.options.data = Component.options.data; + } +} +function sanitizeComponent(Component) { + // If Component already sanitized + if (Component.options && Component._Ctor === Component) { + return Component; + } + if (!Component.options) { + Component = vue__WEBPACK_IMPORTED_MODULE_32__[/* default */ "a"].extend(Component); // fix issue #6 + Component._Ctor = Component; + } else { + Component._Ctor = Component; + Component.extendOptions = Component.options; + } + // If no component name defined, set file path as name, (also fixes #5703) + if (!Component.options.name && Component.options.__file) { + Component.options.name = Component.options.__file; + } + return Component; +} +function getMatchedComponents(route) { + var matches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var prop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'components'; + return Array.prototype.concat.apply([], route.matched.map(function (m, index) { + return Object.keys(m[prop]).map(function (key) { + matches && matches.push(index); + return m[prop][key]; + }); + })); +} +function getMatchedComponentsInstances(route) { + var matches = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + return getMatchedComponents(route, matches, 'instances'); +} +function flatMapComponents(route, fn) { + return Array.prototype.concat.apply([], route.matched.map(function (m, index) { + return Object.keys(m.components).reduce(function (promises, key) { + if (m.components[key]) { + promises.push(fn(m.components[key], m.instances[key], m, key, index)); + } else { + delete m.components[key]; + } + return promises; + }, []); + })); +} +function resolveRouteComponents(route, fn) { + return Promise.all(flatMapComponents(route, /*#__PURE__*/function () { + var _ref5 = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee(Component, instance, match, key) { + var timeNow, previousReloadTime; + return regeneratorRuntime.wrap(function _callee$(_context) { + while (1) switch (_context.prev = _context.next) { + case 0: + if (!(typeof Component === 'function' && !Component.options)) { + _context.next = 11; + break; + } + _context.prev = 1; + _context.next = 4; + return Component(); + case 4: + Component = _context.sent; + _context.next = 11; + break; + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](1); + // Handle webpack chunk loading errors + // This may be due to a new deployment or a network problem + if (_context.t0 && _context.t0.name === 'ChunkLoadError' && typeof window !== 'undefined' && window.sessionStorage) { + timeNow = Date.now(); + previousReloadTime = parseInt(window.sessionStorage.getItem('nuxt-reload')); // check for previous reload time not to reload infinitely + if (!previousReloadTime || previousReloadTime + 60000 < timeNow) { + window.sessionStorage.setItem('nuxt-reload', timeNow); + window.location.reload(true /* skip cache */); + } + } + throw _context.t0; + case 11: + match.components[key] = Component = sanitizeComponent(Component); + return _context.abrupt("return", typeof fn === 'function' ? fn(Component, instance, match, key) : Component); + case 13: + case "end": + return _context.stop(); + } + }, _callee, null, [[1, 7]]); + })); + return function (_x, _x2, _x3, _x4) { + return _ref5.apply(this, arguments); + }; + }())); +} +function getRouteData(_x5) { + return _getRouteData.apply(this, arguments); +} +function _getRouteData() { + _getRouteData = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(route) { + return regeneratorRuntime.wrap(function _callee2$(_context2) { + while (1) switch (_context2.prev = _context2.next) { + case 0: + if (route) { + _context2.next = 2; + break; + } + return _context2.abrupt("return"); + case 2: + _context2.next = 4; + return resolveRouteComponents(route); + case 4: + return _context2.abrupt("return", _objectSpread(_objectSpread({}, route), {}, { + meta: getMatchedComponents(route).map(function (Component, index) { + return _objectSpread(_objectSpread({}, Component.options.meta), (route.matched[index] || {}).meta); + }) + })); + case 5: + case "end": + return _context2.stop(); + } + }, _callee2); + })); + return _getRouteData.apply(this, arguments); +} +function setContext(_x6, _x7) { + return _setContext.apply(this, arguments); +} +function _setContext() { + _setContext = Object(_babel_runtime_helpers_esm_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(app, context) { + var _yield$Promise$all, _yield$Promise$all2, currentRouteData, fromRouteData; + return regeneratorRuntime.wrap(function _callee3$(_context3) { + while (1) switch (_context3.prev = _context3.next) { + case 0: + // If context not defined, create it + if (!app.context) { + app.context = { + isStatic: true, + isDev: false, + isHMR: false, + app: app, + payload: context.payload, + error: context.error, + base: app.router.options.base, + env: {} + }; + // Only set once + + if (context.req) { + app.context.req = context.req; + } + if (context.res) { + app.context.res = context.res; + } + if (context.ssrContext) { + app.context.ssrContext = context.ssrContext; + } + app.context.redirect = function (status, path, query) { + if (!status) { + return; + } + app.context._redirected = true; + // if only 1 or 2 arguments: redirect('/') or redirect('/', { foo: 'bar' }) + var pathType = Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(path); + if (typeof status !== 'number' && (pathType === 'undefined' || pathType === 'object')) { + query = path || {}; + path = status; + pathType = Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(path); + status = 302; + } + if (pathType === 'object') { + path = app.router.resolve(path).route.fullPath; + } + // "/absolute/route", "./relative/route" or "../relative/route" + if (/(^[.]{1,2}\/)|(^\/(?!\/))/.test(path)) { + app.context.next({ + path: path, + query: query, + status: status + }); + } else { + path = Object(ufo__WEBPACK_IMPORTED_MODULE_33__[/* withQuery */ "d"])(path, query); + if (false) {} + if (true) { + // https://developer.mozilla.org/en-US/docs/Web/API/Location/assign + window.location.assign(path); + + // Throw a redirect error + throw new Error('ERR_REDIRECT'); + } + } + }; + if (false) {} + if (true) { + app.context.nuxtState = window.__NUXT__; + } + } + + // Dynamic keys + _context3.next = 3; + return Promise.all([getRouteData(context.route), getRouteData(context.from)]); + case 3: + _yield$Promise$all = _context3.sent; + _yield$Promise$all2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_yield$Promise$all, 2); + currentRouteData = _yield$Promise$all2[0]; + fromRouteData = _yield$Promise$all2[1]; + if (context.route) { + app.context.route = currentRouteData; + } + if (context.from) { + app.context.from = fromRouteData; + } + if (context.error) { + app.context.error = context.error; + } + app.context.next = context.next; + app.context._redirected = false; + app.context._errored = false; + app.context.isHMR = false; + app.context.params = app.context.route.params || {}; + app.context.query = app.context.route.query || {}; + case 16: + case "end": + return _context3.stop(); + } + }, _callee3); + })); + return _setContext.apply(this, arguments); +} +function middlewareSeries(promises, appContext, renderState) { + if (!promises.length || appContext._redirected || appContext._errored || renderState && renderState.aborted) { + return Promise.resolve(); + } + return promisify(promises[0], appContext).then(function () { + return middlewareSeries(promises.slice(1), appContext, renderState); + }); +} +function promisify(fn, context) { + var promise; + if (fn.length === 2) { + // fn(context, callback) + promise = new Promise(function (resolve) { + fn(context, function (err, data) { + if (err) { + context.error(err); + } + data = data || {}; + resolve(data); + }); + }); + } else { + promise = fn(context); + } + if (promise && promise instanceof Promise && typeof promise.then === 'function') { + return promise; + } + return Promise.resolve(promise); +} + +// Imported from vue-router +function getLocation(base, mode) { + if (mode === 'hash') { + return window.location.hash.replace(/^#\//, ''); + } + base = decodeURI(base).slice(0, -1); // consideration is base is normalized with trailing slash + var path = decodeURI(window.location.pathname); + if (base && path.startsWith(base)) { + path = path.slice(base.length); + } + var fullPath = (path || '/') + window.location.search + window.location.hash; + return Object(ufo__WEBPACK_IMPORTED_MODULE_33__[/* normalizeURL */ "c"])(fullPath); +} + +// Imported from path-to-regexp + +/** + * Compile a string to a template function for the path. + * + * @param {string} str + * @param {Object=} options + * @return {!function(Object=, Object=)} + */ +function compile(str, options) { + return tokensToFunction(parse(str, options), options); +} +function getQueryDiff(toQuery, fromQuery) { + var diff = {}; + var queries = _objectSpread(_objectSpread({}, toQuery), fromQuery); + for (var k in queries) { + if (String(toQuery[k]) !== String(fromQuery[k])) { + diff[k] = true; + } + } + return diff; +} +function normalizeError(err) { + var message; + if (!(err.message || typeof err === 'string')) { + try { + message = JSON.stringify(err, null, 2); + } catch (e) { + message = "[".concat(err.constructor.name, "]"); + } + } else { + message = err.message || err; + } + return _objectSpread(_objectSpread({}, err), {}, { + message: message, + statusCode: err.statusCode || err.status || err.response && err.response.status || 500 + }); +} + +/** + * The main path matching regexp utility. + * + * @type {RegExp} + */ +var PATH_REGEXP = new RegExp([ +// Match escaped characters that would otherwise appear in future matches. +// This allows the user to escape special characters that won't transform. +'(\\\\.)', +// Match Express-style parameters and un-named parameters with a prefix +// and optional suffixes. Matches appear as: +// +// "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] +// "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] +// "/*" => ["/", undefined, undefined, undefined, undefined, "*"] +'([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))'].join('|'), 'g'); + +/** + * Parse a string for the raw tokens. + * + * @param {string} str + * @param {Object=} options + * @return {!Array} + */ +function parse(str, options) { + var tokens = []; + var key = 0; + var index = 0; + var path = ''; + var defaultDelimiter = options && options.delimiter || '/'; + var res; + while ((res = PATH_REGEXP.exec(str)) != null) { + var m = res[0]; + var escaped = res[1]; + var offset = res.index; + path += str.slice(index, offset); + index = offset + m.length; + + // Ignore already escaped sequences. + if (escaped) { + path += escaped[1]; + continue; + } + var next = str[index]; + var prefix = res[2]; + var name = res[3]; + var capture = res[4]; + var group = res[5]; + var modifier = res[6]; + var asterisk = res[7]; + + // Push the current path onto the tokens. + if (path) { + tokens.push(path); + path = ''; + } + var partial = prefix != null && next != null && next !== prefix; + var repeat = modifier === '+' || modifier === '*'; + var optional = modifier === '?' || modifier === '*'; + var delimiter = res[2] || defaultDelimiter; + var pattern = capture || group; + tokens.push({ + name: name || key++, + prefix: prefix || '', + delimiter: delimiter, + optional: optional, + repeat: repeat, + partial: partial, + asterisk: Boolean(asterisk), + pattern: pattern ? escapeGroup(pattern) : asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?' + }); + } + + // Match any characters still remaining. + if (index < str.length) { + path += str.substr(index); + } + + // If the path exists, push it onto the end. + if (path) { + tokens.push(path); + } + return tokens; +} + +/** + * Prettier encoding of URI path segments. + * + * @param {string} + * @return {string} + */ +function encodeURIComponentPretty(str, slashAllowed) { + var re = slashAllowed ? /[?#]/g : /[/?#]/g; + return encodeURI(str).replace(re, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase(); + }); +} + +/** + * Encode the asterisk parameter. Similar to `pretty`, but allows slashes. + * + * @param {string} + * @return {string} + */ +function encodeAsterisk(str) { + return encodeURIComponentPretty(str, true); +} + +/** + * Escape a regular expression string. + * + * @param {string} str + * @return {string} + */ +function escapeString(str) { + return str.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1'); +} + +/** + * Escape the capturing group by escaping special characters and meaning. + * + * @param {string} group + * @return {string} + */ +function escapeGroup(group) { + return group.replace(/([=!:$/()])/g, '\\$1'); +} + +/** + * Expose a method for transforming tokens into the path function. + */ +function tokensToFunction(tokens, options) { + // Compile all the tokens into regexps. + var matches = new Array(tokens.length); + + // Compile all the patterns before compilation. + for (var i = 0; i < tokens.length; i++) { + if (Object(_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(tokens[i]) === 'object') { + matches[i] = new RegExp('^(?:' + tokens[i].pattern + ')$', flags(options)); + } + } + return function (obj, opts) { + var path = ''; + var data = obj || {}; + var options = opts || {}; + var encode = options.pretty ? encodeURIComponentPretty : encodeURIComponent; + for (var _i = 0; _i < tokens.length; _i++) { + var token = tokens[_i]; + if (typeof token === 'string') { + path += token; + continue; + } + var value = data[token.name || 'pathMatch']; + var segment = void 0; + if (value == null) { + if (token.optional) { + // Prepend partial segment prefixes. + if (token.partial) { + path += token.prefix; + } + continue; + } else { + throw new TypeError('Expected "' + token.name + '" to be defined'); + } + } + if (Array.isArray(value)) { + if (!token.repeat) { + throw new TypeError('Expected "' + token.name + '" to not repeat, but received `' + JSON.stringify(value) + '`'); + } + if (value.length === 0) { + if (token.optional) { + continue; + } else { + throw new TypeError('Expected "' + token.name + '" to not be empty'); + } + } + for (var j = 0; j < value.length; j++) { + segment = encode(value[j]); + if (!matches[_i].test(segment)) { + throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received `' + JSON.stringify(segment) + '`'); + } + path += (j === 0 ? token.prefix : token.delimiter) + segment; + } + continue; + } + segment = token.asterisk ? encodeAsterisk(value) : encode(value); + if (!matches[_i].test(segment)) { + throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"'); + } + path += token.prefix + segment; + } + return path; + }; +} + +/** + * Get the flags for a regexp from the options. + * + * @param {Object} options + * @return {string} + */ +function flags(options) { + return options && options.sensitive ? '' : 'i'; +} +function addLifecycleHook(vm, hook, fn) { + if (!vm.$options[hook]) { + vm.$options[hook] = []; + } + if (!vm.$options[hook].includes(fn)) { + vm.$options[hook].push(fn); + } +} +var urlJoin = ufo__WEBPACK_IMPORTED_MODULE_33__[/* joinURL */ "b"]; +var stripTrailingSlash = ufo__WEBPACK_IMPORTED_MODULE_33__[/* withoutTrailingSlash */ "e"]; +var isSamePath = ufo__WEBPACK_IMPORTED_MODULE_33__[/* isSamePath */ "a"]; +function setScrollRestoration(newVal) { + try { + window.history.scrollRestoration = newVal; + } catch (e) {} +} + +/***/ }), + +/***/ 192: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(68); +/* harmony import */ var core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(139); +/* harmony import */ var core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_description_js__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(140); +/* harmony import */ var core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_symbol_iterator_js__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84); +/* harmony import */ var core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_filter_js__WEBPACK_IMPORTED_MODULE_3__); +/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(143); +/* harmony import */ var core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_from_js__WEBPACK_IMPORTED_MODULE_4__); +/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(168); +/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_5__); +/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(113); +/* harmony import */ var core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_map_js__WEBPACK_IMPORTED_MODULE_6__); +/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(144); +/* harmony import */ var core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_slice_js__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(95); +/* harmony import */ var core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_8__); +/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(50); +/* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_9__); +/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(69); +/* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(114); +/* harmony import */ var core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_to_string_js__WEBPACK_IMPORTED_MODULE_11__); +/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(212); +/* harmony import */ var core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_includes_js__WEBPACK_IMPORTED_MODULE_12__); +/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(115); +/* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_13__); +/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(70); +/* harmony import */ var core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_14__); +/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(116); +/* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_15__); +/* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(169); +/* harmony import */ var core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_timers_js__WEBPACK_IMPORTED_MODULE_16__); +/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(14); +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } + + + + + + + + + + + + + + + + + + +var requestIdleCallback = window.requestIdleCallback || function (cb) { + var start = Date.now(); + return setTimeout(function () { + cb({ + didTimeout: false, + timeRemaining: function timeRemaining() { + return Math.max(0, 50 - (Date.now() - start)); + } + }); + }, 1); +}; +var cancelIdleCallback = window.cancelIdleCallback || function (id) { + clearTimeout(id); +}; +var observer = window.IntersectionObserver && new window.IntersectionObserver(function (entries) { + entries.forEach(function (_ref) { + var intersectionRatio = _ref.intersectionRatio, + link = _ref.target; + if (intersectionRatio <= 0 || !link.__prefetch) { + return; + } + link.__prefetch(); + }); +}); +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'NuxtLink', + extends: vue__WEBPACK_IMPORTED_MODULE_17__[/* default */ "a"].component('RouterLink'), + props: { + prefetch: { + type: Boolean, + default: true + }, + noPrefetch: { + type: Boolean, + default: false + } + }, + mounted: function mounted() { + if (this.prefetch && !this.noPrefetch) { + this.handleId = requestIdleCallback(this.observe, { + timeout: 2e3 + }); + } + }, + beforeDestroy: function beforeDestroy() { + cancelIdleCallback(this.handleId); + if (this.__observed) { + observer.unobserve(this.$el); + delete this.$el.__prefetch; + } + }, + methods: { + observe: function observe() { + // If no IntersectionObserver, avoid prefetching + if (!observer) { + return; + } + // Add to observer + if (this.shouldPrefetch()) { + this.$el.__prefetch = this.prefetchLink.bind(this); + observer.observe(this.$el); + this.__observed = true; + } + }, + shouldPrefetch: function shouldPrefetch() { + return this.getPrefetchComponents().length > 0; + }, + canPrefetch: function canPrefetch() { + var conn = navigator.connection; + var hasBadConnection = this.$nuxt.isOffline || conn && ((conn.effectiveType || '').includes('2g') || conn.saveData); + return !hasBadConnection; + }, + getPrefetchComponents: function getPrefetchComponents() { + var ref = this.$router.resolve(this.to, this.$route, this.append); + var Components = ref.resolved.matched.map(function (r) { + return r.components.default; + }); + return Components.filter(function (Component) { + return typeof Component === 'function' && !Component.options && !Component.__prefetched; + }); + }, + prefetchLink: function prefetchLink() { + if (!this.canPrefetch()) { + return; + } + // Stop observing this link (in case of internet connection changes) + observer.unobserve(this.$el); + var Components = this.getPrefetchComponents(); + var _iterator = _createForOfIteratorHelper(Components), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var Component = _step.value; + var componentOrPromise = Component(); + if (componentOrPromise instanceof Promise) { + componentOrPromise.catch(function () {}); + } + Component.__prefetched = true; + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + } + } +}); + +/***/ }), + +/***/ 231: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var middleware = {}; +/* harmony default export */ __webpack_exports__["a"] = (middleware); + +/***/ }), + +/***/ 291: +/***/ (function(module, exports, __webpack_require__) { + +// style-loader: Adds some css to the DOM by adding a + + +

Server-side

Works!

Client-side

$sentry object is missing!

+ + From be2780c8f66705b80372875cff9dfe15a51172c9 Mon Sep 17 00:00:00 2001 From: Julianne Koenig Date: Tue, 2 Jul 2024 10:51:29 -0400 Subject: [PATCH 8/8] CNETDEV-37718 remove wrap import --- dist/module.d.mts | 178 -------- dist/module.d.ts | 180 +------- dist/module.mjs | 772 +------------------------------- dist/runtime | 1 + dist/templates | 1 + dist/templates/client.shared.js | 92 ---- dist/templates/options.ejs | 7 - dist/templates/plugin.client.js | 10 - dist/templates/plugin.lazy.js | 172 ------- dist/templates/plugin.mocked.js | 15 - dist/templates/plugin.server.js | 46 -- dist/types.d.mts | 11 +- dist/types.d.ts | 11 +- src/templates/client.shared.js | 4 +- 14 files changed, 33 insertions(+), 1467 deletions(-) delete mode 100644 dist/module.d.mts create mode 120000 dist/runtime create mode 120000 dist/templates delete mode 100644 dist/templates/client.shared.js delete mode 100644 dist/templates/options.ejs delete mode 100644 dist/templates/plugin.client.js delete mode 100644 dist/templates/plugin.lazy.js delete mode 100644 dist/templates/plugin.mocked.js delete mode 100644 dist/templates/plugin.server.js diff --git a/dist/module.d.mts b/dist/module.d.mts deleted file mode 100644 index d9aba96f..00000000 --- a/dist/module.d.mts +++ /dev/null @@ -1,178 +0,0 @@ -import { IntegrationFn, Options } from '@sentry/types'; -import { captureConsoleIntegration, contextLinesIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, httpClientIntegration, reportingObserverIntegration, rewriteFramesIntegration, sessionTimingIntegration, browserTracingIntegration, vueIntegration } from '@sentry/vue'; -import { SentryWebpackPluginOptions } from '@sentry/webpack-plugin'; -import * as SentryNode from '@sentry/node'; -import { anrIntegration, consoleIntegration, nodeContextIntegration, contextLinesIntegration as contextLinesIntegration$1, expressIntegration, graphqlIntegration, hapiIntegration, httpIntegration, localVariablesIntegration, modulesIntegration, mongoIntegration, mysqlIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, postgresIntegration, prismaIntegration, spotlightIntegration, nativeNodeFetchIntegration, NodeOptions } from '@sentry/node'; -import { Configuration } from 'webpack'; -import { breadcrumbsIntegration, globalHandlersIntegration, httpContextIntegration, replayIntegration, browserApiErrorsIntegration } from '@sentry/browser'; -import * as SentryTypes from '@sentry/core'; -import { functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration } from '@sentry/core'; - -type IntegrationConfig = Parameters[0] | Record | false - -type BrowserIntegrations = { - Breadcrumbs?: IntegrationConfig - GlobalHandlers?: IntegrationConfig - HttpContext?: IntegrationConfig - Replay?: IntegrationConfig - TryCatch?: IntegrationConfig - CaptureConsole?: IntegrationConfig - ContextLines?: IntegrationConfig - Debug?: IntegrationConfig - Dedupe?: IntegrationConfig - ExtraErrorData?: IntegrationConfig - HttpClient?: IntegrationConfig - ReportingObserver?: IntegrationConfig - RewriteFrames?: IntegrationConfig - SessionTiming?: IntegrationConfig -} - -type CoreIntegrations = { - FunctionToString?: IntegrationConfig - InboundFilters?: IntegrationConfig - LinkedErrors?: IntegrationConfig - RequestData?: IntegrationConfig -} - -type NodeProfilingIntegrations = { - ProfilingIntegration?: IntegrationConfig // Dummy type since we don't want to depend on `@sentry/profiling-node` -} - -type NodeIntegrations = { - Anr?: IntegrationConfig - Console?: IntegrationConfig - Context?: IntegrationConfig - ContextLines?: IntegrationConfig - Express?: IntegrationConfig - GraphQL?: IntegrationConfig - Hapi?: IntegrationConfig - Http?: IntegrationConfig - LocalVariables?: IntegrationConfig - Modules?: IntegrationConfig - Mongo?: IntegrationConfig - Mysql?: IntegrationConfig - OnUncaughtException?: IntegrationConfig - OnUnhandledRejection?: IntegrationConfig - Postgres?: IntegrationConfig - Prisma?: IntegrationConfig - Spotlight?: IntegrationConfig - Undici?: IntegrationConfig - CaptureConsole?: IntegrationConfig - Debug?: IntegrationConfig - Dedupe?: IntegrationConfig - ExtraErrorData?: IntegrationConfig - HttpClient?: IntegrationConfig - ReportingObserver?: IntegrationConfig - RewriteFrames?: IntegrationConfig - SessionTiming?: IntegrationConfig -} - -type ClientCoreIntegrations = Pick -type ClientIntegrations = ClientCoreIntegrations & BrowserIntegrations - -type ServerCoreIntegrations = CoreIntegrations -type ServerIntegrations = ServerCoreIntegrations & NodeProfilingIntegrations & NodeIntegrations - -interface LazyConfiguration { - chunkName?: string - injectLoadHook?: boolean - injectMock?: boolean - mockApiMethods?: boolean | string[] - webpackPrefetch?: boolean - webpackPreload?: boolean -} - -interface TracingConfiguration extends Pick { - browserTracing?: Parameters[0] - vueOptions?: Partial>[0] -} - -interface ModuleConfiguration { - // Comment out and type with 'any' for now - '@sentry/vue/build/types/types' does not exist - // clientConfig: Partial | string - clientConfig: Record | string - clientIntegrations: ClientIntegrations - config: Options - customClientIntegrations: string - customServerIntegrations: string - disableClientRelease: boolean - disableClientSide: boolean - disabled: boolean - disableServerRelease: boolean - disableServerSide: boolean - dsn: string - tracing: boolean | TracingConfiguration - initialize: boolean - lazy: boolean | LazyConfiguration - logMockCalls: boolean - /** See available options at https://docs.sentry.io/platforms/node/sourcemaps/uploading/webpack/ */ - publishRelease: boolean | SentryWebpackPluginOptions - runtimeConfigKey: string - serverConfig: NodeOptions | string - serverIntegrations: ServerIntegrations - sourceMapStyle: Configuration['devtool'] -} - -type PartialModuleConfiguration = Partial - -type ModulePublicRuntimeConfig = Pick - -type Sentry = typeof SentryTypes -type NodeSentry = typeof SentryNode - -// add type to Vue context -declare module 'vue/types/vue' { - interface Vue { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -// App Context and NuxtAppOptions -declare module '@nuxt/types' { - interface Context { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } - - interface NuxtOptions { - sentry?: PartialModuleConfiguration - } - - interface NuxtAppOptions { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -declare module '@nuxt/types/config/runtime' { - interface NuxtRuntimeConfig { - sentry?: ModulePublicRuntimeConfig - } -} - -// add types for Vuex Store -declare module 'vuex/types' { - interface Store { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -declare global { - namespace NodeJS { - interface Process { - sentry: NodeSentry - } - } -} - -type ModuleOptions = PartialModuleConfiguration - -declare const _default: unknown; - -export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default }; diff --git a/dist/module.d.ts b/dist/module.d.ts index d9aba96f..1b584782 100644 --- a/dist/module.d.ts +++ b/dist/module.d.ts @@ -1,178 +1,2 @@ -import { IntegrationFn, Options } from '@sentry/types'; -import { captureConsoleIntegration, contextLinesIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, httpClientIntegration, reportingObserverIntegration, rewriteFramesIntegration, sessionTimingIntegration, browserTracingIntegration, vueIntegration } from '@sentry/vue'; -import { SentryWebpackPluginOptions } from '@sentry/webpack-plugin'; -import * as SentryNode from '@sentry/node'; -import { anrIntegration, consoleIntegration, nodeContextIntegration, contextLinesIntegration as contextLinesIntegration$1, expressIntegration, graphqlIntegration, hapiIntegration, httpIntegration, localVariablesIntegration, modulesIntegration, mongoIntegration, mysqlIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, postgresIntegration, prismaIntegration, spotlightIntegration, nativeNodeFetchIntegration, NodeOptions } from '@sentry/node'; -import { Configuration } from 'webpack'; -import { breadcrumbsIntegration, globalHandlersIntegration, httpContextIntegration, replayIntegration, browserApiErrorsIntegration } from '@sentry/browser'; -import * as SentryTypes from '@sentry/core'; -import { functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration } from '@sentry/core'; - -type IntegrationConfig = Parameters[0] | Record | false - -type BrowserIntegrations = { - Breadcrumbs?: IntegrationConfig - GlobalHandlers?: IntegrationConfig - HttpContext?: IntegrationConfig - Replay?: IntegrationConfig - TryCatch?: IntegrationConfig - CaptureConsole?: IntegrationConfig - ContextLines?: IntegrationConfig - Debug?: IntegrationConfig - Dedupe?: IntegrationConfig - ExtraErrorData?: IntegrationConfig - HttpClient?: IntegrationConfig - ReportingObserver?: IntegrationConfig - RewriteFrames?: IntegrationConfig - SessionTiming?: IntegrationConfig -} - -type CoreIntegrations = { - FunctionToString?: IntegrationConfig - InboundFilters?: IntegrationConfig - LinkedErrors?: IntegrationConfig - RequestData?: IntegrationConfig -} - -type NodeProfilingIntegrations = { - ProfilingIntegration?: IntegrationConfig // Dummy type since we don't want to depend on `@sentry/profiling-node` -} - -type NodeIntegrations = { - Anr?: IntegrationConfig - Console?: IntegrationConfig - Context?: IntegrationConfig - ContextLines?: IntegrationConfig - Express?: IntegrationConfig - GraphQL?: IntegrationConfig - Hapi?: IntegrationConfig - Http?: IntegrationConfig - LocalVariables?: IntegrationConfig - Modules?: IntegrationConfig - Mongo?: IntegrationConfig - Mysql?: IntegrationConfig - OnUncaughtException?: IntegrationConfig - OnUnhandledRejection?: IntegrationConfig - Postgres?: IntegrationConfig - Prisma?: IntegrationConfig - Spotlight?: IntegrationConfig - Undici?: IntegrationConfig - CaptureConsole?: IntegrationConfig - Debug?: IntegrationConfig - Dedupe?: IntegrationConfig - ExtraErrorData?: IntegrationConfig - HttpClient?: IntegrationConfig - ReportingObserver?: IntegrationConfig - RewriteFrames?: IntegrationConfig - SessionTiming?: IntegrationConfig -} - -type ClientCoreIntegrations = Pick -type ClientIntegrations = ClientCoreIntegrations & BrowserIntegrations - -type ServerCoreIntegrations = CoreIntegrations -type ServerIntegrations = ServerCoreIntegrations & NodeProfilingIntegrations & NodeIntegrations - -interface LazyConfiguration { - chunkName?: string - injectLoadHook?: boolean - injectMock?: boolean - mockApiMethods?: boolean | string[] - webpackPrefetch?: boolean - webpackPreload?: boolean -} - -interface TracingConfiguration extends Pick { - browserTracing?: Parameters[0] - vueOptions?: Partial>[0] -} - -interface ModuleConfiguration { - // Comment out and type with 'any' for now - '@sentry/vue/build/types/types' does not exist - // clientConfig: Partial | string - clientConfig: Record | string - clientIntegrations: ClientIntegrations - config: Options - customClientIntegrations: string - customServerIntegrations: string - disableClientRelease: boolean - disableClientSide: boolean - disabled: boolean - disableServerRelease: boolean - disableServerSide: boolean - dsn: string - tracing: boolean | TracingConfiguration - initialize: boolean - lazy: boolean | LazyConfiguration - logMockCalls: boolean - /** See available options at https://docs.sentry.io/platforms/node/sourcemaps/uploading/webpack/ */ - publishRelease: boolean | SentryWebpackPluginOptions - runtimeConfigKey: string - serverConfig: NodeOptions | string - serverIntegrations: ServerIntegrations - sourceMapStyle: Configuration['devtool'] -} - -type PartialModuleConfiguration = Partial - -type ModulePublicRuntimeConfig = Pick - -type Sentry = typeof SentryTypes -type NodeSentry = typeof SentryNode - -// add type to Vue context -declare module 'vue/types/vue' { - interface Vue { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -// App Context and NuxtAppOptions -declare module '@nuxt/types' { - interface Context { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } - - interface NuxtOptions { - sentry?: PartialModuleConfiguration - } - - interface NuxtAppOptions { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -declare module '@nuxt/types/config/runtime' { - interface NuxtRuntimeConfig { - sentry?: ModulePublicRuntimeConfig - } -} - -// add types for Vuex Store -declare module 'vuex/types' { - interface Store { - readonly $sentry: Sentry - $sentryLoad(): Promise - $sentryReady(): Promise - } -} - -declare global { - namespace NodeJS { - interface Process { - sentry: NodeSentry - } - } -} - -type ModuleOptions = PartialModuleConfiguration - -declare const _default: unknown; - -export { type ModuleOptions, type ModulePublicRuntimeConfig, _default as default }; +export * from "/Users/jkoenig/sentry-module/src/module"; +export { default } from "/Users/jkoenig/sentry-module/src/module"; \ No newline at end of file diff --git a/dist/module.mjs b/dist/module.mjs index 24c2a7f4..41a74a39 100644 --- a/dist/module.mjs +++ b/dist/module.mjs @@ -1,766 +1,12 @@ -import { fileURLToPath } from 'node:url'; -import { defu } from 'defu'; -import { resolvePath } from 'mlly'; -import * as Sentry from '@sentry/node'; -import { withScope, captureException } from '@sentry/node'; -import { existsSync } from 'node:fs'; -import { consola } from 'consola'; -import hash from 'hash-sum'; -import { parse, basename, resolve, normalize, relative } from 'pathe'; -import { resolveAlias as resolveAlias$1 } from 'pathe/utils'; -import { fileURLToPath as fileURLToPath$1 } from 'url'; -import { resolve as resolve$1 } from 'path'; -import initJiti from 'jiti'; -import * as SentryCore from '@sentry/core'; +import jiti from "file:///Users/jkoenig/sentry-module/node_modules/jiti/lib/index.js"; -const nuxtCtx = { - value: null -}; -function useNuxt() { - const instance = nuxtCtx.value; - if (!instance) { - throw new Error("Nuxt instance is unavailable!"); +/** @type {import("/Users/jkoenig/sentry-module/src/module")} */ +const _module = jiti(null, { + "esmResolve": true, + "interopDefault": true, + "alias": { + "@nuxtjs/sentry": "/Users/jkoenig/sentry-module" } - return instance; -} -function tryUseNuxt() { - return nuxtCtx.value; -} -const NUXT2_SHIMS_KEY = "__nuxt2_shims_sentry_key__"; -function nuxt2Shims(nuxt) { - if (nuxt[NUXT2_SHIMS_KEY]) { - return; - } - nuxt[NUXT2_SHIMS_KEY] = true; - nuxt.hooks = nuxt; - if (!nuxtCtx.value) { - nuxtCtx.value = nuxt; - nuxt.hook("close", () => { - nuxtCtx.value = null; - }); - } -} -function defineNuxtModule(definition) { - if (!definition.meta) { - definition.meta = {}; - } - if (definition.meta.configKey === void 0) { - definition.meta.configKey = definition.meta.name; - } - function getOptions(inlineOptions) { - const nuxt = useNuxt(); - const configKey = definition.meta.configKey || definition.meta.name; - const _defaults = definition.defaults instanceof Function ? definition.defaults(nuxt) : definition.defaults; - const _options = defu(inlineOptions, nuxt.options[configKey], _defaults); - return Promise.resolve(_options); - } - async function normalizedModule(inlineOptions) { - const nuxt = this.nuxt; - const uniqueKey = definition.meta.name || definition.meta.configKey; - if (uniqueKey) { - nuxt.options._requiredModules = nuxt.options._requiredModules || {}; - if (nuxt.options._requiredModules[uniqueKey]) { - return false; - } - nuxt.options._requiredModules[uniqueKey] = true; - } - nuxt2Shims(nuxt); - const _options = await getOptions(inlineOptions); - const res = await definition.setup?.call(null, _options, nuxt) ?? {}; - return defu(res, {}); - } - normalizedModule.getMeta = () => Promise.resolve(definition.meta); - normalizedModule.getOptions = getOptions; - return normalizedModule; -} -const logger$1 = consola; -function useLogger(tag) { - return tag ? logger$1.withTag(tag) : logger$1; -} -function resolveAlias(path, alias) { - if (!alias) { - alias = tryUseNuxt()?.options.alias || {}; - } - return resolveAlias$1(path, alias); -} -function normalizePlugin(plugin) { - if (typeof plugin === "string") { - plugin = { src: plugin }; - } else { - plugin = { ...plugin }; - } - if (!plugin.src) { - throw new Error("Invalid plugin. src option is required: " + JSON.stringify(plugin)); - } - const nonTopLevelPlugin = plugin.src.match(/\/plugins\/[^/]+\/index\.[^/]+$/i); - if (nonTopLevelPlugin && nonTopLevelPlugin.length > 0 && !useNuxt().options.plugins.find((i) => (typeof i === "string" ? i : i.src).endsWith(nonTopLevelPlugin[0]))) { - console.warn(`[warn] [nuxt] [deprecation] You are using a plugin that is within a subfolder of your plugins directory without adding it to your config explicitly. You can move it to the top-level plugins directory, or include the file '~${nonTopLevelPlugin[0]}' in your plugins config (https://nuxt.com/docs/api/configuration/nuxt-config#plugins-1) to remove this warning.`); - } - plugin.src = normalize(resolveAlias(plugin.src)); - if (plugin.ssr) { - plugin.mode = "server"; - } - if (!plugin.mode) { - const [, mode = "all"] = plugin.src.match(/\.(server|client)(\.\w+)*$/) || []; - plugin.mode = mode; - } - return plugin; -} -function addPlugin(_plugin, opts = {}) { - const nuxt = useNuxt(); - const plugin = normalizePlugin(_plugin); - nuxt.options.plugins = nuxt.options.plugins.filter((p) => normalizePlugin(p).src !== plugin.src); - nuxt.options.plugins[opts.append ? "push" : "unshift"](plugin); - return plugin; -} -function addPluginTemplate(plugin, opts = {}) { - const normalizedPlugin = typeof plugin === "string" ? { src: plugin } : { ...plugin, src: addTemplate(plugin).dst }; - return addPlugin(normalizedPlugin, opts); -} -function addTemplate(_template) { - const nuxt = useNuxt(); - const template = normalizeTemplate(_template); - nuxt.options.build.templates = nuxt.options.build.templates.filter((p) => normalizeTemplate(p).filename !== template.filename); - nuxt.options.build.templates.push(template); - return template; -} -function normalizeTemplate(template) { - if (!template) { - throw new Error("Invalid template: " + JSON.stringify(template)); - } - if (typeof template === "string") { - template = { src: template }; - } else { - template = { ...template }; - } - if (template.src) { - if (!existsSync(template.src)) { - throw new Error("Template not found: " + template.src); - } - if (!template.filename) { - const srcPath = parse(template.src); - template.filename = template.fileName || `${basename(srcPath.dir)}.${srcPath.name}.${hash(template.src)}${srcPath.ext}`; - } - } - if (!template.src && !template.getContents) { - throw new Error("Invalid template. Either getContents or src options should be provided: " + JSON.stringify(template)); - } - if (!template.filename) { - throw new Error("Invalid template. Either filename should be provided: " + JSON.stringify(template)); - } - if (template.filename.endsWith(".d.ts")) { - template.write = true; - } - if (!template.dst) { - const nuxt = useNuxt(); - template.dst = resolve(nuxt.options.buildDir, template.filename); - } - return template; -} -function addWebpackPlugin(plugin, options) { - extendWebpackConfig((config) => { - config.plugins = config.plugins || []; - if (Array.isArray(plugin)) { - config.plugins.push(...plugin); - } else { - config.plugins.push(plugin); - } - }, options); -} -function extendWebpackConfig(fn, options = {}) { - const nuxt = useNuxt(); - if (options.dev === false && nuxt.options.dev) { - return; - } - if (options.build === false && nuxt.options.build) { - return; - } - nuxt.hook("webpack:config", (configs) => { - if (options.server !== false) { - const config = configs.find((i) => i.name === "server"); - if (config) { - fn(config); - } - } - if (options.client !== false) { - const config = configs.find((i) => i.name === "client"); - if (config) { - fn(config); - } - } - }); -} - -const boolToText = (value) => value ? "enabled" : "disabled"; -const envToBool = (env) => Boolean(env && env.toLowerCase() !== "false" && env !== "0"); -const canInitialize = (options) => Boolean(options.initialize && options.dsn); -const clientSentryEnabled = (options) => !options.disabled && !options.disableClientSide; -const serverSentryEnabled = (options) => !options.disabled && !options.disableServerSide; -function callOnce(fn) { - let called = false; - return function callOnceWrapper(...subargs) { - if (!called) { - called = true; - return fn(...subargs); - } - }; -} - -const jiti = initJiti(fileURLToPath(import.meta.url)); -const BROWSER_CORE_INTEGRATIONS = { - FunctionToString: true, - InboundFilters: true, - LinkedErrors: true -}; -const BROWSER_INTEGRATIONS = { - Breadcrumbs: true, - GlobalHandlers: true, - HttpContext: true, - Replay: true, - TryCatch: true, - // Integrations that are now exported from @sentry/browser - CaptureConsole: true, - ContextLines: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - HttpClient: true, - ReportingObserver: true, - RewriteFrames: true, - SessionTiming: true -}; -const SERVER_CORE_INTEGRATIONS = { - FunctionToString: true, - InboundFilters: true, - LinkedErrors: true, - RequestData: true -}; -const SERVER_NODE_INTEGRATIONS = { - Anr: true, - Console: true, - Context: true, - ContextLines: true, - Express: true, - GraphQL: true, - Hapi: true, - Http: true, - LocalVariables: true, - Modules: true, - Mongo: true, - Mysql: true, - OnUncaughtException: true, - OnUnhandledRejection: true, - Postgres: true, - Prisma: true, - Spotlight: true, - Undici: true, - // Integrations that are now exported from @sentry/node and @sentry/browser: - CaptureConsole: true, - Debug: true, - Dedupe: true, - ExtraErrorData: true, - HttpClient: true, - ReportingObserver: true, - RewriteFrames: true, - SessionTiming: true -}; -const INTEGRATION_TO_IMPORT_NAME_MAP = { - Anr: "anrIntegration", - Breadcrumbs: "breadcrumbsIntegration", - CaptureConsole: "captureConsoleIntegration", - Console: "consoleIntegration", - Context: "nodeContextIntegration", - ContextLines: "contextLinesIntegration", - Debug: "debugIntegration", - Dedupe: "dedupeIntegration", - Express: "expressIntegration", - ExtraErrorData: "extraErrorDataIntegration", - FunctionToString: "functionToStringIntegration", - GlobalHandlers: "globalHandlersIntegration", - GraphQL: "graphqlIntegration", - Hapi: "hapiIntegration", - Http: "httpIntegration", - HttpClient: "httpClientIntegration", - HttpContext: "httpContextIntegration", - InboundFilters: "inboundFiltersIntegration", - LinkedErrors: "linkedErrorsIntegration", - LocalVariables: "localVariablesIntegration", - Modules: "modulesIntegration", - Mongo: "mongoIntegration", - Mysql: "mysqlIntegration", - OnUncaughtException: "onUncaughtExceptionIntegration", - OnUnhandledRejection: "onUnhandledRejectionIntegration", - Postgres: "postgresIntegration", - Prisma: "prismaIntegration", - ProfilingIntegration: "nodeProfilingIntegration", - Replay: "replayIntegration", - ReportingObserver: "reportingObserverIntegration", - RequestData: "requestDataIntegration", - RewriteFrames: "rewriteFramesIntegration", - SessionTiming: "sessionTimingIntegration", - Spotlight: "spotlightIntegration", - TryCatch: "browserApiErrorsIntegration", - Undici: "nativeNodeFetchIntegration" -}; -function mapIntegrationToImportName(key) { - return INTEGRATION_TO_IMPORT_NAME_MAP[key]; -} -const SERVER_PROFILING_INTEGRATION = "ProfilingIntegration"; -function getEnabledIntegrations(integrations) { - return getIntegrationsKeys(integrations).filter((key) => integrations[key]); -} -function getDisabledIntegrationKeys(integrations) { - return getIntegrationsKeys(integrations).filter((key) => integrations[key] === false); -} -function getIntegrationsKeys(integrations) { - return Object.keys(integrations); -} -function isBrowserCoreIntegration(name) { - return name in BROWSER_CORE_INTEGRATIONS; -} -function isBrowserDefaultIntegration(name) { - return name in BROWSER_INTEGRATIONS; -} -function isServerCoreIntegration(name) { - return name in SERVER_CORE_INTEGRATIONS; -} -function isServerNodeIntegration(name) { - return name in SERVER_NODE_INTEGRATIONS; -} -async function getApiMethods(packageName) { - const packageApi = await import(packageName); - const apiMethods = []; - for (const key in packageApi) { - if (key === "default") { - for (const subKey in packageApi[key]) { - if (typeof packageApi[key][subKey] === "function") { - apiMethods.push(subKey); - } - } - continue; - } - if (typeof packageApi[key] === "function") { - apiMethods.push(key); - } - } - return apiMethods; -} -async function resolveRelease(moduleOptions) { - if (!("release" in moduleOptions.config)) { - try { - const SentryCli = await import('@sentry/cli').then((m) => m.default || m); - const cli = new SentryCli(); - return (await cli.releases.proposeVersion()).trim(); - } catch { - } - } -} -function resolveClientLazyOptions(options, apiMethods, logger) { - if (!options.lazy) { - return; - } - const defaultLazyOptions = { - injectMock: true, - injectLoadHook: false, - mockApiMethods: true, - chunkName: "sentry", - webpackPrefetch: false, - webpackPreload: false - }; - options.lazy = defu(options.lazy, defaultLazyOptions); - if (!options.lazy.injectMock) { - options.lazy.mockApiMethods = []; - } else if (options.lazy.mockApiMethods === true) { - options.lazy.mockApiMethods = apiMethods; - } else if (Array.isArray(options.lazy.mockApiMethods)) { - const mockMethods = options.lazy.mockApiMethods; - options.lazy.mockApiMethods = mockMethods.filter((method) => apiMethods.includes(method)); - const notfoundMethods = mockMethods.filter((method) => !apiMethods.includes(method)); - if (notfoundMethods.length) { - logger.warn("Some specified methods to mock weren't found in @sentry/vue:", notfoundMethods); - } - if (!options.lazy.mockApiMethods.includes("captureException")) { - options.lazy.mockApiMethods.push("captureException"); - } - } -} -function resolveTracingOptions(options) { - if (!options.tracing) { - return; - } - const defaultTracingOptions = { - tracesSampleRate: 1, - browserTracing: { - routeLabel: "name" - }, - vueOptions: { - trackComponents: true - } - }; - options.tracing = defu(options.tracing, defaultTracingOptions); - if (options.config.tracesSampleRate === void 0) { - options.config.tracesSampleRate = options.tracing.tracesSampleRate; - } -} -async function resolveClientOptions(nuxt, moduleOptions, logger) { - const options = defu(moduleOptions); - let clientConfigPath; - if (typeof options.clientConfig === "string") { - clientConfigPath = resolveAlias(options.clientConfig); - clientConfigPath = relative(nuxt.options.buildDir, clientConfigPath); - } else { - options.config = defu(options.clientConfig, options.config); - } - const apiMethods = await getApiMethods("@sentry/vue"); - resolveClientLazyOptions(options, apiMethods, logger); - resolveTracingOptions(options); - for (const name of getIntegrationsKeys(options.clientIntegrations)) { - if (!isBrowserDefaultIntegration(name) && !isBrowserCoreIntegration(name)) { - logger.warn(`Sentry clientIntegration "${name}" is not recognized and will be ignored.`); - delete options.clientIntegrations[name]; - } - } - let customClientIntegrations; - if (options.customClientIntegrations) { - if (typeof options.customClientIntegrations === "string") { - customClientIntegrations = resolveAlias(options.customClientIntegrations); - customClientIntegrations = relative(nuxt.options.buildDir, customClientIntegrations); - } else { - logger.warn(`Invalid customClientIntegrations option. Expected a file path, got "${typeof options.customClientIntegrations}".`); - } - } - const importsBrowser = []; - const importsCore = []; - const integrations = getEnabledIntegrations(options.clientIntegrations).reduce((res, key) => { - const importName = mapIntegrationToImportName(key); - if (key in BROWSER_INTEGRATIONS) { - importsBrowser.push(importName); - } else if (key in BROWSER_CORE_INTEGRATIONS) { - importsCore.push(importName); - } - res[importName] = options.clientIntegrations[key]; - return res; - }, {}); - const imports = { - "~@sentry/browser": importsBrowser, - "~@sentry/core": importsCore, - "~@sentry/vue": ["init", ...options.tracing ? ["browserTracingIntegration"] : []] - }; - return { - dev: nuxt.options.dev, - runtimeConfigKey: options.runtimeConfigKey, - config: { - dsn: options.dsn, - ...options.config - }, - clientConfigPath, - DISABLED_INTEGRATION_KEYS: getDisabledIntegrationKeys(options.clientIntegrations), - lazy: options.lazy, - apiMethods, - customClientIntegrations, - logMockCalls: options.logMockCalls, - // for mocked only - tracing: options.tracing, - imports, - initialize: canInitialize(options), - integrations - }; -} -async function resolveServerOptions(nuxt, moduleOptions, logger) { - const options = defu(moduleOptions); - if (options.tracing) { - resolveTracingOptions(options); - options.serverIntegrations = defu(options.serverIntegrations, { Http: {} }); - } - if (typeof options.serverConfig === "string") { - const resolvedPath = resolveAlias(options.serverConfig); - try { - const mod = jiti(resolvedPath); - options.serverConfig = (mod.default || mod)(); - } catch (error) { - logger.error(`Error handling the serverConfig plugin: -${error}`); - } - } - options.config = defu(getServerRuntimeConfig(nuxt, options), options.serverConfig, options.config); - for (const name of getIntegrationsKeys(options.serverIntegrations)) { - if (!isServerNodeIntegration(name) && !isServerCoreIntegration(name) && name !== SERVER_PROFILING_INTEGRATION) { - logger.warn(`Sentry serverIntegration "${name}" is not recognized and will be ignored.`); - delete options.serverIntegrations[name]; - } - } - let customIntegrations = []; - if (options.customServerIntegrations) { - const resolvedPath = resolveAlias(options.customServerIntegrations); - try { - const mod = jiti(resolvedPath); - customIntegrations = (mod.default || mod)(); - if (!Array.isArray(customIntegrations)) { - logger.error(`Invalid value returned from customServerIntegrations plugin. Expected an array, got "${typeof customIntegrations}".`); - } - } catch (error) { - logger.error(`Error handling the customServerIntegrations plugin: -${error}`); - } - } - if (SERVER_PROFILING_INTEGRATION in options.serverIntegrations) { - const enabled = options.serverIntegrations[SERVER_PROFILING_INTEGRATION]; - delete options.serverIntegrations[SERVER_PROFILING_INTEGRATION]; - if (enabled) { - try { - const { nodeProfilingIntegration } = await import('@sentry/profiling-node').then((m) => m.default || m); - customIntegrations.push(nodeProfilingIntegration()); - } catch (error) { - logger.error(`To use the ${SERVER_PROFILING_INTEGRATION} integration you need to install the "@sentry/profiling-node" dependency.`); - throw new Error(error.message); - } - } - } - const resolvedIntegrations = [ - // Automatically instrument Node.js libraries and frameworks - ...getEnabledIntegrations(options.serverIntegrations).map((name) => { - const importName = mapIntegrationToImportName(name); - const opt = options.serverIntegrations[name]; - try { - if (isServerCoreIntegration(name)) { - return Object.keys(opt).length ? SentryCore[importName](opt) : SentryCore[importName](); - } else if (isServerNodeIntegration(name)) { - return Object.keys(opt).length ? Sentry[importName](opt) : Sentry[importName](); - } else { - throw new Error(`Unsupported server integration "${name}"`); - } - } catch (error) { - throw new Error(`Failed initializing server integration "${name}". -${error}`); - } - }), - ...customIntegrations - ]; - const disabledIntegrationKeys = getDisabledIntegrationKeys(options.serverIntegrations); - options.config.integrations = (defaultIntegrations) => { - return [ - ...defaultIntegrations.filter((integration) => !disabledIntegrationKeys.includes(integration.name)), - ...resolvedIntegrations - ]; - }; - return { - config: { - dsn: options.dsn, - ...options.config - }, - apiMethods: await getApiMethods("@sentry/node"), - lazy: options.lazy, - logMockCalls: options.logMockCalls, - // for mocked only - tracing: options.tracing - }; -} -function getServerRuntimeConfig(nuxt, options) { - const { publicRuntimeConfig } = nuxt.options; - const { runtimeConfigKey } = options; - if (publicRuntimeConfig && typeof publicRuntimeConfig !== "function" && runtimeConfigKey in publicRuntimeConfig) { - return defu( - publicRuntimeConfig[runtimeConfigKey].serverConfig, - publicRuntimeConfig[runtimeConfigKey].config - ); - } -} - -const RESOLVED_RELEASE_FILENAME = "sentry.release.config.mjs"; -async function buildHook(nuxt, moduleOptions, logger) { - const release = await resolveRelease(moduleOptions); - const templateDir = fileURLToPath$1(new URL("./templates", import.meta.url)); - const pluginOptionClient = clientSentryEnabled(moduleOptions) && canInitialize(moduleOptions) ? moduleOptions.lazy ? "lazy" : "client" : "mocked"; - const clientOptions = defu({ config: { release } }, await resolveClientOptions(nuxt, moduleOptions, logger)); - addPluginTemplate({ - src: resolve$1(templateDir, `plugin.${pluginOptionClient}.js`), - filename: "sentry.client.js", - mode: "client", - options: clientOptions - }); - if (pluginOptionClient !== "mocked") { - addTemplate({ - src: resolve$1(templateDir, "client.shared.js"), - filename: "sentry.client.shared.js", - options: clientOptions - }); - } - const pluginOptionServer = serverSentryEnabled(moduleOptions) ? "server" : "mocked"; - const serverOptions = defu({ config: { release } }, await resolveServerOptions(nuxt, moduleOptions, logger)); - addPluginTemplate({ - src: resolve$1(templateDir, `plugin.${pluginOptionServer}.js`), - filename: "sentry.server.js", - mode: "server", - options: serverOptions - }); - if (serverSentryEnabled(moduleOptions)) { - addTemplate({ - src: resolve$1(templateDir, "options.ejs"), - filename: RESOLVED_RELEASE_FILENAME, - options: { release } - }); - } - if (!clientOptions.dev && !clientOptions.config.debug) { - const webpack = await import('webpack').then((m) => m.default || m); - addWebpackPlugin(new webpack.DefinePlugin({ - __SENTRY_DEBUG__: "false" - })); - } -} -async function webpackConfigHook(nuxt, webpackConfigs, options, logger) { - let WebpackPlugin; - try { - WebpackPlugin = await import('@sentry/webpack-plugin').then((m) => m.default || m); - } catch { - throw new Error('The "@sentry/webpack-plugin" package must be installed as a dev dependency to use the "publishRelease" option.'); - } - const publishRelease = defu(options.publishRelease); - if (!publishRelease.sourcemaps) { - publishRelease.sourcemaps = {}; - } - if (!publishRelease.sourcemaps.ignore) { - publishRelease.sourcemaps.ignore = []; - } - if (!Array.isArray(publishRelease.sourcemaps.ignore)) { - publishRelease.sourcemaps.ignore = [publishRelease.sourcemaps.ignore]; - } - if (!publishRelease.release) { - publishRelease.release = {}; - } - publishRelease.release.name = publishRelease.release.name || options.config.release || await resolveRelease(options); - if (!publishRelease.release.name) { - logger.warn('Sentry release will not be published because "config.release" or "publishRelease.release.name" was not set nor it was possible to determine it automatically from the repository.'); - return; - } - for (const config of webpackConfigs) { - config.devtool = options.sourceMapStyle; - config.plugins = config.plugins || []; - config.plugins.push(WebpackPlugin.sentryWebpackPlugin(publishRelease)); - } -} -async function initializeServerSentry(nuxt, moduleOptions, logger) { - if (process.sentry) { - return; - } - let release; - try { - const path = resolve$1(nuxt.options.buildDir, RESOLVED_RELEASE_FILENAME); - release = (await import(path)).release; - } catch { - } - const serverOptions = await resolveServerOptions(nuxt, moduleOptions, logger); - const config = defu({ release }, serverOptions.config); - process.sentry = Sentry; - if (canInitialize(moduleOptions)) { - Sentry.init(config); - nuxt.hook("render:setupMiddleware", (app) => app.use(() => Sentry.setupExpressErrorHandler(app))); - } -} -async function shutdownServerSentry() { - if (process.sentry) { - await process.sentry.close(); - process.sentry = void 0; - } -} - -const logger = useLogger("nuxt:sentry"); -const moduleDir = fileURLToPath(new URL("./", import.meta.url)); -const module = defineNuxtModule({ - meta: { - name: "@nuxtjs/sentry", - configKey: "sentry" - }, - defaults: (nuxt) => ({ - lazy: false, - dsn: process.env.SENTRY_DSN || "", - disabled: envToBool(process.env.SENTRY_DISABLED) || false, - initialize: envToBool(process.env.SENTRY_INITIALIZE) || true, - runtimeConfigKey: "sentry", - disableClientSide: envToBool(process.env.SENTRY_DISABLE_CLIENT_SIDE) || false, - disableServerSide: envToBool(process.env.SENTRY_DISABLE_SERVER_SIDE) || false, - publishRelease: envToBool(process.env.SENTRY_PUBLISH_RELEASE) || false, - disableServerRelease: envToBool(process.env.SENTRY_DISABLE_SERVER_RELEASE) || false, - disableClientRelease: envToBool(process.env.SENTRY_DISABLE_CLIENT_RELEASE) || false, - logMockCalls: true, - sourceMapStyle: "hidden-source-map", - tracing: false, - clientIntegrations: { - ExtraErrorData: {}, - ReportingObserver: { types: ["crash"] } - }, - serverIntegrations: { - Dedupe: {}, - ExtraErrorData: {}, - RewriteFrames: { root: nuxt.options.rootDir } - }, - customClientIntegrations: "", - customServerIntegrations: "", - config: { - environment: nuxt.options.dev ? "development" : "production" - }, - serverConfig: {}, - clientConfig: {} - }), - async setup(options, nuxt) { - const defaultsPublishRelease = { - sourcemaps: { - ignore: [ - "node_modules/**/*" - ] - } - }; - if (options.publishRelease) { - options.publishRelease = defu(options.publishRelease, defaultsPublishRelease); - } - if (canInitialize(options) && (clientSentryEnabled(options) || serverSentryEnabled(options))) { - const status = `(client side: ${boolToText(clientSentryEnabled(options))}, server side: ${boolToText(serverSentryEnabled(options))})`; - logger.success(`Sentry reporting is enabled ${status}`); - } else { - let why; - if (options.disabled) { - why = '"disabled" option has been set'; - } else if (!options.dsn) { - why = "no DSN has been provided"; - } else if (!options.initialize) { - why = '"initialize" option has been set to false'; - } else { - why = "both client and server side clients are disabled"; - } - logger.info(`Sentry reporting is disabled (${why})`); - } - const aliasedDependencies = [ - "lodash.mergewith", - "@sentry/browser", - "@sentry/core", - "@sentry/utils", - "@sentry/vue" - ]; - for (const dep of aliasedDependencies) { - nuxt.options.alias[`~${dep}`] = (await resolvePath(dep, { url: moduleDir })).replace(/\/cjs\//, "/esm/"); - } - if (serverSentryEnabled(options)) { - nuxt.hook("generate:routeFailed", ({ route, errors }) => { - errors.forEach(({ error }) => withScope((scope) => { - scope.setExtra("route", route); - captureException(error); - })); - }); - { - const isBuilding = nuxt.options._build && !nuxt.options.dev; - const initHook = isBuilding ? "build:compile" : "ready"; - nuxt.hook(initHook, () => initializeServerSentry(nuxt, options, logger)); - const shutdownHook = isBuilding ? "build:done" : "close"; - const shutdownServerSentryOnce = callOnce(() => shutdownServerSentry()); - nuxt.hook(shutdownHook, shutdownServerSentryOnce); - } - } - nuxt.hook("build:before", () => buildHook(nuxt, options, logger)); - if (options.publishRelease && !options.disabled && !nuxt.options.dev) { - { - nuxt.hook("webpack:config", (webpackConfigs) => webpackConfigHook(nuxt, webpackConfigs, options, logger)); - } - } - } -}); +})("/Users/jkoenig/sentry-module/src/module.ts"); -export { module as default }; +export default _module; \ No newline at end of file diff --git a/dist/runtime b/dist/runtime new file mode 120000 index 00000000..cade95b7 --- /dev/null +++ b/dist/runtime @@ -0,0 +1 @@ +/Users/jkoenig/sentry-module/src/runtime \ No newline at end of file diff --git a/dist/templates b/dist/templates new file mode 120000 index 00000000..75854910 --- /dev/null +++ b/dist/templates @@ -0,0 +1 @@ +/Users/jkoenig/sentry-module/src/templates \ No newline at end of file diff --git a/dist/templates/client.shared.js b/dist/templates/client.shared.js deleted file mode 100644 index 05759b22..00000000 --- a/dist/templates/client.shared.js +++ /dev/null @@ -1,92 +0,0 @@ -import merge from '~lodash.mergewith' -import * as CoreSdk from '~@sentry/core' -import { captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } from '~@sentry/browser' -<% -for (const [package, imports] of Object.entries(options.imports)) { - if (imports.length) { - %>import { <%= imports.join(', ') %> } from '<%= package %>' -<% - } -} -if (options.clientConfigPath) {%>import getClientConfig from '<%= options.clientConfigPath %>' -<%} -if (options.customClientIntegrations) {%>import getCustomIntegrations from '<%= options.customClientIntegrations %>' -<%}%> - -export { init } -export const SentrySdk = { ...CoreSdk, ...{ captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } } - -/** @type {string[]} */ -const DISABLED_INTEGRATION_KEYS = <%= serialize(options.DISABLED_INTEGRATION_KEYS) %> - -/** - * @typedef {Parameters[0]} InitConfig - * @param {import('@nuxt/types').Context} ctx - * @return {Promise} - */ -export<%= (options.clientConfigPath || options.customClientIntegrations) ? ' async' : '' %> function getConfig (ctx) { - /** @type {InitConfig} */ - const config = { - <%= Object - .entries(options.config) - .map(([key, option]) => { - const value = typeof option === 'function' ? serializeFunction(option) : serialize(option) - return `${key}:${value}` - }) - .join(',\n ') %>, - } - - /** @type {NonNullable['integrations']} */ - const resolvedIntegrations = [ - <%= Object - .entries(options.integrations) - .filter(([name]) => name !== 'Vue') - .map(([name, integration]) => { - const integrationOptions = Object - .entries(integration) - .map(([key, option]) => { - const value = typeof option === 'function' ? serializeFunction(option) : serialize(option) - return `${key}:${value}` - }) - - return `${name}(${integrationOptions.length ? '{ ' + integrationOptions.join(',') + ' }' : ''})` - }) - .join(',\n ') %>, - ] - <% - if (options.tracing) { - const { browserTracing, vueOptions, ...tracingOptions } = options.tracing - %> - resolvedIntegrations.push(browserTracingIntegration({ - router: ctx.app.router, - ...<%= serialize(browserTracing) %>, - })) - merge(config, <%= serialize(vueOptions) %>, <%= serialize(tracingOptions) %>) - <% } %> - - <% if (options.clientConfigPath) { %> - const clientConfig = await getClientConfig(ctx) - clientConfig ? merge(config, clientConfig) : console.error(`[@nuxtjs/sentry] Invalid value returned from the clientConfig plugin.`) - <% } %> - - <% if (options.customClientIntegrations) { %> - const customIntegrations = await getCustomIntegrations(ctx) - if (Array.isArray(customIntegrations)) { - resolvedIntegrations.push(...customIntegrations) - } else { - console.error(`[@nuxtjs/sentry] Invalid value returned from customClientIntegrations plugin. Expected an array, got "${typeof customIntegrations}".`) - } - <% } %> - config.integrations = (defaultIntegrations) => { - return [ - ...defaultIntegrations.filter(integration => !DISABLED_INTEGRATION_KEYS.includes(integration.name)), - ...resolvedIntegrations, - ] - } - const runtimeConfigKey = <%= serialize(options.runtimeConfigKey) %> - if (ctx.$config && runtimeConfigKey && ctx.$config[runtimeConfigKey]) { - merge(config, ctx.$config[runtimeConfigKey].config, ctx.$config[runtimeConfigKey].clientConfig) - } - - return config -} diff --git a/dist/templates/options.ejs b/dist/templates/options.ejs deleted file mode 100644 index eaec7491..00000000 --- a/dist/templates/options.ejs +++ /dev/null @@ -1,7 +0,0 @@ -/* eslint-disable */ -<% -for (const [key, value] of Object.entries(options)) { -%>export const <%= key %> = <%= serialize(value) %> -<% -} -%> diff --git a/dist/templates/plugin.client.js b/dist/templates/plugin.client.js deleted file mode 100644 index cd5e35ff..00000000 --- a/dist/templates/plugin.client.js +++ /dev/null @@ -1,10 +0,0 @@ -import Vue from 'vue' -import { getConfig, init, SentrySdk } from './sentry.client.shared' - -/** @type {import('@nuxt/types').Plugin} */ -export default async function (ctx, inject) { - const config = await getConfig(ctx) - init({ Vue, ...config }) - inject('sentry', SentrySdk) - ctx.$sentry = SentrySdk -} diff --git a/dist/templates/plugin.lazy.js b/dist/templates/plugin.lazy.js deleted file mode 100644 index b2ba37b2..00000000 --- a/dist/templates/plugin.lazy.js +++ /dev/null @@ -1,172 +0,0 @@ -import Vue from 'vue' - -<% if (options.lazy.injectMock) { %> -const API_METHODS = <%= JSON.stringify(options.lazy.mockApiMethods)%> -let delayedCalls = [] -let SentryMock = {} -<% } %> -let sentryReadyResolve -let loadInitiated = false -let loadCompleted = false - -<% if (options.lazy.injectMock) { %> -let delayedGlobalErrors = [] -let delayedUnhandledRejections = [] -/** @param {ErrorEvent} event */ -const delayGlobalError = function (event) { - delayedGlobalErrors.push([event.message, event.filename, event.lineno, event.colno, event.error]) -} -const delayUnhandledRejection = function (event) { - if ('reason' in event && event.reason) { - event = event.reason - } else if ('detail' in event && event.detail && 'reason' in event.detail && event.detail.reason) { - event = event.detail.reason - } - delayedUnhandledRejections.push(event) -} - -const vueErrorHandler = Vue.config.errorHandler - -Vue.config.errorHandler = (error, vm, info) => { - if (!loadCompleted) { - if (vm) { - vm.$sentry.captureException(error) - } - - if (Vue.util) { - Vue.util.warn(`Error in ${info}: "${error.toString()}"`, vm) - } - console.error(error) - } - - if (vueErrorHandler) { - return vueErrorHandler(error, vm, info) - } -} -<% } %> - -export default function SentryPlugin (ctx, inject) { - <% if (options.lazy.injectMock) { %> - API_METHODS.forEach((key) => { - SentryMock[key] = (...args) => delayedCalls.push([key, args]) - }) - - window.addEventListener('error', delayGlobalError) - window.addEventListener('unhandledrejection', delayUnhandledRejection) - - inject('sentry', SentryMock) - ctx.$sentry = SentryMock - <% } %> - - const loadSentryHook = () => attemptLoadSentry(ctx, inject) - - <% if (options.lazy.injectLoadHook) { %> - inject('sentryLoad', loadSentryHook) - ctx.$sentryLoad = loadSentryHook - <% } else { %> - window.<%= globals.readyCallback %>(loadSentryHook) - <% } %> - - const sentryReadyPromise = new Promise((resolve) => { - sentryReadyResolve = resolve - }) - - const sentryReady = () => sentryReadyPromise - - inject('sentryReady', sentryReady) - ctx.$sentryReady = sentryReady -} - -async function attemptLoadSentry (ctx, inject) { - if (loadInitiated) { - return - } - - loadInitiated = true - - if (!window.<%= globals.nuxt %>) { - <% if (options.dev) { %> - console.warn('$sentryLoad was called but window.<%= globals.nuxt %> is not available, delaying sentry loading until onNuxtReady callback. Do you really need to use lazy loading for Sentry?') - <% } - if (options.lazy.injectLoadHook) { %>window.<%= globals.readyCallback %>(() => loadSentry(ctx, inject)) - <% } else { %>// Wait for onNuxtReady hook to trigger. - <% } %>return - } - - await loadSentry(ctx, inject) -} - -async function loadSentry (ctx, inject) { - if (loadCompleted) { - return - } - - <% - const magicComments = [`webpackChunkName: '${options.lazy.chunkName}'`] - if (options.lazy.webpackPrefetch) { - magicComments.push('webpackPrefetch: true') - } - if (options.lazy.webpackPreload) { - magicComments.push('webpackPreload: true') - } - %> - const { getConfig, init, SentrySdk } = await import(/* <%= magicComments.join(', ') %> */ './sentry.client.shared') - <% if (options.initialize) {%> - const config = await getConfig(ctx) - init({ Vue, ...config }) - <% } %> - - loadCompleted = true - <% if (options.lazy.injectMock) { %> - window.removeEventListener('error', delayGlobalError) - window.removeEventListener('unhandledrejection', delayUnhandledRejection) - if (delayedGlobalErrors.length) { - if (window.onerror) { - console.info('Reposting global errors after Sentry has loaded') - for (const errorArgs of delayedGlobalErrors) { - window.onerror.apply(window, errorArgs) - } - } - delayedGlobalErrors = [] - } - if (delayedUnhandledRejections.length) { - if (window.onunhandledrejection) { - console.info('Reposting unhandled promise rejection errors after Sentry has loaded') - for (const reason of delayedUnhandledRejections) { - window.onunhandledrejection(reason) - } - } - delayedUnhandledRejections = [] - } - delayedCalls.forEach(([methodName, args]) => SentrySdk[methodName].apply(SentrySdk, args)) - <% } %> - forceInject(ctx, inject, 'sentry', SentrySdk) - sentryReadyResolve(SentrySdk) - - // help gc - <% if (options.lazy.injectMock) { %> - // Avoid crashes in case the reference to the mocked object is being used after the actual Sentry instance has loaded. - API_METHODS.forEach((key) => { - SentryMock[key] = (...args) => SentrySdk[key].apply(SentrySdk, args) - }) - - // Dont unset delayedCalls & SentryMock during development - this will cause HMR issues. - <% if (!options.dev) { %> - delayedCalls = undefined - SentryMock = undefined - <% } else { %> - delayedCalls = [] - <% } %> - <% } %> - sentryReadyResolve = undefined -} - -// Custom inject function that is able to overwrite previously injected values, -// which original inject doesn't allow to do. -// This method is adapted from the inject method in nuxt/vue-app/template/index.js -function forceInject (ctx, inject, key, value) { - inject(key, value) - const injectKey = '$' + key - ctx[injectKey] = value - window.<%= globals.nuxt %>.$options[injectKey] = value -} diff --git a/dist/templates/plugin.mocked.js b/dist/templates/plugin.mocked.js deleted file mode 100644 index af27ebe6..00000000 --- a/dist/templates/plugin.mocked.js +++ /dev/null @@ -1,15 +0,0 @@ -const apiMethods = <%= JSON.stringify(options.apiMethods)%> - -/** @type {import('@nuxt/types').Plugin} */ -export default function (ctx, inject) { - const SentryMock = {} - apiMethods.forEach(key => { - SentryMock[key] = <%= options.logMockCalls - ? '(...args) => console.warn(`$sentry.${key}() called, but Sentry plugin is disabled. Arguments:`, args)' - : '_ => _'%> - }) - - // Inject mocked sentry to the context as $sentry (this is used in case sentry is disabled) - inject('sentry', SentryMock) - ctx.$sentry = SentryMock -} diff --git a/dist/templates/plugin.server.js b/dist/templates/plugin.server.js deleted file mode 100644 index 7e68523b..00000000 --- a/dist/templates/plugin.server.js +++ /dev/null @@ -1,46 +0,0 @@ -<% if (options.tracing) { %> -import { getActiveSpan, getDynamicSamplingContextFromSpan, spanToTraceHeader } from '~@sentry/core' -import { dynamicSamplingContextToSentryBaggageHeader } from '~@sentry/utils' -<% } %> - -/** @type {import('@nuxt/types').Plugin} */ -export default function (ctx, inject) { - const sentry = process.sentry || null - if (!sentry) { - return - } - inject('sentry', sentry) - ctx.$sentry = sentry - <% if (options.tracing) { %> - connectBackendTraces(ctx) - <% } %> - <% if (options.lazy) { %> - const sentryReady = () => Promise.resolve(sentry) - inject('sentryReady', sentryReady) - ctx.$sentryReady = sentryReady - <% } %> -} - -<% if (options.tracing) { %> -/** @param {import('@nuxt/types').Context} ctx */ -function connectBackendTraces (ctx) { - const { head } = ctx.app - if (!head || head instanceof Function) { - console.warn('[@nuxtjs/sentry] can not connect backend and frontend traces because app.head is a function or missing!') - return - } - const span = getActiveSpan() - if (!span) { - return - } - head.meta = head.meta || [] - head.meta.push({ hid: 'sentry-trace', name: 'sentry-trace', content: spanToTraceHeader(span) }) - const dsc = getDynamicSamplingContextFromSpan(span) - if (dsc) { - const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc) - if (baggage) { - head.meta.push({ hid: 'sentry-baggage', name: 'baggage', content: baggage }) - } - } -} -<% } %> diff --git a/dist/types.d.mts b/dist/types.d.mts index 7dd39c96..c0a88199 100644 --- a/dist/types.d.mts +++ b/dist/types.d.mts @@ -1,18 +1,25 @@ -import type { ModuleOptions, ModulePublicRuntimeConfig } from './module.js' +import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks, ModuleRuntimeHooks, ModuleRuntimeConfig, ModulePublicRuntimeConfig } from './module.js' +declare module '#app' { + interface RuntimeNuxtHooks extends RuntimeModuleHooks, ModuleRuntimeHooks {} +} declare module '@nuxt/schema' { interface NuxtConfig { ['sentry']?: Partial } interface NuxtOptions { ['sentry']?: ModuleOptions } + interface NuxtHooks extends ModuleHooks {} + interface RuntimeConfig extends ModuleRuntimeConfig {} interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} } declare module 'nuxt/schema' { interface NuxtConfig { ['sentry']?: Partial } interface NuxtOptions { ['sentry']?: ModuleOptions } + interface NuxtHooks extends ModuleHooks {} + interface RuntimeConfig extends ModuleRuntimeConfig {} interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} } -export type { ModuleOptions, ModulePublicRuntimeConfig, default } from './module.js' +export type { default } from './module.js' diff --git a/dist/types.d.ts b/dist/types.d.ts index 9ea9c960..ae776e8a 100644 --- a/dist/types.d.ts +++ b/dist/types.d.ts @@ -1,18 +1,25 @@ -import type { ModuleOptions, ModulePublicRuntimeConfig } from './module' +import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks, ModuleRuntimeHooks, ModuleRuntimeConfig, ModulePublicRuntimeConfig } from './module' +declare module '#app' { + interface RuntimeNuxtHooks extends RuntimeModuleHooks, ModuleRuntimeHooks {} +} declare module '@nuxt/schema' { interface NuxtConfig { ['sentry']?: Partial } interface NuxtOptions { ['sentry']?: ModuleOptions } + interface NuxtHooks extends ModuleHooks {} + interface RuntimeConfig extends ModuleRuntimeConfig {} interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} } declare module 'nuxt/schema' { interface NuxtConfig { ['sentry']?: Partial } interface NuxtOptions { ['sentry']?: ModuleOptions } + interface NuxtHooks extends ModuleHooks {} + interface RuntimeConfig extends ModuleRuntimeConfig {} interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {} } -export type { ModuleOptions, ModulePublicRuntimeConfig, default } from './module' +export type { default } from './module' diff --git a/src/templates/client.shared.js b/src/templates/client.shared.js index 05759b22..25332f05 100644 --- a/src/templates/client.shared.js +++ b/src/templates/client.shared.js @@ -1,6 +1,6 @@ import merge from '~lodash.mergewith' import * as CoreSdk from '~@sentry/core' -import { captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } from '~@sentry/browser' +import { captureUserFeedback, forceLoad, onLoad, showReportDialog } from '~@sentry/browser' <% for (const [package, imports] of Object.entries(options.imports)) { if (imports.length) { @@ -14,7 +14,7 @@ if (options.customClientIntegrations) {%>import getCustomIntegrations from '<%= <%}%> export { init } -export const SentrySdk = { ...CoreSdk, ...{ captureUserFeedback, forceLoad, onLoad, showReportDialog, wrap } } +export const SentrySdk = { ...CoreSdk, ...{ captureUserFeedback, forceLoad, onLoad, showReportDialog } } /** @type {string[]} */ const DISABLED_INTEGRATION_KEYS = <%= serialize(options.DISABLED_INTEGRATION_KEYS) %>