@intlayer/chokidar 5.8.1 → 6.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/dist/cjs/chokidar/watcher.cjs +15 -20
  2. package/dist/cjs/chokidar/watcher.cjs.map +1 -1
  3. package/dist/cjs/fetchDistantDictionaries.cjs +18 -37
  4. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  5. package/dist/cjs/{fetchDistantDictionaryKeys.cjs → fetchDistantDictionaryKeysAndUpdateTimestamp.cjs} +10 -10
  6. package/dist/cjs/fetchDistantDictionaryKeysAndUpdateTimestamp.cjs.map +1 -0
  7. package/dist/cjs/filterInvalidDictionaries.cjs +70 -0
  8. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -0
  9. package/dist/cjs/getBuiltFetchDictionariesPath.cjs +52 -0
  10. package/dist/cjs/getBuiltFetchDictionariesPath.cjs.map +1 -0
  11. package/dist/cjs/getBuiltRemoteDictionariesPath.cjs +51 -0
  12. package/dist/cjs/getBuiltRemoteDictionariesPath.cjs.map +1 -0
  13. package/dist/cjs/index.cjs +10 -11
  14. package/dist/cjs/index.cjs.map +1 -1
  15. package/dist/cjs/loadDictionaries/index.cjs +4 -4
  16. package/dist/cjs/loadDictionaries/index.cjs.map +1 -1
  17. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +57 -17
  18. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  19. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +128 -53
  20. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  21. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +101 -0
  22. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -0
  23. package/dist/cjs/loadDictionaries/log.cjs +144 -0
  24. package/dist/cjs/loadDictionaries/log.cjs.map +1 -0
  25. package/dist/cjs/mergeDictionaries.cjs +18 -22
  26. package/dist/cjs/mergeDictionaries.cjs.map +1 -1
  27. package/dist/cjs/orderDictionaries.cjs +71 -0
  28. package/dist/cjs/orderDictionaries.cjs.map +1 -0
  29. package/dist/cjs/prepareContentDeclaration.cjs +4 -1
  30. package/dist/cjs/prepareContentDeclaration.cjs.map +1 -1
  31. package/dist/cjs/prepareIntlayer.cjs +9 -4
  32. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  33. package/dist/cjs/processPerLocaleDictionary.cjs.map +1 -1
  34. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs +22 -8
  35. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.cjs.map +1 -1
  36. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.cjs +44 -42
  37. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.cjs.map +1 -1
  38. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.cjs +83 -0
  39. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.cjs.map +1 -0
  40. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.cjs +29 -21
  41. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.cjs.map +1 -1
  42. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.cjs +52 -0
  43. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.cjs.map +1 -0
  44. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.cjs +44 -29
  45. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.cjs.map +1 -1
  46. package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs +39 -34
  47. package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +1 -1
  48. package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs +4 -6
  49. package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +1 -1
  50. package/dist/cjs/transpiler/dictionary_to_type/createType.cjs +17 -16
  51. package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +1 -1
  52. package/dist/cjs/utils/formatter.cjs +50 -0
  53. package/dist/cjs/utils/formatter.cjs.map +1 -0
  54. package/dist/cjs/utils/parallelize.cjs +43 -0
  55. package/dist/cjs/utils/parallelize.cjs.map +1 -0
  56. package/dist/cjs/utils/runOnce.cjs +2 -1
  57. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  58. package/dist/cjs/writeContentDeclaration/formatCode.cjs +7 -4
  59. package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +1 -1
  60. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +5 -1
  61. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  62. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +43 -25
  63. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  64. package/dist/esm/chokidar/watcher.mjs +16 -21
  65. package/dist/esm/chokidar/watcher.mjs.map +1 -1
  66. package/dist/esm/fetchDistantDictionaries.mjs +24 -28
  67. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  68. package/dist/esm/{fetchDistantDictionaryKeys.mjs → fetchDistantDictionaryKeysAndUpdateTimestamp.mjs} +6 -6
  69. package/dist/esm/fetchDistantDictionaryKeysAndUpdateTimestamp.mjs.map +1 -0
  70. package/dist/esm/filterInvalidDictionaries.mjs +40 -0
  71. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -0
  72. package/dist/esm/getBuiltFetchDictionariesPath.mjs +18 -0
  73. package/dist/esm/getBuiltFetchDictionariesPath.mjs.map +1 -0
  74. package/dist/esm/getBuiltRemoteDictionariesPath.mjs +17 -0
  75. package/dist/esm/getBuiltRemoteDictionariesPath.mjs.map +1 -0
  76. package/dist/esm/index.mjs +8 -9
  77. package/dist/esm/index.mjs.map +1 -1
  78. package/dist/esm/loadDictionaries/index.mjs +2 -2
  79. package/dist/esm/loadDictionaries/index.mjs.map +1 -1
  80. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +61 -18
  81. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  82. package/dist/esm/loadDictionaries/loadDictionaries.mjs +132 -53
  83. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  84. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +66 -0
  85. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -0
  86. package/dist/esm/loadDictionaries/log.mjs +125 -0
  87. package/dist/esm/loadDictionaries/log.mjs.map +1 -0
  88. package/dist/esm/mergeDictionaries.mjs +19 -23
  89. package/dist/esm/mergeDictionaries.mjs.map +1 -1
  90. package/dist/esm/orderDictionaries.mjs +37 -0
  91. package/dist/esm/orderDictionaries.mjs.map +1 -0
  92. package/dist/esm/prepareContentDeclaration.mjs +4 -1
  93. package/dist/esm/prepareContentDeclaration.mjs.map +1 -1
  94. package/dist/esm/prepareIntlayer.mjs +9 -4
  95. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  96. package/dist/esm/processPerLocaleDictionary.mjs.map +1 -1
  97. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs +25 -9
  98. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.mjs.map +1 -1
  99. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.mjs +45 -43
  100. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.mjs.map +1 -1
  101. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.mjs +58 -0
  102. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.mjs.map +1 -0
  103. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.mjs +29 -21
  104. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.mjs.map +1 -1
  105. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.mjs +28 -0
  106. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.mjs.map +1 -0
  107. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.mjs +45 -30
  108. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.mjs.map +1 -1
  109. package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs +39 -34
  110. package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +1 -1
  111. package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs +4 -6
  112. package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +1 -1
  113. package/dist/esm/transpiler/dictionary_to_type/createType.mjs +17 -16
  114. package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +1 -1
  115. package/dist/esm/utils/formatter.mjs +15 -0
  116. package/dist/esm/utils/formatter.mjs.map +1 -0
  117. package/dist/esm/utils/parallelize.mjs +9 -0
  118. package/dist/esm/utils/parallelize.mjs.map +1 -0
  119. package/dist/esm/utils/runOnce.mjs +2 -1
  120. package/dist/esm/utils/runOnce.mjs.map +1 -1
  121. package/dist/esm/writeContentDeclaration/formatCode.mjs +8 -5
  122. package/dist/esm/writeContentDeclaration/formatCode.mjs.map +1 -1
  123. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +5 -1
  124. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  125. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +40 -22
  126. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  127. package/dist/types/chokidar/watcher.d.ts.map +1 -1
  128. package/dist/types/fetchDistantDictionaries.d.ts +2 -1
  129. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  130. package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts +3 -0
  131. package/dist/types/fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts.map +1 -0
  132. package/dist/types/filterInvalidDictionaries.d.ts +3 -0
  133. package/dist/types/filterInvalidDictionaries.d.ts.map +1 -0
  134. package/dist/types/getBuiltFetchDictionariesPath.d.ts +5 -0
  135. package/dist/types/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  136. package/dist/types/getBuiltRemoteDictionariesPath.d.ts +5 -0
  137. package/dist/types/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  138. package/dist/types/index.d.ts +3 -4
  139. package/dist/types/index.d.ts.map +1 -1
  140. package/dist/types/loadDictionaries/index.d.ts +2 -2
  141. package/dist/types/loadDictionaries/index.d.ts.map +1 -1
  142. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +4 -1
  143. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  144. package/dist/types/loadDictionaries/loadDictionaries.d.ts +11 -1
  145. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
  146. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +6 -0
  147. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  148. package/dist/types/loadDictionaries/log.d.ts +19 -0
  149. package/dist/types/loadDictionaries/log.d.ts.map +1 -0
  150. package/dist/types/mergeDictionaries.d.ts +1 -1
  151. package/dist/types/mergeDictionaries.d.ts.map +1 -1
  152. package/dist/types/orderDictionaries.d.ts +10 -0
  153. package/dist/types/orderDictionaries.d.ts.map +1 -0
  154. package/dist/types/prepareContentDeclaration.d.ts.map +1 -1
  155. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  156. package/dist/types/processPerLocaleDictionary.d.ts +1 -1
  157. package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts +1 -0
  158. package/dist/types/transpiler/declaration_file_to_dictionary/index.d.ts.map +1 -1
  159. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts +4 -3
  160. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +1 -1
  161. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.d.ts +1 -1
  162. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.d.ts.map +1 -1
  163. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.d.ts +23 -0
  164. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.d.ts.map +1 -0
  165. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.d.ts +1 -1
  166. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.d.ts.map +1 -1
  167. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.d.ts +19 -0
  168. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.d.ts.map +1 -0
  169. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +1 -1
  170. package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts +1 -1
  171. package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +1 -1
  172. package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts +1 -1
  173. package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +1 -1
  174. package/dist/types/transpiler/dictionary_to_type/createType.d.ts +1 -1
  175. package/dist/types/transpiler/dictionary_to_type/createType.d.ts.map +1 -1
  176. package/dist/types/utils/formatter.d.ts +4 -0
  177. package/dist/types/utils/formatter.d.ts.map +1 -0
  178. package/dist/types/utils/parallelize.d.ts +2 -0
  179. package/dist/types/utils/parallelize.d.ts.map +1 -0
  180. package/dist/types/utils/runOnce.d.ts +1 -1
  181. package/dist/types/utils/runOnce.d.ts.map +1 -1
  182. package/dist/types/writeContentDeclaration/formatCode.d.ts.map +1 -1
  183. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +1 -1
  184. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
  185. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +1 -1
  186. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
  187. package/package.json +19 -17
  188. package/dist/cjs/checkDictionaryChanges.cjs +0 -58
  189. package/dist/cjs/checkDictionaryChanges.cjs.map +0 -1
  190. package/dist/cjs/fetchDistantDictionaryKeys.cjs.map +0 -1
  191. package/dist/cjs/getFilteredLocalesContent.cjs +0 -70
  192. package/dist/cjs/getFilteredLocalesContent.cjs.map +0 -1
  193. package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs +0 -44
  194. package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs.map +0 -1
  195. package/dist/cjs/log.cjs +0 -296
  196. package/dist/cjs/log.cjs.map +0 -1
  197. package/dist/esm/checkDictionaryChanges.mjs +0 -37
  198. package/dist/esm/checkDictionaryChanges.mjs.map +0 -1
  199. package/dist/esm/fetchDistantDictionaryKeys.mjs.map +0 -1
  200. package/dist/esm/getFilteredLocalesContent.mjs +0 -49
  201. package/dist/esm/getFilteredLocalesContent.mjs.map +0 -1
  202. package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +0 -20
  203. package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs.map +0 -1
  204. package/dist/esm/log.mjs +0 -262
  205. package/dist/esm/log.mjs.map +0 -1
  206. package/dist/types/checkDictionaryChanges.d.ts +0 -3
  207. package/dist/types/checkDictionaryChanges.d.ts.map +0 -1
  208. package/dist/types/fetchDistantDictionaryKeys.d.ts +0 -3
  209. package/dist/types/fetchDistantDictionaryKeys.d.ts.map +0 -1
  210. package/dist/types/getFilteredLocalesContent.d.ts +0 -4
  211. package/dist/types/getFilteredLocalesContent.d.ts.map +0 -1
  212. package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts +0 -8
  213. package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts.map +0 -1
  214. package/dist/types/log.d.ts +0 -45
  215. package/dist/types/log.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"sourcesContent":["import generator from '@babel/generator';\nimport * as babelParser from '@babel/parser';\nimport traverse, { NodePath } from '@babel/traverse';\nimport * as t from '@babel/types';\nimport { getAppLogger, logger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport {\n Dictionary,\n NodeType,\n TranslationContent,\n TypedNode,\n} from '@intlayer/core';\nimport { existsSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { extname } from 'path';\nimport { getContentDeclarationFileTemplate } from '../getContentDeclarationFileTemplate/getContentDeclarationFileTemplate';\nimport { formatCode } from './formatCode';\n\n/**\n * Updates a JavaScript/TypeScript file based on the provided JSON instructions.\n * It targets a specific dictionary object within the file (identified by its 'key' property)\n * and updates its 'content' entries. Currently, it focuses on modifying arguments\n * of 't' (translation) function calls.\n */\nexport const writeJSFile = async (\n filePath: string,\n dictionary: Dictionary\n): Promise<void> => {\n const appLogger = getAppLogger(configuration);\n\n const {\n key: dictionaryIdentifierKey,\n content: updatesToApply,\n locale,\n autoFilled,\n } = dictionary;\n const isPerLocaleDeclarationFile = typeof locale === 'string';\n\n // Check if the file exist\n if (!existsSync(filePath)) {\n const fileExtension = extname(filePath);\n\n let format = 'ts' as 'ts' | 'cjs' | 'esm';\n\n if (fileExtension === '.ts' || fileExtension === '.tsx') {\n format = 'ts';\n } else if (fileExtension === '.cjs' || fileExtension === '.cjsx') {\n format = 'cjs';\n } else {\n format = 'esm';\n }\n\n appLogger('File does not exist, creating it', {\n isVerbose: true,\n });\n const template = await getContentDeclarationFileTemplate(\n dictionaryIdentifierKey,\n format,\n { locale, autoFilled }\n );\n\n await writeFile(filePath, template, 'utf-8');\n }\n\n let sourceCode: string;\n try {\n sourceCode = await readFile(filePath, 'utf-8');\n } catch (error) {\n const err = error as Error;\n appLogger(`Failed to read file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to read file ${filePath}: ${err.message}`);\n }\n\n const ast = babelParser.parse(sourceCode, {\n sourceType: 'module',\n plugins: ['typescript', 'jsx'],\n tokens: true,\n });\n\n let dictionaryObjectPath: NodePath<t.ObjectExpression> | null = null;\n let dictionaryIdentifier: string | null = null;\n\n // First look for direct objects with the right key, regardless of variable assignments\n traverse(ast, {\n ObjectExpression(path) {\n if (dictionaryObjectPath) return; // Already found\n\n // Check if this object has a key property with the right value\n const keyProp = path.node.properties.find((prop) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n\n if (keyName !== 'key' || !t.isStringLiteral(prop.value)) return false;\n\n // Unescape the value for comparison\n const propValue = prop.value.value;\n // Compare actual string content, not just raw representation\n return propValue === dictionaryIdentifierKey;\n });\n\n if (keyProp) {\n dictionaryObjectPath = path;\n path.stop();\n }\n },\n });\n\n // If not found directly, look for variable declarations and exports\n if (!dictionaryObjectPath) {\n appLogger(`Looking for variable declarations`, {\n isVerbose: true,\n });\n\n // Collect all variable declarations with objects\n const candidateVars: { id: string; path: NodePath<t.ObjectExpression> }[] =\n [];\n\n traverse(ast, {\n VariableDeclarator(path) {\n const { node } = path;\n if (!t.isIdentifier(node.id)) return;\n\n let objPath: NodePath<t.ObjectExpression> | null = null;\n\n // Direct object assignment\n if (node.init && t.isObjectExpression(node.init)) {\n objPath = path.get('init') as NodePath<t.ObjectExpression>;\n }\n // Object with TS type assertion (satisfies/as)\n else if (\n node.init &&\n (t.isTSAsExpression(node.init) || t.isTSTypeAssertion(node.init)) &&\n t.isObjectExpression(node.init.expression)\n ) {\n objPath = path.get('init.expression') as NodePath<t.ObjectExpression>;\n }\n\n if (objPath) {\n candidateVars.push({ id: node.id.name, path: objPath });\n }\n },\n });\n\n appLogger(`Found ${candidateVars.length} candidate variables`, {\n isVerbose: true,\n });\n\n // Check each candidate for the key property\n for (const { id, path } of candidateVars) {\n const keyProp = path.node.properties.find((prop) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n return (\n keyName === 'key' &&\n t.isStringLiteral(prop.value) &&\n prop.value.value === dictionaryIdentifierKey\n );\n });\n\n if (keyProp) {\n appLogger(`Found match in variable: ${id}`);\n dictionaryObjectPath = path;\n dictionaryIdentifier = id;\n break;\n }\n }\n\n // If still not found, dump all object expressions for debugging\n if (!dictionaryObjectPath) {\n appLogger('Could not find dictionary object. Dumping all objects:', {\n isVerbose: true,\n });\n traverse(ast, {\n ObjectExpression(path) {\n const props = path.node.properties\n .map((prop) => {\n if (!t.isObjectProperty(prop)) return 'non-object-property';\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return 'complex-key';\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n let valueDesc = 'unknown-value';\n\n if (t.isStringLiteral(prop.value)) {\n valueDesc = `\"${prop.value.value}\"`;\n }\n\n return `${keyName}: ${valueDesc}`;\n })\n .join(', ');\n\n appLogger(`Object: { ${props} }`);\n },\n });\n }\n }\n\n if (!dictionaryObjectPath) {\n throw new Error(\n `Could not find dictionary object with key '${dictionaryIdentifierKey}' in ${filePath}`\n );\n }\n\n // Find the 'content' property within the identified dictionary object\n const contentPropertyPath = (\n (dictionaryObjectPath as any).get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === 'content';\n });\n\n if (\n !contentPropertyPath ||\n !contentPropertyPath.isObjectProperty() ||\n !(contentPropertyPath.get('value') as NodePath).isObjectExpression()\n ) {\n throw new Error(\n `Could not find 'content' object property, or it's not an object, in dictionary in ${filePath}`\n );\n }\n\n const contentObjectPath = contentPropertyPath.get(\n 'value'\n ) as NodePath<t.ObjectExpression>;\n\n /**\n * Build a Babel Expression for any JSON-serializable value or TypedNode.\n * - Translation nodes become t({...}) or string literal in per-locale files\n * - Objects recurse to ObjectExpression\n * - Arrays recurse to ArrayExpression\n * - Strings/numbers/booleans/null to corresponding literals\n */\n const buildValueNodeFromData = (data: any): t.Expression => {\n // Translation typed node\n if ((data as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = data as TranslationContent;\n if (\n isPerLocaleDeclarationFile &&\n typeof locale === 'string' &&\n translationContent?.[NodeType.Translation]?.[locale] !== undefined\n ) {\n return buildValueNodeFromData(\n translationContent[NodeType.Translation][locale]\n );\n }\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) => {\n const keyNode = t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey);\n return t.objectProperty(keyNode, buildValueNodeFromData(langValue));\n }\n )\n );\n return t.callExpression(t.identifier('t'), [translationsObj]);\n }\n\n // Arrays\n if (Array.isArray(data)) {\n return t.arrayExpression(data.map((el) => buildValueNodeFromData(el)));\n }\n\n // Objects (plain)\n if (data && typeof data === 'object') {\n const props = Object.entries(data).map(([k, v]) => {\n const key = t.isValidIdentifier(k)\n ? t.identifier(k)\n : t.stringLiteral(k);\n return t.objectProperty(key, buildValueNodeFromData(v));\n });\n return t.objectExpression(props);\n }\n\n // Primitives\n switch (typeof data) {\n case 'string':\n return t.stringLiteral(data);\n case 'number':\n return t.numericLiteral(data);\n case 'boolean':\n return t.booleanLiteral(data);\n default:\n return t.nullLiteral();\n }\n };\n\n /** Ensure an object property exists on a given object expression path. */\n const ensureObjectProperty = (\n objPath: NodePath<t.ObjectExpression>,\n key: string\n ): NodePath<t.ObjectProperty> => {\n const existing = (\n objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === key;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (existing) return existing;\n\n const keyNode = t.isValidIdentifier(key)\n ? t.identifier(key)\n : t.stringLiteral(key);\n const newProp = t.objectProperty(keyNode, t.objectExpression([]));\n objPath.node.properties.push(newProp);\n\n // Return a fresh path for the newly pushed property\n const props = objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n return props[props.length - 1] as NodePath<t.ObjectProperty>;\n };\n\n /** Recursively merge a JSON-like value into an ObjectExpression property path. */\n const mergeValueIntoProperty = (\n propPath: NodePath<t.ObjectProperty>,\n value: any,\n propKeyForLogs: string\n ) => {\n const valuePath = propPath.get('value') as NodePath;\n\n // Translation typed node → either update t() args or replace value\n if ((value as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = value as TranslationContent;\n if (\n valuePath.isCallExpression() &&\n t.isIdentifier(valuePath.node.callee) &&\n valuePath.node.callee.name === 't'\n ) {\n // Replace argument with the full translations object (simpler and robust)\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) =>\n t.objectProperty(\n t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey),\n buildValueNodeFromData(langValue)\n )\n )\n );\n\n if (isPerLocaleDeclarationFile && typeof locale === 'string') {\n const localized =\n translationContent?.[NodeType.Translation]?.[locale];\n if (localized !== undefined) {\n valuePath.replaceWith(buildValueNodeFromData(localized));\n return;\n }\n }\n\n (valuePath.node as t.CallExpression).arguments = [translationsObj];\n return;\n }\n\n // Otherwise, replace with a fresh node\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Arrays → replace entirely\n if (Array.isArray(value)) {\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Objects → ensure object expression and recurse into each key\n if (value && typeof value === 'object') {\n if (!valuePath.isObjectExpression()) {\n valuePath.replaceWith(t.objectExpression([]));\n }\n const objPath = valuePath as NodePath<t.ObjectExpression>;\n for (const [k, v] of Object.entries(value)) {\n const childProp = ensureObjectProperty(objPath, k);\n mergeValueIntoProperty(childProp, v, `${propKeyForLogs}.${k}`);\n }\n return;\n }\n\n // Primitives → replace\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n };\n\n // Apply updates to each entry specified in the JSON (now supports deep nesting)\n for (const [entryKeyToUpdate, newEntryData] of Object.entries(\n updatesToApply\n )) {\n let targetPropertyPath = (\n contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === entryKeyToUpdate;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (!targetPropertyPath) {\n const keyNode = t.isValidIdentifier(entryKeyToUpdate)\n ? t.identifier(entryKeyToUpdate)\n : t.stringLiteral(entryKeyToUpdate);\n // By default create an empty object; merge will replace if needed\n const newProperty = t.objectProperty(keyNode, t.objectExpression([]));\n contentObjectPath.node.properties.push(newProperty);\n const props = contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n targetPropertyPath = props[\n props.length - 1\n ] as NodePath<t.ObjectProperty>;\n }\n\n mergeValueIntoProperty(targetPropertyPath, newEntryData, entryKeyToUpdate);\n }\n\n // Generate JavaScript/TypeScript code from the modified AST\n const generatedCode = generator(ast, {\n retainLines: true,\n comments: true,\n jsescOption: {\n minimal: true, // This ensures Unicode characters are not escaped\n },\n }).code;\n\n let finalCode = generatedCode;\n\n finalCode = await formatCode(filePath, finalCode);\n\n // Write the modified code back to the file\n try {\n await writeFile(filePath, finalCode, 'utf-8');\n logger(`Successfully updated ${filePath}`, {\n level: 'info',\n isVerbose: true,\n });\n } catch (error) {\n const err = error as Error;\n logger(`Failed to write updated file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to write updated file ${filePath}: ${err.message}`);\n }\n};\n"],"mappings":"AAAA,OAAO,eAAe;AACtB,YAAY,iBAAiB;AAC7B,OAAO,cAA4B;AACnC,YAAY,OAAO;AACnB,SAAS,cAAc,cAAc;AACrC,OAAO,mBAAmB;AAC1B;AAAA,EAEE;AAAA,OAGK;AACP,SAAS,kBAAkB;AAC3B,SAAS,UAAU,iBAAiB;AACpC,SAAS,eAAe;AACxB,SAAS,yCAAyC;AAClD,SAAS,kBAAkB;AAQpB,MAAM,cAAc,OACzB,UACA,eACkB;AAClB,QAAM,YAAY,aAAa,aAAa;AAE5C,QAAM;AAAA,IACJ,KAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,6BAA6B,OAAO,WAAW;AAGrD,MAAI,CAAC,WAAW,QAAQ,GAAG;AACzB,UAAM,gBAAgB,QAAQ,QAAQ;AAEtC,QAAI,SAAS;AAEb,QAAI,kBAAkB,SAAS,kBAAkB,QA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QACb;AACN,aAAO,YAAY;AAAA,IACrB,CAAC;AAED,QAAI,CAAC,oBAAoB;AACvB,YAAM,UAAU,EAAE,kBAAkB,gBAAgB,IAChD,EAAE,WAAW,gBAAgB,IAC7B,EAAE,cAAc,gBAAgB;AAEpC,YAAM,cAAc,EAAE,eAAe,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACpE,wBAAkB,KAAK,WAAW,KAAK,WAAW;AAClD,YAAM,QAAQ,kBAAkB,IAAI,YAAY;AAGhD,2BAAqB,MACnB,MAAM,SAAS,CACjB;AAAA,IACF;AAEA,2BAAuB,oBAAoB,cAAc,gBAAgB;AAAA,EAC3E;AAGA,QAAM,gBAAgB,UAAU,KAAK;AAAA,IACnC,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aAAa;AAAA,MACX,SAAS;AAAA;AAAA,IACX;AAAA,EACF,CAAC,EAAE;AAEH,MAAI,YAAY;AAEhB,cAAY,MAAM,WAAW,UAAU,SAAS;AAGhD,MAAI;AACF,UAAM,UAAU,UAAU,WAAW,OAAO;AAC5C,WAAO,wBAAwB,QAAQ,IAAI;AAAA,MACzC,OAAO;AAAA,MACP,WAAW;AAAA,IACb,CAAC;AAAA,EACH,SAAS,OAAO;AACd,UAAM,MAAM;AACZ,WAAO,iCAAiC,QAAQ,IAAI;AAAA,MAClD,OAAO;AAAA,IACT,CAAC;AACD,UAAM,IAAI,MAAM,gCAAgC,QAAQ,KAAK,IAAI,OAAO,EAAE;AAAA,EAC5E;AACF;","names":[]}
