@dialexjs/cli 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.mts +42 -39
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +1 -1
- package/dist/index.mjs +329 -395
- package/dist/index.mjs.map +1 -1
- package/dist/{project-B27699T2.mjs → project-BTpZGNjh.mjs} +232 -208
- package/dist/project-BTpZGNjh.mjs.map +1 -0
- package/package.json +2 -2
- package/dist/project-B27699T2.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-BTpZGNjh.mjs","names":["isPropLike","IDENTIFIER","unwrap","findProp","isObject","keyName","keyName","unwrap","findProp","isObject","findProp","unwrap","isObject","findProp"],"sources":["../src/utils/dictionary/types.ts","../src/utils/ast.ts","../src/utils/dictionary/ast-helpers.ts","../src/utils/dictionary/io.ts","../src/utils/dictionary/read.ts","../src/utils/dictionary/write.ts","../src/utils/dictionary/locations.ts","../src/analysis/cache.ts","../src/analysis/load-dictionary.ts","../src/utils/files.ts","../src/utils/icu-check.ts","../src/utils/lockfile.ts","../src/analysis/source-scan.ts","../src/analysis/steps.ts","../src/analysis/index.ts","../src/utils/logger.ts","../src/utils/load-config.ts","../src/utils/scanner.ts","../src/utils/message-arguments.ts","../src/utils/split-locales.ts","../src/utils/static-config.ts","../src/utils/tsconfig.ts","../src/commands/generate/render.ts","../src/commands/generate/watch.ts","../src/commands/generate/write.ts","../src/commands/generate/index.ts","../src/utils/project.ts"],"sourcesContent":["import type { loadFile } from \"magicast\";\n\nimport type { AstNode as Node } from \"../ast.js\";\n\nexport const TODO_PREFIX = \"[TODO] \";\n\nexport interface DictionaryFile {\n file: string;\n /** Dictionary name from `defineDictionary(\"name\", ...)` or the `name` property, if literal. */\n name?: string;\n mod: Awaited<ReturnType<typeof loadFile>>;\n /** The object whose keys are locales. */\n localesObj: Node;\n /** Whether the file ended with a newline when loaded; restored on save. */\n endsWithNewline: boolean;\n /**\n * `false` when part of the dictionary cannot be read statically (spreads, computed keys, or a\n * locale whose content is not an object literal). Leaf lists and parity checks are unreliable\n * for such files.\n */\n complete: boolean;\n}\n\n/** A zero-based line/column range, as used by editors. */\nexport interface SourceRange {\n start: { line: number; column: number };\n end: { line: number; column: number };\n}\n\nexport type LeafKind = \"string\" | \"function\" | \"other\";\n\nexport interface Leaf {\n path: string[];\n kind: LeafKind;\n /** Present when `kind` is `\"string\"`. */\n value?: string;\n}\n","/** A syntax-tree node as magicast (recast/babel) and oxc-style ESTree nodes both look. */\nexport type AstNode = { type: string; [key: string]: any };\n\n/** Strips `as`, `satisfies` and parentheses around an expression. */\nexport function unwrapNode(node: AstNode): AstNode {\n while (\n node &&\n (node.type === \"TSAsExpression\" ||\n node.type === \"TSSatisfiesExpression\" ||\n node.type === \"ParenthesizedExpression\")\n ) {\n node = node.expression;\n }\n return node;\n}\n\nexport const isObjectNode = (node: AstNode) => node?.type === \"ObjectExpression\";\n\n/** The static name of a property key, or `undefined` when it is computed. */\nexport function propertyKeyName(prop: AstNode): string | undefined {\n const key = prop?.key;\n if (!key || prop.computed) return undefined;\n if (key.type === \"Identifier\") return key.name;\n if (key.type === \"StringLiteral\" || (key.type === \"Literal\" && typeof key.value === \"string\")) {\n return key.value;\n }\n if (key.type === \"NumericLiteral\") return String(key.value);\n return undefined;\n}\n\nconst isPropLike = (p: AstNode) =>\n p?.type === \"ObjectProperty\" || p?.type === \"Property\" || p?.type === \"ObjectMethod\";\n\n/** The first property of `obj` with the static name `key`. */\nexport function findProperty(obj: AstNode, key: string): AstNode | undefined {\n return obj.properties.find((p: AstNode) => isPropLike(p) && propertyKeyName(p) === key);\n}\n","import { parseExpression } from \"magicast\";\n\nimport {\n findProperty as findProp,\n isObjectNode as isObject,\n propertyKeyName as keyName,\n unwrapNode as unwrap,\n} from \"../ast.js\";\nimport type { AstNode as Node } from \"../ast.js\";\nimport type { LeafKind } from \"./types.js\";\n\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n\nexport const isPropLike = (p: Node) =>\n p?.type === \"ObjectProperty\" || p?.type === \"Property\" || p?.type === \"ObjectMethod\";\n\nexport function stringValue(node: Node): string | undefined {\n node = unwrap(node);\n if (node?.type === \"StringLiteral\") return node.value;\n if (node?.type === \"Literal\" && typeof node.value === \"string\") return node.value;\n if (node?.type === \"TemplateLiteral\" && node.expressions.length === 0) {\n return node.quasis[0]?.value?.cooked ?? undefined;\n }\n return undefined;\n}\n\nexport function leafKind(node: Node): LeafKind {\n node = unwrap(node);\n if (stringValue(node) !== undefined) return \"string\";\n if (\n node?.type === \"ArrowFunctionExpression\" ||\n node?.type === \"FunctionExpression\" ||\n node?.type === \"ObjectMethod\"\n ) {\n return \"function\";\n }\n return \"other\";\n}\n\nexport function dictionaryProp(obj: Node): Node | undefined {\n const prop = findProp(obj, \"dictionary\");\n const value = unwrap(prop?.value);\n return isObject(value) ? value : undefined;\n}\n\nexport function locateName(declaration: Node): string | undefined {\n const decl = unwrap(declaration);\n if (decl?.type === \"CallExpression\") {\n const first = unwrap(decl.arguments[0]);\n if (isObject(first)) return stringValue(findProp(first, \"name\")?.value);\n return stringValue(first);\n }\n if (isObject(decl)) return stringValue(findProp(decl, \"name\")?.value);\n return undefined;\n}\n\nexport function locateLocalesObject(declaration: Node): Node | undefined {\n const decl = unwrap(declaration);\n if (decl?.type === \"CallExpression\") {\n const first = unwrap(decl.arguments[0]);\n const second = unwrap(decl.arguments[1]);\n if (isObject(second)) return second;\n if (isObject(first)) return dictionaryProp(first);\n return undefined;\n }\n if (isObject(decl)) return dictionaryProp(decl);\n return undefined;\n}\n\n/** Quotes a property key only when it is not a valid identifier. */\nexport function keyCode(key: string): string {\n return IDENTIFIER.test(key) ? key : JSON.stringify(key);\n}\n\n/** Builds a detached `key: <value>` property node from source text. */\nexport function makeProp(key: string, valueCode: string): Node {\n const expr: Node = parseExpression(`({ ${keyCode(key)}: ${valueCode} })`);\n return expr.$ast.properties[0];\n}\n\nexport function makeStringNode(value: string): Node {\n return makeProp(\"_\", JSON.stringify(value)).value;\n}\n\n/**\n * A dictionary is statically readable when every locale is an object literal and no object on the\n * way down uses spreads or computed keys.\n */\nexport function isStaticallyComplete(localesObj: Node): boolean {\n const walk = (obj: Node): boolean =>\n obj.properties.every((prop: Node) => {\n if (!isPropLike(prop) || keyName(prop) === undefined) return false;\n if (prop.type === \"ObjectMethod\") return true;\n const value = unwrap(prop.value);\n return isObject(value) ? walk(value) : true;\n });\n\n return localesObj.properties.every((prop: Node) => {\n if (!isPropLike(prop) || keyName(prop) === undefined || prop.type === \"ObjectMethod\")\n return false;\n const value = unwrap(prop.value);\n return isObject(value) && walk(value);\n });\n}\n","import fs from \"node:fs\";\n\nimport { generateCode, parseModule, writeFile } from \"magicast\";\n\nimport type { AstNode as Node } from \"../ast.js\";\nimport { isStaticallyComplete, locateLocalesObject, locateName } from \"./ast-helpers.js\";\nimport type { DictionaryFile } from \"./types.js\";\n\n/**\n * Parses dictionary source text (for example an unsaved editor buffer). Returns `undefined` when\n * the file does not have an editable shape; throws on syntax errors.\n */\nexport function parseDictionaryText(file: string, text: string): DictionaryFile | undefined {\n const mod = parseModule(text);\n const exported: Node = (mod.exports as any).default;\n const ast: Node = exported?.$ast;\n if (!ast) return undefined;\n const declaration = ast.declaration ?? ast;\n const localesObj = locateLocalesObject(declaration);\n return localesObj\n ? {\n file,\n mod,\n localesObj,\n name: locateName(declaration),\n endsWithNewline: text.endsWith(\"\\n\"),\n complete: isStaticallyComplete(localesObj),\n }\n : undefined;\n}\n\n/** Loads a dictionary file; returns `undefined` when its shape is not editable. */\nexport async function loadDictionaryFile(file: string): Promise<DictionaryFile | undefined> {\n return parseDictionaryText(file, fs.readFileSync(file, \"utf-8\"));\n}\n\n/** The source text with all edits applied, without writing anything. */\nexport function renderDictionaryFile(df: DictionaryFile): string {\n const code = generateCode(df.mod as any).code;\n return df.endsWithNewline && !code.endsWith(\"\\n\") ? `${code}\\n` : code;\n}\n\nexport async function saveDictionaryFile(df: DictionaryFile): Promise<void> {\n await writeFile(df.mod, df.file);\n if (df.endsWithNewline) {\n const text = fs.readFileSync(df.file, \"utf-8\");\n if (!text.endsWith(\"\\n\")) fs.writeFileSync(df.file, text + \"\\n\", \"utf-8\");\n }\n}\n","import {\n findProperty as findProp,\n isObjectNode as isObject,\n propertyKeyName as keyName,\n unwrapNode as unwrap,\n} from \"../ast.js\";\nimport type { AstNode as Node } from \"../ast.js\";\nimport { isPropLike, leafKind, stringValue } from \"./ast-helpers.js\";\nimport type { DictionaryFile, Leaf } from \"./types.js\";\n\nexport function listLocales(df: DictionaryFile): string[] {\n return df.localesObj.properties\n .filter(isPropLike)\n .map(keyName)\n .filter((k: string | undefined): k is string => k !== undefined);\n}\n\nexport function localeObject(df: DictionaryFile, locale: string): Node | undefined {\n const value = unwrap(findProp(df.localesObj, locale)?.value);\n return isObject(value) ? value : undefined;\n}\n\n/** Lists every leaf (string, function, or other value) of a locale, in source order. */\nexport function listLeaves(df: DictionaryFile, locale: string): Leaf[] {\n const root = localeObject(df, locale);\n if (!root) return [];\n\n const leaves: Leaf[] = [];\n const walk = (obj: Node, prefix: string[]) => {\n for (const prop of obj.properties) {\n if (!isPropLike(prop)) continue;\n const name = keyName(prop);\n if (name === undefined) continue;\n const path = [...prefix, name];\n const value = prop.type === \"ObjectMethod\" ? prop : unwrap(prop.value);\n if (isObject(value)) {\n walk(value, path);\n } else {\n const kind = leafKind(value);\n leaves.push({ path, kind, ...(kind === \"string\" ? { value: stringValue(value) } : {}) });\n }\n }\n };\n walk(root, []);\n return leaves;\n}\n\nexport function getProp(df: DictionaryFile, locale: string, path: string[]): Node | undefined {\n let obj = localeObject(df, locale);\n for (let i = 0; obj && i < path.length; i++) {\n const prop = findProp(obj, path[i]);\n if (!prop) return undefined;\n if (i === path.length - 1) return prop;\n const next = unwrap(prop.value);\n obj = isObject(next) ? next : undefined;\n }\n return undefined;\n}\n\nexport function hasPath(df: DictionaryFile, locale: string, path: string[]): boolean {\n return getProp(df, locale, path) !== undefined;\n}\n\nexport function getString(df: DictionaryFile, locale: string, path: string[]): string | undefined {\n const prop = getProp(df, locale, path);\n return prop && prop.type !== \"ObjectMethod\" ? stringValue(prop.value) : undefined;\n}\n\n/** Leaf paths of a runtime dictionary value (plain objects recurse; everything else is a leaf). */\nexport function flattenPaths(value: unknown, prefix: string[] = []): string[][] {\n if (value && typeof value === \"object\" && !Array.isArray(value)) {\n return Object.entries(value).flatMap(([k, v]) => flattenPaths(v, [...prefix, k]));\n }\n return prefix.length > 0 ? [prefix] : [];\n}\n","import { generateCode, parseExpression } from \"magicast\";\n\nimport {\n findProperty as findProp,\n isObjectNode as isObject,\n unwrapNode as unwrap,\n} from \"../ast.js\";\nimport type { AstNode as Node } from \"../ast.js\";\nimport { leafKind, makeProp, makeStringNode, stringValue } from \"./ast-helpers.js\";\nimport { getProp, hasPath, localeObject } from \"./read.js\";\nimport type { DictionaryFile } from \"./types.js\";\n\nfunction ensureLocale(df: DictionaryFile, locale: string): Node {\n let obj = localeObject(df, locale);\n if (!obj) {\n const prop = makeProp(locale, \"{}\");\n df.localesObj.properties.push(prop);\n obj = prop.value as Node;\n }\n return obj;\n}\n\n/** Returns the object that should contain the last path segment, creating objects as needed. */\nfunction ensureParent(df: DictionaryFile, locale: string, path: string[]): Node | undefined {\n let obj = ensureLocale(df, locale);\n for (const segment of path.slice(0, -1)) {\n let prop = findProp(obj, segment);\n if (!prop) {\n prop = makeProp(segment, \"{}\");\n obj.properties.push(prop);\n }\n const next = unwrap(prop.value);\n if (!isObject(next)) return undefined;\n obj = next;\n }\n return obj;\n}\n\nexport type SetResult = \"created\" | \"updated\" | \"skipped\";\n\n/**\n * Sets a string value at `path`. Existing function or non-string values are left alone\n * (`\"skipped\"`) because they cannot be translated as plain text.\n */\nexport function setString(\n df: DictionaryFile,\n locale: string,\n path: string[],\n value: string,\n): SetResult {\n const parent = ensureParent(df, locale, path);\n if (!parent) return \"skipped\";\n\n const last = path[path.length - 1];\n const existing = findProp(parent, last);\n if (existing) {\n if (existing.type === \"ObjectMethod\" || leafKind(existing.value) !== \"string\") {\n return \"skipped\";\n }\n existing.value = makeStringNode(value);\n return \"updated\";\n }\n parent.properties.push(makeProp(last, JSON.stringify(value)));\n return \"created\";\n}\n\n/**\n * Copies the leaf at `path` from one locale to another. String values can be rewritten with\n * `mapString` (for example to add a `[TODO]` marker); other values are copied verbatim.\n * Returns `false` when the source has no such leaf or the target already has one.\n */\nexport function copyLeaf(\n df: DictionaryFile,\n fromLocale: string,\n toLocale: string,\n path: string[],\n mapString?: (value: string) => string,\n): boolean {\n const source = getProp(df, fromLocale, path);\n if (!source || hasPath(df, toLocale, path)) return false;\n\n const parent = ensureParent(df, toLocale, path);\n if (!parent) return false;\n\n const last = path[path.length - 1];\n const text = source.type === \"ObjectMethod\" ? undefined : stringValue(source.value);\n if (text !== undefined && mapString) {\n parent.properties.push(makeProp(last, JSON.stringify(mapString(text))));\n } else {\n const code = generateCode(source as any).code;\n const expr: Node = parseExpression(`({ ${code} })`);\n parent.properties.push(expr.$ast.properties[0]);\n }\n return true;\n}\n","import { generateCode } from \"magicast\";\n\nimport { findProperty as findProp } from \"../ast.js\";\nimport type { AstNode as Node } from \"../ast.js\";\nimport { getProp } from \"./read.js\";\nimport type { DictionaryFile, SourceRange } from \"./types.js\";\n\nconst toRange = (loc: Node | undefined): SourceRange | undefined =>\n loc\n ? {\n start: { line: loc.start.line - 1, column: loc.start.column },\n end: { line: loc.end.line - 1, column: loc.end.column },\n }\n : undefined;\n\n/**\n * Where a locale (no `path`) or a key within it is written. The range covers the property key, so\n * it is a good place to attach a diagnostic or jump to.\n */\nexport function locationOf(\n df: DictionaryFile,\n locale: string,\n path: string[] = [],\n): SourceRange | undefined {\n const prop = path.length === 0 ? findProp(df.localesObj, locale) : getProp(df, locale, path);\n return toRange((prop?.key ?? prop)?.loc);\n}\n\n/** The source text of the dictionary object itself (the object whose keys are locales). */\nexport function dictionaryLocation(df: DictionaryFile): SourceRange | undefined {\n return toRange(df.localesObj.loc);\n}\n\n/** The source code of a leaf's value (a function's source, or a string with its quotes). */\nexport function getLeafSource(\n df: DictionaryFile,\n locale: string,\n path: string[],\n): string | undefined {\n const prop = getProp(df, locale, path);\n if (!prop) return undefined;\n return generateCode((prop.type === \"ObjectMethod\" ? prop : prop.value) as any).code;\n}\n","import fs from \"node:fs\";\n\nimport type { AnalysisCache } from \"./types.js\";\n\nexport function createAnalysisCache(): AnalysisCache {\n return { dictionaries: new Map(), sources: new Map(), gitignore: new Map() };\n}\n\n/** Forget the cached `.gitignore` rules, for example after a `.gitignore` file changed. */\nexport function clearGitignore(cache: AnalysisCache): void {\n cache.gitignore.clear();\n}\n\nexport function stampOf(file: string): string | undefined {\n try {\n const stat = fs.statSync(file);\n return `${stat.mtimeMs}:${stat.size}`;\n } catch {\n return undefined;\n }\n}\n","import fs from \"node:fs\";\nimport { pathToFileURL } from \"node:url\";\n\nimport {\n flattenPaths,\n listLeaves,\n listLocales,\n parseDictionaryText,\n type DictionaryFile,\n} from \"../utils/dictionary/index.js\";\nimport { stampOf } from \"./cache.js\";\nimport type { AnalysisCache, DictionaryData, LeafInfo, Loaded } from \"./types.js\";\n\nfunction fromSyntaxTree(df: DictionaryFile): DictionaryData {\n const locales = listLocales(df);\n const leaves = new Map<string, Map<string, LeafInfo>>();\n for (const locale of locales) {\n const entries = new Map<string, LeafInfo>();\n for (const leaf of listLeaves(df, locale)) {\n entries.set(leaf.path.join(\".\"), { kind: leaf.kind, value: leaf.value });\n }\n leaves.set(locale, entries);\n }\n return { name: df.name!, locales, leaves, df };\n}\n\nasync function fromRuntime(file: string): Promise<Loaded> {\n try {\n const mod = await import(`${pathToFileURL(file).href}?t=${Date.now()}_${Math.random()}`);\n const definition = mod.default || mod;\n if (!definition || typeof definition !== \"object\" || !definition.dictionary) {\n return {\n ok: false,\n level: \"error\",\n code: \"invalid-dictionary\",\n message: \"Default export does not appear to be a valid defineDictionary output.\",\n };\n }\n\n const dictionary = definition.dictionary as Record<string, Record<string, any>>;\n const leaves = new Map<string, Map<string, LeafInfo>>();\n const invalid: string[] = [];\n\n for (const [locale, content] of Object.entries(dictionary)) {\n if (!content || typeof content !== \"object\") {\n invalid.push(locale);\n continue;\n }\n const entries = new Map<string, LeafInfo>();\n for (const leafPath of flattenPaths(content)) {\n let value: any = content;\n for (const segment of leafPath) value = value?.[segment];\n entries.set(\n leafPath.join(\".\"),\n typeof value === \"string\"\n ? { kind: \"string\", value }\n : { kind: typeof value === \"function\" ? \"function\" : \"other\" },\n );\n }\n leaves.set(locale, entries);\n }\n\n if (invalid.length > 0) {\n return {\n ok: false,\n level: \"error\",\n code: \"invalid-locale\",\n message: invalid.map((l) => `Locale \"${l}\" content is empty or invalid.`).join(\"\\n\"),\n };\n }\n\n return {\n ok: true,\n data: { name: String(definition.name ?? \"\"), locales: [...leaves.keys()], leaves },\n };\n } catch (error: any) {\n return {\n ok: false,\n level: \"error\",\n code: \"invalid-dictionary\",\n message: `Failed to import dictionary: ${error.message || String(error)}`,\n };\n }\n}\n\nexport function fromParsed(parsed: () => DictionaryFile | undefined): Loaded | undefined {\n try {\n const df = parsed();\n if (df?.complete && df.name) return { ok: true, data: fromSyntaxTree(df) };\n } catch (error) {\n return {\n ok: false,\n level: \"error\",\n code: \"invalid-dictionary\",\n message: `Failed to parse dictionary: ${(error as Error).message}`,\n };\n }\n return undefined;\n}\n\nexport const UNANALYZABLE: Loaded = {\n ok: false,\n level: \"info\",\n code: \"unanalyzable\",\n message:\n \"This dictionary uses spreads, computed keys, imported values, or a computed name, so it cannot be analyzed statically.\",\n};\n\n/** Reads a dictionary from its syntax tree. Never runs project code. */\nfunction loadDictionaryDataStatic(file: string): Loaded {\n return (\n fromParsed(() => parseDictionaryText(file, fs.readFileSync(file, \"utf-8\"))) ?? UNANALYZABLE\n );\n}\n\nasync function loadDictionaryData(file: string, runtime: boolean): Promise<Loaded> {\n const parsed = fromParsed(() => parseDictionaryText(file, fs.readFileSync(file, \"utf-8\")));\n if (parsed?.ok) return parsed;\n if (runtime) return fromRuntime(file);\n return parsed ?? UNANALYZABLE;\n}\n\nexport async function cachedDictionary(\n file: string,\n runtime: boolean,\n cache: AnalysisCache | undefined,\n): Promise<Loaded> {\n const stamp = cache ? stampOf(file) : undefined;\n const hit = stamp ? cache!.dictionaries.get(file) : undefined;\n if (hit && hit.stamp === stamp) return hit.loaded;\n\n const loaded = await loadDictionaryData(file, runtime);\n if (cache && stamp) cache.dictionaries.set(file, { stamp, loaded });\n return loaded;\n}\n\nexport function cachedDictionaryStatic(file: string, cache: AnalysisCache | undefined): Loaded {\n const stamp = cache ? stampOf(file) : undefined;\n const hit = stamp ? cache!.dictionaries.get(file) : undefined;\n if (hit && hit.stamp === stamp) return hit.loaded;\n\n const loaded = loadDictionaryDataStatic(file);\n if (cache && stamp) cache.dictionaries.set(file, { stamp, loaded });\n return loaded;\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport fg from \"fast-glob\";\nimport ignore, { type Ignore } from \"ignore\";\n\n/** Folders that never hold project dictionaries or sources, in every scanner. */\nexport const BUILTIN_IGNORE = [\n \"**/node_modules/**\",\n \"**/dist/**\",\n \"**/.next/**\",\n \"**/dialex.locales/**\",\n];\n\n/** What the source scan skips on top: other tools' output, declarations, generated and config files. */\nexport const SOURCE_BUILTIN_IGNORE = [\n ...BUILTIN_IGNORE,\n \"**/.nuxt/**\",\n \"**/.output/**\",\n \"**/.svelte-kit/**\",\n \"**/.astro/**\",\n \"**/.turbo/**\",\n \"**/coverage/**\",\n \"**/graphify-out/**\",\n \"**/*.d.ts\",\n \"**/dialex.generated.*\",\n \"**/dialex.config.*\",\n \"**/i18n.config.*\",\n];\n\ninterface GitignoreScope {\n /** Absolute directory the file's patterns are relative to. */\n dir: string;\n matcher: Ignore;\n}\n\n/** The nearest directory at or above `root` that contains `.git`, or `root` itself. */\nfunction repositoryRoot(root: string): string {\n for (let dir = root; ; dir = path.dirname(dir)) {\n if (fs.existsSync(path.join(dir, \".git\"))) return dir;\n if (path.dirname(dir) === dir) return root;\n }\n}\n\nfunction readScope(dir: string): GitignoreScope | undefined {\n try {\n const text = fs.readFileSync(path.join(dir, \".gitignore\"), \"utf-8\");\n return { dir, matcher: ignore().add(text) };\n } catch {\n return undefined;\n }\n}\n\n/**\n * A function that says whether an absolute path is ignored by Git. It reads the `.gitignore`\n * files of the project folder, of every folder above it up to the repository root (monorepo\n * packages inherit the root's rules), and of nested folders.\n */\nexport function createGitignoreFilter(root: string): (absolutePath: string) => boolean {\n const base = path.resolve(root);\n const top = repositoryRoot(base);\n\n const scopes: GitignoreScope[] = [];\n for (let dir = base; ; dir = path.dirname(dir)) {\n const scope = readScope(dir);\n if (scope) scopes.push(scope);\n if (dir === top || path.dirname(dir) === dir) break;\n }\n\n const nested = fg.sync(\"**/.gitignore\", {\n cwd: base,\n absolute: true,\n dot: true,\n ignore: [\"**/node_modules/**\", \"**/.git/**\"],\n });\n for (const file of nested) {\n const dir = path.dirname(file);\n if (dir === base) continue; // already read above\n const scope = readScope(dir);\n if (scope) scopes.push(scope);\n }\n\n if (scopes.length === 0) return () => false;\n\n return (absolutePath) => {\n for (const { dir, matcher } of scopes) {\n const relative = path.relative(dir, absolutePath);\n if (!relative || relative.startsWith(\"..\") || path.isAbsolute(relative)) continue;\n if (matcher.ignores(relative.split(path.sep).join(\"/\"))) return true;\n }\n return false;\n };\n}\n\nexport interface ScanOptions {\n /** Which built-in ignore list applies. @default \"dictionary\" */\n kind?: \"dictionary\" | \"source\";\n /** `exclude` from the config: extra globs, relative to `root`. */\n exclude?: string[];\n /** More ignore globs, relative to `root` (nested projects, for example). */\n ignore?: string[];\n /** Skip what `.gitignore` files ignore. @default true */\n gitignore?: boolean;\n /** A filter from {@link createGitignoreFilter} to reuse instead of reading `.gitignore` again. */\n gitignoreFilter?: (absolutePath: string) => boolean;\n}\n\n/** Finds files under `root`, skipping build output, configured excludes and Git-ignored paths. */\nexport function scanFiles(\n root: string,\n patterns: string | string[],\n options: ScanOptions = {},\n): string[] {\n const builtin = options.kind === \"source\" ? SOURCE_BUILTIN_IGNORE : BUILTIN_IGNORE;\n const files = fg.sync(patterns, {\n cwd: root,\n absolute: true,\n ignore: [...builtin, ...(options.exclude ?? []), ...(options.ignore ?? [])],\n });\n if (options.gitignore === false) return files;\n const ignored = options.gitignoreFilter ?? createGitignoreFilter(root);\n return files.filter((file) => !ignored(file));\n}\n","import {\n argumentSignature,\n findPlurals,\n getArguments,\n isIcuStructured,\n parseMessage,\n type IcuNode,\n} from \"dialexjs/icu\";\n\nexport interface IcuFinding {\n level: \"error\" | \"warning\";\n code: \"invalid-icu\" | \"icu-args-mismatch\" | \"icu-plural-categories\";\n locale: string;\n /** Dotted key including the dictionary name, e.g. `cart.items`. */\n key: string;\n message: string;\n}\n\n/** `locale -> dotted path within the dictionary -> string value` */\nexport type LocaleStrings = Map<string, Map<string, string>>;\n\n/** CLDR order. `resolvedOptions().pluralCategories` order differs between Node versions. */\nconst CATEGORY_ORDER = [\"zero\", \"one\", \"two\", \"few\", \"many\"];\n\nfunction requiredCategories(locale: string, ordinal: boolean): string[] {\n try {\n return new Intl.PluralRules(locale, { type: ordinal ? \"ordinal\" : \"cardinal\" })\n .resolvedOptions()\n .pluralCategories.filter((c) => c !== \"other\")\n .sort((a, b) => CATEGORY_ORDER.indexOf(a) - CATEGORY_ORDER.indexOf(b));\n } catch {\n return []; // not a valid BCP 47 tag; nothing to compare against\n }\n}\n\n/**\n * Validates ICU messages across the locales of one dictionary:\n *\n * - invalid syntax: an error for messages that clearly use ICU (plural/select/number/date/time),\n * a warning for plain `{placeholders}` that do not parse (they may not be meant as ICU);\n * - every locale must use the same arguments as the reference locale;\n * - plural options should cover the categories the locale's plural rules need.\n */\nexport function checkIcu(\n dictionary: string,\n strings: LocaleStrings,\n defaultLocale: string,\n): IcuFinding[] {\n const findings: IcuFinding[] = [];\n const parsed = new Map<string, Map<string, IcuNode[]>>();\n\n for (const [locale, entries] of strings) {\n const ok = new Map<string, IcuNode[]>();\n for (const [path, value] of entries) {\n if (!value.includes(\"{\")) continue;\n const key = `${dictionary}.${path}`;\n try {\n ok.set(path, parseMessage(value));\n } catch (error) {\n const structured = isIcuStructured(value);\n findings.push({\n level: structured ? \"error\" : \"warning\",\n code: \"invalid-icu\",\n locale,\n key,\n message: structured\n ? `Invalid ICU message \"${key}\" (${locale}): ${(error as Error).message}`\n : `\"${key}\" (${locale}) contains braces but is not valid ICU, so t() values cannot be applied: ${(error as Error).message}`,\n });\n }\n }\n parsed.set(locale, ok);\n }\n\n // Compare every locale against the reference (default locale first)\n const order = [defaultLocale, ...[...parsed.keys()].filter((l) => l !== defaultLocale)];\n const paths = new Set([...parsed.values()].flatMap((m) => [...m.keys()]));\n\n for (const path of paths) {\n const key = `${dictionary}.${path}`;\n const reference = order.find((l) => parsed.get(l)?.has(path));\n if (!reference) continue;\n const expected = argumentSignature(parsed.get(reference)!.get(path)!);\n\n for (const locale of order) {\n const nodes = parsed.get(locale)?.get(path);\n if (nodes && locale !== reference) {\n const found = argumentSignature(nodes);\n if (found !== expected) {\n findings.push({\n level: \"error\",\n code: \"icu-args-mismatch\",\n locale,\n key,\n message: `Locale \"${locale}\" uses different arguments than \"${reference}\" for \"${key}\" (expected ${expected || \"none\"}, found ${found || \"none\"})`,\n });\n }\n }\n if (!nodes) continue;\n\n for (const plural of findPlurals(nodes)) {\n const missing = requiredCategories(locale, plural.ordinal).filter(\n (c) => !(c in plural.options),\n );\n if (missing.length > 0) {\n findings.push({\n level: \"warning\",\n code: \"icu-plural-categories\",\n locale,\n key,\n message: `Locale \"${locale}\" plural \"${plural.name}\" in \"${key}\" has no ${missing.map((c) => `\"${c}\"`).join(\", \")} option (used by this language; \"other\" will be shown instead)`,\n });\n }\n }\n }\n }\n\n return findings;\n}\n\n/** Arguments of a message, or `undefined` when it does not parse. */\nexport function tryGetArguments(message: string) {\n try {\n return getArguments(parseMessage(message));\n } catch {\n return undefined;\n }\n}\n","import { createHash } from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nexport const LOCK_FILE = \"dialex.lock.json\";\n\n/**\n * Records which version of the source text each translation was made from, so a later edit of the\n * source can be noticed. A translation whose source changed afterwards is *stale*.\n *\n * ```json\n * { \"version\": 1, \"sourceLocale\": \"en\", \"locales\": { \"tr\": { \"home.title\": \"a1b2c3d4\" } } }\n * ```\n *\n * The value is a short hash of the source locale's text at the time. Translations without a\n * record are untracked (for example hand-written ones) and are never reported as stale.\n */\nexport interface Lockfile {\n version: 1;\n sourceLocale?: string;\n locales: Record<string, Record<string, string>>;\n}\n\nexport const emptyLock = (sourceLocale?: string): Lockfile => ({\n version: 1,\n ...(sourceLocale ? { sourceLocale } : {}),\n locales: {},\n});\n\nexport const lockPath = (root: string) => path.join(root, LOCK_FILE);\n\n/** A short, stable fingerprint of a source string. */\nexport function hashSource(text: string): string {\n return createHash(\"sha1\").update(text).digest(\"hex\").slice(0, 8);\n}\n\n/** The lock file, or `undefined` when there is none (or it cannot be read). */\nexport function readLock(root: string): Lockfile | undefined {\n try {\n const data = JSON.parse(fs.readFileSync(lockPath(root), \"utf-8\"));\n if (data?.version !== 1 || typeof data.locales !== \"object\" || data.locales === null) {\n return undefined;\n }\n return {\n version: 1,\n ...(typeof data.sourceLocale === \"string\" ? { sourceLocale: data.sourceLocale } : {}),\n locales: data.locales,\n };\n } catch {\n return undefined;\n }\n}\n\n/** Writes the lock with sorted keys, so it produces small, stable diffs. */\nexport function writeLock(root: string, lock: Lockfile): void {\n const sorted: Lockfile = {\n version: 1,\n ...(lock.sourceLocale ? { sourceLocale: lock.sourceLocale } : {}),\n locales: Object.fromEntries(\n Object.keys(lock.locales)\n .sort()\n .map((locale) => [\n locale,\n Object.fromEntries(\n Object.entries(lock.locales[locale]).sort(([a], [b]) => a.localeCompare(b)),\n ),\n ]),\n ),\n };\n fs.writeFileSync(lockPath(root), JSON.stringify(sorted, null, 2) + \"\\n\", \"utf-8\");\n}\n\n/** Notes that `key` in `locale` was written from this source text. */\nexport function record(lock: Lockfile, locale: string, key: string, sourceText: string): void {\n (lock.locales[locale] ??= {})[key] = hashSource(sourceText);\n}\n\n/**\n * True when `key` was recorded for `locale` from different source text than `sourceText`. A key\n * with no record is not stale.\n */\nexport function isStale(lock: Lockfile, locale: string, key: string, sourceText: string): boolean {\n const recorded = lock.locales[locale]?.[key];\n return recorded !== undefined && recorded !== hashSource(sourceText);\n}\n\n/**\n * The lock to use for a run translating from `sourceLocale`. A lock written from another source\n * locale says nothing about this one, so it is replaced by a fresh one.\n */\nexport function lockFor(root: string, sourceLocale: string): { lock: Lockfile; replaced: boolean } {\n const existing = readLock(root);\n if (!existing) return { lock: emptyLock(sourceLocale), replaced: false };\n if (existing.sourceLocale && existing.sourceLocale !== sourceLocale) {\n return { lock: emptyLock(sourceLocale), replaced: true };\n }\n existing.sourceLocale = sourceLocale;\n return { lock: existing, replaced: false };\n}\n","import type { SourceRange } from \"../utils/dictionary/index.js\";\nimport type { Reference, SourceScan } from \"./types.js\";\n\nexport const DEFAULT_SOURCE_GLOB = \"**/*.{ts,tsx,js,jsx,mjs,cjs,vue,svelte,astro,mdx}\";\n\n/** `getDictionary(\"x\")`, `useDictionary(\"x\")`, `@DialexDictionary(\"x\")` */\nconst DICTIONARY_CALL =\n /\\b(?:getDictionary|useDictionary|DialexDictionary)\\(\\s*([\"'`])([^\"'`$\\n]+)\\1/dg;\n/** `t(\"dictionary.path.to.key\")` */\nconst T_CALL = /(?<![\\w$.])t\\(\\s*([\"'`])([\\w-]+(?:\\.[\\w-]+)+)\\1/dg;\n\n/**\n * Offsets of `//`, `/* *\\/` and `<!-- -->` comments. Quoted strings are skipped so `\"http://x\"`\n * is not a comment; `'` and `\"` end at a newline, template literals do not.\n */\nfunction commentRanges(text: string): [number, number][] {\n const ranges: [number, number][] = [];\n const length = text.length;\n let i = 0;\n while (i < length) {\n const c = text[i];\n if (c === '\"' || c === \"'\" || c === \"`\") {\n i++;\n while (i < length && text[i] !== c && (c === \"`\" || text[i] !== \"\\n\")) {\n if (text[i] === \"\\\\\") i++;\n i++;\n }\n i++;\n continue;\n }\n let close: string | undefined;\n if (c === \"/\" && text[i + 1] === \"/\") close = \"\\n\";\n else if (c === \"/\" && text[i + 1] === \"*\") close = \"*/\";\n else if (c === \"<\" && text.startsWith(\"<!--\", i)) close = \"-->\";\n if (close === undefined) {\n i++;\n continue;\n }\n const found = text.indexOf(close, i + 2);\n const end = found === -1 ? length : close === \"\\n\" ? found : found + close.length;\n ranges.push([i, end]);\n i = end;\n }\n return ranges;\n}\n\nconst IGNORE_DIRECTIVE = /dialex-ignore(-next-line)?(?![\\w-])/;\n/** `dictionaries: { name: ..., \"other-name\": ..., shorthand }`, up to the first key. */\nconst DICTIONARIES_OBJECT = /\\bdictionaries\\s*:\\s*\\{/g;\nconst OBJECT_KEY = /\\s*(?:([A-Za-z_$][\\w$-]*)|([\"'])([^\"'\\n]+)\\2)\\s*(?=[:,}])/y;\n\n/** Replaces comments with spaces of the same length, keeping offsets and line breaks. */\nfunction maskComments(text: string, comments: [number, number][]): string {\n if (comments.length === 0) return text;\n let out = \"\";\n let at = 0;\n for (const [from, to] of comments) {\n out += text.slice(at, from) + text.slice(from, to).replace(/[^\\n]/g, \" \");\n at = to;\n }\n return out + text.slice(at);\n}\n\n/** Names that an object literal `dictionaries: { ... }` registers inline. */\nfunction inlineDictionaryNames(masked: string): string[] {\n const names = new Set<string>();\n for (const match of masked.matchAll(DICTIONARIES_OBJECT)) {\n let i = match.index! + match[0].length;\n let depth = 1;\n let expectKey = true;\n while (i < masked.length && depth > 0) {\n if (expectKey && depth === 1) {\n OBJECT_KEY.lastIndex = i;\n const key = OBJECT_KEY.exec(masked);\n if (key) {\n names.add(key[1] ?? key[3]);\n i = OBJECT_KEY.lastIndex;\n }\n expectKey = false;\n continue;\n }\n const c = masked[i];\n if (c === '\"' || c === \"'\" || c === \"`\") {\n i++;\n while (i < masked.length && masked[i] !== c && (c === \"`\" || masked[i] !== \"\\n\")) {\n if (masked[i] === \"\\\\\") i++;\n i++;\n }\n } else if (c === \"{\" || c === \"[\" || c === \"(\") depth++;\n else if (c === \"}\" || c === \"]\" || c === \")\") depth--;\n else if (c === \",\" && depth === 1) expectKey = true;\n i++;\n }\n }\n return [...names];\n}\n\n/** Lines that a `dialex-ignore` / `dialex-ignore-next-line` comment excludes from checking. */\nfunction ignoredLines(text: string, comments: [number, number][]): Set<number> {\n const lines = new Set<number>();\n if (!text.includes(\"dialex-ignore\")) return lines;\n const starts = lineStarts(text);\n for (const [from, to] of comments) {\n const directive = IGNORE_DIRECTIVE.exec(text.slice(from, to));\n if (!directive) continue;\n const first = positionAt(starts, from).line;\n const last = positionAt(starts, Math.max(from, to - 1)).line;\n if (directive[1]) lines.add(last + 1);\n else for (let line = first; line <= last; line++) lines.add(line);\n }\n return lines;\n}\n\n/** References and inline dictionary names found in one source file. */\nexport function scanText(text: string): { references: Reference[]; inline: string[] } {\n const comments = commentRanges(text);\n const ignored = ignoredLines(text, comments);\n const starts = ignored.size > 0 ? lineStarts(text) : [];\n const inComment = (offset: number) =>\n comments.some(([from, to]) => offset >= from && offset < to);\n const references: Reference[] = [];\n const collect = (pattern: RegExp, kind: Reference[\"kind\"]) => {\n for (const match of text.matchAll(pattern)) {\n const [start, end] = match.indices![2] as [number, number];\n if (comments.length > 0 && inComment(start)) continue;\n if (ignored.size > 0 && ignored.has(positionAt(starts, start).line)) continue;\n references.push({ kind, value: match[2], start, end });\n }\n };\n collect(DICTIONARY_CALL, \"dictionary\");\n collect(T_CALL, \"path\");\n references.sort((a, b) => a.start - b.start);\n return {\n references,\n inline: text.includes(\"dictionaries\")\n ? inlineDictionaryNames(maskComments(text, comments))\n : [],\n };\n}\n\n/**\n * Finds `getDictionary(\"x\")`-style and `t(\"x.y.z\")` references in source text. References inside\n * comments, and on lines a `dialex-ignore` comment covers, are skipped.\n */\nexport function scanReferences(text: string): Reference[] {\n return scanText(text).references;\n}\n\nfunction lineStarts(text: string): number[] {\n const starts = [0];\n for (let i = 0; i < text.length; i++) if (text.charCodeAt(i) === 10) starts.push(i + 1);\n return starts;\n}\n\nfunction positionAt(starts: number[], offset: number) {\n let low = 0;\n let high = starts.length - 1;\n while (low < high) {\n const mid = Math.ceil((low + high) / 2);\n if (starts[mid] <= offset) low = mid;\n else high = mid - 1;\n }\n return { line: low, column: offset - starts[low] };\n}\n\nexport function scanSource(text: string): SourceScan {\n const starts = lineStarts(text);\n const rangeOf = (start: number, end: number): SourceRange => ({\n start: positionAt(starts, start),\n end: positionAt(starts, end),\n });\n const { references, inline } = scanText(text);\n return {\n tokens: [...new Set(text.match(/[\\w$-]+/g) ?? [])],\n refs: references.map((ref) => ({ ref, range: rangeOf(ref.start, ref.end) })),\n inline,\n };\n}\n","import fs from \"node:fs\";\n\nimport { TODO_PREFIX, dictionaryLocation, locationOf } from \"../utils/dictionary/index.js\";\nimport { createGitignoreFilter, scanFiles } from \"../utils/files.js\";\nimport { checkIcu, type LocaleStrings } from \"../utils/icu-check.js\";\nimport { isStale, readLock } from \"../utils/lockfile.js\";\nimport { stampOf } from \"./cache.js\";\nimport { DEFAULT_SOURCE_GLOB, scanSource } from \"./source-scan.js\";\nimport type {\n AnalysisIssue,\n AnalysisOptions,\n AnalysisResult,\n AnalyzedDictionary,\n LintLevel,\n LintSetting,\n LoadRequest,\n Loaded,\n SourceScan,\n} from \"./types.js\";\n\nfunction lintLevel(setting: LintSetting | undefined): LintLevel | undefined {\n const level = Array.isArray(setting) ? setting[0] : setting;\n return level === \"off\" || level === \"warn\" || level === \"error\" ? level : undefined;\n}\n\n/**\n * The analysis itself, written once. It yields a `LoadRequest` for every dictionary so that a\n * synchronous driver (`analyzeProjectSync`) and an asynchronous one (`analyzeProject`, which may\n * import dictionaries at runtime) can share it.\n */\nexport function* analysisSteps(\n options: AnalysisOptions,\n): Generator<LoadRequest, AnalysisResult, Loaded> {\n const { root, config } = options;\n const include = config.include || \"**/*.content.ts\";\n const configuredLocales = config.locales || [];\n const defaultLocale = config.defaultLocale || \"en\";\n const extraIgnore = options.ignore ?? [];\n\n const cache = options.runtime ? undefined : options.cache;\n let gitignore = cache?.gitignore.get(root);\n if (cache && !gitignore) {\n gitignore = createGitignoreFilter(root);\n cache.gitignore.set(root, gitignore);\n }\n\n const files = scanFiles(root, include, {\n exclude: config.exclude,\n ignore: extraIgnore,\n gitignoreFilter: gitignore,\n });\n\n const issues: AnalysisIssue[] = [];\n const dictionaries: AnalyzedDictionary[] = [];\n const lock = options.lock === false ? undefined : readLock(root);\n\n // 1. Dictionaries: parity, placeholders, ICU\n for (const file of files) {\n const loaded: Loaded = yield {\n file,\n runtime: options.runtime === true,\n cache,\n text: options.contents?.get(file),\n };\n if (!loaded.ok) {\n for (const message of loaded.message.split(\"\\n\")) {\n issues.push({ file, level: loaded.level, code: loaded.code, message });\n }\n continue;\n }\n\n const { data } = loaded;\n const { df } = data;\n const at = (locale?: string, keyPath?: string[]) =>\n df && locale ? locationOf(df, locale, keyPath) : undefined;\n const add = (issue: Omit<AnalysisIssue, \"file\" | \"dictionary\">) =>\n issues.push({ ...issue, file, dictionary: data.name });\n\n for (const required of configuredLocales) {\n if (!data.locales.includes(required)) {\n add({\n level: \"error\",\n code: \"missing-locale\",\n message: `Missing configured locale \"${required}\"`,\n range: df ? dictionaryLocation(df) : undefined,\n locale: required,\n });\n }\n }\n\n const paths: string[] = [];\n const seen = new Set<string>();\n for (const locale of data.locales) {\n for (const leafPath of data.leaves.get(locale)!.keys()) {\n if (!seen.has(leafPath)) {\n seen.add(leafPath);\n paths.push(leafPath);\n }\n }\n }\n\n for (const locale of data.locales) {\n const present = data.leaves.get(locale)!;\n for (const leafPath of paths) {\n if (present.has(leafPath)) continue;\n const sourceLocale = [defaultLocale, ...data.locales].find(\n (l) => l !== locale && data.leaves.get(l)?.has(leafPath),\n );\n add({\n level: \"error\",\n code: \"missing-key\",\n message: `Locale \"${locale}\" is missing key \"${leafPath}\"`,\n range: at(locale),\n locale,\n path: leafPath.split(\".\"),\n sourceLocale,\n });\n }\n }\n\n const strings: LocaleStrings = new Map();\n for (const locale of data.locales) {\n const entries = new Map<string, string>();\n strings.set(locale, entries);\n for (const [leafPath, leaf] of data.leaves.get(locale)!) {\n if (leaf.kind !== \"string\" || leaf.value === undefined) continue;\n entries.set(leafPath, leaf.value);\n if (leaf.value.startsWith(TODO_PREFIX)) {\n add({\n level: \"warning\",\n code: \"todo-placeholder\",\n message: `Locale \"${locale}\" key \"${leafPath}\" still has a ${TODO_PREFIX.trim()} placeholder`,\n range: at(locale, leafPath.split(\".\")),\n locale,\n path: leafPath.split(\".\"),\n });\n }\n }\n }\n\n // Translations made from source text that has changed since (see dialex.lock.json)\n const sourceLeaves = lock?.sourceLocale ? data.leaves.get(lock.sourceLocale) : undefined;\n if (lock && sourceLeaves) {\n for (const locale of data.locales) {\n if (locale === lock.sourceLocale) continue;\n for (const [leafPath, leaf] of data.leaves.get(locale)!) {\n if (leaf.kind !== \"string\" || leaf.value === undefined) continue;\n if (leaf.value.startsWith(TODO_PREFIX)) continue;\n const source = sourceLeaves.get(leafPath);\n if (source?.kind !== \"string\" || source.value === undefined) continue;\n if (!isStale(lock, locale, `${data.name}.${leafPath}`, source.value)) continue;\n add({\n level: \"warning\",\n code: \"stale-translation\",\n message: `Locale \"${locale}\" key \"${leafPath}\" is out of date: the \"${lock.sourceLocale}\" text changed after it was translated`,\n range: at(locale, leafPath.split(\".\")),\n locale,\n path: leafPath.split(\".\"),\n sourceLocale: lock.sourceLocale,\n });\n }\n }\n }\n\n for (const finding of checkIcu(data.name, strings, defaultLocale)) {\n const keyPath = finding.key.slice(data.name.length + 1).split(\".\");\n add({\n level: finding.level,\n code: finding.code,\n message: finding.message,\n range: at(finding.locale, keyPath),\n locale: finding.locale,\n path: keyPath,\n });\n }\n\n dictionaries.push({\n name: data.name,\n file,\n locales: data.locales,\n leaves: data.leaves,\n paths,\n df,\n });\n }\n\n // 2. Source code: references to dictionaries and keys\n const known = new Map(dictionaries.map((d) => [d.name, d]));\n const dictionaryFiles = new Set(files);\n const sourceGlobs = options.src ?? [DEFAULT_SOURCE_GLOB];\n const sourceFiles =\n sourceGlobs.length === 0\n ? []\n : scanFiles(root, sourceGlobs, {\n kind: \"source\",\n exclude: config.exclude,\n ignore: extraIgnore,\n gitignoreFilter: gitignore,\n }).filter((f) => !dictionaryFiles.has(f));\n\n const inline = new Set<string>();\n if (sourceFiles.length > 0) {\n const tokens = new Set<string>();\n const scans: { file: string; scan: SourceScan }[] = [];\n\n for (const file of sourceFiles) {\n const stamp = cache ? stampOf(file) : undefined;\n let scan = stamp ? cache!.sources.get(file) : undefined;\n if (!scan || scan.stamp !== stamp) {\n let text: string;\n try {\n text = fs.readFileSync(file, \"utf-8\");\n } catch {\n continue;\n }\n scan = { stamp: stamp ?? \"\", scan: scanSource(text) };\n if (cache && stamp) cache.sources.set(file, scan);\n }\n for (const token of scan.scan.tokens) tokens.add(token);\n scans.push({ file, scan: scan.scan });\n }\n\n // Dictionaries registered in code are known project-wide, wherever they are read\n for (const { scan } of scans) for (const name of scan.inline) inline.add(name);\n\n for (const { file, scan } of scans) {\n for (const { ref, range } of scan.refs) {\n if (ref.kind === \"dictionary\") {\n if (!known.has(ref.value) && !inline.has(ref.value)) {\n issues.push({\n file,\n level: \"error\",\n code: \"unknown-dictionary\",\n message: `Unknown dictionary \"${ref.value}\"`,\n range,\n dictionary: ref.value,\n });\n }\n continue;\n }\n\n const [name, ...rest] = ref.value.split(\".\");\n const dictionary = known.get(name);\n if (!dictionary) continue; // `t(...)` may belong to another library\n const keyPath = rest.join(\".\");\n const exists = dictionary.paths.some((p) => p === keyPath || p.startsWith(`${keyPath}.`));\n if (!exists) {\n issues.push({\n file,\n level: \"error\",\n code: \"unknown-path\",\n message: `Unknown translation path \"${ref.value}\"`,\n range,\n dictionary: name,\n path: rest,\n });\n }\n }\n }\n\n // 3. Possibly unused dictionaries and keys (heuristic: warnings only)\n if (options.unused !== false) {\n for (const dictionary of dictionaries) {\n if (!tokens.has(dictionary.name)) {\n issues.push({\n file: dictionary.file,\n level: \"warning\",\n code: \"unused-dictionary\",\n message: `Dictionary \"${dictionary.name}\" is never referenced`,\n range: dictionary.df ? dictionaryLocation(dictionary.df) : undefined,\n dictionary: dictionary.name,\n });\n continue;\n }\n for (const keyPath of dictionary.paths) {\n const last = keyPath.split(\".\").pop()!;\n if (tokens.has(last)) continue;\n const holder = dictionary.locales.find((l) => dictionary.leaves.get(l)?.has(keyPath));\n issues.push({\n file: dictionary.file,\n level: \"warning\",\n code: \"unused-key\",\n message: `Key \"${keyPath}\" is possibly unused`,\n range:\n dictionary.df && holder\n ? locationOf(dictionary.df, holder, keyPath.split(\".\"))\n : undefined,\n dictionary: dictionary.name,\n path: keyPath.split(\".\"),\n });\n }\n }\n }\n }\n\n if (cache) {\n const live = new Set([...files, ...sourceFiles]);\n for (const map of [cache.dictionaries, cache.sources] as Map<string, unknown>[]) {\n for (const key of map.keys()) if (key.startsWith(root) && !live.has(key)) map.delete(key);\n }\n }\n\n const rules = config.lint?.rules;\n if (rules && Object.keys(rules).length > 0) {\n for (let i = issues.length - 1; i >= 0; i--) {\n const level = lintLevel(rules[issues[i].code]);\n if (!level) continue;\n if (level === \"off\") issues.splice(i, 1);\n else issues[i].level = level === \"error\" ? \"error\" : \"warning\";\n }\n }\n\n return {\n issues,\n dictionaries,\n files,\n sourceFilesScanned: sourceFiles.length,\n inlineDictionaries: [...inline],\n };\n}\n","import path from \"node:path\";\n\nimport { parseDictionaryText } from \"../utils/dictionary/index.js\";\nimport {\n cachedDictionary,\n cachedDictionaryStatic,\n fromParsed,\n UNANALYZABLE,\n} from \"./load-dictionary.js\";\nimport { analysisSteps } from \"./steps.js\";\nimport type { AnalysisOptions, AnalysisResult } from \"./types.js\";\n\n/**\n * Project analysis shared by `dialex check` and the editor extension.\n *\n * It reads dictionaries from the syntax tree, so it never runs project code. Dictionaries that\n * cannot be read that way (spreads, computed keys, imported values) are skipped with an `info`\n * issue, unless `runtime: true` is passed, in which case they are imported and read from the\n * evaluated module (the CLI does this; editors must not).\n */\n\nexport type {\n AnalysisCache,\n AnalysisConfig,\n AnalysisIssue,\n AnalysisOptions,\n AnalysisResult,\n AnalyzedDictionary,\n IssueCode,\n IssueLevel,\n LeafInfo,\n LintSetting,\n Reference,\n} from \"./types.js\";\nexport { clearGitignore, createAnalysisCache } from \"./cache.js\";\nexport { DEFAULT_SOURCE_GLOB, scanReferences, scanText } from \"./source-scan.js\";\n\n/** Analyzes a project. With `runtime: true`, dictionaries the syntax tree cannot describe are imported. */\nexport async function analyzeProject(options: AnalysisOptions): Promise<AnalysisResult> {\n const steps = analysisSteps(options);\n let step = steps.next();\n while (!step.done) {\n const { file, runtime, cache, text } = step.value;\n step = steps.next(\n text === undefined\n ? await cachedDictionary(file, runtime, cache)\n : (fromParsed(() => parseDictionaryText(file, text)) ?? UNANALYZABLE),\n );\n }\n return step.value;\n}\n\n/**\n * `analyzeProject` for callers that cannot await, such as lint rules. Reads dictionaries from the\n * syntax tree only: `runtime` is ignored, so project code is never executed.\n */\nexport function analyzeProjectSync(options: AnalysisOptions): AnalysisResult {\n const steps = analysisSteps({ ...options, runtime: false });\n let step = steps.next();\n while (!step.done) {\n const { file, cache, text } = step.value;\n step = steps.next(\n text === undefined\n ? cachedDictionaryStatic(file, cache)\n : (fromParsed(() => parseDictionaryText(file, text)) ?? UNANALYZABLE),\n );\n }\n return step.value;\n}\n\n/** Project root-relative path with forward slashes, for display. */\nexport function relativeFile(root: string, file: string): string {\n return path.relative(root, file);\n}\n","import pc from \"picocolors\";\n\nexport const logger = {\n info: (msg: string) => console.log(pc.blue(\"ℹ \") + msg),\n success: (msg: string) => console.log(pc.green(\"✔ \") + pc.bold(msg)),\n warn: (msg: string) => console.warn(pc.yellow(\"⚠ \") + msg),\n error: (msg: string) => console.error(pc.red(\"✖ \") + pc.bold(msg)),\n log: (msg: string) => console.log(msg),\n};\n","import { loadConfigSync } from \"unconfig\";\n\n/** What running a config file produced. */\nexport interface LoadedConfig {\n /** The exported config object, exactly as the file built it (functions and all). */\n config: Record<string, unknown>;\n /** The config file that was run, absolute. */\n file: string;\n}\n\n/**\n * Runs the first config file that exists (`dialex.config.*`, then `i18n.config.*`, or\n * `configFile`) with `unconfig` and returns what it exports. **This executes project code.**\n * Returns `undefined` when the project has no config file; throws what the file throws.\n */\nexport function loadConfigObject(root: string, configFile?: string): LoadedConfig | undefined {\n const sources: any[] = [];\n if (configFile) sources.push({ files: configFile });\n for (const name of [\"dialex.config\", \"i18n.config\"]) {\n sources.push({ files: name, extensions: [\"ts\", \"mts\", \"cts\", \"js\", \"mjs\", \"cjs\", \"json\", \"\"] });\n }\n\n const result = loadConfigSync<Record<string, unknown>>({\n sources,\n merge: false,\n defaults: {},\n cwd: root,\n });\n const file = result?.sources?.[0];\n if (!file) return undefined;\n\n const config = result.config && typeof result.config === \"object\" ? result.config : {};\n return { config, file };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { DEFAULT_CONFIG, type DialexConfig } from \"dialexjs\";\n\nimport { loadConfigObject } from \"./load-config.js\";\n\nexport function resolveDialexConfig(root: string, inlineConfig: DialexConfig = {}): DialexConfig {\n let loadedConfig: DialexConfig = {};\n try {\n const loaded = loadConfigObject(root, inlineConfig.configFile);\n if (loaded) loadedConfig = loaded.config as DialexConfig;\n } catch {\n // Config fallback\n }\n\n return {\n ...DEFAULT_CONFIG,\n ...loadedConfig,\n ...inlineConfig,\n };\n}\n\n/** Every adapter entry point that has its own `DictionaryRegistry` to augment. */\nexport const REGISTRY_ADAPTERS = [\n \"react\",\n \"server\",\n \"hono\",\n \"express\",\n \"fastify\",\n \"koa\",\n \"nestjs\",\n \"elysia\",\n \"sveltekit\",\n \"astro\",\n \"vue\",\n \"web\",\n \"h3\",\n \"angular\",\n \"svelte\",\n \"solid\",\n \"preact\",\n \"qwik\",\n \"lit\",\n \"hapi\",\n \"adonis\",\n \"trpc\",\n] as const;\n\n/** Dependencies that tell which `dialexjs/*` entry points a project can import. */\nconst ADAPTER_DEPENDENCIES: Record<string, string[]> = {\n react: [\"react\"],\n \"react-dom\": [\"react\"],\n next: [\"react\", \"server\"],\n hono: [\"hono\"],\n express: [\"express\"],\n fastify: [\"fastify\"],\n koa: [\"koa\"],\n \"@nestjs/core\": [\"nestjs\"],\n \"@nestjs/common\": [\"nestjs\"],\n elysia: [\"elysia\"],\n \"@sveltejs/kit\": [\"sveltekit\"],\n astro: [\"astro\"],\n vue: [\"vue\"],\n nuxt: [\"vue\", \"h3\"],\n h3: [\"h3\"],\n nitropack: [\"h3\"],\n \"@angular/core\": [\"angular\"],\n svelte: [\"svelte\"],\n \"solid-js\": [\"solid\"],\n preact: [\"preact\"],\n \"@builder.io/qwik\": [\"qwik\"],\n lit: [\"lit\"],\n \"@hapi/hapi\": [\"hapi\"],\n \"@adonisjs/core\": [\"adonis\"],\n \"@adonisjs/http-server\": [\"adonis\"],\n \"@trpc/server\": [\"trpc\"],\n // `dialexjs/react-native` re-exports the hooks of `dialexjs/react`, so one registry serves both.\n \"react-native\": [\"react\"],\n expo: [\"react\"],\n // Frameworks that hand you a standard `Request`, served by `dialexjs/web`.\n \"react-router\": [\"web\"],\n \"react-router-dom\": [\"web\"],\n \"@remix-run/react\": [\"web\"],\n \"@remix-run/node\": [\"web\"],\n \"@tanstack/react-start\": [\"web\"],\n \"@solidjs/start\": [\"web\"],\n wrangler: [\"web\"],\n};\n\n/**\n * The adapter entry points to augment for a project, read from its `package.json`. Falls back to\n * all of them when nothing is recognised, so types never silently go missing.\n */\nexport function detectAdapters(root: string): string[] {\n try {\n const pkg = JSON.parse(fs.readFileSync(path.join(root, \"package.json\"), \"utf-8\"));\n const deps = { ...pkg.dependencies, ...pkg.devDependencies, ...pkg.peerDependencies };\n const found = new Set<string>();\n for (const name of Object.keys(deps)) {\n for (const adapter of ADAPTER_DEPENDENCIES[name] ?? []) found.add(adapter);\n }\n if (found.size > 0) return REGISTRY_ADAPTERS.filter((adapter) => found.has(adapter));\n } catch {\n // no readable package.json\n }\n return [...REGISTRY_ADAPTERS];\n}\n\n/**\n * The `dialex-env.d.ts` a project should have: its path and contents, or `undefined` when there\n * are no dictionary files. Nothing is written.\n */\nexport function renderDts(\n root: string,\n files: string[],\n locales?: string[],\n messageArguments: Record<string, string> = {},\n /** Where to write `dialex-env.d.ts`. Defaults to `src/` when it exists, otherwise `root`. */\n directory?: string,\n): { path: string; content: string } | undefined {\n if (files.length === 0) return undefined;\n\n const dtsDir =\n directory ?? (fs.existsSync(path.join(root, \"src\")) ? path.join(root, \"src\") : root);\n const imports: string[] = [];\n const records: string[] = [];\n\n files.forEach((file, index) => {\n let relPath = path.relative(dtsDir, file).replace(/\\\\/g, \"/\");\n relPath = relPath.replace(/\\.ts$/, \"\");\n if (!relPath.startsWith(\".\")) {\n relPath = \"./\" + relPath;\n }\n\n imports.push(`import dict${index} from '${relPath}';`);\n records.push(\n `Record<typeof dict${index}['name'], typeof dict${index}['dictionary'][keyof typeof dict${index}['dictionary']]>`,\n );\n });\n\n const localesType =\n locales && locales.length > 0 ? locales.map((l) => `\"${l}\"`).join(\" | \") : \"string\";\n\n const registry = records.join(\",\\n \");\n const messageEntries = Object.entries(messageArguments)\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([key, type]) => ` ${JSON.stringify(key)}: ${type};`)\n .join(\"\\n\");\n const adapterBlocks = detectAdapters(root)\n .map(\n (adapter) => `\ndeclare module 'dialexjs/${adapter}' {\n export interface DictionaryRegistry extends ${registry} {}\n}\n`,\n )\n .join(\"\");\n\n const dtsContent = `/* eslint-disable */\n// @ts-nocheck\n// Generated by dialex\n${imports.join(\"\\n\")}\n\ndeclare module 'dialexjs' {\n export interface Register {\n locales: ${localesType};\n }\n export interface DictionaryRegistry extends ${records.join(\",\\n \")} {}\n export interface MessageArguments {${messageEntries ? `\\n${messageEntries}\\n ` : \"\"}}\n}\n${adapterBlocks}\n`;\n\n return { path: path.join(dtsDir, \"dialex-env.d.ts\"), content: dtsContent };\n}\n\nexport function generateDts(root: string, files: string[], locales?: string[]) {\n const dts = renderDts(root, files, locales);\n if (!dts) return;\n const existing = fs.existsSync(dts.path) ? fs.readFileSync(dts.path, \"utf-8\") : \"\";\n if (existing !== dts.content) {\n fs.mkdirSync(path.dirname(dts.path), { recursive: true });\n fs.writeFileSync(dts.path, dts.content, \"utf-8\");\n }\n}\n","import { getArguments, parseMessage, type IcuArgument } from \"dialexjs/icu\";\n\nimport { listLeaves, listLocales, type DictionaryFile } from \"./dictionary/index.js\";\n\nconst IDENTIFIER = /^[A-Za-z_$][\\w$]*$/;\n\n/**\n * The TypeScript type of one ICU argument. A name can appear more than once (in a `plural` and as\n * a plain `{name}`, say); the narrowest use wins, because that is the value the message needs.\n */\nfunction typeOfArgument(uses: IcuArgument[]): string {\n if (uses.some((u) => u.type === \"plural\" || u.type === \"selectordinal\" || u.type === \"number\")) {\n return \"number\";\n }\n if (uses.some((u) => u.type === \"date\" || u.type === \"time\")) return \"Date | number\";\n const select = uses.find((u) => u.type === \"select\");\n if (select) {\n const options = (select.selectors ?? []).filter((s) => s !== \"other\");\n return options.length > 0\n ? `${options.map((o) => JSON.stringify(o)).join(\" | \")} | (string & {})`\n : \"string\";\n }\n return \"string | number | boolean | Date\";\n}\n\n/** `{ count: number; name: string | number | boolean | Date }` for the arguments of one message. */\nexport function messageType(message: string): string | undefined {\n if (!message.includes(\"{\")) return undefined;\n let args: IcuArgument[];\n try {\n args = getArguments(parseMessage(message));\n } catch {\n return undefined; // not valid ICU; `dx check` reports it\n }\n if (args.length === 0) return undefined;\n\n const byName = new Map<string, IcuArgument[]>();\n for (const arg of args) byName.set(arg.name, [...(byName.get(arg.name) ?? []), arg]);\n const members = [...byName].map(\n ([name, uses]) =>\n `${IDENTIFIER.test(name) ? name : JSON.stringify(name)}: ${typeOfArgument(uses)}`,\n );\n return `{ ${members.join(\"; \")} }`;\n}\n\n/**\n * `dictionary.key.path` to the type of its ICU values, read from each dictionary's reference\n * locale (the default locale when the dictionary has it, otherwise its first). Other locales must\n * use the same arguments, which `dx check` verifies.\n */\nexport function messageArguments(\n dictionaries: (DictionaryFile | undefined)[],\n defaultLocale: string,\n): Record<string, string> {\n const result: Record<string, string> = {};\n for (const df of dictionaries) {\n if (!df?.name) continue;\n const locales = listLocales(df);\n const reference = locales.includes(defaultLocale) ? defaultLocale : locales[0];\n if (!reference) continue;\n for (const leaf of listLeaves(df, reference)) {\n if (leaf.kind !== \"string\" || leaf.value === undefined) continue;\n const type = messageType(leaf.value);\n if (type) result[`${df.name}.${leaf.path.join(\".\")}`] = type;\n }\n }\n return result;\n}\n","import { generateCode } from \"magicast\";\n\nimport { isObjectNode, propertyKeyName, unwrapNode, type AstNode } from \"./ast.js\";\nimport type { DictionaryFile } from \"./dictionary/index.js\";\n\nexport interface LocaleSlice {\n locale: string;\n /** Source of the locale's object, ready for `export default <code>`. */\n code: string;\n}\n\nexport type SplitResult = { ok: true; slices: LocaleSlice[] } | { ok: false; reason: string };\n\nconst SKIPPED_KEYS = new Set([\n \"loc\",\n \"start\",\n \"end\",\n \"extra\",\n \"range\",\n \"comments\",\n \"leadingComments\",\n \"trailingComments\",\n \"innerComments\",\n \"tokens\",\n]);\n\n/** Every identifier name used in a node, except property names that are not variable references. */\nfunction usedNames(node: unknown, found = new Set<string>()): Set<string> {\n if (!node || typeof node !== \"object\") return found;\n if (Array.isArray(node)) {\n node.forEach((child) => usedNames(child, found));\n return found;\n }\n const ast = node as AstNode;\n if (ast.type === \"Identifier\") found.add(ast.name);\n\n for (const key of Object.keys(ast)) {\n if (SKIPPED_KEYS.has(key)) continue;\n const isPropertyName =\n key === \"key\" &&\n !ast.computed &&\n [\"ObjectProperty\", \"ObjectMethod\", \"TSPropertySignature\", \"TSMethodSignature\"].includes(\n ast.type,\n );\n const isMemberName =\n key === \"property\" &&\n !ast.computed &&\n (ast.type === \"MemberExpression\" || ast.type === \"OptionalMemberExpression\");\n if (isPropertyName || isMemberName) continue;\n usedNames(ast[key], found);\n }\n return found;\n}\n\n/** Names bound anywhere in a pattern (`const { a, b: [c] } = ...`). */\nfunction patternNames(pattern: AstNode | undefined, found: Set<string>) {\n if (!pattern) return;\n switch (pattern.type) {\n case \"Identifier\":\n found.add(pattern.name);\n break;\n case \"ObjectPattern\":\n for (const prop of pattern.properties) patternNames(prop.value ?? prop.argument, found);\n break;\n case \"ArrayPattern\":\n for (const element of pattern.elements) patternNames(element ?? undefined, found);\n break;\n case \"AssignmentPattern\":\n patternNames(pattern.left, found);\n break;\n case \"RestElement\":\n patternNames(pattern.argument, found);\n break;\n }\n}\n\n/** What the file declares or imports at the top level: a locale that uses any of it cannot move. */\nfunction topLevelNames(df: DictionaryFile): Set<string> {\n const names = new Set<string>();\n const program: AstNode = (df.mod as any).$ast;\n const statements: AstNode[] = program?.body ?? program?.program?.body ?? [];\n for (const raw of statements) {\n const statement =\n raw.type === \"ExportNamedDeclaration\" && raw.declaration ? raw.declaration : raw;\n switch (statement.type) {\n case \"ImportDeclaration\":\n for (const specifier of statement.specifiers) names.add(specifier.local.name);\n break;\n case \"VariableDeclaration\":\n for (const declarator of statement.declarations) patternNames(declarator.id, names);\n break;\n case \"FunctionDeclaration\":\n case \"ClassDeclaration\":\n case \"TSInterfaceDeclaration\":\n case \"TSTypeAliasDeclaration\":\n case \"TSEnumDeclaration\":\n if (statement.id?.name) names.add(statement.id.name);\n break;\n }\n }\n return names;\n}\n\n/**\n * Cuts a dictionary into one self-contained piece per locale, for `lazy: \"locale\"`.\n *\n * A piece moves to its own file, so it must not depend on anything else in the original file.\n * That is checked conservatively: if a locale uses any name the file imports or declares (even one\n * that is only shadowed), the whole file is left alone. A missed split costs bytes; a wrong split\n * would break the app.\n */\nexport function splitLocales(df: DictionaryFile): SplitResult {\n if (!df.complete) {\n return { ok: false, reason: \"it uses spreads, computed keys or non-literal locale values\" };\n }\n\n const bound = topLevelNames(df);\n const slices: LocaleSlice[] = [];\n\n for (const prop of df.localesObj.properties as AstNode[]) {\n const locale = propertyKeyName(prop);\n const value = unwrapNode(prop.value);\n if (locale === undefined || !isObjectNode(value)) {\n return { ok: false, reason: \"a locale is not an object literal\" };\n }\n const clash = [...usedNames(value)].find((name) => bound.has(name));\n if (clash) {\n return {\n ok: false,\n reason: `\"${locale}\" uses \"${clash}\", which is defined elsewhere in the file`,\n };\n }\n slices.push({ locale, code: generateCode(value as any).code });\n }\n\n if (slices.length === 0) return { ok: false, reason: \"it defines no locales\" };\n return { ok: true, slices };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport type { LintRuleSetting } from \"dialexjs\";\nimport { parseModule } from \"magicast\";\n\nimport { findProperty, isObjectNode, propertyKeyName, unwrapNode, type AstNode } from \"./ast.js\";\n\n/**\n * The parts of `dialex.config` that tooling needs, read **without running the file**. Editors must\n * not execute workspace code (it may be untrusted), so values are read from the syntax tree and\n * only literals are understood.\n */\nexport interface StaticConfig {\n defaultLocale: string;\n locales: string[];\n include: string | string[];\n exclude: string[];\n /** Where the generated file goes, when the config sets it. */\n output?: string;\n fallbacks: Record<string, string[]>;\n prefixDefault: boolean;\n lazy: boolean | \"locale\";\n /** Severity and options of each check, by diagnostic code. */\n lint: { rules: Record<string, LintRuleSetting> };\n}\n\nexport interface StaticConfigResult {\n config: StaticConfig;\n /** The file the values came from, if any. */\n file?: string;\n /** Things that could not be read statically, for example `locales: getLocales()`. */\n notes: string[];\n /**\n * The config object has a spread or a computed key, so it may set things this reader cannot\n * see. Only running the file gives a trustworthy answer.\n */\n opaque: boolean;\n}\n\n/** The names a config file can have, without extension, in order of preference. */\nexport const CONFIG_NAMES = [\"dialex.config\", \"i18n.config\"];\n/** The extensions tried for each name, in order. */\nexport const CONFIG_EXTENSIONS = [\"ts\", \"mts\", \"cts\", \"js\", \"mjs\", \"cjs\", \"json\"];\n\n/** The keys of the config that tooling reads. */\nexport const CONFIG_KEYS = [\n \"defaultLocale\",\n \"locales\",\n \"include\",\n \"exclude\",\n \"output\",\n \"fallbacks\",\n \"prefixDefault\",\n \"lazy\",\n \"lint\",\n] as const;\n\n/** The paths `readStaticConfig` and `resolveConfig` try, in order, for a project root. */\nexport function configCandidates(root: string, configFile?: string): string[] {\n return configFile\n ? [path.resolve(root, configFile)]\n : CONFIG_NAMES.flatMap((name) =>\n CONFIG_EXTENSIONS.map((ext) => path.join(root, `${name}.${ext}`)),\n );\n}\n\nexport const DEFAULT_STATIC_CONFIG: StaticConfig = {\n defaultLocale: \"en\",\n locales: [],\n include: \"**/*.content.ts\",\n exclude: [],\n fallbacks: {},\n prefixDefault: true,\n lazy: false,\n lint: { rules: {} },\n};\n\nconst NOT_LITERAL = Symbol(\"not literal\");\n\nfunction literal(node: AstNode | undefined): unknown {\n node = unwrapNode(node as AstNode);\n switch (node?.type) {\n case \"StringLiteral\":\n case \"NumericLiteral\":\n case \"BooleanLiteral\":\n return node.value;\n case \"Literal\":\n return node.value;\n case \"TemplateLiteral\":\n return node.expressions.length === 0 ? (node.quasis[0]?.value?.cooked ?? \"\") : NOT_LITERAL;\n case \"ArrayExpression\": {\n const items = node.elements.map((e: AstNode) => literal(e));\n return items.includes(NOT_LITERAL) ? NOT_LITERAL : items;\n }\n case \"ObjectExpression\": {\n const result: Record<string, unknown> = {};\n for (const prop of node.properties) {\n const key = propertyKeyName(prop);\n const value = key === undefined ? NOT_LITERAL : literal(prop.value);\n if (value === NOT_LITERAL) return NOT_LITERAL;\n result[key as string] = value;\n }\n return result;\n }\n default:\n return NOT_LITERAL;\n }\n}\n\n/** The object literal passed to `defineConfig({...})`, or exported directly. */\nfunction findConfigObject(declaration: AstNode): AstNode | undefined {\n const node = unwrapNode(declaration);\n if (node?.type === \"CallExpression\") return findConfigObject(node.arguments[0]);\n return isObjectNode(node) ? node : undefined;\n}\n\nconst isStringArray = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((v) => typeof v === \"string\");\n\nconst LINT_LEVELS = [\"off\", \"warn\", \"error\"];\n\n/** `lint: { rules: { code: \"warn\" | [\"warn\", {...}] } }`, or `undefined` when it is not that shape. */\nfunction lintRules(value: unknown): Record<string, LintRuleSetting> | undefined {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return undefined;\n const rules = (value as { rules?: unknown }).rules;\n if (rules === undefined) return {};\n if (typeof rules !== \"object\" || rules === null || Array.isArray(rules)) return undefined;\n\n const result: Record<string, LintRuleSetting> = {};\n for (const [code, setting] of Object.entries(rules)) {\n const [level, options] = Array.isArray(setting) ? setting : [setting];\n if (typeof level !== \"string\" || !LINT_LEVELS.includes(level)) return undefined;\n if (options !== undefined && (typeof options !== \"object\" || options === null))\n return undefined;\n result[code] = setting as LintRuleSetting;\n }\n return result;\n}\n\n/**\n * Applies the values of a config object (read from a syntax tree or from a loaded module) over\n * `config`, with the same checks and notes either way.\n */\nexport function applyConfigValues(\n object: Record<string, unknown>,\n config: StaticConfig,\n notes: string[],\n) {\n const accept = <K extends keyof StaticConfig>(\n key: K,\n valid: (value: unknown) => boolean,\n expected: string,\n ) => {\n if (!(key in object)) return;\n const value = object[key];\n if (valid(value)) (config as any)[key] = value;\n else notes.push(`\"${key}\" could not be read statically (expected ${expected}).`);\n };\n\n accept(\"defaultLocale\", (v) => typeof v === \"string\" && v !== \"\", \"a string literal\");\n accept(\"locales\", isStringArray, \"an array of string literals\");\n accept(\n \"include\",\n (v) => typeof v === \"string\" || isStringArray(v),\n \"a string or array of strings\",\n );\n accept(\"exclude\", isStringArray, \"an array of string literals\");\n accept(\"output\", (v) => typeof v === \"string\" && v !== \"\", \"a string literal\");\n accept(\n \"fallbacks\",\n (v) =>\n typeof v === \"object\" && v !== null && Object.values(v).every((list) => isStringArray(list)),\n \"an object of string arrays\",\n );\n accept(\"prefixDefault\", (v) => typeof v === \"boolean\", \"true or false\");\n accept(\"lazy\", (v) => typeof v === \"boolean\" || v === \"locale\", 'true, false or \"locale\"');\n\n if (\"lint\" in object) {\n const rules = lintRules(object.lint);\n if (rules) config.lint = { rules };\n else {\n notes.push(\n '\"lint\" could not be read statically (expected { rules: { code: \"off\" | \"warn\" | \"error\" | [level, options] } }).',\n );\n }\n }\n}\n\n/** Reads a config file's source text. Exposed for tests and for unsaved buffers. */\nexport function parseStaticConfig(text: string, file = \"dialex.config.ts\"): StaticConfigResult {\n const notes: string[] = [];\n const config: StaticConfig = { ...DEFAULT_STATIC_CONFIG };\n let opaque = false;\n\n if (file.endsWith(\".json\")) {\n try {\n const data = JSON.parse(text);\n if (data && typeof data === \"object\") applyConfigValues(data, config, notes);\n } catch (error) {\n notes.push(`Could not parse ${path.basename(file)}: ${(error as Error).message}`);\n }\n return { config, file, notes, opaque };\n }\n\n try {\n const exported = (parseModule(text).exports as any).default;\n const object = findConfigObject(exported?.$ast?.declaration ?? exported?.$ast);\n if (!object) {\n notes.push(`${path.basename(file)} does not export a config object literal.`);\n } else {\n const values: Record<string, unknown> = {};\n opaque = object.properties.some(\n (p: AstNode) =>\n p.type === \"SpreadElement\" || p.type === \"SpreadProperty\" || p.computed === true,\n );\n for (const key of CONFIG_KEYS) {\n const prop = findProperty(object, key);\n if (!prop) continue;\n const value = literal(prop.value);\n if (value === NOT_LITERAL)\n notes.push(`\"${key}\" could not be read statically (not a literal).`);\n else values[key] = value;\n }\n applyConfigValues(values, config, notes);\n }\n } catch (error) {\n notes.push(`Could not parse ${path.basename(file)}: ${(error as Error).message}`);\n }\n\n return { config, file, notes, opaque };\n}\n\n/** Reads `dialex.config.*` (or `i18n.config.*`) from `root`, or from `configFile` if given. */\nexport function readStaticConfig(root: string, configFile?: string): StaticConfigResult {\n for (const file of configCandidates(root, configFile)) {\n if (fs.existsSync(file)) return parseStaticConfig(fs.readFileSync(file, \"utf-8\"), file);\n }\n return { config: { ...DEFAULT_STATIC_CONFIG }, notes: [], opaque: false };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\n/** Parses tsconfig-style JSON: comments and trailing commas are allowed. */\nexport function parseJsonc(text: string): any {\n let out = \"\";\n let inString = false;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if (inString) {\n out += c;\n if (c === \"\\\\\") out += text[++i] ?? \"\";\n else if (c === '\"') inString = false;\n } else if (c === '\"') {\n inString = true;\n out += c;\n } else if (c === \"/\" && text[i + 1] === \"/\") {\n while (i < text.length && text[i] !== \"\\n\") i++;\n out += \"\\n\";\n } else if (c === \"/\" && text[i + 1] === \"*\") {\n i += 2;\n while (i < text.length && !(text[i] === \"*\" && text[i + 1] === \"/\")) i++;\n i++;\n } else {\n out += c;\n }\n }\n return JSON.parse(out.replace(/,(\\s*[}\\]])/g, \"$1\"));\n}\n\ninterface Resolved {\n moduleResolution?: string;\n include?: string[];\n references: string[];\n}\n\nfunction configFile(from: string): string | undefined {\n if (fs.existsSync(from) && fs.statSync(from).isFile()) return from;\n for (const candidate of [`${from}.json`, path.join(from, \"tsconfig.json\")]) {\n if (fs.existsSync(candidate) && fs.statSync(candidate).isFile()) return candidate;\n }\n return undefined;\n}\n\n/** A package in `extends` (`@adonisjs/tsconfig/tsconfig.app.json`), looked up from `dir` upwards. */\nfunction packageConfig(from: string, specifier: string): string | undefined {\n for (let dir = from; ; dir = path.dirname(dir)) {\n const found = configFile(path.join(dir, \"node_modules\", specifier));\n if (found) return found;\n if (path.dirname(dir) === dir) return undefined;\n }\n}\n\n/** `moduleResolution` and `include` of a tsconfig, following `extends` (relative or a package). */\nfunction read(file: string, depth = 0): Resolved {\n const result: Resolved = { references: [] };\n let json: any;\n try {\n json = parseJsonc(fs.readFileSync(file, \"utf-8\"));\n } catch {\n return result;\n }\n const dir = path.dirname(file);\n\n // `extends` may list several configs; later ones override earlier ones, and this file overrides all.\n const parents: unknown[] = Array.isArray(json.extends) ? json.extends : [json.extends];\n for (const extendsFrom of parents) {\n if (typeof extendsFrom !== \"string\" || depth >= 5) continue;\n const parent = extendsFrom.startsWith(\".\")\n ? configFile(path.resolve(dir, extendsFrom))\n : packageConfig(dir, extendsFrom);\n if (parent) Object.assign(result, read(parent, depth + 1));\n }\n\n const options = json.compilerOptions ?? {};\n const module = typeof options.module === \"string\" ? options.module.toLowerCase() : undefined;\n const resolution =\n typeof options.moduleResolution === \"string\"\n ? options.moduleResolution.toLowerCase()\n : module === \"node16\" || module === \"nodenext\"\n ? module\n : undefined;\n if (resolution) result.moduleResolution = resolution;\n if (Array.isArray(json.include)) result.include = json.include;\n result.references = (json.references ?? [])\n .map((ref: any) =>\n typeof ref?.path === \"string\" ? configFile(path.resolve(dir, ref.path)) : undefined,\n )\n .filter(Boolean) as string[];\n return result;\n}\n\n/**\n * The extension for relative imports in generated files. TypeScript's `node16`/`nodenext` need\n * `./x.js`; bundlers (webpack, Vite) resolve extensionless imports, and webpack cannot map `.js`\n * to a `.ts` file. Without any tsconfig it is plain Node ESM, which needs the extension.\n */\nexport function relativeImportExtension(root: string): \".js\" | \"\" {\n const file = configFile(path.join(root, \"tsconfig.json\"));\n if (!file) return \".js\";\n\n let resolved = read(file);\n if (!resolved.moduleResolution && resolved.references.length > 0) {\n // A \"solution\" tsconfig: use the referenced project that covers src/.\n const projects = resolved.references.map((ref) => read(ref));\n resolved =\n projects.find((p) => p.include?.some((entry) => /^(\\.\\/)?src(\\/|$)/.test(entry))) ??\n projects[0] ??\n resolved;\n }\n const resolution = resolved.moduleResolution;\n return resolution === \"node16\" || resolution === \"nodenext\" ? \".js\" : \"\";\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { DEFAULT_CONFIG } from \"dialexjs\";\n\nimport { listLocales, parseDictionaryText } from \"../../utils/dictionary/index.js\";\nimport { scanFiles } from \"../../utils/files.js\";\nimport { messageArguments } from \"../../utils/message-arguments.js\";\nimport { renderDts, resolveDialexConfig } from \"../../utils/scanner.js\";\nimport { splitLocales } from \"../../utils/split-locales.js\";\nimport { readStaticConfig } from \"../../utils/static-config.js\";\nimport { relativeImportExtension } from \"../../utils/tsconfig.js\";\nimport type { GenerateOptions, RenderedGenerate } from \"./types.js\";\n\n/** The folder, next to `dialex.generated.ts`, that holds the per-locale modules. */\nexport const LOCALES_DIR = \"dialex.locales\";\nconst safeName = (text: string) => text.replace(/[^A-Za-z0-9._-]/g, \"_\");\n\n/**\n * Works out `dialex.generated.ts` and `dialex-env.d.ts` for a project without writing anything,\n * so `check` can tell whether they are up to date.\n *\n * Settings come from `dialex.config.*` and fall back to {@link DEFAULT_CONFIG}; `locales` falls\n * back to the locales the dictionaries define.\n */\nexport function renderGenerated(root: string, options: GenerateOptions = {}): RenderedGenerate {\n const inlineConfig = options.config ? { configFile: options.config } : {};\n const staticRead = readStaticConfig(root, options.config);\n const config = options.static ? staticRead.config : resolveDialexConfig(root, inlineConfig);\n const include = config.include || DEFAULT_CONFIG.include;\n\n const found = scanFiles(root, include, { exclude: config.exclude }).sort();\n\n const srcDir = fs.existsSync(path.join(root, \"src\")) ? path.join(root, \"src\") : root;\n const outputOption = options.output ?? config.output;\n const outputPath = outputOption\n ? path.resolve(root, outputOption)\n : path.join(srcDir, \"dialex.generated.ts\");\n const outputDir = path.dirname(outputPath);\n // A broad `include` (like `src/**/*.ts`) would otherwise match the files generated here\n const files = found.filter(\n (file) =>\n file !== outputPath &&\n !file.endsWith(\".d.ts\") &&\n path.basename(file) !== \"dialex.generated.ts\",\n );\n\n // Read each dictionary's name and locales from its syntax tree; project code is never run.\n const parsed = files.map((file) => parseDictionaryText(file, fs.readFileSync(file, \"utf-8\")));\n const inferred: string[] = [];\n for (const df of parsed) {\n if (df)\n for (const locale of listLocales(df)) if (!inferred.includes(locale)) inferred.push(locale);\n }\n const locales = config.locales?.length ? config.locales : inferred;\n\n const clientConfig = {\n defaultLocale: config.defaultLocale || DEFAULT_CONFIG.defaultLocale,\n locales,\n fallbacks: config.fallbacks ?? DEFAULT_CONFIG.fallbacks,\n prefixDefault: config.prefixDefault ?? DEFAULT_CONFIG.prefixDefault,\n lazy: config.lazy ?? DEFAULT_CONFIG.lazy,\n };\n\n const extension = relativeImportExtension(root);\n const importPath = (file: string) => {\n let rel = path.relative(outputDir, file).replace(/\\\\/g, \"/\").replace(/\\.ts$/, extension);\n if (!rel.startsWith(\".\")) rel = \"./\" + rel;\n return rel;\n };\n\n const header = `// Auto-generated by dialex CLI. Do not edit directly.\n/* eslint-disable */\n// @ts-nocheck`;\n // \"locale\" must stay a literal type, or `<DialexProvider {...dialex}>` would not type-check\n const configJson = JSON.stringify(clientConfig, null, 2).replace(\n '\"lazy\": \"locale\"',\n '\"lazy\": \"locale\" as const',\n );\n const configExport = `export const config = ${configJson};\n\n${\n locales.length > 0\n ? `export const locales = ${JSON.stringify(locales)} as const;\\nexport type Locale = (typeof locales)[number];`\n : \"export const locales: readonly string[] = [];\\nexport type Locale = string;\"\n}`;\n\n const extraFiles: { path: string; content: string }[] = [];\n const notes: string[] = [];\n const takenNames = new Set<string>();\n\n let content: string;\n if (clientConfig.lazy) {\n // Only dynamic imports, so bundlers can split each dictionary (or, with \"locale\", each\n // locale of it) into its own chunk.\n const loaders = files.map((file, i) => {\n const df = parsed[i];\n const name = df?.name;\n if (!name || !df) {\n throw new Error(\n `Cannot determine the dictionary name of ${path.relative(root, file)} for lazy loading. ` +\n 'Use defineDictionary(\"name\", ...) or a literal `name` property.',\n );\n }\n const whole = ` ${JSON.stringify(name)}: () => import(\"${importPath(file)}\"),`;\n if (clientConfig.lazy !== \"locale\") return whole;\n\n const split = splitLocales(df);\n if (!split.ok) {\n notes.push(\n `${path.relative(root, file)} is loaded whole, not per locale: ${split.reason}.`,\n );\n return whole;\n }\n let base = safeName(name);\n for (let n = 2; takenNames.has(base); n++) base = `${safeName(name)}-${n}`;\n takenNames.add(base);\n\n const entries = split.slices.map((slice) => {\n const target = path.join(outputDir, LOCALES_DIR, `${base}.${safeName(slice.locale)}.ts`);\n extraFiles.push({\n path: target,\n content: `${header}\\nexport default ${slice.code};\\n`,\n });\n return ` ${JSON.stringify(slice.locale)}: () => import(\"${importPath(target)}\"),`;\n });\n return ` ${JSON.stringify(name)}: {\\n${entries.join(\"\\n\")}\\n },`;\n });\n content = `${header}\n\nexport const dictionaries = [];\n\nexport const dictionaryMap = {};\n\nexport const loaders = {\n${loaders.join(\"\\n\")}\n};\n\n${configExport}\n\nexport const dialex = { dictionaries, config, loaders };\n\nexport default dictionaries;\n`;\n } else {\n const ids = files.map((_, i) => `dict_${i}`);\n const dictList = ids.length <= 1 ? `[${ids.join(\", \")}]` : `[\\n ${ids.join(\",\\n \")}\\n]`;\n content = `${header}\n${files.map((file, i) => `import ${ids[i]} from \"${importPath(file)}\";`).join(\"\\n\")}\n\nexport const dictionaries = ${dictList};\n\nexport const dictionaryMap = {\n${ids.map((id) => ` [${id}.name]: ${id}.dictionary,`).join(\"\\n\")}\n};\n\n${configExport}\n\nexport const dialex = { dictionaries, config };\n\nexport default dictionaries;\n`;\n }\n\n const dts = renderDts(\n root,\n files,\n locales,\n messageArguments(parsed, clientConfig.defaultLocale),\n outputOption ? outputDir : undefined,\n );\n return {\n files,\n outputPath,\n content,\n dtsPath: dts?.path ?? path.join(outputOption ? outputDir : srcDir, \"dialex-env.d.ts\"),\n dtsContent: dts?.content,\n configFile: staticRead.file,\n extraFiles,\n notes,\n };\n}\n","import path from \"node:path\";\n\nimport chokidar from \"chokidar\";\n\nimport { createGitignoreFilter } from \"../../utils/files.js\";\nimport { logger } from \"../../utils/logger.js\";\nimport { renderGenerated } from \"./render.js\";\nimport type { GenerateOptions } from \"./types.js\";\n\nconst WATCH_IGNORED =\n /(^|[\\\\/])(node_modules|dist|\\.next|\\.nuxt|\\.output|\\.turbo|\\.git|dialex\\.locales)([\\\\/]|$)/;\nconst CONFIG_FILE = /(^|[\\\\/])(dialex|i18n)\\.config\\.[cm]?[jt]s(on)?$/;\n\n/**\n * Regenerates when a dictionary or config file is added, edited or removed. chokidar 4+ no longer\n * understands globs, so this watches the project directory and decides for itself which events\n * matter, using the same `include` glob as `generate`.\n */\nexport function startGenerateWatcher(\n root: string,\n options: GenerateOptions,\n regenerate: () => void,\n delay = 100,\n /** Where to report what triggered a regeneration. Defaults to the CLI logger (stdout). */\n log: (message: string) => void = (message) => logger.info(message),\n) {\n const dictionaryFiles = () => new Set(renderGenerated(root, options).files);\n let known = dictionaryFiles();\n let outputs = new Set<string>();\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n const trigger = () => {\n if (timer) clearTimeout(timer);\n timer = setTimeout(() => {\n regenerate();\n try {\n known = dictionaryFiles();\n const rendered = renderGenerated(root, options);\n outputs = new Set([rendered.outputPath, rendered.dtsPath]);\n } catch {\n // keep the previous list; the next event tries again\n }\n }, delay);\n };\n\n const gitIgnored = createGitignoreFilter(root);\n const watcher = chokidar.watch(root, {\n ignoreInitial: true,\n ignored: (file: string) => WATCH_IGNORED.test(file) || gitIgnored(path.resolve(root, file)),\n });\n\n watcher.on(\"all\", (event, filePath) => {\n const file = path.resolve(root, filePath);\n if (outputs.has(file)) return; // our own output\n const isConfig = CONFIG_FILE.test(file);\n\n if (event === \"change\") {\n if (!known.has(file) && !isConfig) return;\n } else if (event === \"add\" || event === \"unlink\") {\n let now: Set<string>;\n try {\n now = dictionaryFiles();\n } catch {\n return;\n }\n const changed = now.size !== known.size || [...now].some((f) => !known.has(f));\n if (!changed && !isConfig) return;\n } else {\n return;\n }\n\n log(`[${event}] ${path.relative(root, file)} changed, regenerating...`);\n trigger();\n });\n\n return watcher;\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { LOCALES_DIR, renderGenerated } from \"./render.js\";\nimport type { GenerateOptions } from \"./types.js\";\n\nfunction writeIfChanged(file: string, content: string) {\n const existing = fs.existsSync(file) ? fs.readFileSync(file, \"utf-8\") : \"\";\n if (existing === content) return;\n fs.mkdirSync(path.dirname(file), { recursive: true });\n fs.writeFileSync(file, content, \"utf-8\");\n}\n\nexport function generateDictionaries(\n root: string,\n options: GenerateOptions = {},\n): {\n files: string[];\n outputPath: string;\n dtsPath: string;\n configFile?: string;\n notes: string[];\n} {\n const rendered = renderGenerated(root, options);\n if (rendered.dtsContent !== undefined) writeIfChanged(rendered.dtsPath, rendered.dtsContent);\n writeIfChanged(rendered.outputPath, rendered.content);\n\n // Per-locale modules, and no leftovers from dictionaries or locales that are gone\n const dir = path.join(path.dirname(rendered.outputPath), LOCALES_DIR);\n const wanted = new Set(rendered.extraFiles.map((f) => f.path));\n for (const file of rendered.extraFiles) writeIfChanged(file.path, file.content);\n if (fs.existsSync(dir)) {\n for (const entry of fs.readdirSync(dir)) {\n const full = path.join(dir, entry);\n if (entry.endsWith(\".ts\") && !wanted.has(full)) fs.rmSync(full);\n }\n if (fs.readdirSync(dir).length === 0) fs.rmdirSync(dir);\n }\n\n return {\n files: rendered.files,\n outputPath: rendered.outputPath,\n dtsPath: rendered.dtsPath,\n configFile: rendered.configFile,\n notes: rendered.notes,\n };\n}\n","import path from \"node:path\";\n\nimport { logger } from \"../../utils/logger.js\";\nimport type { GenerateOptions } from \"./types.js\";\nimport { startGenerateWatcher } from \"./watch.js\";\nimport { generateDictionaries } from \"./write.js\";\n\nexport type { GenerateOptions, RenderedGenerate } from \"./types.js\";\nexport { LOCALES_DIR, renderGenerated } from \"./render.js\";\nexport { generateDictionaries } from \"./write.js\";\nexport { startGenerateWatcher } from \"./watch.js\";\n\nexport async function runGenerate(options: GenerateOptions = {}) {\n const root = options.cwd || process.cwd();\n const quiet = options.json === true;\n\n const doGenerate = () => {\n try {\n const { files, outputPath, dtsPath, configFile, notes } = generateDictionaries(root, options);\n if (quiet) {\n console.log(\n JSON.stringify(\n {\n success: true,\n files: files.map((f) => path.relative(root, f)),\n outputPath: path.relative(root, outputPath),\n dtsPath: path.relative(root, dtsPath),\n notes,\n },\n null,\n 2,\n ),\n );\n } else {\n if (!configFile) {\n logger.info(\"No dialex.config.* found, using defaults (run `dialex init` to add one).\");\n }\n logger.success(\n `Generated dictionaries for ${files.length} file${files.length === 1 ? \"\" : \"s\"}:`,\n );\n logger.info(`→ ${path.relative(root, outputPath)}`);\n logger.info(`→ ${path.relative(root, dtsPath)}`);\n for (const note of notes) logger.info(note);\n }\n return true;\n } catch (err: any) {\n if (quiet) {\n console.log(\n JSON.stringify(\n {\n success: false,\n error: err.message || String(err),\n },\n null,\n 2,\n ),\n );\n } else {\n logger.error(`Generation failed: ${err.message || String(err)}`);\n }\n return false;\n }\n };\n\n const ok = doGenerate();\n if (!ok && !options.watch) {\n process.exit(1);\n }\n\n if (options.watch) {\n logger.info(\"Watching for dictionary changes (-w, --watch)...\");\n startGenerateWatcher(root, options, doGenerate);\n }\n}\n","import path from \"node:path\";\n\nimport type { DialexConfig } from \"dialexjs\";\n\nimport { loadDictionaryFile, type DictionaryFile } from \"./dictionary/index.js\";\nimport { scanFiles } from \"./files.js\";\nimport { resolveDialexConfig } from \"./scanner.js\";\nimport { readStaticConfig } from \"./static-config.js\";\n\nexport interface ProjectDictionary {\n /** Path relative to the project root. */\n rel: string;\n name: string;\n df: DictionaryFile;\n}\n\nexport interface Project {\n root: string;\n config: DialexConfig;\n dictionaries: ProjectDictionary[];\n /** Dictionary files that could not be parsed into an editable shape. */\n unsupported: string[];\n /** Config values that could not be read statically (static loading only). */\n notes: string[];\n}\n\nasync function loadDictionaries(root: string, config: DialexConfig) {\n const include = config.include || \"**/*.content.ts\";\n const files = scanFiles(root, include, { exclude: config.exclude });\n\n const dictionaries: ProjectDictionary[] = [];\n const unsupported: string[] = [];\n\n for (const file of files) {\n const rel = path.relative(root, file);\n try {\n const df = await loadDictionaryFile(file);\n if (!df || !df.name) unsupported.push(rel);\n else dictionaries.push({ rel, name: df.name, df });\n } catch {\n unsupported.push(rel); // syntax error: reported by the analysis, nothing to edit here\n }\n }\n\n return { dictionaries, unsupported };\n}\n\n/**\n * Resolves the config (running `dialex.config.*` through the loader, which executes it) and loads\n * every dictionary file for AST-level reading and editing.\n */\nexport async function loadProject(root: string, configFile?: string): Promise<Project> {\n const config = resolveDialexConfig(root, configFile ? { configFile } : {});\n return { root, config, notes: [], ...(await loadDictionaries(root, config)) };\n}\n\n/**\n * Like `loadProject`, but reads the config from the syntax tree without executing it. Use this in\n * editors and anywhere project code must not run.\n */\nexport async function loadStaticProject(root: string, configFile?: string): Promise<Project> {\n const { config, notes } = readStaticConfig(root, configFile);\n return { root, config, notes, ...(await loadDictionaries(root, config)) };\n}\n\n/** `home` + `[\"nav\", \"about\"]` -> `home.nav.about` */\nexport const toKey = (dictionary: string, keyPath: string[]) => [dictionary, ...keyPath].join(\".\");\n"],"mappings":";;;;;;;;;;;;;AAIA,MAAa,cAAc;;;;ACA3B,SAAgB,WAAW,MAAwB;CACjD,OACE,SACC,KAAK,SAAS,oBACb,KAAK,SAAS,2BACd,KAAK,SAAS,4BAEhB,OAAO,KAAK;CAEd,OAAO;AACT;AAEA,MAAa,gBAAgB,SAAkB,MAAM,SAAS;;AAG9D,SAAgB,gBAAgB,MAAmC;CACjE,MAAM,MAAM,MAAM;CAClB,IAAI,CAAC,OAAO,KAAK,UAAU,OAAO,KAAA;CAClC,IAAI,IAAI,SAAS,cAAc,OAAO,IAAI;CAC1C,IAAI,IAAI,SAAS,mBAAoB,IAAI,SAAS,aAAa,OAAO,IAAI,UAAU,UAClF,OAAO,IAAI;CAEb,IAAI,IAAI,SAAS,kBAAkB,OAAO,OAAO,IAAI,KAAK;AAE5D;AAEA,MAAMA,gBAAc,MAClB,GAAG,SAAS,oBAAoB,GAAG,SAAS,cAAc,GAAG,SAAS;;AAGxE,SAAgB,aAAa,KAAc,KAAkC;CAC3E,OAAO,IAAI,WAAW,MAAM,MAAeA,aAAW,CAAC,KAAK,gBAAgB,CAAC,MAAM,GAAG;AACxF;;;ACzBA,MAAMC,eAAa;AAEnB,MAAa,cAAc,MACzB,GAAG,SAAS,oBAAoB,GAAG,SAAS,cAAc,GAAG,SAAS;AAExE,SAAgB,YAAY,MAAgC;CAC1D,OAAOC,WAAO,IAAI;CAClB,IAAI,MAAM,SAAS,iBAAiB,OAAO,KAAK;CAChD,IAAI,MAAM,SAAS,aAAa,OAAO,KAAK,UAAU,UAAU,OAAO,KAAK;CAC5E,IAAI,MAAM,SAAS,qBAAqB,KAAK,YAAY,WAAW,GAClE,OAAO,KAAK,OAAO,EAAE,EAAE,OAAO,UAAU,KAAA;AAG5C;AA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EA,OAAO;EAAE;EAAc;CAAY;AACrC;;;;;AAMA,eAAsB,YAAY,MAAc,YAAuC;CACrF,MAAM,SAAS,oBAAoB,MAAM,aAAa,EAAE,WAAW,IAAI,CAAC,CAAC;CACzE,OAAO;EAAE;EAAM;EAAQ,OAAO,CAAC;EAAG,GAAI,MAAM,iBAAiB,MAAM,MAAM;CAAG;AAC9E;;;;;AAMA,eAAsB,kBAAkB,MAAc,YAAuC;CAC3F,MAAM,EAAE,QAAQ,UAAU,iBAAiB,MAAM,UAAU;CAC3D,OAAO;EAAE;EAAM;EAAQ;EAAO,GAAI,MAAM,iBAAiB,MAAM,MAAM;CAAG;AAC1E;;AAGA,MAAa,SAAS,YAAoB,YAAsB,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dialexjs/cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "High-performance CLI tool for Dialex internationalization (codegen, scaffolding, CI parity checking)",
|
|
5
5
|
"homepage": "https://github.com/awaiden/dialex#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@clack/prompts": "^1.8.1",
|
|
40
40
|
"chokidar": "^5.0.0",
|
|
41
41
|
"commander": "^15.0.0",
|
|
42
|
-
"dialexjs": "0.9.
|
|
42
|
+
"dialexjs": "0.9.2",
|
|
43
43
|
"fast-glob": "^3.3.3",
|
|
44
44
|
"ignore": "^7.0.12",
|
|
45
45
|
"magicast": "^0.5.5",
|