@generaltranslation/vue-extractor 0.0.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.
Files changed (62) hide show
  1. package/LICENSE.md +105 -0
  2. package/dist/config.d.ts +2 -0
  3. package/dist/config.js +2 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/dist/internal/compilerAst.d.ts +43 -0
  7. package/dist/internal/compilerAst.js +77 -0
  8. package/dist/internal/compilerAst.js.map +1 -0
  9. package/dist/internal/config/resolveVueCompilerOptions.d.ts +23 -0
  10. package/dist/internal/config/resolveVueCompilerOptions.js +987 -0
  11. package/dist/internal/config/resolveVueCompilerOptions.js.map +1 -0
  12. package/dist/internal/extractFromVueSource.d.ts +9 -0
  13. package/dist/internal/extractFromVueSource.js +332 -0
  14. package/dist/internal/extractFromVueSource.js.map +1 -0
  15. package/dist/internal/script/analyze.d.ts +13 -0
  16. package/dist/internal/script/analyze.js +4761 -0
  17. package/dist/internal/script/analyze.js.map +1 -0
  18. package/dist/internal/script/jsx.d.ts +36 -0
  19. package/dist/internal/script/jsx.js +667 -0
  20. package/dist/internal/script/jsx.js.map +1 -0
  21. package/dist/internal/script/knownValues.d.ts +14 -0
  22. package/dist/internal/script/knownValues.js +148 -0
  23. package/dist/internal/script/knownValues.js.map +1 -0
  24. package/dist/internal/script/localModules.d.ts +80 -0
  25. package/dist/internal/script/localModules.js +364 -0
  26. package/dist/internal/script/localModules.js.map +1 -0
  27. package/dist/internal/script/model.d.ts +317 -0
  28. package/dist/internal/script/model.js +1 -0
  29. package/dist/internal/script/parser.d.ts +3 -0
  30. package/dist/internal/script/parser.js +21 -0
  31. package/dist/internal/script/parser.js.map +1 -0
  32. package/dist/internal/script/replay.d.ts +53 -0
  33. package/dist/internal/script/replay.js +1611 -0
  34. package/dist/internal/script/replay.js.map +1 -0
  35. package/dist/internal/script/snapshot.d.ts +25 -0
  36. package/dist/internal/script/snapshot.js +293 -0
  37. package/dist/internal/script/snapshot.js.map +1 -0
  38. package/dist/internal/script/syntax.d.ts +21 -0
  39. package/dist/internal/script/syntax.js +46 -0
  40. package/dist/internal/script/syntax.js.map +1 -0
  41. package/dist/internal/script.d.ts +2 -0
  42. package/dist/internal/script.js +2 -0
  43. package/dist/internal/stringCalls.d.ts +7 -0
  44. package/dist/internal/stringCalls.js +82 -0
  45. package/dist/internal/stringCalls.js.map +1 -0
  46. package/dist/internal/template.d.ts +4 -0
  47. package/dist/internal/template.js +2198 -0
  48. package/dist/internal/template.js.map +1 -0
  49. package/dist/internal/templatePath.d.ts +12 -0
  50. package/dist/internal/templatePath.js +23 -0
  51. package/dist/internal/templatePath.js.map +1 -0
  52. package/dist/internal/types.d.ts +69 -0
  53. package/dist/internal/types.js +1 -0
  54. package/dist/internal/utils.d.ts +19 -0
  55. package/dist/internal/utils.js +149 -0
  56. package/dist/internal/utils.js.map +1 -0
  57. package/dist/internal/vueCompiler.d.ts +35 -0
  58. package/dist/internal/vueCompiler.js +320 -0
  59. package/dist/internal/vueCompiler.js.map +1 -0
  60. package/dist/types.d.ts +80 -0
  61. package/dist/types.js +1 -0
  62. package/package.json +78 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx.js","names":[],"sources":["../../../src/internal/script/jsx.ts"],"sourcesContent":["import type { NodePath, Scope } from '@babel/traverse';\nimport * as babel from '@babel/types';\nimport {\n HTML_CONTENT_PROPS,\n type GTProp,\n type JsxChild,\n type JsxChildren,\n} from '@generaltranslation/format/types';\nimport { isHTMLTag, isSVGTag } from '@vue/shared';\nimport { isAcceptedPluralForm } from 'generaltranslation/internal';\nimport type { GTComponentName, VueExtractionContext } from '../types.js';\nimport {\n addVueError,\n babelLocation,\n createInlineMetadata,\n type StaticPrimitiveResult,\n unwrapExpression,\n} from '../utils.js';\nimport type { KnownValue } from './model.js';\n\ntype Counter = { value: number };\n\ntype JSXSlotFunction = {\n node:\n | babel.ArrowFunctionExpression\n | babel.FunctionExpression\n | babel.ObjectMethod;\n scope: Scope;\n};\n\ntype JSXSlotLayout = {\n defaultChildren: babel.JSXElement['children'];\n defaultSlot?: JSXSlotFunction;\n namedSlots: Map<string, JSXSlotFunction>;\n};\n\ntype OrdinaryElementShape = {\n /** Component slots stay outside T's source tree. */\n opaque: boolean;\n /** Proven runtime string tag, retained only for catalog readability. */\n tag?: string;\n};\n\n/** Narrow script-analysis capabilities required by rich JSX extraction. */\nexport type VueJSXAnalysis = {\n /** Per-file pragma that replaces Vue's VNode factory, when present. */\n customPragma?: babel.Comment;\n /** Resolves an expression to a proven gt-vue or Vue runtime identity. */\n resolveKnownValue: (\n expression: babel.Expression,\n scope: Scope\n ) => KnownValue | undefined;\n /** Evaluates the side-effect-free primitive subset at this source position. */\n readStaticPrimitive: (\n expression: babel.Node,\n scope: Scope\n ) => StaticPrimitiveResult;\n /** Resolves a safely retained object literal without executing user code. */\n resolveStaticObject: (\n expression: babel.Node,\n scope: Scope\n ) => { node: babel.ObjectExpression; scope: Scope } | undefined;\n /** Returns Babel's lexical scope for a nested function or expression. */\n scopeForNode: (node: babel.Node, fallback: Scope) => Scope;\n};\n\nconst RESERVED_T_PROPS = new Set(['key', 'ref']);\nconst FORMAT_COMPONENTS = new Set<GTComponentName>([\n 'Currency',\n 'DateTime',\n 'Num',\n]);\nconst NON_BRANCH_PROP_NAMES = new Set([\n 'branch',\n 'class',\n 'key',\n 'locales',\n 'n',\n 'ref',\n 'ref-for',\n 'ref-key',\n 'ref_for',\n 'ref_key',\n 'style',\n 'v-slots',\n 'vSlots',\n]);\n\n/**\n * Extracts one statically identified gt-vue `T` JSX element.\n *\n * This serializer follows the VNodes emitted by `@vue/babel-plugin-jsx`:\n * fragments are transparent, JSX text uses the plugin's normalization, and\n * arbitrary component slots remain opaque because gt-vue does not execute\n * user slots while calculating a source hash.\n */\nexport function extractVueJSXTranslation(\n path: NodePath<babel.JSXElement>,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): void {\n if (analysis.customPragma) {\n addVueError(\n context,\n babelLocation(analysis.customPragma.loc),\n 'Found a custom @jsx pragma in a gt-vue JSX translation file',\n 'Use the default Vue JSX VNode factory for files containing gt-vue <T>'\n );\n return;\n }\n const errorCount = context.errors.length;\n const translationContext = readTranslationContext(\n path.node.openingElement,\n path.scope,\n context,\n analysis\n );\n const source = collapseChildren(\n serializeChildren(\n path.node.children,\n { value: 0 },\n path.scope,\n context,\n analysis\n )\n );\n if (context.errors.length !== errorCount) return;\n\n context.results.push({\n dataFormat: 'JSX',\n source,\n metadata: createInlineMetadata(\n context,\n babelLocation(path.node.loc),\n translationContext\n ),\n });\n}\n\n/** Returns whether the visitor is already covered by an outer serialized T. */\nexport function isNestedInVueJSXTranslation(\n path: NodePath<babel.JSXElement>,\n analysis: VueJSXAnalysis\n): boolean {\n let current: NodePath | null = path.parentPath;\n while (current) {\n if (current.isJSXElement()) {\n const element = current.node;\n const identity = resolveElementIdentity(\n element.openingElement.name,\n current.scope,\n analysis\n );\n const containingAttribute = findContainingJSXAttribute(path, current);\n if (\n containingAttribute &&\n !(\n identity?.type === 'component' &&\n (identity.name === 'Branch' || identity.name === 'Plural') &&\n isSlotsAttribute(containingAttribute.node)\n )\n ) {\n // JSX inside an event or ordinary prop is not a child VNode of the\n // surrounding translation. Extract it independently if it is T.\n return false;\n }\n if (identity?.type === 'component') {\n if (identity.name === 'T') return true;\n if (identity.name === 'Var' || FORMAT_COMPONENTS.has(identity.name)) {\n return false;\n }\n // Branch and Plural own stable slots, so an outer T reaches them.\n } else if (\n identity?.type === 'vue-builtin' &&\n (identity.name !== 'Fragment' ||\n isTransparentFragment(element.openingElement.name, identity))\n ) {\n if (\n identity.name === 'Suspense' &&\n containingAttribute &&\n isSlotsAttribute(containingAttribute.node)\n ) {\n // Explicit Suspense slots have separate lifetimes. The outer\n // serializer follows the default slot and excludes fallback, while\n // a T declared in fallback remains an independent translation.\n return false;\n }\n // Vue Fragment aliases and normalized Suspense default content are\n // transparent to the runtime source tree.\n } else if (\n !isLiteralFragment(element.openingElement.name) &&\n !isNativeElement(element.openingElement.name)\n ) {\n // Arbitrary component slots are opaque to the outer translation.\n return false;\n }\n }\n current = current.parentPath;\n }\n return false;\n}\n\n/** Finds an attribute boundary between a nested JSX node and one ancestor. */\nfunction findContainingJSXAttribute(\n path: NodePath,\n ancestor: NodePath<babel.JSXElement>\n): NodePath<babel.JSXAttribute> | undefined {\n let current: NodePath | null = path.parentPath;\n while (current && current !== ancestor) {\n if (\n current.isJSXAttribute() &&\n current.parentPath?.isJSXOpeningElement() &&\n current.parentPath.parentPath === ancestor\n ) {\n return current;\n }\n current = current.parentPath;\n }\n return undefined;\n}\n\nfunction isSlotsAttribute(attribute: babel.JSXAttribute): boolean {\n const name = readAttributeName(attribute.name);\n return name === 'v-slots' || name === 'vSlots';\n}\n\n/** Resolves a JSX tag to the identity tracked by the script analyzer. */\nexport function resolveVueJSXElementIdentity(\n name: babel.JSXElement['openingElement']['name'],\n scope: Scope,\n analysis: VueJSXAnalysis\n): KnownValue | undefined {\n return resolveElementIdentity(name, scope, analysis);\n}\n\n/** Enforces the one supported public shape for a gt-vue variable component. */\nexport function validateVueJSXVariableComponent(\n element: babel.JSXElement,\n component: 'Currency' | 'DateTime' | 'Num' | 'Var',\n context: VueExtractionContext\n): void {\n validateVariableElement(element, component, context);\n}\n\nfunction readTranslationContext(\n element: babel.JSXOpeningElement,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): string | undefined {\n let translationContext: string | undefined;\n let hasContext = false;\n\n for (const attribute of element.attributes) {\n if (attribute.type === 'JSXSpreadAttribute') {\n addVueError(\n context,\n babelLocation(attribute.loc),\n 'Found a spread prop on a gt-vue <T> component in JSX',\n 'Pass context as one explicit static context or $context prop'\n );\n continue;\n }\n const name = readAttributeName(attribute.name);\n if (RESERVED_T_PROPS.has(name)) continue;\n if (name !== 'context' && name !== '$context') {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found unsupported prop \"${name}\" on a gt-vue <T> component`,\n 'gt-vue <T> currently supports only context'\n );\n continue;\n }\n if (hasContext) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n 'Found duplicate context props on a gt-vue <T> component',\n 'Pass only one context prop'\n );\n continue;\n }\n hasContext = true;\n const contextExpression =\n attribute.value?.type === 'JSXExpressionContainer' &&\n attribute.value.expression.type !== 'JSXEmptyExpression'\n ? unwrapExpression(attribute.value.expression)\n : undefined;\n if (\n contextExpression?.type === 'ConditionalExpression' ||\n contextExpression?.type === 'LogicalExpression'\n ) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n 'Found conditional context on a gt-vue <T> component',\n 'Use one invariant static context string for this translation'\n );\n continue;\n }\n const value = readJSXAttributePrimitive(attribute, scope, analysis);\n if (!value.ok || typeof value.value !== 'string') {\n addVueError(\n context,\n babelLocation(attribute.loc),\n 'Found a dynamic context on a gt-vue <T> component',\n 'Use a string literal or an immutable static string'\n );\n continue;\n }\n translationContext = value.value;\n }\n return translationContext;\n}\n\nfunction serializeChildren(\n children: Array<\n | babel.JSXText\n | babel.JSXExpressionContainer\n | babel.JSXSpreadChild\n | babel.JSXElement\n | babel.JSXFragment\n >,\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild[] {\n const result: JsxChild[] = [];\n for (const child of children) {\n for (const serialized of serializeChild(\n child,\n counter,\n scope,\n context,\n analysis\n )) {\n appendSerializedChild(result, serialized);\n }\n }\n return result;\n}\n\nfunction serializeChild(\n child:\n | babel.JSXText\n | babel.JSXExpressionContainer\n | babel.JSXSpreadChild\n | babel.JSXElement\n | babel.JSXFragment,\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild[] {\n if (child.type === 'JSXText') {\n const text = normalizeJSXText(child.value);\n return text ? [text] : [];\n }\n if (child.type === 'JSXElement') {\n return serializeElement(child, counter, scope, context, analysis);\n }\n if (child.type === 'JSXFragment') {\n return serializeChildren(child.children, counter, scope, context, analysis);\n }\n if (child.type === 'JSXSpreadChild') {\n addVueError(\n context,\n babelLocation(child.loc),\n 'Found a spread child inside a gt-vue <T> component in JSX',\n 'Use static JSX children and wrap one runtime value in a gt-vue variable component'\n );\n return [];\n }\n if (child.expression.type === 'JSXEmptyExpression') return [];\n return serializeExpression(\n child.expression,\n counter,\n scope,\n context,\n analysis\n );\n}\n\nfunction serializeExpression(\n input: babel.Expression,\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild[] {\n const expression = unwrapExpression(input);\n if (!expression) return [];\n if (expression.type === 'JSXElement') {\n return serializeElement(expression, counter, scope, context, analysis);\n }\n if (expression.type === 'JSXFragment') {\n return serializeChildren(\n expression.children,\n counter,\n scope,\n context,\n analysis\n );\n }\n if (expression.type === 'ArrayExpression') {\n const result: JsxChild[] = [];\n for (const item of expression.elements) {\n if (!item) continue;\n if (item.type === 'SpreadElement') {\n addVueError(\n context,\n babelLocation(item.loc),\n 'Found a spread array child inside a gt-vue <T> component in JSX',\n 'List each static child explicitly'\n );\n continue;\n }\n for (const serialized of serializeExpression(\n item,\n counter,\n scope,\n context,\n analysis\n )) {\n appendSerializedChild(result, serialized);\n }\n }\n return result;\n }\n if (\n expression.type === 'ConditionalExpression' ||\n expression.type === 'LogicalExpression'\n ) {\n addVueError(\n context,\n babelLocation(expression.loc),\n 'Found conditional JSX content inside a gt-vue <T> component',\n 'Move conditional content outside <T>, or use a static Branch or Plural component'\n );\n return [];\n }\n\n const value = analysis.readStaticPrimitive(expression, scope);\n if (!value.ok) {\n addVueError(\n context,\n babelLocation(expression.loc),\n 'Found dynamic JSX content inside a gt-vue <T> component',\n 'Wrap runtime values in <Var>, <Num>, <DateTime>, or <Currency>'\n );\n return [];\n }\n // Vue drops null and boolean JSX children. All other primitive VNode\n // children are stringified by gt-vue before the source is hashed.\n return value.value == null || typeof value.value === 'boolean'\n ? []\n : [String(value.value)];\n}\n\nfunction serializeElement(\n element: babel.JSXElement,\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild[] {\n const name = element.openingElement.name;\n const identity = resolveElementIdentity(name, scope, analysis);\n if (isTransparentFragment(name, identity)) {\n return serializeChildren(\n element.children,\n counter,\n scope,\n context,\n analysis\n );\n }\n\n counter.value += 1;\n const id = counter.value;\n const component = identity?.type === 'component' ? identity.name : undefined;\n\n validateElementAttributes(element.openingElement, scope, context, analysis);\n if (component === 'T') {\n addVueError(\n context,\n babelLocation(element.loc),\n 'Found a nested gt-vue <T> component inside another <T>',\n 'Split nested translations into sibling <T> components'\n );\n return [];\n }\n if (\n component === 'Var' ||\n component === 'Num' ||\n component === 'DateTime' ||\n component === 'Currency'\n ) {\n validateVariableElement(element, component, context);\n const variable =\n component === 'Num'\n ? { name: 'n', type: 'n' as const }\n : component === 'DateTime'\n ? { name: 'date', type: 'd' as const }\n : component === 'Currency'\n ? { name: 'cost', type: 'c' as const }\n : { name: 'value', type: 'v' as const };\n return [{ i: id, k: `_gt_${variable.name}_${id}`, v: variable.type }];\n }\n if (component === 'Branch' || component === 'Plural') {\n return [\n serializeBranchElement(\n element,\n id,\n component,\n counter,\n scope,\n context,\n analysis\n ),\n ];\n }\n if (identity?.type === 'vue-builtin' && identity.name === 'Suspense') {\n return [\n serializeSuspenseElement(element, id, counter, scope, context, analysis),\n ];\n }\n if (identity?.type === 'vue-builtin' && identity.name === 'Fragment') {\n addVueError(\n context,\n babelLocation(element.loc),\n 'Found a renamed Vue Fragment binding inside a gt-vue JSX translation',\n 'Use <>, literal <Fragment>, or a Vue namespace member such as <Vue.Fragment>; the Vue JSX transform compiles renamed Fragment bindings as component slots'\n );\n return [];\n }\n if (identity?.type === 'vue-builtin') {\n addVueError(\n context,\n babelLocation(element.loc),\n `Found unsupported Vue <${identity.name}> content inside a gt-vue JSX translation`,\n 'Move this Vue builtin outside <T>'\n );\n return [];\n }\n if (!identity && isUnboundNonNativeElement(name, scope)) {\n addVueError(\n context,\n babelLocation(element.loc),\n `Could not determine whether JSX tag <${readElementDisplayName(name) ?? 'unknown'}> is a component or custom element`,\n 'Import or locally bind the component, or move the configured custom element outside <T>'\n );\n return [];\n }\n\n const ordinaryShape = identity\n ? undefined\n : resolveOrdinaryElementShape(name, scope, analysis, new Set());\n if (!identity && !ordinaryShape) {\n addVueError(\n context,\n babelLocation(element.loc),\n `Could not statically resolve whether JSX tag <${readElementDisplayName(name) ?? 'unknown'}> renders an element or component`,\n 'Use a native tag, imported component, defineComponent result, or an immutable tag expression that cannot switch between element and component shapes'\n );\n return [];\n }\n\n const data = readContentProps(\n element.openingElement,\n scope,\n context,\n analysis\n );\n const tag = ordinaryShape?.tag ?? readElementDisplayName(name);\n if (!tag) {\n addVueError(\n context,\n babelLocation(element.loc),\n 'Found unsupported namespaced JSX syntax inside a gt-vue <T> component',\n 'Use a native element or a statically imported component'\n );\n return [];\n }\n if (ordinaryShape?.opaque) {\n return [\n {\n t: tag,\n i: id,\n ...(Object.keys(data).length > 0 && { d: data }),\n },\n ];\n }\n\n const children = serializeChildren(\n element.children,\n counter,\n scope,\n context,\n analysis\n );\n return [\n {\n t: tag,\n i: id,\n ...(Object.keys(data).length > 0 && { d: data }),\n ...(children.length > 0 && { c: collapseChildren(children) }),\n },\n ];\n}\n\n/**\n * Serializes Vue Suspense's normalized default content without evaluating its\n * fallback. Vue requires that default slot to resolve to one VNode root; an\n * ambiguous or multi-root shape is rejected before it can hash differently.\n */\nfunction serializeSuspenseElement(\n element: babel.JSXElement,\n id: number,\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild {\n const slots = readJSXSlotLayout(\n element,\n scope,\n context,\n analysis,\n 'suspense'\n );\n const directSlot = readDirectSuspenseSlot(element, scope, context, analysis);\n if (directSlot.present) {\n slots.defaultChildren = [];\n slots.defaultSlot = directSlot.slot;\n }\n\n for (const name of slots.namedSlots.keys()) {\n if (name === 'fallback' || name.startsWith('_')) continue;\n addVueError(\n context,\n babelLocation(element.loc),\n `Found unsupported named slot \"${name}\" on Vue <Suspense> inside a gt-vue <T> component`,\n 'Use only the default and fallback Suspense slots'\n );\n }\n\n if (slots.defaultSlot) {\n validateSuspenseSlotRoot(slots.defaultSlot, element, context);\n } else {\n validateSuspenseImplicitRoot(slots.defaultChildren, element, context);\n }\n\n const children = slots.defaultSlot\n ? serializeSlotFunction(slots.defaultSlot, counter, context, analysis)\n : serializeChildren(\n slots.defaultChildren,\n counter,\n scope,\n context,\n analysis\n );\n const data = readContentProps(\n element.openingElement,\n scope,\n context,\n analysis\n );\n return {\n t: 'Suspense',\n i: id,\n ...(Object.keys(data).length > 0 && { d: data }),\n ...(children.length > 0 && { c: collapseChildren(children) }),\n };\n}\n\n/** Reads the unambiguous one-function JSX spelling for a default slot. */\nfunction readDirectSuspenseSlot(\n element: babel.JSXElement,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): { present: boolean; slot?: JSXSlotFunction } {\n if (\n hasExplicitAttribute(element.openingElement, 'v-slots') ||\n hasExplicitAttribute(element.openingElement, 'vSlots')\n ) {\n return { present: false };\n }\n const children = element.children.filter(isMeaningfulJSXChild);\n if (\n children.length !== 1 ||\n children[0]?.type !== 'JSXExpressionContainer' ||\n children[0].expression.type === 'JSXEmptyExpression'\n ) {\n return { present: false };\n }\n const value = unwrapExpression(children[0].expression);\n if (\n !value ||\n (value.type !== 'ArrowFunctionExpression' &&\n value.type !== 'FunctionExpression')\n ) {\n return { present: false };\n }\n if (value.params.length > 0 || value.async || value.generator) {\n addVueError(\n context,\n babelLocation(value.loc),\n 'Found a dynamic or scoped default slot on Vue <Suspense> inside a gt-vue <T> component',\n 'Use a synchronous zero-argument function with static returned content'\n );\n return { present: true };\n }\n return {\n present: true,\n slot: {\n node: value,\n scope: analysis.scopeForNode(value, scope),\n },\n };\n}\n\n/** Enforces the single-root contract for children wrapped by the JSX plugin. */\nfunction validateSuspenseImplicitRoot(\n children: babel.JSXElement['children'],\n element: babel.JSXElement,\n context: VueExtractionContext\n): void {\n const roots = children.filter(isMeaningfulJSXChild);\n if (roots.length > 1) {\n addSuspenseRootError(element, context);\n return;\n }\n const root = roots[0];\n if (\n root?.type === 'JSXExpressionContainer' &&\n root.expression.type !== 'JSXEmptyExpression'\n ) {\n const expression = unwrapExpression(root.expression);\n if (\n expression?.type !== 'JSXElement' &&\n expression?.type !== 'JSXFragment'\n ) {\n addVueError(\n context,\n babelLocation(root.loc),\n 'Could not statically prove the default root of Vue <Suspense> inside a gt-vue <T> component',\n 'Use one JSX element, Fragment, or a static zero-argument default slot'\n );\n }\n }\n}\n\n/** Enforces the single-root contract for an explicit static slot function. */\nfunction validateSuspenseSlotRoot(\n slot: JSXSlotFunction,\n element: babel.JSXElement,\n context: VueExtractionContext\n): void {\n const returned = readStaticSlotReturn(slot);\n const expression = returned && unwrapExpression(returned);\n if (expression?.type !== 'ArrayExpression') return;\n const roots = expression.elements.filter(Boolean);\n if (\n roots.length > 1 ||\n roots.some(\n (root) =>\n root?.type === 'SpreadElement' ||\n (root?.type !== 'JSXElement' && root?.type !== 'JSXFragment')\n )\n ) {\n addSuspenseRootError(element, context);\n }\n}\n\n/** Reports the stable diagnostic shared by all invalid Suspense root shapes. */\nfunction addSuspenseRootError(\n element: babel.JSXElement,\n context: VueExtractionContext\n): void {\n addVueError(\n context,\n babelLocation(element.loc),\n 'Found more than one or an invalid default root inside Vue <Suspense> within a gt-vue <T> component',\n 'Wrap the Suspense default content in one element or Fragment, or move <T> inside <Suspense>'\n );\n}\n\n/** Serializes GT-owned Branch and Plural slots with independent ID scopes. */\nfunction serializeBranchElement(\n element: babel.JSXElement,\n id: number,\n component: 'Branch' | 'Plural',\n counter: Counter,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild {\n const slots = readJSXSlotLayout(element, scope, context, analysis);\n if (\n component === 'Plural' &&\n !hasExplicitAttribute(element.openingElement, 'n')\n ) {\n addVueError(\n context,\n babelLocation(element.openingElement.loc),\n 'Found a gt-vue <Plural> component without an n prop',\n 'Pass the numeric selector through <Plural n={count} />'\n );\n }\n\n const children = slots.defaultSlot\n ? serializeSlotFunction(slots.defaultSlot, counter, context, analysis)\n : serializeChildren(\n slots.defaultChildren,\n counter,\n scope,\n context,\n analysis\n );\n const branches: Record<string, JsxChildren> = {};\n for (const [name, slot] of slots.namedSlots) {\n if (name.startsWith('_')) continue;\n if (component === 'Plural' && !isAcceptedPluralForm(name)) continue;\n branches[name] = collapseChildren(\n serializeSlotFunction(slot, { value: id }, context, analysis)\n );\n }\n readBranchAttributeSources(\n element.openingElement,\n component,\n branches,\n scope,\n context,\n analysis\n );\n\n const data = readContentProps(\n element.openingElement,\n scope,\n context,\n analysis\n );\n if (Object.keys(branches).length > 0) {\n data.b = branches;\n data.t = component === 'Plural' ? 'p' : 'b';\n }\n return {\n t: component,\n i: id,\n ...(Object.keys(data).length > 0 && { d: data }),\n ...(children.length > 0 && { c: collapseChildren(children) }),\n };\n}\n\n/** Reconstructs the slots object emitted by the Vue JSX transform. */\nfunction readJSXSlotLayout(\n element: babel.JSXElement,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis,\n owner: 'branch' | 'suspense' = 'branch'\n): JSXSlotLayout {\n const ownerLabel =\n owner === 'suspense' ? 'Vue <Suspense>' : 'a gt-vue JSX branch component';\n const vSlots = element.openingElement.attributes.filter(\n (attribute): attribute is babel.JSXAttribute =>\n attribute.type === 'JSXAttribute' && isSlotsAttribute(attribute)\n );\n if (vSlots.length > 1) {\n addVueError(\n context,\n babelLocation(vSlots[1]!.loc),\n `Found more than one v-slots prop on ${ownerLabel}`,\n 'Pass one static slots object'\n );\n }\n\n const meaningfulChildren = element.children.filter(isMeaningfulJSXChild);\n const objectSlotChild =\n vSlots.length === 0 &&\n meaningfulChildren.length === 1 &&\n meaningfulChildren[0]?.type === 'JSXExpressionContainer' &&\n meaningfulChildren[0].expression.type !== 'JSXEmptyExpression'\n ? analysis.resolveStaticObject(meaningfulChildren[0].expression, scope)\n : undefined;\n if (objectSlotChild) {\n addVueError(\n context,\n babelLocation(meaningfulChildren[0]?.loc),\n 'Found Vue object-slot child syntax in a gt-vue JSX translation',\n 'Pass the static slots object through v-slots so extraction is independent of the JSX enableObjectSlots compiler option'\n );\n }\n const vSlotsObject = vSlots[0]\n ? readSlotsAttributeObject(vSlots[0], scope, context, analysis, ownerLabel)\n : undefined;\n const slotsObject = vSlotsObject;\n const namedSlots = new Map<string, JSXSlotFunction>();\n let defaultSlot: JSXSlotFunction | undefined;\n if (slotsObject) {\n for (const [name, slot] of readStaticSlotObject(\n slotsObject,\n context,\n analysis\n )) {\n if (name === 'default') defaultSlot = slot;\n else namedSlots.set(name, slot);\n }\n }\n\n return {\n defaultChildren: objectSlotChild ? [] : element.children,\n ...(defaultSlot && { defaultSlot }),\n namedSlots,\n };\n}\n\nfunction readSlotsAttributeObject(\n attribute: babel.JSXAttribute,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis,\n ownerLabel: string\n): { node: babel.ObjectExpression; scope: Scope } | undefined {\n const expression =\n attribute.value?.type === 'JSXExpressionContainer' &&\n attribute.value.expression.type !== 'JSXEmptyExpression'\n ? attribute.value.expression\n : undefined;\n const object = expression\n ? analysis.resolveStaticObject(expression, scope)\n : undefined;\n if (!object) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found dynamic v-slots on ${ownerLabel}`,\n 'Use a retained object literal with statically named zero-argument slot functions'\n );\n }\n return object;\n}\n\n/** Reads statically named zero-argument functions from one JSX slots object. */\nfunction readStaticSlotObject(\n object: { node: babel.ObjectExpression; scope: Scope },\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): Map<string, JSXSlotFunction> {\n const slots = new Map<string, JSXSlotFunction>();\n for (const property of object.node.properties) {\n if (property.type === 'SpreadElement') {\n addVueError(\n context,\n babelLocation(property.loc),\n 'Found a spread in a gt-vue JSX slots object',\n 'List every static slot explicitly'\n );\n continue;\n }\n const name = readStaticObjectKey(property, object.scope, analysis);\n if (name === undefined) {\n addVueError(\n context,\n babelLocation(property.loc),\n 'Found a dynamic slot name in a gt-vue JSX slots object',\n 'Use a static string slot name'\n );\n continue;\n }\n if (slots.has(name)) {\n addVueError(\n context,\n babelLocation(property.loc),\n `Found duplicate JSX slot \"${name}\" in a gt-vue translation`,\n 'Define every slot once'\n );\n continue;\n }\n const value =\n property.type === 'ObjectMethod'\n ? property\n : unwrapExpression(property.value);\n if (\n !value ||\n (value.type !== 'ArrowFunctionExpression' &&\n value.type !== 'FunctionExpression' &&\n value.type !== 'ObjectMethod') ||\n value.params.length > 0 ||\n value.async ||\n value.generator\n ) {\n addVueError(\n context,\n babelLocation(property.loc),\n `Found a dynamic or scoped JSX slot \"${name}\" in a gt-vue translation`,\n 'Use a synchronous zero-argument function with static returned content'\n );\n continue;\n }\n slots.set(name, {\n node: value,\n scope: analysis.scopeForNode(value, object.scope),\n });\n }\n return slots;\n}\n\nfunction serializeSlotFunction(\n slot: JSXSlotFunction,\n counter: Counter,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): JsxChild[] {\n const returned = readStaticSlotReturn(slot);\n if (!returned) {\n addVueError(\n context,\n babelLocation(slot.node.loc),\n 'Found a JSX slot with a dynamic function body in a gt-vue translation',\n 'Return static slot content directly from the zero-argument function'\n );\n return [];\n }\n return serializeExpression(returned, counter, slot.scope, context, analysis);\n}\n\n/** Returns the expression from a slot body that contains only one return. */\nfunction readStaticSlotReturn(\n slot: JSXSlotFunction\n): babel.Expression | undefined {\n const body = slot.node.body;\n if (body.type !== 'BlockStatement') return body;\n const statements = body.body.filter(\n (statement) => statement.type !== 'EmptyStatement'\n );\n const returned =\n statements.length === 1 && statements[0]?.type === 'ReturnStatement'\n ? statements[0].argument\n : undefined;\n return returned ?? undefined;\n}\n\nfunction readStaticObjectKey(\n property: babel.ObjectMethod | babel.ObjectProperty,\n scope: Scope,\n analysis: VueJSXAnalysis\n): string | undefined {\n if (!property.computed) {\n if (property.key.type === 'Identifier') return property.key.name;\n if (\n property.key.type === 'StringLiteral' ||\n property.key.type === 'NumericLiteral'\n ) {\n return String(property.key.value);\n }\n return undefined;\n }\n const key = analysis.readStaticPrimitive(property.key, scope);\n return key.ok &&\n (typeof key.value === 'string' || typeof key.value === 'number')\n ? String(key.value)\n : undefined;\n}\n\nfunction readBranchAttributeSources(\n element: babel.JSXOpeningElement,\n component: 'Branch' | 'Plural',\n branches: Record<string, JsxChildren>,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): void {\n const seenBranchProps = new Set<string>();\n for (const attribute of element.attributes) {\n if (attribute.type !== 'JSXAttribute') continue;\n const name = readAttributeName(attribute.name);\n if (\n !isBranchPropName(name) ||\n (component === 'Plural' && !isAcceptedPluralForm(name))\n ) {\n continue;\n }\n if (seenBranchProps.has(name)) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found duplicate branch prop \"${name}\" on a gt-vue <${component}> component`,\n 'Pass each branch prop once so Vue JSX compiler options cannot change which value is hashed'\n );\n continue;\n }\n seenBranchProps.add(name);\n if (Object.prototype.hasOwnProperty.call(branches, name)) continue;\n const value = readJSXAttributePrimitive(attribute, scope, analysis);\n if (!value.ok) {\n if (isStaticallyNonBranchAttribute(attribute, scope)) continue;\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found dynamic branch prop \"${name}\" on a gt-vue <${component}> component`,\n 'Use a static primitive branch prop or a static named slot'\n );\n continue;\n }\n branches[name] =\n value.value == null || typeof value.value === 'boolean'\n ? []\n : String(value.value);\n }\n}\n\nfunction isBranchPropName(name: string): boolean {\n return !(\n NON_BRANCH_PROP_NAMES.has(name) ||\n name.startsWith('aria-') ||\n name.startsWith('data-') ||\n /^on[^a-z]/.test(name)\n );\n}\n\nfunction isStaticallyNonBranchAttribute(\n attribute: babel.JSXAttribute,\n scope: Scope\n): boolean {\n const expression =\n attribute.value?.type === 'JSXExpressionContainer' &&\n attribute.value.expression.type !== 'JSXEmptyExpression'\n ? unwrapExpression(attribute.value.expression)\n : undefined;\n if (!expression) return false;\n if (expression.type === 'Identifier' && expression.name === 'undefined') {\n return !scope.hasBinding('undefined');\n }\n return (\n expression.type === 'ArrayExpression' ||\n expression.type === 'ArrowFunctionExpression' ||\n expression.type === 'ClassExpression' ||\n expression.type === 'FunctionExpression' ||\n expression.type === 'JSXElement' ||\n expression.type === 'JSXFragment' ||\n expression.type === 'NewExpression' ||\n expression.type === 'ObjectExpression' ||\n expression.type === 'RegExpLiteral' ||\n (expression.type === 'UnaryExpression' && expression.operator === 'void')\n );\n}\n\nfunction hasExplicitAttribute(\n element: babel.JSXOpeningElement,\n name: string\n): boolean {\n return element.attributes.some(\n (attribute) =>\n attribute.type === 'JSXAttribute' &&\n readAttributeName(attribute.name) === name\n );\n}\n\nfunction isMeaningfulJSXChild(\n child: babel.JSXElement['children'][number]\n): boolean {\n if (child.type === 'JSXText') return normalizeJSXText(child.value) !== '';\n return !(\n child.type === 'JSXExpressionContainer' &&\n child.expression.type === 'JSXEmptyExpression'\n );\n}\n\nfunction validateVariableElement(\n element: babel.JSXElement,\n component: 'Currency' | 'DateTime' | 'Num' | 'Var',\n context: VueExtractionContext\n): void {\n if (context.validatedVariableComponents.has(element)) return;\n context.validatedVariableComponents.add(element);\n\n const explicitProps = new Set<string>();\n let hasSpread = false;\n for (const attribute of element.openingElement.attributes) {\n if (attribute.type === 'JSXSpreadAttribute') {\n hasSpread = true;\n } else {\n explicitProps.add(readAttributeName(attribute.name));\n }\n }\n if (hasSpread) {\n addVueError(\n context,\n babelLocation(element.openingElement.loc),\n `Found a spread prop on a gt-vue <${component}> component`,\n 'Pass variable component props explicitly'\n );\n }\n if (component === 'Var') {\n for (const prop of ['name', 'value']) {\n if (!explicitProps.has(prop)) continue;\n addVueError(\n context,\n babelLocation(element.openingElement.loc),\n `Found unsupported ${prop} prop on a gt-vue <Var> component`,\n 'Pass the variable as the default child of <Var>'\n );\n }\n return;\n }\n if (!explicitProps.has('value')) {\n addVueError(\n context,\n babelLocation(element.openingElement.loc),\n `Found a gt-vue <${component}> component without a value prop`,\n `Pass the runtime value through <${component} value={value} />`\n );\n }\n if (hasMeaningfulChildren(element.children)) {\n addVueError(\n context,\n babelLocation(element.loc),\n `Found children on a gt-vue <${component}> component`,\n `Use only the required value prop: <${component} value={value} />`\n );\n }\n}\n\nfunction hasMeaningfulChildren(\n children: babel.JSXElement['children']\n): boolean {\n return children.some((child) => {\n if (child.type === 'JSXText') return normalizeJSXText(child.value) !== '';\n return !(\n child.type === 'JSXExpressionContainer' &&\n child.expression.type === 'JSXEmptyExpression'\n );\n });\n}\n\nfunction validateElementAttributes(\n element: babel.JSXOpeningElement,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): void {\n const seenContentProps = new Set<string>();\n for (const attribute of element.attributes) {\n if (attribute.type === 'JSXSpreadAttribute') {\n addVueError(\n context,\n babelLocation(attribute.loc),\n 'Found a spread prop inside a gt-vue <T> component in JSX',\n 'Pass props by static name so their effect on the translation source is known'\n );\n continue;\n }\n const name = readAttributeName(attribute.name);\n if (isVueJSXDirectiveName(name) && !isSlotsAttribute(attribute)) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found Vue JSX directive \"${name}\" inside a gt-vue <T> component`,\n 'Move the directive outside <T> so the translated VNode source stays static'\n );\n continue;\n }\n if (name === 'innerHTML' || name === 'textContent') {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found source-shaping prop \"${name}\" inside a gt-vue <T> component`,\n 'Use static JSX children instead'\n );\n continue;\n }\n const contentProp = (\n Object.values(HTML_CONTENT_PROPS) as readonly string[]\n ).includes(name);\n if (!contentProp) continue;\n if (seenContentProps.has(name)) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found duplicate translatable prop \"${name}\" inside a gt-vue <T> component`,\n 'Pass each translatable element prop once so Vue JSX compiler options cannot change which value is hashed'\n );\n continue;\n }\n seenContentProps.add(name);\n const value = readJSXAttributePrimitive(attribute, scope, analysis);\n if (!value.ok) {\n addVueError(\n context,\n babelLocation(attribute.loc),\n `Found dynamic translatable prop \"${name}\" inside a gt-vue <T> component`,\n 'Use a static string for translatable element props'\n );\n }\n }\n}\n\nfunction isVueJSXDirectiveName(name: string): boolean {\n return /^v(?:-|[A-Z])/.test(name);\n}\n\nfunction readContentProps(\n element: babel.JSXOpeningElement,\n scope: Scope,\n context: VueExtractionContext,\n analysis: VueJSXAnalysis\n): GTProp {\n const data: GTProp = {};\n const entries = Object.entries(HTML_CONTENT_PROPS);\n for (const attribute of element.attributes) {\n if (attribute.type !== 'JSXAttribute') continue;\n const name = readAttributeName(attribute.name);\n const entry = entries.find(([, propName]) => propName === name);\n if (!entry) continue;\n const value = readJSXAttributePrimitive(attribute, scope, analysis);\n if (value.ok && typeof value.value === 'string') {\n (data as Record<string, unknown>)[entry[0]] = value.value;\n } else if (!value.ok) {\n // validateElementAttributes owns the single user-facing diagnostic.\n void context;\n }\n }\n return data;\n}\n\nfunction readJSXAttributePrimitive(\n attribute: babel.JSXAttribute,\n scope: Scope,\n analysis: VueJSXAnalysis\n): StaticPrimitiveResult {\n if (!attribute.value) return { ok: true, value: true };\n if (attribute.value.type === 'StringLiteral') {\n return { ok: true, value: normalizeJSXText(attribute.value.value) };\n }\n if (\n attribute.value.type !== 'JSXExpressionContainer' ||\n attribute.value.expression.type === 'JSXEmptyExpression'\n ) {\n return { ok: false };\n }\n return analysis.readStaticPrimitive(attribute.value.expression, scope);\n}\n\nfunction resolveElementIdentity(\n name: babel.JSXElement['openingElement']['name'],\n scope: Scope,\n analysis: VueJSXAnalysis\n): KnownValue | undefined {\n const expression = jsxNameToExpression(name);\n return expression ? analysis.resolveKnownValue(expression, scope) : undefined;\n}\n\nfunction jsxNameToExpression(\n name: babel.JSXElement['openingElement']['name']\n): babel.Expression | undefined {\n if (name.type === 'JSXIdentifier') return babel.identifier(name.name);\n if (name.type === 'JSXNamespacedName') return undefined;\n const object = jsxMemberObjectToExpression(name.object);\n return object\n ? babel.memberExpression(object, babel.identifier(name.property.name))\n : undefined;\n}\n\nfunction jsxMemberObjectToExpression(\n object: babel.JSXMemberExpression['object']\n): babel.Expression | undefined {\n if (object.type === 'JSXIdentifier') return babel.identifier(object.name);\n const parent = jsxMemberObjectToExpression(object.object);\n return parent\n ? babel.memberExpression(parent, babel.identifier(object.property.name))\n : undefined;\n}\n\nfunction isLiteralFragment(\n name: babel.JSXElement['openingElement']['name']\n): boolean {\n // Vue's JSX transforms (verified in 1.4 and 3.0) select the Fragment helper\n // before checking lexical bindings. Consequently literal `<Fragment>` is\n // transparent even when source code declares a same-named local binding.\n return name.type === 'JSXIdentifier' && name.name === 'Fragment';\n}\n\n/** Matches only Fragment spellings the Vue JSX transform keeps transparent. */\nfunction isTransparentFragment(\n name: babel.JSXElement['openingElement']['name'],\n identity: KnownValue | undefined\n): boolean {\n return (\n isLiteralFragment(name) ||\n (identity?.type === 'vue-builtin' &&\n identity.name === 'Fragment' &&\n name.type === 'JSXMemberExpression' &&\n name.property.name === 'Fragment')\n );\n}\n\n/** Detects tags whose VNode type can change with plugin `isCustomElement`. */\nfunction isUnboundNonNativeElement(\n name: babel.JSXElement['openingElement']['name'],\n scope: Scope\n): boolean {\n if (name.type === 'JSXIdentifier') {\n return (\n name.name !== 'Fragment' &&\n !isNativeElement(name) &&\n !scope.hasBinding(name.name)\n );\n }\n if (name.type === 'JSXNamespacedName') return true;\n let object = name.object;\n while (object.type === 'JSXMemberExpression') object = object.object;\n return !scope.hasBinding(object.name);\n}\n\nfunction isNativeElement(\n name: babel.JSXElement['openingElement']['name']\n): boolean {\n return (\n name.type === 'JSXIdentifier' &&\n (isHTMLTag(name.name) || isSVGTag(name.name))\n );\n}\n\n/** Proves whether a non-GT JSX tag is traversable or slot-opaque. */\nfunction resolveOrdinaryElementShape(\n name: babel.JSXElement['openingElement']['name'],\n scope: Scope,\n analysis: VueJSXAnalysis,\n seen: Set<babel.Node>\n): OrdinaryElementShape | undefined {\n if (isNativeElement(name)) {\n return { opaque: false, tag: (name as babel.JSXIdentifier).name };\n }\n if (name.type === 'JSXNamespacedName') return undefined;\n if (name.type === 'JSXMemberExpression') {\n let root = name.object;\n while (root.type === 'JSXMemberExpression') root = root.object;\n const binding = scope.getBinding(root.name);\n return binding?.path.isImportSpecifier() ||\n binding?.path.isImportDefaultSpecifier() ||\n binding?.path.isImportNamespaceSpecifier()\n ? { opaque: true }\n : undefined;\n }\n const binding = scope.getBinding(name.name);\n if (!binding) return undefined;\n if (\n binding.path.isImportSpecifier() ||\n binding.path.isImportDefaultSpecifier() ||\n binding.path.isImportNamespaceSpecifier() ||\n binding.path.isFunctionDeclaration() ||\n binding.path.isClassDeclaration()\n ) {\n return { opaque: true };\n }\n const declaration = binding.path.node;\n return declaration.type === 'VariableDeclarator' && declaration.init\n ? resolveOrdinaryElementExpression(\n declaration.init,\n binding.path.scope,\n analysis,\n seen\n )\n : undefined;\n}\n\n/** Classifies a retained tag expression without executing application code. */\nfunction resolveOrdinaryElementExpression(\n input: babel.Expression,\n scope: Scope,\n analysis: VueJSXAnalysis,\n seen: Set<babel.Node>\n): OrdinaryElementShape | undefined {\n const expression = unwrapExpression(input);\n if (!expression || seen.has(expression)) return undefined;\n const nextSeen = new Set(seen);\n nextSeen.add(expression);\n\n const primitive = analysis.readStaticPrimitive(expression, scope);\n if (primitive.ok) {\n return typeof primitive.value === 'string'\n ? { opaque: false, tag: primitive.value }\n : undefined;\n }\n if (\n expression.type === 'ArrowFunctionExpression' ||\n expression.type === 'FunctionExpression' ||\n expression.type === 'ClassExpression' ||\n expression.type === 'ObjectExpression'\n ) {\n return { opaque: true };\n }\n if (expression.type === 'Identifier') {\n const binding = scope.getBinding(expression.name);\n if (!binding) return undefined;\n if (\n binding.path.isImportSpecifier() ||\n binding.path.isImportDefaultSpecifier() ||\n binding.path.isImportNamespaceSpecifier() ||\n binding.path.isFunctionDeclaration() ||\n binding.path.isClassDeclaration()\n ) {\n return { opaque: true };\n }\n const declaration = binding.path.node;\n return declaration.type === 'VariableDeclarator' && declaration.init\n ? resolveOrdinaryElementExpression(\n declaration.init,\n binding.path.scope,\n analysis,\n nextSeen\n )\n : undefined;\n }\n if (\n expression.type === 'CallExpression' ||\n expression.type === 'OptionalCallExpression'\n ) {\n if (expression.callee.type === 'V8IntrinsicIdentifier') return undefined;\n const callee = analysis.resolveKnownValue(expression.callee, scope);\n if (callee?.type === 'defineComponent') return { opaque: true };\n const argument = expression.arguments[0];\n return callee?.type === 'identity' &&\n expression.arguments.length === 1 &&\n argument &&\n argument.type !== 'SpreadElement' &&\n argument.type !== 'ArgumentPlaceholder'\n ? resolveOrdinaryElementExpression(argument, scope, analysis, nextSeen)\n : undefined;\n }\n if (expression.type === 'ConditionalExpression') {\n return mergeOrdinaryElementShapes(\n resolveOrdinaryElementExpression(\n expression.consequent,\n scope,\n analysis,\n nextSeen\n ),\n resolveOrdinaryElementExpression(\n expression.alternate,\n scope,\n analysis,\n nextSeen\n )\n );\n }\n if (expression.type === 'LogicalExpression') {\n return mergeOrdinaryElementShapes(\n resolveOrdinaryElementExpression(\n expression.left,\n scope,\n analysis,\n nextSeen\n ),\n resolveOrdinaryElementExpression(\n expression.right,\n scope,\n analysis,\n nextSeen\n )\n );\n }\n if (expression.type === 'SequenceExpression') {\n const last = expression.expressions.at(-1);\n return last\n ? resolveOrdinaryElementExpression(last, scope, analysis, nextSeen)\n : undefined;\n }\n return undefined;\n}\n\n/** Combines alternate tags only when they preserve traversal semantics. */\nfunction mergeOrdinaryElementShapes(\n left: OrdinaryElementShape | undefined,\n right: OrdinaryElementShape | undefined\n): OrdinaryElementShape | undefined {\n if (!left || !right || left.opaque !== right.opaque) return undefined;\n return {\n opaque: left.opaque,\n ...(left.tag === right.tag && left.tag !== undefined && { tag: left.tag }),\n };\n}\n\nfunction readElementDisplayName(\n name: babel.JSXElement['openingElement']['name']\n): string | undefined {\n if (name.type === 'JSXIdentifier') return name.name;\n if (name.type === 'JSXNamespacedName') return undefined;\n const object = readMemberDisplayName(name.object);\n return object ? `${object}.${name.property.name}` : undefined;\n}\n\nfunction readMemberDisplayName(\n object: babel.JSXMemberExpression['object']\n): string | undefined {\n if (object.type === 'JSXIdentifier') return object.name;\n const parent = readMemberDisplayName(object.object);\n return parent ? `${parent}.${object.property.name}` : undefined;\n}\n\nfunction readAttributeName(name: babel.JSXAttribute['name']): string {\n return name.type === 'JSXIdentifier'\n ? name.name\n : `${name.namespace.name}:${name.name.name}`;\n}\n\n/** Mirrors `@vue/babel-plugin-jsx`'s JSX text and string-prop transform. */\nfunction normalizeJSXText(text: string): string {\n const lines = text.split(/\\r\\n|\\n|\\r/);\n let lastNonEmptyLine = 0;\n for (let index = 0; index < lines.length; index += 1) {\n if (/[^ \\t]/.test(lines[index]!)) lastNonEmptyLine = index;\n }\n\n let result = '';\n for (let index = 0; index < lines.length; index += 1) {\n const isFirstLine = index === 0;\n const isLastLine = index === lines.length - 1;\n const isLastNonEmptyLine = index === lastNonEmptyLine;\n let line = lines[index]!.replace(/\\t/g, ' ');\n if (!isFirstLine) line = line.replace(/^ +/, '');\n if (!isLastLine) line = line.replace(/ +$/, '');\n if (!line) continue;\n if (!isLastNonEmptyLine) line += ' ';\n result += line;\n }\n return result;\n}\n\nfunction appendSerializedChild(result: JsxChild[], child: JsxChild): void {\n const previous = result.at(-1);\n if (typeof previous === 'string' && typeof child === 'string') {\n result[result.length - 1] = previous + child;\n } else {\n result.push(child);\n }\n}\n\nfunction collapseChildren(children: JsxChild[]): JsxChildren {\n return children.length === 1 ? children[0]! : children;\n}\n"],"mappings":";;;;;;AAkEA,MAAM,mBAAmB,IAAI,IAAI,CAAC,OAAO,MAAM,CAAC;AAChD,MAAM,oBAAoB,IAAI,IAAqB;CACjD;CACA;CACA;CACD,CAAC;AACF,MAAM,wBAAwB,IAAI,IAAI;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;;;;;;;;AAUF,SAAgB,yBACd,MACA,SACA,UACM;AACN,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AI,OAAO,SAAS,gBAAiB,QAAO,OAAO;CACnD,MAAM,SAAS,sBAAsB,OAAO,OAAO;AACnD,QAAO,SAAS,GAAG,OAAO,GAAG,OAAO,SAAS,SAAS,KAAA;;AAGxD,SAAS,kBAAkB,MAA0C;AACnE,QAAO,KAAK,SAAS,kBACjB,KAAK,OACL,GAAG,KAAK,UAAU,KAAK,GAAG,KAAK,KAAK;;;AAI1C,SAAS,iBAAiB,MAAsB;CAC9C,MAAM,QAAQ,KAAK,MAAM,aAAa;CACtC,IAAI,mBAAmB;AACvB,MAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,EACjD,KAAI,SAAS,KAAK,MAAM,OAAQ,CAAE,oBAAmB;CAGvD,IAAI,SAAS;AACb,MAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG;EACpD,MAAM,cAAc,UAAU;EAC9B,MAAM,aAAa,UAAU,MAAM,SAAS;EAC5C,MAAM,qBAAqB,UAAU;EACrC,IAAI,OAAO,MAAM,OAAQ,QAAQ,OAAO,IAAI;AAC5C,MAAI,CAAC,YAAa,QAAO,KAAK,QAAQ,OAAO,GAAG;AAChD,MAAI,CAAC,WAAY,QAAO,KAAK,QAAQ,OAAO,GAAG;AAC/C,MAAI,CAAC,KAAM;AACX,MAAI,CAAC,mBAAoB,SAAQ;AACjC,YAAU;;AAEZ,QAAO;;AAGT,SAAS,sBAAsB,QAAoB,OAAuB;CACxE,MAAM,WAAW,OAAO,GAAG,GAAG;AAC9B,KAAI,OAAO,aAAa,YAAY,OAAO,UAAU,SACnD,QAAO,OAAO,SAAS,KAAK,WAAW;KAEvC,QAAO,KAAK,MAAM;;AAItB,SAAS,iBAAiB,UAAmC;AAC3D,QAAO,SAAS,WAAW,IAAI,SAAS,KAAM"}
@@ -0,0 +1,14 @@
1
+ import type { GTComponentName, VueBuiltinName } from '../types.js';
2
+ import type { KnownValue } from './model.js';
3
+ /** Public gt-vue component exports recognized by script analysis. */
4
+ export declare const COMPONENT_IMPORTS: Set<GTComponentName>;
5
+ /** Vue exports whose exact runtime identity changes rich traversal. */
6
+ export declare const VUE_BUILTIN_IMPORTS: Set<VueBuiltinName>;
7
+ /** Array methods that do not mutate the receiver's retained identity. */
8
+ export declare const READONLY_ARRAY_TRANSFORMS: Set<string>;
9
+ /** Unbound globals whose values cannot be gt-vue translation identities. */
10
+ export declare const ORDINARY_GLOBAL_VALUES: Set<string>;
11
+ /** Returns the recognized identity of one gt-vue or Vue export. */
12
+ export declare function knownExport(source: 'gt-vue' | 'vue', name: string): KnownValue | undefined;
13
+ /** Produces a stable equality key for recognized runtime identities. */
14
+ export declare function knownValueKey(value: KnownValue): string;
@@ -0,0 +1,148 @@
1
+ //#region src/internal/script/knownValues.ts
2
+ /** Public gt-vue component exports recognized by script analysis. */
3
+ const COMPONENT_IMPORTS = new Set([
4
+ "T",
5
+ "Var",
6
+ "Num",
7
+ "DateTime",
8
+ "Currency",
9
+ "Plural",
10
+ "Branch"
11
+ ]);
12
+ /** Vue exports whose exact runtime identity changes rich traversal. */
13
+ const VUE_BUILTIN_IMPORTS = new Set(["Fragment", "Suspense"]);
14
+ /** Array methods that do not mutate the receiver's retained identity. */
15
+ const READONLY_ARRAY_TRANSFORMS = new Set([
16
+ "at",
17
+ "concat",
18
+ "entries",
19
+ "every",
20
+ "filter",
21
+ "find",
22
+ "findIndex",
23
+ "findLast",
24
+ "findLastIndex",
25
+ "flat",
26
+ "flatMap",
27
+ "forEach",
28
+ "includes",
29
+ "indexOf",
30
+ "join",
31
+ "keys",
32
+ "lastIndexOf",
33
+ "map",
34
+ "reduce",
35
+ "reduceRight",
36
+ "slice",
37
+ "some",
38
+ "toReversed",
39
+ "toSorted",
40
+ "toSpliced",
41
+ "values",
42
+ "with"
43
+ ]);
44
+ /** Unbound globals whose values cannot be gt-vue translation identities. */
45
+ const ORDINARY_GLOBAL_VALUES = new Set([
46
+ "Array",
47
+ "BigInt",
48
+ "Boolean",
49
+ "Date",
50
+ "Error",
51
+ "Map",
52
+ "Number",
53
+ "Object",
54
+ "RegExp",
55
+ "Set",
56
+ "String",
57
+ "Symbol",
58
+ "WeakMap",
59
+ "WeakSet",
60
+ "undefined"
61
+ ]);
62
+ /** Returns the recognized identity of one gt-vue or Vue export. */
63
+ function knownExport(source, name) {
64
+ if (source === "vue") {
65
+ if (name === "createVNode" || name === "defineAsyncComponent" || name === "h") return {
66
+ type: "vue-call",
67
+ name
68
+ };
69
+ if (name === "defineComponent") return { type: "defineComponent" };
70
+ if (name === "markRaw") return { type: "identity" };
71
+ if (name === "unref") return {
72
+ type: "container-wrapper",
73
+ kind: "unref",
74
+ writePolicy: "forward"
75
+ };
76
+ if (name === "toRaw") return {
77
+ type: "container-wrapper",
78
+ kind: "to-raw",
79
+ writePolicy: "forward"
80
+ };
81
+ if (name === "computed") return {
82
+ type: "vue-wrapper",
83
+ kind: "computed"
84
+ };
85
+ if (name === "ref" || name === "shallowRef") return {
86
+ type: "vue-wrapper",
87
+ kind: "ref"
88
+ };
89
+ if (name === "readonly") return {
90
+ type: "container-wrapper",
91
+ kind: "readonly",
92
+ writePolicy: "readonly-deep"
93
+ };
94
+ if (name === "shallowReadonly") return {
95
+ type: "container-wrapper",
96
+ kind: "shallow-readonly",
97
+ writePolicy: "readonly-shallow"
98
+ };
99
+ if (name === "reactive") return {
100
+ type: "container-wrapper",
101
+ kind: "reactive",
102
+ writePolicy: "forward"
103
+ };
104
+ if (name === "shallowReactive") return {
105
+ type: "container-wrapper",
106
+ kind: "shallow-reactive",
107
+ writePolicy: "forward"
108
+ };
109
+ return VUE_BUILTIN_IMPORTS.has(name) ? {
110
+ type: "vue-builtin",
111
+ name
112
+ } : void 0;
113
+ }
114
+ if (COMPONENT_IMPORTS.has(name)) return {
115
+ type: "component",
116
+ name
117
+ };
118
+ if (name === "msg") return {
119
+ type: "string",
120
+ kind: "msg"
121
+ };
122
+ if (name === "useGT") return {
123
+ type: "hook",
124
+ kind: "gt"
125
+ };
126
+ if (name === "useMessages") return {
127
+ type: "hook",
128
+ kind: "messages"
129
+ };
130
+ }
131
+ /** Produces a stable equality key for recognized runtime identities. */
132
+ function knownValueKey(value) {
133
+ if (value.type === "component") return `component:${value.name}`;
134
+ if (value.type === "hook") return `hook:${value.kind}`;
135
+ if (value.type === "string") return `string:${value.kind}`;
136
+ if (value.type === "namespace") return `namespace:${value.source}`;
137
+ if (value.type === "local-namespace") return `local-namespace:${value.modulePath}`;
138
+ if (value.type === "vue-builtin") return `vue-builtin:${value.name}`;
139
+ if (value.type === "vue-call") return `vue-call:${value.name}`;
140
+ if (value.type === "vue-wrapper") return `vue-wrapper:${value.kind}`;
141
+ if (value.type === "container-wrapper") return `container-wrapper:${value.kind}`;
142
+ if (value.type === "identity") return "identity";
143
+ return "defineComponent";
144
+ }
145
+ //#endregion
146
+ export { COMPONENT_IMPORTS, ORDINARY_GLOBAL_VALUES, READONLY_ARRAY_TRANSFORMS, VUE_BUILTIN_IMPORTS, knownExport, knownValueKey };
147
+
148
+ //# sourceMappingURL=knownValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knownValues.js","names":[],"sources":["../../../src/internal/script/knownValues.ts"],"sourcesContent":["import type { GTComponentName, VueBuiltinName } from '../types.js';\nimport type { KnownValue } from './model.js';\n\n/** Public gt-vue component exports recognized by script analysis. */\nexport const COMPONENT_IMPORTS = new Set<GTComponentName>([\n 'T',\n 'Var',\n 'Num',\n 'DateTime',\n 'Currency',\n 'Plural',\n 'Branch',\n]);\n\n/** Vue exports whose exact runtime identity changes rich traversal. */\nexport const VUE_BUILTIN_IMPORTS = new Set<VueBuiltinName>([\n 'Fragment',\n 'Suspense',\n]);\n\n/** Array methods that do not mutate the receiver's retained identity. */\nexport const READONLY_ARRAY_TRANSFORMS = new Set([\n 'at',\n 'concat',\n 'entries',\n 'every',\n 'filter',\n 'find',\n 'findIndex',\n 'findLast',\n 'findLastIndex',\n 'flat',\n 'flatMap',\n 'forEach',\n 'includes',\n 'indexOf',\n 'join',\n 'keys',\n 'lastIndexOf',\n 'map',\n 'reduce',\n 'reduceRight',\n 'slice',\n 'some',\n 'toReversed',\n 'toSorted',\n 'toSpliced',\n 'values',\n 'with',\n]);\n\n/** Unbound globals whose values cannot be gt-vue translation identities. */\nexport const ORDINARY_GLOBAL_VALUES = new Set([\n 'Array',\n 'BigInt',\n 'Boolean',\n 'Date',\n 'Error',\n 'Map',\n 'Number',\n 'Object',\n 'RegExp',\n 'Set',\n 'String',\n 'Symbol',\n 'WeakMap',\n 'WeakSet',\n 'undefined',\n]);\n\n/** Returns the recognized identity of one gt-vue or Vue export. */\nexport function knownExport(\n source: 'gt-vue' | 'vue',\n name: string\n): KnownValue | undefined {\n if (source === 'vue') {\n if (\n name === 'createVNode' ||\n name === 'defineAsyncComponent' ||\n name === 'h'\n ) {\n return { type: 'vue-call', name };\n }\n if (name === 'defineComponent') return { type: 'defineComponent' };\n if (name === 'markRaw') return { type: 'identity' };\n if (name === 'unref') {\n return {\n type: 'container-wrapper',\n kind: 'unref',\n writePolicy: 'forward',\n };\n }\n if (name === 'toRaw') {\n return {\n type: 'container-wrapper',\n kind: 'to-raw',\n writePolicy: 'forward',\n };\n }\n if (name === 'computed') return { type: 'vue-wrapper', kind: 'computed' };\n if (name === 'ref' || name === 'shallowRef') {\n return { type: 'vue-wrapper', kind: 'ref' };\n }\n if (name === 'readonly') {\n return {\n type: 'container-wrapper',\n kind: 'readonly',\n writePolicy: 'readonly-deep',\n };\n }\n if (name === 'shallowReadonly') {\n return {\n type: 'container-wrapper',\n kind: 'shallow-readonly',\n writePolicy: 'readonly-shallow',\n };\n }\n if (name === 'reactive') {\n return {\n type: 'container-wrapper',\n kind: 'reactive',\n writePolicy: 'forward',\n };\n }\n if (name === 'shallowReactive') {\n return {\n type: 'container-wrapper',\n kind: 'shallow-reactive',\n writePolicy: 'forward',\n };\n }\n return VUE_BUILTIN_IMPORTS.has(name as VueBuiltinName)\n ? { type: 'vue-builtin', name: name as VueBuiltinName }\n : undefined;\n }\n if (COMPONENT_IMPORTS.has(name as GTComponentName)) {\n return { type: 'component', name: name as GTComponentName };\n }\n if (name === 'msg') return { type: 'string', kind: 'msg' };\n if (name === 'useGT') return { type: 'hook', kind: 'gt' };\n if (name === 'useMessages') return { type: 'hook', kind: 'messages' };\n return undefined;\n}\n\n/** Produces a stable equality key for recognized runtime identities. */\nexport function knownValueKey(value: KnownValue): string {\n if (value.type === 'component') return `component:${value.name}`;\n if (value.type === 'hook') return `hook:${value.kind}`;\n if (value.type === 'string') return `string:${value.kind}`;\n if (value.type === 'namespace') return `namespace:${value.source}`;\n if (value.type === 'local-namespace') {\n return `local-namespace:${value.modulePath}`;\n }\n if (value.type === 'vue-builtin') return `vue-builtin:${value.name}`;\n if (value.type === 'vue-call') return `vue-call:${value.name}`;\n if (value.type === 'vue-wrapper') return `vue-wrapper:${value.kind}`;\n if (value.type === 'container-wrapper') {\n return `container-wrapper:${value.kind}`;\n }\n if (value.type === 'identity') return 'identity';\n return 'defineComponent';\n}\n"],"mappings":";;AAIA,MAAa,oBAAoB,IAAI,IAAqB;CACxD;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;AAGF,MAAa,sBAAsB,IAAI,IAAoB,CACzD,YACA,WACD,CAAC;;AAGF,MAAa,4BAA4B,IAAI,IAAI;CAC/C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;AAGF,MAAa,yBAAyB,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;;AAGF,SAAgB,YACd,QACA,MACwB;AACxB,KAAI,WAAW,OAAO;AACpB,MACE,SAAS,iBACT,SAAS,0BACT,SAAS,IAET,QAAO;GAAE,MAAM;GAAY;GAAM;AAEnC,MAAI,SAAS,kBAAmB,QAAO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MAAM,SAAS,cAAe,QAAO,eAAe,MAAM;AAC9D,KAAI,MAAM,SAAS,WAAY,QAAO,YAAY,MAAM;AACxD,KAAI,MAAM,SAAS,cAAe,QAAO,eAAe,MAAM;AAC9D,KAAI,MAAM,SAAS,oBACjB,QAAO,qBAAqB,MAAM;AAEpC,KAAI,MAAM,SAAS,WAAY,QAAO;AACtC,QAAO"}
@@ -0,0 +1,80 @@
1
+ import { type Scope } from '@babel/traverse';
2
+ import type * as t from '@babel/types';
3
+ import type { VueExtractionOptions } from '../../types.js';
4
+ type ExternalModuleName = 'gt-vue' | 'vue';
5
+ type DeclaredExport = {
6
+ type: 'expression';
7
+ node: t.Node;
8
+ } | {
9
+ type: 'local';
10
+ name: string;
11
+ } | {
12
+ type: 'namespace';
13
+ source: string;
14
+ } | {
15
+ type: 'reexport';
16
+ importedName: string;
17
+ source: string;
18
+ };
19
+ type ImportedBinding = {
20
+ importedName: string | '*';
21
+ source: string;
22
+ };
23
+ /** One parsed local source module used exclusively for static analysis. */
24
+ export type LocalModuleRecord = {
25
+ ast: t.File;
26
+ explicitExports: Map<string, DeclaredExport | 'ambiguous'>;
27
+ filePath: string;
28
+ imports: Map<string, ImportedBinding>;
29
+ programScope: Scope;
30
+ starExports: string[];
31
+ };
32
+ /** A statically resolved ESM export without executing project code. */
33
+ export type LocalExportTarget = {
34
+ exportName: string;
35
+ originKey: string;
36
+ record: LocalModuleRecord;
37
+ type: 'local';
38
+ } | {
39
+ node: t.Node;
40
+ originKey: string;
41
+ record: LocalModuleRecord;
42
+ type: 'expression';
43
+ } | {
44
+ exportName: string;
45
+ originKey: string;
46
+ source: ExternalModuleName;
47
+ type: 'external';
48
+ } | {
49
+ originKey: string;
50
+ source: ExternalModuleName;
51
+ type: 'external-namespace';
52
+ } | {
53
+ modulePath: string;
54
+ originKey: string;
55
+ type: 'namespace';
56
+ };
57
+ /** Result of resolving one named export through a local ESM graph. */
58
+ export type LocalExportResolution = {
59
+ status: 'absent' | 'ambiguous' | 'invalid';
60
+ } | {
61
+ status: 'resolved';
62
+ target: LocalExportTarget;
63
+ };
64
+ /** Read-only local source resolver used by the Vue script analyzer. */
65
+ export type LocalModuleResolver = {
66
+ getRecord(filePath: string): LocalModuleRecord | undefined;
67
+ /** Whether the caller supplied project-specific bare-specifier semantics. */
68
+ hasCustomResolver: boolean;
69
+ listExportNames(filePath: string): string[];
70
+ resolveExport(filePath: string, exportName: string): LocalExportResolution;
71
+ resolveModule(importer: string, specifier: string): string | undefined;
72
+ };
73
+ /**
74
+ * Creates a cycle-safe ESM resolver for local source files and index barrels.
75
+ *
76
+ * The resolver reads and parses source text but never imports or executes it.
77
+ * Bare aliases are accepted only through the caller's explicit resolver hook.
78
+ */
79
+ export declare function createLocalModuleResolver(resolveModuleOption: VueExtractionOptions['resolveModule']): LocalModuleResolver;
80
+ export {};