@intlayer/chokidar 8.4.3 → 8.4.5

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 (497) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  3. package/dist/cjs/build.cjs +58 -1
  4. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +62 -1
  5. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  6. package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -1
  7. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +26 -1
  8. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  9. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +107 -4
  10. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  11. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +81 -5
  12. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  13. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +46 -1
  14. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  15. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +50 -1
  16. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  17. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +59 -1
  18. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  19. package/dist/cjs/cleanOutputDir.cjs +30 -1
  20. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  21. package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -1
  22. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  23. package/dist/cjs/cli.cjs +35 -1
  24. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +70 -1
  25. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  26. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +42 -7
  27. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  28. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +23 -1
  29. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  30. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +24 -1
  31. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  32. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +24 -1
  33. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +23 -1
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +23 -1
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -1
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +112 -9
  40. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  41. package/dist/cjs/createType/createType.cjs +29 -1
  42. package/dist/cjs/createType/createType.cjs.map +1 -1
  43. package/dist/cjs/createType/index.cjs +8 -1
  44. package/dist/cjs/detectFormatCommand.cjs +32 -1
  45. package/dist/cjs/detectFormatCommand.cjs.map +1 -1
  46. package/dist/cjs/fetchDistantDictionaries.cjs +51 -1
  47. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  48. package/dist/cjs/filterInvalidDictionaries.cjs +52 -1
  49. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  50. package/dist/cjs/formatDictionary.cjs +49 -1
  51. package/dist/cjs/formatDictionary.cjs.map +1 -1
  52. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +61 -7
  53. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  54. package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -1
  55. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +34 -1
  56. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  57. package/dist/cjs/handleContentDeclarationFileChange.cjs +49 -1
  58. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  59. package/dist/cjs/handleContentDeclarationFileMoved.cjs +24 -1
  60. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  61. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +37 -1
  62. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  63. package/dist/cjs/init/index.cjs +284 -1
  64. package/dist/cjs/init/index.cjs.map +1 -1
  65. package/dist/cjs/init/utils/configManipulation.cjs +111 -1
  66. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  67. package/dist/cjs/init/utils/fileSystem.cjs +39 -1
  68. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  69. package/dist/cjs/init/utils/index.cjs +14 -1
  70. package/dist/cjs/init/utils/jsonParser.cjs +42 -3
  71. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  72. package/dist/cjs/init/utils/tsConfig.cjs +18 -1
  73. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  74. package/dist/cjs/initConfig/index.cjs +39 -1
  75. package/dist/cjs/initConfig/index.cjs.map +1 -1
  76. package/dist/cjs/installMCP/installMCP.cjs +50 -1
  77. package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
  78. package/dist/cjs/installSkills/index.cjs +303 -1
  79. package/dist/cjs/installSkills/index.cjs.map +1 -1
  80. package/dist/cjs/listDictionariesPath.cjs +42 -1
  81. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  82. package/dist/cjs/listGitFiles.cjs +105 -5
  83. package/dist/cjs/listGitFiles.cjs.map +1 -1
  84. package/dist/cjs/listProjects.cjs +47 -1
  85. package/dist/cjs/listProjects.cjs.map +1 -1
  86. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +68 -1
  87. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  88. package/dist/cjs/loadDictionaries/index.cjs +14 -1
  89. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +93 -2
  90. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  91. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +127 -1
  92. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  93. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -1
  94. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  95. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +61 -1
  96. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  97. package/dist/cjs/loadDictionaries/log.cjs +138 -3
  98. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +63 -2
  100. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
  101. package/dist/cjs/logConfigDetails.cjs +39 -2
  102. package/dist/cjs/logConfigDetails.cjs.map +1 -1
  103. package/dist/cjs/prepareIntlayer.cjs +103 -1
  104. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  105. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +30 -1
  106. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  107. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +12 -1
  108. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  109. package/dist/cjs/utils/autoDecorateContent.cjs +89 -1
  110. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  111. package/dist/cjs/utils/buildComponentFilesList.cjs +67 -1
  112. package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -1
  113. package/dist/cjs/utils/buildFilesList.cjs +83 -1
  114. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  115. package/dist/cjs/utils/chunkJSON.cjs +336 -1
  116. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  117. package/dist/cjs/utils/formatter.cjs +18 -1
  118. package/dist/cjs/utils/formatter.cjs.map +1 -1
  119. package/dist/cjs/utils/getChunk.cjs +34 -1
  120. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  121. package/dist/cjs/utils/getContentExtension.cjs +29 -1
  122. package/dist/cjs/utils/getContentExtension.cjs.map +1 -1
  123. package/dist/cjs/utils/getFormatFromExtension.cjs +34 -1
  124. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  125. package/dist/cjs/utils/getPathHash.cjs +10 -1
  126. package/dist/cjs/utils/getPathHash.cjs.map +1 -1
  127. package/dist/cjs/utils/index.cjs +49 -1
  128. package/dist/cjs/utils/mergeChunks.cjs +28 -1
  129. package/dist/cjs/utils/mergeChunks.cjs.map +1 -1
  130. package/dist/cjs/utils/pLimit.cjs +128 -1
  131. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  132. package/dist/cjs/utils/parallelize.cjs +11 -1
  133. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  134. package/dist/cjs/utils/parallelizeGlobal.cjs +29 -1
  135. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  136. package/dist/cjs/utils/reduceObjectFormat.cjs +31 -1
  137. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  138. package/dist/cjs/utils/resolveObjectPromises.cjs +21 -1
  139. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  140. package/dist/cjs/utils/resolveRelativePath.cjs +21 -1
  141. package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -1
  142. package/dist/cjs/utils/runOnce.cjs +95 -1
  143. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  144. package/dist/cjs/utils/runParallel/bin.cjs +54 -1
  145. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  146. package/dist/cjs/utils/runParallel/bootstrap.cjs +24 -1
  147. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  148. package/dist/cjs/utils/runParallel/index.cjs +115 -1
  149. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  150. package/dist/cjs/utils/runParallel/pidTree.cjs +145 -1
  151. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  152. package/dist/cjs/utils/runParallel/ps.cjs +49 -1
  153. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  154. package/dist/cjs/utils/runParallel/runTask.cjs +154 -1
  155. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  156. package/dist/cjs/utils/runParallel/spawnPosix.cjs +59 -1
  157. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  158. package/dist/cjs/utils/runParallel/spawnWin32.cjs +43 -1
  159. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  160. package/dist/cjs/utils/runParallel/wmic.cjs +52 -1
  161. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  162. package/dist/cjs/utils/sortAlphabetically.cjs +7 -1
  163. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  164. package/dist/cjs/utils/splitTextByLine.cjs +11 -1
  165. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  166. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -1
  167. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  168. package/dist/cjs/watcher.cjs +120 -1
  169. package/dist/cjs/watcher.cjs.map +1 -1
  170. package/dist/cjs/writeConfiguration/index.cjs +42 -1
  171. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  172. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +28 -1
  173. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  174. package/dist/cjs/writeContentDeclaration/index.cjs +10 -1
  175. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +94 -1
  176. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +412 -3
  178. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +127 -2
  180. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  181. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +148 -1
  182. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  183. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +92 -1
  184. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  185. package/dist/cjs/writeFileIfChanged.cjs +50 -1
  186. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  187. package/dist/cjs/writeJsonIfChanged.cjs +17 -1
  188. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  189. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  190. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  191. package/dist/esm/build.mjs +25 -1
  192. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +60 -1
  193. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  194. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -1
  195. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +24 -1
  196. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  197. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +102 -4
  198. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +77 -5
  200. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  201. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +44 -1
  202. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  203. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +48 -1
  204. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  205. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +56 -1
  206. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  207. package/dist/esm/cleanOutputDir.mjs +28 -1
  208. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  209. package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -1
  210. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  211. package/dist/esm/cli.mjs +15 -1
  212. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +68 -1
  213. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  214. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +40 -7
  215. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  216. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +20 -1
  217. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  218. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +21 -1
  219. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  220. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +21 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +20 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +20 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  226. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -1
  227. package/dist/esm/createType/createModuleAugmentation.mjs +108 -9
  228. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  229. package/dist/esm/createType/createType.mjs +26 -1
  230. package/dist/esm/createType/createType.mjs.map +1 -1
  231. package/dist/esm/createType/index.mjs +4 -1
  232. package/dist/esm/detectFormatCommand.mjs +30 -1
  233. package/dist/esm/detectFormatCommand.mjs.map +1 -1
  234. package/dist/esm/fetchDistantDictionaries.mjs +49 -1
  235. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  236. package/dist/esm/filterInvalidDictionaries.mjs +48 -1
  237. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  238. package/dist/esm/formatDictionary.mjs +44 -1
  239. package/dist/esm/formatDictionary.mjs.map +1 -1
  240. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +59 -7
  241. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  242. package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -1
  243. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +32 -1
  244. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  245. package/dist/esm/handleContentDeclarationFileChange.mjs +47 -1
  246. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileMoved.mjs +22 -1
  248. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  249. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +35 -1
  250. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  251. package/dist/esm/init/index.mjs +281 -1
  252. package/dist/esm/init/index.mjs.map +1 -1
  253. package/dist/esm/init/utils/configManipulation.mjs +108 -1
  254. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  255. package/dist/esm/init/utils/fileSystem.mjs +34 -1
  256. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  257. package/dist/esm/init/utils/index.mjs +6 -1
  258. package/dist/esm/init/utils/jsonParser.mjs +40 -3
  259. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  260. package/dist/esm/init/utils/tsConfig.mjs +16 -1
  261. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  262. package/dist/esm/initConfig/index.mjs +37 -1
  263. package/dist/esm/initConfig/index.mjs.map +1 -1
  264. package/dist/esm/installMCP/installMCP.mjs +46 -1
  265. package/dist/esm/installMCP/installMCP.mjs.map +1 -1
  266. package/dist/esm/installSkills/index.mjs +295 -1
  267. package/dist/esm/installSkills/index.mjs.map +1 -1
  268. package/dist/esm/listDictionariesPath.mjs +38 -1
  269. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  270. package/dist/esm/listGitFiles.mjs +100 -5
  271. package/dist/esm/listGitFiles.mjs.map +1 -1
  272. package/dist/esm/listProjects.mjs +43 -1
  273. package/dist/esm/listProjects.mjs.map +1 -1
  274. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +67 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  276. package/dist/esm/loadDictionaries/index.mjs +6 -1
  277. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +88 -2
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  279. package/dist/esm/loadDictionaries/loadDictionaries.mjs +124 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  281. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +25 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  283. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +58 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  285. package/dist/esm/loadDictionaries/log.mjs +134 -3
  286. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  287. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +61 -2
  288. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
  289. package/dist/esm/logConfigDetails.mjs +36 -2
  290. package/dist/esm/logConfigDetails.mjs.map +1 -1
  291. package/dist/esm/prepareIntlayer.mjs +99 -1
  292. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  293. package/dist/esm/reduceDictionaryContent/applyMask.mjs +28 -1
  294. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  295. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +10 -1
  296. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  297. package/dist/esm/utils/autoDecorateContent.mjs +86 -1
  298. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  299. package/dist/esm/utils/buildComponentFilesList.mjs +64 -1
  300. package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +79 -1
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +333 -1
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +13 -1
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +33 -1
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getContentExtension.mjs +27 -1
  310. package/dist/esm/utils/getContentExtension.mjs.map +1 -1
  311. package/dist/esm/utils/getFormatFromExtension.mjs +31 -1
  312. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  313. package/dist/esm/utils/getPathHash.mjs +7 -1
  314. package/dist/esm/utils/getPathHash.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +22 -1
  316. package/dist/esm/utils/mergeChunks.mjs +26 -1
  317. package/dist/esm/utils/mergeChunks.mjs.map +1 -1
  318. package/dist/esm/utils/pLimit.mjs +125 -1
  319. package/dist/esm/utils/pLimit.mjs.map +1 -1
  320. package/dist/esm/utils/parallelize.mjs +10 -1
  321. package/dist/esm/utils/parallelize.mjs.map +1 -1
  322. package/dist/esm/utils/parallelizeGlobal.mjs +26 -1
  323. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  324. package/dist/esm/utils/reduceObjectFormat.mjs +29 -1
  325. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  326. package/dist/esm/utils/resolveObjectPromises.mjs +19 -1
  327. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  328. package/dist/esm/utils/resolveRelativePath.mjs +19 -1
  329. package/dist/esm/utils/resolveRelativePath.mjs.map +1 -1
  330. package/dist/esm/utils/runOnce.mjs +92 -1
  331. package/dist/esm/utils/runOnce.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/bin.mjs +52 -1
  333. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/bootstrap.mjs +22 -1
  335. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/index.mjs +113 -1
  337. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/pidTree.mjs +142 -1
  339. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/ps.mjs +46 -1
  341. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/runTask.mjs +152 -1
  343. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/spawnPosix.mjs +57 -1
  345. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  346. package/dist/esm/utils/runParallel/spawnWin32.mjs +41 -1
  347. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  348. package/dist/esm/utils/runParallel/wmic.mjs +49 -1
  349. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  350. package/dist/esm/utils/sortAlphabetically.mjs +5 -1
  351. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  352. package/dist/esm/utils/splitTextByLine.mjs +9 -1
  353. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  354. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +58 -1
  355. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  356. package/dist/esm/watcher.mjs +117 -1
  357. package/dist/esm/watcher.mjs.map +1 -1
  358. package/dist/esm/writeConfiguration/index.mjs +39 -1
  359. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +26 -1
  361. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  362. package/dist/esm/writeContentDeclaration/index.mjs +6 -1
  363. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +91 -1
  364. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +407 -3
  366. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +124 -2
  368. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +146 -1
  370. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  371. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +90 -1
  372. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  373. package/dist/esm/writeFileIfChanged.mjs +48 -1
  374. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  375. package/dist/esm/writeJsonIfChanged.mjs +16 -1
  376. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  377. package/dist/types/build.d.ts +20 -20
  378. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -2
  379. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  380. package/dist/types/buildIntlayerDictionary/index.d.ts +2 -2
  381. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -2
  382. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  383. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +49 -2
  384. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  385. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +7 -7
  386. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  387. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +30 -2
  388. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  389. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -2
  390. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  391. package/dist/types/cli.d.ts +6 -6
  392. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -2
  393. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  394. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -2
  395. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  396. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -2
  397. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  398. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -2
  399. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  400. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -2
  401. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  402. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -2
  403. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  404. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -2
  405. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  406. package/dist/types/createDictionaryEntryPoint/index.d.ts +7 -7
  407. package/dist/types/createType/createModuleAugmentation.d.ts +9 -2
  408. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  409. package/dist/types/createType/createType.d.ts +12 -2
  410. package/dist/types/createType/createType.d.ts.map +1 -0
  411. package/dist/types/createType/index.d.ts +2 -2
  412. package/dist/types/fetchDistantDictionaries.d.ts +1 -1
  413. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  414. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -2
  415. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  416. package/dist/types/getContentDeclarationFileTemplate/index.d.ts +1 -1
  417. package/dist/types/loadDictionaries/index.d.ts +4 -4
  418. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +12 -2
  419. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
  420. package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -2
  421. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
  422. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -2
  423. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
  424. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -2
  425. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  426. package/dist/types/loadDictionaries/log.d.ts +1 -1
  427. package/dist/types/utils/getFormatFromExtension.d.ts +8 -2
  428. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
  429. package/dist/types/utils/index.d.ts +1 -1
  430. package/dist/types/writeConfiguration/index.d.ts.map +1 -1
  431. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -2
  432. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
  433. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -2
  434. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  435. package/dist/types/writeContentDeclaration/index.d.ts +5 -5
  436. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  437. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -2
  438. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  439. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -2
  440. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
  441. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -2
  442. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  443. package/package.json +8 -8
  444. package/dist/cjs/_utils_asset-SJVy1xMD.cjs +0 -2
  445. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  446. package/dist/esm/_utils_asset-4w8dPH9r.mjs +0 -2
  447. package/dist/esm/chunk-DDgYwkfe.mjs +0 -1
  448. package/dist/types/buildIntlayerDictionary-_xrGjSmw.d.ts +0 -25
  449. package/dist/types/buildIntlayerDictionary-_xrGjSmw.d.ts.map +0 -1
  450. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts +0 -14
  451. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts.map +0 -1
  452. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts +0 -9
  453. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts.map +0 -1
  454. package/dist/types/createType--rDwdg2t.d.ts +0 -12
  455. package/dist/types/createType--rDwdg2t.d.ts.map +0 -1
  456. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts +0 -12
  457. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts.map +0 -1
  458. package/dist/types/dictionaryStatus-DPVO37qe.d.ts +0 -5
  459. package/dist/types/dictionaryStatus-DPVO37qe.d.ts.map +0 -1
  460. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts +0 -10
  461. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts.map +0 -1
  462. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts +0 -10
  463. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts.map +0 -1
  464. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts +0 -10
  465. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts.map +0 -1
  466. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts +0 -10
  467. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts.map +0 -1
  468. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts +0 -10
  469. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts.map +0 -1
  470. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts +0 -10
  471. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts.map +0 -1
  472. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts +0 -7
  473. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts.map +0 -1
  474. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts +0 -8
  475. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts.map +0 -1
  476. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts +0 -12
  477. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts.map +0 -1
  478. package/dist/types/loadDictionaries-BIqHwtYE.d.ts +0 -23
  479. package/dist/types/loadDictionaries-BIqHwtYE.d.ts.map +0 -1
  480. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts +0 -8
  481. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts.map +0 -1
  482. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts +0 -15
  483. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts.map +0 -1
  484. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts +0 -11
  485. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts.map +0 -1
  486. package/dist/types/transformJSFile-Cg0LkeLb.d.ts +0 -11
  487. package/dist/types/transformJSFile-Cg0LkeLb.d.ts.map +0 -1
  488. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts +0 -19
  489. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts.map +0 -1
  490. package/dist/types/writeDynamicDictionary-DO8f3FYl.d.ts +0 -48
  491. package/dist/types/writeDynamicDictionary-DO8f3FYl.d.ts.map +0 -1
  492. package/dist/types/writeJSFile-kK95jzg_.d.ts +0 -14
  493. package/dist/types/writeJSFile-kK95jzg_.d.ts.map +0 -1
  494. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts +0 -30
  495. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts.map +0 -1
  496. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts +0 -34
  497. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"createDictionaryEntryPoint.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.system;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\nexport type CreateDictionaryEntryPointOptions = {\n formats?: ('cjs' | 'esm')[];\n excludeKeys?: string[];\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n options: CreateDictionaryEntryPointOptions = {}\n) => {\n const { formats, excludeKeys = [] } = options;\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.system;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":"svBAYA,MAAM,EAAuB,MAC3B,EACA,EACA,EACA,EACA,EACA,EAAgB,GAAkB,GAC/B,CACH,IAAM,EAAU,EACd,MAAM,EACN,EACA,EACA,EACA,EACD,CACK,EAAY,IAAW,MAAQ,MAAQ,MAEvC,CAAE,WAAY,EAAc,OAElC,MAAM,EACJ,EAAQ,EAAS,GAAG,EAAS,GAAG,IAAY,CAC5C,EACD,EAWU,EAA6B,MACxC,EAAgB,GAAkB,CAClC,EAA6C,EAAE,GAC5C,CACH,GAAM,CAAE,UAAS,cAAc,EAAE,EAAK,EAChC,EAAgB,GAAW,EAAc,MAAM,aAC/C,CAAE,WAAY,EAAc,OAElC,MAAM,EAAM,EAAS,CAAE,UAAW,GAAM,CAAC,CA+DzC,MAAM,EA7DkB,CACtB,GAAG,EAAc,IACd,IACE,CACC,MAAO,EAAyB,EAAe,EAAY,CAC3D,WAAY,OACZ,aAAc,kBACd,SAAU,eACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAO,EAAiC,EAAe,EAAY,CACnE,WAAY,OACZ,aAAc,0BACd,SAAU,wBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAO,EACL,EACA,EACA,EACD,CACD,WAAY,aACZ,aAAc,yBACd,SAAU,uBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAO,EACL,EACA,EACA,EACD,CACD,WAAY,aACZ,aAAc,uBACd,SAAU,qBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAO,EAA+B,EAAe,EAAY,CACjE,WAAY,OACZ,aAAc,wBACd,SAAU,sBACV,SACD,EACJ,CACF,CAIC,MAAO,CAAE,QAAO,WAAU,SAAQ,eAAc,gBAC9C,EACE,EACA,EACA,EACA,EACA,EACA,EACD,CACJ"}
