@intlayer/chokidar 8.4.4 → 8.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  2. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  3. package/dist/cjs/build.cjs +58 -1
  4. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +62 -1
  5. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  6. package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -1
  7. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +26 -1
  8. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  9. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +107 -5
  10. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  11. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +80 -3
  12. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  13. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +46 -1
  14. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  15. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +50 -1
  16. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  17. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +59 -1
  18. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  19. package/dist/cjs/cleanOutputDir.cjs +30 -1
  20. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  21. package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -1
  22. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  23. package/dist/cjs/cli.cjs +35 -1
  24. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +70 -1
  25. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  26. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +42 -7
  27. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  28. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +23 -1
  29. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  30. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +24 -1
  31. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  32. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +24 -1
  33. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  34. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +23 -1
  35. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  36. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +23 -1
  37. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -1
  39. package/dist/cjs/createType/createModuleAugmentation.cjs +112 -9
  40. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  41. package/dist/cjs/createType/createType.cjs +29 -1
  42. package/dist/cjs/createType/createType.cjs.map +1 -1
  43. package/dist/cjs/createType/index.cjs +8 -1
  44. package/dist/cjs/detectFormatCommand.cjs +32 -1
  45. package/dist/cjs/detectFormatCommand.cjs.map +1 -1
  46. package/dist/cjs/fetchDistantDictionaries.cjs +51 -1
  47. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  48. package/dist/cjs/filterInvalidDictionaries.cjs +52 -1
  49. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  50. package/dist/cjs/formatDictionary.cjs +49 -1
  51. package/dist/cjs/formatDictionary.cjs.map +1 -1
  52. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +61 -7
  53. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  54. package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -1
  55. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +34 -1
  56. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  57. package/dist/cjs/handleContentDeclarationFileChange.cjs +49 -1
  58. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  59. package/dist/cjs/handleContentDeclarationFileMoved.cjs +24 -1
  60. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  61. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +37 -1
  62. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  63. package/dist/cjs/init/index.cjs +284 -1
  64. package/dist/cjs/init/index.cjs.map +1 -1
  65. package/dist/cjs/init/utils/configManipulation.cjs +111 -1
  66. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  67. package/dist/cjs/init/utils/fileSystem.cjs +39 -1
  68. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  69. package/dist/cjs/init/utils/index.cjs +14 -1
  70. package/dist/cjs/init/utils/jsonParser.cjs +42 -3
  71. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  72. package/dist/cjs/init/utils/tsConfig.cjs +18 -1
  73. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  74. package/dist/cjs/initConfig/index.cjs +39 -1
  75. package/dist/cjs/initConfig/index.cjs.map +1 -1
  76. package/dist/cjs/installMCP/installMCP.cjs +50 -1
  77. package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
  78. package/dist/cjs/installSkills/index.cjs +303 -1
  79. package/dist/cjs/installSkills/index.cjs.map +1 -1
  80. package/dist/cjs/listDictionariesPath.cjs +42 -1
  81. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  82. package/dist/cjs/listGitFiles.cjs +105 -5
  83. package/dist/cjs/listGitFiles.cjs.map +1 -1
  84. package/dist/cjs/listProjects.cjs +47 -1
  85. package/dist/cjs/listProjects.cjs.map +1 -1
  86. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +68 -1
  87. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  88. package/dist/cjs/loadDictionaries/index.cjs +14 -1
  89. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +93 -2
  90. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  91. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +127 -1
  92. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  93. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -1
  94. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  95. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +61 -1
  96. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  97. package/dist/cjs/loadDictionaries/log.cjs +138 -3
  98. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +63 -2
  100. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
  101. package/dist/cjs/logConfigDetails.cjs +39 -2
  102. package/dist/cjs/logConfigDetails.cjs.map +1 -1
  103. package/dist/cjs/prepareIntlayer.cjs +103 -1
  104. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  105. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +30 -1
  106. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  107. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +12 -1
  108. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  109. package/dist/cjs/utils/autoDecorateContent.cjs +89 -1
  110. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  111. package/dist/cjs/utils/buildComponentFilesList.cjs +67 -1
  112. package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -1
  113. package/dist/cjs/utils/buildFilesList.cjs +83 -1
  114. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  115. package/dist/cjs/utils/chunkJSON.cjs +336 -1
  116. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  117. package/dist/cjs/utils/formatter.cjs +18 -1
  118. package/dist/cjs/utils/formatter.cjs.map +1 -1
  119. package/dist/cjs/utils/getChunk.cjs +34 -1
  120. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  121. package/dist/cjs/utils/getContentExtension.cjs +29 -1
  122. package/dist/cjs/utils/getContentExtension.cjs.map +1 -1
  123. package/dist/cjs/utils/getFormatFromExtension.cjs +34 -1
  124. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  125. package/dist/cjs/utils/getPathHash.cjs +10 -1
  126. package/dist/cjs/utils/getPathHash.cjs.map +1 -1
  127. package/dist/cjs/utils/index.cjs +49 -1
  128. package/dist/cjs/utils/mergeChunks.cjs +28 -1
  129. package/dist/cjs/utils/mergeChunks.cjs.map +1 -1
  130. package/dist/cjs/utils/pLimit.cjs +128 -1
  131. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  132. package/dist/cjs/utils/parallelize.cjs +11 -1
  133. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  134. package/dist/cjs/utils/parallelizeGlobal.cjs +29 -1
  135. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  136. package/dist/cjs/utils/reduceObjectFormat.cjs +31 -1
  137. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  138. package/dist/cjs/utils/resolveObjectPromises.cjs +21 -1
  139. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  140. package/dist/cjs/utils/resolveRelativePath.cjs +21 -1
  141. package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -1
  142. package/dist/cjs/utils/runOnce.cjs +95 -1
  143. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  144. package/dist/cjs/utils/runParallel/bin.cjs +54 -1
  145. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  146. package/dist/cjs/utils/runParallel/bootstrap.cjs +24 -1
  147. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  148. package/dist/cjs/utils/runParallel/index.cjs +115 -1
  149. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  150. package/dist/cjs/utils/runParallel/pidTree.cjs +145 -1
  151. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  152. package/dist/cjs/utils/runParallel/ps.cjs +49 -1
  153. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  154. package/dist/cjs/utils/runParallel/runTask.cjs +154 -1
  155. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  156. package/dist/cjs/utils/runParallel/spawnPosix.cjs +59 -1
  157. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  158. package/dist/cjs/utils/runParallel/spawnWin32.cjs +43 -1
  159. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  160. package/dist/cjs/utils/runParallel/wmic.cjs +52 -1
  161. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  162. package/dist/cjs/utils/sortAlphabetically.cjs +7 -1
  163. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  164. package/dist/cjs/utils/splitTextByLine.cjs +11 -1
  165. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  166. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -1
  167. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  168. package/dist/cjs/watcher.cjs +120 -1
  169. package/dist/cjs/watcher.cjs.map +1 -1
  170. package/dist/cjs/writeConfiguration/index.cjs +42 -1
  171. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  172. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +28 -1
  173. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  174. package/dist/cjs/writeContentDeclaration/index.cjs +10 -1
  175. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +94 -1
  176. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +412 -3
  178. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +127 -2
  180. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  181. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +148 -1
  182. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  183. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +92 -1
  184. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  185. package/dist/cjs/writeFileIfChanged.cjs +50 -1
  186. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  187. package/dist/cjs/writeJsonIfChanged.cjs +17 -1
  188. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  189. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  190. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  191. package/dist/esm/build.mjs +25 -1
  192. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +60 -1
  193. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  194. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -1
  195. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +24 -1
  196. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  197. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +102 -5
  198. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +76 -3
  200. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  201. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +44 -1
  202. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  203. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +48 -1
  204. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  205. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +56 -1
  206. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  207. package/dist/esm/cleanOutputDir.mjs +28 -1
  208. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  209. package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -1
  210. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  211. package/dist/esm/cli.mjs +15 -1
  212. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +68 -1
  213. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  214. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +40 -7
  215. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  216. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +20 -1
  217. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  218. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +21 -1
  219. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  220. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +21 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +20 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +20 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  226. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -1
  227. package/dist/esm/createType/createModuleAugmentation.mjs +108 -9
  228. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  229. package/dist/esm/createType/createType.mjs +26 -1
  230. package/dist/esm/createType/createType.mjs.map +1 -1
  231. package/dist/esm/createType/index.mjs +4 -1
  232. package/dist/esm/detectFormatCommand.mjs +30 -1
  233. package/dist/esm/detectFormatCommand.mjs.map +1 -1
  234. package/dist/esm/fetchDistantDictionaries.mjs +49 -1
  235. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  236. package/dist/esm/filterInvalidDictionaries.mjs +48 -1
  237. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  238. package/dist/esm/formatDictionary.mjs +44 -1
  239. package/dist/esm/formatDictionary.mjs.map +1 -1
  240. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +59 -7
  241. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  242. package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -1
  243. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +32 -1
  244. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  245. package/dist/esm/handleContentDeclarationFileChange.mjs +47 -1
  246. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileMoved.mjs +22 -1
  248. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  249. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +35 -1
  250. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  251. package/dist/esm/init/index.mjs +281 -1
  252. package/dist/esm/init/index.mjs.map +1 -1
  253. package/dist/esm/init/utils/configManipulation.mjs +108 -1
  254. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  255. package/dist/esm/init/utils/fileSystem.mjs +34 -1
  256. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  257. package/dist/esm/init/utils/index.mjs +6 -1
  258. package/dist/esm/init/utils/jsonParser.mjs +40 -3
  259. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  260. package/dist/esm/init/utils/tsConfig.mjs +16 -1
  261. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  262. package/dist/esm/initConfig/index.mjs +37 -1
  263. package/dist/esm/initConfig/index.mjs.map +1 -1
  264. package/dist/esm/installMCP/installMCP.mjs +46 -1
  265. package/dist/esm/installMCP/installMCP.mjs.map +1 -1
  266. package/dist/esm/installSkills/index.mjs +295 -1
  267. package/dist/esm/installSkills/index.mjs.map +1 -1
  268. package/dist/esm/listDictionariesPath.mjs +38 -1
  269. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  270. package/dist/esm/listGitFiles.mjs +100 -5
  271. package/dist/esm/listGitFiles.mjs.map +1 -1
  272. package/dist/esm/listProjects.mjs +43 -1
  273. package/dist/esm/listProjects.mjs.map +1 -1
  274. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +67 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  276. package/dist/esm/loadDictionaries/index.mjs +6 -1
  277. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +88 -2
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  279. package/dist/esm/loadDictionaries/loadDictionaries.mjs +124 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  281. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +25 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  283. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +58 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  285. package/dist/esm/loadDictionaries/log.mjs +134 -3
  286. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  287. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +61 -2
  288. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
  289. package/dist/esm/logConfigDetails.mjs +36 -2
  290. package/dist/esm/logConfigDetails.mjs.map +1 -1
  291. package/dist/esm/prepareIntlayer.mjs +99 -1
  292. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  293. package/dist/esm/reduceDictionaryContent/applyMask.mjs +28 -1
  294. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  295. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +10 -1
  296. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  297. package/dist/esm/utils/autoDecorateContent.mjs +86 -1
  298. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  299. package/dist/esm/utils/buildComponentFilesList.mjs +64 -1
  300. package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +79 -1
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +333 -1
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +13 -1
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +33 -1
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getContentExtension.mjs +27 -1
  310. package/dist/esm/utils/getContentExtension.mjs.map +1 -1
  311. package/dist/esm/utils/getFormatFromExtension.mjs +31 -1
  312. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  313. package/dist/esm/utils/getPathHash.mjs +7 -1
  314. package/dist/esm/utils/getPathHash.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +22 -1
  316. package/dist/esm/utils/mergeChunks.mjs +26 -1
  317. package/dist/esm/utils/mergeChunks.mjs.map +1 -1
  318. package/dist/esm/utils/pLimit.mjs +125 -1
  319. package/dist/esm/utils/pLimit.mjs.map +1 -1
  320. package/dist/esm/utils/parallelize.mjs +10 -1
  321. package/dist/esm/utils/parallelize.mjs.map +1 -1
  322. package/dist/esm/utils/parallelizeGlobal.mjs +26 -1
  323. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  324. package/dist/esm/utils/reduceObjectFormat.mjs +29 -1
  325. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  326. package/dist/esm/utils/resolveObjectPromises.mjs +19 -1
  327. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  328. package/dist/esm/utils/resolveRelativePath.mjs +19 -1
  329. package/dist/esm/utils/resolveRelativePath.mjs.map +1 -1
  330. package/dist/esm/utils/runOnce.mjs +92 -1
  331. package/dist/esm/utils/runOnce.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/bin.mjs +52 -1
  333. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/bootstrap.mjs +22 -1
  335. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/index.mjs +113 -1
  337. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/pidTree.mjs +142 -1
  339. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/ps.mjs +46 -1
  341. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/runTask.mjs +152 -1
  343. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/spawnPosix.mjs +57 -1
  345. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  346. package/dist/esm/utils/runParallel/spawnWin32.mjs +41 -1
  347. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  348. package/dist/esm/utils/runParallel/wmic.mjs +49 -1
  349. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  350. package/dist/esm/utils/sortAlphabetically.mjs +5 -1
  351. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  352. package/dist/esm/utils/splitTextByLine.mjs +9 -1
  353. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  354. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +58 -1
  355. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  356. package/dist/esm/watcher.mjs +117 -1
  357. package/dist/esm/watcher.mjs.map +1 -1
  358. package/dist/esm/writeConfiguration/index.mjs +39 -1
  359. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +26 -1
  361. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  362. package/dist/esm/writeContentDeclaration/index.mjs +6 -1
  363. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +91 -1
  364. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +407 -3
  366. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +124 -2
  368. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +146 -1
  370. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  371. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +90 -1
  372. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  373. package/dist/esm/writeFileIfChanged.mjs +48 -1
  374. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  375. package/dist/esm/writeJsonIfChanged.mjs +16 -1
  376. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  377. package/dist/types/build.d.ts +20 -20
  378. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -2
  379. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  380. package/dist/types/buildIntlayerDictionary/index.d.ts +2 -2
  381. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -2
  382. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  383. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +49 -2
  384. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  385. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +1 -1
  386. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  387. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +30 -2
  388. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  389. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -2
  390. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  391. package/dist/types/cli.d.ts +6 -6
  392. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -2
  393. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  394. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -2
  395. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  396. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -2
  397. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  398. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -2
  399. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  400. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -2
  401. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  402. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -2
  403. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  404. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -2
  405. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  406. package/dist/types/createDictionaryEntryPoint/index.d.ts +7 -7
  407. package/dist/types/createType/createModuleAugmentation.d.ts +9 -2
  408. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  409. package/dist/types/createType/createType.d.ts +12 -2
  410. package/dist/types/createType/createType.d.ts.map +1 -0
  411. package/dist/types/createType/index.d.ts +2 -2
  412. package/dist/types/fetchDistantDictionaries.d.ts +1 -1
  413. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  414. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -2
  415. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  416. package/dist/types/getContentDeclarationFileTemplate/index.d.ts +1 -1
  417. package/dist/types/loadDictionaries/index.d.ts +4 -4
  418. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +12 -2
  419. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
  420. package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -2
  421. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
  422. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -2
  423. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
  424. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -2
  425. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  426. package/dist/types/loadDictionaries/log.d.ts +1 -1
  427. package/dist/types/utils/getFormatFromExtension.d.ts +8 -2
  428. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
  429. package/dist/types/utils/index.d.ts +1 -1
  430. package/dist/types/writeConfiguration/index.d.ts.map +1 -1
  431. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -2
  432. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
  433. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -2
  434. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  435. package/dist/types/writeContentDeclaration/index.d.ts +5 -5
  436. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  437. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -2
  438. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  439. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -2
  440. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
  441. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -2
  442. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  443. package/package.json +8 -8
  444. package/dist/cjs/_utils_asset-SJVy1xMD.cjs +0 -2
  445. package/dist/cjs/chunk-Bmb41Sf3.cjs +0 -1
  446. package/dist/esm/_utils_asset-4w8dPH9r.mjs +0 -2
  447. package/dist/esm/chunk-DDgYwkfe.mjs +0 -1
  448. package/dist/types/buildIntlayerDictionary-C-LWgPIL.d.ts +0 -25
  449. package/dist/types/buildIntlayerDictionary-C-LWgPIL.d.ts.map +0 -1
  450. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts +0 -14
  451. package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts.map +0 -1
  452. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts +0 -9
  453. package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts.map +0 -1
  454. package/dist/types/createType--rDwdg2t.d.ts +0 -12
  455. package/dist/types/createType--rDwdg2t.d.ts.map +0 -1
  456. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts +0 -12
  457. package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts.map +0 -1
  458. package/dist/types/dictionaryStatus-DPVO37qe.d.ts +0 -5
  459. package/dist/types/dictionaryStatus-DPVO37qe.d.ts.map +0 -1
  460. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts +0 -10
  461. package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts.map +0 -1
  462. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts +0 -10
  463. package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts.map +0 -1
  464. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts +0 -10
  465. package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts.map +0 -1
  466. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts +0 -10
  467. package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts.map +0 -1
  468. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts +0 -10
  469. package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts.map +0 -1
  470. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts +0 -10
  471. package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts.map +0 -1
  472. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts +0 -7
  473. package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts.map +0 -1
  474. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts +0 -8
  475. package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts.map +0 -1
  476. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts +0 -12
  477. package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts.map +0 -1
  478. package/dist/types/loadDictionaries-BIqHwtYE.d.ts +0 -23
  479. package/dist/types/loadDictionaries-BIqHwtYE.d.ts.map +0 -1
  480. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts +0 -8
  481. package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts.map +0 -1
  482. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts +0 -15
  483. package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts.map +0 -1
  484. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts +0 -11
  485. package/dist/types/processContentDeclaration-CAvrHaIT.d.ts.map +0 -1
  486. package/dist/types/transformJSFile-Cg0LkeLb.d.ts +0 -11
  487. package/dist/types/transformJSFile-Cg0LkeLb.d.ts.map +0 -1
  488. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts +0 -19
  489. package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts.map +0 -1
  490. package/dist/types/writeDynamicDictionary-BE0mF2zZ.d.ts +0 -49
  491. package/dist/types/writeDynamicDictionary-BE0mF2zZ.d.ts.map +0 -1
  492. package/dist/types/writeJSFile-kK95jzg_.d.ts +0 -14
  493. package/dist/types/writeJSFile-kK95jzg_.d.ts.map +0 -1
  494. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts +0 -30
  495. package/dist/types/writeMergedDictionary-CMeghcRI.d.ts.map +0 -1
  496. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts +0 -34
  497. package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts.map +0 -1
