@intlayer/chokidar 8.1.2 → 8.1.3

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 (396) hide show
  1. package/dist/assets/installSkills/skills/angular.md +3 -0
  2. package/dist/assets/installSkills/skills/astro.md +3 -0
  3. package/dist/assets/installSkills/skills/cli.md +7 -4
  4. package/dist/assets/installSkills/skills/config.md +3 -0
  5. package/dist/assets/installSkills/skills/content.md +3 -0
  6. package/dist/assets/installSkills/skills/next_js.md +3 -0
  7. package/dist/assets/installSkills/skills/preact.md +3 -2
  8. package/dist/assets/installSkills/skills/react.md +3 -0
  9. package/dist/assets/installSkills/skills/solid.md +3 -0
  10. package/dist/assets/installSkills/skills/svelte.md +3 -0
  11. package/dist/assets/installSkills/skills/usage.md +2 -0
  12. package/dist/assets/installSkills/skills/vue.md +3 -0
  13. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
  14. package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
  15. package/dist/cjs/build.cjs +1 -51
  16. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +1 -53
  17. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  18. package/dist/cjs/buildIntlayerDictionary/index.cjs +1 -6
  19. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +1 -26
  20. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  21. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +4 -78
  22. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  23. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +4 -62
  24. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  25. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -46
  26. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  27. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +1 -50
  28. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  29. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +1 -59
  30. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  31. package/dist/cjs/cleanOutputDir.cjs +1 -30
  32. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  33. package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -96
  34. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  35. package/dist/cjs/cli.cjs +1 -21
  36. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -70
  37. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +7 -41
  39. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  40. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +1 -23
  41. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  42. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +1 -24
  43. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  44. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +1 -24
  45. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  46. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +1 -23
  47. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  48. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +1 -23
  49. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  50. package/dist/cjs/createDictionaryEntryPoint/index.cjs +1 -16
  51. package/dist/cjs/createType/createModuleAugmentation.cjs +9 -110
  52. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  53. package/dist/cjs/createType/createType.cjs +1 -29
  54. package/dist/cjs/createType/createType.cjs.map +1 -1
  55. package/dist/cjs/createType/index.cjs +1 -8
  56. package/dist/cjs/fetchDistantDictionaries.cjs +1 -50
  57. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  58. package/dist/cjs/filterInvalidDictionaries.cjs +1 -49
  59. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  60. package/dist/cjs/formatDictionary.cjs +1 -49
  61. package/dist/cjs/formatDictionary.cjs.map +1 -1
  62. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +1 -39
  63. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  64. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +1 -34
  65. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  66. package/dist/cjs/handleContentDeclarationFileChange.cjs +1 -49
  67. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  68. package/dist/cjs/handleContentDeclarationFileMoved.cjs +1 -24
  69. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  70. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -37
  71. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  72. package/dist/cjs/index.cjs +1 -131
  73. package/dist/cjs/init/index.cjs +1 -242
  74. package/dist/cjs/init/index.cjs.map +1 -1
  75. package/dist/cjs/init/utils/configManipulation.cjs +1 -164
  76. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  77. package/dist/cjs/init/utils/fileSystem.cjs +1 -30
  78. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  79. package/dist/cjs/init/utils/index.cjs +1 -13
  80. package/dist/cjs/init/utils/jsonParser.cjs +3 -42
  81. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  82. package/dist/cjs/init/utils/tsConfig.cjs +1 -18
  83. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  84. package/dist/cjs/initConfig/index.cjs +1 -38
  85. package/dist/cjs/initConfig/index.cjs.map +1 -1
  86. package/dist/cjs/installSkills/index.cjs +1 -172
  87. package/dist/cjs/installSkills/index.cjs.map +1 -1
  88. package/dist/cjs/listDictionariesPath.cjs +1 -41
  89. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  90. package/dist/cjs/listGitFiles.cjs +5 -95
  91. package/dist/cjs/listGitFiles.cjs.map +1 -1
  92. package/dist/cjs/listProjects.cjs +1 -47
  93. package/dist/cjs/listProjects.cjs.map +1 -1
  94. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -66
  95. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  96. package/dist/cjs/loadDictionaries/index.cjs +1 -12
  97. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -72
  98. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -125
  100. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  101. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -28
  102. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  103. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +1 -61
  104. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  105. package/dist/cjs/loadDictionaries/log.cjs +3 -135
  106. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  107. package/dist/cjs/prepareIntlayer.cjs +1 -95
  108. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  109. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +1 -30
  110. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  111. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +1 -12
  112. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  113. package/dist/cjs/transformFiles/extractDictionaryKey.cjs +1 -16
  114. package/dist/cjs/transformFiles/extractDictionaryKey.cjs.map +1 -1
  115. package/dist/cjs/transformFiles/index.cjs +1 -10
  116. package/dist/cjs/transformFiles/transformFiles.cjs +1 -251
  117. package/dist/cjs/transformFiles/transformFiles.cjs.map +1 -1
  118. package/dist/cjs/utils/autoDecorateContent.cjs +1 -87
  119. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  120. package/dist/cjs/utils/buildFilesList.cjs +1 -50
  121. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  122. package/dist/cjs/utils/chunkJSON.cjs +1 -336
  123. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  124. package/dist/cjs/utils/formatter.cjs +1 -16
  125. package/dist/cjs/utils/formatter.cjs.map +1 -1
  126. package/dist/cjs/utils/getChunk.cjs +1 -34
  127. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  128. package/dist/cjs/utils/getComponentTransformPattern.cjs +1 -48
  129. package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
  130. package/dist/cjs/utils/getFileHash.cjs +1 -12
  131. package/dist/cjs/utils/getFileHash.cjs.map +1 -1
  132. package/dist/cjs/utils/getFormatFromExtension.cjs +1 -31
  133. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  134. package/dist/cjs/utils/index.cjs +1 -46
  135. package/dist/cjs/utils/pLimit.cjs +1 -128
  136. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  137. package/dist/cjs/utils/parallelize.cjs +1 -11
  138. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  139. package/dist/cjs/utils/parallelizeGlobal.cjs +1 -29
  140. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  141. package/dist/cjs/utils/reduceObjectFormat.cjs +1 -31
  142. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  143. package/dist/cjs/utils/resolveObjectPromises.cjs +1 -21
  144. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  145. package/dist/cjs/utils/runOnce.cjs +1 -95
  146. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  147. package/dist/cjs/utils/runParallel/bin.cjs +1 -54
  148. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  149. package/dist/cjs/utils/runParallel/bootstrap.cjs +1 -24
  150. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  151. package/dist/cjs/utils/runParallel/index.cjs +1 -110
  152. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  153. package/dist/cjs/utils/runParallel/pidTree.cjs +1 -145
  154. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  155. package/dist/cjs/utils/runParallel/ps.cjs +1 -49
  156. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  157. package/dist/cjs/utils/runParallel/runTask.cjs +1 -154
  158. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  159. package/dist/cjs/utils/runParallel/spawnPosix.cjs +1 -59
  160. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  161. package/dist/cjs/utils/runParallel/spawnWin32.cjs +1 -43
  162. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  163. package/dist/cjs/utils/runParallel/wmic.cjs +1 -52
  164. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  165. package/dist/cjs/utils/sortAlphabetically.cjs +1 -7
  166. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  167. package/dist/cjs/utils/splitTextByLine.cjs +1 -11
  168. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  169. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +1 -60
  170. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  171. package/dist/cjs/watcher.cjs +1 -95
  172. package/dist/cjs/watcher.cjs.map +1 -1
  173. package/dist/cjs/writeConfiguration/index.cjs +1 -34
  174. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  175. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +1 -28
  176. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs +1 -31
  178. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/index.cjs +1 -12
  180. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +1 -93
  181. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  182. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +2 -1775
  183. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  184. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +1 -77
  185. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  186. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -123
  187. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  188. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +1 -71
  189. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  190. package/dist/cjs/writeFileIfChanged.cjs +1 -12
  191. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  192. package/dist/cjs/writeJsonIfChanged.cjs +1 -17
  193. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  194. package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
  195. package/dist/esm/_virtual/_utils_asset.mjs +2 -97
  196. package/dist/esm/build.mjs +1 -24
  197. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +1 -51
  198. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/index.mjs +1 -4
  200. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +1 -24
  201. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  202. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +4 -75
  203. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  204. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +4 -59
  205. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  206. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -44
  207. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  208. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +1 -48
  209. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  210. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +1 -56
  211. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  212. package/dist/esm/cleanOutputDir.mjs +1 -28
  213. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  214. package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -93
  215. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  216. package/dist/esm/cli.mjs +1 -8
  217. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -68
  218. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  219. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +7 -39
  220. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +1 -20
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +1 -21
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +1 -21
  226. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  227. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +1 -20
  228. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  229. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +1 -20
  230. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  231. package/dist/esm/createDictionaryEntryPoint/index.mjs +1 -9
  232. package/dist/esm/createType/createModuleAugmentation.mjs +9 -106
  233. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  234. package/dist/esm/createType/createType.mjs +1 -26
  235. package/dist/esm/createType/createType.mjs.map +1 -1
  236. package/dist/esm/createType/index.mjs +1 -4
  237. package/dist/esm/fetchDistantDictionaries.mjs +1 -48
  238. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  239. package/dist/esm/filterInvalidDictionaries.mjs +1 -46
  240. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  241. package/dist/esm/formatDictionary.mjs +1 -44
  242. package/dist/esm/formatDictionary.mjs.map +1 -1
  243. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +1 -37
  244. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  245. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +1 -32
  246. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileChange.mjs +1 -47
  248. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  249. package/dist/esm/handleContentDeclarationFileMoved.mjs +1 -22
  250. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  251. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -35
  252. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  253. package/dist/esm/index.mjs +1 -57
  254. package/dist/esm/init/index.mjs +1 -240
  255. package/dist/esm/init/index.mjs.map +1 -1
  256. package/dist/esm/init/utils/configManipulation.mjs +1 -161
  257. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  258. package/dist/esm/init/utils/fileSystem.mjs +1 -26
  259. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  260. package/dist/esm/init/utils/index.mjs +1 -6
  261. package/dist/esm/init/utils/jsonParser.mjs +3 -40
  262. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  263. package/dist/esm/init/utils/tsConfig.mjs +1 -16
  264. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  265. package/dist/esm/initConfig/index.mjs +1 -36
  266. package/dist/esm/initConfig/index.mjs.map +1 -1
  267. package/dist/esm/installSkills/index.mjs +1 -167
  268. package/dist/esm/installSkills/index.mjs.map +1 -1
  269. package/dist/esm/listDictionariesPath.mjs +1 -37
  270. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  271. package/dist/esm/listGitFiles.mjs +5 -90
  272. package/dist/esm/listGitFiles.mjs.map +1 -1
  273. package/dist/esm/listProjects.mjs +1 -43
  274. package/dist/esm/listProjects.mjs.map +1 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -65
  276. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  277. package/dist/esm/loadDictionaries/index.mjs +1 -6
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -69
  279. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -123
  281. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -26
  283. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +1 -58
  285. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  286. package/dist/esm/loadDictionaries/log.mjs +3 -132
  287. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  288. package/dist/esm/prepareIntlayer.mjs +1 -92
  289. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  290. package/dist/esm/reduceDictionaryContent/applyMask.mjs +1 -28
  291. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  292. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +1 -10
  293. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  294. package/dist/esm/transformFiles/extractDictionaryKey.mjs +1 -14
  295. package/dist/esm/transformFiles/extractDictionaryKey.mjs.map +1 -1
  296. package/dist/esm/transformFiles/index.mjs +1 -4
  297. package/dist/esm/transformFiles/transformFiles.mjs +1 -244
  298. package/dist/esm/transformFiles/transformFiles.mjs.map +1 -1
  299. package/dist/esm/utils/autoDecorateContent.mjs +1 -85
  300. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +1 -47
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +1 -333
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +1 -12
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +1 -33
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getComponentTransformPattern.mjs +1 -44
  310. package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
  311. package/dist/esm/utils/getFileHash.mjs +1 -9
  312. package/dist/esm/utils/getFileHash.mjs.map +1 -1
  313. package/dist/esm/utils/getFormatFromExtension.mjs +1 -28
  314. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +1 -20
  316. package/dist/esm/utils/pLimit.mjs +1 -125
  317. package/dist/esm/utils/pLimit.mjs.map +1 -1
  318. package/dist/esm/utils/parallelize.mjs +1 -10
  319. package/dist/esm/utils/parallelize.mjs.map +1 -1
  320. package/dist/esm/utils/parallelizeGlobal.mjs +1 -26
  321. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  322. package/dist/esm/utils/reduceObjectFormat.mjs +1 -29
  323. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  324. package/dist/esm/utils/resolveObjectPromises.mjs +1 -19
  325. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  326. package/dist/esm/utils/runOnce.mjs +1 -92
  327. package/dist/esm/utils/runOnce.mjs.map +1 -1
  328. package/dist/esm/utils/runParallel/bin.mjs +1 -52
  329. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  330. package/dist/esm/utils/runParallel/bootstrap.mjs +1 -22
  331. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/index.mjs +1 -108
  333. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/pidTree.mjs +1 -142
  335. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/ps.mjs +1 -46
  337. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/runTask.mjs +1 -152
  339. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/spawnPosix.mjs +1 -57
  341. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/spawnWin32.mjs +1 -41
  343. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/wmic.mjs +1 -49
  345. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  346. package/dist/esm/utils/sortAlphabetically.mjs +1 -5
  347. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  348. package/dist/esm/utils/splitTextByLine.mjs +1 -9
  349. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  350. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +1 -58
  351. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  352. package/dist/esm/watcher.mjs +1 -92
  353. package/dist/esm/watcher.mjs.map +1 -1
  354. package/dist/esm/writeConfiguration/index.mjs +1 -31
  355. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  356. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +1 -26
  357. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  358. package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +1 -29
  359. package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/index.mjs +1 -7
  361. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +1 -91
  362. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  363. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +2 -1773
  364. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +1 -75
  366. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -121
  368. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +1 -69
  370. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  371. package/dist/esm/writeFileIfChanged.mjs +1 -10
  372. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  373. package/dist/esm/writeJsonIfChanged.mjs +1 -16
  374. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  375. package/dist/types/build.d.ts +3 -1
  376. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
  377. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
  378. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  379. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
  380. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
  381. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
  382. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  383. package/dist/types/index.d.ts +16 -24
  384. package/dist/types/initConfig/index.d.ts +1 -1
  385. package/dist/types/initConfig/index.d.ts.map +1 -1
  386. package/dist/types/listGitFiles.d.ts.map +1 -1
  387. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -1
  388. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  389. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  390. package/dist/types/transformFiles/transformFiles.d.ts +1 -1
  391. package/dist/types/transformFiles/transformFiles.d.ts.map +1 -1
  392. package/dist/types/utils/formatter.d.ts +1 -1
  393. package/dist/types/watcher.d.ts +1 -1
  394. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  395. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
  396. package/package.json +10 -15