1
+ {"version":3,"sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"sourcesContent":["import * as generate from '@babel/generator';\nimport * as babelParser from '@babel/parser';\nimport type { NodePath } from '@babel/traverse';\nimport * as babelTraverse from '@babel/traverse';\nimport * as t from '@babel/types';\nimport { getAppLogger, logger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport {\n Dictionary,\n NodeType,\n TranslationContent,\n TypedNode,\n} from '@intlayer/core';\nimport { existsSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { extname } from 'path';\nimport { getContentDeclarationFileTemplate } from '../getContentDeclarationFileTemplate/getContentDeclarationFileTemplate';\nimport { formatCode } from './formatCode';\n\n/**\n * Updates a JavaScriptå/TypeScript file based on the provided JSON instructions.\n * It targets a specific dictionary object within the file (identified by its 'key' property)\n * and updates its 'content' entries. Currently, it focuses on modifying arguments\n * of 't' (translation) function calls.\n */\nexport const writeJSFile = async (\n filePath: string,\n dictionary: Dictionary\n): Promise<void> => {\n // Ensure compatibility with various ESM/CJS interop shapes of @babel/traverse\n const normalizeTraverse = (mod: unknown) => {\n const candidate = mod as any;\n if (typeof candidate === 'function') return candidate;\n if (candidate?.default) {\n if (typeof candidate.default === 'function') return candidate.default;\n if (typeof candidate.default?.default === 'function')\n return candidate.default.default;\n if (typeof candidate.default?.traverse === 'function')\n return candidate.default.traverse;\n }\n if (typeof candidate?.traverse === 'function') return candidate.traverse;\n return candidate;\n };\n\n const traverse = normalizeTraverse(babelTraverse) as any;\n const appLogger = getAppLogger(configuration);\n\n const {\n key: dictionaryIdentifierKey,\n content: updatesToApply,\n locale,\n autoFilled,\n } = dictionary;\n const isPerLocaleDeclarationFile = typeof locale === 'string';\n\n // Check if the file exist\n if (!existsSync(filePath)) {\n const fileExtension = extname(filePath);\n\n let format = 'ts' as 'ts' | 'cjs' | 'esm';\n\n if (fileExtension === '.ts' || fileExtension === '.tsx') {\n format = 'ts';\n } else if (fileExtension === '.cjs' || fileExtension === '.cjsx') {\n format = 'cjs';\n } else {\n format = 'esm';\n }\n\n appLogger('File does not exist, creating it', {\n isVerbose: true,\n });\n const template = await getContentDeclarationFileTemplate(\n dictionaryIdentifierKey,\n format,\n { locale, autoFilled }\n );\n\n await writeFile(filePath, template, 'utf-8');\n }\n\n let sourceCode: string;\n try {\n sourceCode = await readFile(filePath, 'utf-8');\n } catch (error) {\n const err = error as Error;\n appLogger(`Failed to read file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to read file ${filePath}: ${err.message}`);\n }\n\n const ast = babelParser.parse(sourceCode, {\n sourceType: 'module',\n plugins: ['typescript', 'jsx'],\n tokens: true,\n });\n\n let dictionaryObjectPath: NodePath<t.ObjectExpression> | null = null;\n let dictionaryIdentifier: string | null = null;\n\n // First look for direct objects with the right key, regardless of variable assignments\n traverse(ast, {\n ObjectExpression(path: NodePath<t.ObjectExpression>) {\n if (dictionaryObjectPath) return; // Already found\n\n // Check if this object has a key property with the right value\n const keyProp = path.node.properties.find(\n (prop: t.ObjectProperty | t.SpreadElement | t.ObjectMethod) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n\n if (keyName !== 'key' || !t.isStringLiteral(prop.value)) return false;\n\n // Unescape the value for comparison\n const propValue = prop.value.value;\n // Compare actual string content, not just raw representation\n return propValue === dictionaryIdentifierKey;\n }\n );\n\n if (keyProp) {\n dictionaryObjectPath = path;\n path.stop();\n }\n },\n });\n\n // If not found directly, look for variable declarations and exports\n if (!dictionaryObjectPath) {\n appLogger(`Looking for variable declarations`, {\n isVerbose: true,\n });\n\n // Collect all variable declarations with objects\n const candidateVars: { id: string; path: NodePath<t.ObjectExpression> }[] =\n [];\n\n traverse(ast, {\n VariableDeclarator(path: NodePath<t.VariableDeclarator>) {\n const { node } = path;\n if (!t.isIdentifier(node.id)) return;\n\n let objPath: NodePath<t.ObjectExpression> | null = null;\n\n // Direct object assignment\n if (node.init && t.isObjectExpression(node.init)) {\n objPath = path.get('init') as NodePath<t.ObjectExpression>;\n }\n // Object with TS type assertion (satisfies/as)\n else if (\n node.init &&\n (t.isTSAsExpression(node.init) || t.isTSTypeAssertion(node.init)) &&\n t.isObjectExpression(node.init.expression)\n ) {\n objPath = path.get('init.expression') as NodePath<t.ObjectExpression>;\n }\n\n if (objPath) {\n candidateVars.push({ id: node.id.name, path: objPath });\n }\n },\n });\n\n appLogger(`Found ${candidateVars.length} candidate variables`, {\n isVerbose: true,\n });\n\n // Check each candidate for the key property\n for (const { id, path } of candidateVars) {\n const keyProp = path.node.properties.find((prop) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n return (\n keyName === 'key' &&\n t.isStringLiteral(prop.value) &&\n prop.value.value === dictionaryIdentifierKey\n );\n });\n\n if (keyProp) {\n appLogger(`Found match in variable: ${id}`);\n dictionaryObjectPath = path;\n dictionaryIdentifier = id;\n break;\n }\n }\n\n // If still not found, dump all object expressions for debugging\n if (!dictionaryObjectPath) {\n appLogger('Could not find dictionary object. Dumping all objects:', {\n isVerbose: true,\n });\n traverse(ast, {\n ObjectExpression(path: NodePath<t.ObjectExpression>) {\n const props = path.node.properties\n .map(\n (prop: t.ObjectProperty | t.SpreadElement | t.ObjectMethod) => {\n if (!t.isObjectProperty(prop)) return 'non-object-property';\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return 'complex-key';\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n let valueDesc = 'unknown-value';\n\n if (t.isStringLiteral(prop.value)) {\n valueDesc = `\"${prop.value.value}\"`;\n }\n\n return `${keyName}: ${valueDesc}`;\n }\n )\n .join(', ');\n\n appLogger(`Object: { ${props} }`);\n },\n });\n }\n }\n\n if (!dictionaryObjectPath) {\n throw new Error(\n `Could not find dictionary object with key '${dictionaryIdentifierKey}' in ${filePath}`\n );\n }\n\n // Find the 'content' property within the identified dictionary object\n const contentPropertyPath = (\n (dictionaryObjectPath as any).get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === 'content';\n });\n\n if (\n !contentPropertyPath ||\n !contentPropertyPath.isObjectProperty() ||\n !(contentPropertyPath.get('value') as NodePath).isObjectExpression()\n ) {\n throw new Error(\n `Could not find 'content' object property, or it's not an object, in dictionary in ${filePath}`\n );\n }\n\n const contentObjectPath = contentPropertyPath.get(\n 'value'\n ) as NodePath<t.ObjectExpression>;\n\n /**\n * Build a Babel Expression for any JSON-serializable value or TypedNode.\n * - Translation nodes become t({...}) or string literal in per-locale files\n * - Objects recurse to ObjectExpression\n * - Arrays recurse to ArrayExpression\n * - Strings/numbers/booleans/null to corresponding literals\n */\n const buildValueNodeFromData = (data: any): t.Expression => {\n // Translation typed node\n if ((data as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = data as TranslationContent;\n if (\n isPerLocaleDeclarationFile &&\n typeof locale === 'string' &&\n translationContent?.[NodeType.Translation]?.[locale] !== undefined\n ) {\n return buildValueNodeFromData(\n translationContent[NodeType.Translation][locale]\n );\n }\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) => {\n const keyNode = t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey);\n return t.objectProperty(keyNode, buildValueNodeFromData(langValue));\n }\n )\n );\n return t.callExpression(t.identifier('t'), [translationsObj]);\n }\n\n // Arrays\n if (Array.isArray(data)) {\n return t.arrayExpression(data.map((el) => buildValueNodeFromData(el)));\n }\n\n // Objects (plain)\n if (data && typeof data === 'object') {\n const props = Object.entries(data).map(([k, v]) => {\n const key = t.isValidIdentifier(k)\n ? t.identifier(k)\n : t.stringLiteral(k);\n return t.objectProperty(key, buildValueNodeFromData(v));\n });\n return t.objectExpression(props);\n }\n\n // Primitives\n switch (typeof data) {\n case 'string':\n return t.stringLiteral(data);\n case 'number':\n return t.numericLiteral(data);\n case 'boolean':\n return t.booleanLiteral(data);\n default:\n return t.nullLiteral();\n }\n };\n\n /** Ensure an object property exists on a given object expression path. */\n const ensureObjectProperty = (\n objPath: NodePath<t.ObjectExpression>,\n key: string\n ): NodePath<t.ObjectProperty> => {\n const existing = (\n objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === key;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (existing) return existing;\n\n const keyNode = t.isValidIdentifier(key)\n ? t.identifier(key)\n : t.stringLiteral(key);\n const newProp = t.objectProperty(keyNode, t.objectExpression([]));\n objPath.node.properties.push(newProp);\n\n // Return a fresh path for the newly pushed property\n const props = objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n return props[props.length - 1] as NodePath<t.ObjectProperty>;\n };\n\n /** Recursively merge a JSON-like value into an ObjectExpression property path. */\n const mergeValueIntoProperty = (\n propPath: NodePath<t.ObjectProperty>,\n value: any,\n propKeyForLogs: string\n ) => {\n const valuePath = propPath.get('value') as NodePath;\n\n // Translation typed node → either update t() args or replace value\n if ((value as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = value as TranslationContent;\n if (\n valuePath.isCallExpression() &&\n t.isIdentifier(valuePath.node.callee) &&\n valuePath.node.callee.name === 't'\n ) {\n // Replace argument with the full translations object (simpler and robust)\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) =>\n t.objectProperty(\n t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey),\n buildValueNodeFromData(langValue)\n )\n )\n );\n\n if (isPerLocaleDeclarationFile && typeof locale === 'string') {\n const localized =\n translationContent?.[NodeType.Translation]?.[locale];\n if (localized !== undefined) {\n valuePath.replaceWith(buildValueNodeFromData(localized));\n return;\n }\n }\n\n (valuePath.node as t.CallExpression).arguments = [translationsObj];\n return;\n }\n\n // Otherwise, replace with a fresh node\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Arrays → replace entirely\n if (Array.isArray(value)) {\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Objects → ensure object expression and recurse into each key\n if (value && typeof value === 'object') {\n if (!valuePath.isObjectExpression()) {\n valuePath.replaceWith(t.objectExpression([]));\n }\n const objPath = valuePath as NodePath<t.ObjectExpression>;\n for (const [k, v] of Object.entries(value)) {\n const childProp = ensureObjectProperty(objPath, k);\n mergeValueIntoProperty(childProp, v, `${propKeyForLogs}.${k}`);\n }\n return;\n }\n\n // Primitives → replace\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n };\n\n // Apply updates to each entry specified in the JSON (now supports deep nesting)\n for (const [entryKeyToUpdate, newEntryData] of Object.entries(\n updatesToApply\n )) {\n let targetPropertyPath = (\n contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === entryKeyToUpdate;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (!targetPropertyPath) {\n const keyNode = t.isValidIdentifier(entryKeyToUpdate)\n ? t.identifier(entryKeyToUpdate)\n : t.stringLiteral(entryKeyToUpdate);\n // By default create an empty object; merge will replace if needed\n const newProperty = t.objectProperty(keyNode, t.objectExpression([]));\n contentObjectPath.node.properties.push(newProperty);\n const props = contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n targetPropertyPath = props[\n props.length - 1\n ] as NodePath<t.ObjectProperty>;\n }\n\n mergeValueIntoProperty(targetPropertyPath, newEntryData, entryKeyToUpdate);\n }\n\n // Generate JavaScript/TypeScript code from the modified AST\n const generatedCode = generate.generate(ast, {\n retainLines: true,\n comments: true,\n jsescOption: {\n minimal: true, // This ensures Unicode characters are not escaped\n },\n }).code;\n\n let finalCode = generatedCode;\n\n finalCode = await formatCode(filePath, finalCode);\n\n // Write the modified code back to the file\n try {\n await writeFile(filePath, finalCode, 'utf-8');\n logger(`Successfully updated ${filePath}`, {\n level: 'info',\n isVerbose: true,\n });\n } catch (error) {\n const err = error as Error;\n logger(`Failed to write updated file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to write updated file ${filePath}: ${err.message}`);\n }\n};\n"],"mappings":"AAAA,YAAY,cAAc;AAC1B,YAAY,iBAAiB;AAE7B,YAAY,mBAAmB;AAC/B,YAAY,OAAO;AACnB,SAAS,cAAc,cAAc;AACrC,OAAO,mBAAmB;AAC1B;AAAA,EAEE;AAAA,OAGK;AACP,SAAS,kBAAkB;AAC3B,SAAS,UAAU,iBAAiB;AACpC,SAAS,eAAe;AACxB,SAAS,yCAAyC;AAClD,SAAS,kBAAkB;AAQpB,MAAM,cAAc,OACzB,UACA,eACkB;AAElB,QAAM,oBAAoB,CAAC,QAAiB;AAC1C,UAAM,YAAY;AAClB,QAAI,OAAO,cAAc,WAAY,QAAO;AAC5C,QAAI,WAAW,SAAS;AACtB,UAAI,OAAO,UAAU,YAAY,WAAY,QAAO,UAAU;AAC9D,UAAI,OAAO,UAAU,SAAS,YAAY;AACxC,eAAO,UAAU,QAAQ;AAC3B,UAAI,OAAO,UAAU,SAAS,aAAa;AACzC,eAAO,UAAU,QAAQ;AAAA,IAC7B;AACA,QAAI,OAAO,WAAW,aAAa,WAAY,QAAO,UAAU;AAChE,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,kBAAkB,aAAa;AAChD,QAAM,YAAY,aAAa,aAAa;AAE5C,QAAM;AAAA,IACJ,KAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF,IAAI;AACJ,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,KAAK,GAAI,UAAU,YAAY,QA+C3C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,UAAU,YAAY,kBAUjE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { DictionaryAPI } from '@intlayer/backend';
2
+ import { DictionariesStatus } from './loadDictionaries';
2
3
  type FetchDistantDictionariesOptions = {
3
4
  dictionaryKeys: string[];
4
5
  newDictionariesPath?: string;
@@ -7,6 +8,6 @@ type FetchDistantDictionariesOptions = {
7
8
  /**
8
9
  * Fetch distant dictionaries and update the logger with their statuses.
9
10
  */
10
- export declare const fetchDistantDictionaries: (options: FetchDistantDictionariesOptions) => Promise<DictionaryAPI[]>;
11
+ export declare const fetchDistantDictionaries: (options: FetchDistantDictionariesOptions, onStatusUpdate?: (status: DictionariesStatus[]) => void) => Promise<DictionaryAPI[]>;
11
12
  export {};
12
13
  //# sourceMappingURL=fetchDistantDictionaries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchDistantDictionaries.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKvD,KAAK,+BAA+B,GAAG;IACrC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,+BAA+B,KACvC,OAAO,CAAC,aAAa,EAAE,CAoGzB,CAAC"}
1
+ {"version":3,"file":"fetchDistantDictionaries.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,KAAK,+BAA+B,GAAG;IACrC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,SAAS,+BAA+B,EACxC,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,KACtD,OAAO,CAAC,aAAa,EAAE,CA0FzB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type IntlayerConfig } from '@intlayer/config';
2
+ export declare const fetchDistantDictionaryKeysAndUpdateTimestamp: (configuration?: IntlayerConfig) => Promise<Record<string, number>>;
3
+ //# sourceMappingURL=fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchDistantDictionaryKeysAndUpdateTimestamp.d.ts","sourceRoot":"","sources":["../../src/fetchDistantDictionaryKeysAndUpdateTimestamp.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEzE,eAAO,MAAM,4CAA4C,GACvD,gBAAe,cAAmC,KACjD,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkChC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { Dictionary } from '@intlayer/core';
2
+ export declare const filterInvalidDictionaries: (dictionaries: (Dictionary | undefined)[] | undefined) => Dictionary[];
3
+ //# sourceMappingURL=filterInvalidDictionaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterInvalidDictionaries.d.ts","sourceRoot":"","sources":["../../src/filterInvalidDictionaries.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,yBAAyB,GACpC,cAAc,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,KACnD,UAAU,EAiCZ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This function generates a list of dictionaries in the main directory
3
+ */
4
+ export declare const getBuiltFetchDictionariesPath: (configuration?: import("@intlayer/config").IntlayerConfig, format?: "cjs" | "esm") => string[];
5
+ //# sourceMappingURL=getBuiltFetchDictionariesPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBuiltFetchDictionariesPath.d.ts","sourceRoot":"","sources":["../../src/getBuiltFetchDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,yDAAkC,EAClC,SAAQ,KAAK,GAAG,KAAa,aAgB9B,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * This function generates a list of dictionaries in the main directory
3
+ */
4
+ export declare const getBuiltRemoteDictionariesPath: (configuration?: import("@intlayer/config").IntlayerConfig) => string[];
5
+ //# sourceMappingURL=getBuiltRemoteDictionariesPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBuiltRemoteDictionariesPath.d.ts","sourceRoot":"","sources":["../../src/getBuiltRemoteDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,yDAAkC,aAcnC,CAAC"}
@@ -1,14 +1,12 @@
1
- export { checkDictionaryChanges } from './checkDictionaryChanges';
2
1
  export { buildAndWatchIntlayer, handleAdditionalContentDeclarationFile, handleContentDeclarationFileChange, watch, } from './chokidar/watcher';
3
2
  export { cleanOutputDir } from './cleanOutputDir';
4
3
  export { fetchDistantDictionaries } from './fetchDistantDictionaries';
5
- export { fetchDistantDictionaryKeys } from './fetchDistantDictionaryKeys';
4
+ export { fetchDistantDictionaryKeysAndUpdateTimestamp } from './fetchDistantDictionaryKeysAndUpdateTimestamp';
6
5
  export { getBuiltDictionariesPath } from './getBuiltDictionariesPath';
7
6
  export { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';
8
- export { getFilteredLocalesContent } from './getFilteredLocalesContent';
9
7
  export { listDictionaries } from './listDictionariesPath';
10
8
  export { listGitFiles, listGitLines, type DiffMode, type ListGitFilesOptions, type ListGitLinesOptions, } from './listGitFiles';
11
- export { loadDictionaries, loadDistantDictionaries, loadLocalDictionaries, } from './loadDictionaries/index';
9
+ export { loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, } from './loadDictionaries/index';
12
10
  export { mergeDictionaries } from './mergeDictionaries';
13
11
  export { prepareContentDeclaration } from './prepareContentDeclaration';
14
12
  export { prepareIntlayer } from './prepareIntlayer';
@@ -17,6 +15,7 @@ export { reduceDictionaryContent } from './reduceDictionaryContent/reduceDiction
17
15
  export { buildDictionary } from './transpiler/declaration_file_to_dictionary/index';
18
16
  export { createDictionaryEntryPoint, generateDictionaryListContent, } from './transpiler/dictionary_to_main';
19
17
  export { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';
18
+ export { formatLocale, formatPath } from './utils/formatter';
20
19
  export { getFileHash } from './utils/getFileHash';
21
20
  export { kebabCaseToCamelCase } from './utils/kebabCaseToCamelCase';
22
21
  export { resolveObjectPromises } from './utils/resolveObjectPromises';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,qBAAqB,EACrB,sCAAsC,EACtC,kCAAkC,EAClC,KAAK,GACN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,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O,EACL,uBAAuB,EACvB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC"}
@@ -1,5 +1,5 @@
1
+ export * from './loadContentDeclaration';
1
2
  export * from './loadDictionaries';
2
- export * from './loadDistantDictionaries';
3
3
  export * from './loadLocalDictionaries';
4
- export * from './loadContentDeclaration';
4
+ export * from './loadRemoteDictionaries';
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC"}
@@ -1,3 +1,6 @@
1
+ import { IntlayerConfig } from '@intlayer/config';
1
2
  import type { Dictionary } from '@intlayer/core';
2
- export declare const loadContentDeclarations: (contentDeclarationFilePath: string[], projectRequire?: NodeJS.Require) => Promise<Dictionary[]>;
3
+ import { DictionariesStatus } from './loadDictionaries';
4
+ export declare const formatLocalDictionaries: (dictionariesRecord: Record<string, Dictionary>) => Dictionary[];
5
+ export declare const loadContentDeclarations: (contentDeclarationFilePath: string[], configuration?: IntlayerConfig, projectRequire?: NodeJS.Require, onStatusUpdate?: (status: DictionariesStatus[]) => void) => Promise<Dictionary[]>;
3
6
  //# sourceMappingURL=loadContentDeclaration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,uBAAuB,GAClC,4BAA4B,MAAM,EAAE,EACpC,+BAA+B,KAC9B,OAAO,CAAC,UAAU,EAAE,CAwBtB,CAAC"}
1
+ {"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,eAAO,MAAM,uBAAuB,GAClC,oBAAoB,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,KAC7C,UAAU,EAMR,CAAC;AAEN,eAAO,MAAM,uBAAuB,GAClC,4BAA4B,MAAM,EAAE,EACpC,gBAAe,cAAmC,EAClD,+BAA+B,EAC/B,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,KACtD,OAAO,CAAC,UAAU,EAAE,CA0DtB,CAAC"}
@@ -1,3 +1,13 @@
1
+ import { type IntlayerConfig } from '@intlayer/config';
1
2
  import type { Dictionary } from '@intlayer/core';
2
- export declare const loadDictionaries: (contentDeclarationsPaths: string[] | string, configuration?: import("@intlayer/config").IntlayerConfig, projectRequire?: NodeJS.Require) => Promise<Dictionary[]>;
3
+ export type DictionariesStatus = {
4
+ dictionaryKey: string;
5
+ type: 'local' | 'remote';
6
+ status: 'pending' | 'fetching' | 'fetched' | 'error' | 'imported' | 'found' | 'building' | 'built';
7
+ error?: string;
8
+ };
9
+ export declare const loadDictionaries: (contentDeclarationsPaths: string[] | string, configuration?: IntlayerConfig, projectRequire?: NodeJS.Require) => Promise<{
10
+ localDictionaries: Dictionary[];
11
+ remoteDictionaries: Dictionary[];
12
+ }>;
3
13
  //# sourceMappingURL=loadDictionaries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQjD,eAAO,MAAM,gBAAgB,GAC3B,0BAA0B,MAAM,EAAE,GAAG,MAAM,EAC3C,yDAAkC,EAClC,+BAA+B,KAC9B,OAAO,CAAC,UAAU,EAAE,CAqFtB,CAAC"}
1
+ {"version":3,"file":"loadDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadDictionaries.ts"],"names":[],"mappings":"AACA,OAAO,EAQL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,OAAO,GAAG,QAAQ,CAAC;IACzB,MAAM,EACF,SAAS,GACT,UAAU,GACV,SAAS,GACT,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA6GF,eAAO,MAAM,gBAAgB,GAC3B,0BAA0B,MAAM,EAAE,GAAG,MAAM,EAC3C,gBAAe,cAAmC,EAClD,+BAA+B,KAC9B,OAAO,CAAC;IACT,iBAAiB,EAAE,UAAU,EAAE,CAAC;IAChC,kBAAkB,EAAE,UAAU,EAAE,CAAC;CAClC,CAuEA,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { DictionaryAPI } from '@intlayer/backend';
2
+ import type { Dictionary } from '@intlayer/core';
3
+ import { DictionariesStatus } from '../loadDictionaries/loadDictionaries';
4
+ export declare const formatDistantDictionaries: (dictionaries: DictionaryAPI[]) => Dictionary[];
5
+ export declare const loadRemoteDictionaries: (configuration?: import("@intlayer/config").IntlayerConfig, onStatusUpdate?: (status: DictionariesStatus[]) => void) => Promise<DictionaryAPI[]>;
6
+ //# sourceMappingURL=loadRemoteDictionaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadRemoteDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAG1E,eAAO,MAAM,yBAAyB,GACpC,cAAc,aAAa,EAAE,KAC5B,UAAU,EAKR,CAAC;AAEN,eAAO,MAAM,sBAAsB,GACjC,yDAAkC,EAClC,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,KACtD,OAAO,CAAC,aAAa,EAAE,CA0EzB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { DictionariesStatus } from './loadDictionaries';
2
+ export declare class DictionariesLogger {
3
+ private statuses;
4
+ private spinnerTimer;
5
+ private spinnerIndex;
6
+ private renderedLines;
7
+ private readonly spinnerFrames;
8
+ private isFinished;
9
+ private readonly prefix;
10
+ private lastRenderedState;
11
+ constructor();
12
+ update(newStatuses: DictionariesStatus[]): void;
13
+ finish(): void;
14
+ private startSpinner;
15
+ private stopSpinner;
16
+ private render;
17
+ private computeProgress;
18
+ }
19
+ //# sourceMappingURL=log.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/log.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,YAAY,CAA+B;IACnD,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAiB;IAC/C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,iBAAiB,CAAc;;IAOvC,MAAM,CAAC,WAAW,EAAE,kBAAkB,EAAE;IAkBxC,MAAM;IAON,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,MAAM;IAwDd,OAAO,CAAC,eAAe;CAyCxB"}
@@ -1,3 +1,3 @@
1
- import type { Dictionary } from '@intlayer/core';
1
+ import { type Dictionary } from '@intlayer/core';
2
2
  export declare const mergeDictionaries: (dictionaries: Dictionary[]) => Dictionary;
3
3
  //# sourceMappingURL=mergeDictionaries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/mergeDictionaries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAuGjD,eAAO,MAAM,iBAAiB,GAAI,cAAc,UAAU,EAAE,KAAG,UAuC9D,CAAC"}
1
+ {"version":3,"file":"mergeDictionaries.d.ts","sourceRoot":"","sources":["../../src/mergeDictionaries.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,gBAAgB,CAAC;AAuG9D,eAAO,MAAM,iBAAiB,GAAI,cAAc,UAAU,EAAE,KAAG,UAoC9D,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Dictionary } from '@intlayer/core';
2
+ /**
3
+ * Orders dictionaries based on the dictionary priority strategy.
4
+ *
5
+ * @param dictionaries - Array of dictionaries to order
6
+ * @param priorityStrategy - The priority strategy ('local_first' or 'distant_first')
7
+ * @returns Ordered array of dictionaries
8
+ */
9
+ export declare const orderDictionaries: (dictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Dictionary[];
10
+ //# sourceMappingURL=orderDictionaries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"orderDictionaries.d.ts","sourceRoot":"","sources":["../../src/orderDictionaries.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAC5B,cAAc,UAAU,EAAE,EAC1B,yDAA8B,KAC7B,UAAU,EAiDZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prepareContentDeclaration.d.ts","sourceRoot":"","sources":["../../src/prepareContentDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,UAAU,EAQhB,MAAM,gBAAgB,CAAC;AAyFxB,eAAO,MAAM,yBAAyB,GAAU,YAAY,UAAU,iBAKlE,CAAC"}
1
+ {"version":3,"file":"prepareContentDeclaration.d.ts","sourceRoot":"","sources":["../../src/prepareContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,UAAU,EAQhB,MAAM,gBAAgB,CAAC;AA2FxB,eAAO,MAAM,yBAAyB,GAAU,YAAY,UAAU,iBAKlE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"prepareIntlayer.d.ts","sourceRoot":"","sources":["../../src/prepareIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,kBAAkB,CAAC;AAY1B,eAAO,MAAM,eAAe,GAC1B,gBAAe,cAAmC,EAClD,+BAA+B,EAC/B,eAAa,kBAwCd,CAAC"}
1
+ {"version":3,"file":"prepareIntlayer.d.ts","sourceRoot":"","sources":["../../src/prepareIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,kBAAkB,CAAC;AAa1B,eAAO,MAAM,eAAe,GAC1B,gBAAe,cAAmC,EAClD,+BAA+B,EAC/B,eAAa,kBA+Cd,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { type Dictionary } from '@intlayer/core';
2
2
  /**
3
3
  *
4
- * Should transform per locale dictionaries to multi-locale dictionaries
4
+ * Should transform per local dictionaries to multi-local dictionaries
5
5
  *
6
6
  * Example:
7
7
  *
@@ -3,5 +3,6 @@ export declare const buildDictionary: (dictionaries: Dictionary[], configuration
3
3
  unmergedDictionaries: import("./intlayer_dictionary/writeUnmergedDictionary").UnmergedDictionaryOutput;
4
4
  mergedDictionaries: import("./intlayer_dictionary/writeMergedDictionary").MergedDictionaryOutput;
5
5
  dynamicDictionaries: import("./intlayer_dictionary/writeDynamicDictionary").LocalizedDictionaryOutput;
6
+ fetchDictionaries: import("./intlayer_dictionary/writeDynamicDictionary").LocalizedDictionaryOutput;
6
7
  }>;
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/declaration_file_to_dictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,eAAe,GAC1B,cAAc,UAAU,EAAE,EAC1B,yDAAkC;;;;EAWnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/declaration_file_to_dictionary/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,eAAe,GAC1B,cAAc,UAAU,EAAE,EAC1B,yDAAkC;;;;;EAWnC,CAAC"}
@@ -1,11 +1,12 @@
1
- import type { DictionaryAPI } from '@intlayer/backend';
2
1
  import type { Dictionary } from '@intlayer/core';
2
+ import { LocalizedDictionaryOutput } from './writeDynamicDictionary';
3
3
  /**
4
4
  * This function transpile the bundled code to to make dictionaries as JSON files
5
5
  */
6
- export declare const buildIntlayerDictionary: (contentDeclarations: (DictionaryAPI | Dictionary)[], configuration?: import("@intlayer/config").IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<{
6
+ export declare const buildIntlayerDictionary: (localDictionariesEntries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<{
7
7
  unmergedDictionaries: import("./writeUnmergedDictionary").UnmergedDictionaryOutput;
8
8
  mergedDictionaries: import("./writeMergedDictionary").MergedDictionaryOutput;
9
- dynamicDictionaries: import("./writeDynamicDictionary").LocalizedDictionaryOutput;
9
+ dynamicDictionaries: LocalizedDictionaryOutput;
10
+ fetchDictionaries: LocalizedDictionaryOutput;
10
11
  }>;
11
12
  //# sourceMappingURL=buildIntlayerDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildIntlayerDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,CAAC,aAAa,GAAG,UAAU,CAAC,EAAE,EACnD,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB;;;;EAuB5C,CAAC"}
1
+ {"version":3,"file":"buildIntlayerDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/buildIntlayerDictionary.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAClC,0BAA0B,UAAU,EAAE,EACtC,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB;;;;;EAwC5C,CAAC"}
@@ -23,7 +23,7 @@ export declare const generateDictionaryEntryPoint: (localedDictionariesPathsReco
23
23
  * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
24
24
  * console.log(finalDictionaries);
25
25
  *
26
- * // .intlayer/dictionaries/home.json
26
+ * // .intlayer/dynamic_dictionaries/home.json
27
27
  * // { key: 'home', content: { ... } },
28
28
  * ```
29
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"writeDynamicDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,MAAM,EACN,yBAAyB,CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA6BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GACjC,oBAAoB,sBAAsB,EAC1C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CA+DnC,CAAC"}
1
+ {"version":3,"file":"writeDynamicDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDynamicDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,OAAO,EAAiB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,MAAM,EACN,yBAAyB,CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GACjC,oBAAoB,sBAAsB,EAC1C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CAiEnC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { LocalizedDictionaryOutput, LocalizedDictionaryResult } from './writeDynamicDictionary';
2
+ /**
3
+ * This function generates the content of the dictionary list file
4
+ */
5
+ export declare const generateDictionaryEntryPoint: (localedDictionariesPathsRecord: LocalizedDictionaryResult, format?: "cjs" | "esm", configuration?: import("@intlayer/config").IntlayerConfig) => string;
6
+ /**
7
+ * Write the localized dictionaries to the dictionariesDir
8
+ * @param mergedDictionaries - The merged dictionaries
9
+ * @param configuration - The configuration
10
+ * @returns The final dictionaries
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
15
+ * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
16
+ * console.log(finalDictionaries);
17
+ *
18
+ * // .intlayer/fetch_dictionaries/home.json
19
+ * // { key: 'home', content: { ... } },
20
+ * ```
21
+ */
22
+ export declare const writeFetchDictionary: (dynamicDictionaries: LocalizedDictionaryOutput, configuration?: import("@intlayer/config").IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<LocalizedDictionaryOutput>;
23
+ //# sourceMappingURL=writeFetchDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeFetchDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeFetchDictionary.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAC/B,qBAAqB,yBAAyB,EAC9C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CA+BnC,CAAC"}
@@ -17,7 +17,7 @@ export type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;
17
17
  * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
18
18
  * console.log(finalDictionaries);
19
19
  *
20
- * // .intlayer/dictionaries/home.json
20
+ * // .intlayer/dictionary/home.json
21
21
  * // { key: 'home', content: { ... } },
22
22
  * ```
23
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"writeMergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,wBAAwB,EAC7C,yDAAkC,KACjC,OAAO,CAAC,sBAAsB,CAqChC,CAAC"}
1
+ {"version":3,"file":"writeMergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeMergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,wBAAwB,EAC7C,yDAAkC,KACjC,OAAO,CAAC,sBAAsB,CA6ChC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Dictionary } from '@intlayer/core';
2
+ /**
3
+ * Write the localized dictionaries to the dictionariesDir
4
+ * @param mergedDictionaries - The merged dictionaries
5
+ * @param configuration - The configuration
6
+ * @returns The final dictionaries
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
11
+ * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
12
+ * console.log(finalDictionaries);
13
+ *
14
+ * // .intlayer/fetch_dictionaries/home.json
15
+ * // { key: 'home', content: { ... } },
16
+ * ```
17
+ */
18
+ export declare const writeRemoteDictionary: (remoteDictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<Dictionary[]>;
19
+ //# sourceMappingURL=writeRemoteDictionary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeRemoteDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeRemoteDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAChC,oBAAoB,UAAU,EAAE,EAChC,yDAAkC,KACjC,OAAO,CAAC,UAAU,EAAE,CAyBtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"writeUnmergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAqBjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,UAAU,EAAE,EAC1B,yDAAkC,KACjC,OAAO,CAAC,wBAAwB,CA+BlC,CAAC"}
1
+ {"version":3,"file":"writeUnmergedDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeUnmergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAuBjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,UAAU,EAAE,EAC1B,yDAAkC,KACjC,OAAO,CAAC,wBAAwB,CAkDlC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * This function generates a list of dictionaries in the main directory
3
3
  */
4
- export declare const createDictionaryEntryPoint: (configuration?: import("@intlayer/config").IntlayerConfig, dictionariesKeys?: string[], formats?: ("cjs" | "esm")[]) => void;
4
+ export declare const createDictionaryEntryPoint: (configuration?: import("@intlayer/config").IntlayerConfig, dictionariesKeys?: string[], formats?: ("cjs" | "esm")[]) => Promise<void>;
5
5
  //# sourceMappingURL=createDictionaryEntryPoint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,EAClC,mBAAmB,MAAM,EAAE,EAC3B,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,SAgD5C,CAAC"}
1
+ {"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AAgCA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,EAClC,mBAAmB,MAAM,EAAE,EAC3B,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,kBA6C5C,CAAC"}
@@ -2,5 +2,5 @@ export declare const getTypeName: (key: string) => string;
2
2
  /**
3
3
  * This function generates a index file merging all the types
4
4
  */
5
- export declare const createModuleAugmentation: (configuration?: import("@intlayer/config").IntlayerConfig) => void;
5
+ export declare const createModuleAugmentation: (configuration?: import("@intlayer/config").IntlayerConfig) => Promise<void>;
6
6
  //# sourceMappingURL=createModuleAugmentation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MACH,CAAC;AA8FxC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,SAmBnC,CAAC"}
1
+ {"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createModuleAugmentation.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MACH,CAAC;AA8FxC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,kBAiBnC,CAAC"}
@@ -4,5 +4,5 @@ export declare const generateTypeScriptType: (dictionary: Dictionary) => string;
4
4
  /**
5
5
  * This function generates a TypeScript type definition from a JSON object
6
6
  */
7
- export declare const createTypes: (dictionariesPaths: string[], configuration?: IntlayerConfig) => string[];
7
+ export declare const createTypes: (dictionariesPaths: string[], configuration?: IntlayerConfig) => Promise<string[]>;
8
8
  //# sourceMappingURL=createType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AASjD,eAAO,MAAM,sBAAsB,GAAI,YAAY,UAAU,WAI5D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,mBAAmB,MAAM,EAAE,EAC3B,gBAAe,cAAmC,KACjD,MAAM,EA2BR,CAAC"}
1
+ {"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_type/createType.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAUjD,eAAO,MAAM,sBAAsB,GAAI,YAAY,UAAU,WAI5D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,mBAAmB,MAAM,EAAE,EAC3B,gBAAe,cAAmC,KACjD,OAAO,CAAC,MAAM,EAAE,CA0BlB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ANSIColors, Locales } from '@intlayer/config';
2
+ export declare const formatPath: (path: string | string[], color?: ANSIColors | false) => string;
3
+ export declare const formatLocale: (locale: Locales | Locales[], color?: ANSIColors | false) => string;
4
+ //# sourceMappingURL=formatter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../../src/utils/formatter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA0B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAK/E,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,GAAG,MAAM,EAAE,EACvB,QAAQ,UAAU,GAAG,KAAK,WAYb,CAAC;AAEhB,eAAO,MAAM,YAAY,GACvB,QAAQ,OAAO,GAAG,OAAO,EAAE,EAC3B,QAAO,UAAU,GAAG,KAAwB,WAM/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const parallelize: <T, R>(items: T[], callback: (item: T) => Promise<R>, parallelLimit?: number) => Promise<R[]>;
2
+ //# sourceMappingURL=parallelize.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parallelize.d.ts","sourceRoot":"","sources":["../../../src/utils/parallelize.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,CAAC,EACpC,OAAO,CAAC,EAAE,EACV,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACjC,gBAAe,MAAW,KACzB,OAAO,CAAC,CAAC,EAAE,CAGb,CAAC"}
@@ -20,5 +20,5 @@
20
20
  *
21
21
  * @throws {Error} When there are unexpected filesystem errors
22
22
  */
23
- export declare const runOnce: (sentinelFilePath: string, callback: () => void | Promise<void>, cacheTimeoutMs?: number) => Promise<void>;
23
+ export declare const runOnce: (sentinelFilePath: string, callback: () => void | Promise<void>, onIsCached?: () => void | Promise<void>, cacheTimeoutMs?: number) => Promise<void>;
24
24
  //# sourceMappingURL=runOnce.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runOnce.d.ts","sourceRoot":"","sources":["../../../src/utils/runOnce.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,GAClB,kBAAkB,MAAM,EACxB,UAAU,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,iBAAgB,MAAkB,kBAyCnC,CAAC"}
1
+ {"version":3,"file":"runOnce.d.ts","sourceRoot":"","sources":["../../../src/utils/runOnce.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,OAAO,GAClB,kBAAkB,MAAM,EACxB,UAAU,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,aAAa,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACvC,iBAAgB,MAAkB,kBA0CnC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/formatCode.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,EAAE,MAAM,MAAM,iBA4C9D,CAAC"}
1
+ {"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/formatCode.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,EAAE,MAAM,MAAM,iBA+C9D,CAAC"}