@@ -1,2 +1,28 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`./loadContentDeclaration.cjs`);let t=require(`node:fs/promises`),n=require(`node:path`);const r=async(r,i)=>{let{system:a}=i,{dictionariesDir:o,baseDir:s}=a;typeof r==`string`&&(r=[r]),await(0,t.mkdir)((0,n.resolve)(o),{recursive:!0});let c=[];for await(let t of r){let r=await e.loadContentDeclarations([t],i),a=(0,n.relative)(s,t),o={...r[0],filePath:a};c.push(o)}return c};exports.loadLocalDictionaries=r;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_loadDictionaries_loadContentDeclaration = require('./loadContentDeclaration.cjs');
4
+ let node_fs_promises = require("node:fs/promises");
5
+ let node_path = require("node:path");
6
+
7
+ //#region src/loadDictionaries/loadLocalDictionaries.ts
8
+ const loadLocalDictionaries = async (contentDeclarationsPaths, configuration) => {
9
+ const { system } = configuration;
10
+ const { dictionariesDir, baseDir } = system;
11
+ if (typeof contentDeclarationsPaths === "string") contentDeclarationsPaths = [contentDeclarationsPaths];
12
+ await (0, node_fs_promises.mkdir)((0, node_path.resolve)(dictionariesDir), { recursive: true });
13
+ const result = [];
14
+ for await (const contentDeclarationPath of contentDeclarationsPaths) {
15
+ const dictionary = await require_loadDictionaries_loadContentDeclaration.loadContentDeclarations([contentDeclarationPath], configuration);
16
+ const relativeFilePath = (0, node_path.relative)(baseDir, contentDeclarationPath);
17
+ const dictionaryWithPath = {
18
+ ...dictionary[0],
19
+ filePath: relativeFilePath
20
+ };
21
+ result.push(dictionaryWithPath);
22
+ }
23
+ return result;
24
+ };
25
+
26
+ //#endregion
27
+ exports.loadLocalDictionaries = loadLocalDictionaries;
2
28
  //# sourceMappingURL=loadLocalDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadLocalDictionaries.cjs","names":["loadContentDeclarations"],"sources":["../../../src/loadDictionaries/loadLocalDictionaries.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { loadContentDeclarations } from './loadContentDeclaration';\n\nexport const loadLocalDictionaries = async (\n contentDeclarationsPaths: string[] | string,\n configuration: IntlayerConfig\n): Promise<Dictionary[]> => {\n const { system } = configuration;\n const { dictionariesDir, baseDir } = system;\n\n if (typeof contentDeclarationsPaths === 'string') {\n contentDeclarationsPaths = [contentDeclarationsPaths];\n }\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const result: Dictionary[] = [];\n\n for await (const contentDeclarationPath of contentDeclarationsPaths) {\n const dictionary = await loadContentDeclarations(\n [contentDeclarationPath],\n configuration\n );\n\n const relativeFilePath = relative(baseDir, contentDeclarationPath);\n\n const dictionaryWithPath: Dictionary = {\n ...dictionary[0],\n filePath: relativeFilePath,\n };\n\n result.push(dictionaryWithPath);\n }\n\n return result;\n};\n"],"mappings":"6MAMA,MAAa,EAAwB,MACnC,EACA,IAC0B,CAC1B,GAAM,CAAE,UAAW,EACb,CAAE,kBAAiB,WAAY,EAEjC,OAAO,GAA6B,WACtC,EAA2B,CAAC,EAAyB,EAIvD,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAgB,CAAE,CAAE,UAAW,GAAM,CAAC,CAE1D,IAAM,EAAuB,EAAE,CAE/B,UAAW,IAAM,KAA0B,EAA0B,CACnE,IAAM,EAAa,MAAMA,EAAAA,wBACvB,CAAC,EAAuB,CACxB,EACD,CAEK,GAAA,EAAA,EAAA,UAA4B,EAAS,EAAuB,CAE5D,EAAiC,CACrC,GAAG,EAAW,GACd,SAAU,EACX,CAED,EAAO,KAAK,EAAmB,CAGjC,OAAO"}
