@sentry/bundler-plugins 11.18.0 → 11.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/core/index.js +1 -2
- package/build/cjs/core/index.js.map +1 -1
- package/build/cjs/core/options-mapping.js.map +1 -1
- package/build/cjs/core/sentry/telemetry.js +1 -1
- package/build/cjs/core/sentry/telemetry.js.map +1 -1
- package/build/cjs/core/sourcemap-settings.js +26 -22
- package/build/cjs/core/sourcemap-settings.js.map +1 -1
- package/build/cjs/core/version.js +1 -1
- package/build/cjs/core/version.js.map +1 -1
- package/build/cjs/rewriter/arrays.js +25 -0
- package/build/cjs/rewriter/arrays.js.map +1 -0
- package/build/cjs/rewriter/ast.js +102 -0
- package/build/cjs/rewriter/ast.js.map +1 -0
- package/build/cjs/rewriter/class-extends.js +67 -0
- package/build/cjs/rewriter/class-extends.js.map +1 -0
- package/build/cjs/rewriter/exports.js +241 -0
- package/build/cjs/rewriter/exports.js.map +1 -0
- package/build/cjs/rewriter/imports.js +22 -0
- package/build/cjs/rewriter/imports.js.map +1 -0
- package/build/cjs/rewriter/index.js +45 -0
- package/build/cjs/rewriter/module-shape.js +120 -0
- package/build/cjs/rewriter/module-shape.js.map +1 -0
- package/build/cjs/rewriter/parse.js +64 -0
- package/build/cjs/rewriter/parse.js.map +1 -0
- package/build/cjs/rewriter/report.js +17 -0
- package/build/cjs/rewriter/report.js.map +1 -0
- package/build/cjs/rewriter/rewriter.js +68 -0
- package/build/cjs/rewriter/rewriter.js.map +1 -0
- package/build/cjs/vite/source-map-hooks.js +1 -1
- package/build/cjs/vite/source-map-hooks.js.map +1 -1
- package/build/esm/core/index.js +2 -2
- package/build/esm/core/index.js.map +1 -1
- package/build/esm/core/options-mapping.js.map +1 -1
- package/build/esm/core/sentry/telemetry.js +1 -1
- package/build/esm/core/sentry/telemetry.js.map +1 -1
- package/build/esm/core/sourcemap-settings.js +26 -21
- package/build/esm/core/sourcemap-settings.js.map +1 -1
- package/build/esm/core/version.js +1 -1
- package/build/esm/core/version.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/rewriter/arrays.js +25 -0
- package/build/esm/rewriter/arrays.js.map +1 -0
- package/build/esm/rewriter/ast.js +95 -0
- package/build/esm/rewriter/ast.js.map +1 -0
- package/build/esm/rewriter/class-extends.js +67 -0
- package/build/esm/rewriter/class-extends.js.map +1 -0
- package/build/esm/rewriter/exports.js +231 -0
- package/build/esm/rewriter/exports.js.map +1 -0
- package/build/esm/rewriter/imports.js +21 -0
- package/build/esm/rewriter/imports.js.map +1 -0
- package/build/esm/rewriter/index.js +11 -0
- package/build/esm/rewriter/module-shape.js +118 -0
- package/build/esm/rewriter/module-shape.js.map +1 -0
- package/build/esm/rewriter/parse.js +60 -0
- package/build/esm/rewriter/parse.js.map +1 -0
- package/build/esm/rewriter/report.js +16 -0
- package/build/esm/rewriter/report.js.map +1 -0
- package/build/esm/rewriter/rewriter.js +65 -0
- package/build/esm/rewriter/rewriter.js.map +1 -0
- package/build/esm/vite/source-map-hooks.js +2 -2
- package/build/esm/vite/source-map-hooks.js.map +1 -1
- package/build/types/core/index.d.ts +1 -1
- package/build/types/core/index.d.ts.map +1 -1
- package/build/types/core/options-mapping.d.ts +2 -2
- package/build/types/core/options-mapping.d.ts.map +1 -1
- package/build/types/core/sentry/telemetry.d.ts.map +1 -1
- package/build/types/core/sourcemap-settings.d.ts +8 -6
- package/build/types/core/sourcemap-settings.d.ts.map +1 -1
- package/build/types/core/types.d.ts +14 -11
- package/build/types/core/types.d.ts.map +1 -1
- package/build/types/core/version.d.ts +1 -1
- package/build/types/rewriter/arrays.d.ts +12 -0
- package/build/types/rewriter/arrays.d.ts.map +1 -0
- package/build/types/rewriter/ast.d.ts +120 -0
- package/build/types/rewriter/ast.d.ts.map +1 -0
- package/build/types/rewriter/class-extends.d.ts +16 -0
- package/build/types/rewriter/class-extends.d.ts.map +1 -0
- package/build/types/rewriter/exports.d.ts +88 -0
- package/build/types/rewriter/exports.d.ts.map +1 -0
- package/build/types/rewriter/imports.d.ts +7 -0
- package/build/types/rewriter/imports.d.ts.map +1 -0
- package/build/types/rewriter/index.d.ts +10 -0
- package/build/types/rewriter/index.d.ts.map +1 -0
- package/build/types/rewriter/module-shape.d.ts +47 -0
- package/build/types/rewriter/module-shape.d.ts.map +1 -0
- package/build/types/rewriter/parse.d.ts +27 -0
- package/build/types/rewriter/parse.d.ts.map +1 -0
- package/build/types/rewriter/report.d.ts +12 -0
- package/build/types/rewriter/report.d.ts.map +1 -0
- package/build/types/rewriter/rewriter.d.ts +64 -0
- package/build/types/rewriter/rewriter.d.ts.map +1 -0
- package/build/types/vite/source-map-hooks.d.ts.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-shape.js","names":[],"sources":["../../../src/rewriter/module-shape.ts"],"sourcesContent":["import type {\n BaseNode,\n ClassDeclarationNode,\n ExportAllNode,\n ExportDefaultNode,\n ExportNamedNode,\n IdentifierNode,\n ImportDeclarationNode,\n MemberExpressionNode,\n ProgramBody,\n} from './ast';\nimport { exportedName, isTypeOnlyExport } from './ast';\nimport { langFromId, parseModule } from './parse';\n\n/** Binding name used for a module's default export. */\nexport const DEFAULT_EXPORT = 'default';\n\n/** A resolved superclass reference: a bare identifier or a `ns.Member` expression. */\nexport type SuperRef = { kind: 'identifier'; name: string } | { kind: 'member'; object: string; property: string };\n\n/** The declarations of a single module that binding resolution needs. */\nexport interface ModuleShape {\n /** Top-level class names → their superclass reference (absent when the class has no `extends`). */\n classes: Map<string, SuperRef | undefined>;\n /** Local binding name → the import it came from (`imported` is `default` for a default import). */\n imports: Map<string, { source: string; imported: string }>;\n /** Local binding name → module specifier, for `import * as ns from '...'`. */\n namespaces: Map<string, string>;\n /** Exported name → the re-export it came from, for `export { x as y } from '...'`. */\n reexports: Map<string, { source: string; imported: string }>;\n /** Exported name → local binding name, for `export { x as y }` without a source. */\n localExports: Map<string, string>;\n /** Module specifiers of bare `export * from '...'` declarations. */\n starExports: string[];\n /** `export default <Identifier>` — the local name it refers to. */\n defaultExportName?: string;\n /** True when the module's default export is a class declaration/expression. */\n defaultExportIsClass?: boolean;\n /** Superclass of an anonymous `export default class extends X`. */\n defaultExportSuper?: SuperRef;\n}\n\nfunction emptyShape(): ModuleShape {\n return {\n classes: new Map(),\n imports: new Map(),\n namespaces: new Map(),\n reexports: new Map(),\n localExports: new Map(),\n starExports: [],\n };\n}\n\n/** Collect the shape of a module from its parsed AST. */\nexport function shapeFromAst(ast: ProgramBody): ModuleShape {\n const shape = emptyShape();\n\n for (const node of ast.body) {\n switch (node.type) {\n case 'ClassDeclaration':\n addAstClass(shape, node);\n break;\n case 'ImportDeclaration':\n addAstImports(shape, node);\n break;\n case 'ExportNamedDeclaration':\n addAstNamedExport(shape, node);\n break;\n case 'ExportDefaultDeclaration': {\n const decl = (node as ExportDefaultNode).declaration;\n if (decl.type === 'ClassDeclaration' || decl.type === 'ClassExpression') {\n shape.defaultExportIsClass = true;\n shape.defaultExportSuper = superRefFromNode((decl as ClassDeclarationNode).superClass);\n // `export default class Foo {}` also binds `Foo` locally.\n addAstClass(shape, decl);\n } else if (decl.type === 'Identifier') {\n shape.defaultExportName = (decl as IdentifierNode).name;\n }\n break;\n }\n case 'ExportAllDeclaration': {\n const starNode = node as ExportAllNode;\n // `export * as ns from '...'` binds a namespace object, not the individual exports.\n const source = starNode.exported || isTypeOnlyExport(starNode) ? undefined : asString(starNode.source?.value);\n if (source) shape.starExports.push(source);\n break;\n }\n }\n }\n\n return shape;\n}\n\n/**\n * Extract the module shape from unprocessed source, such as a sibling module\n * read off disk. Returns `undefined` when the source does not parse.\n */\nexport function shapeFromSource(code: string, id: string): ModuleShape | undefined {\n const lang = langFromId(id);\n // A module read off disk may hold TypeScript or JSX whatever its id says,\n // and `tsx` reads everything the other dialects do.\n for (const candidate of lang === 'tsx' ? [lang] : [lang, 'tsx' as const]) {\n try {\n return shapeFromAst(parseModule(code, id, candidate));\n } catch {\n // Try the next dialect.\n }\n }\n return undefined;\n}\n\nfunction superRefFromNode(superClass: BaseNode | null | undefined): SuperRef | undefined {\n if (!superClass) return undefined;\n\n if (superClass.type === 'Identifier') {\n return { kind: 'identifier', name: (superClass as IdentifierNode).name };\n }\n\n if (superClass.type === 'MemberExpression') {\n const member = superClass as MemberExpressionNode;\n const object = member.object?.type === 'Identifier' ? member.object.name : undefined;\n const property = member.property?.name;\n if (object && property) return { kind: 'member', object, property };\n }\n\n return undefined;\n}\n\nfunction addAstClass(shape: ModuleShape, classNode: ClassDeclarationNode): void {\n if (classNode.id?.name) shape.classes.set(classNode.id.name, superRefFromNode(classNode.superClass));\n}\n\nfunction addAstImports(shape: ModuleShape, node: ImportDeclarationNode): void {\n const source = asString(node.source?.value);\n // Type-only imports never contribute a runtime base class.\n if (!source || node.importKind === 'type') return;\n\n for (const specifier of node.specifiers ?? []) {\n const local = specifier.local?.name;\n if (!local || specifier.importKind === 'type') continue;\n\n const imported = exportedName(specifier.imported);\n if (specifier.type === 'ImportSpecifier' && imported) {\n shape.imports.set(local, { source, imported });\n } else if (specifier.type === 'ImportDefaultSpecifier') {\n shape.imports.set(local, { source, imported: DEFAULT_EXPORT });\n } else if (specifier.type === 'ImportNamespaceSpecifier') {\n shape.namespaces.set(local, source);\n }\n }\n}\n\nfunction addAstNamedExport(shape: ModuleShape, node: ExportNamedNode): void {\n if (node.declaration?.type === 'ClassDeclaration') {\n addAstClass(shape, node.declaration);\n return;\n }\n if (isTypeOnlyExport(node)) return;\n\n const source = asString(node.source?.value);\n for (const specifier of node.specifiers ?? []) {\n const exported = exportedName(specifier.exported);\n const local = exportedName(specifier.local);\n if (!exported || !local || isTypeOnlyExport(specifier)) continue;\n\n if (source) {\n shape.reexports.set(exported, { source, imported: local });\n } else {\n shape.localExports.set(exported, local);\n }\n }\n}\n\nfunction asString(value: unknown): string | undefined {\n return typeof value === 'string' && value ? value : undefined;\n}\n"],"mappings":";;;;AAeA,MAAa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AU,KAAK;EAC1C,IAAI,CAAC,YAAY,CAAC,SAAS,iBAAiB,SAAS,GAAG;EAExD,IAAI,QACF,MAAM,UAAU,IAAI,UAAU;GAAE;GAAQ,UAAU;EAAM,CAAC;OAEzD,MAAM,aAAa,IAAI,UAAU,KAAK;CAE1C;AACF;AAEA,SAAS,SAAS,OAAoC;CACpD,OAAO,OAAO,UAAU,YAAY,QAAQ,QAAQ,KAAA;AACtD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { stripUrlQueryAndFragment } from "@sentry/core";
|
|
2
|
+
// src/rewriter/parse.ts
|
|
3
|
+
const PARSER_UNAVAILABLE_MESSAGE = "[@sentry/bundler-plugins] Could not load `oxc-parser` for this platform. Modules that need it will not be auto-instrumented.";
|
|
4
|
+
let oxc;
|
|
5
|
+
let warnedParserUnavailable = false;
|
|
6
|
+
const oxcLoaded = import("oxc-parser").then((module) => {
|
|
7
|
+
oxc = module;
|
|
8
|
+
return true;
|
|
9
|
+
}, () => {
|
|
10
|
+
oxc = null;
|
|
11
|
+
return false;
|
|
12
|
+
});
|
|
13
|
+
/** Resolves once `oxc-parser` has loaded or failed to load, with whether it is available. */
|
|
14
|
+
function loadParser() {
|
|
15
|
+
return oxcLoaded;
|
|
16
|
+
}
|
|
17
|
+
function isParserLoading() {
|
|
18
|
+
return oxc === void 0;
|
|
19
|
+
}
|
|
20
|
+
/** The source dialect a module id names by its extension. */
|
|
21
|
+
function langFromId(id) {
|
|
22
|
+
const extension = /\.([cm]?[jt]sx?)$/.exec(stripUrlQueryAndFragment(id))?.[1] ?? "js";
|
|
23
|
+
if (extension === "tsx") return "tsx";
|
|
24
|
+
if (extension === "jsx") return "jsx";
|
|
25
|
+
return extension.endsWith("ts") ? "ts" : "js";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The default {@link ModuleParser}, over `oxc-parser`. Throws when `oxc-parser`
|
|
29
|
+
* has not loaded; see {@link loadParser}.
|
|
30
|
+
*/
|
|
31
|
+
function parseModule(code, id, lang = langFromId(id)) {
|
|
32
|
+
if (!oxc) {
|
|
33
|
+
if (oxc === null && !warnedParserUnavailable) {
|
|
34
|
+
warnedParserUnavailable = true;
|
|
35
|
+
console.warn(PARSER_UNAVAILABLE_MESSAGE);
|
|
36
|
+
}
|
|
37
|
+
throw new Error(oxc === null ? PARSER_UNAVAILABLE_MESSAGE : "`oxc-parser` has not loaded yet");
|
|
38
|
+
}
|
|
39
|
+
const { program, errors } = oxc.parseSync(id, code, {
|
|
40
|
+
lang,
|
|
41
|
+
sourceType: "module",
|
|
42
|
+
preserveParens: false
|
|
43
|
+
});
|
|
44
|
+
if (errors.length > 0) throw new Error(errors[0]?.message);
|
|
45
|
+
return program;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A parser over Rolldown's own `this.parse`, which reads TypeScript when told
|
|
49
|
+
* the dialect. Rollup's `this.parse` cannot, so it is not used.
|
|
50
|
+
*/
|
|
51
|
+
function bundlerParser(context) {
|
|
52
|
+
if (!context?.meta?.rolldownVersion || typeof context.parse !== "function") return void 0;
|
|
53
|
+
return (code, id) => context.parse?.(code, {
|
|
54
|
+
lang: langFromId(id),
|
|
55
|
+
preserveParens: false
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
export { bundlerParser, isParserLoading, langFromId, loadParser, parseModule };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=parse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.js","names":[],"sources":["../../../src/rewriter/parse.ts"],"sourcesContent":["import { stripUrlQueryAndFragment } from '@sentry/core';\nimport type * as OxcParser from 'oxc-parser';\nimport type { ProgramBody } from './ast';\n\nexport type ModuleLang = 'js' | 'jsx' | 'ts' | 'tsx';\n\n/** Parses a module into an ESTree program. Throws when the code does not parse. */\nexport type ModuleParser = (code: string, id: string) => ProgramBody;\n\n/** The part of a bundler's plugin context that can parse code. */\nexport interface ParserContext {\n meta?: { rolldownVersion?: string };\n parse?(input: string, options?: object | null): unknown;\n}\n\nconst PARSER_UNAVAILABLE_MESSAGE =\n '[@sentry/bundler-plugins] Could not load `oxc-parser` for this platform. ' +\n 'Modules that need it will not be auto-instrumented.';\n\n// `undefined` while loading, `null` when it failed to load.\nlet oxc: typeof OxcParser | null | undefined;\nlet warnedParserUnavailable = false;\n\n// The import is dynamic so that a platform without an `oxc-parser` native\n// binary gets a warning instead of a failed build.\nconst oxcLoaded: Promise<boolean> = import('oxc-parser').then(\n module => {\n oxc = module;\n return true;\n },\n () => {\n oxc = null;\n return false;\n },\n);\n\n/** Resolves once `oxc-parser` has loaded or failed to load, with whether it is available. */\nexport function loadParser(): Promise<boolean> {\n return oxcLoaded;\n}\n\nexport function isParserLoading(): boolean {\n return oxc === undefined;\n}\n\n/** The source dialect a module id names by its extension. */\nexport function langFromId(id: string): ModuleLang {\n const extension = /\\.([cm]?[jt]sx?)$/.exec(stripUrlQueryAndFragment(id))?.[1] ?? 'js';\n if (extension === 'tsx') return 'tsx';\n if (extension === 'jsx') return 'jsx';\n return extension.endsWith('ts') ? 'ts' : 'js';\n}\n\n/**\n * The default {@link ModuleParser}, over `oxc-parser`. Throws when `oxc-parser`\n * has not loaded; see {@link loadParser}.\n */\nexport function parseModule(code: string, id: string, lang: ModuleLang = langFromId(id)): ProgramBody {\n if (!oxc) {\n if (oxc === null && !warnedParserUnavailable) {\n warnedParserUnavailable = true;\n // eslint-disable-next-line no-console\n console.warn(PARSER_UNAVAILABLE_MESSAGE);\n }\n throw new Error(oxc === null ? PARSER_UNAVAILABLE_MESSAGE : '`oxc-parser` has not loaded yet');\n }\n\n // `preserveParens: false` matches the AST Vite produces.\n const { program, errors } = oxc.parseSync(id, code, { lang, sourceType: 'module', preserveParens: false });\n if (errors.length > 0) {\n throw new Error(errors[0]?.message);\n }\n return program;\n}\n\n/**\n * A parser over Rolldown's own `this.parse`, which reads TypeScript when told\n * the dialect. Rollup's `this.parse` cannot, so it is not used.\n */\nexport function bundlerParser(context: ParserContext | undefined): ModuleParser | undefined {\n if (!context?.meta?.rolldownVersion || typeof context.parse !== 'function') return undefined;\n return (code, id) => context.parse?.(code, { lang: langFromId(id), preserveParens: false }) as ProgramBody;\n}\n"],"mappings":";;AAeA,MAAM,6BACJ;AAIF,IAAI;AACJ,IAAI,0BAA0B;AAI9B,MAAM,YAA8B,OAAO,aAAa,CAAC,MACvD,WAAU;CACR,MAAM;CACN,OAAO;AACT,SACM;CACJ,MAAM;CACN,OAAO;AACT,CACF;;AAGA,SAAgB,aAA+B;CAC7C,OAAO;AACT;AAEA,SAAgB,kBAA2B;CACzC,OAAO,QAAQ,KAAA;AACjB;;AAGA,SAAgB,WAAW,IAAwB;CACjD,MAAM,YAAY,oBAAoB,KAAK,yBAAyB,EAAE,CAAC,CAAC,GAAG,MAAM;CACjF,IAAI,cAAc,OAAO,OAAO;CAChC,IAAI,cAAc,OAAO,OAAO;CAChC,OAAO,UAAU,SAAS,IAAI,IAAI,OAAO;AAC3C;;;;;AAMA,SAAgB,YAAY,MAAc,IAAY,OAAmB,WAAW,EAAE,GAAgB;CACpG,IAAI,CAAC,KAAK;EACR,IAAI,QAAQ,QAAQ,CAAC,yBAAyB;GAC5C,0BAA0B;GAE1B,QAAQ,KAAK,0BAA0B;EACzC;EACA,MAAM,IAAI,MAAM,QAAQ,OAAO,6BAA6B,iCAAiC;CAC/F;CAGA,MAAM,EAAE,SAAS,WAAW,IAAI,UAAU,IAAI,MAAM;EAAE;EAAM,YAAY;EAAU,gBAAgB;CAAM,CAAC;CACzG,IAAI,OAAO,SAAS,GAClB,MAAM,IAAI,MAAM,OAAO,EAAE,EAAE,OAAO;CAEpC,OAAO;AACT;;;;;AAMA,SAAgB,cAAc,SAA8D;CAC1F,IAAI,CAAC,SAAS,MAAM,mBAAmB,OAAO,QAAQ,UAAU,YAAY,OAAO,KAAA;CACnF,QAAQ,MAAM,OAAO,QAAQ,QAAQ,MAAM;EAAE,MAAM,WAAW,EAAE;EAAG,gBAAgB;CAAM,CAAC;AAC5F"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/rewriter/report.ts
|
|
2
|
+
function createReport() {
|
|
3
|
+
return {
|
|
4
|
+
wrapped: [],
|
|
5
|
+
skipped: [],
|
|
6
|
+
alreadyWrapped: []
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** The warning for the skipped sites of a module, or `undefined` when none were skipped. */
|
|
10
|
+
function formatReport(report, id) {
|
|
11
|
+
if (report.skipped.length === 0) return void 0;
|
|
12
|
+
return `[Sentry] Could not auto-instrument ${report.skipped.join(" and ")} in ${id}.`;
|
|
13
|
+
}
|
|
14
|
+
export { createReport, formatReport };
|
|
15
|
+
|
|
16
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","names":[],"sources":["../../../src/rewriter/report.ts"],"sourcesContent":["/** What a rewrite did with the sites it found, by site label. */\nexport interface RewriteReport {\n wrapped: string[];\n /** Sites the rewrite could not wrap, for the user to wrap by hand. */\n skipped: string[];\n /** Sites the user already wrapped. */\n alreadyWrapped: string[];\n}\n\nexport function createReport(): RewriteReport {\n return { wrapped: [], skipped: [], alreadyWrapped: [] };\n}\n\n/** The warning for the skipped sites of a module, or `undefined` when none were skipped. */\nexport function formatReport(report: RewriteReport, id: string): string | undefined {\n if (report.skipped.length === 0) return undefined;\n return `[Sentry] Could not auto-instrument ${report.skipped.join(' and ')} in ${id}.`;\n}\n"],"mappings":";AASA,SAAgB,eAA8B;CAC5C,OAAO;EAAE,SAAS,CAAC;EAAG,SAAS,CAAC;EAAG,gBAAgB,CAAC;CAAE;AACxD;;AAGA,SAAgB,aAAa,QAAuB,IAAgC;CAClF,IAAI,OAAO,QAAQ,WAAW,GAAG,OAAO,KAAA;CACxC,OAAO,sCAAsC,OAAO,QAAQ,KAAK,OAAO,EAAE,MAAM,GAAG;AACrF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { bundlerParser, isParserLoading, loadParser, parseModule } from "./parse.js";
|
|
2
|
+
import { createReport, formatReport } from "./report.js";
|
|
3
|
+
import MagicString from "magic-string";
|
|
4
|
+
import { basename } from "node:path";
|
|
5
|
+
// src/rewriter/rewriter.ts
|
|
6
|
+
function createRewriteState(code) {
|
|
7
|
+
return {
|
|
8
|
+
ms: new MagicString(code),
|
|
9
|
+
needsImport: false,
|
|
10
|
+
wrappedLocals: /* @__PURE__ */ new Map(),
|
|
11
|
+
imports: /* @__PURE__ */ new Set(),
|
|
12
|
+
report: createReport()
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function createCallSiteRewriter(rules, options = {}) {
|
|
16
|
+
const rewrite = (matching, code, id, parse) => {
|
|
17
|
+
let ast;
|
|
18
|
+
try {
|
|
19
|
+
ast = parse(code, id);
|
|
20
|
+
} catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const state = createRewriteState(code);
|
|
24
|
+
const ctx = {
|
|
25
|
+
ast,
|
|
26
|
+
code,
|
|
27
|
+
id,
|
|
28
|
+
state
|
|
29
|
+
};
|
|
30
|
+
const finish = () => {
|
|
31
|
+
const warning = formatReport(state.report, id);
|
|
32
|
+
if (warning) options.logger?.warn(warning);
|
|
33
|
+
if (!state.ms.hasChanged()) return null;
|
|
34
|
+
return {
|
|
35
|
+
code: state.ms.toString(),
|
|
36
|
+
map: state.ms.generateMap({ hires: true })
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
const pending = applyRules(matching, ctx, 0);
|
|
40
|
+
return pending ? pending.then(finish) : finish();
|
|
41
|
+
};
|
|
42
|
+
return { transform(code, id, context) {
|
|
43
|
+
const matching = rules.filter((rule) => matches(rule.include, code, id));
|
|
44
|
+
if (matching.length === 0) return null;
|
|
45
|
+
const parse = options.parse ?? bundlerParser(context) ?? parseModule;
|
|
46
|
+
if (isParserLoading()) return loadParser().then(() => rewrite(matching, code, id, parse));
|
|
47
|
+
return rewrite(matching, code, id, parse);
|
|
48
|
+
} };
|
|
49
|
+
}
|
|
50
|
+
function matches(include, code, id) {
|
|
51
|
+
if (include.id && !include.id.test(id)) return false;
|
|
52
|
+
if (include.basename && !include.basename.test(basename(id))) return false;
|
|
53
|
+
if (include.contains && !include.contains.every((substring) => code.includes(substring))) return false;
|
|
54
|
+
return true;
|
|
55
|
+
}
|
|
56
|
+
/** Applies the rules in order, staying synchronous until a rule returns a promise. */
|
|
57
|
+
function applyRules(rules, ctx, from) {
|
|
58
|
+
for (let index = from; index < rules.length; index++) {
|
|
59
|
+
const pending = rules[index]?.apply(ctx);
|
|
60
|
+
if (pending instanceof Promise) return pending.then(() => applyRules(rules, ctx, index + 1));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export { createCallSiteRewriter, createRewriteState };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=rewriter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewriter.js","names":[],"sources":["../../../src/rewriter/rewriter.ts"],"sourcesContent":["import { basename } from 'node:path';\nimport MagicString, { type SourceMap } from 'magic-string';\nimport type { ProgramBody } from './ast';\nimport {\n bundlerParser,\n isParserLoading,\n loadParser,\n type ModuleParser,\n parseModule,\n type ParserContext,\n} from './parse';\nimport { createReport, formatReport, type RewriteReport } from './report';\n\n/** The edits a rewrite makes to one module, shared by every rule that runs on it. */\nexport interface RewriteState {\n /** Positions are always relative to the original source. */\n ms: MagicString;\n /** Set once the rewritten code references a binding the caller must import. */\n needsImport: boolean;\n /** Local binding name → the binding that holds its wrapper. */\n wrappedLocals: Map<string, string>;\n /** Import statements already added to this module. */\n imports: Set<string>;\n report: RewriteReport;\n}\n\nexport function createRewriteState(code: string): RewriteState {\n return {\n ms: new MagicString(code),\n needsImport: false,\n wrappedLocals: new Map(),\n imports: new Set(),\n report: createReport(),\n };\n}\n\n/** Which modules a rule runs on. Every given condition must hold. */\nexport interface RuleInclude {\n /** Tested against the full module id. */\n id?: RegExp;\n /** Tested against the last path segment of the module id. */\n basename?: RegExp;\n /** Substrings the source must contain, checked before parsing. */\n contains?: string[];\n}\n\nexport interface RuleContext {\n ast: ProgramBody;\n code: string;\n id: string;\n state: RewriteState;\n}\n\nexport interface RewriteRule {\n name: string;\n include: RuleInclude;\n apply(ctx: RuleContext): void | Promise<void>;\n}\n\nexport interface RewriterOptions {\n /**\n * Defaults to Rolldown's `this.parse` when the transform gets a Rolldown\n * plugin context, and to {@link parseModule} otherwise.\n */\n parse?: ModuleParser;\n /** Receives the warning for sites a rule could not wrap. */\n logger?: { warn(message: string): void };\n}\n\nexport interface RewriteOutput {\n code: string;\n map: SourceMap;\n}\n\nexport interface CallSiteRewriter {\n /**\n * Runs every matching rule on one module. Returns `null` when nothing\n * changed. The result is a promise only while `oxc-parser` is still\n * loading, or when a rule's `apply` returns one.\n *\n * @param context the bundler's plugin context, for its parser\n */\n transform(code: string, id: string, context?: ParserContext): RewriteOutput | null | Promise<RewriteOutput | null>;\n}\n\nexport function createCallSiteRewriter(rules: RewriteRule[], options: RewriterOptions = {}): CallSiteRewriter {\n const rewrite = (\n matching: RewriteRule[],\n code: string,\n id: string,\n parse: ModuleParser,\n ): RewriteOutput | null | Promise<RewriteOutput | null> => {\n let ast: ProgramBody;\n try {\n ast = parse(code, id);\n } catch {\n return null;\n }\n\n const state = createRewriteState(code);\n const ctx: RuleContext = { ast, code, id, state };\n const finish = (): RewriteOutput | null => {\n const warning = formatReport(state.report, id);\n if (warning) options.logger?.warn(warning);\n if (!state.ms.hasChanged()) return null;\n return { code: state.ms.toString(), map: state.ms.generateMap({ hires: true }) };\n };\n\n const pending = applyRules(matching, ctx, 0);\n return pending ? pending.then(finish) : finish();\n };\n\n return {\n transform(code, id, context) {\n const matching = rules.filter(rule => matches(rule.include, code, id));\n if (matching.length === 0) return null;\n\n const parse = options.parse ?? bundlerParser(context) ?? parseModule;\n // Rules may parse other modules with `parseModule`, so it has to be ready\n // whichever parser reads this one.\n if (isParserLoading()) {\n return loadParser().then(() => rewrite(matching, code, id, parse));\n }\n return rewrite(matching, code, id, parse);\n },\n };\n}\n\nfunction matches(include: RuleInclude, code: string, id: string): boolean {\n if (include.id && !include.id.test(id)) return false;\n if (include.basename && !include.basename.test(basename(id))) return false;\n if (include.contains && !include.contains.every(substring => code.includes(substring))) return false;\n return true;\n}\n\n/** Applies the rules in order, staying synchronous until a rule returns a promise. */\nfunction applyRules(rules: RewriteRule[], ctx: RuleContext, from: number): Promise<void> | undefined {\n for (let index = from; index < rules.length; index++) {\n const pending = rules[index]?.apply(ctx);\n if (pending instanceof Promise) {\n return pending.then(() => applyRules(rules, ctx, index + 1));\n }\n }\n return undefined;\n}\n"],"mappings":";;;;;AA0BA,SAAgB,mBAAmB,MAA4B;CAC7D,OAAO;EACL,IAAI,IAAI,YAAY,IAAI;EACxB,aAAa;EACb,+BAAe,IAAI,IAAI;EACvB,yBAAS,IAAI,IAAI;EACjB,QAAQ,aAAa;CACvB;AACF;AAmDA,SAAgB,uBAAuB,OAAsB,UAA2B,CAAC,GAAqB;CAC5G,MAAM,WACJ,UACA,MACA,IACA,UACyD;EACzD,IAAI;EACJ,IAAI;GACF,MAAM,MAAM,MAAM,EAAE;EACtB,QAAQ;GACN,OAAO;EACT;EAEA,MAAM,QAAQ,mBAAmB,IAAI;EACrC,MAAM,MAAmB;GAAE;GAAK;GAAM;GAAI;EAAM;EAChD,MAAM,eAAqC;GACzC,MAAM,UAAU,aAAa,MAAM,QAAQ,EAAE;GAC7C,IAAI,SAAS,QAAQ,QAAQ,KAAK,OAAO;GACzC,IAAI,CAAC,MAAM,GAAG,WAAW,GAAG,OAAO;GACnC,OAAO;IAAE,MAAM,MAAM,GAAG,SAAS;IAAG,KAAK,MAAM,GAAG,YAAY,EAAE,OAAO,KAAK,CAAC;GAAE;EACjF;EAEA,MAAM,UAAU,WAAW,UAAU,KAAK,CAAC;EAC3C,OAAO,UAAU,QAAQ,KAAK,MAAM,IAAI,OAAO;CACjD;CAEA,OAAO,EACL,UAAU,MAAM,IAAI,SAAS;EAC3B,MAAM,WAAW,MAAM,QAAO,SAAQ,QAAQ,KAAK,SAAS,MAAM,EAAE,CAAC;EACrE,IAAI,SAAS,WAAW,GAAG,OAAO;EAElC,MAAM,QAAQ,QAAQ,SAAS,cAAc,OAAO,KAAK;EAGzD,IAAI,gBAAgB,GAClB,OAAO,WAAW,CAAC,CAAC,WAAW,QAAQ,UAAU,MAAM,IAAI,KAAK,CAAC;EAEnE,OAAO,QAAQ,UAAU,MAAM,IAAI,KAAK;CAC1C,EACF;AACF;AAEA,SAAS,QAAQ,SAAsB,MAAc,IAAqB;CACxE,IAAI,QAAQ,MAAM,CAAC,QAAQ,GAAG,KAAK,EAAE,GAAG,OAAO;CAC/C,IAAI,QAAQ,YAAY,CAAC,QAAQ,SAAS,KAAK,SAAS,EAAE,CAAC,GAAG,OAAO;CACrE,IAAI,QAAQ,YAAY,CAAC,QAAQ,SAAS,OAAM,cAAa,KAAK,SAAS,SAAS,CAAC,GAAG,OAAO;CAC/F,OAAO;AACT;;AAGA,SAAS,WAAW,OAAsB,KAAkB,MAAyC;CACnG,KAAK,IAAI,QAAQ,MAAM,QAAQ,MAAM,QAAQ,SAAS;EACpD,MAAM,UAAU,MAAM,MAAM,EAAE,MAAM,GAAG;EACvC,IAAI,mBAAmB,SACrB,OAAO,QAAQ,WAAW,WAAW,OAAO,KAAK,QAAQ,CAAC,CAAC;CAE/D;AAEF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getDeleteOption,
|
|
1
|
+
import { getDeleteOption, getSdkDeleteSourceMaps } from "../core/sourcemap-settings.js";
|
|
2
2
|
import "../core/index.js";
|
|
3
3
|
import { getOutputMatch, sourceMapKindFromRollupSetting } from "../rollup/source-map-handling.js";
|
|
4
4
|
import * as path from "node:path";
|
|
@@ -76,7 +76,7 @@ function createViteSourceMapHooks(sentryBuildPluginManager, sourceMapHandling) {
|
|
|
76
76
|
const environmentName = decisions.has(name) ? name : void 0;
|
|
77
77
|
const { normalizedOptions } = sentryBuildPluginManager;
|
|
78
78
|
const deleteOption = getDeleteOption(normalizedOptions, environmentName);
|
|
79
|
-
const removeAll = normalizedOptions.sourcemaps?.delete === true ||
|
|
79
|
+
const removeAll = normalizedOptions.sourcemaps?.delete === true || getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;
|
|
80
80
|
for (const output of getOutputs(config.root, environment.build)) {
|
|
81
81
|
if (output.ownSetting) {
|
|
82
82
|
const outputKind = sourceMapKindFromRollupSetting(output.sourcemap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source-map-hooks.js","names":[],"sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } from '../core';\nimport { getDeleteOption,
|
|
1
|
+
{"version":3,"file":"source-map-hooks.js","names":[],"sources":["../../../src/vite/source-map-hooks.ts"],"sourcesContent":["import * as path from 'node:path';\nimport type { SentryBuildPluginManager, SourceMapDecision, SourceMapKind } from '../core';\nimport { getDeleteOption, getSdkDeleteSourceMaps } from '../core';\nimport type { OutputMatch, RollupSourceMapSetting, SourceMapHandling } from '../rollup/source-map-handling';\nimport { getOutputMatch, sourceMapKindFromRollupSetting } from '../rollup/source-map-handling';\n\ntype BundlerOutput = OutputMatch & { dir?: string; sourcemap?: RollupSourceMapSetting };\ntype BundlerOutputOptions = BundlerOutput | BundlerOutput[] | undefined;\n\ntype ViteBuildOptions = {\n sourcemap?: RollupSourceMapSetting;\n outDir?: string;\n rollupOptions?: { output?: BundlerOutputOptions };\n rolldownOptions?: { output?: BundlerOutputOptions };\n};\n\nexport type ViteUserConfig = {\n build?: ViteBuildOptions;\n environments?: Record<string, { build?: ViteBuildOptions } | undefined>;\n};\n\nexport type ViteResolvedConfig = {\n root: string;\n build: ViteBuildOptions;\n environments?: Record<string, { build: ViteBuildOptions }>;\n};\n\nexport type ViteSourceMapHooks = {\n config: (userConfig: ViteUserConfig, env: { command: string }) => ViteUserConfig | null;\n configResolved: (config: ViteResolvedConfig) => void;\n outputOptions: SourceMapHandling['applyHiddenDecision'];\n};\n\nconst NO_CHANGE: SourceMapDecision = { enableHidden: false, deleteAfterUpload: false };\n\ntype EnvironmentOutput = {\n destination: string;\n match: OutputMatch;\n sourcemap: RollupSourceMapSetting;\n /** The output sets `sourcemap` itself, which overrides `build.sourcemap`. */\n ownSetting: boolean;\n};\n\n/**\n * The outputs an environment writes: one per entry of `rollupOptions.output` or\n * `rolldownOptions.output`. An output writes to `build.outDir` (relative to the root) unless it\n * sets its own `dir`, which the bundler resolves from the working directory. An output's own\n * `sourcemap` overrides `build.sourcemap`.\n */\nfunction getOutputs(root: string, build: ViteBuildOptions): EnvironmentOutput[] {\n const configured = build.rolldownOptions?.output ?? build.rollupOptions?.output;\n const outputs = Array.isArray(configured) ? configured : [configured ?? {}];\n\n return outputs.map(output => {\n const sourcemap = output.sourcemap ?? build.sourcemap;\n return {\n destination: output.dir === undefined ? path.resolve(root, build.outDir ?? 'dist') : path.resolve(output.dir),\n match: getOutputMatch({ ...output, sourcemap }),\n sourcemap,\n ownSetting: output.sourcemap !== undefined,\n };\n });\n}\n\n/**\n * Vite warns about `rollupOptions.output.sourcemap`, so the Vite plugin decides on `build.sourcemap`\n * in a `config` hook. The hook belongs on the post plugin: framework plugins that set\n * `build.sourcemap` themselves run first, and the decision sees the merged setting. The output\n * directories are only known in `configResolved`, which then records the decision for each of them.\n */\nexport function createViteSourceMapHooks(\n sentryBuildPluginManager: SentryBuildPluginManager,\n sourceMapHandling: SourceMapHandling,\n): ViteSourceMapHooks {\n // `'*'` for the top-level setting, otherwise the name of an environment with its own.\n const decisions = new Map<string, { kind: SourceMapKind; decision: SourceMapDecision }>();\n\n return {\n config: (userConfig, env) => {\n if (env.command !== 'build') {\n return null;\n }\n\n // The same plugin instances can serve several builds in a row.\n decisions.clear();\n\n const kind = sourceMapKindFromRollupSetting(userConfig.build?.sourcemap);\n // Logged in `generateBundle`, which knows whether the output is written.\n const decision = sentryBuildPluginManager.sourceMaps.decide(kind, { log: false });\n decisions.set('*', { kind, decision });\n\n const result: ViteUserConfig = decision.enableHidden ? { build: { sourcemap: 'hidden' } } : {};\n\n for (const [name, environment] of Object.entries(userConfig.environments ?? {})) {\n const setting = environment?.build?.sourcemap;\n if (setting === undefined) {\n continue;\n }\n\n const environmentKind = sourceMapKindFromRollupSetting(setting);\n const environmentDecision = sentryBuildPluginManager.sourceMaps.decide(environmentKind, {\n log: false,\n environment: name,\n });\n decisions.set(name, { kind: environmentKind, decision: environmentDecision });\n\n if (environmentDecision.enableHidden) {\n result.environments = { ...result.environments, [name]: { build: { sourcemap: 'hidden' } } };\n }\n }\n\n return result;\n },\n\n configResolved: config => {\n const environments = config.environments ?? { client: { build: config.build } };\n\n for (const [name, environment] of Object.entries(environments)) {\n const { kind, decision } = decisions.get(name) ?? decisions.get('*') ?? { kind: 'unset', decision: NO_CHANGE };\n const environmentName = decisions.has(name) ? name : undefined;\n const { normalizedOptions } = sentryBuildPluginManager;\n const deleteOption = getDeleteOption(normalizedOptions, environmentName);\n // `sourcemaps.delete: true` removes every source map, like for maps the SDK turned on.\n const removeAll =\n normalizedOptions.sourcemaps?.delete === true ||\n getSdkDeleteSourceMaps(normalizedOptions, environmentName) === true;\n\n for (const output of getOutputs(config.root, environment.build)) {\n // Hidden maps of an output's own setting are removed when the user\n // asks for it, visible ones only when every source map is removed.\n // Removed visible maps switch to hidden in `outputOptions`, so no\n // `sourceMappingURL` comment points at a removed file.\n if (output.ownSetting) {\n const outputKind = sourceMapKindFromRollupSetting(output.sourcemap);\n const removeAllSourceMaps = removeAll && (outputKind === 'hidden' || outputKind === 'visible');\n const deleteAfterUpload = deleteOption === true && (outputKind === 'hidden' || removeAllSourceMaps);\n sourceMapHandling.setDecision(output.destination, {\n match: output.match,\n kind: outputKind,\n decision: {\n enableHidden: outputKind === 'visible' && deleteAfterUpload,\n deleteAfterUpload,\n removeAllSourceMaps,\n },\n });\n continue;\n }\n\n // A plugin that ran after ours may have changed the setting again.\n if (decision.deleteAfterUpload && output.sourcemap !== 'hidden') {\n sentryBuildPluginManager.logger.debug(\n `Source maps of the \"${name}\" environment are set to ${JSON.stringify(output.sourcemap)}. Not removing them after upload.`,\n );\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision: NO_CHANGE });\n } else {\n sourceMapHandling.setDecision(output.destination, { match: output.match, kind, decision });\n }\n }\n }\n },\n\n outputOptions: sourceMapHandling.applyHiddenDecision,\n };\n}\n"],"mappings":";;;;;AAiCA,MAAM,YAA+B;CAAE,cAAc;CAAO,mBAAmB;AAAM;;;;;;;AAgBrF,SAAS,WAAW,MAAc,OAA8C;CAC9E,MAAM,aAAa,MAAM,iBAAiB,UAAU,MAAM,eAAe;CAGzE,QAFgB,MAAM,QAAQ,UAAU,IAAI,aAAa,CAAC,cAAc,CAAC,CAAC,EAAA,CAE3D,KAAI,WAAU;EAC3B,MAAM,YAAY,OAAO,aAAa,MAAM;EAC5C,OAAO;GACL,aAAa,OAAO,QAAQ,KAAA,IAAY,KAAK,QAAQ,MAAM,MAAM,UAAU,MAAM,IAAI,KAAK,QAAQ,OAAO,GAAG;GAC5G,OAAO,eAAe;IAAE,GAAG;IAAQ;GAAU,CAAC;GAC9C;GACA,YAAY,OAAO,cAAc,KAAA;EACnC;CACF,CAAC;AACH;;;;;;;AAQA,SAAgB,yBACd,0BACA,mBACoB;CAEpB,MAAM,4BAAY,IAAI,IAAkE;CAExF,OAAO;EACL,SAAS,YAAY,QAAQ;GAC3B,IAAI,IAAI,YAAY,SAClB,OAAO;GAIT,UAAU,MAAM;GAEhB,MAAM,OAAO,+BAA+B,WAAW,OAAO,SAAS;GAEvE,MAAM,WAAW,yBAAyB,WAAW,OAAO,MAAM,EAAE,KAAK,MAAM,CAAC;GAChF,UAAU,IAAI,KAAK;IAAE;IAAM;GAAS,CAAC;GAErC,MAAM,SAAyB,SAAS,eAAe,EAAE,OAAO,EAAE,WAAW,SAAS,EAAE,IA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;QACR,cAAc,eAAe,aAAa;QAC1C;QACA;OACF;MACF,CAAC;MACD;KACF;KAGA,IAAI,SAAS,qBAAqB,OAAO,cAAc,UAAU;MAC/D,yBAAyB,OAAO,MAC9B,uBAAuB,KAAK,2BAA2B,KAAK,UAAU,OAAO,SAAS,EAAE,kCAC1F;MACA,kBAAkB,YAAY,OAAO,aAAa;OAAE,OAAO,OAAO;OAAO;OAAM,UAAU;MAAU,CAAC;KACtG,OACE,kBAAkB,YAAY,OAAO,aAAa;MAAE,OAAO,OAAO;MAAO;MAAM;KAAS,CAAC;IAE7F;GACF;EACF;EAEA,eAAe,kBAAkB;CACnC;AACF"}
|
|
@@ -42,7 +42,7 @@ export { CodeInjection, replaceBooleanFlagsInCode, stringToUUID, generateRelease
|
|
|
42
42
|
export { createSentryBuildPluginManager } from './build-plugin-manager';
|
|
43
43
|
export type { SentryBuildPluginManager, UploadResult, UploadStaging } from './build-plugin-manager';
|
|
44
44
|
export { createDebugIdUploadFunction, addDebugIdToEmittedArtifacts, stampDebugId } from './debug-id-upload';
|
|
45
|
-
export { decideSourceMapHandling, getDeleteOption,
|
|
45
|
+
export { decideSourceMapHandling, getDeleteOption, getSdkDeleteSourceMaps, getSourceMapFeatures, } from './sourcemap-settings';
|
|
46
46
|
export type { SourceMapDecision, SourceMapKind } from './sourcemap-settings';
|
|
47
47
|
export { hasSourceMapUploadCredentials } from './upload-credentials';
|
|
48
48
|
export type { UploadFilter } from './upload-filter';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkD,MAAM,SAAS,CAAC;AAExF;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAGlD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAA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AAe,EACf,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -21,8 +21,8 @@ export type NormalizedOptions = {
|
|
|
21
21
|
rewriteSources?: RewriteSourcesHook;
|
|
22
22
|
resolveSourceMap?: ResolveSourceMapHook;
|
|
23
23
|
filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
|
|
24
|
-
deleteSourcemapsAfterUpload?: boolean
|
|
25
|
-
|
|
24
|
+
deleteSourcemapsAfterUpload?: boolean;
|
|
25
|
+
sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);
|
|
26
26
|
} | undefined;
|
|
27
27
|
release: {
|
|
28
28
|
name: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options-mapping.d.ts","sourceRoot":"","sources":["../../../src/core/options-mapping.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,IAAI,WAAW,EAC9B,iBAAiB,EACjB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC5C,KAAK,EAAE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CAAC;AAEF,eAAO,MAAM,eAAe,sBAAsB,CAAC;AAGnD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,CAyFhF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CA8CnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../src/core/sentry/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAWrC,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAoD9C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../../../src/core/sentry/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAWrC,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,mBAAmB,EAAE,OAAO,CAAC,OAAO,CAAC,EACrC,SAAS,EAAE,MAAM,EACjB,qBAAqB,EAAE,MAAM,GAAG,SAAS,GACxC;IAAE,WAAW,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAoD9C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,EACjB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,IAAI,CA6DN;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,CAsBzF;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO5E"}
|
|
@@ -41,16 +41,18 @@ export type SourceMapFeatures = {
|
|
|
41
41
|
* `sourcemaps.disable` decides.
|
|
42
42
|
*/
|
|
43
43
|
export declare function getSourceMapFeatures(options: NormalizedOptions): SourceMapFeatures;
|
|
44
|
-
/** Reads `sourcemaps.
|
|
45
|
-
export declare function
|
|
46
|
-
/**
|
|
44
|
+
/** Reads the internal `sourcemaps.sdkDeleteSourceMaps` option, calling its function form if given. */
|
|
45
|
+
export declare function getSdkDeleteSourceMaps(options: NormalizedOptions, environment?: string): boolean | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Reads `sourcemaps.delete`. When it is unset, `sourcemaps.deleteSourcemapsAfterUpload` decides, and
|
|
48
|
+
* then the SDK.
|
|
49
|
+
*/
|
|
47
50
|
export declare function getDeleteOption(options: NormalizedOptions, environment?: string): boolean | undefined;
|
|
48
|
-
/** Reads the internal `sourcemaps.sdkEnabledSourceMaps` option, calling its function form if given. */
|
|
49
|
-
export declare function getSdkEnabledSourceMaps(options: NormalizedOptions, environment?: string): boolean;
|
|
50
51
|
/**
|
|
51
52
|
* Decides whether the plugin turns hidden source maps on and whether it removes the maps from the
|
|
52
53
|
* build output after the upload. The plugin only turns maps on when an upload can run, and only
|
|
53
|
-
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload`
|
|
54
|
+
* removes maps it turned on itself unless `deleteSourcemapsAfterUpload` or the SDK's
|
|
55
|
+
* `sdkDeleteSourceMaps` says otherwise. The user's `deleteSourcemapsAfterUpload` wins over the SDK.
|
|
54
56
|
*/
|
|
55
57
|
export declare function decideSourceMapHandling(kind: SourceMapKind, options: NormalizedOptions, uploadPossible: boolean, environment?: string): SourceMapDecision;
|
|
56
58
|
//# sourceMappingURL=sourcemap-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourcemap-settings.d.ts","sourceRoot":"","sources":["../../../src/core/sourcemap-settings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gDAAgD;IAChD,YAAY,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,iBAAiB,EAAE,OAAO,CAAC;IAC3B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,CAAC;AAYF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,sEAAsE;IACtE,cAAc,EAAE,OAAO,CAAC;IACxB,iFAAiF;IACjF,MAAM,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,CAIlF;AAED,
|
|
1
|
+
{"version":3,"file":"sourcemap-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,24 @@ export type HandleRecoverableErrorFn = (error: unknown, throwByDefault: boolean)
|
|
|
658
658
|
/**
|
|
659
659
|
* @internal For Sentry SDK packages only. It can change in any release.
|
|
660
660
|
*
|
|
661
|
-
* Like `Options`, but
|
|
662
|
-
* `sourcemaps.
|
|
663
|
-
*
|
|
664
|
-
*
|
|
665
|
-
*
|
|
661
|
+
* Like `Options`, but with the SDK's own source map deletion decision in
|
|
662
|
+
* `sourcemaps.sdkDeleteSourceMaps`. The plugin calls its function form when it decides how to treat
|
|
663
|
+
* the bundler's source map setting, so an SDK can give a value that it only knows after it created
|
|
664
|
+
* the plugin. Vite passes the name of an environment with its own `build.sourcemap`, and `undefined`
|
|
665
|
+
* for the top-level `build.sourcemap`.
|
|
666
666
|
*/
|
|
667
667
|
export type InternalOptions = Omit<Options, 'sourcemaps'> & {
|
|
668
|
-
sourcemaps?:
|
|
669
|
-
deleteSourcemapsAfterUpload?: boolean | ((environment?: string) => boolean | undefined);
|
|
668
|
+
sourcemaps?: NonNullable<Options['sourcemaps']> & {
|
|
670
669
|
/**
|
|
671
|
-
*
|
|
672
|
-
*
|
|
673
|
-
*
|
|
670
|
+
* - `true`: the SDK turned the source maps on, so the plugin removes every source map, also those of
|
|
671
|
+
* CSS and of chunks that the upload leaves out.
|
|
672
|
+
* - `false`: the plugin keeps the source maps.
|
|
673
|
+
* - `undefined`: the plugin's own rules apply.
|
|
674
|
+
*
|
|
675
|
+
* The user's `sourcemaps.delete` replaces it. The user's `sourcemaps.deleteSourcemapsAfterUpload`
|
|
676
|
+
* decides whether source maps are removed, and `true` here still makes that all of them.
|
|
674
677
|
*/
|
|
675
|
-
|
|
678
|
+
sdkDeleteSourceMaps?: boolean | ((environment?: string) => boolean | undefined);
|
|
676
679
|
};
|
|
677
680
|
};
|
|
678
681
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/types.ts"],"names":[],"m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,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,KAAK,IAAI,CAAC;AAEzF;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,GAAG;IAC1D,UAAU,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG;QAChD;;;;;;;;WAQG;QACH,mBAAmB,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC,CAAC;KACjF,CAAC;CACH,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "11.
|
|
1
|
+
export declare const LIB_VERSION = "11.20.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseNode } from './ast';
|
|
2
|
+
import type { RewriteState } from './rewriter';
|
|
3
|
+
/**
|
|
4
|
+
* Replace an array literal of identifiers with `build(names)`, where `names`
|
|
5
|
+
* holds each identifier once, in source order. An empty array is left alone.
|
|
6
|
+
* An array holding anything other than plain identifiers is left alone and
|
|
7
|
+
* recorded as skipped under `label`.
|
|
8
|
+
*
|
|
9
|
+
* @returns whether the array was replaced
|
|
10
|
+
*/
|
|
11
|
+
export declare function wrapArrayLiteral(state: RewriteState, arrayNode: BaseNode, label: string, build: (names: string[]) => string): boolean;
|
|
12
|
+
//# sourceMappingURL=arrays.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrays.d.ts","sourceRoot":"","sources":["../../../src/rewriter/arrays.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAuB,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,SAAS,EAAE,QAAQ,EACnB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,MAAM,GACjC,OAAO,CAcT"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export interface BaseNode {
|
|
2
|
+
type: string;
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ProgramBody {
|
|
7
|
+
body: BaseNode[];
|
|
8
|
+
hashbang?: BaseNode | null;
|
|
9
|
+
}
|
|
10
|
+
export interface IdentifierNode extends BaseNode {
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
/** An `Identifier` or, for `export { x as "name" }`, a string `Literal`. */
|
|
14
|
+
export interface NameNode {
|
|
15
|
+
type: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
value?: unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface CallExpressionNode extends BaseNode {
|
|
20
|
+
callee?: {
|
|
21
|
+
type: string;
|
|
22
|
+
name?: string;
|
|
23
|
+
property?: {
|
|
24
|
+
type: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
arguments?: BaseNode[];
|
|
29
|
+
}
|
|
30
|
+
export interface MemberExpressionNode extends BaseNode {
|
|
31
|
+
object?: {
|
|
32
|
+
type: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
};
|
|
35
|
+
property?: {
|
|
36
|
+
type: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface ClassDeclarationNode extends BaseNode {
|
|
41
|
+
id?: IdentifierNode | null;
|
|
42
|
+
superClass?: BaseNode | null;
|
|
43
|
+
decorators?: BaseNode[] | null;
|
|
44
|
+
}
|
|
45
|
+
export interface ExportDefaultNode extends BaseNode {
|
|
46
|
+
declaration: BaseNode;
|
|
47
|
+
}
|
|
48
|
+
export interface ExportSpecifierNode extends BaseNode {
|
|
49
|
+
local?: NameNode;
|
|
50
|
+
exported?: NameNode;
|
|
51
|
+
exportKind?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ExportNamedNode extends BaseNode {
|
|
54
|
+
declaration?: BaseNode | null;
|
|
55
|
+
source?: (BaseNode & {
|
|
56
|
+
value?: unknown;
|
|
57
|
+
}) | null;
|
|
58
|
+
specifiers?: ExportSpecifierNode[];
|
|
59
|
+
exportKind?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ExportAllNode extends BaseNode {
|
|
62
|
+
source?: {
|
|
63
|
+
value?: unknown;
|
|
64
|
+
};
|
|
65
|
+
exported?: NameNode | null;
|
|
66
|
+
exportKind?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface VariableDeclaratorNode {
|
|
69
|
+
id?: BaseNode | null;
|
|
70
|
+
init?: BaseNode | null;
|
|
71
|
+
}
|
|
72
|
+
export interface VariableDeclarationNode extends BaseNode {
|
|
73
|
+
declarations?: VariableDeclaratorNode[];
|
|
74
|
+
}
|
|
75
|
+
export interface ImportSpecifierNode {
|
|
76
|
+
type: string;
|
|
77
|
+
imported?: NameNode;
|
|
78
|
+
local?: NameNode;
|
|
79
|
+
importKind?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface ImportDeclarationNode extends BaseNode {
|
|
82
|
+
source?: {
|
|
83
|
+
value?: unknown;
|
|
84
|
+
};
|
|
85
|
+
specifiers?: ImportSpecifierNode[];
|
|
86
|
+
importKind?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface ArrayExpressionNode extends BaseNode {
|
|
89
|
+
elements?: Array<BaseNode | null>;
|
|
90
|
+
}
|
|
91
|
+
export interface PropertyNode extends BaseNode {
|
|
92
|
+
key?: NameNode;
|
|
93
|
+
value?: BaseNode;
|
|
94
|
+
computed?: boolean;
|
|
95
|
+
}
|
|
96
|
+
/** The declaration a top-level statement makes, looking through `export` (`export const x = ...`). */
|
|
97
|
+
export declare function declarationOf(node: BaseNode): BaseNode | null | undefined;
|
|
98
|
+
/** Whether `node` calls `methodName`, either bare (`fn()`) or as a member (`ns.fn()`). */
|
|
99
|
+
export declare function isCallToMethod(node: BaseNode, methodName: string): boolean;
|
|
100
|
+
export declare function isAnonymousFunctionOrClass(node: BaseNode): boolean;
|
|
101
|
+
/** `export type { X }` or `export { type X }`, which TypeScript erases. */
|
|
102
|
+
export declare function isTypeOnlyExport(node: {
|
|
103
|
+
exportKind?: string;
|
|
104
|
+
}): boolean;
|
|
105
|
+
/** The name an export or import specifier refers to, for both `x` and `"x"`. */
|
|
106
|
+
export declare function exportedName(node: NameNode | undefined): string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* The offset after the hashbang and the directive prologue (`'use server'`),
|
|
109
|
+
* where code may be inserted without changing what the module means.
|
|
110
|
+
*/
|
|
111
|
+
export declare function directivesEnd(ast: ProgramBody): number;
|
|
112
|
+
/**
|
|
113
|
+
* The binding names a declaration introduces, including names inside
|
|
114
|
+
* destructuring patterns. `undefined` for a declaration that binds no runtime
|
|
115
|
+
* value (`interface`, `type`).
|
|
116
|
+
*/
|
|
117
|
+
export declare function declaredNames(declaration: BaseNode): string[] | undefined;
|
|
118
|
+
/** Visit `node` and every node below it, parents first. */
|
|
119
|
+
export declare function walk(node: unknown, visit: (node: BaseNode) => void): void;
|
|
120
|
+
//# sourceMappingURL=ast.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IAAI,CAWzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ProgramBody } from './ast';
|
|
2
|
+
/** A base class, named by the module it is imported from and its export name. */
|
|
3
|
+
export interface BaseClassRef {
|
|
4
|
+
module: string;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Find top-level classes that (transitively, within this module) extend the
|
|
9
|
+
* given base class. A superclass must be a plain identifier (`extends Base`)
|
|
10
|
+
* or member access (`extends ns.Base`).
|
|
11
|
+
*
|
|
12
|
+
* Only same-file base chains are resolvable here; a base class imported from
|
|
13
|
+
* another module under a different name is invisible.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findClassesExtending(ast: ProgramBody, base: BaseClassRef): Set<string>;
|
|
16
|
+
//# sourceMappingURL=class-extends.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class-extends.d.ts","sourceRoot":"","sources":["../../../src/rewriter/class-extends.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,WAAW,EACZ,MAAM,OAAO,CAAC;AAGf,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AASD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,CA8BtF"}
|