@@ -1 +1 @@
1
- {"version":3,"file":"createModuleAugmentation.cjs","names":["getFileHash","writeFileIfChanged"],"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';\nimport type { IntlayerConfig, Locale } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport { printNode, zodToTs } from 'zod-to-ts';\nimport { getFileHash } from '../utils/getFileHash';\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 } = configuration;\n const { moduleAugmentationDir } = system;\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: `_${getFileHash(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 as any, key);\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 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
+ {"version":3,"file":"createModuleAugmentation.cjs","names":["getFileHash","writeFileIfChanged"],"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 { IntlayerConfig, Locale } from '@intlayer/types';\nimport fg from 'fast-glob';\nimport { printNode, zodToTs } from 'zod-to-ts';\nimport { getFileHash } from '../utils/getFileHash';\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 } = configuration;\n const { moduleAugmentationDir } = system;\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: `_${getFileHash(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 as any, key);\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 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,30 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require_utils_parallelize = require('../utils/parallelize.cjs');
4
- let node_fs_promises = require("node:fs/promises");
5
- let node_path = require("node:path");
6
-
7
- //#region src/createType/createType.ts
8
- const generateTypeScriptType = (dictionary) => {
9
- return `/* eslint-disable */\nexport default ${JSON.stringify(dictionary, null, 2)} as const;\n`;
10
- };
11
- /**
12
- * This function generates a TypeScript type definition from a JSON object
13
- */
14
- const createTypes = async (dictionaries, configuration) => {
15
- const { system } = configuration;
16
- const { typesDir } = system;
17
- await (0, node_fs_promises.mkdir)(typesDir, { recursive: true });
18
- return (await require_utils_parallelize.parallelize(dictionaries, async (dictionary) => {
19
- if (!dictionary.key) return;
20
- const typeDefinition = generateTypeScriptType(dictionary);
21
- const outputPath = (0, node_path.resolve)(typesDir, `${dictionary.key}.ts`);
22
- await (0, node_fs_promises.writeFile)(outputPath, typeDefinition);
23
- return outputPath;
24
- })).filter(Boolean);
25
- };
26
-
27
- //#endregion
28
- exports.createTypes = createTypes;
29
- exports.generateTypeScriptType = generateTypeScriptType;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`);let t=require(`node:fs/promises`),n=require(`node:path`);const r=e=>`/* eslint-disable */\nexport default ${JSON.stringify(e,null,2)} as const;\n`,i=async(i,a)=>{let{system:o}=a,{typesDir:s}=o;return await(0,t.mkdir)(s,{recursive:!0}),(await e.parallelize(i,async e=>{if(!e.key)return;let i=r(e),a=(0,n.resolve)(s,`${e.key}.ts`);return await(0,t.writeFile)(a,i),a})).filter(Boolean)};exports.createTypes=i,exports.generateTypeScriptType=r;
30
2
  //# sourceMappingURL=createType.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"createType.cjs","names":["parallelize"],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\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":";;;;;;;AAKA,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,mCAAY,UAAU,EAAE,WAAW,MAAM,CAAC;AAmB1C,SAjBgB,MAAMA,sCACpB,cACA,OAAO,eAA4C;AACjD,MAAI,CAAC,WAAW,IACd;EAGF,MAAM,iBAAyB,uBAAuB,WAAW;EAEjE,MAAM,oCAA6B,UAAU,GAAG,WAAW,IAAI,KAAK;AAEpE,wCAAgB,YAAY,eAAe;AAE3C,SAAO;GAEV,EAEc,OAAO,QAAQ"}
1
+ {"version":3,"file":"createType.cjs","names":["parallelize"],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\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":"qNAKA,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,MAAA,EAAA,EAAA,OAAY,EAAU,CAAE,UAAW,GAAM,CAAC,EAE1B,MAAMA,EAAAA,YACpB,EACA,KAAO,IAA4C,CACjD,GAAI,CAAC,EAAW,IACd,OAGF,IAAM,EAAyB,EAAuB,EAAW,CAE3D,GAAA,EAAA,EAAA,SAA6B,EAAU,GAAG,EAAW,IAAI,KAAK,CAIpE,OAFA,MAAA,EAAA,EAAA,WAAgB,EAAY,EAAe,CAEpC,GAEV,EAEc,OAAO,QAAQ"}
@@ -1,8 +1 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_createType_createModuleAugmentation = require('./createModuleAugmentation.cjs');
3
- const require_createType_createType = require('./createType.cjs');
4
-
5
- exports.createModuleAugmentation = require_createType_createModuleAugmentation.createModuleAugmentation;
6
- exports.createTypes = require_createType_createType.createTypes;
7
- exports.generateTypeScriptType = require_createType_createType.generateTypeScriptType;
8
- exports.getTypeName = require_createType_createModuleAugmentation.getTypeName;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./createModuleAugmentation.cjs`),t=require(`./createType.cjs`);exports.createModuleAugmentation=e.createModuleAugmentation,exports.createTypes=t.createTypes,exports.generateTypeScriptType=t.generateTypeScriptType,exports.getTypeName=e.getTypeName;
@@ -1,51 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_utils_parallelize = require('./utils/parallelize.cjs');
4
- let _intlayer_config = require("@intlayer/config");
5
- let _intlayer_api = require("@intlayer/api");
6
-
7
- //#region src/fetchDistantDictionaries.ts
8
- /**
9
- * Fetch distant dictionaries and update the logger with their statuses.
10
- */
11
- const fetchDistantDictionaries = async (options, onStatusUpdate) => {
12
- const config = (0, _intlayer_config.getConfiguration)();
13
- const appLogger = (0, _intlayer_config.getAppLogger)(config);
14
- try {
15
- const intlayerAPI = (0, _intlayer_api.getIntlayerAPIProxy)(void 0, config);
16
- const distantDictionariesKeys = options.dictionaryKeys;
17
- const processDictionary = async (dictionaryKey) => {
18
- onStatusUpdate?.([{
19
- dictionaryKey,
20
- type: "remote",
21
- status: "fetching"
22
- }]);
23
- try {
24
- const distantDictionary = (await intlayerAPI.dictionary.getDictionary(dictionaryKey)).data;
25
- if (!distantDictionary) throw new Error(`Dictionary ${dictionaryKey} not found on remote`);
26
- onStatusUpdate?.([{
27
- dictionaryKey,
28
- type: "remote",
29
- status: "fetched"
30
- }]);
31
- return distantDictionary;
32
- } catch (error) {
33
- onStatusUpdate?.([{
34
- dictionaryKey,
35
- type: "remote",
36
- status: "error",
37
- error: `Error fetching dictionary ${dictionaryKey}: ${error}`
38
- }]);
39
- return;
40
- }
41
- };
42
- return (await require_utils_parallelize.parallelize(distantDictionariesKeys, async (dictionaryKey) => await processDictionary(dictionaryKey))).filter((dict) => dict !== void 0);
43
- } catch (_error) {
44
- appLogger(`${_intlayer_config.x} Failed to fetch distant dictionaries`, { level: "error" });
45
- return [];
46
- }
47
- };
48
-
49
- //#endregion
50
- exports.fetchDistantDictionaries = fetchDistantDictionaries;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/parallelize.cjs`);let t=require(`@intlayer/config/node`),n=require(`@intlayer/config/logger`),r=require(`@intlayer/api`);const i=async(i,a)=>{let o=(0,t.getConfiguration)(),s=(0,n.getAppLogger)(o);try{let t=(0,r.getIntlayerAPIProxy)(void 0,o),n=i.dictionaryKeys,s=async e=>{a?.([{dictionaryKey:e,type:`remote`,status:`fetching`}]);try{let n=(await t.dictionary.getDictionary(e)).data;if(!n)throw Error(`Dictionary ${e} not found on remote`);return a?.([{dictionaryKey:e,type:`remote`,status:`fetched`}]),n}catch(t){a?.([{dictionaryKey:e,type:`remote`,status:`error`,error:`Error fetching dictionary ${e}: ${t}`}]);return}};return(await e.parallelize(n,async e=>await s(e))).filter(e=>e!==void 0)}catch{return s(`${n.x} Failed to fetch distant dictionaries`,{level:`error`}),[]}};exports.fetchDistantDictionaries=i;
51
2
  //# sourceMappingURL=fetchDistantDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetchDistantDictionaries.cjs","names":["parallelize","x"],"sources":["../../src/fetchDistantDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getAppLogger, getConfiguration, x } from '@intlayer/config';\nimport type { DictionariesStatus } from './loadDictionaries';\nimport { parallelize } from './utils/parallelize';\n\ntype FetchDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n logPrefix?: string;\n};\n\n/**\n * Fetch distant dictionaries and update the logger with their statuses.\n */\nexport const fetchDistantDictionaries = async (\n options: FetchDistantDictionariesOptions,\n onStatusUpdate?: (status: DictionariesStatus[]) => void\n): Promise<DictionaryAPI[]> => {\n const config = getConfiguration();\n const appLogger = getAppLogger(config);\n try {\n const intlayerAPI = getIntlayerAPIProxy(undefined, config);\n\n const distantDictionariesKeys = options.dictionaryKeys;\n // Process dictionaries in parallel with a concurrency limit\n const processDictionary = async (\n dictionaryKey: string\n ): Promise<DictionaryAPI | undefined> => {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'fetching',\n },\n ]);\n\n try {\n // Fetch the dictionary\n const getDictionaryResult =\n await intlayerAPI.dictionary.getDictionary(dictionaryKey);\n\n const distantDictionary = getDictionaryResult.data;\n\n if (!distantDictionary) {\n throw new Error(`Dictionary ${dictionaryKey} not found on remote`);\n }\n\n onStatusUpdate?.([\n { dictionaryKey, type: 'remote', status: 'fetched' },\n ]);\n\n return distantDictionary;\n } catch (error) {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'error',\n error: `Error fetching dictionary ${dictionaryKey}: ${error}`,\n },\n ]);\n return undefined;\n }\n };\n\n const result = await parallelize(\n distantDictionariesKeys,\n async (dictionaryKey) => await processDictionary(dictionaryKey)\n );\n\n // Remove undefined values\n const filteredResult = result.filter(\n (dict: DictionaryAPI | undefined): dict is DictionaryAPI =>\n dict !== undefined\n );\n\n return filteredResult;\n } catch (_error) {\n appLogger(`${x} Failed to fetch distant dictionaries`, { level: 'error' });\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,2BAA2B,OACtC,SACA,mBAC6B;CAC7B,MAAM,iDAA2B;CACjC,MAAM,+CAAyB,OAAO;AACtC,KAAI;EACF,MAAM,qDAAkC,QAAW,OAAO;EAE1D,MAAM,0BAA0B,QAAQ;EAExC,MAAM,oBAAoB,OACxB,kBACuC;AACvC,oBAAiB,CACf;IACE;IACA,MAAM;IACN,QAAQ;IACT,CACF,CAAC;AAEF,OAAI;IAKF,MAAM,qBAFJ,MAAM,YAAY,WAAW,cAAc,cAAc,EAEb;AAE9C,QAAI,CAAC,kBACH,OAAM,IAAI,MAAM,cAAc,cAAc,sBAAsB;AAGpE,qBAAiB,CACf;KAAE;KAAe,MAAM;KAAU,QAAQ;KAAW,CACrD,CAAC;AAEF,WAAO;YACA,OAAO;AACd,qBAAiB,CACf;KACE;KACA,MAAM;KACN,QAAQ;KACR,OAAO,6BAA6B,cAAc,IAAI;KACvD,CACF,CAAC;AACF;;;AAeJ,UAXe,MAAMA,sCACnB,yBACA,OAAO,kBAAkB,MAAM,kBAAkB,cAAc,CAChE,EAG6B,QAC3B,SACC,SAAS,OACZ;UAGM,QAAQ;AACf,YAAU,GAAGC,mBAAE,wCAAwC,EAAE,OAAO,SAAS,CAAC;AAC1E,SAAO,EAAE"}
1
+ {"version":3,"file":"fetchDistantDictionaries.cjs","names":["parallelize","x"],"sources":["../../src/fetchDistantDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getAppLogger, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { DictionariesStatus } from './loadDictionaries';\nimport { parallelize } from './utils/parallelize';\n\ntype FetchDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n logPrefix?: string;\n};\n\n/**\n * Fetch distant dictionaries and update the logger with their statuses.\n */\nexport const fetchDistantDictionaries = async (\n options: FetchDistantDictionariesOptions,\n onStatusUpdate?: (status: DictionariesStatus[]) => void\n): Promise<DictionaryAPI[]> => {\n const config = getConfiguration();\n const appLogger = getAppLogger(config);\n try {\n const intlayerAPI = getIntlayerAPIProxy(undefined, config);\n\n const distantDictionariesKeys = options.dictionaryKeys;\n // Process dictionaries in parallel with a concurrency limit\n const processDictionary = async (\n dictionaryKey: string\n ): Promise<DictionaryAPI | undefined> => {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'fetching',\n },\n ]);\n\n try {\n // Fetch the dictionary\n const getDictionaryResult =\n await intlayerAPI.dictionary.getDictionary(dictionaryKey);\n\n const distantDictionary = getDictionaryResult.data;\n\n if (!distantDictionary) {\n throw new Error(`Dictionary ${dictionaryKey} not found on remote`);\n }\n\n onStatusUpdate?.([\n { dictionaryKey, type: 'remote', status: 'fetched' },\n ]);\n\n return distantDictionary;\n } catch (error) {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'error',\n error: `Error fetching dictionary ${dictionaryKey}: ${error}`,\n },\n ]);\n return undefined;\n }\n };\n\n const result = await parallelize(\n distantDictionariesKeys,\n async (dictionaryKey) => await processDictionary(dictionaryKey)\n );\n\n // Remove undefined values\n const filteredResult = result.filter(\n (dict: DictionaryAPI | undefined): dict is DictionaryAPI =>\n dict !== undefined\n );\n\n return filteredResult;\n } catch (_error) {\n appLogger(`${x} Failed to fetch distant dictionaries`, { level: 'error' });\n return [];\n }\n};\n"],"mappings":"iQAiBA,MAAa,EAA2B,MACtC,EACA,IAC6B,CAC7B,IAAM,GAAA,EAAA,EAAA,mBAA2B,CAC3B,GAAA,EAAA,EAAA,cAAyB,EAAO,CACtC,GAAI,CACF,IAAM,GAAA,EAAA,EAAA,qBAAkC,IAAA,GAAW,EAAO,CAEpD,EAA0B,EAAQ,eAElC,EAAoB,KACxB,IACuC,CACvC,IAAiB,CACf,CACE,gBACA,KAAM,SACN,OAAQ,WACT,CACF,CAAC,CAEF,GAAI,CAKF,IAAM,GAFJ,MAAM,EAAY,WAAW,cAAc,EAAc,EAEb,KAE9C,GAAI,CAAC,EACH,MAAU,MAAM,cAAc,EAAc,sBAAsB,CAOpE,OAJA,IAAiB,CACf,CAAE,gBAAe,KAAM,SAAU,OAAQ,UAAW,CACrD,CAAC,CAEK,QACA,EAAO,CACd,IAAiB,CACf,CACE,gBACA,KAAM,SACN,OAAQ,QACR,MAAO,6BAA6B,EAAc,IAAI,IACvD,CACF,CAAC,CACF,SAeJ,OAXe,MAAMA,EAAAA,YACnB,EACA,KAAO,IAAkB,MAAM,EAAkB,EAAc,CAChE,EAG6B,OAC3B,GACC,IAAS,IAAA,GACZ,MAGc,CAEf,OADA,EAAU,GAAGC,EAAAA,EAAE,uCAAwC,CAAE,MAAO,QAAS,CAAC,CACnE,EAAE"}
@@ -1,50 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_utils_formatter = require('./utils/formatter.cjs');
4
- let _intlayer_core = require("@intlayer/core");
5
- let _intlayer_config_client = require("@intlayer/config/client");
6
-
7
- //#region src/filterInvalidDictionaries.ts
8
- const isInvalidDictionary = (dictionary, configuration, options) => {
9
- const appLogger = (0, _intlayer_config_client.getAppLogger)(configuration);
10
- if (!dictionary) return false;
11
- const location = Boolean(dictionary.location === "local" || typeof dictionary.filePath === "string") ? "Local" : "Remote";
12
- const hasKey = Boolean(dictionary.key);
13
- const hasContent = Boolean(dictionary.content);
14
- if (!hasKey) {
15
- appLogger(`${location} dictionary has no key`, { level: "error" });
16
- return false;
17
- }
18
- if (!hasContent) {
19
- appLogger(`${location} dictionary ${(0, _intlayer_config_client.colorizeKey)(dictionary.key)} has no content - ${dictionary.filePath ? require_utils_formatter.formatPath(dictionary.filePath) : (0, _intlayer_config_client.colorizePath)("Remote")}`, { level: "error" });
20
- return false;
21
- }
22
- if (dictionary.schema && options?.checkSchema) {
23
- if (!(typeof dictionary.content === "function" || typeof dictionary.content === "object" && dictionary.content !== null && typeof dictionary.content.then === "function")) {
24
- const locales = configuration?.internationalization?.locales ?? [];
25
- const isStrict = configuration?.internationalization.strictMode === "strict";
26
- const schema = typeof dictionary.schema === "string" ? configuration?.schemas?.[dictionary.schema] : void 0;
27
- if (schema && typeof schema.safeParse === "function") for (const locale of locales) {
28
- const resolvedContent = (0, _intlayer_core.getContent)(dictionary.content, {
29
- dictionaryKey: dictionary.key,
30
- keyPath: []
31
- }, locale, !isStrict);
32
- const result = schema.safeParse(resolvedContent);
33
- if (!result.success) {
34
- appLogger(`${location} dictionary ${(0, _intlayer_config_client.colorizeKey)(dictionary.key)} has invalid content according to schema ${(0, _intlayer_config_client.colorize)(dictionary.schema, _intlayer_config_client.ANSIColors.ORANGE)} for locale ${require_utils_formatter.formatLocale(locale)} - ${dictionary.filePath ? require_utils_formatter.formatPath(dictionary.filePath) : (0, _intlayer_config_client.colorizePath)("Remote")}`, { level: "error" });
35
- result.error.issues.forEach((issue) => {
36
- appLogger(`${_intlayer_config_client.x} Error: ${(0, _intlayer_config_client.colorizeKey)(dictionary.key)} - ${require_utils_formatter.formatLocale(locale)} - ${(0, _intlayer_config_client.colorize)(`${issue.path.join(".")}:`, _intlayer_config_client.ANSIColors.BLUE)} ${(0, _intlayer_config_client.colorize)(issue.message, _intlayer_config_client.ANSIColors.GREY)}`, { level: "error" });
37
- });
38
- return false;
39
- }
40
- }
41
- }
42
- }
43
- return true;
44
- };
45
- const filterInvalidDictionaries = (dictionaries, configuration, options) => (dictionaries ?? [])?.filter((dictionary) => isInvalidDictionary(dictionary, configuration, options));
46
-
47
- //#endregion
48
- exports.filterInvalidDictionaries = filterInvalidDictionaries;
49
- exports.isInvalidDictionary = isInvalidDictionary;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/formatter.cjs`);let t=require(`@intlayer/config/client`),n=require(`@intlayer/core/interpreter`);const r=(r,i,a)=>{let o=(0,t.getAppLogger)(i);if(!r)return!1;let s=r.location===`local`||typeof r.filePath==`string`?`Local`:`Remote`,c=!!r.key,l=!!r.content;if(!c)return o(`${s} dictionary has no key`,{level:`error`}),!1;if(!l)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has no content - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),!1;if(r.schema&&a?.checkSchema&&!(typeof r.content==`function`||typeof r.content==`object`&&r.content!==null&&typeof r.content.then==`function`)){let a=i?.internationalization?.locales??[],c=i?.internationalization.strictMode===`strict`,l=typeof r.schema==`string`?i?.schemas?.[r.schema]:void 0;if(l&&typeof l.safeParse==`function`)for(let i of a){let a=(0,n.getContent)(r.content,{dictionaryKey:r.key,keyPath:[]},i,!c),u=l.safeParse(a);if(!u.success)return o(`${s} dictionary ${(0,t.colorizeKey)(r.key)} has invalid content according to schema ${(0,t.colorize)(r.schema,t.ANSIColors.ORANGE)} for locale ${e.formatLocale(i)} - ${r.filePath?e.formatPath(r.filePath):(0,t.colorizePath)(`Remote`)}`,{level:`error`}),u.error.issues.forEach(n=>{o(`${t.x} Error: ${(0,t.colorizeKey)(r.key)} - ${e.formatLocale(i)} - ${(0,t.colorize)(`${n.path.join(`.`)}:`,t.ANSIColors.BLUE)} ${(0,t.colorize)(n.message,t.ANSIColors.GREY)}`,{level:`error`})}),!1}}return!0},i=(e,t,n)=>(e??[])?.filter(e=>r(e,t,n));exports.filterInvalidDictionaries=i,exports.isInvalidDictionary=r;
50
2
  //# sourceMappingURL=filterInvalidDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"filterInvalidDictionaries.cjs","names":["formatPath","ANSIColors","formatLocale","x"],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/client';\nimport { getContent } from '@intlayer/core';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\nimport { formatLocale, formatPath } from './utils/formatter';\n\ntype IsInvalidDictionaryOptions = { checkSchema: boolean };\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(\n dictionary.location === 'local' || typeof dictionary.filePath === 'string'\n );\n const location = isLocal ? 'Local' : 'Remote';\n const hasKey = Boolean(dictionary.key);\n const hasContent = Boolean(dictionary.content);\n\n if (!hasKey) {\n appLogger(`${location} dictionary has no key`, {\n level: 'error',\n });\n\n return false;\n }\n\n if (!hasContent) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n return false;\n }\n\n if (dictionary.schema && options?.checkSchema) {\n const isAsync =\n typeof dictionary.content === 'function' ||\n (typeof dictionary.content === 'object' &&\n dictionary.content !== null &&\n typeof (dictionary.content as any).then === 'function');\n\n if (!isAsync) {\n const locales = configuration?.internationalization?.locales ?? [];\n const isStrict =\n configuration?.internationalization.strictMode === 'strict';\n\n const schema =\n typeof dictionary.schema === 'string'\n ? configuration?.schemas?.[dictionary.schema]\n : undefined;\n\n if (schema && typeof schema.safeParse === 'function') {\n for (const locale of locales) {\n const resolvedContent = getContent(\n dictionary.content,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n },\n locale,\n !isStrict\n );\n const result = (schema as any).safeParse(resolvedContent);\n\n if (!result.success) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema as string, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n\n result.error.issues.forEach((issue: any) => {\n appLogger(\n `${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join('.')}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`,\n {\n level: 'error',\n }\n );\n });\n\n return false;\n }\n }\n }\n }\n }\n\n return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration, options)\n ) as Dictionary[];\n"],"mappings":";;;;;;;AAcA,MAAa,uBACX,YACA,eACA,YACY;CACZ,MAAM,sDAAyB,cAAc;AAE7C,KAAI,CAAC,WAAY,QAAO;CAKxB,MAAM,WAHU,QACd,WAAW,aAAa,WAAW,OAAO,WAAW,aAAa,SACnE,GAC0B,UAAU;CACrC,MAAM,SAAS,QAAQ,WAAW,IAAI;CACtC,MAAM,aAAa,QAAQ,WAAW,QAAQ;AAE9C,KAAI,CAAC,QAAQ;AACX,YAAU,GAAG,SAAS,yBAAyB,EAC7C,OAAO,SACR,CAAC;AAEF,SAAO;;AAGT,KAAI,CAAC,YAAY;AACf,YACE,GAAG,SAAS,uDAA0B,WAAW,IAAI,CAAC,oBAAoB,WAAW,WAAWA,mCAAW,WAAW,SAAS,6CAAgB,SAAS,IACxJ,EACE,OAAO,SACR,CACF;AACD,SAAO;;AAGT,KAAI,WAAW,UAAU,SAAS,aAOhC;MAAI,EALF,OAAO,WAAW,YAAY,cAC7B,OAAO,WAAW,YAAY,YAC7B,WAAW,YAAY,QACvB,OAAQ,WAAW,QAAgB,SAAS,aAElC;GACZ,MAAM,UAAU,eAAe,sBAAsB,WAAW,EAAE;GAClE,MAAM,WACJ,eAAe,qBAAqB,eAAe;GAErD,MAAM,SACJ,OAAO,WAAW,WAAW,WACzB,eAAe,UAAU,WAAW,UACpC;AAEN,OAAI,UAAU,OAAO,OAAO,cAAc,WACxC,MAAK,MAAM,UAAU,SAAS;IAC5B,MAAM,iDACJ,WAAW,SACX;KACE,eAAe,WAAW;KAC1B,SAAS,EAAE;KACZ,EACD,QACA,CAAC,SACF;IACD,MAAM,SAAU,OAAe,UAAU,gBAAgB;AAEzD,QAAI,CAAC,OAAO,SAAS;AACnB,eACE,GAAG,SAAS,uDAA0B,WAAW,IAAI,CAAC,iFAAoD,WAAW,QAAkBC,mCAAW,OAAO,CAAC,cAAcC,qCAAa,OAAO,CAAC,KAAK,WAAW,WAAWF,mCAAW,WAAW,SAAS,6CAAgB,SAAS,IAChR,EACE,OAAO,SACR,CACF;AAED,YAAO,MAAM,OAAO,SAAS,UAAe;AAC1C,gBACE,GAAGG,0BAAE,mDAAsB,WAAW,IAAI,CAAC,KAAKD,qCAAa,OAAO,CAAC,2CAAc,GAAG,MAAM,KAAK,KAAK,IAAI,CAAC,IAAID,mCAAW,KAAK,CAAC,yCAAY,MAAM,SAASA,mCAAW,KAAK,IAC3K,EACE,OAAO,SACR,CACF;OACD;AAEF,YAAO;;;;;AAOjB,QAAO;;AAGT,MAAa,6BACX,cACA,eACA,aAEC,gBAAgB,EAAE,GAAG,QAAQ,eAC5B,oBAAoB,YAAY,eAAe,QAAQ,CACxD"}