1
+ {"version":3,"file":"loadLocalDictionaries.cjs","names":["loadContentDeclarations"],"sources":["../../../src/loadDictionaries/loadLocalDictionaries.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { loadContentDeclarations } from './loadContentDeclaration';\n\nexport const loadLocalDictionaries = async (\n contentDeclarationsPaths: string[] | string,\n configuration: IntlayerConfig\n): Promise<Dictionary[]> => {\n const { system } = configuration;\n const { dictionariesDir, baseDir } = system;\n\n if (typeof contentDeclarationsPaths === 'string') {\n contentDeclarationsPaths = [contentDeclarationsPaths];\n }\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const result: Dictionary[] = [];\n\n for await (const contentDeclarationPath of contentDeclarationsPaths) {\n const dictionary = await loadContentDeclarations(\n [contentDeclarationPath],\n configuration\n );\n\n const relativeFilePath = relative(baseDir, contentDeclarationPath);\n\n const dictionaryWithPath: Dictionary = {\n ...dictionary[0],\n filePath: relativeFilePath,\n };\n\n result.push(dictionaryWithPath);\n }\n\n return result;\n};\n"],"mappings":";;;;;;;AAMA,MAAa,wBAAwB,OACnC,0BACA,kBAC0B;CAC1B,MAAM,EAAE,WAAW;CACnB,MAAM,EAAE,iBAAiB,YAAY;AAErC,KAAI,OAAO,6BAA6B,SACtC,4BAA2B,CAAC,yBAAyB;AAIvD,0DAAoB,gBAAgB,EAAE,EAAE,WAAW,MAAM,CAAC;CAE1D,MAAM,SAAuB,EAAE;AAE/B,YAAW,MAAM,0BAA0B,0BAA0B;EACnE,MAAM,aAAa,MAAMA,wEACvB,CAAC,uBAAuB,EACxB,cACD;EAED,MAAM,2CAA4B,SAAS,uBAAuB;EAElE,MAAM,qBAAiC;GACrC,GAAG,WAAW;GACd,UAAU;GACX;AAED,SAAO,KAAK,mBAAmB;;AAGjC,QAAO"}
@@ -1,2 +1,62 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`../utils/sortAlphabetically.cjs`),t=require(`../fetchDistantDictionaries.cjs`);let n=require(`@intlayer/config/node`),r=require(`@intlayer/api`),i=require(`@intlayer/remote-dictionaries-entry`);const a=e=>e.map(e=>({...e,localId:`${e.key}::remote::${e.id}`,location:`remote`})),o=async(o=(0,n.getConfiguration)(),s,c)=>{let{editor:l}=o,u=(0,i.getRemoteDictionaries)(o);if(!(l.clientId&&l.clientSecret))return[];try{c?.onStartRemoteCheck?.();let n=(await(0,r.getIntlayerAPIProxy)(void 0,o).dictionary.getDictionariesUpdateTimestamp()).data;if(!n)throw Error(`No distant dictionaries found`);let i=Object.entries(n).filter(([e,t])=>{if(!t.updatedAt)return!0;let n=u[t.key]?.find(t=>t.id===e);if(!n)return!0;let r=n?.updatedAt,i=typeof r==`number`?r:r?new Date(r).getTime():void 0;return typeof i==`number`?t.updatedAt>i:!0}),l=Object.values(u).flat().filter(e=>{let t=n[e.id].updatedAt,r=e.updatedAt,i=typeof r==`number`?r:r?new Date(r).getTime():void 0;return typeof i==`number`&&typeof t==`number`&&i>=t});l.length>0&&s?.(l.map(e=>({dictionaryKey:e.key,type:`remote`,status:`imported`})));let d=i.map(([,e])=>e.key).sort(e.sortAlphabetically);d.length>0&&s?.(d.map(e=>({dictionaryKey:e,type:`remote`,status:`pending`})));let f=a(await t.fetchDistantDictionaries({dictionaryKeys:d},s));return[...l,...f]}catch(e){return c?.onError?.(e),[]}finally{c?.onStopRemoteCheck?.()}};exports.formatDistantDictionaries=a,exports.loadRemoteDictionaries=o;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_utils_sortAlphabetically = require('../utils/sortAlphabetically.cjs');
4
+ const require_fetchDistantDictionaries = require('../fetchDistantDictionaries.cjs');
5
+ let _intlayer_config_node = require("@intlayer/config/node");
6
+ let _intlayer_api = require("@intlayer/api");
7
+ let _intlayer_remote_dictionaries_entry = require("@intlayer/remote-dictionaries-entry");
8
+
9
+ //#region src/loadDictionaries/loadRemoteDictionaries.ts
10
+ const formatDistantDictionaries = (dictionaries) => dictionaries.map((dict) => ({
11
+ ...dict,
12
+ localId: `${dict.key}::remote::${dict.id}`,
13
+ location: "remote"
14
+ }));
15
+ const loadRemoteDictionaries = async (configuration = (0, _intlayer_config_node.getConfiguration)(), onStatusUpdate, options) => {
16
+ const { editor } = configuration;
17
+ const remoteDictionariesRecord = (0, _intlayer_remote_dictionaries_entry.getRemoteDictionaries)(configuration);
18
+ if (!Boolean(editor.clientId && editor.clientSecret)) return [];
19
+ try {
20
+ options?.onStartRemoteCheck?.();
21
+ const distantDictionaryUpdateTimeStamp = (await (0, _intlayer_api.getIntlayerAPIProxy)(void 0, configuration).dictionary.getDictionariesUpdateTimestamp()).data;
22
+ if (!distantDictionaryUpdateTimeStamp) throw new Error("No distant dictionaries found");
23
+ const dictionariesIdToFetch = Object.entries(distantDictionaryUpdateTimeStamp).filter(([dictionaryId, data]) => {
24
+ if (!data.updatedAt) return true;
25
+ const local = remoteDictionariesRecord[data.key]?.find((dictionary) => dictionary.id === dictionaryId);
26
+ if (!local) return true;
27
+ const localUpdatedAtRaw = local?.updatedAt;
28
+ const localUpdatedAt = typeof localUpdatedAtRaw === "number" ? localUpdatedAtRaw : localUpdatedAtRaw ? new Date(localUpdatedAtRaw).getTime() : void 0;
29
+ if (typeof localUpdatedAt !== "number") return true;
30
+ return data.updatedAt > localUpdatedAt;
31
+ });
32
+ const cachedDictionaries = Object.values(remoteDictionariesRecord).flat().filter((dictionary) => {
33
+ const remoteUpdatedAt = distantDictionaryUpdateTimeStamp[dictionary.id].updatedAt;
34
+ const localUpdatedAtRaw = dictionary.updatedAt;
35
+ const localUpdatedAt = typeof localUpdatedAtRaw === "number" ? localUpdatedAtRaw : localUpdatedAtRaw ? new Date(localUpdatedAtRaw).getTime() : void 0;
36
+ return typeof localUpdatedAt === "number" && typeof remoteUpdatedAt === "number" && localUpdatedAt >= remoteUpdatedAt;
37
+ });
38
+ if (cachedDictionaries.length > 0) onStatusUpdate?.(cachedDictionaries.map((dictionary) => ({
39
+ dictionaryKey: dictionary.key,
40
+ type: "remote",
41
+ status: "imported"
42
+ })));
43
+ const orderedDistantDictionaryKeys = dictionariesIdToFetch.map(([, data]) => data.key).sort(require_utils_sortAlphabetically.sortAlphabetically);
44
+ if (orderedDistantDictionaryKeys.length > 0) onStatusUpdate?.(orderedDistantDictionaryKeys.map((key) => ({
45
+ dictionaryKey: key,
46
+ type: "remote",
47
+ status: "pending"
48
+ })));
49
+ const distantDictionaries = formatDistantDictionaries(await require_fetchDistantDictionaries.fetchDistantDictionaries({ dictionaryKeys: orderedDistantDictionaryKeys }, onStatusUpdate));
50
+ return [...cachedDictionaries, ...distantDictionaries];
51
+ } catch (error) {
52
+ options?.onError?.(error);
53
+ return [];
54
+ } finally {
55
+ options?.onStopRemoteCheck?.();
56
+ }
57
+ };
58
+
59
+ //#endregion
60
+ exports.formatDistantDictionaries = formatDistantDictionaries;
61
+ exports.loadRemoteDictionaries = loadRemoteDictionaries;
2
62
  //# sourceMappingURL=loadRemoteDictionaries.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"loadRemoteDictionaries.cjs","names":["sortAlphabetically","fetchDistantDictionaries"],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getRemoteDictionaries } from '@intlayer/remote-dictionaries-entry';\nimport type { Dictionary, DictionaryId, DictionaryKey } from '@intlayer/types/dictionary';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\nimport type { DictionariesStatus } from '../loadDictionaries/loadDictionaries';\nimport { sortAlphabetically } from '../utils/sortAlphabetically';\n\nexport const formatDistantDictionaries = (\n dictionaries: (DictionaryAPI | Dictionary)[]\n): Dictionary[] =>\n dictionaries.map((dict) => ({\n ...dict,\n localId: `${dict.key}::remote::${dict.id}`,\n location: 'remote' as const,\n }));\n\nexport const loadRemoteDictionaries = async (\n configuration = getConfiguration(),\n onStatusUpdate?: (status: DictionariesStatus[]) => void,\n options?: {\n onStartRemoteCheck?: () => void;\n onStopRemoteCheck?: () => void;\n onError?: (error: Error) => void;\n }\n): Promise<Dictionary[]> => {\n const { editor } = configuration;\n const remoteDictionariesRecord = getRemoteDictionaries(configuration);\n\n const hasRemoteDictionaries = Boolean(editor.clientId && editor.clientSecret);\n\n if (!hasRemoteDictionaries) return [];\n\n try {\n options?.onStartRemoteCheck?.();\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n const distantDictionaryUpdateTimeStamp: Record<\n DictionaryId,\n { key: DictionaryKey; updatedAt: number }\n > | null = getDictionariesKeysResult.data;\n\n if (!distantDictionaryUpdateTimeStamp) {\n throw new Error('No distant dictionaries found');\n }\n\n const dictionariesIdToFetch = Object.entries(\n distantDictionaryUpdateTimeStamp\n ).filter(([dictionaryId, data]) => {\n // If remote doesn't provide updatedAt, fetch to be safe\n if (!data.updatedAt) return true;\n\n // If no local cache exists, fetch\n const local: Dictionary | undefined = remoteDictionariesRecord[\n data.key\n ]?.find((dictionary) => dictionary.id === dictionaryId);\n if (!local) return true;\n\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // If local timestamp missing or older than remote, fetch\n if (typeof localUpdatedAt !== 'number') return true;\n\n return data.updatedAt > localUpdatedAt;\n });\n\n const flatRemoteDictionariesRecord: DictionaryAPI[] = Object.values(\n remoteDictionariesRecord\n ).flat();\n\n const cachedDictionaries: Dictionary[] =\n flatRemoteDictionariesRecord.filter((dictionary) => {\n const remoteUpdatedAt =\n distantDictionaryUpdateTimeStamp[dictionary.id!].updatedAt;\n\n const localUpdatedAtRaw = dictionary.updatedAt;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // Consider as cached/imported when local exists and is up-to-date or newer\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n });\n\n // Report cached as already imported\n if (cachedDictionaries.length > 0) {\n onStatusUpdate?.(\n cachedDictionaries.map((dictionary) => ({\n dictionaryKey: dictionary.key,\n type: 'remote',\n status: 'imported',\n }))\n );\n }\n\n const orderedDistantDictionaryKeys = dictionariesIdToFetch\n .map(([, data]) => data.key)\n .sort(sortAlphabetically);\n\n // Report pending for keys to be fetched so totals are visible immediately\n if (orderedDistantDictionaryKeys.length > 0) {\n onStatusUpdate?.(\n orderedDistantDictionaryKeys.map((key) => ({\n dictionaryKey: key,\n type: 'remote',\n status: 'pending',\n }))\n );\n }\n\n const distantDictionariesData = await fetchDistantDictionaries(\n {\n dictionaryKeys: orderedDistantDictionaryKeys,\n },\n onStatusUpdate\n );\n\n const distantDictionaries: Dictionary[] = formatDistantDictionaries(\n distantDictionariesData\n );\n\n return [...cachedDictionaries, ...distantDictionaries];\n } catch (error) {\n options?.onError?.(error as Error);\n return [];\n } finally {\n options?.onStopRemoteCheck?.();\n }\n};\n"],"mappings":"uTAUA,MAAa,EACX,GAEA,EAAa,IAAK,IAAU,CAC1B,GAAG,EACH,QAAS,GAAG,EAAK,IAAI,YAAY,EAAK,KACtC,SAAU,SACX,EAAE,CAEQ,EAAyB,MACpC,GAAA,EAAA,EAAA,mBAAkC,CAClC,EACA,IAK0B,CAC1B,GAAM,CAAE,UAAW,EACb,GAAA,EAAA,EAAA,uBAAiD,EAAc,CAIrE,GAAI,EAFkC,EAAO,UAAY,EAAO,cAEpC,MAAO,EAAE,CAErC,GAAI,CAC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C,EAAO,CAEd,OADA,GAAS,UAAU,EAAe,CAC3B,EAAE,QACD,CACR,GAAS,qBAAqB"}