1
+ {"version":3,"file":"createDictionaryEntryPoint.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.system;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\nexport type CreateDictionaryEntryPointOptions = {\n formats?: ('cjs' | 'esm')[];\n excludeKeys?: string[];\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n options: CreateDictionaryEntryPointOptions = {}\n) => {\n const { formats, excludeKeys = [] } = options;\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.system;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;AAYA,MAAM,uBAAuB,OAC3B,OACA,UACA,YACA,cACA,QACA,gBAAgB,kBAAkB,KAC/B;CACH,MAAM,UAAU,8BACd,MAAM,OACN,cACA,YACA,QACA,cACD;CACD,MAAM,YAAY,WAAW,QAAQ,QAAQ;CAE7C,MAAM,EAAE,YAAY,cAAc;AAElC,OAAM,mBACJ,QAAQ,SAAS,GAAG,SAAS,GAAG,YAAY,EAC5C,QACD;;;;;AAWH,MAAa,6BAA6B,OACxC,gBAAgB,kBAAkB,EAClC,UAA6C,EAAE,KAC5C;CACH,MAAM,EAAE,SAAS,cAAc,EAAE,KAAK;CACtC,MAAM,gBAAgB,WAAW,cAAc,MAAM;CACrD,MAAM,EAAE,YAAY,cAAc;AAElC,OAAM,MAAM,SAAS,EAAE,WAAW,MAAM,CAAC;AA+DzC,OAAM,YA7DkB;EACtB,GAAG,cAAc,KACd,YACE;GACC,OAAO,yBAAyB,eAAe,YAAY;GAC3D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,iCAAiC,eAAe,YAAY;GACnE,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,gCACL,eACA,QACA,YACD;GACD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,8BACL,eACA,QACA,YACD;GACD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAO,+BAA+B,eAAe,YAAY;GACjE,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACF,EAIC,OAAO,EAAE,OAAO,UAAU,QAAQ,cAAc,iBAC9C,qBACE,OACA,UACA,YACA,cACA,QACA,cACD,CACJ"}
@@ -1,8 +1,41 @@
1
- import{getPathHash as e}from"../utils/getPathHash.mjs";import{basename as t,extname as n,relative as r}from"node:path";import{getConfiguration as i}from"@intlayer/config/node";import{normalizePath as a}from"@intlayer/config/utils";const o=(o,s,c,l=`esm`,u=i())=>{let{mainDir:d}=u.system,f=``,p=o.map(i=>({relativePath:a(r(d,i)),id:t(i,n(i)),hash:`_${e(i)}`}));p.forEach(e=>{l===`esm`&&(f+=`import ${e.hash} from '${e.relativePath}'${c===`json`?` with { type: 'json' }`:``};\n`),l===`cjs`&&(f+=`const ${e.hash} = require('${e.relativePath}');\n`)}),f+=`
2
- `;let m=p.map(e=>` "${e.id}": ${e.hash}`).join(`,
3
- `);return f+=`const dictionaries = {\n${m}\n};\n`,f+=`const ${s} = () => dictionaries;\n`,l===`esm`&&(f+=`
4
- `,f+=`export { ${s} };\n`,f+=`export default dictionaries;
5
- `),l===`cjs`&&(f+=`
6
- `,f+=`module.exports.${s} = ${s};\n`,f+=`module.exports = dictionaries;
7
- `),f};export{o as generateDictionaryListContent};
1
+ import { getPathHash } from "../utils/getPathHash.mjs";
2
+ import { basename, extname, relative } from "node:path";
3
+ import { getConfiguration } from "@intlayer/config/node";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/generateDictionaryListContent.ts
7
+ /**
8
+ * This function generates the content of the dictionary list file
9
+ */
10
+ const generateDictionaryListContent = (dictionaries, functionName, importType, format = "esm", configuration = getConfiguration()) => {
11
+ const { mainDir } = configuration.system;
12
+ let content = "";
13
+ const dictionariesRef = dictionaries.map((dictionaryPath) => ({
14
+ relativePath: normalizePath(relative(mainDir, dictionaryPath)),
15
+ id: basename(dictionaryPath, extname(dictionaryPath)),
16
+ hash: `_${getPathHash(dictionaryPath)}`
17
+ }));
18
+ dictionariesRef.forEach((dictionary) => {
19
+ if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === "json" ? " with { type: 'json' }" : ""};\n`;
20
+ if (format === "cjs") content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\n`;
21
+ });
22
+ content += "\n";
23
+ const formattedDictionaryMap = dictionariesRef.map((dictionary) => ` "${dictionary.id}": ${dictionary.hash}`).join(",\n");
24
+ content += `const dictionaries = {\n${formattedDictionaryMap}\n};\n`;
25
+ content += `const ${functionName} = () => dictionaries;\n`;
26
+ if (format === "esm") {
27
+ content += `\n`;
28
+ content += `export { ${functionName} };\n`;
29
+ content += `export default dictionaries;\n`;
30
+ }
31
+ if (format === "cjs") {
32
+ content += `\n`;
33
+ content += `module.exports.${functionName} = ${functionName};\n`;
34
+ content += `module.exports = dictionaries;\n`;
35
+ }
36
+ return content;
37
+ };
38
+
39
+ //#endregion
40
+ export { generateDictionaryListContent };
8
41
  //# sourceMappingURL=generateDictionaryListContent.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateDictionaryListContent.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { normalizePath } from '@intlayer/config/utils';\nimport { getPathHash } from '../utils/getPathHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n importType: 'json' | 'javascript',\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.system;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getPathHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === 'json' ? \" with { type: 'json' }\" : ''};\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":"uOAQA,MAAa,GACX,EACA,EACA,EACA,EAAwB,MACxB,EAAgB,GAAkB,GACvB,CACX,GAAM,CAAE,WAAY,EAAc,OAE9B,EAAU,GAER,EAAkB,EAAa,IAAK,IAAoB,CAC5D,aAAc,EAAc,EAAS,EAAS,EAAe,CAAC,CAC9D,GAAI,EAAS,EAAgB,EAAQ,EAAe,CAAC,CACrD,KAAM,IAAI,EAAY,EAAe,GACtC,EAAE,CAGH,EAAgB,QAAS,GAAe,CAClC,IAAW,QACb,GAAW,UAAU,EAAW,KAAK,SAAS,EAAW,aAAa,GAAG,IAAe,OAAS,yBAA2B,GAAG,MAC7H,IAAW,QACb,GAAW,SAAS,EAAW,KAAK,cAAc,EAAW,aAAa,SAC5E,CAEF,GAAW;EAGX,IAAM,EAAiC,EACpC,IAAK,GAAe,MAAM,EAAW,GAAG,KAAK,EAAW,OAAO,CAC/D,KAAK;EAAM,CAiBd,MAfA,IAAW,2BAA2B,EAAuB,QAC7D,GAAW,SAAS,EAAa,0BAE7B,IAAW,QACb,GAAW;EACX,GAAW,YAAY,EAAa,OACpC,GAAW;GAGT,IAAW,QACb,GAAW;EACX,GAAW,kBAAkB,EAAa,KAAK,EAAa,KAC5D,GAAW;GAGN"}
