@intlayer/chokidar 6.0.2 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/README.md +249 -66
  2. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.cjs +18 -2
  3. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -0
  4. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.cjs +4 -4
  5. package/dist/cjs/buildIntlayerDictionary/index.cjs.map +1 -0
  6. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.cjs +1 -1
  7. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -0
  8. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.cjs +3 -3
  9. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -0
  10. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.cjs +2 -2
  11. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -0
  12. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.cjs +4 -4
  13. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -0
  14. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.cjs +4 -4
  15. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -0
  16. package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.cjs +4 -4
  17. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -0
  18. package/dist/cjs/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.cjs +7 -7
  19. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -0
  20. package/dist/cjs/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.cjs +1 -1
  21. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -0
  22. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -0
  23. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -0
  24. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -0
  25. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -0
  26. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
  27. package/dist/cjs/createDictionaryEntryPoint/index.cjs +35 -0
  28. package/dist/cjs/createDictionaryEntryPoint/index.cjs.map +1 -0
  29. package/dist/cjs/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.cjs +3 -3
  30. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -0
  31. package/dist/cjs/{transpiler/dictionary_to_type → createType}/createType.cjs +1 -1
  32. package/dist/cjs/createType/createType.cjs.map +1 -0
  33. package/dist/cjs/{transpiler/dictionary_to_type → createType}/index.cjs +4 -4
  34. package/dist/cjs/createType/index.cjs.map +1 -0
  35. package/dist/cjs/filterInvalidDictionaries.cjs +32 -40
  36. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  37. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +54 -0
  38. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -0
  39. package/dist/cjs/handleContentDeclarationFileChange.cjs +59 -0
  40. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -0
  41. package/dist/cjs/handleUnlikedContentDeclarationFile.cjs +57 -0
  42. package/dist/cjs/handleUnlikedContentDeclarationFile.cjs.map +1 -0
  43. package/dist/cjs/index.cjs +35 -12
  44. package/dist/cjs/index.cjs.map +1 -1
  45. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  46. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +6 -3
  47. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  48. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +8 -4
  49. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  50. package/dist/cjs/prepareIntlayer.cjs +10 -8
  51. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  52. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +2 -2
  53. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  54. package/dist/cjs/utils/extractErrorMessage.cjs +22 -10
  55. package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
  56. package/dist/cjs/utils/parallelize.cjs +139 -12
  57. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  58. package/dist/cjs/utils/runParallel.cjs +77 -0
  59. package/dist/cjs/utils/runParallel.cjs.map +1 -0
  60. package/dist/cjs/watcher.cjs +89 -0
  61. package/dist/cjs/watcher.cjs.map +1 -0
  62. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +770 -0
  63. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -0
  64. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +46 -55
  65. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  66. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +12 -288
  67. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  68. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.mjs +18 -2
  69. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -0
  70. package/dist/esm/buildIntlayerDictionary/index.mjs.map +1 -0
  71. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.mjs +1 -1
  72. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -0
  73. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.mjs +3 -3
  74. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -0
  75. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.mjs +2 -2
  76. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -0
  77. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.mjs +4 -4
  78. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -0
  79. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.mjs +4 -4
  80. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -0
  81. package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.mjs +4 -4
  82. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -0
  83. package/dist/esm/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.mjs +7 -7
  84. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -0
  85. package/dist/esm/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.mjs +1 -1
  86. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -0
  87. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -0
  88. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -0
  89. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -0
  90. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -0
  91. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
  92. package/dist/esm/createDictionaryEntryPoint/index.mjs +8 -0
  93. package/dist/esm/createDictionaryEntryPoint/index.mjs.map +1 -0
  94. package/dist/esm/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.mjs +3 -3
  95. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -0
  96. package/dist/esm/{transpiler/dictionary_to_type → createType}/createType.mjs +1 -1
  97. package/dist/esm/createType/createType.mjs.map +1 -0
  98. package/dist/esm/createType/index.mjs.map +1 -0
  99. package/dist/esm/filterInvalidDictionaries.mjs +29 -28
  100. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  101. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +30 -0
  102. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -0
  103. package/dist/esm/handleContentDeclarationFileChange.mjs +35 -0
  104. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -0
  105. package/dist/esm/handleUnlikedContentDeclarationFile.mjs +33 -0
  106. package/dist/esm/handleUnlikedContentDeclarationFile.mjs.map +1 -0
  107. package/dist/esm/index.mjs +29 -14
  108. package/dist/esm/index.mjs.map +1 -1
  109. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  110. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +10 -4
  111. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  112. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +12 -5
  113. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  114. package/dist/esm/prepareIntlayer.mjs +8 -9
  115. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  116. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +2 -2
  117. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  118. package/dist/esm/utils/extractErrorMessage.mjs +22 -10
  119. package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
  120. package/dist/esm/utils/parallelize.mjs +137 -1
  121. package/dist/esm/utils/parallelize.mjs.map +1 -1
  122. package/dist/esm/utils/runParallel.mjs +43 -0
  123. package/dist/esm/utils/runParallel.mjs.map +1 -0
  124. package/dist/esm/watcher.mjs +67 -0
  125. package/dist/esm/watcher.mjs.map +1 -0
  126. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +751 -0
  127. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -0
  128. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +47 -56
  129. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  130. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +15 -279
  131. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  132. package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.d.ts +1 -1
  133. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  134. package/dist/types/buildIntlayerDictionary/index.d.ts.map +1 -0
  135. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  136. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  137. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -0
  138. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  139. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -0
  140. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  141. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  142. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  143. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  144. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  145. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  146. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  147. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  148. package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -0
  149. package/dist/types/createDictionaryEntryPoint/index.d.ts.map +1 -0
  150. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  151. package/dist/types/createType/createType.d.ts.map +1 -0
  152. package/dist/types/createType/index.d.ts.map +1 -0
  153. package/dist/types/filterInvalidDictionaries.d.ts +3 -1
  154. package/dist/types/filterInvalidDictionaries.d.ts.map +1 -1
  155. package/dist/types/handleAdditionalContentDeclarationFile.d.ts +3 -0
  156. package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -0
  157. package/dist/types/handleContentDeclarationFileChange.d.ts +3 -0
  158. package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -0
  159. package/dist/types/handleUnlikedContentDeclarationFile.d.ts +3 -0
  160. package/dist/types/handleUnlikedContentDeclarationFile.d.ts.map +1 -0
  161. package/dist/types/index.d.ts +12 -7
  162. package/dist/types/index.d.ts.map +1 -1
  163. package/dist/types/listDictionariesPath.d.ts +5 -0
  164. package/dist/types/listDictionariesPath.d.ts.map +1 -1
  165. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +1 -1
  166. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  167. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +2 -1
  168. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -1
  169. package/dist/types/prepareIntlayer.d.ts +1 -1
  170. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  171. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +1 -1
  172. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -1
  173. package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
  174. package/dist/types/utils/parallelize.d.ts +12 -0
  175. package/dist/types/utils/parallelize.d.ts.map +1 -1
  176. package/dist/types/utils/runParallel.d.ts +11 -0
  177. package/dist/types/utils/runParallel.d.ts.map +1 -0
  178. package/dist/types/watcher.d.ts +12 -0
  179. package/dist/types/watcher.d.ts.map +1 -0
  180. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +9 -0
  181. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  182. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
  183. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +3 -2
  184. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
  185. package/package.json +22 -27
  186. package/dist/cjs/chokidar/index.cjs +0 -23
  187. package/dist/cjs/chokidar/index.cjs.map +0 -1
  188. package/dist/cjs/chokidar/watcher.cjs +0 -157
  189. package/dist/cjs/chokidar/watcher.cjs.map +0 -1
  190. package/dist/cjs/getBuiltDictionariesPath.cjs.map +0 -1
  191. package/dist/cjs/getBuiltDynamicDictionariesPath.cjs.map +0 -1
  192. package/dist/cjs/getBuiltFetchDictionariesPath.cjs.map +0 -1
  193. package/dist/cjs/getBuiltRemoteDictionariesPath.cjs.map +0 -1
  194. package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs.map +0 -1
  195. package/dist/cjs/reduceDictionaryContent/buildMask.cjs +0 -49
  196. package/dist/cjs/reduceDictionaryContent/buildMask.cjs.map +0 -1
  197. package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +0 -1
  198. package/dist/cjs/transpiler/dictionary_to_main/generateDictionaryListContent.cjs.map +0 -1
  199. package/dist/cjs/transpiler/dictionary_to_main/index.cjs +0 -25
  200. package/dist/cjs/transpiler/dictionary_to_main/index.cjs.map +0 -1
  201. package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +0 -1
  202. package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +0 -1
  203. package/dist/cjs/transpiler/dictionary_to_type/index.cjs.map +0 -1
  204. package/dist/cjs/transpiler/intlayer_dictionary/buildIntlayerDictionary.cjs.map +0 -1
  205. package/dist/cjs/transpiler/intlayer_dictionary/index.cjs.map +0 -1
  206. package/dist/cjs/transpiler/intlayer_dictionary/processContentDeclaration.cjs.map +0 -1
  207. package/dist/cjs/transpiler/intlayer_dictionary/writeDynamicDictionary.cjs.map +0 -1
  208. package/dist/cjs/transpiler/intlayer_dictionary/writeFetchDictionary.cjs.map +0 -1
  209. package/dist/cjs/transpiler/intlayer_dictionary/writeMergedDictionary.cjs.map +0 -1
  210. package/dist/cjs/transpiler/intlayer_dictionary/writeRemoteDictionary.cjs.map +0 -1
  211. package/dist/cjs/transpiler/intlayer_dictionary/writeUnmergedDictionary.cjs.map +0 -1
  212. package/dist/esm/chokidar/index.mjs +0 -2
  213. package/dist/esm/chokidar/index.mjs.map +0 -1
  214. package/dist/esm/chokidar/watcher.mjs +0 -135
  215. package/dist/esm/chokidar/watcher.mjs.map +0 -1
  216. package/dist/esm/getBuiltDictionariesPath.mjs.map +0 -1
  217. package/dist/esm/getBuiltDynamicDictionariesPath.mjs.map +0 -1
  218. package/dist/esm/getBuiltFetchDictionariesPath.mjs.map +0 -1
  219. package/dist/esm/getBuiltRemoteDictionariesPath.mjs.map +0 -1
  220. package/dist/esm/getBuiltUnmergedDictionariesPath.mjs.map +0 -1
  221. package/dist/esm/reduceDictionaryContent/buildMask.mjs +0 -24
  222. package/dist/esm/reduceDictionaryContent/buildMask.mjs.map +0 -1
  223. package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +0 -1
  224. package/dist/esm/transpiler/dictionary_to_main/generateDictionaryListContent.mjs.map +0 -1
  225. package/dist/esm/transpiler/dictionary_to_main/index.mjs +0 -3
  226. package/dist/esm/transpiler/dictionary_to_main/index.mjs.map +0 -1
  227. package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +0 -1
  228. package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +0 -1
  229. package/dist/esm/transpiler/dictionary_to_type/index.mjs.map +0 -1
  230. package/dist/esm/transpiler/intlayer_dictionary/buildIntlayerDictionary.mjs.map +0 -1
  231. package/dist/esm/transpiler/intlayer_dictionary/index.mjs.map +0 -1
  232. package/dist/esm/transpiler/intlayer_dictionary/processContentDeclaration.mjs.map +0 -1
  233. package/dist/esm/transpiler/intlayer_dictionary/writeDynamicDictionary.mjs.map +0 -1
  234. package/dist/esm/transpiler/intlayer_dictionary/writeFetchDictionary.mjs.map +0 -1
  235. package/dist/esm/transpiler/intlayer_dictionary/writeMergedDictionary.mjs.map +0 -1
  236. package/dist/esm/transpiler/intlayer_dictionary/writeRemoteDictionary.mjs.map +0 -1
  237. package/dist/esm/transpiler/intlayer_dictionary/writeUnmergedDictionary.mjs.map +0 -1
  238. package/dist/types/chokidar/index.d.ts +0 -2
  239. package/dist/types/chokidar/index.d.ts.map +0 -1
  240. package/dist/types/chokidar/watcher.d.ts +0 -14
  241. package/dist/types/chokidar/watcher.d.ts.map +0 -1
  242. package/dist/types/getBuiltDictionariesPath.d.ts.map +0 -1
  243. package/dist/types/getBuiltDynamicDictionariesPath.d.ts.map +0 -1
  244. package/dist/types/getBuiltFetchDictionariesPath.d.ts.map +0 -1
  245. package/dist/types/getBuiltRemoteDictionariesPath.d.ts.map +0 -1
  246. package/dist/types/getBuiltUnmergedDictionariesPath.d.ts.map +0 -1
  247. package/dist/types/reduceDictionaryContent/buildMask.d.ts +0 -5
  248. package/dist/types/reduceDictionaryContent/buildMask.d.ts.map +0 -1
  249. package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +0 -1
  250. package/dist/types/transpiler/dictionary_to_main/generateDictionaryListContent.d.ts.map +0 -1
  251. package/dist/types/transpiler/dictionary_to_main/index.d.ts +0 -3
  252. package/dist/types/transpiler/dictionary_to_main/index.d.ts.map +0 -1
  253. package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +0 -1
  254. package/dist/types/transpiler/dictionary_to_type/createType.d.ts.map +0 -1
  255. package/dist/types/transpiler/dictionary_to_type/index.d.ts.map +0 -1
  256. package/dist/types/transpiler/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +0 -1
  257. package/dist/types/transpiler/intlayer_dictionary/index.d.ts.map +0 -1
  258. package/dist/types/transpiler/intlayer_dictionary/processContentDeclaration.d.ts.map +0 -1
  259. package/dist/types/transpiler/intlayer_dictionary/writeDynamicDictionary.d.ts.map +0 -1
  260. package/dist/types/transpiler/intlayer_dictionary/writeFetchDictionary.d.ts.map +0 -1
  261. package/dist/types/transpiler/intlayer_dictionary/writeMergedDictionary.d.ts.map +0 -1
  262. package/dist/types/transpiler/intlayer_dictionary/writeRemoteDictionary.d.ts.map +0 -1
  263. package/dist/types/transpiler/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +0 -1
  264. /package/dist/cjs/{getBuiltDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltDictionariesPath.cjs} +0 -0
  265. /package/dist/cjs/{getBuiltDynamicDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs} +0 -0
  266. /package/dist/cjs/{getBuiltFetchDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs} +0 -0
  267. /package/dist/cjs/{getBuiltRemoteDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs} +0 -0
  268. /package/dist/cjs/{getBuiltUnmergedDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs} +0 -0
  269. /package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.mjs +0 -0
  270. /package/dist/esm/{getBuiltDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltDictionariesPath.mjs} +0 -0
  271. /package/dist/esm/{getBuiltDynamicDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs} +0 -0
  272. /package/dist/esm/{getBuiltFetchDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs} +0 -0
  273. /package/dist/esm/{getBuiltRemoteDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs} +0 -0
  274. /package/dist/esm/{getBuiltUnmergedDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs} +0 -0
  275. /package/dist/esm/{transpiler/dictionary_to_type → createType}/index.mjs +0 -0
  276. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.d.ts +0 -0
  277. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.d.ts +0 -0
  278. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.d.ts +0 -0
  279. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.d.ts +0 -0
  280. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.d.ts +0 -0
  281. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.d.ts +0 -0
  282. /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.d.ts +0 -0
  283. /package/dist/types/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.d.ts +0 -0
  284. /package/dist/types/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.d.ts +0 -0
  285. /package/dist/types/{getBuiltDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts} +0 -0
  286. /package/dist/types/{getBuiltDynamicDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts} +0 -0
  287. /package/dist/types/{getBuiltFetchDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts} +0 -0
  288. /package/dist/types/{getBuiltRemoteDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts} +0 -0
  289. /package/dist/types/{getBuiltUnmergedDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts} +0 -0
  290. /package/dist/types/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.d.ts +0 -0
  291. /package/dist/types/{transpiler/dictionary_to_type → createType}/createType.d.ts +0 -0
  292. /package/dist/types/{transpiler/dictionary_to_type → createType}/index.d.ts +0 -0
