@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,364 @@
1
+ import { parseScriptAst } from "./parser.js";
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import traverseModule from "@babel/traverse";
5
+ //#region src/internal/script/localModules.ts
6
+ const traverse = traverseModule.default || traverseModule;
7
+ const SOURCE_EXTENSIONS = [
8
+ ".ts",
9
+ ".tsx",
10
+ ".js",
11
+ ".jsx",
12
+ ".mts",
13
+ ".mjs",
14
+ ".cts",
15
+ ".cjs",
16
+ ".vue"
17
+ ];
18
+ const GT_EXPORT_NAMES = [
19
+ "T",
20
+ "Var",
21
+ "Num",
22
+ "DateTime",
23
+ "Currency",
24
+ "Plural",
25
+ "Branch",
26
+ "msg",
27
+ "useGT",
28
+ "useMessages"
29
+ ];
30
+ const VUE_EXPORT_NAMES = [
31
+ "Suspense",
32
+ "computed",
33
+ "createVNode",
34
+ "defineComponent",
35
+ "defineAsyncComponent",
36
+ "Fragment",
37
+ "h",
38
+ "markRaw",
39
+ "reactive",
40
+ "readonly",
41
+ "ref",
42
+ "shallowReactive",
43
+ "shallowReadonly",
44
+ "shallowRef",
45
+ "toRaw",
46
+ "unref"
47
+ ];
48
+ /**
49
+ * Creates a cycle-safe ESM resolver for local source files and index barrels.
50
+ *
51
+ * The resolver reads and parses source text but never imports or executes it.
52
+ * Bare aliases are accepted only through the caller's explicit resolver hook.
53
+ */
54
+ function createLocalModuleResolver(resolveModuleOption) {
55
+ const records = /* @__PURE__ */ new Map();
56
+ const resolutions = /* @__PURE__ */ new Map();
57
+ const resolveModule = (importer, specifier) => {
58
+ if (specifier === "gt-vue" || specifier === "vue") return void 0;
59
+ let requested;
60
+ if (resolveModuleOption) try {
61
+ const resolved = resolveModuleOption(specifier, importer);
62
+ requested = resolved ? path.isAbsolute(resolved) ? resolved : path.resolve(path.dirname(importer), resolved) : void 0;
63
+ } catch {}
64
+ if (!requested && (specifier.startsWith(".") || path.isAbsolute(specifier))) requested = path.isAbsolute(specifier) ? specifier : path.resolve(path.dirname(importer), specifier);
65
+ return requested ? resolveSourceFile(requested) : void 0;
66
+ };
67
+ const getRecord = (filePath) => {
68
+ const normalized = path.resolve(filePath);
69
+ const cached = records.get(normalized);
70
+ if (cached !== void 0) return cached ?? void 0;
71
+ records.set(normalized, null);
72
+ const parsed = parseLocalModule(normalized);
73
+ records.set(normalized, parsed ?? null);
74
+ return parsed;
75
+ };
76
+ const resolveExportInternal = (filePath, exportName, seen) => {
77
+ const normalized = path.resolve(filePath);
78
+ const cycleKey = `${normalized}\0${exportName}`;
79
+ if (seen.has(cycleKey)) return { status: "absent" };
80
+ const record = getRecord(normalized);
81
+ if (!record) return { status: "invalid" };
82
+ const nextSeen = new Set(seen).add(cycleKey);
83
+ const explicit = record.explicitExports.get(exportName);
84
+ if (explicit === "ambiguous") return { status: "ambiguous" };
85
+ if (explicit) return resolveDeclaredExport(record, exportName, explicit, nextSeen);
86
+ if (exportName === "default") return { status: "absent" };
87
+ const candidates = [];
88
+ let invalid = false;
89
+ for (const source of record.starExports) {
90
+ const candidate = resolveFromSource(record, source, exportName, nextSeen);
91
+ if (candidate.status === "resolved") candidates.push(candidate.target);
92
+ if (candidate.status === "ambiguous") return candidate;
93
+ if (candidate.status === "invalid") invalid = true;
94
+ }
95
+ if (candidates.length === 0) return { status: invalid ? "invalid" : "absent" };
96
+ return new Set(candidates.map(({ originKey }) => originKey)).size === 1 ? {
97
+ status: "resolved",
98
+ target: candidates[0]
99
+ } : { status: "ambiguous" };
100
+ };
101
+ const resolveFromSource = (record, source, exportName, seen) => {
102
+ if (isExternalModule(source)) return knownExternalExport(source, exportName) ? {
103
+ status: "resolved",
104
+ target: {
105
+ exportName,
106
+ originKey: `${source}#${exportName}`,
107
+ source,
108
+ type: "external"
109
+ }
110
+ } : { status: "absent" };
111
+ const modulePath = resolveModule(record.filePath, source);
112
+ return modulePath ? resolveExportInternal(modulePath, exportName, seen) : { status: "invalid" };
113
+ };
114
+ const resolveDeclaredExport = (record, exportName, declared, seen) => {
115
+ if (declared.type === "reexport") return resolveFromSource(record, declared.source, declared.importedName, seen);
116
+ if (declared.type === "namespace") {
117
+ if (isExternalModule(declared.source)) return {
118
+ status: "resolved",
119
+ target: {
120
+ originKey: `${declared.source}#namespace`,
121
+ source: declared.source,
122
+ type: "external-namespace"
123
+ }
124
+ };
125
+ const modulePath = resolveModule(record.filePath, declared.source);
126
+ return modulePath ? {
127
+ status: "resolved",
128
+ target: {
129
+ modulePath,
130
+ originKey: `${modulePath}#namespace`,
131
+ type: "namespace"
132
+ }
133
+ } : { status: "invalid" };
134
+ }
135
+ if (declared.type === "local") {
136
+ const imported = record.imports.get(declared.name);
137
+ if (imported) {
138
+ if (imported.importedName === "*") {
139
+ if (isExternalModule(imported.source)) return {
140
+ status: "resolved",
141
+ target: {
142
+ originKey: `${imported.source}#namespace`,
143
+ source: imported.source,
144
+ type: "external-namespace"
145
+ }
146
+ };
147
+ const modulePath = resolveModule(record.filePath, imported.source);
148
+ return modulePath ? {
149
+ status: "resolved",
150
+ target: {
151
+ modulePath,
152
+ originKey: `${modulePath}#namespace`,
153
+ type: "namespace"
154
+ }
155
+ } : { status: "invalid" };
156
+ }
157
+ return resolveFromSource(record, imported.source, imported.importedName, seen);
158
+ }
159
+ return {
160
+ status: "resolved",
161
+ target: {
162
+ exportName: declared.name,
163
+ originKey: `${record.filePath}#local:${declared.name}`,
164
+ record,
165
+ type: "local"
166
+ }
167
+ };
168
+ }
169
+ return {
170
+ status: "resolved",
171
+ target: {
172
+ node: declared.node,
173
+ originKey: `${record.filePath}#expression:${exportName}`,
174
+ record,
175
+ type: "expression"
176
+ }
177
+ };
178
+ };
179
+ const resolveExport = (filePath, exportName) => {
180
+ const cacheKey = `${path.resolve(filePath)}\0${exportName}`;
181
+ const cached = resolutions.get(cacheKey);
182
+ if (cached) return cached;
183
+ const result = resolveExportInternal(filePath, exportName, /* @__PURE__ */ new Set());
184
+ resolutions.set(cacheKey, result);
185
+ return result;
186
+ };
187
+ const listExportNames = (filePath) => {
188
+ return [...collectExportNames(filePath, /* @__PURE__ */ new Set())].sort();
189
+ };
190
+ const collectExportNames = (filePath, seen) => {
191
+ const normalized = path.resolve(filePath);
192
+ if (seen.has(normalized)) return /* @__PURE__ */ new Set();
193
+ const record = getRecord(normalized);
194
+ if (!record) return /* @__PURE__ */ new Set();
195
+ const nextSeen = new Set(seen).add(normalized);
196
+ const names = new Set(record.explicitExports.keys());
197
+ for (const source of record.starExports) if (source === "gt-vue") for (const name of GT_EXPORT_NAMES) names.add(name);
198
+ else if (source === "vue") for (const name of VUE_EXPORT_NAMES) names.add(name);
199
+ else {
200
+ const modulePath = resolveModule(record.filePath, source);
201
+ if (!modulePath) continue;
202
+ for (const name of collectExportNames(modulePath, nextSeen)) if (name !== "default") names.add(name);
203
+ }
204
+ return names;
205
+ };
206
+ return {
207
+ getRecord,
208
+ hasCustomResolver: resolveModuleOption !== void 0,
209
+ listExportNames,
210
+ resolveExport,
211
+ resolveModule
212
+ };
213
+ }
214
+ function resolveSourceFile(requested) {
215
+ const candidates = [requested];
216
+ const extension = path.extname(requested).toLowerCase();
217
+ if (!extension) {
218
+ for (const sourceExtension of SOURCE_EXTENSIONS) candidates.push(`${requested}${sourceExtension}`);
219
+ for (const sourceExtension of SOURCE_EXTENSIONS) candidates.push(path.join(requested, `index${sourceExtension}`));
220
+ } else if ([
221
+ ".js",
222
+ ".jsx",
223
+ ".mjs"
224
+ ].includes(extension)) {
225
+ const base = requested.slice(0, -extension.length);
226
+ for (const sourceExtension of SOURCE_EXTENSIONS) candidates.push(`${base}${sourceExtension}`);
227
+ }
228
+ return candidates.find(isReadableFile);
229
+ }
230
+ function isReadableFile(filePath) {
231
+ try {
232
+ return fs.statSync(filePath).isFile();
233
+ } catch {
234
+ return false;
235
+ }
236
+ }
237
+ function parseLocalModule(filePath) {
238
+ let source;
239
+ try {
240
+ source = fs.readFileSync(filePath, "utf8");
241
+ } catch {
242
+ return;
243
+ }
244
+ const extension = path.extname(filePath).toLowerCase();
245
+ if (extension === ".cjs" || extension === ".cts") return void 0;
246
+ let language = extension.slice(1);
247
+ if (extension === ".mjs") language = "js";
248
+ if (extension === ".mts") language = "ts";
249
+ if (extension === ".vue") return void 0;
250
+ if (![
251
+ "js",
252
+ "jsx",
253
+ "ts",
254
+ "tsx"
255
+ ].includes(language)) return void 0;
256
+ let ast;
257
+ try {
258
+ ast = parseScriptAst(source, language);
259
+ } catch {
260
+ return;
261
+ }
262
+ let programScope;
263
+ traverse(ast, { Program(programPath) {
264
+ programScope = programPath.scope;
265
+ programPath.stop();
266
+ } });
267
+ if (!programScope) return void 0;
268
+ const record = {
269
+ ast,
270
+ explicitExports: /* @__PURE__ */ new Map(),
271
+ filePath,
272
+ imports: collectImportedBindings(ast),
273
+ programScope,
274
+ starExports: []
275
+ };
276
+ collectExports(record);
277
+ return record;
278
+ }
279
+ function collectImportedBindings(ast) {
280
+ const imports = /* @__PURE__ */ new Map();
281
+ for (const statement of ast.program.body) {
282
+ if (statement.type !== "ImportDeclaration" || statement.importKind === "type") continue;
283
+ for (const specifier of statement.specifiers) if (specifier.type === "ImportSpecifier" && specifier.importKind !== "type") imports.set(specifier.local.name, {
284
+ importedName: specifier.imported.type === "Identifier" ? specifier.imported.name : specifier.imported.value,
285
+ source: statement.source.value
286
+ });
287
+ else if (specifier.type === "ImportDefaultSpecifier") imports.set(specifier.local.name, {
288
+ importedName: "default",
289
+ source: statement.source.value
290
+ });
291
+ else if (specifier.type === "ImportNamespaceSpecifier") imports.set(specifier.local.name, {
292
+ importedName: "*",
293
+ source: statement.source.value
294
+ });
295
+ }
296
+ return imports;
297
+ }
298
+ function collectExports(record) {
299
+ for (const statement of record.ast.program.body) {
300
+ if (statement.type === "ExportAllDeclaration") {
301
+ if (statement.exportKind !== "type") record.starExports.push(statement.source.value);
302
+ continue;
303
+ }
304
+ if (statement.type === "ExportDefaultDeclaration") {
305
+ addExplicitExport(record, "default", {
306
+ node: statement.declaration,
307
+ type: "expression"
308
+ });
309
+ continue;
310
+ }
311
+ if (statement.type !== "ExportNamedDeclaration" || statement.exportKind === "type") continue;
312
+ if (statement.declaration) for (const name of declaredNames(statement.declaration)) addExplicitExport(record, name, {
313
+ name,
314
+ type: "local"
315
+ });
316
+ for (const specifier of statement.specifiers) {
317
+ if (specifier.type === "ExportSpecifier" && specifier.exportKind === "type") continue;
318
+ const exportedName = specifier.exported.type === "Identifier" ? specifier.exported.name : specifier.exported.value;
319
+ if (specifier.type === "ExportNamespaceSpecifier") {
320
+ if (statement.source) addExplicitExport(record, exportedName, {
321
+ source: statement.source.value,
322
+ type: "namespace"
323
+ });
324
+ continue;
325
+ }
326
+ if (specifier.type !== "ExportSpecifier") continue;
327
+ const localName = specifier.local.name;
328
+ addExplicitExport(record, exportedName, statement.source ? {
329
+ importedName: localName,
330
+ source: statement.source.value,
331
+ type: "reexport"
332
+ } : {
333
+ name: localName,
334
+ type: "local"
335
+ });
336
+ }
337
+ }
338
+ }
339
+ function addExplicitExport(record, name, value) {
340
+ record.explicitExports.set(name, record.explicitExports.has(name) ? "ambiguous" : value);
341
+ }
342
+ function declaredNames(declaration) {
343
+ if (declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") return declaration.id ? [declaration.id.name] : [];
344
+ if (declaration.type !== "VariableDeclaration") return [];
345
+ return declaration.declarations.flatMap(({ id }) => patternNames(id));
346
+ }
347
+ function patternNames(pattern) {
348
+ if (pattern.type === "Identifier") return [pattern.name];
349
+ if (pattern.type === "RestElement") return patternNames(pattern.argument);
350
+ if (pattern.type === "AssignmentPattern") return patternNames(pattern.left);
351
+ if (pattern.type === "ArrayPattern") return pattern.elements.flatMap((element) => element ? patternNames(element) : []);
352
+ if (pattern.type === "ObjectPattern") return pattern.properties.flatMap((property) => property.type === "RestElement" ? patternNames(property.argument) : patternNames(property.value));
353
+ return [];
354
+ }
355
+ function isExternalModule(source) {
356
+ return source === "gt-vue" || source === "vue";
357
+ }
358
+ function knownExternalExport(source, exportName) {
359
+ return source === "gt-vue" ? GT_EXPORT_NAMES.includes(exportName) : VUE_EXPORT_NAMES.includes(exportName);
360
+ }
361
+ //#endregion
362
+ export { createLocalModuleResolver };
363
+
364
+ //# sourceMappingURL=localModules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localModules.js","names":[],"sources":["../../../src/internal/script/localModules.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport traverseModule, { type Scope } from '@babel/traverse';\nimport type * as t from '@babel/types';\nimport type { VueExtractionOptions } from '../../types.js';\nimport { parseScriptAst } from './parser.js';\n\nconst traverse = traverseModule.default || traverseModule;\n\nconst SOURCE_EXTENSIONS = [\n '.ts',\n '.tsx',\n '.js',\n '.jsx',\n '.mts',\n '.mjs',\n '.cts',\n '.cjs',\n '.vue',\n] as const;\n\nconst GT_EXPORT_NAMES = [\n 'T',\n 'Var',\n 'Num',\n 'DateTime',\n 'Currency',\n 'Plural',\n 'Branch',\n 'msg',\n 'useGT',\n 'useMessages',\n] as const;\n\nconst VUE_EXPORT_NAMES = [\n 'Suspense',\n 'computed',\n 'createVNode',\n 'defineComponent',\n 'defineAsyncComponent',\n 'Fragment',\n 'h',\n 'markRaw',\n 'reactive',\n 'readonly',\n 'ref',\n 'shallowReactive',\n 'shallowReadonly',\n 'shallowRef',\n 'toRaw',\n 'unref',\n] as const;\n\ntype ExternalModuleName = 'gt-vue' | 'vue';\n\ntype DeclaredExport =\n | { type: 'expression'; node: t.Node }\n | { type: 'local'; name: string }\n | { type: 'namespace'; source: string }\n | { type: 'reexport'; importedName: string; source: string };\n\ntype ImportedBinding = {\n importedName: string | '*';\n source: string;\n};\n\n/** One parsed local source module used exclusively for static analysis. */\nexport type LocalModuleRecord = {\n ast: t.File;\n explicitExports: Map<string, DeclaredExport | 'ambiguous'>;\n filePath: string;\n imports: Map<string, ImportedBinding>;\n programScope: Scope;\n starExports: string[];\n};\n\n/** A statically resolved ESM export without executing project code. */\nexport type LocalExportTarget =\n | {\n exportName: string;\n originKey: string;\n record: LocalModuleRecord;\n type: 'local';\n }\n | {\n node: t.Node;\n originKey: string;\n record: LocalModuleRecord;\n type: 'expression';\n }\n | {\n exportName: string;\n originKey: string;\n source: ExternalModuleName;\n type: 'external';\n }\n | {\n originKey: string;\n source: ExternalModuleName;\n type: 'external-namespace';\n }\n | {\n modulePath: string;\n originKey: string;\n type: 'namespace';\n };\n\n/** Result of resolving one named export through a local ESM graph. */\nexport type LocalExportResolution =\n | { status: 'absent' | 'ambiguous' | 'invalid' }\n | { status: 'resolved'; target: LocalExportTarget };\n\n/** Read-only local source resolver used by the Vue script analyzer. */\nexport type LocalModuleResolver = {\n getRecord(filePath: string): LocalModuleRecord | undefined;\n /** Whether the caller supplied project-specific bare-specifier semantics. */\n hasCustomResolver: boolean;\n listExportNames(filePath: string): string[];\n resolveExport(filePath: string, exportName: string): LocalExportResolution;\n resolveModule(importer: string, specifier: string): string | undefined;\n};\n\n/**\n * Creates a cycle-safe ESM resolver for local source files and index barrels.\n *\n * The resolver reads and parses source text but never imports or executes it.\n * Bare aliases are accepted only through the caller's explicit resolver hook.\n */\nexport function createLocalModuleResolver(\n resolveModuleOption: VueExtractionOptions['resolveModule']\n): LocalModuleResolver {\n const records = new Map<string, LocalModuleRecord | null>();\n const resolutions = new Map<string, LocalExportResolution>();\n\n const resolveModule = (\n importer: string,\n specifier: string\n ): string | undefined => {\n if (specifier === 'gt-vue' || specifier === 'vue') return undefined;\n let requested: string | undefined;\n if (resolveModuleOption) {\n try {\n const resolved = resolveModuleOption(specifier, importer);\n requested = resolved\n ? path.isAbsolute(resolved)\n ? resolved\n : path.resolve(path.dirname(importer), resolved)\n : undefined;\n } catch {\n // A project resolver is advisory. Relative paths retain the safe,\n // filesystem-only fallback below when the hook cannot resolve them.\n }\n }\n if (\n !requested &&\n (specifier.startsWith('.') || path.isAbsolute(specifier))\n ) {\n requested = path.isAbsolute(specifier)\n ? specifier\n : path.resolve(path.dirname(importer), specifier);\n }\n return requested ? resolveSourceFile(requested) : undefined;\n };\n\n const getRecord = (filePath: string): LocalModuleRecord | undefined => {\n const normalized = path.resolve(filePath);\n const cached = records.get(normalized);\n if (cached !== undefined) return cached ?? undefined;\n // The sentinel also makes self-imports and parse-time cycles fail closed.\n records.set(normalized, null);\n const parsed = parseLocalModule(normalized);\n records.set(normalized, parsed ?? null);\n return parsed;\n };\n\n const resolveExportInternal = (\n filePath: string,\n exportName: string,\n seen: Set<string>\n ): LocalExportResolution => {\n const normalized = path.resolve(filePath);\n const cycleKey = `${normalized}\\0${exportName}`;\n if (seen.has(cycleKey)) return { status: 'absent' };\n const record = getRecord(normalized);\n if (!record) return { status: 'invalid' };\n const nextSeen = new Set(seen).add(cycleKey);\n const explicit = record.explicitExports.get(exportName);\n if (explicit === 'ambiguous') return { status: 'ambiguous' };\n if (explicit) {\n return resolveDeclaredExport(record, exportName, explicit, nextSeen);\n }\n if (exportName === 'default') return { status: 'absent' };\n\n const candidates: LocalExportTarget[] = [];\n let invalid = false;\n for (const source of record.starExports) {\n const candidate = resolveFromSource(record, source, exportName, nextSeen);\n if (candidate.status === 'resolved') candidates.push(candidate.target);\n if (candidate.status === 'ambiguous') return candidate;\n if (candidate.status === 'invalid') invalid = true;\n }\n if (candidates.length === 0) {\n return { status: invalid ? 'invalid' : 'absent' };\n }\n const origins = new Set(candidates.map(({ originKey }) => originKey));\n return origins.size === 1\n ? { status: 'resolved', target: candidates[0]! }\n : { status: 'ambiguous' };\n };\n\n const resolveFromSource = (\n record: LocalModuleRecord,\n source: string,\n exportName: string,\n seen: Set<string>\n ): LocalExportResolution => {\n if (isExternalModule(source)) {\n return knownExternalExport(source, exportName)\n ? {\n status: 'resolved',\n target: {\n exportName,\n originKey: `${source}#${exportName}`,\n source,\n type: 'external',\n },\n }\n : { status: 'absent' };\n }\n const modulePath = resolveModule(record.filePath, source);\n return modulePath\n ? resolveExportInternal(modulePath, exportName, seen)\n : { status: 'invalid' };\n };\n\n const resolveDeclaredExport = (\n record: LocalModuleRecord,\n exportName: string,\n declared: DeclaredExport,\n seen: Set<string>\n ): LocalExportResolution => {\n if (declared.type === 'reexport') {\n return resolveFromSource(\n record,\n declared.source,\n declared.importedName,\n seen\n );\n }\n if (declared.type === 'namespace') {\n if (isExternalModule(declared.source)) {\n return {\n status: 'resolved',\n target: {\n originKey: `${declared.source}#namespace`,\n source: declared.source,\n type: 'external-namespace',\n },\n };\n }\n const modulePath = resolveModule(record.filePath, declared.source);\n return modulePath\n ? {\n status: 'resolved',\n target: {\n modulePath,\n originKey: `${modulePath}#namespace`,\n type: 'namespace',\n },\n }\n : { status: 'invalid' };\n }\n if (declared.type === 'local') {\n const imported = record.imports.get(declared.name);\n if (imported) {\n if (imported.importedName === '*') {\n if (isExternalModule(imported.source)) {\n return {\n status: 'resolved',\n target: {\n originKey: `${imported.source}#namespace`,\n source: imported.source,\n type: 'external-namespace',\n },\n };\n }\n const modulePath = resolveModule(record.filePath, imported.source);\n return modulePath\n ? {\n status: 'resolved',\n target: {\n modulePath,\n originKey: `${modulePath}#namespace`,\n type: 'namespace',\n },\n }\n : { status: 'invalid' };\n }\n return resolveFromSource(\n record,\n imported.source,\n imported.importedName,\n seen\n );\n }\n return {\n status: 'resolved',\n target: {\n exportName: declared.name,\n originKey: `${record.filePath}#local:${declared.name}`,\n record,\n type: 'local',\n },\n };\n }\n return {\n status: 'resolved',\n target: {\n node: declared.node,\n originKey: `${record.filePath}#expression:${exportName}`,\n record,\n type: 'expression',\n },\n };\n };\n\n const resolveExport = (\n filePath: string,\n exportName: string\n ): LocalExportResolution => {\n const cacheKey = `${path.resolve(filePath)}\\0${exportName}`;\n const cached = resolutions.get(cacheKey);\n if (cached) return cached;\n const result = resolveExportInternal(filePath, exportName, new Set());\n resolutions.set(cacheKey, result);\n return result;\n };\n\n const listExportNames = (filePath: string): string[] => {\n return [...collectExportNames(filePath, new Set())].sort();\n };\n\n const collectExportNames = (\n filePath: string,\n seen: Set<string>\n ): Set<string> => {\n const normalized = path.resolve(filePath);\n if (seen.has(normalized)) return new Set();\n const record = getRecord(normalized);\n if (!record) return new Set();\n const nextSeen = new Set(seen).add(normalized);\n const names = new Set(record.explicitExports.keys());\n for (const source of record.starExports) {\n if (source === 'gt-vue') {\n for (const name of GT_EXPORT_NAMES) names.add(name);\n } else if (source === 'vue') {\n for (const name of VUE_EXPORT_NAMES) names.add(name);\n } else {\n const modulePath = resolveModule(record.filePath, source);\n if (!modulePath) continue;\n for (const name of collectExportNames(modulePath, nextSeen)) {\n if (name !== 'default') names.add(name);\n }\n }\n }\n return names;\n };\n\n return {\n getRecord,\n hasCustomResolver: resolveModuleOption !== undefined,\n listExportNames,\n resolveExport,\n resolveModule,\n };\n}\n\nfunction resolveSourceFile(requested: string): string | undefined {\n const candidates: string[] = [requested];\n const extension = path.extname(requested).toLowerCase();\n if (!extension) {\n for (const sourceExtension of SOURCE_EXTENSIONS) {\n candidates.push(`${requested}${sourceExtension}`);\n }\n for (const sourceExtension of SOURCE_EXTENSIONS) {\n candidates.push(path.join(requested, `index${sourceExtension}`));\n }\n } else if (['.js', '.jsx', '.mjs'].includes(extension)) {\n const base = requested.slice(0, -extension.length);\n for (const sourceExtension of SOURCE_EXTENSIONS) {\n candidates.push(`${base}${sourceExtension}`);\n }\n }\n return candidates.find(isReadableFile);\n}\n\nfunction isReadableFile(filePath: string): boolean {\n try {\n return fs.statSync(filePath).isFile();\n } catch {\n return false;\n }\n}\n\nfunction parseLocalModule(filePath: string): LocalModuleRecord | undefined {\n let source: string;\n try {\n source = fs.readFileSync(filePath, 'utf8');\n } catch {\n return undefined;\n }\n const extension = path.extname(filePath).toLowerCase();\n // Node treats these extensions as CommonJS regardless of package metadata.\n // Parsing ESM-looking syntax here would prove an identity the application\n // cannot actually import with ESM semantics, so both formats fail closed.\n if (extension === '.cjs' || extension === '.cts') return undefined;\n let language = extension.slice(1);\n if (extension === '.mjs') language = 'js';\n if (extension === '.mts') language = 'ts';\n // A local .vue module must be parsed with the consuming application's exact\n // compiler. The extractor deliberately fails closed here instead of\n // reintroducing a bundled-compiler mismatch through barrel resolution.\n if (extension === '.vue') return undefined;\n if (!['js', 'jsx', 'ts', 'tsx'].includes(language)) return undefined;\n\n let ast: t.File;\n try {\n ast = parseScriptAst(source, language);\n } catch {\n return undefined;\n }\n let programScope: Scope | undefined;\n traverse(ast, {\n Program(programPath) {\n programScope = programPath.scope;\n programPath.stop();\n },\n });\n if (!programScope) return undefined;\n\n const record: LocalModuleRecord = {\n ast,\n explicitExports: new Map(),\n filePath,\n imports: collectImportedBindings(ast),\n programScope,\n starExports: [],\n };\n collectExports(record);\n return record;\n}\n\nfunction collectImportedBindings(ast: t.File): Map<string, ImportedBinding> {\n const imports = new Map<string, ImportedBinding>();\n for (const statement of ast.program.body) {\n if (\n statement.type !== 'ImportDeclaration' ||\n statement.importKind === 'type'\n ) {\n continue;\n }\n for (const specifier of statement.specifiers) {\n if (\n specifier.type === 'ImportSpecifier' &&\n specifier.importKind !== 'type'\n ) {\n imports.set(specifier.local.name, {\n importedName:\n specifier.imported.type === 'Identifier'\n ? specifier.imported.name\n : specifier.imported.value,\n source: statement.source.value,\n });\n } else if (specifier.type === 'ImportDefaultSpecifier') {\n imports.set(specifier.local.name, {\n importedName: 'default',\n source: statement.source.value,\n });\n } else if (specifier.type === 'ImportNamespaceSpecifier') {\n imports.set(specifier.local.name, {\n importedName: '*',\n source: statement.source.value,\n });\n }\n }\n }\n return imports;\n}\n\nfunction collectExports(record: LocalModuleRecord): void {\n for (const statement of record.ast.program.body) {\n if (statement.type === 'ExportAllDeclaration') {\n if (statement.exportKind !== 'type') {\n record.starExports.push(statement.source.value);\n }\n continue;\n }\n if (statement.type === 'ExportDefaultDeclaration') {\n addExplicitExport(record, 'default', {\n node: statement.declaration,\n type: 'expression',\n });\n continue;\n }\n if (\n statement.type !== 'ExportNamedDeclaration' ||\n statement.exportKind === 'type'\n ) {\n continue;\n }\n if (statement.declaration) {\n for (const name of declaredNames(statement.declaration)) {\n addExplicitExport(record, name, { name, type: 'local' });\n }\n }\n for (const specifier of statement.specifiers) {\n if (\n specifier.type === 'ExportSpecifier' &&\n specifier.exportKind === 'type'\n ) {\n continue;\n }\n const exportedName =\n specifier.exported.type === 'Identifier'\n ? specifier.exported.name\n : specifier.exported.value;\n if (specifier.type === 'ExportNamespaceSpecifier') {\n if (statement.source) {\n addExplicitExport(record, exportedName, {\n source: statement.source.value,\n type: 'namespace',\n });\n }\n continue;\n }\n if (specifier.type !== 'ExportSpecifier') continue;\n const localName = specifier.local.name;\n addExplicitExport(\n record,\n exportedName,\n statement.source\n ? {\n importedName: localName,\n source: statement.source.value,\n type: 'reexport',\n }\n : { name: localName, type: 'local' }\n );\n }\n }\n}\n\nfunction addExplicitExport(\n record: LocalModuleRecord,\n name: string,\n value: DeclaredExport\n): void {\n record.explicitExports.set(\n name,\n record.explicitExports.has(name) ? 'ambiguous' : value\n );\n}\n\nfunction declaredNames(declaration: t.Declaration): string[] {\n if (\n declaration.type === 'FunctionDeclaration' ||\n declaration.type === 'ClassDeclaration'\n ) {\n return declaration.id ? [declaration.id.name] : [];\n }\n if (declaration.type !== 'VariableDeclaration') return [];\n return declaration.declarations.flatMap(({ id }) => patternNames(id));\n}\n\nfunction patternNames(pattern: t.Node): string[] {\n if (pattern.type === 'Identifier') return [pattern.name];\n if (pattern.type === 'RestElement') return patternNames(pattern.argument);\n if (pattern.type === 'AssignmentPattern') return patternNames(pattern.left);\n if (pattern.type === 'ArrayPattern') {\n return pattern.elements.flatMap((element) =>\n element ? patternNames(element) : []\n );\n }\n if (pattern.type === 'ObjectPattern') {\n return pattern.properties.flatMap((property) =>\n property.type === 'RestElement'\n ? patternNames(property.argument)\n : patternNames(property.value)\n );\n }\n return [];\n}\n\nfunction isExternalModule(source: string): source is ExternalModuleName {\n return source === 'gt-vue' || source === 'vue';\n}\n\nfunction knownExternalExport(\n source: ExternalModuleName,\n exportName: string\n): boolean {\n return source === 'gt-vue'\n ? (GT_EXPORT_NAMES as readonly string[]).includes(exportName)\n : (VUE_EXPORT_NAMES as readonly string[]).includes(exportName);\n}\n"],"mappings":";;;;;AAOA,MAAM,WAAW,eAAe,WAAW;AAE3C,MAAM,oBAAoB;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,kBAAkB;CACtB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAM,mBAAmB;CACvB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;AA6ED,SAAgB,0BACd,qBACqB;CACrB,MAAM,0BAAU,IAAI,KAAuC;CAC3D,MAAM,8BAAc,IAAI,KAAoC;CAE5D,MAAM,iBACJ,UACA,cACuB;AACvB,MAAI,cAAc,YAAY,cAAc,MAAO,QAAO,KAAA;EAC1D,IAAI;AACJ,MAAI,oBACF,KAAI;GAC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