1
+ {"version":3,"file":"generateDictionaryListContent.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { normalizePath } from '@intlayer/config/utils';\nimport { getPathHash } from '../utils/getPathHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n importType: 'json' | 'javascript',\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.system;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getPathHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === 'json' ? \" with { type: 'json' }\" : ''};\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,iCACX,cACA,cACA,YACA,SAAwB,OACxB,gBAAgB,kBAAkB,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,cAAc,cAAc,SAAS,SAAS,eAAe,CAAC;EAC9D,IAAI,SAAS,gBAAgB,QAAQ,eAAe,CAAC;EACrD,MAAM,IAAI,YAAY,eAAe;EACtC,EAAE;AAGH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa,GAAG,eAAe,SAAS,2BAA2B,GAAG;AACjI,MAAI,WAAW,MACb,YAAW,SAAS,WAAW,KAAK,cAAc,WAAW,aAAa;GAC5E;AAEF,YAAW;CAGX,MAAM,yBAAiC,gBACpC,KAAK,eAAe,MAAM,WAAW,GAAG,KAAK,WAAW,OAAO,CAC/D,KAAK,MAAM;AAEd,YAAW,2BAA2B,uBAAuB;AAC7D,YAAW,SAAS,aAAa;AAEjC,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,YAAY,aAAa;AACpC,aAAW;;AAGb,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,kBAAkB,aAAa,KAAK,aAAa;AAC5D,aAAW;;AAGb,QAAO"}
@@ -1,2 +1,21 @@
1
- import{basename as e}from"node:path";import t from"fast-glob";import{existsSync as n,mkdirSync as r}from"node:fs";import{normalizePath as i}from"@intlayer/config/utils";const a=async(a,o=[])=>{let{dictionariesDir:s,mainDir:c}=a.system;return n(c)||r(c,{recursive:!0}),(await t(`${i(s)}/**/*.json`)).filter(t=>{let n=e(t,`.json`);return!o.includes(n)})};export{a as getBuiltDictionariesPath};
1
+ import { basename } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { existsSync, mkdirSync } from "node:fs";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts
7
+ /**
8
+ * This function generates a list of dictionaries in the main directory
9
+ */
10
+ const getBuiltDictionariesPath = async (configuration, excludeKeys = []) => {
11
+ const { dictionariesDir, mainDir } = configuration.system;
12
+ if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
13
+ return (await fg(`${normalizePath(dictionariesDir)}/**/*.json`)).filter((path) => {
14
+ const key = basename(path, ".json");
15
+ return !excludeKeys.includes(key);
16
+ });
17
+ };
18
+
19
+ //#endregion
20
+ export { getBuiltDictionariesPath };
2
21
  //# sourceMappingURL=getBuiltDictionariesPath.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBuiltDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { dictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"yKASA,MAAa,EAA2B,MACtC,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,kBAAiB,WAAY,EAAc,OAWnD,OARK,EAAW,EAAQ,EACtB,EAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAM,EACvC,GAAG,EAAc,EAAgB,CAAC,YACnC,EAEuB,OAAQ,GAAS,CACvC,IAAM,EAAM,EAAS,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
1
+ {"version":3,"file":"getBuiltDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { dictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,2BAA2B,OACtC,eACA,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,iBAAiB,YAAY,cAAc;AAGnD,KAAI,CAAC,WAAW,QAAQ,CACtB,WAAU,SAAS,EAAE,WAAW,MAAM,CAAC;AAOzC,SAJmC,MAAM,GACvC,GAAG,cAAc,gBAAgB,CAAC,YACnC,EAEuB,QAAQ,SAAS;EACvC,MAAM,MAAM,SAAS,MAAM,QAAQ;AACnC,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
@@ -1,2 +1,22 @@
1
- import{basename as e}from"node:path";import t from"fast-glob";import{existsSync as n,mkdirSync as r}from"node:fs";import{normalizePath as i}from"@intlayer/config/utils";const a=async(a,o=`esm`,s=[])=>{let{dynamicDictionariesDir:c,mainDir:l}=a.system;n(l)||r(l,{recursive:!0});let u=o===`cjs`?`cjs`:`mjs`;return(await t(`${i(c)}/*.${u}`)).filter(t=>{let n=e(t,`.${u}`);return!s.includes(n)})};export{a as getBuiltDynamicDictionariesPath};
1
+ import { basename } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { existsSync, mkdirSync } from "node:fs";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts
7
+ /**
8
+ * This function generates a list of dictionaries in the main directory
9
+ */
10
+ const getBuiltDynamicDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
11
+ const { dynamicDictionariesDir, mainDir } = configuration.system;
12
+ if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
13
+ const extension = format === "cjs" ? "cjs" : "mjs";
14
+ return (await fg(`${normalizePath(dynamicDictionariesDir)}/*.${extension}`)).filter((path) => {
15
+ const key = basename(path, `.${extension}`);
16
+ return !excludeKeys.includes(key);
17
+ });
18
+ };
19
+
20
+ //#endregion
21
+ export { getBuiltDynamicDictionariesPath };
2
22
  //# sourceMappingURL=getBuiltDynamicDictionariesPath.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBuiltDynamicDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"yKASA,MAAa,EAAkC,MAC7C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,yBAAwB,WAAY,EAAc,OAGrD,EAAW,EAAQ,EACtB,EAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAM,EACvC,GAAG,EAAc,EAAuB,CAAC,KAAK,IAC/C,EAEuB,OAAQ,GAAS,CACvC,IAAM,EAAM,EAAS,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