1
+ {"version":3,"file":"filterInvalidDictionaries.cjs","names":["formatPath","ANSIColors","formatLocale","x"],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/client';\nimport { getContent } from '@intlayer/core/interpreter';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\nimport { formatLocale, formatPath } from './utils/formatter';\n\ntype IsInvalidDictionaryOptions = { checkSchema: boolean };\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(\n dictionary.location === 'local' || typeof dictionary.filePath === 'string'\n );\n const location = isLocal ? 'Local' : 'Remote';\n const hasKey = Boolean(dictionary.key);\n const hasContent = Boolean(dictionary.content);\n\n if (!hasKey) {\n appLogger(`${location} dictionary has no key`, {\n level: 'error',\n });\n\n return false;\n }\n\n if (!hasContent) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n return false;\n }\n\n if (dictionary.schema && options?.checkSchema) {\n const isAsync =\n typeof dictionary.content === 'function' ||\n (typeof dictionary.content === 'object' &&\n dictionary.content !== null &&\n typeof (dictionary.content as any).then === 'function');\n\n if (!isAsync) {\n const locales = configuration?.internationalization?.locales ?? [];\n const isStrict =\n configuration?.internationalization.strictMode === 'strict';\n\n const schema =\n typeof dictionary.schema === 'string'\n ? configuration?.schemas?.[dictionary.schema]\n : undefined;\n\n if (schema && typeof schema.safeParse === 'function') {\n for (const locale of locales) {\n const resolvedContent = getContent(\n dictionary.content,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n },\n locale,\n !isStrict\n );\n const result = (schema as any).safeParse(resolvedContent);\n\n if (!result.success) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema as string, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n\n result.error.issues.forEach((issue: any) => {\n appLogger(\n `${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join('.')}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`,\n {\n level: 'error',\n }\n );\n });\n\n return false;\n }\n }\n }\n }\n }\n\n return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration, options)\n ) as Dictionary[];\n"],"mappings":"yOAcA,MAAa,GACX,EACA,EACA,IACY,CACZ,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAc,CAE7C,GAAI,CAAC,EAAY,MAAO,GAKxB,IAAM,EAFJ,EAAW,WAAa,SAAW,OAAO,EAAW,UAAa,SAEzC,QAAU,SAC/B,EAAS,EAAQ,EAAW,IAC5B,EAAa,EAAQ,EAAW,QAEtC,GAAI,CAAC,EAKH,OAJA,EAAU,GAAG,EAAS,wBAAyB,CAC7C,MAAO,QACR,CAAC,CAEK,GAGT,GAAI,CAAC,EAOH,OANA,EACE,GAAG,EAAS,eAAA,EAAA,EAAA,aAA0B,EAAW,IAAI,CAAC,oBAAoB,EAAW,SAAWA,EAAAA,WAAW,EAAW,SAAS,EAAA,EAAA,EAAA,cAAgB,SAAS,GACxJ,CACE,MAAO,QACR,CACF,CACM,GAGT,GAAI,EAAW,QAAU,GAAS,aAO5B,EALF,OAAO,EAAW,SAAY,YAC7B,OAAO,EAAW,SAAY,UAC7B,EAAW,UAAY,MACvB,OAAQ,EAAW,QAAgB,MAAS,YAElC,CACZ,IAAM,EAAU,GAAe,sBAAsB,SAAW,EAAE,CAC5D,EACJ,GAAe,qBAAqB,aAAe,SAE/C,EACJ,OAAO,EAAW,QAAW,SACzB,GAAe,UAAU,EAAW,QACpC,IAAA,GAEN,GAAI,GAAU,OAAO,EAAO,WAAc,WACxC,IAAK,IAAM,KAAU,EAAS,CAC5B,IAAM,GAAA,EAAA,EAAA,YACJ,EAAW,QACX,CACE,cAAe,EAAW,IAC1B,QAAS,EAAE,CACZ,CACD,EACA,CAAC,EACF,CACK,EAAU,EAAe,UAAU,EAAgB,CAEzD,GAAI,CAAC,EAAO,QAiBV,OAhBA,EACE,GAAG,EAAS,eAAA,EAAA,EAAA,aAA0B,EAAW,IAAI,CAAC,4CAAA,EAAA,EAAA,UAAoD,EAAW,OAAkBC,EAAAA,WAAW,OAAO,CAAC,cAAcC,EAAAA,aAAa,EAAO,CAAC,KAAK,EAAW,SAAWF,EAAAA,WAAW,EAAW,SAAS,EAAA,EAAA,EAAA,cAAgB,SAAS,GAChR,CACE,MAAO,QACR,CACF,CAED,EAAO,MAAM,OAAO,QAAS,GAAe,CAC1C,EACE,GAAGG,EAAAA,EAAE,WAAA,EAAA,EAAA,aAAsB,EAAW,IAAI,CAAC,KAAKD,EAAAA,aAAa,EAAO,CAAC,MAAA,EAAA,EAAA,UAAc,GAAG,EAAM,KAAK,KAAK,IAAI,CAAC,GAAID,EAAAA,WAAW,KAAK,CAAC,IAAA,EAAA,EAAA,UAAY,EAAM,QAASA,EAAAA,WAAW,KAAK,GAC3K,CACE,MAAO,QACR,CACF,EACD,CAEK,IAOjB,MAAO,IAGI,GACX,EACA,EACA,KAEC,GAAgB,EAAE,GAAG,OAAQ,GAC5B,EAAoB,EAAY,EAAe,EAAQ,CACxD"}
@@ -1,50 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _intlayer_core_messageFormat = require("@intlayer/core/messageFormat");
4
-
5
- //#region src/formatDictionary.ts
6
- const formatDictionary = (dictionary) => {
7
- if (dictionary.format === "icu") return {
8
- ...dictionary,
9
- format: "intlayer",
10
- content: (0, _intlayer_core_messageFormat.icuToIntlayerFormatter)(dictionary.content)
11
- };
12
- if (dictionary.format === "i18next") return {
13
- ...dictionary,
14
- format: "intlayer",
15
- content: (0, _intlayer_core_messageFormat.i18nextToIntlayerFormatter)(dictionary.content)
16
- };
17
- if (dictionary.format === "vue-i18n") return {
18
- ...dictionary,
19
- format: "intlayer",
20
- content: (0, _intlayer_core_messageFormat.vueI18nToIntlayerFormatter)(dictionary.content)
21
- };
22
- return dictionary;
23
- };
24
- const formatDictionaries = (dictionaries) => dictionaries.map(formatDictionary);
25
- const formatDictionaryOutput = (dictionary) => {
26
- if (dictionary.format === "icu") return {
27
- ...dictionary,
28
- format: "icu",
29
- content: (0, _intlayer_core_messageFormat.intlayerToICUFormatter)(dictionary.content)
30
- };
31
- if (dictionary.format === "i18next") return {
32
- ...dictionary,
33
- format: "i18next",
34
- content: (0, _intlayer_core_messageFormat.intlayerToI18nextFormatter)(dictionary.content)
35
- };
36
- if (dictionary.format === "vue-i18n") return {
37
- ...dictionary,
38
- format: "vue-i18n",
39
- content: (0, _intlayer_core_messageFormat.intlayerToVueI18nFormatter)(dictionary.content)
40
- };
41
- return dictionary;
42
- };
43
- const formatDictionariesOutput = (dictionaries) => dictionaries.map(formatDictionaryOutput);
44
-
45
- //#endregion
46
- exports.formatDictionaries = formatDictionaries;
47
- exports.formatDictionariesOutput = formatDictionariesOutput;
48
- exports.formatDictionary = formatDictionary;
49
- exports.formatDictionaryOutput = formatDictionaryOutput;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/core/messageFormat`);const t=t=>t.format===`icu`?{...t,format:`intlayer`,content:(0,e.icuToIntlayerFormatter)(t.content)}:t.format===`i18next`?{...t,format:`intlayer`,content:(0,e.i18nextToIntlayerFormatter)(t.content)}:t.format===`vue-i18n`?{...t,format:`intlayer`,content:(0,e.vueI18nToIntlayerFormatter)(t.content)}:t,n=e=>e.map(t),r=t=>t.format===`icu`?{...t,format:`icu`,content:(0,e.intlayerToICUFormatter)(t.content)}:t.format===`i18next`?{...t,format:`i18next`,content:(0,e.intlayerToI18nextFormatter)(t.content)}:t.format===`vue-i18n`?{...t,format:`vue-i18n`,content:(0,e.intlayerToVueI18nFormatter)(t.content)}:t,i=e=>e.map(r);exports.formatDictionaries=n,exports.formatDictionariesOutput=i,exports.formatDictionary=t,exports.formatDictionaryOutput=r;
50
2
  //# sourceMappingURL=formatDictionary.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatDictionary.cjs","names":[],"sources":["../../src/formatDictionary.ts"],"sourcesContent":["import {\n i18nextToIntlayerFormatter,\n icuToIntlayerFormatter,\n intlayerToI18nextFormatter,\n intlayerToICUFormatter,\n intlayerToVueI18nFormatter,\n vueI18nToIntlayerFormatter,\n} from '@intlayer/core/messageFormat';\nimport type { Dictionary } from '@intlayer/types';\n\nexport const formatDictionary = (dictionary: Dictionary): Dictionary => {\n if (dictionary.format === 'icu') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: icuToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'i18next') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: i18nextToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: vueI18nToIntlayerFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionaries = (dictionaries: Dictionary[]): Dictionary[] =>\n dictionaries.map(formatDictionary);\n\nexport const formatDictionaryOutput = (dictionary: Dictionary) => {\n if (dictionary.format === 'icu') {\n return {\n ...dictionary,\n format: 'icu',\n content: intlayerToICUFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'i18next') {\n return {\n ...dictionary,\n format: 'i18next',\n content: intlayerToI18nextFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'vue-i18n',\n content: intlayerToVueI18nFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionariesOutput = (dictionaries: Dictionary[]) =>\n dictionaries.map(formatDictionaryOutput);\n"],"mappings":";;;;;AAUA,MAAa,oBAAoB,eAAuC;AACtE,KAAI,WAAW,WAAW,MACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,kEAAgC,WAAW,QAAQ;EACpD;AAGH,KAAI,WAAW,WAAW,UACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,sEAAoC,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WAAW,WACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,sEAAoC,WAAW,QAAQ;EACxD;AAGH,QAAO;;AAGT,MAAa,sBAAsB,iBACjC,aAAa,IAAI,iBAAiB;AAEpC,MAAa,0BAA0B,eAA2B;AAChE,KAAI,WAAW,WAAW,MACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,kEAAgC,WAAW,QAAQ;EACpD;AAGH,KAAI,WAAW,WAAW,UACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,sEAAoC,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WAAW,WACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,sEAAoC,WAAW,QAAQ;EACxD;AAGH,QAAO;;AAGT,MAAa,4BAA4B,iBACvC,aAAa,IAAI,uBAAuB"}
1
+ {"version":3,"file":"formatDictionary.cjs","names":[],"sources":["../../src/formatDictionary.ts"],"sourcesContent":["import {\n i18nextToIntlayerFormatter,\n icuToIntlayerFormatter,\n intlayerToI18nextFormatter,\n intlayerToICUFormatter,\n intlayerToVueI18nFormatter,\n vueI18nToIntlayerFormatter,\n} from '@intlayer/core/messageFormat';\nimport type { Dictionary } from '@intlayer/types';\n\nexport const formatDictionary = (dictionary: Dictionary): Dictionary => {\n if (dictionary.format === 'icu') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: icuToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'i18next') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: i18nextToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: vueI18nToIntlayerFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionaries = (dictionaries: Dictionary[]): Dictionary[] =>\n dictionaries.map(formatDictionary);\n\nexport const formatDictionaryOutput = (dictionary: Dictionary) => {\n if (dictionary.format === 'icu') {\n return {\n ...dictionary,\n format: 'icu',\n content: intlayerToICUFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'i18next') {\n return {\n ...dictionary,\n format: 'i18next',\n content: intlayerToI18nextFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'vue-i18n',\n content: intlayerToVueI18nFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionariesOutput = (dictionaries: Dictionary[]) =>\n dictionaries.map(formatDictionaryOutput);\n"],"mappings":"6JAUA,MAAa,EAAoB,GAC3B,EAAW,SAAW,MACjB,CACL,GAAG,EACH,OAAQ,WACR,SAAA,EAAA,EAAA,wBAAgC,EAAW,QAAQ,CACpD,CAGC,EAAW,SAAW,UACjB,CACL,GAAG,EACH,OAAQ,WACR,SAAA,EAAA,EAAA,4BAAoC,EAAW,QAAQ,CACxD,CAGC,EAAW,SAAW,WACjB,CACL,GAAG,EACH,OAAQ,WACR,SAAA,EAAA,EAAA,4BAAoC,EAAW,QAAQ,CACxD,CAGI,EAGI,EAAsB,GACjC,EAAa,IAAI,EAAiB,CAEvB,EAA0B,GACjC,EAAW,SAAW,MACjB,CACL,GAAG,EACH,OAAQ,MACR,SAAA,EAAA,EAAA,wBAAgC,EAAW,QAAQ,CACpD,CAGC,EAAW,SAAW,UACjB,CACL,GAAG,EACH,OAAQ,UACR,SAAA,EAAA,EAAA,4BAAoC,EAAW,QAAQ,CACxD,CAGC,EAAW,SAAW,WACjB,CACL,GAAG,EACH,OAAQ,WACR,SAAA,EAAA,EAAA,4BAAoC,EAAW,QAAQ,CACxD,CAGI,EAGI,EAA4B,GACvC,EAAa,IAAI,EAAuB"}
@@ -1,40 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- const require__utils_asset = require('../_virtual/_utils_asset.cjs');
4
- let _intlayer_config = require("@intlayer/config");
5
-
6
- //#region src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts
7
- const getContentDeclarationFileTemplate = async (key, format, fileParams = {}) => {
8
- let fileTemplate;
9
- switch (format) {
10
- case "ts":
11
- fileTemplate = "./tsTemplate.txt";
12
- break;
13
- case "cjs":
14
- fileTemplate = "./cjsTemplate.txt";
15
- break;
16
- case "json":
17
- case "jsonc":
18
- case "json5":
19
- fileTemplate = "./jsonTemplate.txt";
20
- break;
21
- default:
22
- fileTemplate = "./esmTemplate.txt";
23
- break;
24
- }
25
- const fileContent = require__utils_asset.readAsset(fileTemplate);
26
- const camelCaseKey = (0, _intlayer_config.kebabCaseToCamelCase)(key);
27
- const nonCapitalizedCamelCaseKey = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);
28
- const fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([key, value]) => {
29
- const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key) ? key : JSON.stringify(key);
30
- if (typeof value === "object") return `\n ${formattedKey}: ${JSON.stringify(value)},`;
31
- if (typeof value === "boolean" || typeof value === "number") return `\n ${formattedKey}: ${value},`;
32
- if (typeof value === "string") return `\n ${formattedKey}: ${JSON.stringify(value)},`;
33
- return `\n ${formattedKey}: ${value},`;
34
- }).join("");
35
- return fileContent.replace("{{key}}", key).replaceAll("{{name}}", nonCapitalizedCamelCaseKey).replace("{{fileParams}}", fileParamsString);
36
- };
37
-
38
- //#endregion
39
- exports.getContentDeclarationFileTemplate = getContentDeclarationFileTemplate;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../_virtual/_utils_asset.cjs`);let t=require(`@intlayer/config/utils`);const n=async(n,r,i={})=>{let a;switch(r){case`ts`:a=`./tsTemplate.txt`;break;case`cjs`:a=`./cjsTemplate.txt`;break;case`json`:case`jsonc`:case`json5`:a=`./jsonTemplate.txt`;break;default:a=`./esmTemplate.txt`;break}let o=e.readAsset(a),s=(0,t.kebabCaseToCamelCase)(n),c=s.charAt(0).toLowerCase()+s.slice(1),l=Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>{let n=/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(e)?e:JSON.stringify(e);return typeof t==`object`?`\n ${n}: ${JSON.stringify(t)},`:typeof t==`boolean`||typeof t==`number`?`\n ${n}: ${t},`:typeof t==`string`?`\n ${n}: ${JSON.stringify(t)},`:`\n ${n}: ${t},`}).join(``);return o.replace(`{{key}}`,n).replaceAll(`{{name}}`,c).replace(`{{fileParams}}`,l)};exports.getContentDeclarationFileTemplate=n;
40
2
  //# sourceMappingURL=getContentDeclarationFileTemplate.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"getContentDeclarationFileTemplate.cjs","names":["readAsset"],"sources":["../../../src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts"],"sourcesContent":["import { readAsset } from 'utils:asset';\nimport { kebabCaseToCamelCase } from '@intlayer/config';\nimport type { Format } from '../utils/getFormatFromExtension';\n\nexport const getContentDeclarationFileTemplate = async (\n key: string,\n format: Format,\n fileParams: Record<string, any> = {}\n) => {\n let fileTemplate: string;\n\n switch (format) {\n case 'ts':\n fileTemplate = './tsTemplate.txt';\n break;\n case 'cjs':\n fileTemplate = './cjsTemplate.txt';\n break;\n case 'json':\n case 'jsonc':\n case 'json5':\n fileTemplate = './jsonTemplate.txt';\n break;\n default:\n fileTemplate = './esmTemplate.txt';\n break;\n }\n\n const fileContent = readAsset(fileTemplate);\n const camelCaseKey = kebabCaseToCamelCase(key);\n const nonCapitalizedCamelCaseKey =\n camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\n const fileParamsString = Object.entries(fileParams)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => {\n const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key)\n ? key\n : JSON.stringify(key);\n\n if (typeof value === 'object') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return `\\n ${formattedKey}: ${value},`;\n }\n\n if (typeof value === 'string') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n return `\\n ${formattedKey}: ${value},`;\n })\n .join('');\n\n return fileContent\n .replace('{{key}}', key)\n .replaceAll('{{name}}', nonCapitalizedCamelCaseKey)\n .replace('{{fileParams}}', fileParamsString);\n};\n"],"mappings":";;;;;;AAIA,MAAa,oCAAoC,OAC/C,KACA,QACA,aAAkC,EAAE,KACjC;CACH,IAAI;AAEJ,SAAQ,QAAR;EACE,KAAK;AACH,kBAAe;AACf;EACF,KAAK;AACH,kBAAe;AACf;EACF,KAAK;EACL,KAAK;EACL,KAAK;AACH,kBAAe;AACf;EACF;AACE,kBAAe;AACf;;CAGJ,MAAM,cAAcA,+BAAU,aAAa;CAC3C,MAAM,0DAAoC,IAAI;CAC9C,MAAM,6BACJ,aAAa,OAAO,EAAE,CAAC,aAAa,GAAG,aAAa,MAAM,EAAE;CAE9D,MAAM,mBAAmB,OAAO,QAAQ,WAAW,CAChD,QAAQ,GAAG,WAAW,UAAU,OAAU,CAC1C,KAAK,CAAC,KAAK,WAAW;EACrB,MAAM,eAAe,6BAA6B,KAAK,IAAI,GACvD,MACA,KAAK,UAAU,IAAI;AAEvB,MAAI,OAAO,UAAU,SACnB,QAAO,OAAO,aAAa,IAAI,KAAK,UAAU,MAAM,CAAC;AAGvD,MAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SACjD,QAAO,OAAO,aAAa,IAAI,MAAM;AAGvC,MAAI,OAAO,UAAU,SACnB,QAAO,OAAO,aAAa,IAAI,KAAK,UAAU,MAAM,CAAC;AAGvD,SAAO,OAAO,aAAa,IAAI,MAAM;GACrC,CACD,KAAK,GAAG;AAEX,QAAO,YACJ,QAAQ,WAAW,IAAI,CACvB,WAAW,YAAY,2BAA2B,CAClD,QAAQ,kBAAkB,iBAAiB"}