1
+ {"version":3,"file":"loadRemoteDictionaries.cjs","names":["sortAlphabetically","fetchDistantDictionaries"],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getRemoteDictionaries } from '@intlayer/remote-dictionaries-entry';\nimport type { Dictionary, DictionaryId, DictionaryKey } from '@intlayer/types/dictionary';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\nimport type { DictionariesStatus } from '../loadDictionaries/loadDictionaries';\nimport { sortAlphabetically } from '../utils/sortAlphabetically';\n\nexport const formatDistantDictionaries = (\n dictionaries: (DictionaryAPI | Dictionary)[]\n): Dictionary[] =>\n dictionaries.map((dict) => ({\n ...dict,\n localId: `${dict.key}::remote::${dict.id}`,\n location: 'remote' as const,\n }));\n\nexport const loadRemoteDictionaries = async (\n configuration = getConfiguration(),\n onStatusUpdate?: (status: DictionariesStatus[]) => void,\n options?: {\n onStartRemoteCheck?: () => void;\n onStopRemoteCheck?: () => void;\n onError?: (error: Error) => void;\n }\n): Promise<Dictionary[]> => {\n const { editor } = configuration;\n const remoteDictionariesRecord = getRemoteDictionaries(configuration);\n\n const hasRemoteDictionaries = Boolean(editor.clientId && editor.clientSecret);\n\n if (!hasRemoteDictionaries) return [];\n\n try {\n options?.onStartRemoteCheck?.();\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n const distantDictionaryUpdateTimeStamp: Record<\n DictionaryId,\n { key: DictionaryKey; updatedAt: number }\n > | null = getDictionariesKeysResult.data;\n\n if (!distantDictionaryUpdateTimeStamp) {\n throw new Error('No distant dictionaries found');\n }\n\n const dictionariesIdToFetch = Object.entries(\n distantDictionaryUpdateTimeStamp\n ).filter(([dictionaryId, data]) => {\n // If remote doesn't provide updatedAt, fetch to be safe\n if (!data.updatedAt) return true;\n\n // If no local cache exists, fetch\n const local: Dictionary | undefined = remoteDictionariesRecord[\n data.key\n ]?.find((dictionary) => dictionary.id === dictionaryId);\n if (!local) return true;\n\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // If local timestamp missing or older than remote, fetch\n if (typeof localUpdatedAt !== 'number') return true;\n\n return data.updatedAt > localUpdatedAt;\n });\n\n const flatRemoteDictionariesRecord: DictionaryAPI[] = Object.values(\n remoteDictionariesRecord\n ).flat();\n\n const cachedDictionaries: Dictionary[] =\n flatRemoteDictionariesRecord.filter((dictionary) => {\n const remoteUpdatedAt =\n distantDictionaryUpdateTimeStamp[dictionary.id!].updatedAt;\n\n const localUpdatedAtRaw = dictionary.updatedAt;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // Consider as cached/imported when local exists and is up-to-date or newer\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n });\n\n // Report cached as already imported\n if (cachedDictionaries.length > 0) {\n onStatusUpdate?.(\n cachedDictionaries.map((dictionary) => ({\n dictionaryKey: dictionary.key,\n type: 'remote',\n status: 'imported',\n }))\n );\n }\n\n const orderedDistantDictionaryKeys = dictionariesIdToFetch\n .map(([, data]) => data.key)\n .sort(sortAlphabetically);\n\n // Report pending for keys to be fetched so totals are visible immediately\n if (orderedDistantDictionaryKeys.length > 0) {\n onStatusUpdate?.(\n orderedDistantDictionaryKeys.map((key) => ({\n dictionaryKey: key,\n type: 'remote',\n status: 'pending',\n }))\n );\n }\n\n const distantDictionariesData = await fetchDistantDictionaries(\n {\n dictionaryKeys: orderedDistantDictionaryKeys,\n },\n onStatusUpdate\n );\n\n const distantDictionaries: Dictionary[] = formatDistantDictionaries(\n distantDictionariesData\n );\n\n return [...cachedDictionaries, ...distantDictionaries];\n } catch (error) {\n options?.onError?.(error as Error);\n return [];\n } finally {\n options?.onStopRemoteCheck?.();\n }\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,6BACX,iBAEA,aAAa,KAAK,UAAU;CAC1B,GAAG;CACH,SAAS,GAAG,KAAK,IAAI,YAAY,KAAK;CACtC,UAAU;CACX,EAAE;AAEL,MAAa,yBAAyB,OACpC,6DAAkC,EAClC,gBACA,YAK0B;CAC1B,MAAM,EAAE,WAAW;CACnB,MAAM,0FAAiD,cAAc;AAIrE,KAAI,CAF0B,QAAQ,OAAO,YAAY,OAAO,aAAa,CAEjD,QAAO,EAAE;AAErC,KAAI;AACF,WAAS,sBAAsB;EAQ/B,MAAM,oCAFJ,6CAJsC,QAAW,cAAc,CAI7C,WAAW,gCAAgC,EAK1B;AAErC,MAAI,CAAC,iCACH,OAAM,IAAI,MAAM,gCAAgC;EAGlD,MAAM,wBAAwB,OAAO,QACnC,iCACD,CAAC,QAAQ,CAAC,cAAc,UAAU;AAEjC,OAAI,CAAC,KAAK,UAAW,QAAO;GAG5B,MAAM,QAAgC,yBACpC,KAAK,MACJ,MAAM,eAAe,WAAW,OAAO,aAAa;AACvD,OAAI,CAAC,MAAO,QAAO;GAEnB,MAAM,oBAAqB,OAAe;GAK1C,MAAM,iBACJ,OAAO,sBAAsB,WACzB,oBACA,oBACE,IAAI,KAAK,kBAAkB,CAAC,SAAS,GACrC;AAGR,OAAI,OAAO,mBAAmB,SAAU,QAAO;AAE/C,UAAO,KAAK,YAAY;IACxB;EAMF,MAAM,qBAJgD,OAAO,OAC3D,yBACD,CAAC,MAAM,CAGuB,QAAQ,eAAe;GAClD,MAAM,kBACJ,iCAAiC,WAAW,IAAK;GAEnD,MAAM,oBAAoB,WAAW;GAErC,MAAM,iBACJ,OAAO,sBAAsB,WACzB,oBACA,oBACE,IAAI,KAAK,kBAAkB,CAAC,SAAS,GACrC;AAGR,UACE,OAAO,mBAAmB,YAC1B,OAAO,oBAAoB,YAC3B,kBAAkB;IAEpB;AAGJ,MAAI,mBAAmB,SAAS,EAC9B,kBACE,mBAAmB,KAAK,gBAAgB;GACtC,eAAe,WAAW;GAC1B,MAAM;GACN,QAAQ;GACT,EAAE,CACJ;EAGH,MAAM,+BAA+B,sBAClC,KAAK,GAAG,UAAU,KAAK,IAAI,CAC3B,KAAKA,oDAAmB;AAG3B,MAAI,6BAA6B,SAAS,EACxC,kBACE,6BAA6B,KAAK,SAAS;GACzC,eAAe;GACf,MAAM;GACN,QAAQ;GACT,EAAE,CACJ;EAUH,MAAM,sBAAoC,0BAPV,MAAMC,0DACpC,EACE,gBAAgB,8BACjB,EACD,eACD,CAIA;AAED,SAAO,CAAC,GAAG,oBAAoB,GAAG,oBAAoB;UAC/C,OAAO;AACd,WAAS,UAAU,MAAe;AAClC,SAAO,EAAE;WACD;AACR,WAAS,qBAAqB"}
@@ -1,4 +1,139 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@intlayer/config/logger`),n=require(`@intlayer/config/utils`),r=require(`@intlayer/config/colors`);r=e.t(r);let i=require(`@intlayer/config/built`);i=e.t(i);var a=class{statuses=[];spinnerTimer=null;spinnerIndex=0;renderedLines=0;spinnerFrames=t.spinnerFrames;isFinished=!1;prefix;lastRenderedState=``;remoteCheckInProgress=!1;expectRemote=!1;remoteError;pluginTotal=0;pluginDone=0;pluginError;constructor(){this.prefix=(0,t.getPrefix)(i.default?.log?.prefix)??``}setExpectRemote(e){this.expectRemote=e}startRemoteCheck(){this.isFinished||(this.remoteCheckInProgress=!0,this.startSpinner(),this.render())}stopRemoteCheck(){this.remoteCheckInProgress=!1}update(e){if(this.isFinished)return;for(let t of e){let e=this.statuses.findIndex(e=>e.dictionaryKey===t.dictionaryKey&&e.type===t.type);e>=0?this.statuses[e]=t:this.statuses.push(t)}let{remoteTotal:t}=this.computeProgress();this.expectRemote&&!this.remoteCheckInProgress&&t===0||(this.startSpinner(),this.render())}finish(){this.isFinished=!0,this.stopSpinner(),this.render()}startSpinner(){this.spinnerTimer||this.isFinished||(this.spinnerTimer=setInterval(()=>{this.spinnerIndex=(this.spinnerIndex+1)%this.spinnerFrames.length,this.render()},100))}stopSpinner(){this.spinnerTimer&&=(clearInterval(this.spinnerTimer),null)}setRemoteError=e=>{this.remoteError=(0,n.extractErrorMessage)(e),this.stopRemoteCheck(),this.render()};setPluginTotal(e){this.isFinished||(this.pluginTotal=e,e>0&&this.startSpinner(),this.render())}setPluginDone(e){this.isFinished||(this.pluginDone=e,this.render())}setPluginError(e){this.isFinished||(this.pluginError=(0,n.extractErrorMessage)(e),this.render())}render(){let{localTotal:e,localDone:n,remoteTotal:i,remoteDone:a,pluginTotal:o,pluginDone:s}=this.computeProgress(),c=this.spinnerFrames[this.spinnerIndex],l=(0,t.colorize)(c,r.BLUE),u=[],d=n===e,f=a===i,p=s===o;this.expectRemote&&this.remoteCheckInProgress&&i===0||(d?u.push(`${this.prefix} ${t.v} Local content: ${(0,t.colorize)(`${n}`,r.GREEN)}${(0,t.colorize)(`/${e}`,r.GREY)}`):u.push(`${this.prefix} ${l} Local content: ${(0,t.colorize)(`${n}`,r.BLUE)}${(0,t.colorize)(`/${e}`,r.GREY)}`)),(i>0||this.remoteCheckInProgress||this.remoteError)&&(this.remoteError?u.push(`${this.prefix} ${t.x} Remote content: ${(0,t.colorize)(this.remoteError,r.RED)}`):i===0?u.push(`${this.prefix} ${l} Remote content: ${(0,t.colorize)(`Check server`,r.BLUE)}`):f?u.push(`${this.prefix} ${t.v} Remote content: ${(0,t.colorize)(`${a}`,r.GREEN)}${(0,t.colorize)(`/${i}`,r.GREY)}`):u.push(`${this.prefix} ${l} Remote content: ${(0,t.colorize)(`${a}`,r.BLUE)}${(0,t.colorize)(`/${i}`,r.GREY)}`)),(o>0||this.pluginError)&&(this.pluginError?u.push(`${this.prefix} ${t.x} Plugin content: ${(0,t.colorize)(this.pluginError,r.RED)}`):p?u.push(`${this.prefix} ${t.v} Plugin content: ${(0,t.colorize)(`${s}`,r.GREEN)}${(0,t.colorize)(`/${o}`,r.GREY)}`):u.push(`${this.prefix} ${l} Plugin content: ${(0,t.colorize)(`${s}`,r.BLUE)}${(0,t.colorize)(`/${o}`,r.GREY)}`));let m=u.join(`
2
- `);if(m===this.lastRenderedState)return;this.lastRenderedState=m,this.renderedLines>0&&process.stdout.write(`\x1b[${this.renderedLines}F`);let h=Math.max(this.renderedLines,u.length);for(let e=0;e<h;e++){process.stdout.write(`\x1B[2K`);let t=u[e];t!==void 0&&process.stdout.write(t),process.stdout.write(`
3
- `)}this.renderedLines=u.length}computeProgress(){let e=new Set(this.statuses.filter(e=>e.type===`local`).map(e=>e.dictionaryKey)),t=new Set(this.statuses.filter(e=>e.type===`local`&&(e.status===`built`||e.status===`error`)).map(e=>e.dictionaryKey)),n=new Set(this.statuses.filter(e=>e.type===`remote`).map(e=>e.dictionaryKey)),r=new Set(this.statuses.filter(e=>e.type===`remote`&&(e.status===`fetched`||e.status===`imported`||e.status===`error`)).map(e=>e.dictionaryKey));return{localTotal:e.size,localDone:t.size,remoteTotal:n.size,remoteDone:r.size,pluginTotal:this.pluginTotal,pluginDone:this.pluginDone}}};exports.DictionariesLogger=a;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_config_logger = require("@intlayer/config/logger");
4
+ let _intlayer_config_utils = require("@intlayer/config/utils");
5
+ let _intlayer_config_colors = require("@intlayer/config/colors");
6
+ _intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
7
+ let _intlayer_config_built = require("@intlayer/config/built");
8
+ _intlayer_config_built = require_runtime.__toESM(_intlayer_config_built);
9
+
10
+ //#region src/loadDictionaries/log.ts
11
+ var DictionariesLogger = class {
12
+ statuses = [];
13
+ spinnerTimer = null;
14
+ spinnerIndex = 0;
15
+ renderedLines = 0;
16
+ spinnerFrames = _intlayer_config_logger.spinnerFrames;
17
+ isFinished = false;
18
+ prefix;
19
+ lastRenderedState = "";
20
+ remoteCheckInProgress = false;
21
+ expectRemote = false;
22
+ remoteError;
23
+ pluginTotal = 0;
24
+ pluginDone = 0;
25
+ pluginError;
26
+ constructor() {
27
+ this.prefix = (0, _intlayer_config_logger.getPrefix)(_intlayer_config_built.default?.log?.prefix) ?? "";
28
+ }
29
+ setExpectRemote(expect) {
30
+ this.expectRemote = expect;
31
+ }
32
+ startRemoteCheck() {
33
+ if (this.isFinished) return;
34
+ this.remoteCheckInProgress = true;
35
+ this.startSpinner();
36
+ this.render();
37
+ }
38
+ stopRemoteCheck() {
39
+ this.remoteCheckInProgress = false;
40
+ }
41
+ update(newStatuses) {
42
+ if (this.isFinished) return;
43
+ for (const status of newStatuses) {
44
+ const index = this.statuses.findIndex((s) => s.dictionaryKey === status.dictionaryKey && s.type === status.type);
45
+ if (index >= 0) this.statuses[index] = status;
46
+ else this.statuses.push(status);
47
+ }
48
+ const { remoteTotal } = this.computeProgress();
49
+ if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) return;
50
+ this.startSpinner();
51
+ this.render();
52
+ }
53
+ finish() {
54
+ this.isFinished = true;
55
+ this.stopSpinner();
56
+ this.render();
57
+ }
58
+ startSpinner() {
59
+ if (this.spinnerTimer || this.isFinished) return;
60
+ this.spinnerTimer = setInterval(() => {
61
+ this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;
62
+ this.render();
63
+ }, 100);
64
+ }
65
+ stopSpinner() {
66
+ if (!this.spinnerTimer) return;
67
+ clearInterval(this.spinnerTimer);
68
+ this.spinnerTimer = null;
69
+ }
70
+ setRemoteError = (error) => {
71
+ this.remoteError = (0, _intlayer_config_utils.extractErrorMessage)(error);
72
+ this.stopRemoteCheck();
73
+ this.render();
74
+ };
75
+ setPluginTotal(total) {
76
+ if (this.isFinished) return;
77
+ this.pluginTotal = total;
78
+ if (total > 0) this.startSpinner();
79
+ this.render();
80
+ }
81
+ setPluginDone(done) {
82
+ if (this.isFinished) return;
83
+ this.pluginDone = done;
84
+ this.render();
85
+ }
86
+ setPluginError(error) {
87
+ if (this.isFinished) return;
88
+ this.pluginError = (0, _intlayer_config_utils.extractErrorMessage)(error);
89
+ this.render();
90
+ }
91
+ render() {
92
+ const { localTotal, localDone, remoteTotal, remoteDone, pluginTotal, pluginDone } = this.computeProgress();
93
+ const frame = this.spinnerFrames[this.spinnerIndex];
94
+ const clock = (0, _intlayer_config_logger.colorize)(frame, _intlayer_config_colors.BLUE);
95
+ const lines = [];
96
+ const isLocalDone = localDone === localTotal;
97
+ const isRemoteDone = remoteDone === remoteTotal;
98
+ const isPluginDone = pluginDone === pluginTotal;
99
+ if (!(this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0)) if (isLocalDone) lines.push(`${this.prefix} ${_intlayer_config_logger.v} Local content: ${(0, _intlayer_config_logger.colorize)(`${localDone}`, _intlayer_config_colors.GREEN)}${(0, _intlayer_config_logger.colorize)(`/${localTotal}`, _intlayer_config_colors.GREY)}`);
100
+ else lines.push(`${this.prefix} ${clock} Local content: ${(0, _intlayer_config_logger.colorize)(`${localDone}`, _intlayer_config_colors.BLUE)}${(0, _intlayer_config_logger.colorize)(`/${localTotal}`, _intlayer_config_colors.GREY)}`);
101
+ if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) if (this.remoteError) lines.push(`${this.prefix} ${_intlayer_config_logger.x} Remote content: ${(0, _intlayer_config_logger.colorize)(this.remoteError, _intlayer_config_colors.RED)}`);
102
+ else if (remoteTotal === 0) lines.push(`${this.prefix} ${clock} Remote content: ${(0, _intlayer_config_logger.colorize)("Check server", _intlayer_config_colors.BLUE)}`);
103
+ else if (isRemoteDone) lines.push(`${this.prefix} ${_intlayer_config_logger.v} Remote content: ${(0, _intlayer_config_logger.colorize)(`${remoteDone}`, _intlayer_config_colors.GREEN)}${(0, _intlayer_config_logger.colorize)(`/${remoteTotal}`, _intlayer_config_colors.GREY)}`);
104
+ else lines.push(`${this.prefix} ${clock} Remote content: ${(0, _intlayer_config_logger.colorize)(`${remoteDone}`, _intlayer_config_colors.BLUE)}${(0, _intlayer_config_logger.colorize)(`/${remoteTotal}`, _intlayer_config_colors.GREY)}`);
105
+ if (pluginTotal > 0 || this.pluginError) if (this.pluginError) lines.push(`${this.prefix} ${_intlayer_config_logger.x} Plugin content: ${(0, _intlayer_config_logger.colorize)(this.pluginError, _intlayer_config_colors.RED)}`);
106
+ else if (isPluginDone) lines.push(`${this.prefix} ${_intlayer_config_logger.v} Plugin content: ${(0, _intlayer_config_logger.colorize)(`${pluginDone}`, _intlayer_config_colors.GREEN)}${(0, _intlayer_config_logger.colorize)(`/${pluginTotal}`, _intlayer_config_colors.GREY)}`);
107
+ else lines.push(`${this.prefix} ${clock} Plugin content: ${(0, _intlayer_config_logger.colorize)(`${pluginDone}`, _intlayer_config_colors.BLUE)}${(0, _intlayer_config_logger.colorize)(`/${pluginTotal}`, _intlayer_config_colors.GREY)}`);
108
+ const currentState = lines.join("\n");
109
+ if (currentState === this.lastRenderedState) return;
110
+ this.lastRenderedState = currentState;
111
+ if (this.renderedLines > 0) process.stdout.write(`\x1b[${this.renderedLines}F`);
112
+ const totalLinesToClear = Math.max(this.renderedLines, lines.length);
113
+ for (let i = 0; i < totalLinesToClear; i++) {
114
+ process.stdout.write("\x1B[2K");
115
+ const line = lines[i];
116
+ if (line !== void 0) process.stdout.write(line);
117
+ process.stdout.write("\n");
118
+ }
119
+ this.renderedLines = lines.length;
120
+ }
121
+ computeProgress() {
122
+ const localKeys = new Set(this.statuses.filter((s) => s.type === "local").map((s) => s.dictionaryKey));
123
+ const localDoneKeys = new Set(this.statuses.filter((s) => s.type === "local" && (s.status === "built" || s.status === "error")).map((s) => s.dictionaryKey));
124
+ const remoteKeys = new Set(this.statuses.filter((s) => s.type === "remote").map((s) => s.dictionaryKey));
125
+ const remoteDoneKeys = new Set(this.statuses.filter((s) => s.type === "remote" && (s.status === "fetched" || s.status === "imported" || s.status === "error")).map((s) => s.dictionaryKey));
126
+ return {
127
+ localTotal: localKeys.size,
128
+ localDone: localDoneKeys.size,
129
+ remoteTotal: remoteKeys.size,
130
+ remoteDone: remoteDoneKeys.size,
131
+ pluginTotal: this.pluginTotal,
132
+ pluginDone: this.pluginDone
133
+ };
134
+ }
135
+ };
136
+
137
+ //#endregion
138
+ exports.DictionariesLogger = DictionariesLogger;
4
139
  //# sourceMappingURL=log.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.cjs","names":["spinnerFrames","configuration","ANSIColors","v","x"],"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport {\n colorize,\n getPrefix,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config/logger';\nimport { extractErrorMessage } from '@intlayer/config/utils';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n private pluginTotal = 0;\n private pluginDone = 0;\n private pluginError: string | undefined;\n\n constructor() {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n setPluginTotal(total: number) {\n if (this.isFinished) return;\n this.pluginTotal = total;\n if (total > 0) {\n this.startSpinner();\n }\n this.render();\n }\n\n setPluginDone(done: number) {\n if (this.isFinished) return;\n this.pluginDone = done;\n this.render();\n }\n\n setPluginError(error?: Error) {\n if (this.isFinished) return;\n this.pluginError = extractErrorMessage(error);\n this.render();\n }\n\n private render() {\n const {\n localTotal,\n localDone,\n remoteTotal,\n remoteDone,\n pluginTotal,\n pluginDone,\n } = this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n const isPluginDone = pluginDone === pluginTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Plugin line: show error or progress counts\n if (pluginTotal > 0 || this.pluginError) {\n if (this.pluginError) {\n lines.push(\n `${this.prefix} ${x} Plugin content: ${colorize(\n this.pluginError,\n ANSIColors.RED\n )}`\n );\n } else if (isPluginDone) {\n lines.push(\n `${this.prefix} ${v} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.GREEN)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.BLUE)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n pluginTotal: this.pluginTotal,\n pluginDone: this.pluginDone,\n } as const;\n }\n}\n"],"mappings":"wRAYA,IAAa,EAAb,KAAgC,CAC9B,SAAyC,EAAE,CAC3C,aAA8C,KAC9C,aAAuB,EACvB,cAAwB,EACxB,cAAiCA,EAAAA,cACjC,WAAqB,GACrB,OACA,kBAAoC,GACpC,sBAAgC,GAChC,aAAuB,GACvB,YACA,YAAsB,EACtB,WAAqB,EACrB,YAEA,aAAc,CACZ,KAAK,QAAA,EAAA,EAAA,WAAmBC,EAAAA,SAAe,KAAK,OAAO,EAAI,GAGzD,gBAAgB,EAAiB,CAC/B,KAAK,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,CACA,IAAK,GAAM,EAAE,cAAc,CAC/B,CAED,MAAO,CACL,WAAY,EAAU,KACtB,UAAW,EAAc,KACzB,YAAa,EAAW,KACxB,WAAY,EAAe,KAC3B,YAAa,KAAK,YAClB,WAAY,KAAK,WAClB"}
1
+ {"version":3,"file":"log.cjs","names":["spinnerFrames","configuration","ANSIColors","v","x"],"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport {\n colorize,\n getPrefix,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config/logger';\nimport { extractErrorMessage } from '@intlayer/config/utils';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n private pluginTotal = 0;\n private pluginDone = 0;\n private pluginError: string | undefined;\n\n constructor() {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n setPluginTotal(total: number) {\n if (this.isFinished) return;\n this.pluginTotal = total;\n if (total > 0) {\n this.startSpinner();\n }\n this.render();\n }\n\n setPluginDone(done: number) {\n if (this.isFinished) return;\n this.pluginDone = done;\n this.render();\n }\n\n setPluginError(error?: Error) {\n if (this.isFinished) return;\n this.pluginError = extractErrorMessage(error);\n this.render();\n }\n\n private render() {\n const {\n localTotal,\n localDone,\n remoteTotal,\n remoteDone,\n pluginTotal,\n pluginDone,\n } = this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n const isPluginDone = pluginDone === pluginTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Plugin line: show error or progress counts\n if (pluginTotal > 0 || this.pluginError) {\n if (this.pluginError) {\n lines.push(\n `${this.prefix} ${x} Plugin content: ${colorize(\n this.pluginError,\n ANSIColors.RED\n )}`\n );\n } else if (isPluginDone) {\n lines.push(\n `${this.prefix} ${v} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.GREEN)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.BLUE)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n pluginTotal: this.pluginTotal,\n pluginDone: this.pluginDone,\n } as const;\n }\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAa,qBAAb,MAAgC;CAC9B,AAAQ,WAAiC,EAAE;CAC3C,AAAQ,eAAsC;CAC9C,AAAQ,eAAe;CACvB,AAAQ,gBAAgB;CACxB,AAAiB,gBAAgBA;CACjC,AAAQ,aAAa;CACrB,AAAiB;CACjB,AAAQ,oBAA4B;CACpC,AAAQ,wBAAwB;CAChC,AAAQ,eAAe;CACvB,AAAQ;CACR,AAAQ,cAAc;CACtB,AAAQ,aAAa;CACrB,AAAQ;CAER,cAAc;AACZ,OAAK,gDAAmBC,gCAAe,KAAK,OAAO,IAAI;;CAGzD,gBAAgB,QAAiB;AAC/B,OAAK,eAAe;;CAGtB,mBAAmB;AACjB,MAAI,KAAK,WAAY;AACrB,OAAK,wBAAwB;AAC7B,OAAK,cAAc;AACnB,OAAK,QAAQ;;CAGf,kBAAkB;AAChB,OAAK,wBAAwB;;CAG/B,OAAO,aAAmC;AACxC,MAAI,KAAK,WAAY;AACrB,OAAK,MAAM,UAAU,aAAa;GAChC,MAAM,QAAQ,KAAK,SAAS,WACzB,MACC,EAAE,kBAAkB,OAAO,iBAAi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C,MAAI,iBAAiB,KAAK,kBACxB;AAEF,OAAK,oBAAoB;AAEzB,MAAI,KAAK,gBAAgB,EACvB,SAAQ,OAAO,MAAM,QAAQ,KAAK,cAAc,GAAG;EAGrD,MAAM,oBAAoB,KAAK,IAAI,KAAK,eAAe,MAAM,OAAO;AACpE,OAAK,IAAI,IAAI,GAAG,IAAI,mBAAmB,KAAK;AAC1C,WAAQ,OAAO,MAAM,UAAU;GAC/B,MAAM,OAAO,MAAM;AACnB,OAAI,SAAS,OACX,SAAQ,OAAO,MAAM,KAAK;AAE5B,WAAQ,OAAO,MAAM,KAAK;;AAG5B,OAAK,gBAAgB,MAAM;;CAG7B,AAAQ,kBAAkB;EACxB,MAAM,YAAY,IAAI,IACpB,KAAK,SACF,QAAQ,MAAM,EAAE,SAAS,QAAQ,CACjC,KAAK,MAAM,EAAE,cAAc,CAC/B;EAED,MAAM,gBAAgB,IAAI,IACxB,KAAK,SACF,QACE,MACC,EAAE,SAAS,YAAY,EAAE,WAAW,WAAW,EAAE,WAAW,SAC/D,CACA,KAAK,MAAM,EAAE,cAAc,CAC/B;EAED,MAAM,aAAa,IAAI,IACrB,KAAK,SACF,QAAQ,MAAM,EAAE,SAAS,SAAS,CAClC,KAAK,MAAM,EAAE,cAAc,CAC/B;EAED,MAAM,iBAAiB,IAAI,IACzB,KAAK,SACF,QACE,MACC,EAAE,SAAS,aACV,EAAE,WAAW,aACZ,EAAE,WAAW,cACb,EAAE,WAAW,SAClB,CACA,KAAK,MAAM,EAAE,cAAc,CAC/B;AAED,SAAO;GACL,YAAY,UAAU;GACtB,WAAW,cAAc;GACzB,aAAa,WAAW;GACxB,YAAY,eAAe;GAC3B,aAAa,KAAK;GAClB,YAAY,KAAK;GAClB"}
@@ -1,3 +1,64 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`node:path`),t=require(`@intlayer/config/logger`);const n=async(n,r)=>{let i=(0,t.getAppLogger)(r),a=n.filter(t=>{let n=(0,e.extname)(t);return[`.ts`,`.tsx`,`.js`,`.jsx`,`.cjs`,`.mjs`,`.json`].includes(n)});if(a.length===0)return;let o;try{o=(await import(`typescript`)).default||await import(`typescript`)}catch{return}let s=o.findConfigFile(r.system?.baseDir??process.cwd(),o.sys.fileExists,`tsconfig.json`),c={noEmit:!0,allowJs:!0,resolveJsonModule:!0};if(s){let t=o.sys.readFile(s);if(t){let n=o.parseConfigFileTextToJson(s,t);if(!n.error){let{incremental:t,tsBuildInfoFile:r,...i}=o.parseJsonConfigFileContent(n.config,o.sys,(0,e.dirname)(s)).options;c={...c,...i,noEmit:!0}}}}let l=o.createProgram(a,c);a.forEach(e=>{let t=l.getSourceFile(e);t&&o.getPreEmitDiagnostics(l,t).forEach(e=>{let t=o.flattenDiagnosticMessageText(e.messageText,`
2
- `);if(e.file&&e.start!==void 0){let{line:n,character:r}=e.file.getLineAndCharacterOfPosition(e.start);i(`TS Error in ${e.file.fileName} (${n+1},${r+1}): ${t}`,{level:`warn`})}})})};exports.logTypeScriptErrors=n;
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let node_path = require("node:path");
4
+ let _intlayer_config_logger = require("@intlayer/config/logger");
5
+
6
+ //#region src/loadDictionaries/logTypeScriptErrors.ts
7
+ const logTypeScriptErrors = async (filePaths, configuration) => {
8
+ const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration);
9
+ const filesToCheck = filePaths.filter((path) => {
10
+ const ext = (0, node_path.extname)(path);
11
+ return [
12
+ ".ts",
13
+ ".tsx",
14
+ ".js",
15
+ ".jsx",
16
+ ".cjs",
17
+ ".mjs",
18
+ ".json"
19
+ ].includes(ext);
20
+ });
21
+ if (filesToCheck.length === 0) return;
22
+ let ts;
23
+ try {
24
+ ts = (await import("typescript")).default || await import("typescript");
25
+ } catch {
26
+ return;
27
+ }
28
+ const configFileName = ts.findConfigFile(configuration.system?.baseDir ?? process.cwd(), ts.sys.fileExists, "tsconfig.json");
29
+ let compilerOptions = {
30
+ noEmit: true,
31
+ allowJs: true,
32
+ resolveJsonModule: true
33
+ };
34
+ if (configFileName) {
35
+ const configFileText = ts.sys.readFile(configFileName);
36
+ if (configFileText) {
37
+ const configJson = ts.parseConfigFileTextToJson(configFileName, configFileText);
38
+ if (!configJson.error) {
39
+ const { incremental, tsBuildInfoFile, ...restOptions } = ts.parseJsonConfigFileContent(configJson.config, ts.sys, (0, node_path.dirname)(configFileName)).options;
40
+ compilerOptions = {
41
+ ...compilerOptions,
42
+ ...restOptions,
43
+ noEmit: true
44
+ };
45
+ }
46
+ }
47
+ }
48
+ const program = ts.createProgram(filesToCheck, compilerOptions);
49
+ filesToCheck.forEach((filePath) => {
50
+ const sourceFile = program.getSourceFile(filePath);
51
+ if (!sourceFile) return;
52
+ ts.getPreEmitDiagnostics(program, sourceFile).forEach((diagnostic) => {
53
+ const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n");
54
+ if (diagnostic.file && diagnostic.start !== void 0) {
55
+ const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
56
+ appLogger(`TS Error in ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`, { level: "warn" });
57
+ }
58
+ });
59
+ });
60
+ };
61
+
62
+ //#endregion
63
+ exports.logTypeScriptErrors = logTypeScriptErrors;
3
64
  //# sourceMappingURL=logTypeScriptErrors.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logTypeScriptErrors.cjs","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"sourcesContent":["import { dirname, extname } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const logTypeScriptErrors = async (\n filePaths: string[],\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration);\n\n const filesToCheck = filePaths.filter((path) => {\n const ext = extname(path);\n\n return ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.json'].includes(\n ext\n );\n });\n\n if (filesToCheck.length === 0) return;\n\n let ts: typeof import('typescript');\n\n try {\n ts = (await import('typescript')).default || (await import('typescript'));\n } catch {\n // TypeScript not installed, skip type checking\n\n return;\n }\n\n const configFileName = ts.findConfigFile(\n configuration.system?.baseDir ?? process.cwd(),\n ts.sys.fileExists,\n 'tsconfig.json'\n );\n\n let compilerOptions: any = {\n noEmit: true,\n\n allowJs: true,\n\n resolveJsonModule: true,\n };\n\n if (configFileName) {\n const configFileText = ts.sys.readFile(configFileName);\n\n if (configFileText) {\n const configJson = ts.parseConfigFileTextToJson(\n configFileName,\n\n configFileText\n );\n\n if (!configJson.error) {\n const parsedConfig = ts.parseJsonConfigFileContent(\n configJson.config,\n\n ts.sys,\n\n dirname(configFileName)\n );\n\n const { incremental, tsBuildInfoFile, ...restOptions } =\n parsedConfig.options;\n\n compilerOptions = { ...compilerOptions, ...restOptions, noEmit: true };\n }\n }\n }\n\n const program = ts.createProgram(filesToCheck, compilerOptions);\n\n filesToCheck.forEach((filePath) => {\n const sourceFile = program.getSourceFile(filePath);\n\n if (!sourceFile) return;\n\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n\n diagnostics.forEach((diagnostic) => {\n const message = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n\n '\\n'\n );\n\n if (diagnostic.file && diagnostic.start !== undefined) {\n const { line, character } =\n diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n\n appLogger(\n `TS Error in ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`,\n\n { level: 'warn' }\n );\n }\n });\n });\n};\n"],"mappings":"oKAIA,MAAa,EAAsB,MACjC,EACA,IACG,CACH,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAc,CAEvC,EAAe,EAAU,OAAQ,GAAS,CAC9C,IAAM,GAAA,EAAA,EAAA,SAAc,EAAK,CAEzB,MAAO,CAAC,MAAO,OAAQ,MAAO,OAAQ,OAAQ,OAAQ,QAAQ,CAAC,SAC7D,EACD,EACD,CAEF,GAAI,EAAa,SAAW,EAAG,OAE/B,IAAI,EAEJ,GAAI,CACF,GAAM,MAAM,OAAO,eAAe,SAAY,MAAM,OAAO,mBACrD,CAGN,OAGF,IAAM,EAAiB,EAAG,eACxB,EAAc,QAAQ,SAAW,QAAQ,KAAK,CAC9C,EAAG,IAAI,WACP,gBACD,CAEG,EAAuB,CACzB,OAAQ,GAER,QAAS,GAET,kBAAmB,GACpB,CAED,GAAI,EAAgB,CAClB,IAAM,EAAiB,EAAG,IAAI,SAAS,EAAe,CAEtD,GAAI,EAAgB,CAClB,IAAM,EAAa,EAAG,0BACpB,EAEA,EACD,CAED,GAAI,CAAC,EAAW,MAAO,CASrB,GAAM,CAAE,cAAa,kBAAiB,GAAG,GARpB,EAAG,2BACtB,EAAW,OAEX,EAAG,KAAA,EAAA,EAAA,SAEK,EAAe,CACxB,CAGc,QAEf,EAAkB,CAAE,GAAG,EAAiB,GAAG,EAAa,OAAQ,GAAM,GAK5E,IAAM,EAAU,EAAG,cAAc,EAAc,EAAgB,CAE/D,EAAa,QAAS,GAAa,CACjC,IAAM,EAAa,EAAQ,cAAc,EAAS,CAE7C,GAEe,EAAG,sBAAsB,EAAS,EAAW,CAErD,QAAS,GAAe,CAClC,IAAM,EAAU,EAAG,6BACjB,EAAW,YAEX;EACD,CAED,GAAI,EAAW,MAAQ,EAAW,QAAU,IAAA,GAAW,CACrD,GAAM,CAAE,OAAM,aACZ,EAAW,KAAK,8BAA8B,EAAW,MAAM,CAEjE,EACE,eAAe,EAAW,KAAK,SAAS,IAAI,EAAO,EAAE,GAAG,EAAY,EAAE,KAAK,IAE3E,CAAE,MAAO,OAAQ,CAClB,GAEH,EACF"}