@@ -24,14 +24,14 @@ module.exports = __toCommonJS(createDictionaryEntryPoint_exports);
24
24
  var import_config = require("@intlayer/config");
25
25
  var import_promises = require("fs/promises");
26
26
  var import_path = require("path");
27
- var import_getBuiltDictionariesPath = require('../../getBuiltDictionariesPath.cjs');
28
- var import_getBuiltDynamicDictionariesPath = require('../../getBuiltDynamicDictionariesPath.cjs');
29
- var import_getBuiltFetchDictionariesPath = require('../../getBuiltFetchDictionariesPath.cjs');
30
- var import_getBuiltRemoteDictionariesPath = require('../../getBuiltRemoteDictionariesPath.cjs');
31
- var import_getBuiltUnmergedDictionariesPath = require('../../getBuiltUnmergedDictionariesPath.cjs');
32
- var import_parallelize = require('../../utils/parallelize.cjs');
33
- var import_writeFileIfChanged = require('../../writeFileIfChanged.cjs');
27
+ var import_parallelize = require('../utils/parallelize.cjs');
28
+ var import_writeFileIfChanged = require('../writeFileIfChanged.cjs');
34
29
  var import_generateDictionaryListContent = require('./generateDictionaryListContent.cjs');
30
+ var import_getBuiltDictionariesPath = require('./getBuiltDictionariesPath.cjs');
31
+ var import_getBuiltDynamicDictionariesPath = require('./getBuiltDynamicDictionariesPath.cjs');
32
+ var import_getBuiltFetchDictionariesPath = require('./getBuiltFetchDictionariesPath.cjs');
33
+ var import_getBuiltRemoteDictionariesPath = require('./getBuiltRemoteDictionariesPath.cjs');
34
+ var import_getBuiltUnmergedDictionariesPath = require('./getBuiltUnmergedDictionariesPath.cjs');
35
35
  const filterDictionaries = (paths, keys) => {
36
36
  if (!keys) return paths;
37
37
  return paths.filter(
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { getConfiguration } from '@intlayer/config';\nimport { mkdir } from 'fs/promises';\nimport { resolve } from 'path';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst filterDictionaries = (paths: string[], keys?: string[]) => {\n if (!keys) return paths;\n return paths.filter((path) =>\n keys.some((key) => path.endsWith(`${key}.json`))\n );\n};\n\nconst writeDictionaryFiles = async (\n paths: string[],\n fileName: string,\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n paths,\n functionName,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.content;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n dictionariesKeys?: string[],\n formats?: ('cjs' | 'esm')[]\n) => {\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.content;\n\n await mkdir(mainDir, { recursive: true });\n\n const remoteDictionariesPath = getBuiltRemoteDictionariesPath(configuration);\n const dictionariesPath = filterDictionaries(\n getBuiltDictionariesPath(configuration),\n dictionariesKeys\n );\n const unmergedDictionariesPath =\n getBuiltUnmergedDictionariesPath(configuration);\n\n const writeOperations = [\n ...outputFormats.map((format) => ({\n paths: remoteDictionariesPath,\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n })),\n ...outputFormats.map((format) => ({\n paths: dictionariesPath,\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n })),\n ...outputFormats.map((format) => ({\n paths: unmergedDictionariesPath,\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n })),\n ...outputFormats.map((format) => ({\n paths: getBuiltDynamicDictionariesPath(configuration, format),\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n })),\n ...outputFormats.map((format) => ({\n paths: getBuiltFetchDictionariesPath(configuration, format),\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n })),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName }) =>\n writeDictionaryFiles(paths, fileName, functionName, format, configuration)\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAiC;AACjC,sBAAsB;AACtB,kBAAwB;AACxB,yBAA4B;AAC5B,gCAAmC;AACnC,2CAA8C;AAC9C,sCAAyC;AACzC,6CAAgD;AAChD,2CAA8C;AAC9C,4CAA+C;AAC/C,8CAAiD;AAEjD,MAAM,qBAAqB,CAAC,OAAiB,SAAoB;AAC/D,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,MAAM;AAAA,IAAO,CAAC,SACnB,KAAK,KAAK,CAAC,QAAQ,KAAK,SAAS,GAAG,GAAG,OAAO,CAAC;AAAA,EACjD;AACF;AAEA,MAAM,uBAAuB,OAC3B,OACA,UACA,cACA,QACA,oBAAgB,gCAAiB,MAC9B;AACH,QAAM,cAAU;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACA,QAAM,YAAY,WAAW,QAAQ,QAAQ;AAE7C,QAAM,EAAE,QAAQ,IAAI,cAAc;AAElC,YAAM;AAAA,QACJ,qBAAQ,SAAS,GAAG,QAAQ,IAAI,SAAS,EAAE;AAAA,IAC3C;AAAA,EACF;AACF;AAKO,MAAM,6BAA6B,OACxC,oBAAgB,gCAAiB,GACjC,kBACA,YACG;AACH,QAAM,gBAAgB,WAAW,cAAc,MAAM;AACrD,QAAM,EAAE,QAAQ,IAAI,cAAc;AAElC,YAAM,uBAAM,SAAS,EAAE,WAAW,KAAK,CAAC;AAExC,QAAM,6BAAyB,sEAA+B,aAAa;AAC3E,QAAM,mBAAmB;AAAA,QACvB,0DAAyB,aAAa;AAAA,IACtC;AAAA,EACF;AACA,QAAM,+BACJ,0EAAiC,aAAa;AAEhD,QAAM,kBAAkB;AAAA,IACtB,GAAG,cAAc,IAAI,CAAC,YAAY;AAAA,MAChC,OAAO;AAAA,MACP,cAAc;AAAA,MACd,UAAU;AAAA,MACV;AAAA,IACF,EAAE;AAAA,IACF,GAAG,cAAc,IAAI,CAAC,YAAY;AAAA,MAChC,OAAO;AAAA,MACP,cAAc;AAAA,MACd,UAAU;AAAA,MACV;AAAA,IACF,EAAE;AAAA,IACF,GAAG,cAAc,IAAI,CAAC,YAAY;AAAA,MAChC,OAAO;AAAA,MACP,cAAc;AAAA,MACd,UAAU;AAAA,MACV;AAAA,IACF,EAAE;AAAA,IACF,GAAG,cAAc,IAAI,CAAC,YAAY;AAAA,MAChC,WAAO,wEAAgC,eAAe,MAAM;AAAA,MAC5D,cAAc;AAAA,MACd,UAAU;AAAA,MACV;AAAA,IACF,EAAE;AAAA,IACF,GAAG,cAAc,IAAI,CAAC,YAAY;AAAA,MAChC,WAAO,oEAA8B,eAAe,MAAM;AAAA,MAC1D,cAAc;AAAA,MACd,UAAU;AAAA,MACV;AAAA,IACF,EAAE;AAAA,EACJ;AAEA,YAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,OAAO,UAAU,QAAQ,aAAa,MAC7C,qBAAqB,OAAO,UAAU,cAAc,QAAQ,aAAa;AAAA,EAC7E;AACF;","names":[]}
@@ -23,7 +23,7 @@ __export(generateDictionaryListContent_exports, {
23
23
  module.exports = __toCommonJS(generateDictionaryListContent_exports);
24
24
  var import_config = require("@intlayer/config");
25
25
  var import_path = require("path");
26
- var import_getFileHash = require('../../utils/getFileHash.cjs');
26
+ var import_getFileHash = require('../utils/getFileHash.cjs');
27
27
  const generateDictionaryListContent = (dictionaries, functionName, format = "esm", configuration = (0, import_config.getConfiguration)()) => {
28
28
  const { mainDir } = configuration.content;
29
29
  let content = "";
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport { basename, extname, relative } from 'path';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.content;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}' with { type: 'json' };\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,kBAA4C;AAC5C,yBAA4B;AAKrB,MAAM,gCAAgC,CAC3C,cACA,cACA,SAAwB,OACxB,oBAAgB,gCAAiB,MACtB;AACX,QAAM,EAAE,QAAQ,IAAI,cAAc;AAElC,MAAI,UAAU;AAEd,QAAM,kBAAkB,aAAa,IAAI,CAAC,oBAAoB;AAAA,IAC5D,kBAAc,iCAAc,sBAAS,SAAS,cAAc,CAAC;AAAA,IAC7D,QAAI,sBAAS,oBAAgB,qBAAQ,cAAc,CAAC;AAAA;AAAA,IACpD,MAAM,QAAI,gCAAY,cAAc,CAAC;AAAA;AAAA,EACvC,EAAE;AAGF,kBAAgB,QAAQ,CAAC,eAAe;AACtC,QAAI,WAAW;AACb,iBAAW,UAAU,WAAW,IAAI,UAAU,WAAW,YAAY;AAAA;AACvE,QAAI,WAAW;AACb,iBAAW,SAAS,WAAW,IAAI,eAAe,WAAW,YAAY;AAAA;AAAA,EAC7E,CAAC;AAED,aAAW;AAGX,QAAM,yBAAiC,gBACpC,IAAI,CAAC,eAAe,MAAM,WAAW,EAAE,MAAM,WAAW,IAAI,EAAE,EAC9D,KAAK,KAAK;AAEb,aAAW;AAAA,EAA2B,sBAAsB;AAAA;AAAA;AAC5D,aAAW,SAAS,YAAY;AAAA;AAEhC,MAAI,WAAW,OAAO;AACpB,eAAW;AAAA;AACX,eAAW,YAAY,YAAY;AAAA;AACnC,eAAW;AAAA;AAAA,EACb;AAEA,MAAI,WAAW,OAAO;AACpB,eAAW;AAAA;AACX,eAAW,kBAAkB,YAAY,MAAM,YAAY;AAAA;AAC3D,eAAW;AAAA;AAAA,EACb;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { existsSync, mkdirSync } from 'fs';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = (\n configuration = getConfiguration()\n) => {\n const { dictionariesDir, mainDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,uBAAe;AACf,gBAAsC;AAK/B,MAAM,2BAA2B,CACtC,oBAAgB,gCAAiB,MAC9B;AACH,QAAM,EAAE,iBAAiB,QAAQ,IAAI,cAAc;AAGnD,MAAI,KAAC,sBAAW,OAAO,GAAG;AACxB,6BAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EACxC;AAEA,QAAM,mBAA6B,iBAAAA,QAAG;AAAA,IACpC,OAAG,6BAAc,eAAe,CAAC;AAAA,EACnC;AAEA,SAAO;AACT;","names":["fg"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { existsSync, mkdirSync } from 'fs';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = (\n configuration = getConfiguration(),\n format: 'cjs' | 'esm' = 'esm'\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,uBAAe;AACf,gBAAsC;AAK/B,MAAM,kCAAkC,CAC7C,oBAAgB,gCAAiB,GACjC,SAAwB,UACrB;AACH,QAAM,EAAE,wBAAwB,QAAQ,IAAI,cAAc;AAG1D,MAAI,KAAC,sBAAW,OAAO,GAAG;AACxB,6BAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EACxC;AAEA,QAAM,YAAY,WAAW,QAAQ,QAAQ;AAE7C,QAAM,mBAA6B,iBAAAA,QAAG;AAAA,IACpC,OAAG,6BAAc,sBAAsB,CAAC,SAAS,SAAS;AAAA,EAC5D;AAEA,SAAO;AACT;","names":["fg"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { existsSync, mkdirSync } from 'fs';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = (\n configuration = getConfiguration(),\n format: 'cjs' | 'esm' = 'esm'\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(fetchDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,uBAAe;AACf,gBAAsC;AAK/B,MAAM,gCAAgC,CAC3C,oBAAgB,gCAAiB,GACjC,SAAwB,UACrB;AACH,QAAM,EAAE,sBAAsB,QAAQ,IAAI,cAAc;AAGxD,MAAI,KAAC,sBAAW,OAAO,GAAG;AACxB,6BAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EACxC;AAEA,QAAM,YAAY,WAAW,QAAQ,QAAQ;AAE7C,QAAM,mBAA6B,iBAAAA,QAAG;AAAA,IACpC,OAAG,6BAAc,oBAAoB,CAAC,SAAS,SAAS;AAAA,EAC1D;AAEA,SAAO;AACT;","names":["fg"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { existsSync, mkdirSync } from 'fs';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = (\n configuration = getConfiguration()\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,uBAAe;AACf,gBAAsC;AAK/B,MAAM,iCAAiC,CAC5C,oBAAgB,gCAAiB,MAC9B;AACH,QAAM,EAAE,uBAAuB,QAAQ,IAAI,cAAc;AAGzD,MAAI,KAAC,sBAAW,OAAO,GAAG;AACxB,6BAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EACxC;AAEA,QAAM,mBAA6B,iBAAAA,QAAG;AAAA,IACpC,OAAG,6BAAc,qBAAqB,CAAC;AAAA,EACzC;AAEA,SAAO;AACT;","names":["fg"]}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { existsSync, mkdirSync } from 'fs';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = (\n configuration = getConfiguration()\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAgD;AAChD,uBAAe;AACf,gBAAsC;AAK/B,MAAM,mCAAmC,CAC9C,oBAAgB,gCAAiB,MAC9B;AACH,QAAM,EAAE,yBAAyB,QAAQ,IAAI,cAAc;AAG3D,MAAI,KAAC,sBAAW,OAAO,GAAG;AACxB,6BAAU,SAAS,EAAE,WAAW,KAAK,CAAC;AAAA,EACxC;AAEA,QAAM,mBAA6B,iBAAAA,QAAG;AAAA,IACpC,OAAG,6BAAc,uBAAuB,CAAC;AAAA,EAC3C;AAEA,SAAO;AACT;","names":["fg"]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var createDictionaryEntryPoint_exports = {};
17
+ module.exports = __toCommonJS(createDictionaryEntryPoint_exports);
18
+ __reExport(createDictionaryEntryPoint_exports, require('./createDictionaryEntryPoint.cjs'), module.exports);
19
+ __reExport(createDictionaryEntryPoint_exports, require('./generateDictionaryListContent.cjs'), module.exports);
20
+ __reExport(createDictionaryEntryPoint_exports, require('./getBuiltDictionariesPath.cjs'), module.exports);
21
+ __reExport(createDictionaryEntryPoint_exports, require('./getBuiltDynamicDictionariesPath.cjs'), module.exports);
22
+ __reExport(createDictionaryEntryPoint_exports, require('./getBuiltFetchDictionariesPath.cjs'), module.exports);
23
+ __reExport(createDictionaryEntryPoint_exports, require('./getBuiltRemoteDictionariesPath.cjs'), module.exports);
24
+ __reExport(createDictionaryEntryPoint_exports, require('./getBuiltUnmergedDictionariesPath.cjs'), module.exports);
25
+ // Annotate the CommonJS export names for ESM import in node:
26
+ 0 && (module.exports = {
27
+ ...require('./createDictionaryEntryPoint.cjs'),
28
+ ...require('./generateDictionaryListContent.cjs'),
29
+ ...require('./getBuiltDictionariesPath.cjs'),
30
+ ...require('./getBuiltDynamicDictionariesPath.cjs'),
31
+ ...require('./getBuiltFetchDictionariesPath.cjs'),
32
+ ...require('./getBuiltRemoteDictionariesPath.cjs'),
33
+ ...require('./getBuiltUnmergedDictionariesPath.cjs')
34
+ });
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createDictionaryEntryPoint/index.ts"],"sourcesContent":["export * from './createDictionaryEntryPoint';\nexport * from './generateDictionaryListContent';\nexport * from './getBuiltDictionariesPath';\nexport * from './getBuiltDynamicDictionariesPath';\nexport * from './getBuiltFetchDictionariesPath';\nexport * from './getBuiltRemoteDictionariesPath';\nexport * from './getBuiltUnmergedDictionariesPath';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+CAAc,yCAAd;AACA,+CAAc,4CADd;AAEA,+CAAc,uCAFd;AAGA,+CAAc,8CAHd;AAIA,+CAAc,4CAJd;AAKA,+CAAc,6CALd;AAMA,+CAAc,+CANd;","names":[]}
@@ -36,9 +36,9 @@ var import_config = require("@intlayer/config");
36
36
  var import_fast_glob = __toESM(require("fast-glob"));
37
37
  var import_promises = require("fs/promises");
38
38
  var import_path = require("path");
39
- var import_getFileHash = require('../../utils/getFileHash.cjs');
40
- var import_kebabCaseToCamelCase = require('../../utils/kebabCaseToCamelCase.cjs');
41
- var import_writeFileIfChanged = require('../../writeFileIfChanged.cjs');
39
+ var import_getFileHash = require('../utils/getFileHash.cjs');
40
+ var import_kebabCaseToCamelCase = require('../utils/kebabCaseToCamelCase.cjs');
41
+ var import_writeFileIfChanged = require('../writeFileIfChanged.cjs');
42
42
  const getTypeName = (key) => `${(0, import_kebabCaseToCamelCase.kebabCaseToCamelCase)(key)}Content`;
43
43
  const formatLocales = (locales) => locales.map((locale) => {
44
44
  for (const key in import_config.Locales) {
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createType/createModuleAugmentation.ts"],"sourcesContent":["import { Locales, getConfiguration, normalizePath } from '@intlayer/config';\nimport fg from 'fast-glob';\nimport { mkdir } from 'fs/promises';\nimport { basename, extname, join, relative } from 'path';\nimport { getFileHash } from '../utils/getFileHash';\nimport { kebabCaseToCamelCase } from '../utils/kebabCaseToCamelCase';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\n\nexport const getTypeName = (key: string): string =>\n `${kebabCaseToCamelCase(key)}Content`;\n\nconst formatLocales = (locales: Locales[]): string =>\n locales\n .map((locale) => {\n for (const key in Locales) {\n if (Locales[key as keyof typeof Locales] === locale) {\n return `Locales.${key}`;\n }\n }\n })\n .join(' | ');\n\n/**\n * This function generates the content of the module augmentation file\n */\nconst generateTypeIndexContent = (\n typeFiles: string[],\n configuration = getConfiguration()\n): string => {\n const { content, internationalization } = configuration;\n const { moduleAugmentationDir } = content;\n const { locales, requiredLocales, strictMode } = internationalization;\n\n let fileContent =\n \"/* eslint-disable */\\nimport { Locales } from 'intlayer';\\n\";\n\n const dictionariesRef = typeFiles.map((dictionaryPath) => ({\n relativePath: `./${relative(moduleAugmentationDir, dictionaryPath)}`,\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id (without the extension)\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\\n`;\n });\n\n fileContent += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": typeof ${dictionary.hash};`)\n .join('\\n');\n\n const requiredLocalesValues =\n requiredLocales.length > 0\n ? requiredLocales.filter((locale) =>\n locales.map((locale) => String(locale)).includes(String(locale))\n )\n : locales;\n\n const formattedLocales = formatLocales(locales);\n const formattedRequiredLocales = formatLocales(requiredLocalesValues);\n\n const strictModeRecord =\n strictMode === 'strict'\n ? `interface IConfigLocales<Content> extends Record<DeclaredLocales, Content> {}`\n : strictMode === 'inclusive'\n ? `interface IConfigLocales<Content> extends Record<ExtractedLocales, Content>, Partial<Record<ExcludedLocales, Content>> {}`\n : `interface IConfigLocales<Content> extends Partial<Record<Locales, Content>> {}`;\n\n /**\n * Write the module augmentation to extend the intlayer module with the dictionaries types\n * Will suggest the type resulting of the dictionaries\n *\n * declare module 'intlayer' {\n * interface IntlayerDictionaryTypesConnector = {\n * dictionaries: {\n * id: DictionaryType;\n * }\n * }\n *\n * type ConfigLocales = Locales.ENGLISH | Locales.FRENCH | Locales.SPANISH;\n * type ExtractedLocales = Extract<Locales, ConfigLocales>;\n *\n * interface IConfigLocales<Content> extends Record<ExtractedLocales, Content>, Partial<Record<ExcludedLocales, Content>> {}\n *\n *\n * }\n * See https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation\n */\n fileContent += `declare module 'intlayer' {\\n`;\n fileContent += ` interface IntlayerDictionaryTypesConnector {\\n${formattedDictionaryMap}\\n }\\n\\n`;\n fileContent += ` type DeclaredLocales = ${formattedLocales};\\n`;\n fileContent += ` type RequiredLocales = ${formattedRequiredLocales};\\n`;\n fileContent += ` type ExtractedLocales = Extract<Locales, RequiredLocales>;\\n`;\n fileContent += ` type ExcludedLocales = Exclude<Locales, RequiredLocales>;\\n`;\n fileContent += ` ${strictModeRecord}\\n`;\n fileContent += `}`;\n\n return fileContent;\n};\n\n/**\n * This function generates a index file merging all the types\n */\nexport const createModuleAugmentation = async (\n configuration = getConfiguration()\n) => {\n const { moduleAugmentationDir, typesDir } = configuration.content;\n\n // Create main directory if it doesn't exist\n await mkdir(moduleAugmentationDir, { recursive: true });\n\n const dictionariesTypesDefinitions: string[] = fg.sync(\n normalizePath(`${typesDir}/*.ts`),\n {\n ignore: ['**/*.d.ts'],\n }\n );\n\n // Create the dictionary list file\n const tsContent = generateTypeIndexContent(dictionariesTypesDefinitions);\n\n const tsFilePath = join(moduleAugmentationDir, 'intlayer.d.ts');\n\n await writeFileIfChanged(tsFilePath, tsContent);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAyD;AACzD,uBAAe;AACf,sBAAsB;AACtB,kBAAkD;AAClD,yBAA4B;AAC5B,kCAAqC;AACrC,gCAAmC;AAE5B,MAAM,cAAc,CAAC,QAC1B,OAAG,kDAAqB,GAAG,CAAC;AAE9B,MAAM,gBAAgB,CAAC,YACrB,QACG,IAAI,CAAC,WAAW;AACf,aAAW,OAAO,uBAAS;AACzB,QAAI,sBAAQ,GAA2B,MAAM,QAAQ;AACnD,aAAO,WAAW,GAAG;AAAA,IACvB;AAAA,EACF;AACF,CAAC,EACA,KAAK,KAAK;AAKf,MAAM,2BAA2B,CAC/B,WACA,oBAAgB,gCAAiB,MACtB;AACX,QAAM,EAAE,SAAS,qBAAqB,IAAI;AAC1C,QAAM,EAAE,sBAAsB,IAAI;AAClC,QAAM,EAAE,SAAS,iBAAiB,WAAW,IAAI;AAEjD,MAAI,cACF;AAEF,QAAM,kBAAkB,UAAU,IAAI,CAAC,oBAAoB;AAAA,IACzD,cAAc,SAAK,sBAAS,uBAAuB,cAAc,CAAC;AAAA,IAClE,QAAI,sBAAS,oBAAgB,qBAAQ,cAAc,CAAC;AAAA;AAAA,IACpD,MAAM,QAAI,gCAAY,cAAc,CAAC;AAAA;AAAA,EACvC,EAAE;AAGF,kBAAgB,QAAQ,CAAC,eAAe;AACtC,mBAAe,UAAU,WAAW,IAAI,UAAU,WAAW,YAAY;AAAA;AAAA,EAC3E,CAAC;AAED,iBAAe;AAGf,QAAM,yBAAiC,gBACpC,IAAI,CAAC,eAAe,QAAQ,WAAW,EAAE,aAAa,WAAW,IAAI,GAAG,EACxE,KAAK,IAAI;AAEZ,QAAM,wBACJ,gBAAgB,SAAS,IACrB,gBAAgB;AAAA,IAAO,CAAC,WACtB,QAAQ,IAAI,CAACA,YAAW,OAAOA,OAAM,CAAC,EAAE,SAAS,OAAO,MAAM,CAAC;AAAA,EACjE,IACA;AAEN,QAAM,mBAAmB,cAAc,OAAO;AAC9C,QAAM,2BAA2B,cAAc,qBAAqB;AAEpE,QAAM,mBACJ,eAAe,WACX,kFACA,eAAe,cACb,8HACA;AAsBR,iBAAe;AAAA;AACf,iBAAe;AAAA,EAAmD,sBAAsB;AAAA;AAAA;AAAA;AACxF,iBAAe,4BAA4B,gBAAgB;AAAA;AAC3D,iBAAe,4BAA4B,wBAAwB;AAAA;AACnE,iBAAe;AAAA;AACf,iBAAe;AAAA;AACf,iBAAe,KAAK,gBAAgB;AAAA;AACpC,iBAAe;AAEf,SAAO;AACT;AAKO,MAAM,2BAA2B,OACtC,oBAAgB,gCAAiB,MAC9B;AACH,QAAM,EAAE,uBAAuB,SAAS,IAAI,cAAc;AAG1D,YAAM,uBAAM,uBAAuB,EAAE,WAAW,KAAK,CAAC;AAEtD,QAAM,+BAAyC,iBAAAC,QAAG;AAAA,QAChD,6BAAc,GAAG,QAAQ,OAAO;AAAA,IAChC;AAAA,MACE,QAAQ,CAAC,WAAW;AAAA,IACtB;AAAA,EACF;AAGA,QAAM,YAAY,yBAAyB,4BAA4B;AAEvE,QAAM,iBAAa,kBAAK,uBAAuB,eAAe;AAE9D,YAAM,8CAAmB,YAAY,SAAS;AAChD;","names":["locale","fg"]}
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(createType_exports);
25
25
  var import_config = require("@intlayer/config");
26
26
  var import_promises = require("fs/promises");
27
27
  var import_path = require("path");
28
- var import_parallelize = require('../../utils/parallelize.cjs');
28
+ var import_parallelize = require('../utils/parallelize.cjs');
29
29
  const requireUncached = (module2) => {
30
30
  delete import_config.ESMxCJSRequire.cache[import_config.ESMxCJSRequire.resolve(module2)];
31
31
  return (0, import_config.ESMxCJSRequire)(module2);
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import {\n ESMxCJSRequire,\n getConfiguration,\n IntlayerConfig,\n} from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { mkdir, writeFile } from 'fs/promises';\nimport { resolve } from 'path';\nimport { parallelize } from '../utils/parallelize';\n\nconst requireUncached = (module: string) => {\n delete ESMxCJSRequire.cache[ESMxCJSRequire.resolve(module)];\n return ESMxCJSRequire(module);\n};\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 dictionariesPaths: string[],\n configuration: IntlayerConfig = getConfiguration()\n): Promise<string[]> => {\n const { typesDir } = configuration.content;\n\n // Create type folders if they don't exist\n await mkdir(typesDir, { recursive: true });\n\n const results = await parallelize(\n dictionariesPaths,\n async (dictionaryPath): Promise<string | undefined> => {\n const dictionary: Dictionary = requireUncached(dictionaryPath);\n\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":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAIO;AAEP,sBAAiC;AACjC,kBAAwB;AACxB,yBAA4B;AAE5B,MAAM,kBAAkB,CAACA,YAAmB;AAC1C,SAAO,6BAAe,MAAM,6BAAe,QAAQA,OAAM,CAAC;AAC1D,aAAO,8BAAeA,OAAM;AAC9B;AAEO,MAAM,yBAAyB,CAAC,eAA2B;AAChE,QAAM,aAAa,KAAK,UAAU,YAAY,MAAM,CAAC;AAErD,SAAO;AAAA,iBAAwC,UAAU;AAAA;AAC3D;AAIO,MAAM,cAAc,OACzB,mBACA,oBAAgC,gCAAiB,MAC3B;AACtB,QAAM,EAAE,SAAS,IAAI,cAAc;AAGnC,YAAM,uBAAM,UAAU,EAAE,WAAW,KAAK,CAAC;AAEzC,QAAM,UAAU,UAAM;AAAA,IACpB;AAAA,IACA,OAAO,mBAAgD;AACrD,YAAM,aAAyB,gBAAgB,cAAc;AAE7D,UAAI,CAAC,WAAW,KAAK;AACnB,eAAO;AAAA,MACT;AAEA,YAAM,iBAAyB,uBAAuB,UAAU;AAEhE,YAAM,iBAAqB,qBAAQ,UAAU,GAAG,WAAW,GAAG,KAAK;AAEnE,gBAAM,2BAAU,YAAY,cAAc;AAE1C,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,QAAQ,OAAO,OAAO;AAC/B;","names":["module"]}
@@ -13,10 +13,10 @@ var __copyProps = (to, from, except, desc) => {
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var dictionary_to_type_exports = {};
17
- module.exports = __toCommonJS(dictionary_to_type_exports);
18
- __reExport(dictionary_to_type_exports, require('./createModuleAugmentation.cjs'), module.exports);
19
- __reExport(dictionary_to_type_exports, require('./createType.cjs'), module.exports);
16
+ var createType_exports = {};
17
+ module.exports = __toCommonJS(createType_exports);
18
+ __reExport(createType_exports, require('./createModuleAugmentation.cjs'), module.exports);
19
+ __reExport(createType_exports, require('./createType.cjs'), module.exports);
20
20
  // Annotate the CommonJS export names for ESM import in node:
21
21
  0 && (module.exports = {
22
22
  ...require('./createModuleAugmentation.cjs'),
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/createType/index.ts"],"sourcesContent":["export * from './createModuleAugmentation';\nexport * from './createType';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,uCAAd;AACA,+BAAc,yBADd;","names":[]}
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,54 +15,48 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var filterInvalidDictionaries_exports = {};
30
20
  __export(filterInvalidDictionaries_exports, {
31
- filterInvalidDictionaries: () => filterInvalidDictionaries
21
+ filterInvalidDictionaries: () => filterInvalidDictionaries,
22
+ isInvalidDictionary: () => isInvalidDictionary
32
23
  });
33
24
  module.exports = __toCommonJS(filterInvalidDictionaries_exports);
34
- var import_built = __toESM(require("@intlayer/config/built"));
35
25
  var import_client = require("@intlayer/config/client");
36
26
  var import_formatter = require('./utils/formatter.cjs');
37
- const filterInvalidDictionaries = (dictionaries) => {
38
- const appLogger = (0, import_client.getAppLogger)(import_built.default);
39
- return (dictionaries ?? [])?.filter((dictionary) => {
40
- if (!dictionary) return false;
41
- const isLocal = Boolean(dictionary.location === "locale");
42
- const location = isLocal ? "Local" : "Remote";
43
- const hasKey = Boolean(dictionary.key);
44
- const hasContent = Boolean(dictionary.content);
45
- if (!hasKey) {
46
- appLogger(`${location} dictionary has no key`, {
47
- level: "error"
48
- });
49
- appLogger(JSON.stringify(dictionary, null, 2), {
27
+ const isInvalidDictionary = (dictionary, configuration) => {
28
+ const appLogger = (0, import_client.getAppLogger)(configuration);
29
+ if (!dictionary) return false;
30
+ const isLocal = Boolean(dictionary.location === "locale");
31
+ const location = isLocal ? "Local" : "Remote";
32
+ const hasKey = Boolean(dictionary.key);
33
+ const hasContent = Boolean(dictionary.content);
34
+ if (!hasKey) {
35
+ appLogger(`${location} dictionary has no key`, {
36
+ level: "error"
37
+ });
38
+ appLogger(JSON.stringify(dictionary, null, 2), {
39
+ level: "error"
40
+ });
41
+ return false;
42
+ }
43
+ if (!hasContent) {
44
+ appLogger(
45
+ `${location} dictionary ${(0, import_client.colorizeKey)(dictionary.key)} has no content - ${dictionary.filePath ? (0, import_formatter.formatPath)(dictionary.filePath) : (0, import_client.colorizePath)("Remote")}`,
46
+ {
50
47
  level: "error"
51
- });
52
- return false;
53
- }
54
- if (!hasContent) {
55
- appLogger(
56
- `${location} dictionary ${(0, import_client.colorizeKey)(dictionary.key)} has no content - ${dictionary.filePath ? (0, import_formatter.formatPath)(dictionary.filePath) : (0, import_client.colorizePath)("Remote")}`,
57
- {
58
- level: "error"
59
- }
60
- );
61
- return false;
62
- }
63
- return true;
64
- });
48
+ }
49
+ );
50
+ return false;
51
+ }
52
+ return true;
65
53
  };
54
+ const filterInvalidDictionaries = (dictionaries, configuration) => (dictionaries ?? [])?.filter(
55
+ (dictionary) => isInvalidDictionary(dictionary, configuration)
56
+ );
66
57
  // Annotate the CommonJS export names for ESM import in node:
67
58
  0 && (module.exports = {
68
- filterInvalidDictionaries
59
+ filterInvalidDictionaries,
60
+ isInvalidDictionary
69
61
  });
70
62
  //# sourceMappingURL=filterInvalidDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {\n colorizeKey,\n colorizePath,\n getAppLogger,\n} from '@intlayer/config/client';\nimport type { Dictionary } from '@intlayer/core';\nimport { formatPath } from './utils/formatter';\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined\n): Dictionary[] => {\n const appLogger = getAppLogger(configuration);\n\n return (dictionaries ?? [])?.filter((dictionary) => {\n if (!dictionary) return false;\n\n const isLocal = Boolean(dictionary.location === 'locale');\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 appLogger(JSON.stringify(dictionary, null, 2), {\n level: 'error',\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 return true;\n }) as Dictionary[];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B;AAC1B,oBAIO;AAEP,uBAA2B;AAEpB,MAAM,4BAA4B,CACvC,iBACiB;AACjB,QAAM,gBAAY,4BAAa,aAAAA,OAAa;AAE5C,UAAQ,gBAAgB,CAAC,IAAI,OAAO,CAAC,eAAe;AAClD,QAAI,CAAC,WAAY,QAAO;AAExB,UAAM,UAAU,QAAQ,WAAW,aAAa,QAAQ;AACxD,UAAM,WAAW,UAAU,UAAU;AACrC,UAAM,SAAS,QAAQ,WAAW,GAAG;AACrC,UAAM,aAAa,QAAQ,WAAW,OAAO;AAE7C,QAAI,CAAC,QAAQ;AACX,gBAAU,GAAG,QAAQ,0BAA0B;AAAA,QAC7C,OAAO;AAAA,MACT,CAAC;AACD,gBAAU,KAAK,UAAU,YAAY,MAAM,CAAC,GAAG;AAAA,QAC7C,OAAO;AAAA,MACT,CAAC;AACD,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,YAAY;AACf;AAAA,QACE,GAAG,QAAQ,mBAAe,2BAAY,WAAW,GAAG,CAAC,qBAAqB,WAAW,eAAW,6BAAW,WAAW,QAAQ,QAAI,4BAAa,QAAQ,CAAC;AAAA,QACxJ;AAAA,UACE,OAAO;AAAA,QACT;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,WAAO;AAAA,EACT,CAAC;AACH;","names":["configuration"]}
1
+ {"version":3,"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import { type IntlayerConfig } from '@intlayer/config';\nimport {\n colorizeKey,\n colorizePath,\n getAppLogger,\n} from '@intlayer/config/client';\nimport type { Dictionary } from '@intlayer/core';\nimport { formatPath } from './utils/formatter';\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(dictionary.location === 'locale');\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 appLogger(JSON.stringify(dictionary, null, 2), {\n level: 'error',\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 return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration?: IntlayerConfig\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration)\n ) as Dictionary[];\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAIO;AAEP,uBAA2B;AAEpB,MAAM,sBAAsB,CACjC,YACA,kBACY;AACZ,QAAM,gBAAY,4BAAa,aAAa;AAE5C,MAAI,CAAC,WAAY,QAAO;AAExB,QAAM,UAAU,QAAQ,WAAW,aAAa,QAAQ;AACxD,QAAM,WAAW,UAAU,UAAU;AACrC,QAAM,SAAS,QAAQ,WAAW,GAAG;AACrC,QAAM,aAAa,QAAQ,WAAW,OAAO;AAE7C,MAAI,CAAC,QAAQ;AACX,cAAU,GAAG,QAAQ,0BAA0B;AAAA,MAC7C,OAAO;AAAA,IACT,CAAC;AACD,cAAU,KAAK,UAAU,YAAY,MAAM,CAAC,GAAG;AAAA,MAC7C,OAAO;AAAA,IACT,CAAC;AACD,WAAO;AAAA,EACT;AAEA,MAAI,CAAC,YAAY;AACf;AAAA,MACE,GAAG,QAAQ,mBAAe,2BAAY,WAAW,GAAG,CAAC,qBAAqB,WAAW,eAAW,6BAAW,WAAW,QAAQ,QAAI,4BAAa,QAAQ,CAAC;AAAA,MACxJ;AAAA,QACE,OAAO;AAAA,MACT;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAEO,MAAM,4BAA4B,CACvC,cACA,mBAEC,gBAAgB,CAAC,IAAI;AAAA,EAAO,CAAC,eAC5B,oBAAoB,YAAY,aAAa;AAC/C;","names":[]}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var handleAdditionalContentDeclarationFile_exports = {};
20
+ __export(handleAdditionalContentDeclarationFile_exports, {
21
+ handleAdditionalContentDeclarationFile: () => handleAdditionalContentDeclarationFile
22
+ });
23
+ module.exports = __toCommonJS(handleAdditionalContentDeclarationFile_exports);
24
+ var import_config = require("@intlayer/config");
25
+ var import_buildIntlayerDictionary = require('./buildIntlayerDictionary/buildIntlayerDictionary.cjs');
26
+ var import_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
27
+ var import_createType = require('./createType/index.cjs');
28
+ var import_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
29
+ var import_formatter = require('./utils/formatter.cjs');
30
+ const handleAdditionalContentDeclarationFile = async (filePath, config) => {
31
+ const appLogger = (0, import_config.getAppLogger)(config);
32
+ appLogger(`Additional file detected: ${(0, import_formatter.formatPath)(filePath)}`, {
33
+ isVerbose: true
34
+ });
35
+ const localeDictionaries = await (0, import_loadLocalDictionaries.loadLocalDictionaries)(filePath, config);
36
+ const dictionariesOutput = await (0, import_buildIntlayerDictionary.buildDictionary)(localeDictionaries, config);
37
+ const dictionariesPaths = Object.values(
38
+ dictionariesOutput?.mergedDictionaries ?? {}
39
+ ).map((dictionary) => dictionary.dictionaryPath);
40
+ await (0, import_createType.createTypes)(dictionariesPaths);
41
+ await (0, import_createDictionaryEntryPoint.createDictionaryEntryPoint)(config);
42
+ appLogger("Dictionaries built", {
43
+ isVerbose: true
44
+ });
45
+ (0, import_createType.createModuleAugmentation)(config);
46
+ appLogger("Module augmentation built", {
47
+ isVerbose: true
48
+ });
49
+ };
50
+ // Annotate the CommonJS export names for ESM import in node:
51
+ 0 && (module.exports = {
52
+ handleAdditionalContentDeclarationFile
53
+ });
54
+ //# sourceMappingURL=handleAdditionalContentDeclarationFile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { type IntlayerConfig, getAppLogger } from '@intlayer/config';\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 dictionariesPaths = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionaryPath);\n\n await createTypes(dictionariesPaths);\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"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkD;AAClD,qCAAgC;AAChC,wCAA2C;AAC3C,wBAAsD;AACtD,mCAAsC;AACtC,uBAA2B;AAEpB,MAAM,yCAAyC,OACpD,UACA,WACG;AACH,QAAM,gBAAY,4BAAa,MAAM;AAGrC,YAAU,iCAA6B,6BAAW,QAAQ,CAAC,IAAI;AAAA,IAC7D,WAAW;AAAA,EACb,CAAC;AAED,QAAM,qBAAqB,UAAM,oDAAsB,UAAU,MAAM;AAEvE,QAAM,qBAAqB,UAAM,gDAAgB,oBAAoB,MAAM;AAE3E,QAAM,oBAAoB,OAAO;AAAA,IAC/B,oBAAoB,sBAAsB,CAAC;AAAA,EAC7C,EAAE,IAAI,CAAC,eAAe,WAAW,cAAc;AAE/C,YAAM,+BAAY,iBAAiB;AAEnC,YAAM,8DAA2B,MAAM;AAEvC,YAAU,sBAAsB;AAAA,IAC9B,WAAW;AAAA,EACb,CAAC;AAED,kDAAyB,MAAM;AAE/B,YAAU,6BAA6B;AAAA,IACrC,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var handleContentDeclarationFileChange_exports = {};
20
+ __export(handleContentDeclarationFileChange_exports, {
21
+ handleContentDeclarationFileChange: () => handleContentDeclarationFileChange
22
+ });
23
+ module.exports = __toCommonJS(handleContentDeclarationFileChange_exports);
24
+ var import_config = require("@intlayer/config");
25
+ var import_buildIntlayerDictionary = require('./buildIntlayerDictionary/buildIntlayerDictionary.cjs');
26
+ var import_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
27
+ var import_getBuiltDictionariesPath = require('./createDictionaryEntryPoint/getBuiltDictionariesPath.cjs');
28
+ var import_createType = require('./createType/index.cjs');
29
+ var import_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
30
+ var import_formatter = require('./utils/formatter.cjs');
31
+ const handleContentDeclarationFileChange = async (filePath, config) => {
32
+ const appLogger = (0, import_config.getAppLogger)(config);
33
+ appLogger(`Change detected: ${(0, import_formatter.formatPath)(filePath)}`, {
34
+ isVerbose: true
35
+ });
36
+ const localeDictionaries = await (0, import_loadLocalDictionaries.loadLocalDictionaries)(filePath, config);
37
+ const dictionariesOutput = await (0, import_buildIntlayerDictionary.buildDictionary)(localeDictionaries, config);
38
+ const updatedDictionariesPaths = Object.values(
39
+ dictionariesOutput?.mergedDictionaries ?? {}
40
+ ).map((dictionary) => dictionary.dictionaryPath);
41
+ const allDictionariesPaths = (0, import_getBuiltDictionariesPath.getBuiltDictionariesPath)(config);
42
+ (0, import_createType.createTypes)(updatedDictionariesPaths);
43
+ appLogger("TypeScript types built", {
44
+ isVerbose: true
45
+ });
46
+ if (updatedDictionariesPaths.some(
47
+ (updatedDictionaryPath) => !allDictionariesPaths.includes(updatedDictionaryPath)
48
+ )) {
49
+ await (0, import_createDictionaryEntryPoint.createDictionaryEntryPoint)(config);
50
+ appLogger("Dictionary list built", {
51
+ isVerbose: true
52
+ });
53
+ }
54
+ };
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ handleContentDeclarationFileChange
58
+ });
59
+ //# sourceMappingURL=handleContentDeclarationFileChange.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { type IntlayerConfig, getAppLogger } from '@intlayer/config';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { getBuiltDictionariesPath } from './createDictionaryEntryPoint/getBuiltDictionariesPath';\nimport { createTypes } from './createType';\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 localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n const updatedDictionariesPaths = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionaryPath);\n\n const allDictionariesPaths: string[] = getBuiltDictionariesPath(config);\n\n createTypes(updatedDictionariesPaths);\n appLogger('TypeScript types built', {\n isVerbose: true,\n });\n\n if (\n updatedDictionariesPaths.some(\n (updatedDictionaryPath) =>\n !allDictionariesPaths.includes(updatedDictionaryPath)\n )\n ) {\n await createDictionaryEntryPoint(config);\n\n appLogger('Dictionary list built', {\n isVerbose: true,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkD;AAClD,qCAAgC;AAChC,wCAA2C;AAC3C,sCAAyC;AACzC,wBAA4B;AAC5B,mCAAsC;AACtC,uBAA2B;AAEpB,MAAM,qCAAqC,OAChD,UACA,WACG;AACH,QAAM,gBAAY,4BAAa,MAAM;AAGrC,YAAU,wBAAoB,6BAAW,QAAQ,CAAC,IAAI;AAAA,IACpD,WAAW;AAAA,EACb,CAAC;AAED,QAAM,qBAAqB,UAAM,oDAAsB,UAAU,MAAM;AAEvE,QAAM,qBAAqB,UAAM,gDAAgB,oBAAoB,MAAM;AAC3E,QAAM,2BAA2B,OAAO;AAAA,IACtC,oBAAoB,sBAAsB,CAAC;AAAA,EAC7C,EAAE,IAAI,CAAC,eAAe,WAAW,cAAc;AAE/C,QAAM,2BAAiC,0DAAyB,MAAM;AAEtE,qCAAY,wBAAwB;AACpC,YAAU,0BAA0B;AAAA,IAClC,WAAW;AAAA,EACb,CAAC;AAED,MACE,yBAAyB;AAAA,IACvB,CAAC,0BACC,CAAC,qBAAqB,SAAS,qBAAqB;AAAA,EACxD,GACA;AACA,cAAM,8DAA2B,MAAM;AAEvC,cAAU,yBAAyB;AAAA,MACjC,WAAW;AAAA,IACb,CAAC;AAAA,EACH;AACF;","names":[]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var handleUnlikedContentDeclarationFile_exports = {};
20
+ __export(handleUnlikedContentDeclarationFile_exports, {
21
+ handleUnlikedContentDeclarationFile: () => handleUnlikedContentDeclarationFile
22
+ });
23
+ module.exports = __toCommonJS(handleUnlikedContentDeclarationFile_exports);
24
+ var import_config = require("@intlayer/config");
25
+ var import_buildIntlayerDictionary = require('./buildIntlayerDictionary/buildIntlayerDictionary.cjs');
26
+ var import_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
27
+ var import_createType = require('./createType/index.cjs');
28
+ var import_createModuleAugmentation = require('./createType/createModuleAugmentation.cjs');
29
+ var import_listDictionariesPath = require('./listDictionariesPath.cjs');
30
+ var import_loadLocalDictionaries = require('./loadDictionaries/loadLocalDictionaries.cjs');
31
+ var import_formatter = require('./utils/formatter.cjs');
32
+ const handleUnlikedContentDeclarationFile = async (filePath, config) => {
33
+ const appLogger = (0, import_config.getAppLogger)(config);
34
+ appLogger(`Unlinked detected: ${(0, import_formatter.formatPath)(filePath)}`, {
35
+ isVerbose: true
36
+ });
37
+ const files = (0, import_listDictionariesPath.listDictionaries)(config);
38
+ const localeDictionaries = await (0, import_loadLocalDictionaries.loadLocalDictionaries)(files, config);
39
+ const dictionariesOutput = await (0, import_buildIntlayerDictionary.buildDictionary)(localeDictionaries, config);
40
+ const dictionariesPaths = Object.values(
41
+ dictionariesOutput?.mergedDictionaries ?? {}
42
+ ).map((dictionary) => dictionary.dictionaryPath);
43
+ await (0, import_createType.createTypes)(dictionariesPaths);
44
+ await (0, import_createDictionaryEntryPoint.createDictionaryEntryPoint)();
45
+ appLogger("Dictionaries rebuilt", {
46
+ isVerbose: true
47
+ });
48
+ await (0, import_createModuleAugmentation.createModuleAugmentation)();
49
+ appLogger("Module augmentation built", {
50
+ isVerbose: true
51
+ });
52
+ };
53
+ // Annotate the CommonJS export names for ESM import in node:
54
+ 0 && (module.exports = {
55
+ handleUnlikedContentDeclarationFile
56
+ });
57
+ //# sourceMappingURL=handleUnlikedContentDeclarationFile.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/handleUnlikedContentDeclarationFile.ts"],"sourcesContent":["import { type IntlayerConfig, getAppLogger } from '@intlayer/config';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { listDictionaries } from './listDictionariesPath';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleUnlikedContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Unlinked detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const files: string[] = listDictionaries(config);\n\n const localeDictionaries = await loadLocalDictionaries(files, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesPaths = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionaryPath);\n\n await createTypes(dictionariesPaths);\n\n await createDictionaryEntryPoint();\n\n appLogger('Dictionaries rebuilt', {\n isVerbose: true,\n });\n\n await createModuleAugmentation();\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAkD;AAClD,qCAAgC;AAChC,wCAA2C;AAC3C,wBAA4B;AAC5B,sCAAyC;AACzC,kCAAiC;AACjC,mCAAsC;AACtC,uBAA2B;AAEpB,MAAM,sCAAsC,OACjD,UACA,WACG;AACH,QAAM,gBAAY,4BAAa,MAAM;AAGrC,YAAU,0BAAsB,6BAAW,QAAQ,CAAC,IAAI;AAAA,IACtD,WAAW;AAAA,EACb,CAAC;AAED,QAAM,YAAkB,8CAAiB,MAAM;AAE/C,QAAM,qBAAqB,UAAM,oDAAsB,OAAO,MAAM;AAEpE,QAAM,qBAAqB,UAAM,gDAAgB,oBAAoB,MAAM;AAE3E,QAAM,oBAAoB,OAAO;AAAA,IAC/B,oBAAoB,sBAAsB,CAAC;AAAA,EAC7C,EAAE,IAAI,CAAC,eAAe,WAAW,cAAc;AAE/C,YAAM,+BAAY,iBAAiB;AAEnC,YAAM,8DAA2B;AAEjC,YAAU,wBAAwB;AAAA,IAChC,WAAW;AAAA,EACb,CAAC;AAED,YAAM,0DAAyB;AAE/B,YAAU,6BAA6B;AAAA,IACrC,WAAW;AAAA,EACb,CAAC;AACH;","names":[]}