@sentry/svelte 10.0.0-alpha.0 → 10.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -97,7 +97,7 @@ function shouldInjectFunction(
97
97
  // because the code inside is not executed when the component is instantiated but
98
98
  // when the module is first imported.
99
99
  // see: https://svelte.dev/docs#component-format-script-context-module
100
- if (attributes.context === 'module') {
100
+ if (attributes.module || attributes.context === 'module') {
101
101
  return false;
102
102
  }
103
103
 
@@ -1 +1 @@
1
- {"version":3,"file":"preprocessors.js","sources":["../../src/preprocessors.ts"],"sourcesContent":["import MagicString from 'magic-string';\nimport type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\nimport type { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types';\n\nexport const defaultComponentTrackingOptions: Required<ComponentTrackingInitOptions> = {\n trackComponents: true,\n trackInit: true,\n trackUpdates: false,\n};\n\nexport const FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID = 'FIRST_PASS_COMPONENT_TRACKING_PREPROCESSOR';\n\n/**\n * Svelte Preprocessor to inject Sentry performance monitoring related code\n * into Svelte components.\n */\nexport function componentTrackingPreprocessor(options?: ComponentTrackingInitOptions): PreprocessorGroup {\n const mergedOptions = { ...defaultComponentTrackingOptions, ...options };\n\n const visitedFiles = new Set<string>();\n const visitedFilesMarkup = new Set<string>();\n\n const preprocessor: PreprocessorGroup = {\n // This markup hook is called once per .svelte component file, before the `script` hook is called\n // We use it to check if the passed component has a <script> tag. If it doesn't, we add one to inject our\n // code later on, when the `script` hook is executed.\n markup: ({ content, filename }) => {\n const finalFilename = filename || 'unknown';\n const shouldInject = shouldInjectFunction(mergedOptions.trackComponents, finalFilename, {}, visitedFilesMarkup);\n\n if (shouldInject && !hasScriptTag(content)) {\n // Insert a <script> tag into the component file where we can later on inject our code.\n // We have to add a placeholder to the script tag because for empty script tags,\n // the `script` preprocessor hook won't be called\n // Note: The space between <script> and </script> is important! Without any content,\n // the `script` hook wouldn't be executed for the added script tag.\n const s = new MagicString(content);\n s.prepend('<script>\\n</script>\\n');\n return { code: s.toString(), map: s.generateMap().toString() };\n }\n\n return { code: content };\n },\n\n // This script hook is called whenever a Svelte component's <script> content is preprocessed.\n // `content` contains the script code as a string\n script: ({ content, filename, attributes }) => {\n // TODO: Not sure when a filename could be undefined. Using this 'unknown' fallback for the time being\n const finalFilename = filename || 'unknown';\n\n if (!shouldInjectFunction(mergedOptions.trackComponents, finalFilename, attributes, visitedFiles)) {\n return { code: content };\n }\n\n const { trackInit, trackUpdates } = mergedOptions;\n const trackComponentOptions: TrackComponentOptions = {\n trackInit,\n trackUpdates,\n componentName: getBaseName(finalFilename),\n };\n\n const importStmt = 'import { trackComponent } from \"@sentry/svelte\";\\n';\n const functionCall = `trackComponent(${JSON.stringify(trackComponentOptions)});\\n`;\n\n const s = new MagicString(content);\n s.prepend(functionCall).prepend(importStmt);\n\n const updatedCode = s.toString();\n const updatedSourceMap = s.generateMap().toString();\n\n return { code: updatedCode, map: updatedSourceMap };\n },\n };\n\n const sentryPreprocessor: SentryPreprocessorGroup = {\n ...preprocessor,\n sentryId: FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID,\n };\n\n return sentryPreprocessor;\n}\n\nfunction shouldInjectFunction(\n trackComponents: Required<ComponentTrackingInitOptions['trackComponents']>,\n filename: string,\n attributes: Record<string, string | boolean>,\n visitedFiles: Set<string>,\n): boolean {\n // We do cannot inject our function multiple times into the same component\n // This can happen when a component has multiple <script> blocks\n if (visitedFiles.has(filename)) {\n return false;\n }\n visitedFiles.add(filename);\n\n // We can't inject our function call into <script context=\"module\"> blocks\n // because the code inside is not executed when the component is instantiated but\n // when the module is first imported.\n // see: https://svelte.dev/docs#component-format-script-context-module\n if (attributes.context === 'module') {\n return false;\n }\n\n if (!trackComponents) {\n return false;\n }\n\n if (Array.isArray(trackComponents)) {\n const componentName = getBaseName(filename);\n return trackComponents.some(allowed => allowed === componentName);\n }\n\n return true;\n}\n\nfunction getBaseName(filename: string): string {\n const segments = filename.split('/');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return segments[segments.length - 1]!.replace('.svelte', '');\n}\n\nfunction hasScriptTag(content: string): boolean {\n // This regex is taken from the Svelte compiler code.\n // They use this regex to find matching script tags that are passed to the `script` preprocessor hook:\n // https://github.com/sveltejs/svelte/blob/bb83eddfc623437528f24e9fe210885b446e72fa/src/compiler/preprocess/index.ts#L144\n // However, we remove the first part of the regex to not match HTML comments\n const scriptTagRegex = /<script(\\s[^]*?)?(?:>([^]*?)<\\/script\\s*>|\\/>)/gi;\n\n // Regex testing is not a super safe way of checking for the presence of a <script> tag in the Svelte\n // component file but I think we can use it as a start.\n // A case that is not covered by regex-testing HTML is e.g. nested <script> tags but I cannot\n // think of why one would do this in Svelte components. For instance, the Svelte compiler errors\n // when there's more than one top-level script tag.\n return scriptTagRegex.test(content);\n}\n"],"names":["MagicString"],"mappings":";;;;AAIO,MAAM,+BAA+B,GAA2C;AACvF,EAAE,eAAe,EAAE,IAAI;AACvB,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB;;AAEO,MAAM,wCAAA,GAA2C;;AAExD;AACA;AACA;AACA;AACO,SAAS,6BAA6B,CAAC,OAAO,EAAoD;AACzG,EAAE,MAAM,gBAAgB,EAAE,GAAG,+BAA+B,EAAE,GAAG,OAAA,EAAS;;AAE1E,EAAE,MAAM,YAAA,GAAe,IAAI,GAAG,EAAU;AACxC,EAAE,MAAM,kBAAA,GAAqB,IAAI,GAAG,EAAU;;AAE9C,EAAE,MAAM,YAAY,GAAsB;AAC1C;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAA,EAAU,KAAK;AACvC,MAAM,MAAM,aAAA,GAAgB,QAAA,IAAY,SAAS;AACjD,MAAM,MAAM,YAAA,GAAe,oBAAoB,CAAC,aAAa,CAAC,eAAe,EAAE,aAAa,EAAE,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9D;;AAEA,SAAS,YAAY,CAAC,OAAO,EAAmB;AAChD;AACA;AACA;AACA;AACA,EAAE,MAAM,cAAA,GAAiB,kDAAkD;;AAE3E;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;AACrC;;;;;;"}
1
+ {"version":3,"file":"preprocessors.js","sources":["../../src/preprocessors.ts"],"sourcesContent":["import MagicString from 'magic-string';\nimport type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\nimport type { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types';\n\nexport const defaultComponentTrackingOptions: Required<ComponentTrackingInitOptions> = {\n trackComponents: true,\n trackInit: true,\n trackUpdates: false,\n};\n\nexport const FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID = 'FIRST_PASS_COMPONENT_TRACKING_PREPROCESSOR';\n\n/**\n * Svelte Preprocessor to inject Sentry performance monitoring related code\n * into Svelte components.\n */\nexport function componentTrackingPreprocessor(options?: ComponentTrackingInitOptions): PreprocessorGroup {\n const mergedOptions = { ...defaultComponentTrackingOptions, ...options };\n\n const visitedFiles = new Set<string>();\n const visitedFilesMarkup = new Set<string>();\n\n const preprocessor: PreprocessorGroup = {\n // This markup hook is called once per .svelte component file, before the `script` hook is called\n // We use it to check if the passed component has a <script> tag. If it doesn't, we add one to inject our\n // code later on, when the `script` hook is executed.\n markup: ({ content, filename }) => {\n const finalFilename = filename || 'unknown';\n const shouldInject = shouldInjectFunction(mergedOptions.trackComponents, finalFilename, {}, visitedFilesMarkup);\n\n if (shouldInject && !hasScriptTag(content)) {\n // Insert a <script> tag into the component file where we can later on inject our code.\n // We have to add a placeholder to the script tag because for empty script tags,\n // the `script` preprocessor hook won't be called\n // Note: The space between <script> and </script> is important! Without any content,\n // the `script` hook wouldn't be executed for the added script tag.\n const s = new MagicString(content);\n s.prepend('<script>\\n</script>\\n');\n return { code: s.toString(), map: s.generateMap().toString() };\n }\n\n return { code: content };\n },\n\n // This script hook is called whenever a Svelte component's <script> content is preprocessed.\n // `content` contains the script code as a string\n script: ({ content, filename, attributes }) => {\n // TODO: Not sure when a filename could be undefined. Using this 'unknown' fallback for the time being\n const finalFilename = filename || 'unknown';\n\n if (!shouldInjectFunction(mergedOptions.trackComponents, finalFilename, attributes, visitedFiles)) {\n return { code: content };\n }\n\n const { trackInit, trackUpdates } = mergedOptions;\n const trackComponentOptions: TrackComponentOptions = {\n trackInit,\n trackUpdates,\n componentName: getBaseName(finalFilename),\n };\n\n const importStmt = 'import { trackComponent } from \"@sentry/svelte\";\\n';\n const functionCall = `trackComponent(${JSON.stringify(trackComponentOptions)});\\n`;\n\n const s = new MagicString(content);\n s.prepend(functionCall).prepend(importStmt);\n\n const updatedCode = s.toString();\n const updatedSourceMap = s.generateMap().toString();\n\n return { code: updatedCode, map: updatedSourceMap };\n },\n };\n\n const sentryPreprocessor: SentryPreprocessorGroup = {\n ...preprocessor,\n sentryId: FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID,\n };\n\n return sentryPreprocessor;\n}\n\nfunction shouldInjectFunction(\n trackComponents: Required<ComponentTrackingInitOptions['trackComponents']>,\n filename: string,\n attributes: Record<string, string | boolean>,\n visitedFiles: Set<string>,\n): boolean {\n // We do cannot inject our function multiple times into the same component\n // This can happen when a component has multiple <script> blocks\n if (visitedFiles.has(filename)) {\n return false;\n }\n visitedFiles.add(filename);\n\n // We can't inject our function call into <script context=\"module\"> blocks\n // because the code inside is not executed when the component is instantiated but\n // when the module is first imported.\n // see: https://svelte.dev/docs#component-format-script-context-module\n if (attributes.module || attributes.context === 'module') {\n return false;\n }\n\n if (!trackComponents) {\n return false;\n }\n\n if (Array.isArray(trackComponents)) {\n const componentName = getBaseName(filename);\n return trackComponents.some(allowed => allowed === componentName);\n }\n\n return true;\n}\n\nfunction getBaseName(filename: string): string {\n const segments = filename.split('/');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return segments[segments.length - 1]!.replace('.svelte', '');\n}\n\nfunction hasScriptTag(content: string): boolean {\n // This regex is taken from the Svelte compiler code.\n // They use this regex to find matching script tags that are passed to the `script` preprocessor hook:\n // https://github.com/sveltejs/svelte/blob/bb83eddfc623437528f24e9fe210885b446e72fa/src/compiler/preprocess/index.ts#L144\n // However, we remove the first part of the regex to not match HTML comments\n const scriptTagRegex = /<script(\\s[^]*?)?(?:>([^]*?)<\\/script\\s*>|\\/>)/gi;\n\n // Regex testing is not a super safe way of checking for the presence of a <script> tag in the Svelte\n // component file but I think we can use it as a start.\n // A case that is not covered by regex-testing HTML is e.g. nested <script> tags but I cannot\n // think of why one would do this in Svelte components. For instance, the Svelte compiler errors\n // when there's more than one top-level script tag.\n return scriptTagRegex.test(content);\n}\n"],"names":["MagicString"],"mappings":";;;;AAIO,MAAM,+BAA+B,GAA2C;AACvF,EAAE,eAAe,EAAE,IAAI;AACvB,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB;;AAEO,MAAM,wCAAA,GAA2C;;AAExD;AACA;AACA;AACA;AACO,SAAS,6BAA6B,CAAC,OAAO,EAAoD;AACzG,EAAE,MAAM,gBAAgB,EAAE,GAAG,+BAA+B,EAAE,GAAG,OAAA,EAAS;;AAE1E,EAAE,MAAM,YAAA,GAAe,IAAI,GAAG,EAAU;AACxC,EAAE,MAAM,kBAAA,GAAqB,IAAI,GAAG,EAAU;;AAE9C,EAAE,MAAM,YAAY,GAAsB;AAC1C;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAA,EAAU,KAAK;AACvC,MAAM,MAAM,aAAA,GAAgB,QAAA,IAAY,SAAS;AACjD,MAAM,MAAM,YAAA,GAAe,oBAAoB,CAAC,aAAa,CAAC,eAAe,EAAE,aAAa,EAAE,EAAE,EAAE,kBAAkB,CAAC;;AAErH,MAAM,IAAI,YAAA,IAAgB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE;AAClD;AACA;AACA;AACA;AACA;AACA,QA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AAE3E;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;AACrC;;;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.0.0-alpha.0","sideEffects":false}
1
+ {"type":"module","version":"10.0.0-alpha.2","sideEffects":false}
@@ -95,7 +95,7 @@ function shouldInjectFunction(
95
95
  // because the code inside is not executed when the component is instantiated but
96
96
  // when the module is first imported.
97
97
  // see: https://svelte.dev/docs#component-format-script-context-module
98
- if (attributes.context === 'module') {
98
+ if (attributes.module || attributes.context === 'module') {
99
99
  return false;
100
100
  }
101
101
 
@@ -1 +1 @@
1
- {"version":3,"file":"preprocessors.js","sources":["../../src/preprocessors.ts"],"sourcesContent":["import MagicString from 'magic-string';\nimport type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\nimport type { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types';\n\nexport const defaultComponentTrackingOptions: Required<ComponentTrackingInitOptions> = {\n trackComponents: true,\n trackInit: true,\n trackUpdates: false,\n};\n\nexport const FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID = 'FIRST_PASS_COMPONENT_TRACKING_PREPROCESSOR';\n\n/**\n * Svelte Preprocessor to inject Sentry performance monitoring related code\n * into Svelte components.\n */\nexport function componentTrackingPreprocessor(options?: ComponentTrackingInitOptions): PreprocessorGroup {\n const mergedOptions = { ...defaultComponentTrackingOptions, ...options };\n\n const visitedFiles = new Set<string>();\n const visitedFilesMarkup = new Set<string>();\n\n const preprocessor: PreprocessorGroup = {\n // This markup hook is called once per .svelte component file, before the `script` hook is called\n // We use it to check if the passed component has a <script> tag. If it doesn't, we add one to inject our\n // code later on, when the `script` hook is executed.\n markup: ({ content, filename }) => {\n const finalFilename = filename || 'unknown';\n const shouldInject = shouldInjectFunction(mergedOptions.trackComponents, finalFilename, {}, visitedFilesMarkup);\n\n if (shouldInject && !hasScriptTag(content)) {\n // Insert a <script> tag into the component file where we can later on inject our code.\n // We have to add a placeholder to the script tag because for empty script tags,\n // the `script` preprocessor hook won't be called\n // Note: The space between <script> and </script> is important! Without any content,\n // the `script` hook wouldn't be executed for the added script tag.\n const s = new MagicString(content);\n s.prepend('<script>\\n</script>\\n');\n return { code: s.toString(), map: s.generateMap().toString() };\n }\n\n return { code: content };\n },\n\n // This script hook is called whenever a Svelte component's <script> content is preprocessed.\n // `content` contains the script code as a string\n script: ({ content, filename, attributes }) => {\n // TODO: Not sure when a filename could be undefined. Using this 'unknown' fallback for the time being\n const finalFilename = filename || 'unknown';\n\n if (!shouldInjectFunction(mergedOptions.trackComponents, finalFilename, attributes, visitedFiles)) {\n return { code: content };\n }\n\n const { trackInit, trackUpdates } = mergedOptions;\n const trackComponentOptions: TrackComponentOptions = {\n trackInit,\n trackUpdates,\n componentName: getBaseName(finalFilename),\n };\n\n const importStmt = 'import { trackComponent } from \"@sentry/svelte\";\\n';\n const functionCall = `trackComponent(${JSON.stringify(trackComponentOptions)});\\n`;\n\n const s = new MagicString(content);\n s.prepend(functionCall).prepend(importStmt);\n\n const updatedCode = s.toString();\n const updatedSourceMap = s.generateMap().toString();\n\n return { code: updatedCode, map: updatedSourceMap };\n },\n };\n\n const sentryPreprocessor: SentryPreprocessorGroup = {\n ...preprocessor,\n sentryId: FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID,\n };\n\n return sentryPreprocessor;\n}\n\nfunction shouldInjectFunction(\n trackComponents: Required<ComponentTrackingInitOptions['trackComponents']>,\n filename: string,\n attributes: Record<string, string | boolean>,\n visitedFiles: Set<string>,\n): boolean {\n // We do cannot inject our function multiple times into the same component\n // This can happen when a component has multiple <script> blocks\n if (visitedFiles.has(filename)) {\n return false;\n }\n visitedFiles.add(filename);\n\n // We can't inject our function call into <script context=\"module\"> blocks\n // because the code inside is not executed when the component is instantiated but\n // when the module is first imported.\n // see: https://svelte.dev/docs#component-format-script-context-module\n if (attributes.context === 'module') {\n return false;\n }\n\n if (!trackComponents) {\n return false;\n }\n\n if (Array.isArray(trackComponents)) {\n const componentName = getBaseName(filename);\n return trackComponents.some(allowed => allowed === componentName);\n }\n\n return true;\n}\n\nfunction getBaseName(filename: string): string {\n const segments = filename.split('/');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return segments[segments.length - 1]!.replace('.svelte', '');\n}\n\nfunction hasScriptTag(content: string): boolean {\n // This regex is taken from the Svelte compiler code.\n // They use this regex to find matching script tags that are passed to the `script` preprocessor hook:\n // https://github.com/sveltejs/svelte/blob/bb83eddfc623437528f24e9fe210885b446e72fa/src/compiler/preprocess/index.ts#L144\n // However, we remove the first part of the regex to not match HTML comments\n const scriptTagRegex = /<script(\\s[^]*?)?(?:>([^]*?)<\\/script\\s*>|\\/>)/gi;\n\n // Regex testing is not a super safe way of checking for the presence of a <script> tag in the Svelte\n // component file but I think we can use it as a start.\n // A case that is not covered by regex-testing HTML is e.g. nested <script> tags but I cannot\n // think of why one would do this in Svelte components. For instance, the Svelte compiler errors\n // when there's more than one top-level script tag.\n return scriptTagRegex.test(content);\n}\n"],"names":[],"mappings":";;AAIO,MAAM,+BAA+B,GAA2C;AACvF,EAAE,eAAe,EAAE,IAAI;AACvB,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB;;AAEO,MAAM,wCAAA,GAA2C;;AAExD;AACA;AACA;AACA;AACO,SAAS,6BAA6B,CAAC,OAAO,EAAoD;AACzG,EAAE,MAAM,gBAAgB,EAAE,GAAG,+BAA+B,EAAE,GAAG,OAAA,EAAS;;AAE1E,EAAE,MAAM,YAAA,GAAe,IAAI,GAAG,EAAU;AACxC,EAAE,MAAM,kBAAA,GAAqB,IAAI,GAAG,EAAU;;AAE9C,EAAE,MAAM,YAAY,GAAsB;AAC1C;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAA,EAAU,KAAK;AACvC,MAAM,MAAM,aAAA,GAAgB,QAAA,IAAY,SAAS;AACjD,MAAM,MAAM,YAA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C,CAAC,CAAE,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;AAC9D;;AAEA,SAAS,YAAY,CAAC,OAAO,EAAmB;AAChD;AACA;AACA;AACA;AACA,EAAE,MAAM,cAAA,GAAiB,kDAAkD;;AAE3E;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;AACrC;;;;"}
1
+ {"version":3,"file":"preprocessors.js","sources":["../../src/preprocessors.ts"],"sourcesContent":["import MagicString from 'magic-string';\nimport type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\nimport type { ComponentTrackingInitOptions, SentryPreprocessorGroup, TrackComponentOptions } from './types';\n\nexport const defaultComponentTrackingOptions: Required<ComponentTrackingInitOptions> = {\n trackComponents: true,\n trackInit: true,\n trackUpdates: false,\n};\n\nexport const FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID = 'FIRST_PASS_COMPONENT_TRACKING_PREPROCESSOR';\n\n/**\n * Svelte Preprocessor to inject Sentry performance monitoring related code\n * into Svelte components.\n */\nexport function componentTrackingPreprocessor(options?: ComponentTrackingInitOptions): PreprocessorGroup {\n const mergedOptions = { ...defaultComponentTrackingOptions, ...options };\n\n const visitedFiles = new Set<string>();\n const visitedFilesMarkup = new Set<string>();\n\n const preprocessor: PreprocessorGroup = {\n // This markup hook is called once per .svelte component file, before the `script` hook is called\n // We use it to check if the passed component has a <script> tag. If it doesn't, we add one to inject our\n // code later on, when the `script` hook is executed.\n markup: ({ content, filename }) => {\n const finalFilename = filename || 'unknown';\n const shouldInject = shouldInjectFunction(mergedOptions.trackComponents, finalFilename, {}, visitedFilesMarkup);\n\n if (shouldInject && !hasScriptTag(content)) {\n // Insert a <script> tag into the component file where we can later on inject our code.\n // We have to add a placeholder to the script tag because for empty script tags,\n // the `script` preprocessor hook won't be called\n // Note: The space between <script> and </script> is important! Without any content,\n // the `script` hook wouldn't be executed for the added script tag.\n const s = new MagicString(content);\n s.prepend('<script>\\n</script>\\n');\n return { code: s.toString(), map: s.generateMap().toString() };\n }\n\n return { code: content };\n },\n\n // This script hook is called whenever a Svelte component's <script> content is preprocessed.\n // `content` contains the script code as a string\n script: ({ content, filename, attributes }) => {\n // TODO: Not sure when a filename could be undefined. Using this 'unknown' fallback for the time being\n const finalFilename = filename || 'unknown';\n\n if (!shouldInjectFunction(mergedOptions.trackComponents, finalFilename, attributes, visitedFiles)) {\n return { code: content };\n }\n\n const { trackInit, trackUpdates } = mergedOptions;\n const trackComponentOptions: TrackComponentOptions = {\n trackInit,\n trackUpdates,\n componentName: getBaseName(finalFilename),\n };\n\n const importStmt = 'import { trackComponent } from \"@sentry/svelte\";\\n';\n const functionCall = `trackComponent(${JSON.stringify(trackComponentOptions)});\\n`;\n\n const s = new MagicString(content);\n s.prepend(functionCall).prepend(importStmt);\n\n const updatedCode = s.toString();\n const updatedSourceMap = s.generateMap().toString();\n\n return { code: updatedCode, map: updatedSourceMap };\n },\n };\n\n const sentryPreprocessor: SentryPreprocessorGroup = {\n ...preprocessor,\n sentryId: FIRST_PASS_COMPONENT_TRACKING_PREPROC_ID,\n };\n\n return sentryPreprocessor;\n}\n\nfunction shouldInjectFunction(\n trackComponents: Required<ComponentTrackingInitOptions['trackComponents']>,\n filename: string,\n attributes: Record<string, string | boolean>,\n visitedFiles: Set<string>,\n): boolean {\n // We do cannot inject our function multiple times into the same component\n // This can happen when a component has multiple <script> blocks\n if (visitedFiles.has(filename)) {\n return false;\n }\n visitedFiles.add(filename);\n\n // We can't inject our function call into <script context=\"module\"> blocks\n // because the code inside is not executed when the component is instantiated but\n // when the module is first imported.\n // see: https://svelte.dev/docs#component-format-script-context-module\n if (attributes.module || attributes.context === 'module') {\n return false;\n }\n\n if (!trackComponents) {\n return false;\n }\n\n if (Array.isArray(trackComponents)) {\n const componentName = getBaseName(filename);\n return trackComponents.some(allowed => allowed === componentName);\n }\n\n return true;\n}\n\nfunction getBaseName(filename: string): string {\n const segments = filename.split('/');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return segments[segments.length - 1]!.replace('.svelte', '');\n}\n\nfunction hasScriptTag(content: string): boolean {\n // This regex is taken from the Svelte compiler code.\n // They use this regex to find matching script tags that are passed to the `script` preprocessor hook:\n // https://github.com/sveltejs/svelte/blob/bb83eddfc623437528f24e9fe210885b446e72fa/src/compiler/preprocess/index.ts#L144\n // However, we remove the first part of the regex to not match HTML comments\n const scriptTagRegex = /<script(\\s[^]*?)?(?:>([^]*?)<\\/script\\s*>|\\/>)/gi;\n\n // Regex testing is not a super safe way of checking for the presence of a <script> tag in the Svelte\n // component file but I think we can use it as a start.\n // A case that is not covered by regex-testing HTML is e.g. nested <script> tags but I cannot\n // think of why one would do this in Svelte components. For instance, the Svelte compiler errors\n // when there's more than one top-level script tag.\n return scriptTagRegex.test(content);\n}\n"],"names":[],"mappings":";;AAIO,MAAM,+BAA+B,GAA2C;AACvF,EAAE,eAAe,EAAE,IAAI;AACvB,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB;;AAEO,MAAM,wCAAA,GAA2C;;AAExD;AACA;AACA;AACA;AACO,SAAS,6BAA6B,CAAC,OAAO,EAAoD;AACzG,EAAE,MAAM,gBAAgB,EAAE,GAAG,+BAA+B,EAAE,GAAG,OAAA,EAAS;;AAE1E,EAAE,MAAM,YAAA,GAAe,IAAI,GAAG,EAAU;AACxC,EAAE,MAAM,kBAAA,GAAqB,IAAI,GAAG,EAAU;;AAE9C,EAAE,MAAM,YAAY,GAAsB;AAC1C;AACA;AACA;AACA,IAAI,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,QAAA,EAAU,KAAK;AACvC,MAAM,MAAM,aAAA,GAAgB,QAAA,IAAY,SAAS;AACjD,MAAM,MAAM,YAAA,GAAe,oBAAoB,CAAC,aAAa,CAAC,eAAe,EAAE,aAAa,EAAE,EAAE,EAAE,kBAAkB,CAAC;;AAErH,MAAM,IAAI,YAAA,IAAgB,CAAC,YAAY,CAAC,OAAO,C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ACA,EAAE,MAAM,cAAA,GAAiB,kDAAkD;;AAE3E;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;AACrC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/svelte",
3
- "version": "10.0.0-alpha.0",
3
+ "version": "10.0.0-alpha.2",
4
4
  "description": "Official Sentry SDK for Svelte",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte",
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@sentry/browser": "10.0.0-alpha.0",
43
- "@sentry/core": "10.0.0-alpha.0",
42
+ "@sentry/browser": "10.0.0-alpha.2",
43
+ "@sentry/core": "10.0.0-alpha.2",
44
44
  "magic-string": "^0.30.0"
45
45
  },
46
46
  "peerDependencies": {