1
+ {"version":3,"file":"getContentDeclarationFileTemplate.cjs","names":["readAsset"],"sources":["../../../src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts"],"sourcesContent":["import { readAsset } from 'utils:asset';\nimport { kebabCaseToCamelCase } from '@intlayer/config/utils';\nimport type { Format } from '../utils/getFormatFromExtension';\n\nexport const getContentDeclarationFileTemplate = async (\n key: string,\n format: Format,\n fileParams: Record<string, any> = {}\n) => {\n let fileTemplate: string;\n\n switch (format) {\n case 'ts':\n fileTemplate = './tsTemplate.txt';\n break;\n case 'cjs':\n fileTemplate = './cjsTemplate.txt';\n break;\n case 'json':\n case 'jsonc':\n case 'json5':\n fileTemplate = './jsonTemplate.txt';\n break;\n default:\n fileTemplate = './esmTemplate.txt';\n break;\n }\n\n const fileContent = readAsset(fileTemplate);\n const camelCaseKey = kebabCaseToCamelCase(key);\n const nonCapitalizedCamelCaseKey =\n camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\n const fileParamsString = Object.entries(fileParams)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => {\n const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key)\n ? key\n : JSON.stringify(key);\n\n if (typeof value === 'object') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return `\\n ${formattedKey}: ${value},`;\n }\n\n if (typeof value === 'string') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n return `\\n ${formattedKey}: ${value},`;\n })\n .join('');\n\n return fileContent\n .replace('{{key}}', key)\n .replaceAll('{{name}}', nonCapitalizedCamelCaseKey)\n .replace('{{fileParams}}', fileParamsString);\n};\n"],"mappings":"wMAIA,MAAa,EAAoC,MAC/C,EACA,EACA,EAAkC,EAAE,GACjC,CACH,IAAI,EAEJ,OAAQ,EAAR,CACE,IAAK,KACH,EAAe,mBACf,MACF,IAAK,MACH,EAAe,oBACf,MACF,IAAK,OACL,IAAK,QACL,IAAK,QACH,EAAe,qBACf,MACF,QACE,EAAe,oBACf,MAGJ,IAAM,EAAcA,EAAAA,UAAU,EAAa,CACrC,GAAA,EAAA,EAAA,sBAAoC,EAAI,CACxC,EACJ,EAAa,OAAO,EAAE,CAAC,aAAa,CAAG,EAAa,MAAM,EAAE,CAExD,EAAmB,OAAO,QAAQ,EAAW,CAChD,QAAQ,EAAG,KAAW,IAAU,IAAA,GAAU,CAC1C,KAAK,CAAC,EAAK,KAAW,CACrB,IAAM,EAAe,6BAA6B,KAAK,EAAI,CACvD,EACA,KAAK,UAAU,EAAI,CAcvB,OAZI,OAAO,GAAU,SACZ,OAAO,EAAa,IAAI,KAAK,UAAU,EAAM,CAAC,GAGnD,OAAO,GAAU,WAAa,OAAO,GAAU,SAC1C,OAAO,EAAa,IAAI,EAAM,GAGnC,OAAO,GAAU,SACZ,OAAO,EAAa,IAAI,KAAK,UAAU,EAAM,CAAC,GAGhD,OAAO,EAAa,IAAI,EAAM,IACrC,CACD,KAAK,GAAG,CAEX,OAAO,EACJ,QAAQ,UAAW,EAAI,CACvB,WAAW,WAAY,EAA2B,CAClD,QAAQ,iBAAkB,EAAiB"}
@@ -1,35 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_utils_formatter = require('./utils/formatter.cjs');
4
- const require_buildIntlayerDictionary_buildIntlayerDictionary = require('./buildIntlayerDictionary/buildIntlayerDictionary.cjs');
5
- const require_createDictionaryEntryPoint_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
6
- const require_createType_createModuleAugmentation = require('./createType/createModuleAugmentation.cjs');
7
- const require_createType_createType = require('./createType/createType.cjs');
8
- const require_loadDictionaries_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
9
- let _intlayer_config = require("@intlayer/config");
10
-
11
- //#region src/handleAdditionalContentDeclarationFile.ts
12
- const handleAdditionalContentDeclarationFile = async (filePath, config) => {
13
- const appLogger = (0, _intlayer_config.getAppLogger)(config);
14
- appLogger(`Additional file detected: ${require_utils_formatter.formatPath(filePath)}`, { isVerbose: true });
15
- const dictionariesOutput = await require_buildIntlayerDictionary_buildIntlayerDictionary.buildDictionary(await require_loadDictionaries_loadLocalDictionaries.loadLocalDictionaries(filePath, config), config);
16
- await require_createType_createType.createTypes(Object.values(dictionariesOutput?.mergedDictionaries ?? {}).map((dictionary) => dictionary.dictionary), config);
17
- await require_createDictionaryEntryPoint_createDictionaryEntryPoint.createDictionaryEntryPoint(config);
18
- appLogger("Dictionaries built", { isVerbose: true });
19
- require_createType_createModuleAugmentation.createModuleAugmentation(config);
20
- appLogger("Module augmentation built", { isVerbose: true });
21
- for await (const plugin of config.plugins ?? []) {
22
- const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
23
- await plugin.afterBuild?.({
24
- dictionaries: {
25
- unmergedDictionaries,
26
- mergedDictionaries
27
- },
28
- configuration: config
29
- });
30
- }
31
- };
32
-
33
- //#endregion
34
- exports.handleAdditionalContentDeclarationFile = handleAdditionalContentDeclarationFile;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/formatter.cjs`),t=require(`./buildIntlayerDictionary/buildIntlayerDictionary.cjs`),n=require(`./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs`),r=require(`./createType/createModuleAugmentation.cjs`),i=require(`./createType/createType.cjs`),a=require(`./loadDictionaries/loadLocalDictionaries.cjs`);let o=require(`@intlayer/config/logger`);const s=async(s,c)=>{let l=(0,o.getAppLogger)(c);l(`Additional file detected: ${e.formatPath(s)}`,{isVerbose:!0});let u=await t.buildDictionary(await a.loadLocalDictionaries(s,c),c);await i.createTypes(Object.values(u?.mergedDictionaries??{}).map(e=>e.dictionary),c),await n.createDictionaryEntryPoint(c),l(`Dictionaries built`,{isVerbose:!0}),r.createModuleAugmentation(c),l(`Module augmentation built`,{isVerbose:!0});for await(let e of c.plugins??[]){let{unmergedDictionaries:t,mergedDictionaries:n}=u;await e.afterBuild?.({dictionaries:{unmergedDictionaries:t,mergedDictionaries:n},configuration:c})}};exports.handleAdditionalContentDeclarationFile=s;
35
2
  //# sourceMappingURL=handleAdditionalContentDeclarationFile.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleAdditionalContentDeclarationFile.cjs","names":["formatPath","buildDictionary","loadLocalDictionaries","createTypes","createDictionaryEntryPoint"],"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleAdditionalContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Additional file detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n await createDictionaryEntryPoint(config);\n\n appLogger('Dictionaries built', {\n isVerbose: true,\n });\n\n createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;AAQA,MAAa,yCAAyC,OACpD,UACA,WACG;CACH,MAAM,+CAAyB,OAAO;AAGtC,WAAU,6BAA6BA,mCAAW,SAAS,IAAI,EAC7D,WAAW,MACZ,CAAC;CAIF,MAAM,qBAAqB,MAAMC,wEAFN,MAAMC,qEAAsB,UAAU,OAAO,EAEH,OAAO;AAM5E,OAAMC,0CAJsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C,CAAC,KAAK,eAAe,WAAW,WAAW,EAEL,OAAO;AAE9C,OAAMC,yFAA2B,OAAO;AAExC,WAAU,sBAAsB,EAC9B,WAAW,MACZ,CAAC;AAEF,sEAAyB,OAAO;AAEhC,WAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;AAIF,YAAW,MAAM,UAAU,OAAO,WAAW,EAAE,EAAE;EAC/C,MAAM,EAAE,sBAAsB,uBAAuB;AAErD,QAAM,OAAO,aAAa;GACxB,cAAc;IACZ;IACA;IACD;GACD,eAAe;GAChB,CAAC"}
1
+ {"version":3,"file":"handleAdditionalContentDeclarationFile.cjs","names":["formatPath","buildDictionary","loadLocalDictionaries","createTypes","createDictionaryEntryPoint"],"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleAdditionalContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Additional file detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n await createDictionaryEntryPoint(config);\n\n appLogger('Dictionaries built', {\n isVerbose: true,\n });\n\n createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":"ueAQA,MAAa,EAAyC,MACpD,EACA,IACG,CACH,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAO,CAGtC,EAAU,6BAA6BA,EAAAA,WAAW,EAAS,GAAI,CAC7D,UAAW,GACZ,CAAC,CAIF,IAAM,EAAqB,MAAMC,EAAAA,gBAFN,MAAMC,EAAAA,sBAAsB,EAAU,EAAO,CAEH,EAAO,CAM5E,MAAMC,EAAAA,YAJsB,OAAO,OACjC,GAAoB,oBAAsB,EAAE,CAC7C,CAAC,IAAK,GAAe,EAAW,WAAW,CAEL,EAAO,CAE9C,MAAMC,EAAAA,2BAA2B,EAAO,CAExC,EAAU,qBAAsB,CAC9B,UAAW,GACZ,CAAC,CAEF,EAAA,yBAAyB,EAAO,CAEhC,EAAU,4BAA6B,CACrC,UAAW,GACZ,CAAC,CAIF,UAAW,IAAM,KAAU,EAAO,SAAW,EAAE,CAAE,CAC/C,GAAM,CAAE,uBAAsB,sBAAuB,EAErD,MAAM,EAAO,aAAa,CACxB,aAAc,CACZ,uBACA,qBACD,CACD,cAAe,EAChB,CAAC"}
@@ -1,50 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_utils_formatter = require('./utils/formatter.cjs');
4
- const require_buildIntlayerDictionary_buildIntlayerDictionary = require('./buildIntlayerDictionary/buildIntlayerDictionary.cjs');
5
- const require_createDictionaryEntryPoint_getBuiltDictionariesPath = require('./createDictionaryEntryPoint/getBuiltDictionariesPath.cjs');
6
- const require_createDictionaryEntryPoint_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
7
- const require_createType_createModuleAugmentation = require('./createType/createModuleAugmentation.cjs');
8
- const require_createType_createType = require('./createType/createType.cjs');
9
- const require_loadDictionaries_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
10
- const require_cleanRemovedContentDeclaration = require('./cleanRemovedContentDeclaration.cjs');
11
- let _intlayer_config = require("@intlayer/config");
12
-
13
- //#region src/handleContentDeclarationFileChange.ts
14
- const handleContentDeclarationFileChange = async (filePath, config) => {
15
- const appLogger = (0, _intlayer_config.getAppLogger)(config);
16
- appLogger(`Change detected: ${require_utils_formatter.formatPath(filePath)}`, { isVerbose: true });
17
- const allDictionariesPaths = await require_createDictionaryEntryPoint_getBuiltDictionariesPath.getBuiltDictionariesPath(config);
18
- const localeDictionaries = await require_loadDictionaries_loadLocalDictionaries.loadLocalDictionaries(filePath, config);
19
- const dictionariesOutput = await require_buildIntlayerDictionary_buildIntlayerDictionary.buildDictionary(localeDictionaries, config);
20
- const updatedDictionaries = Object.values(dictionariesOutput?.mergedDictionaries ?? {});
21
- const updatedDictionariesPaths = updatedDictionaries.map((dictionary) => dictionary.dictionaryPath);
22
- const { excludeKeys, hasRebuilt } = await require_cleanRemovedContentDeclaration.cleanRemovedContentDeclaration(filePath, localeDictionaries.map((dictionary) => dictionary.key), config);
23
- const hasNewDictionaries = updatedDictionariesPaths.some((updatedDictionaryPath) => !allDictionariesPaths.includes(updatedDictionaryPath));
24
- if (hasRebuilt || hasNewDictionaries) {
25
- if (!hasRebuilt) {
26
- await require_createDictionaryEntryPoint_createDictionaryEntryPoint.createDictionaryEntryPoint(config, { excludeKeys });
27
- appLogger("Dictionary list built", { isVerbose: true });
28
- }
29
- }
30
- await require_createType_createType.createTypes(updatedDictionaries.map((dictionary) => dictionary.dictionary), config);
31
- appLogger("TypeScript types built", { isVerbose: true });
32
- if (hasNewDictionaries) {
33
- await require_createType_createModuleAugmentation.createModuleAugmentation(config);
34
- appLogger("Module augmentation built", { isVerbose: true });
35
- }
36
- for await (const plugin of config.plugins ?? []) {
37
- const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
38
- await plugin.afterBuild?.({
39
- dictionaries: {
40
- unmergedDictionaries,
41
- mergedDictionaries
42
- },
43
- configuration: config
44
- });
45
- }
46
- };
47
-
48
- //#endregion
49
- exports.handleContentDeclarationFileChange = handleContentDeclarationFileChange;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./utils/formatter.cjs`),t=require(`./buildIntlayerDictionary/buildIntlayerDictionary.cjs`),n=require(`./createDictionaryEntryPoint/getBuiltDictionariesPath.cjs`),r=require(`./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs`),i=require(`./createType/createModuleAugmentation.cjs`),a=require(`./createType/createType.cjs`),o=require(`./loadDictionaries/loadLocalDictionaries.cjs`),s=require(`./cleanRemovedContentDeclaration.cjs`);let c=require(`@intlayer/config/logger`);const l=async(l,u)=>{let d=(0,c.getAppLogger)(u);d(`Change detected: ${e.formatPath(l)}`,{isVerbose:!0});let f=await n.getBuiltDictionariesPath(u),p=await o.loadLocalDictionaries(l,u),m=await t.buildDictionary(p,u),h=Object.values(m?.mergedDictionaries??{}),g=h.map(e=>e.dictionaryPath),{excludeKeys:_,hasRebuilt:v}=await s.cleanRemovedContentDeclaration(l,p.map(e=>e.key),u),y=g.some(e=>!f.includes(e));(v||y)&&(v||(await r.createDictionaryEntryPoint(u,{excludeKeys:_}),d(`Dictionary list built`,{isVerbose:!0}))),await a.createTypes(h.map(e=>e.dictionary),u),d(`TypeScript types built`,{isVerbose:!0}),y&&(await i.createModuleAugmentation(u),d(`Module augmentation built`,{isVerbose:!0}));for await(let e of u.plugins??[]){let{unmergedDictionaries:t,mergedDictionaries:n}=m;await e.afterBuild?.({dictionaries:{unmergedDictionaries:t,mergedDictionaries:n},configuration:u})}};exports.handleContentDeclarationFileChange=l;
50
2
  //# sourceMappingURL=handleContentDeclarationFileChange.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleContentDeclarationFileChange.cjs","names":["formatPath","getBuiltDictionariesPath","loadLocalDictionaries","buildDictionary","cleanRemovedContentDeclaration","createDictionaryEntryPoint","createTypes","createModuleAugmentation"],"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { getBuiltDictionariesPath } from './createDictionaryEntryPoint/getBuiltDictionariesPath';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileChange = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Change detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const allDictionariesPaths: string[] = await getBuiltDictionariesPath(config);\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n const updatedDictionaries = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n );\n const updatedDictionariesPaths = updatedDictionaries.map(\n (dictionary) => dictionary.dictionaryPath\n );\n\n const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(\n filePath,\n localeDictionaries.map((dictionary) => dictionary.key),\n config\n );\n\n const hasNewDictionaries = updatedDictionariesPaths.some(\n (updatedDictionaryPath) =>\n !allDictionariesPaths.includes(updatedDictionaryPath)\n );\n\n // Rebuild Entry Point & Module Augmentation\n // These only need to be updated if the *list* of dictionaries changed (Add/Remove/Rename)\n if (hasRebuilt || hasNewDictionaries) {\n // If hasRebuilt is true, cleanRemovedContentDeclaration has already updated the entry point\n // to remove the old keys (and it likely included the new ones if they were already on disk).\n // If NOT hasRebuilt, we explicitly need to update the entry point to include the new dictionaries.\n if (!hasRebuilt) {\n await createDictionaryEntryPoint(config, { excludeKeys });\n appLogger('Dictionary list built', {\n isVerbose: true,\n });\n }\n }\n\n // Rebuild Types\n // Always regenerate types when a file changes, as the content structure (interface) might have changed\n // even if the key is the same.\n const dictionariesToBuild = updatedDictionaries.map(\n (dictionary) => dictionary.dictionary\n );\n\n await createTypes(dictionariesToBuild, config);\n appLogger('TypeScript types built', {\n isVerbose: true,\n });\n\n if (hasNewDictionaries) {\n await createModuleAugmentation(config);\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n }\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,qCAAqC,OAChD,UACA,WACG;CACH,MAAM,+CAAyB,OAAO;AAGtC,WAAU,oBAAoBA,mCAAW,SAAS,IAAI,EACpD,WAAW,MACZ,CAAC;CAEF,MAAM,uBAAiC,MAAMC,qFAAyB,OAAO;CAE7E,MAAM,qBAAqB,MAAMC,qEAAsB,UAAU,OAAO;CAExE,MAAM,qBAAqB,MAAMC,wEAAgB,oBAAoB,OAAO;CAC5E,MAAM,sBAAsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C;CACD,MAAM,2BAA2B,oBAAoB,KAClD,eAAe,WAAW,eAC5B;CAED,MAAM,EAAE,aAAa,eAAe,MAAMC,sEACxC,UACA,mBAAmB,KAAK,eAAe,WAAW,IAAI,EACtD,OACD;CAED,MAAM,qBAAqB,yBAAyB,MACjD,0BACC,CAAC,qBAAqB,SAAS,sBAAsB,CACxD;AAID,KAAI,cAAc,oBAIhB;MAAI,CAAC,YAAY;AACf,SAAMC,yFAA2B,QAAQ,EAAE,aAAa,CAAC;AACzD,aAAU,yBAAyB,EACjC,WAAW,MACZ,CAAC;;;AAWN,OAAMC,0CAJsB,oBAAoB,KAC7C,eAAe,WAAW,WAC5B,EAEsC,OAAO;AAC9C,WAAU,0BAA0B,EAClC,WAAW,MACZ,CAAC;AAEF,KAAI,oBAAoB;AACtB,QAAMC,qEAAyB,OAAO;AACtC,YAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;;AAKJ,YAAW,MAAM,UAAU,OAAO,WAAW,EAAE,EAAE;EAC/C,MAAM,EAAE,sBAAsB,uBAAuB;AAErD,QAAM,OAAO,aAAa;GACxB,cAAc;IACZ;IACA;IACD;GACD,eAAe;GAChB,CAAC"}