1
+ {"version":3,"file":"getBuiltDynamicDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,kCAAkC,OAC7C,eACA,SAAwB,OACxB,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,wBAAwB,YAAY,cAAc;AAG1D,KAAI,CAAC,WAAW,QAAQ,CACtB,WAAU,SAAS,EAAE,WAAW,MAAM,CAAC;CAGzC,MAAM,YAAY,WAAW,QAAQ,QAAQ;AAM7C,SAJmC,MAAM,GACvC,GAAG,cAAc,uBAAuB,CAAC,KAAK,YAC/C,EAEuB,QAAQ,SAAS;EACvC,MAAM,MAAM,SAAS,MAAM,IAAI,YAAY;AAC3C,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
@@ -1,2 +1,22 @@
1
- import{basename as e}from"node:path";import t from"fast-glob";import{existsSync as n,mkdirSync as r}from"node:fs";import{normalizePath as i}from"@intlayer/config/utils";const a=async(a,o=`esm`,s=[])=>{let{fetchDictionariesDir:c,mainDir:l}=a.system;n(l)||r(l,{recursive:!0});let u=o===`cjs`?`cjs`:`mjs`;return(await t(`${i(c)}/*.${u}`)).filter(t=>{let n=e(t,`.${u}`);return!s.includes(n)})};export{a as getBuiltFetchDictionariesPath};
1
+ import { basename } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { existsSync, mkdirSync } from "node:fs";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts
7
+ /**
8
+ * This function generates a list of dictionaries in the main directory
9
+ */
10
+ const getBuiltFetchDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
11
+ const { fetchDictionariesDir, mainDir } = configuration.system;
12
+ if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
13
+ const extension = format === "cjs" ? "cjs" : "mjs";
14
+ return (await fg(`${normalizePath(fetchDictionariesDir)}/*.${extension}`)).filter((path) => {
15
+ const key = basename(path, `.${extension}`);
16
+ return !excludeKeys.includes(key);
17
+ });
18
+ };
19
+
20
+ //#endregion
21
+ export { getBuiltFetchDictionariesPath };
2
22
  //# sourceMappingURL=getBuiltFetchDictionariesPath.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBuiltFetchDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"yKASA,MAAa,EAAgC,MAC3C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,uBAAsB,WAAY,EAAc,OAGnD,EAAW,EAAQ,EACtB,EAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAM,EACvC,GAAG,EAAc,EAAqB,CAAC,KAAK,IAC7C,EAEuB,OAAQ,GAAS,CACvC,IAAM,EAAM,EAAS,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