1
+ {"version":3,"file":"logTypeScriptErrors.cjs","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"sourcesContent":["import { dirname, extname } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const logTypeScriptErrors = async (\n filePaths: string[],\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration);\n\n const filesToCheck = filePaths.filter((path) => {\n const ext = extname(path);\n\n return ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.json'].includes(\n ext\n );\n });\n\n if (filesToCheck.length === 0) return;\n\n let ts: typeof import('typescript');\n\n try {\n ts = (await import('typescript')).default || (await import('typescript'));\n } catch {\n // TypeScript not installed, skip type checking\n\n return;\n }\n\n const configFileName = ts.findConfigFile(\n configuration.system?.baseDir ?? process.cwd(),\n ts.sys.fileExists,\n 'tsconfig.json'\n );\n\n let compilerOptions: any = {\n noEmit: true,\n\n allowJs: true,\n\n resolveJsonModule: true,\n };\n\n if (configFileName) {\n const configFileText = ts.sys.readFile(configFileName);\n\n if (configFileText) {\n const configJson = ts.parseConfigFileTextToJson(\n configFileName,\n\n configFileText\n );\n\n if (!configJson.error) {\n const parsedConfig = ts.parseJsonConfigFileContent(\n configJson.config,\n\n ts.sys,\n\n dirname(configFileName)\n );\n\n const { incremental, tsBuildInfoFile, ...restOptions } =\n parsedConfig.options;\n\n compilerOptions = { ...compilerOptions, ...restOptions, noEmit: true };\n }\n }\n }\n\n const program = ts.createProgram(filesToCheck, compilerOptions);\n\n filesToCheck.forEach((filePath) => {\n const sourceFile = program.getSourceFile(filePath);\n\n if (!sourceFile) return;\n\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n\n diagnostics.forEach((diagnostic) => {\n const message = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n\n '\\n'\n );\n\n if (diagnostic.file && diagnostic.start !== undefined) {\n const { line, character } =\n diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n\n appLogger(\n `TS Error in ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`,\n\n { level: 'warn' }\n );\n }\n });\n });\n};\n"],"mappings":";;;;;;AAIA,MAAa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,EAAE,OAAO,QAAQ,CAClB;;IAEH;GACF"}
@@ -1,3 +1,40 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./utils/formatter.cjs`),n=require(`./utils/runOnce.cjs`);let r=require(`node:path`),i=require(`@intlayer/config/logger`),a=require(`@intlayer/config/node`),o=require(`@intlayer/config/colors`);o=e.t(o);let s=require(`@intlayer/config/env`);const c=e=>{let{configuration:c,customConfiguration:l,numCustomConfiguration:u,configurationFilePath:d}=(0,a.getConfigurationAndFilePath)(e),f=(0,i.getAppLogger)(c);n.runOnce((0,r.join)(c.system.baseDir,`.intlayer`,`cache`,`intlayer-config-locaded.lock`),()=>{if(u===0)f(`Configuration file not found, using default configuration.`,{isVerbose:!0});else{let n=c.system.baseDir,i=(0,r.relative)(n,d);if(u===1){let n=(0,s.getEnvFilePath)(e?.env,e?.envFile);f(`Configuration loaded ${t.formatPath(i)}${n?` - Env: ${t.formatPath(n)}`:``}`,{isVerbose:!0})}else f(`Multiple configuration files found, using ${t.formatPath(i)}.`,{isVerbose:!0})}if(l){let e=a.intlayerConfigSchema.safeParse(l);e.success||f(`${i.x} Invalid configuration:\n${e.error.issues.map(e=>`${(0,i.colorizePath)(` - ${e.path.join(`.`)}:`)} ${(0,i.colorize)(e.message,o.GREY_DARK)}`).join(`
2
- `)}`),l.build?.importMode&&f(`${(0,i.colorize)(`build.importMode`,o.BLUE)} is deprecated, use ${(0,i.colorize)(`dictionary.importMode`,o.BLUE)} instead`),l.compiler?.transformPattern&&f(`${(0,i.colorize)(`compiler.transformPattern`,o.BLUE)} is deprecated, use ${(0,i.colorize)(`build.traversePattern`,o.BLUE)} instead`),l.compiler?.excludePattern&&f(`${(0,i.colorize)(`compiler.excludePattern`,o.BLUE)} is deprecated, use ${(0,i.colorize)(`build.traversePattern`,o.BLUE)} instead`)}},{cacheTimeoutMs:1e3*60})};exports.logConfigDetails=c;
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_utils_runOnce = require('./utils/runOnce.cjs');
5
+ let node_path = require("node:path");
6
+ let _intlayer_config_logger = require("@intlayer/config/logger");
7
+ let _intlayer_config_node = require("@intlayer/config/node");
8
+ let _intlayer_config_colors = require("@intlayer/config/colors");
9
+ _intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
10
+ let _intlayer_config_env = require("@intlayer/config/env");
11
+
12
+ //#region src/logConfigDetails.ts
13
+ const logConfigDetails = (options) => {
14
+ const { configuration, customConfiguration, numCustomConfiguration, configurationFilePath } = (0, _intlayer_config_node.getConfigurationAndFilePath)(options);
15
+ const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration);
16
+ require_utils_runOnce.runOnce((0, node_path.join)(configuration.system.baseDir, ".intlayer", "cache", "intlayer-config-locaded.lock"), () => {
17
+ if (numCustomConfiguration === 0) appLogger("Configuration file not found, using default configuration.", { isVerbose: true });
18
+ else {
19
+ const baseDir = configuration.system.baseDir;
20
+ const relativeOutputPath = (0, node_path.relative)(baseDir, configurationFilePath);
21
+ if (numCustomConfiguration === 1) {
22
+ const dotEnvFilePath = (0, _intlayer_config_env.getEnvFilePath)(options?.env, options?.envFile);
23
+ appLogger(`Configuration loaded ${require_utils_formatter.formatPath(relativeOutputPath)}${dotEnvFilePath ? ` - Env: ${require_utils_formatter.formatPath(dotEnvFilePath)}` : ""}`, { isVerbose: true });
24
+ } else appLogger(`Multiple configuration files found, using ${require_utils_formatter.formatPath(relativeOutputPath)}.`, { isVerbose: true });
25
+ }
26
+ if (customConfiguration) {
27
+ const validation = _intlayer_config_node.intlayerConfigSchema.safeParse(customConfiguration);
28
+ if (!validation.success) appLogger(`${_intlayer_config_logger.x} Invalid configuration:\n${validation.error.issues.map((error) => {
29
+ return `${(0, _intlayer_config_logger.colorizePath)(` - ${error.path.join(".")}:`)} ${(0, _intlayer_config_logger.colorize)(error.message, _intlayer_config_colors.GREY_DARK)}`;
30
+ }).join("\n")}`);
31
+ if (customConfiguration.build?.importMode) appLogger(`${(0, _intlayer_config_logger.colorize)("build.importMode", _intlayer_config_colors.BLUE)} is deprecated, use ${(0, _intlayer_config_logger.colorize)("dictionary.importMode", _intlayer_config_colors.BLUE)} instead`);
32
+ if (customConfiguration.compiler?.transformPattern) appLogger(`${(0, _intlayer_config_logger.colorize)("compiler.transformPattern", _intlayer_config_colors.BLUE)} is deprecated, use ${(0, _intlayer_config_logger.colorize)("build.traversePattern", _intlayer_config_colors.BLUE)} instead`);
33
+ if (customConfiguration.compiler?.excludePattern) appLogger(`${(0, _intlayer_config_logger.colorize)("compiler.excludePattern", _intlayer_config_colors.BLUE)} is deprecated, use ${(0, _intlayer_config_logger.colorize)("build.traversePattern", _intlayer_config_colors.BLUE)} instead`);
34
+ }
35
+ }, { cacheTimeoutMs: 1e3 * 60 });
36
+ };
37
+
38
+ //#endregion
39
+ exports.logConfigDetails = logConfigDetails;
3
40
  //# sourceMappingURL=logConfigDetails.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logConfigDetails.cjs","names":["formatPath","intlayerConfigSchema","x","ANSIColors"],"sources":["../../src/logConfigDetails.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport {\n colorize,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfigurationAndFilePath,\n intlayerConfigSchema,\n} from '@intlayer/config/node';\nimport { formatPath, runOnce } from './utils';\n\nexport const logConfigDetails = (options?: GetConfigurationOptions) => {\n const {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n } = getConfigurationAndFilePath(options);\n const appLogger = getAppLogger(configuration);\n\n runOnce(\n join(\n configuration.system.baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-config-locaded.lock'\n ),\n () => {\n if (numCustomConfiguration === 0) {\n appLogger(\n 'Configuration file not found, using default configuration.',\n {\n isVerbose: true,\n }\n );\n } else {\n const baseDir = configuration.system.baseDir;\n const relativeOutputPath = relative(baseDir, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n const dotEnvFilePath = getEnvFilePath(options?.env, options?.envFile);\n\n appLogger(\n `Configuration loaded ${formatPath(relativeOutputPath)}${dotEnvFilePath ? ` - Env: ${formatPath(dotEnvFilePath)}` : ''}`,\n {\n isVerbose: true,\n }\n );\n } else {\n appLogger(\n `Multiple configuration files found, using ${formatPath(relativeOutputPath)}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n\n if (customConfiguration) {\n const validation = intlayerConfigSchema.safeParse(customConfiguration);\n\n if (!validation.success) {\n const errorMessages = validation.error.issues\n .map((error) => {\n const path = colorizePath(` - ${error.path.join('.')}:`);\n const message = colorize(error.message, ANSIColors.GREY_DARK);\n return `${path} ${message}`;\n })\n .join('\\n');\n const errorMessage = `${x} Invalid configuration:\\n${errorMessages}`;\n\n appLogger(errorMessage);\n }\n\n if (customConfiguration.build?.importMode) {\n appLogger(\n `${colorize('build.importMode', ANSIColors.BLUE)} is deprecated, use ${colorize('dictionary.importMode', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.transformPattern) {\n appLogger(\n `${colorize('compiler.transformPattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.excludePattern) {\n appLogger(\n `${colorize('compiler.excludePattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n }\n },\n {\n cacheTimeoutMs: 1000 * 60, // 1 minute\n }\n );\n};\n"],"mappings":"sWAgBA,MAAa,EAAoB,GAAsC,CACrE,GAAM,CACJ,gBACA,sBACA,yBACA,0BAAA,EAAA,EAAA,6BAC8B,EAAQ,CAClC,GAAA,EAAA,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AAK,CAAC,UAClI,GAIP,CACE,eAAgB,IAAO,GACxB,CACF"}
1
+ {"version":3,"file":"logConfigDetails.cjs","names":["formatPath","intlayerConfigSchema","x","ANSIColors"],"sources":["../../src/logConfigDetails.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport {\n colorize,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfigurationAndFilePath,\n intlayerConfigSchema,\n} from '@intlayer/config/node';\nimport { formatPath, runOnce } from './utils';\n\nexport const logConfigDetails = (options?: GetConfigurationOptions) => {\n const {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n } = getConfigurationAndFilePath(options);\n const appLogger = getAppLogger(configuration);\n\n runOnce(\n join(\n configuration.system.baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-config-locaded.lock'\n ),\n () => {\n if (numCustomConfiguration === 0) {\n appLogger(\n 'Configuration file not found, using default configuration.',\n {\n isVerbose: true,\n }\n );\n } else {\n const baseDir = configuration.system.baseDir;\n const relativeOutputPath = relative(baseDir, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n const dotEnvFilePath = getEnvFilePath(options?.env, options?.envFile);\n\n appLogger(\n `Configuration loaded ${formatPath(relativeOutputPath)}${dotEnvFilePath ? ` - Env: ${formatPath(dotEnvFilePath)}` : ''}`,\n {\n isVerbose: true,\n }\n );\n } else {\n appLogger(\n `Multiple configuration files found, using ${formatPath(relativeOutputPath)}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n\n if (customConfiguration) {\n const validation = intlayerConfigSchema.safeParse(customConfiguration);\n\n if (!validation.success) {\n const errorMessages = validation.error.issues\n .map((error) => {\n const path = colorizePath(` - ${error.path.join('.')}:`);\n const message = colorize(error.message, ANSIColors.GREY_DARK);\n return `${path} ${message}`;\n })\n .join('\\n');\n const errorMessage = `${x} Invalid configuration:\\n${errorMessages}`;\n\n appLogger(errorMessage);\n }\n\n if (customConfiguration.build?.importMode) {\n appLogger(\n `${colorize('build.importMode', ANSIColors.BLUE)} is deprecated, use ${colorize('dictionary.importMode', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.transformPattern) {\n appLogger(\n `${colorize('compiler.transformPattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.excludePattern) {\n appLogger(\n `${colorize('compiler.excludePattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n }\n },\n {\n cacheTimeoutMs: 1000 * 60, // 1 minute\n }\n );\n};\n"],"mappings":";;;;;;;;;;;;AAgBA,MAAa,oBAAoB,YAAsC;CACrE,MAAM,EACJ,eACA,qBACA,wBACA,iFAC8B,QAAQ;CACxC,MAAM,sDAAyB,cAAc;AAE7C,mDAEI,cAAc,OAAO,SACrB,aACA,SACA,+BACD,QACK;AACJ,MAAI,2BAA2B,EAC7B,WACE,8DACA,EACE,WAAW,MACZ,CACF;OACI;GACL,MAAM,UAAU,cAAc,OAAO;GACrC,MAAM,6CAA8B,SAAS,sBAAuB;AAEpE,OAAI,2BAA2B,GAAG;IAChC,MAAM,0DAAgC,SAAS,KAAK,SAAS,QAAQ;AAErE,cACE,wBAAwBA,mCAAW,mBAAmB,GAAG,iBAAiB,WAAWA,mCAAW,eAAe,KAAK,MACpH,EACE,WAAW,MACZ,CACF;SAED,WACE,6CAA6CA,mCAAW,mBAAmB,CAAC,IAC5E,EACE,WAAW,MACZ,CACF;;AAIL,MAAI,qBAAqB;GACvB,MAAM,aAAaC,2CAAqB,UAAU,oBAAoB;AAEtE,OAAI,CAAC,WAAW,QAUd,WAFqB,GAAGC,0BAAE,2BAPJ,WAAW,MAAM,OACpC,KAAK,UAAU;AAGd,WAAO,6CAFmB,MAAM,MAAM,KAAK,KAAK,IAAI,CAA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