1
+ {"version":3,"file":"handleContentDeclarationFileChange.cjs","names":["formatPath","getBuiltDictionariesPath","loadLocalDictionaries","buildDictionary","cleanRemovedContentDeclaration","createDictionaryEntryPoint","createTypes","createModuleAugmentation"],"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { getBuiltDictionariesPath } from './createDictionaryEntryPoint/getBuiltDictionariesPath';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileChange = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Change detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const allDictionariesPaths: string[] = await getBuiltDictionariesPath(config);\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n const updatedDictionaries = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n );\n const updatedDictionariesPaths = updatedDictionaries.map(\n (dictionary) => dictionary.dictionaryPath\n );\n\n const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(\n filePath,\n localeDictionaries.map((dictionary) => dictionary.key),\n config\n );\n\n const hasNewDictionaries = updatedDictionariesPaths.some(\n (updatedDictionaryPath) =>\n !allDictionariesPaths.includes(updatedDictionaryPath)\n );\n\n // Rebuild Entry Point & Module Augmentation\n // These only need to be updated if the *list* of dictionaries changed (Add/Remove/Rename)\n if (hasRebuilt || hasNewDictionaries) {\n // If hasRebuilt is true, cleanRemovedContentDeclaration has already updated the entry point\n // to remove the old keys (and it likely included the new ones if they were already on disk).\n // If NOT hasRebuilt, we explicitly need to update the entry point to include the new dictionaries.\n if (!hasRebuilt) {\n await createDictionaryEntryPoint(config, { excludeKeys });\n appLogger('Dictionary list built', {\n isVerbose: true,\n });\n }\n }\n\n // Rebuild Types\n // Always regenerate types when a file changes, as the content structure (interface) might have changed\n // even if the key is the same.\n const dictionariesToBuild = updatedDictionaries.map(\n (dictionary) => dictionary.dictionary\n );\n\n await createTypes(dictionariesToBuild, config);\n appLogger('TypeScript types built', {\n isVerbose: true,\n });\n\n if (hasNewDictionaries) {\n await createModuleAugmentation(config);\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n }\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":"gmBAWA,MAAa,EAAqC,MAChD,EACA,IACG,CACH,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAO,CAGtC,EAAU,oBAAoBA,EAAAA,WAAW,EAAS,GAAI,CACpD,UAAW,GACZ,CAAC,CAEF,IAAM,EAAiC,MAAMC,EAAAA,yBAAyB,EAAO,CAEvE,EAAqB,MAAMC,EAAAA,sBAAsB,EAAU,EAAO,CAElE,EAAqB,MAAMC,EAAAA,gBAAgB,EAAoB,EAAO,CACtE,EAAsB,OAAO,OACjC,GAAoB,oBAAsB,EAAE,CAC7C,CACK,EAA2B,EAAoB,IAClD,GAAe,EAAW,eAC5B,CAEK,CAAE,cAAa,cAAe,MAAMC,EAAAA,+BACxC,EACA,EAAmB,IAAK,GAAe,EAAW,IAAI,CACtD,EACD,CAEK,EAAqB,EAAyB,KACjD,GACC,CAAC,EAAqB,SAAS,EAAsB,CACxD,EAIG,GAAc,KAIX,IACH,MAAMC,EAAAA,2BAA2B,EAAQ,CAAE,cAAa,CAAC,CACzD,EAAU,wBAAyB,CACjC,UAAW,GACZ,CAAC,GAWN,MAAMC,EAAAA,YAJsB,EAAoB,IAC7C,GAAe,EAAW,WAC5B,CAEsC,EAAO,CAC9C,EAAU,yBAA0B,CAClC,UAAW,GACZ,CAAC,CAEE,IACF,MAAMC,EAAAA,yBAAyB,EAAO,CACtC,EAAU,4BAA6B,CACrC,UAAW,GACZ,CAAC,EAKJ,UAAW,IAAM,KAAU,EAAO,SAAW,EAAE,CAAE,CAC/C,GAAM,CAAE,uBAAsB,sBAAuB,EAErD,MAAM,EAAO,aAAa,CACxB,aAAc,CACZ,uBACA,qBACD,CACD,cAAe,EAChB,CAAC"}