1
+ {"version":3,"file":"getBuiltFetchDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,gCAAgC,OAC3C,eACA,SAAwB,OACxB,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,sBAAsB,YAAY,cAAc;AAGxD,KAAI,CAAC,WAAW,QAAQ,CACtB,WAAU,SAAS,EAAE,WAAW,MAAM,CAAC;CAGzC,MAAM,YAAY,WAAW,QAAQ,QAAQ;AAM7C,SAJmC,MAAM,GACvC,GAAG,cAAc,qBAAqB,CAAC,KAAK,YAC7C,EAEuB,QAAQ,SAAS;EACvC,MAAM,MAAM,SAAS,MAAM,IAAI,YAAY;AAC3C,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
@@ -1,2 +1,21 @@
1
- import{basename as e}from"node:path";import t from"fast-glob";import{existsSync as n,mkdirSync as r}from"node:fs";import{normalizePath as i}from"@intlayer/config/utils";const a=async(a,o=[])=>{let{remoteDictionariesDir:s,mainDir:c}=a.system;return n(c)||r(c,{recursive:!0}),t.sync(`${i(s)}/**/*.json`).filter(t=>{let n=e(t,`.json`);return!o.includes(n)})};export{a as getBuiltRemoteDictionariesPath};
1
+ import { basename } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { existsSync, mkdirSync } from "node:fs";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts
7
+ /**
8
+ * This function generates a list of dictionaries in the main directory
9
+ */
10
+ const getBuiltRemoteDictionariesPath = async (configuration, excludeKeys = []) => {
11
+ const { remoteDictionariesDir, mainDir } = configuration.system;
12
+ if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
13
+ return fg.sync(`${normalizePath(remoteDictionariesDir)}/**/*.json`).filter((path) => {
14
+ const key = basename(path, ".json");
15
+ return !excludeKeys.includes(key);
16
+ });
17
+ };
18
+
19
+ //#endregion
20
+ export { getBuiltRemoteDictionariesPath };
2
21
  //# sourceMappingURL=getBuiltRemoteDictionariesPath.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBuiltRemoteDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"yKASA,MAAa,EAAiC,MAC5C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,wBAAuB,WAAY,EAAc,OAWzD,OARK,EAAW,EAAQ,EACtB,EAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGN,EAAG,KACpC,GAAG,EAAc,EAAsB,CAAC,YACzC,CAEuB,OAAQ,GAAS,CACvC,IAAM,EAAM,EAAS,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
1
+ {"version":3,"file":"getBuiltRemoteDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,iCAAiC,OAC5C,eACA,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,uBAAuB,YAAY,cAAc;AAGzD,KAAI,CAAC,WAAW,QAAQ,CACtB,WAAU,SAAS,EAAE,WAAW,MAAM,CAAC;AAOzC,QAJmC,GAAG,KACpC,GAAG,cAAc,sBAAsB,CAAC,YACzC,CAEuB,QAAQ,SAAS;EACvC,MAAM,MAAM,SAAS,MAAM,QAAQ;AACnC,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
@@ -1,2 +1,21 @@
1
- import{basename as e}from"node:path";import t from"fast-glob";import{existsSync as n,mkdirSync as r}from"node:fs";import{normalizePath as i}from"@intlayer/config/utils";const a=async(a,o=[])=>{let{unmergedDictionariesDir:s,mainDir:c}=a.system;return n(c)||r(c,{recursive:!0}),(await t(`${i(s)}/**/*.json`)).filter(t=>{let n=e(t,`.json`);return!o.includes(n)})};export{a as getBuiltUnmergedDictionariesPath};
1
+ import { basename } from "node:path";
2
+ import fg from "fast-glob";
3
+ import { existsSync, mkdirSync } from "node:fs";
4
+ import { normalizePath } from "@intlayer/config/utils";
5
+
6
+ //#region src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts
7
+ /**
8
+ * This function generates a list of dictionaries in the main directory
9
+ */
10
+ const getBuiltUnmergedDictionariesPath = async (configuration, excludeKeys = []) => {
11
+ const { unmergedDictionariesDir, mainDir } = configuration.system;
12
+ if (!existsSync(mainDir)) mkdirSync(mainDir, { recursive: true });
13
+ return (await fg(`${normalizePath(unmergedDictionariesDir)}/**/*.json`)).filter((path) => {
14
+ const key = basename(path, ".json");
15
+ return !excludeKeys.includes(key);
16
+ });
17
+ };
18
+
19
+ //#endregion
20
+ export { getBuiltUnmergedDictionariesPath };
2
21
  //# sourceMappingURL=getBuiltUnmergedDictionariesPath.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getBuiltUnmergedDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"yKASA,MAAa,EAAmC,MAC9C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,0BAAyB,WAAY,EAAc,OAW3D,OARK,EAAW,EAAQ,EACtB,EAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAM,EACvC,GAAG,EAAc,EAAwB,CAAC,YAC3C,EAEuB,OAAQ,GAAS,CACvC,IAAM,EAAM,EAAS,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
1
+ {"version":3,"file":"getBuiltUnmergedDictionariesPath.mjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":";;;;;;;;;AASA,MAAa,mCAAmC,OAC9C,eACA,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,yBAAyB,YAAY,cAAc;AAG3D,KAAI,CAAC,WAAW,QAAQ,CACtB,WAAU,SAAS,EAAE,WAAW,MAAM,CAAC;AAOzC,SAJmC,MAAM,GACvC,GAAG,cAAc,wBAAwB,CAAC,YAC3C,EAEuB,QAAQ,SAAS;EACvC,MAAM,MAAM,SAAS,MAAM,QAAQ;AACnC,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
@@ -1 +1,9 @@
1
- import{generateDictionaryListContent as e}from"./generateDictionaryListContent.mjs";import{getBuiltDictionariesPath as t}from"./getBuiltDictionariesPath.mjs";import{getBuiltDynamicDictionariesPath as n}from"./getBuiltDynamicDictionariesPath.mjs";import{getBuiltFetchDictionariesPath as r}from"./getBuiltFetchDictionariesPath.mjs";import{getBuiltRemoteDictionariesPath as i}from"./getBuiltRemoteDictionariesPath.mjs";import{getBuiltUnmergedDictionariesPath as a}from"./getBuiltUnmergedDictionariesPath.mjs";import{createDictionaryEntryPoint as o}from"./createDictionaryEntryPoint.mjs";export{o as createDictionaryEntryPoint,e as generateDictionaryListContent,t as getBuiltDictionariesPath,n as getBuiltDynamicDictionariesPath,r as getBuiltFetchDictionariesPath,i as getBuiltRemoteDictionariesPath,a as getBuiltUnmergedDictionariesPath};
1
+ import { generateDictionaryListContent } from "./generateDictionaryListContent.mjs";
2
+ import { getBuiltDictionariesPath } from "./getBuiltDictionariesPath.mjs";
3
+ import { getBuiltDynamicDictionariesPath } from "./getBuiltDynamicDictionariesPath.mjs";
4
+ import { getBuiltFetchDictionariesPath } from "./getBuiltFetchDictionariesPath.mjs";
5
+ import { getBuiltRemoteDictionariesPath } from "./getBuiltRemoteDictionariesPath.mjs";
6
+ import { getBuiltUnmergedDictionariesPath } from "./getBuiltUnmergedDictionariesPath.mjs";
7
+ import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint.mjs";
8
+
9
+ export { createDictionaryEntryPoint, generateDictionaryListContent, getBuiltDictionariesPath, getBuiltDynamicDictionariesPath, getBuiltFetchDictionariesPath, getBuiltRemoteDictionariesPath, getBuiltUnmergedDictionariesPath };
@@ -1,10 +1,109 @@
1
- import{writeFileIfChanged as e}from"../writeFileIfChanged.mjs";import{getPathHash as t}from"../utils/getPathHash.mjs";import{mkdir as n}from"node:fs/promises";import{basename as r,extname as i,join as a,relative as o}from"node:path";import s from"fast-glob";import{kebabCaseToCamelCase as c,normalizePath as l}from"@intlayer/config/utils";import{createAuxiliaryTypeStore as u,printNode as d,zodToTs as f}from"zod-to-ts";const p=e=>`${c(e)}Content`,m=e=>e.map(e=>` "${e}": 1;`).join(`
2
- `),h=e=>{if(!e)return`any`;let t=e._def??e.def??e;switch(t.typeName??t.type){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodNull`:case`null`:return`null`;case`ZodUndefined`:case`undefined`:return`undefined`;case`ZodArray`:case`array`:return`${h(t.type??t.element)}[]`;case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{\n${Object.entries(e).map(([e,t])=>` "${e}": ${h(t)};`).join(`
3
- `)}\n }`:`Record<string, any>`}case`ZodOptional`:case`optional`:return`${h(t.innerType??t.wrapped)} | undefined`;case`ZodNullable`:case`nullable`:return`${h(t.innerType??t.wrapped)} | null`;case`ZodUnion`:case`union`:return(t.options??[]).map(h).join(` | `);case`ZodIntersection`:case`intersection`:return`${h(t.left)} & ${h(t.right)}`;case`ZodEnum`:case`enum`:return(t.values??[]).map(e=>`"${e}"`).join(` | `);case`ZodLiteral`:case`literal`:{let e=t.value;return typeof e==`string`?`"${e}"`:String(e)}default:return`any`}},g=(e,n)=>{let{internationalization:a,system:s,editor:c}=n,{moduleAugmentationDir:l}=s,{enabled:p}=c,{locales:g,requiredLocales:_,strictMode:v}=a,y=`import "intlayer";
4
- `,b=e.map(e=>({relativePath:`./${o(l,e)}`,id:r(e,i(e)),hash:`_${t(e)}`}));for(let e of b)y+=`import ${e.hash} from '${e.relativePath}';\n`;y+=`
5
- `;let x=b.map(e=>` "${e.id}": typeof ${e.hash};`).join(`
6
- `),S=g,C=_?.length?_.filter(e=>S.includes(e)):S,w=m(S),T=m(C),E=n.schemas??{},D=Object.entries(E).map(([e,t])=>{let n=`any`;if(t)try{let{node:e}=f(t,{auxiliaryTypeStore:u()});n=e.kind===133?h(t):d(e)}catch{n=h(t)}return` "${e}": ${n};`}).join(`
7
- `),O=v===`strict`?`strict`:v===`inclusive`?`inclusive`:`loose`;return y+=`declare module 'intlayer' {
8
- `,y+=` interface __DictionaryRegistry {\n${x}\n }\n\n`,y+=` interface __DeclaredLocalesRegistry {\n${w}\n }\n\n`,y+=` interface __RequiredLocalesRegistry {\n${T}\n }\n\n`,y+=` interface __SchemaRegistry {\n${D}\n }\n\n`,y+=` interface __StrictModeRegistry { mode: '${O}' }\n\n`,y+=` interface __EditorRegistry { enabled : ${p} } \n`,y+=`}
9
- `,y},_=async t=>{let{moduleAugmentationDir:r,typesDir:i}=t.system;await n(r,{recursive:!0});let o=g(await s(l(`${i}/*.ts`),{ignore:[`**/*.d.ts`]}),t);await e(a(r,`intlayer.d.ts`),o)};export{_ as createModuleAugmentation,p as getTypeName};
1
+ import { writeFileIfChanged } from "../writeFileIfChanged.mjs";
2
+ import { getPathHash } from "../utils/getPathHash.mjs";
3
+ import { mkdir } from "node:fs/promises";
4
+ import { basename, extname, join, relative } from "node:path";
5
+ import fg from "fast-glob";
6
+ import { kebabCaseToCamelCase, normalizePath } from "@intlayer/config/utils";
7
+ import { createAuxiliaryTypeStore, printNode, zodToTs } from "zod-to-ts";
8
+
9
+ //#region src/createType/createModuleAugmentation.ts
10
+ const getTypeName = (key) => `${kebabCaseToCamelCase(key)}Content`;
11
+ /** Returns lines like: [Locales.FRENCH]: 1; */
12
+ const formatLocales = (locales) => locales.map((locale) => ` "${locale}": 1;`).join("\n");
13
+ const zodToTsString = (schema) => {
14
+ if (!schema) return "any";
15
+ const def = schema._def ?? schema.def ?? schema;
16
+ switch (def.typeName ?? def.type) {
17
+ case "ZodString":
18
+ case "string": return "string";
19
+ case "ZodNumber":
20
+ case "number": return "number";
21
+ case "ZodBoolean":
22
+ case "boolean": return "boolean";
23
+ case "ZodNull":
24
+ case "null": return "null";
25
+ case "ZodUndefined":
26
+ case "undefined": return "undefined";
27
+ case "ZodArray":
28
+ case "array": return `${zodToTsString(def.type ?? def.element)}[]`;
29
+ case "ZodObject":
30
+ case "object": {
31
+ const shape = typeof def.shape === "function" ? def.shape() : def.shape;
32
+ if (!shape) return "Record<string, any>";
33
+ return `{\n${Object.entries(shape).map(([k, v]) => ` "${k}": ${zodToTsString(v)};`).join("\n")}\n }`;
34
+ }
35
+ case "ZodOptional":
36
+ case "optional": return `${zodToTsString(def.innerType ?? def.wrapped)} | undefined`;
37
+ case "ZodNullable":
38
+ case "nullable": return `${zodToTsString(def.innerType ?? def.wrapped)} | null`;
39
+ case "ZodUnion":
40
+ case "union": return (def.options ?? []).map(zodToTsString).join(" | ");
41
+ case "ZodIntersection":
42
+ case "intersection": return `${zodToTsString(def.left)} & ${zodToTsString(def.right)}`;
43
+ case "ZodEnum":
44
+ case "enum": return (def.values ?? []).map((v) => `"${v}"`).join(" | ");
45
+ case "ZodLiteral":
46
+ case "literal": {
47
+ const value = def.value;
48
+ return typeof value === "string" ? `"${value}"` : String(value);
49
+ }
50
+ default: return "any";
51
+ }
52
+ };
53
+ /** Generate the content of the module augmentation file */
54
+ const generateTypeIndexContent = (typeFiles, configuration) => {
55
+ const { internationalization, system, editor } = configuration;
56
+ const { moduleAugmentationDir } = system;
57
+ const { enabled } = editor;
58
+ const { locales, requiredLocales, strictMode } = internationalization;
59
+ let fileContent = "import \"intlayer\";\n";
60
+ const dictionariesRef = typeFiles.map((dictionaryPath) => ({
61
+ relativePath: `./${relative(moduleAugmentationDir, dictionaryPath)}`,
62
+ id: basename(dictionaryPath, extname(dictionaryPath)),
63
+ hash: `_${getPathHash(dictionaryPath)}`
64
+ }));
65
+ for (const dictionary of dictionariesRef) fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\n`;
66
+ fileContent += "\n";
67
+ const formattedDictionaryMap = dictionariesRef.map((dictionary) => ` "${dictionary.id}": typeof ${dictionary.hash};`).join("\n");
68
+ const declared = locales;
69
+ const requiredSanitized = requiredLocales?.length ? requiredLocales.filter((requiredLocales) => declared.includes(requiredLocales)) : declared;
70
+ const formattedDeclaredLocales = formatLocales(declared);
71
+ const formattedRequiredLocales = formatLocales(requiredSanitized);
72
+ const schemas = configuration.schemas ?? {};
73
+ const formattedSchemas = Object.entries(schemas).map(([key, schema]) => {
74
+ let typeStr = "any";
75
+ if (schema) try {
76
+ const { node } = zodToTs(schema, { auxiliaryTypeStore: createAuxiliaryTypeStore() });
77
+ if (node.kind !== 133) typeStr = printNode(node);
78
+ else typeStr = zodToTsString(schema);
79
+ } catch (_e) {
80
+ typeStr = zodToTsString(schema);
81
+ }
82
+ return ` "${key}": ${typeStr};`;
83
+ }).join("\n");
84
+ const strictKey = strictMode === "strict" ? "strict" : strictMode === "inclusive" ? "inclusive" : "loose";
85
+ /**
86
+ * Module augmentation that ONLY adds keys to registries.
87
+ * No types/aliases redefined here—avoids merge conflicts.
88
+ */
89
+ fileContent += `declare module 'intlayer' {\n`;
90
+ fileContent += ` interface __DictionaryRegistry {\n${formattedDictionaryMap}\n }\n\n`;
91
+ fileContent += ` interface __DeclaredLocalesRegistry {\n${formattedDeclaredLocales}\n }\n\n`;
92
+ fileContent += ` interface __RequiredLocalesRegistry {\n${formattedRequiredLocales}\n }\n\n`;
93
+ fileContent += ` interface __SchemaRegistry {\n${formattedSchemas}\n }\n\n`;
94
+ fileContent += ` interface __StrictModeRegistry { mode: '${strictKey}' }\n\n`;
95
+ fileContent += ` interface __EditorRegistry { enabled : ${enabled} } \n`;
96
+ fileContent += `}\n`;
97
+ return fileContent;
98
+ };
99
+ /** Generate the index file merging all the types */
100
+ const createModuleAugmentation = async (configuration) => {
101
+ const { moduleAugmentationDir, typesDir } = configuration.system;
102
+ await mkdir(moduleAugmentationDir, { recursive: true });
103
+ const tsContent = generateTypeIndexContent(await fg(normalizePath(`${typesDir}/*.ts`), { ignore: ["**/*.d.ts"] }), configuration);
104
+ await writeFileIfChanged(join(moduleAugmentationDir, "intlayer.d.ts"), tsContent);
105
+ };
106
+
107
+ //#endregion
108
+ export { createModuleAugmentation, getTypeName };
10
109
  //# sourceMappingURL=createModuleAugmentation.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createModuleAugmentation.mjs","names":[],"sources":["../../../src/createType/createModuleAugmentation.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { basename, extname, join, relative } from 'node:path';\nimport { kebabCaseToCamelCase, normalizePath } from '@intlayer/config/utils';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\nimport { createAuxiliaryTypeStore, printNode, zodToTs } from 'zod-to-ts';\nimport { getPathHash } from '../utils';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\n\nexport const getTypeName = (key: string): string =>\n `${kebabCaseToCamelCase(key)}Content`;\n\n/** Returns lines like: [Locales.FRENCH]: 1; */\nconst formatLocales = (locales: Locale[]) =>\n locales.map((locale) => ` \"${locale}\": 1;`).join('\\n');\n\nconst zodToTsString = (schema: any): string => {\n if (!schema) return 'any';\n\n // Support both real Zod objects (_def) and serialized versions (def or nested)\n const def = schema._def ?? schema.def ?? schema;\n\n // Handle serialized type names (sometimes 'type' instead of 'typeName')\n const typeName = def.typeName ?? def.type;\n\n switch (typeName) {\n case 'ZodString':\n case 'string':\n return 'string';\n case 'ZodNumber':\n case 'number':\n return 'number';\n case 'ZodBoolean':\n case 'boolean':\n return 'boolean';\n case 'ZodNull':\n case 'null':\n return 'null';\n case 'ZodUndefined':\n case 'undefined':\n return 'undefined';\n case 'ZodArray':\n case 'array':\n return `${zodToTsString(def.type ?? def.element)}[]`;\n case 'ZodObject':\n case 'object': {\n const shape = typeof def.shape === 'function' ? def.shape() : def.shape;\n if (!shape) return 'Record<string, any>';\n\n const entries = Object.entries(shape)\n .map(([k, v]) => ` \"${k}\": ${zodToTsString(v)};`)\n .join('\\n');\n return `{\\n${entries}\\n }`;\n }\n case 'ZodOptional':\n case 'optional':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | undefined`;\n case 'ZodNullable':\n case 'nullable':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | null`;\n case 'ZodUnion':\n case 'union': {\n const options = def.options ?? [];\n return options.map(zodToTsString).join(' | ');\n }\n case 'ZodIntersection':\n case 'intersection':\n return `${zodToTsString(def.left)} & ${zodToTsString(def.right)}`;\n case 'ZodEnum':\n case 'enum': {\n const values = def.values ?? [];\n return values.map((v: string) => `\"${v}\"`).join(' | ');\n }\n case 'ZodLiteral':\n case 'literal': {\n const value = def.value;\n return typeof value === 'string' ? `\"${value}\"` : String(value);\n }\n default:\n return 'any';\n }\n};\n\n/** Generate the content of the module augmentation file */\nconst generateTypeIndexContent = (\n typeFiles: string[],\n configuration: IntlayerConfig\n): string => {\n const { internationalization, system, editor } = configuration;\n const { moduleAugmentationDir } = system;\n const { enabled } = editor;\n const { locales, requiredLocales, strictMode } = internationalization;\n\n let fileContent = 'import \"intlayer\";\\n';\n\n // Build dictionary refs\n const dictionariesRef = typeFiles.map((dictionaryPath) => ({\n relativePath: `./${relative(moduleAugmentationDir, dictionaryPath)}`,\n id: basename(dictionaryPath, extname(dictionaryPath)),\n hash: `_${getPathHash(dictionaryPath)}`,\n }));\n\n // Import all dictionaries\n for (const dictionary of dictionariesRef) {\n fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\\n`;\n }\n fileContent += '\\n';\n\n // Dictionary map entries (id: typeof <hash>)\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": typeof ${dictionary.hash};`)\n .join('\\n');\n\n // Ensure required ⊆ declared; if empty, default required = declared\n const declared = locales;\n const requiredSanitized = requiredLocales?.length\n ? requiredLocales.filter((requiredLocales) =>\n declared.includes(requiredLocales)\n )\n : declared;\n\n const formattedDeclaredLocales = formatLocales(declared);\n const formattedRequiredLocales = formatLocales(requiredSanitized);\n\n // Build schema registry\n const schemas = configuration.schemas ?? {};\n const formattedSchemas = Object.entries(schemas)\n .map(([key, schema]) => {\n let typeStr = 'any';\n\n if (schema) {\n try {\n const { node } = zodToTs(schema, {\n auxiliaryTypeStore: createAuxiliaryTypeStore(),\n });\n // 133 is the kind for AnyKeyword in TypeScript\n if ((node as any).kind !== 133) {\n typeStr = printNode(node);\n } else {\n // Fallback to custom string generator if zodToTs returns any\n typeStr = zodToTsString(schema);\n }\n } catch (_e) {\n // Fallback to custom string generator\n typeStr = zodToTsString(schema);\n }\n }\n return ` \"${key}\": ${typeStr};`;\n })\n .join('\\n');\n\n // Choose strict mode registry key\n const strictKey =\n strictMode === 'strict'\n ? 'strict'\n : strictMode === 'inclusive'\n ? 'inclusive'\n : 'loose';\n\n /**\n * Module augmentation that ONLY adds keys to registries.\n * No types/aliases redefined here—avoids merge conflicts.\n */\n fileContent += `declare module 'intlayer' {\\n`;\n // Dictionaries registry\n fileContent += ` interface __DictionaryRegistry {\\n${formattedDictionaryMap}\\n }\\n\\n`;\n // Locales registries\n fileContent += ` interface __DeclaredLocalesRegistry {\\n${formattedDeclaredLocales}\\n }\\n\\n`;\n fileContent += ` interface __RequiredLocalesRegistry {\\n${formattedRequiredLocales}\\n }\\n\\n`;\n // Schema registry\n fileContent += ` interface __SchemaRegistry {\\n${formattedSchemas}\\n }\\n\\n`;\n // Resolved strict mode (narrow the literal at build time)\n fileContent += ` interface __StrictModeRegistry { mode: '${strictKey}' }\\n\\n`;\n // Editor registry\n fileContent += ` interface __EditorRegistry { enabled : ${enabled} } \\n`;\n fileContent += `}\\n`;\n\n return fileContent;\n};\n\n/** Generate the index file merging all the types */\nexport const createModuleAugmentation = async (\n configuration: IntlayerConfig\n) => {\n const { moduleAugmentationDir, typesDir } = configuration.system;\n\n await mkdir(moduleAugmentationDir, { recursive: true });\n\n const dictionariesTypesDefinitions: string[] = await fg(\n normalizePath(`${typesDir}/*.ts`),\n { ignore: ['**/*.d.ts'] }\n );\n\n const tsContent = generateTypeIndexContent(\n dictionariesTypesDefinitions,\n configuration\n );\n\n const tsFilePath = join(moduleAugmentationDir, 'intlayer.d.ts');\n await writeFileIfChanged(tsFilePath, tsContent);\n};\n"],"mappings":"oaAUA,MAAa,EAAe,GAC1B,GAAG,EAAqB,EAAI,CAAC,SAGzB,EAAiB,GACrB,EAAQ,IAAK,GAAW,QAAQ,EAAO,OAAO,CAAC,KAAK;EAAK,CAErD,EAAiB,GAAwB,CAC7C,GAAI,CAAC,EAAQ,MAAO,MAGpB,IAAM,EAAM,EAAO,MAAQ,EAAO,KAAO,EAKzC,OAFiB,EAAI,UAAY,EAAI,KAErC,CACE,IAAK,YACL,IAAK,SACH,MAAO,SACT,IAAK,YACL,IAAK,SACH,MAAO,SACT,IAAK,aACL,IAAK,UACH,MAAO,UACT,IAAK,UACL,IAAK,OACH,MAAO,OACT,IAAK,eACL,IAAK,YACH,MAAO,YACT,IAAK,WACL,IAAK,QACH,MAAO,GAAG,EAAc,EAAI,MAAQ,EAAI,QAAQ,CAAC,IACnD,IAAK,YACL,IAAK,SAAU,CACb,IAAM,EAAQ,OAAO,EAAI,OAAU,WAAa,EAAI,OAAO,CAAG,EAAI,MAMlE,OALK,EAKE,MAHS,OAAO,QAAQ,EAAM,CAClC,KAAK,CAAC,EAAG,KAAO,UAAU,EAAE,KAAK,EAAc,EAAE,CAAC,GAAG,CACrD,KAAK;EAAK,CACQ,SALF,sBAOrB,IAAK,cACL,IAAK,WACH,MAAO,GAAG,EAAc,EAAI,WAAa,EAAI,QAAQ,CAAC,cACxD,IAAK,cACL,IAAK,WACH,MAAO,GAAG,EAAc,EAAI,WAAa,EAAI,QAAQ,CAAC,SACxD,IAAK,WACL,IAAK,QAEH,OADgB,EAAI,SAAW,EAAE,EAClB,IAAI,EAAc,CAAC,KAAK,MAAM,CAE/C,IAAK,kBACL,IAAK,eACH,MAAO,GAAG,EAAc,EAAI,KAAK,CAAC,KAAK,EAAc,EAAI,MAAM,GACjE,IAAK,UACL,IAAK,OAEH,OADe,EAAI,QAAU,EAAE,EACjB,IAAK,GAAc,IAAI,EAAE,GAAG,CAAC,KAAK,MAAM,CAExD,IAAK,aACL,IAAK,UAAW,CACd,IAAM,EAAQ,EAAI,MAClB,OAAO,OAAO,GAAU,SAAW,IAAI,EAAM,GAAK,OAAO,EAAM,CAEjE,QACE,MAAO,QAKP,GACJ,EACA,IACW,CACX,GAAM,CAAE,uBAAsB,SAAQ,UAAW,EAC3C,CAAE,yBAA0B,EAC5B,CAAE,WAAY,EACd,CAAE,UAAS,kBAAiB,cAAe,EAE7C,EAAc;EAGZ,EAAkB,EAAU,IAAK,IAAoB,CACzD,aAAc,KAAK,EAAS,EAAuB,EAAe,GAClE,GAAI,EAAS,EAAgB,EAAQ,EAAe,CAAC,CACrD,KAAM,IAAI,EAAY,EAAe,GACtC,EAAE,CAGH,IAAK,IAAM,KAAc,EACvB,GAAe,UAAU,EAAW,KAAK,SAAS,EAAW,aAAa,MAE5E,GAAe;EAGf,IAAM,EAAiC,EACpC,IAAK,GAAe,QAAQ,EAAW,GAAG,YAAY,EAAW,KAAK,GAAG,CACzE,KAAK;EAAK,CAGP,EAAW,EACX,EAAoB,GAAiB,OACvC,EAAgB,OAAQ,GACtB,EAAS,SAAS,EAAgB,CACnC,CACD,EAEE,EAA2B,EAAc,EAAS,CAClD,EAA2B,EAAc,EAAkB,CAG3D,EAAU,EAAc,SAAW,EAAE,CACrC,EAAmB,OAAO,QAAQ,EAAQ,CAC7C,KAAK,CAAC,EAAK,KAAY,CACtB,IAAI,EAAU,MAEd,GAAI,EACF,GAAI,CACF,GAAM,CAAE,QAAS,EAAQ,EAAQ,CAC/B,mBAAoB,GAA0B,CAC/C,CAAC,CAEF,AACE,EADG,EAAa,OAAS,IAIf,EAAc,EAAO,CAHrB,EAAU,EAAK,MAKhB,CAEX,EAAU,EAAc,EAAO,CAGnC,MAAO,QAAQ,EAAI,KAAK,EAAQ,IAChC,CACD,KAAK;EAAK,CAGP,EACJ,IAAe,SACX,SACA,IAAe,YACb,YACA,QAoBR,MAdA,IAAe;EAEf,GAAe,uCAAuC,EAAuB,WAE7E,GAAe,4CAA4C,EAAyB,WACpF,GAAe,4CAA4C,EAAyB,WAEpF,GAAe,mCAAmC,EAAiB,WAEnE,GAAe,6CAA6C,EAAU,SAEtE,GAAe,4CAA4C,EAAQ,OACnE,GAAe;EAER,GAII,EAA2B,KACtC,IACG,CACH,GAAM,CAAE,wBAAuB,YAAa,EAAc,OAE1D,MAAM,EAAM,EAAuB,CAAE,UAAW,GAAM,CAAC,CAOvD,IAAM,EAAY,EAL6B,MAAM,EACnD,EAAc,GAAG,EAAS,OAAO,CACjC,CAAE,OAAQ,CAAC,YAAY,CAAE,CAC1B,CAIC,EACD,CAGD,MAAM,EADa,EAAK,EAAuB,gBAAgB,CAC1B,EAAU"}
1
+ {"version":3,"file":"createModuleAugmentation.mjs","names":[],"sources":["../../../src/createType/createModuleAugmentation.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { basename, extname, join, relative } from 'node:path';\nimport { kebabCaseToCamelCase, normalizePath } from '@intlayer/config/utils';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\nimport { createAuxiliaryTypeStore, printNode, zodToTs } from 'zod-to-ts';\nimport { getPathHash } from '../utils';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\n\nexport const getTypeName = (key: string): string =>\n `${kebabCaseToCamelCase(key)}Content`;\n\n/** Returns lines like: [Locales.FRENCH]: 1; */\nconst formatLocales = (locales: Locale[]) =>\n locales.map((locale) => ` \"${locale}\": 1;`).join('\\n');\n\nconst zodToTsString = (schema: any): string => {\n if (!schema) return 'any';\n\n // Support both real Zod objects (_def) and serialized versions (def or nested)\n const def = schema._def ?? schema.def ?? schema;\n\n // Handle serialized type names (sometimes 'type' instead of 'typeName')\n const typeName = def.typeName ?? def.type;\n\n switch (typeName) {\n case 'ZodString':\n case 'string':\n return 'string';\n case 'ZodNumber':\n case 'number':\n return 'number';\n case 'ZodBoolean':\n case 'boolean':\n return 'boolean';\n case 'ZodNull':\n case 'null':\n return 'null';\n case 'ZodUndefined':\n case 'undefined':\n return 'undefined';\n case 'ZodArray':\n case 'array':\n return `${zodToTsString(def.type ?? def.element)}[]`;\n case 'ZodObject':\n case 'object': {\n const shape = typeof def.shape === 'function' ? def.shape() : def.shape;\n if (!shape) return 'Record<string, any>';\n\n const entries = Object.entries(shape)\n .map(([k, v]) => ` \"${k}\": ${zodToTsString(v)};`)\n .join('\\n');\n return `{\\n${entries}\\n }`;\n }\n case 'ZodOptional':\n case 'optional':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | undefined`;\n case 'ZodNullable':\n case 'nullable':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | null`;\n case 'ZodUnion':\n case 'union': {\n const options = def.options ?? [];\n return options.map(zodToTsString).join(' | ');\n }\n case 'ZodIntersection':\n case 'intersection':\n return `${zodToTsString(def.left)} & ${zodToTsString(def.right)}`;\n case 'ZodEnum':\n case 'enum': {\n const values = def.values ?? [];\n return values.map((v: string) => `\"${v}\"`).join(' | ');\n }\n case 'ZodLiteral':\n case 'literal': {\n const value = def.value;\n return typeof value === 'string' ? `\"${value}\"` : String(value);\n }\n default:\n return 'any';\n }\n};\n\n/** Generate the content of the module augmentation file */\nconst generateTypeIndexContent = (\n typeFiles: string[],\n configuration: IntlayerConfig\n): string => {\n const { internationalization, system, editor } = configuration;\n const { moduleAugmentationDir } = system;\n const { enabled } = editor;\n const { locales, requiredLocales, strictMode } = internationalization;\n\n let fileContent = 'import \"intlayer\";\\n';\n\n // Build dictionary refs\n const dictionariesRef = typeFiles.map((dictionaryPath) => ({\n relativePath: `./${relative(moduleAugmentationDir, dictionaryPath)}`,\n id: basename(dictionaryPath, extname(dictionaryPath)),\n hash: `_${getPathHash(dictionaryPath)}`,\n }));\n\n // Import all dictionaries\n for (const dictionary of dictionariesRef) {\n fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\\n`;\n }\n fileContent += '\\n';\n\n // Dictionary map entries (id: typeof <hash>)\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": typeof ${dictionary.hash};`)\n .join('\\n');\n\n // Ensure required ⊆ declared; if empty, default required = declared\n const declared = locales;\n const requiredSanitized = requiredLocales?.length\n ? requiredLocales.filter((requiredLocales) =>\n declared.includes(requiredLocales)\n )\n : declared;\n\n const formattedDeclaredLocales = formatLocales(declared);\n const formattedRequiredLocales = formatLocales(requiredSanitized);\n\n // Build schema registry\n const schemas = configuration.schemas ?? {};\n const formattedSchemas = Object.entries(schemas)\n .map(([key, schema]) => {\n let typeStr = 'any';\n\n if (schema) {\n try {\n const { node } = zodToTs(schema, {\n auxiliaryTypeStore: createAuxiliaryTypeStore(),\n });\n // 133 is the kind for AnyKeyword in TypeScript\n if ((node as any).kind !== 133) {\n typeStr = printNode(node);\n } else {\n // Fallback to custom string generator if zodToTs returns any\n typeStr = zodToTsString(schema);\n }\n } catch (_e) {\n // Fallback to custom string generator\n typeStr = zodToTsString(schema);\n }\n }\n return ` \"${key}\": ${typeStr};`;\n })\n .join('\\n');\n\n // Choose strict mode registry key\n const strictKey =\n strictMode === 'strict'\n ? 'strict'\n : strictMode === 'inclusive'\n ? 'inclusive'\n : 'loose';\n\n /**\n * Module augmentation that ONLY adds keys to registries.\n * No types/aliases redefined here—avoids merge conflicts.\n */\n fileContent += `declare module 'intlayer' {\\n`;\n // Dictionaries registry\n fileContent += ` interface __DictionaryRegistry {\\n${formattedDictionaryMap}\\n }\\n\\n`;\n // Locales registries\n fileContent += ` interface __DeclaredLocalesRegistry {\\n${formattedDeclaredLocales}\\n }\\n\\n`;\n fileContent += ` interface __RequiredLocalesRegistry {\\n${formattedRequiredLocales}\\n }\\n\\n`;\n // Schema registry\n fileContent += ` interface __SchemaRegistry {\\n${formattedSchemas}\\n }\\n\\n`;\n // Resolved strict mode (narrow the literal at build time)\n fileContent += ` interface __StrictModeRegistry { mode: '${strictKey}' }\\n\\n`;\n // Editor registry\n fileContent += ` interface __EditorRegistry { enabled : ${enabled} } \\n`;\n fileContent += `}\\n`;\n\n return fileContent;\n};\n\n/** Generate the index file merging all the types */\nexport const createModuleAugmentation = async (\n configuration: IntlayerConfig\n) => {\n const { moduleAugmentationDir, typesDir } = configuration.system;\n\n await mkdir(moduleAugmentationDir, { recursive: true });\n\n const dictionariesTypesDefinitions: string[] = await fg(\n normalizePath(`${typesDir}/*.ts`),\n { ignore: ['**/*.d.ts'] }\n );\n\n const tsContent = generateTypeIndexContent(\n dictionariesTypesDefinitions,\n configuration\n );\n\n const tsFilePath = join(moduleAugmentationDir, 'intlayer.d.ts');\n await writeFileIfChanged(tsFilePath, tsContent);\n};\n"],"mappings":"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"}
@@ -1,2 +1,27 @@
1
- import{parallelize as e}from"../utils/parallelize.mjs";import{mkdir as t,writeFile as n}from"node:fs/promises";import{resolve as r}from"node:path";const i=e=>`/* eslint-disable */\nexport default ${JSON.stringify(e,null,2)} as const;\n`,a=async(a,o)=>{let{system:s}=o,{typesDir:c}=s;return await t(c,{recursive:!0}),(await e(a,async e=>{if(!e.key)return;let t=i(e),a=r(c,`${e.key}.ts`);return await n(a,t),a})).filter(Boolean)};export{a as createTypes,i as generateTypeScriptType};
1
+ import { parallelize } from "../utils/parallelize.mjs";
2
+ import { mkdir, writeFile } from "node:fs/promises";
3
+ import { resolve } from "node:path";
4
+
5
+ //#region src/createType/createType.ts
6
+ const generateTypeScriptType = (dictionary) => {
7
+ return `/* eslint-disable */\nexport default ${JSON.stringify(dictionary, null, 2)} as const;\n`;
8
+ };
9
+ /**
10
+ * This function generates a TypeScript type definition from a JSON object
11
+ */
12
+ const createTypes = async (dictionaries, configuration) => {
13
+ const { system } = configuration;
14
+ const { typesDir } = system;
15
+ await mkdir(typesDir, { recursive: true });
16
+ return (await parallelize(dictionaries, async (dictionary) => {
17
+ if (!dictionary.key) return;
18
+ const typeDefinition = generateTypeScriptType(dictionary);
19
+ const outputPath = resolve(typesDir, `${dictionary.key}.ts`);
20
+ await writeFile(outputPath, typeDefinition);
21
+ return outputPath;
22
+ })).filter(Boolean);
23
+ };
24
+
25
+ //#endregion
26
+ export { createTypes, generateTypeScriptType };
2
27
  //# sourceMappingURL=createType.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createType.mjs","names":[],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { parallelize } from '../utils/parallelize';\n\nexport const generateTypeScriptType = (dictionary: Dictionary) => {\n const jsonString = JSON.stringify(dictionary, null, 2);\n\n return `/* eslint-disable */\\nexport default ${jsonString} as const;\\n`;\n};\n/**\n * This function generates a TypeScript type definition from a JSON object\n */\nexport const createTypes = async (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { system } = configuration;\n const { typesDir } = system;\n\n // Create type folders if they don't exist\n await mkdir(typesDir, { recursive: true });\n\n const results = await parallelize(\n dictionaries,\n async (dictionary): Promise<string | undefined> => {\n if (!dictionary.key) {\n return undefined;\n }\n\n const typeDefinition: string = generateTypeScriptType(dictionary);\n\n const outputPath: string = resolve(typesDir, `${dictionary.key}.ts`);\n\n await writeFile(outputPath, typeDefinition);\n\n return outputPath;\n }\n );\n\n return results.filter(Boolean) as string[];\n};\n"],"mappings":"mJAMA,MAAa,EAA0B,GAG9B,wCAFY,KAAK,UAAU,EAAY,KAAM,EAAE,CAEI,cAK/C,EAAc,MACzB,EACA,IACsB,CACtB,GAAM,CAAE,UAAW,EACb,CAAE,YAAa,EAsBrB,OAnBA,MAAM,EAAM,EAAU,CAAE,UAAW,GAAM,CAAC,EAE1B,MAAM,EACpB,EACA,KAAO,IAA4C,CACjD,GAAI,CAAC,EAAW,IACd,OAGF,IAAM,EAAyB,EAAuB,EAAW,CAE3D,EAAqB,EAAQ,EAAU,GAAG,EAAW,IAAI,KAAK,CAIpE,OAFA,MAAM,EAAU,EAAY,EAAe,CAEpC,GAEV,EAEc,OAAO,QAAQ"}
1
+ {"version":3,"file":"createType.mjs","names":[],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { parallelize } from '../utils/parallelize';\n\nexport const generateTypeScriptType = (dictionary: Dictionary) => {\n const jsonString = JSON.stringify(dictionary, null, 2);\n\n return `/* eslint-disable */\\nexport default ${jsonString} as const;\\n`;\n};\n/**\n * This function generates a TypeScript type definition from a JSON object\n */\nexport const createTypes = async (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { system } = configuration;\n const { typesDir } = system;\n\n // Create type folders if they don't exist\n await mkdir(typesDir, { recursive: true });\n\n const results = await parallelize(\n dictionaries,\n async (dictionary): Promise<string | undefined> => {\n if (!dictionary.key) {\n return undefined;\n }\n\n const typeDefinition: string = generateTypeScriptType(dictionary);\n\n const outputPath: string = resolve(typesDir, `${dictionary.key}.ts`);\n\n await writeFile(outputPath, typeDefinition);\n\n return outputPath;\n }\n );\n\n return results.filter(Boolean) as string[];\n};\n"],"mappings":";;;;;AAMA,MAAa,0BAA0B,eAA2B;AAGhE,QAAO,wCAFY,KAAK,UAAU,YAAY,MAAM,EAAE,CAEI;;;;;AAK5D,MAAa,cAAc,OACzB,cACA,kBACsB;CACtB,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,aAAa;AAGrB,OAAM,MAAM,UAAU,EAAE,WAAW,MAAM,CAAC;AAmB1C,SAjBgB,MAAM,YACpB,cACA,OAAO,eAA4C;AACjD,MAAI,CAAC,WAAW,IACd;EAGF,MAAM,iBAAyB,uBAAuB,WAAW;EAEjE,MAAM,aAAqB,QAAQ,UAAU,GAAG,WAAW,IAAI,KAAK;AAEpE,QAAM,UAAU,YAAY,eAAe;AAE3C,SAAO;GAEV,EAEc,OAAO,QAAQ"}
@@ -1 +1,4 @@
1
- import{createModuleAugmentation as e,getTypeName as t}from"./createModuleAugmentation.mjs";import{createTypes as n,generateTypeScriptType as r}from"./createType.mjs";export{e as createModuleAugmentation,n as createTypes,r as generateTypeScriptType,t as getTypeName};
1
+ import { createModuleAugmentation, getTypeName } from "./createModuleAugmentation.mjs";
2
+ import { createTypes, generateTypeScriptType } from "./createType.mjs";
3
+
4
+ export { createModuleAugmentation, createTypes, generateTypeScriptType, getTypeName };
@@ -1,2 +1,31 @@
1
- import{getProjectRequire as e}from"@intlayer/config/utils";let t=null;const n=(n,r)=>{let{baseDir:i}=n.system,{formatCommand:a}=n.content,o=r??e(i);if(a)return a;if(t!==null)return t;try{return o.resolve(`prettier`),t=`prettier --write "{{file}}" --log-level silent`,t}catch{}try{return o.resolve(`biome`),t=`biome format "{{file}}" --write --log-level none`,t}catch{}try{return o.resolve(`eslint`),t=`eslint --fix "{{file}}" --quiet || node -e "process.exit(0)"`,t}catch{}t=void 0};export{n as detectFormatCommand};
1
+ import { getProjectRequire } from "@intlayer/config/utils";
2
+
3
+ //#region src/detectFormatCommand.ts
4
+ let cachedFormatCommand = null;
5
+ const detectFormatCommand = (configuration, projectRequireProp) => {
6
+ const { baseDir } = configuration.system;
7
+ const { formatCommand } = configuration.content;
8
+ const projectRequire = projectRequireProp ?? getProjectRequire(baseDir);
9
+ if (formatCommand) return formatCommand;
10
+ if (cachedFormatCommand !== null) return cachedFormatCommand;
11
+ try {
12
+ projectRequire.resolve("prettier");
13
+ cachedFormatCommand = "prettier --write \"{{file}}\" --log-level silent";
14
+ return cachedFormatCommand;
15
+ } catch (_error) {}
16
+ try {
17
+ projectRequire.resolve("biome");
18
+ cachedFormatCommand = "biome format \"{{file}}\" --write --log-level none";
19
+ return cachedFormatCommand;
20
+ } catch (_error) {}
21
+ try {
22
+ projectRequire.resolve("eslint");
23
+ cachedFormatCommand = "eslint --fix \"{{file}}\" --quiet || node -e \"process.exit(0)\"";
24
+ return cachedFormatCommand;
25
+ } catch (_error) {}
26
+ cachedFormatCommand = void 0;
27
+ };
28
+
29
+ //#endregion
30
+ export { detectFormatCommand };
2
31
  //# sourceMappingURL=detectFormatCommand.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"detectFormatCommand.mjs","names":[],"sources":["../../src/detectFormatCommand.ts"],"sourcesContent":["import { getProjectRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nlet cachedFormatCommand: string | undefined | null = null;\n\nexport const detectFormatCommand = (\n configuration: IntlayerConfig,\n projectRequireProp?: NodeJS.Require\n) => {\n const { baseDir } = configuration.system;\n const { formatCommand } = configuration.content;\n const projectRequire = projectRequireProp ?? getProjectRequire(baseDir);\n\n // Priority: Explicit configuration\n // We do not cache this because the user might change their config file active-session.\n if (formatCommand) {\n return formatCommand;\n }\n\n // Priority: Cached detection\n // If not null, we have already performed the expensive checks.\n if (cachedFormatCommand !== null) {\n return cachedFormatCommand;\n }\n\n // Perform Detection\n\n // Try Prettier\n try {\n projectRequire.resolve('prettier');\n cachedFormatCommand = 'prettier --write \"{{file}}\" --log-level silent';\n return cachedFormatCommand;\n } catch (_error) {\n // Prettier not found, continue\n }\n\n // Try Biome\n try {\n projectRequire.resolve('biome');\n cachedFormatCommand = 'biome format \"{{file}}\" --write --log-level none';\n return cachedFormatCommand;\n } catch (_error) {\n // Biome not found, continue\n }\n\n // Try ESLint\n try {\n projectRequire.resolve('eslint');\n cachedFormatCommand =\n 'eslint --fix \"{{file}}\" --quiet || node -e \"process.exit(0)\"';\n return cachedFormatCommand;\n } catch (_error) {\n // ESLint not found\n }\n\n // No formatter found\n // Set to undefined (not null) so we know we checked and found nothing.\n cachedFormatCommand = undefined;\n return undefined;\n};\n"],"mappings":"2DAGA,IAAI,EAAiD,KAErD,MAAa,GACX,EACA,IACG,CACH,GAAM,CAAE,WAAY,EAAc,OAC5B,CAAE,iBAAkB,EAAc,QAClC,EAAiB,GAAsB,EAAkB,EAAQ,CAIvE,GAAI,EACF,OAAO,EAKT,GAAI,IAAwB,KAC1B,OAAO,EAMT,GAAI,CAGF,OAFA,EAAe,QAAQ,WAAW,CAClC,EAAsB,iDACf,OACQ,EAKjB,GAAI,CAGF,OAFA,EAAe,QAAQ,QAAQ,CAC/B,EAAsB,mDACf,OACQ,EAKjB,GAAI,CAIF,OAHA,EAAe,QAAQ,SAAS,CAChC,EACE,+DACK,OACQ,EAMjB,EAAsB,IAAA"}
1
+ {"version":3,"file":"detectFormatCommand.mjs","names":[],"sources":["../../src/detectFormatCommand.ts"],"sourcesContent":["import { getProjectRequire } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nlet cachedFormatCommand: string | undefined | null = null;\n\nexport const detectFormatCommand = (\n configuration: IntlayerConfig,\n projectRequireProp?: NodeJS.Require\n) => {\n const { baseDir } = configuration.system;\n const { formatCommand } = configuration.content;\n const projectRequire = projectRequireProp ?? getProjectRequire(baseDir);\n\n // Priority: Explicit configuration\n // We do not cache this because the user might change their config file active-session.\n if (formatCommand) {\n return formatCommand;\n }\n\n // Priority: Cached detection\n // If not null, we have already performed the expensive checks.\n if (cachedFormatCommand !== null) {\n return cachedFormatCommand;\n }\n\n // Perform Detection\n\n // Try Prettier\n try {\n projectRequire.resolve('prettier');\n cachedFormatCommand = 'prettier --write \"{{file}}\" --log-level silent';\n return cachedFormatCommand;\n } catch (_error) {\n // Prettier not found, continue\n }\n\n // Try Biome\n try {\n projectRequire.resolve('biome');\n cachedFormatCommand = 'biome format \"{{file}}\" --write --log-level none';\n return cachedFormatCommand;\n } catch (_error) {\n // Biome not found, continue\n }\n\n // Try ESLint\n try {\n projectRequire.resolve('eslint');\n cachedFormatCommand =\n 'eslint --fix \"{{file}}\" --quiet || node -e \"process.exit(0)\"';\n return cachedFormatCommand;\n } catch (_error) {\n // ESLint not found\n }\n\n // No formatter found\n // Set to undefined (not null) so we know we checked and found nothing.\n cachedFormatCommand = undefined;\n return undefined;\n};\n"],"mappings":";;;AAGA,IAAI,sBAAiD;AAErD,MAAa,uBACX,eACA,uBACG;CACH,MAAM,EAAE,YAAY,cAAc;CAClC,MAAM,EAAE,kBAAkB,cAAc;CACxC,MAAM,iBAAiB,sBAAsB,kBAAkB,QAAQ;AAIvE,KAAI,cACF,QAAO;AAKT,KAAI,wBAAwB,KAC1B,QAAO;AAMT,KAAI;AACF,iBAAe,QAAQ,WAAW;AAClC,wBAAsB;AACtB,SAAO;UACA,QAAQ;AAKjB,KAAI;AACF,iBAAe,QAAQ,QAAQ;AAC/B,wBAAsB;AACtB,SAAO;UACA,QAAQ;AAKjB,KAAI;AACF,iBAAe,QAAQ,SAAS;AAChC,wBACE;AACF,SAAO;UACA,QAAQ;AAMjB,uBAAsB"}