@intlayer/chokidar 8.1.2 → 8.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (396) hide show
  1. package/dist/assets/installSkills/skills/angular.md +3 -0
  2. package/dist/assets/installSkills/skills/astro.md +3 -0
  3. package/dist/assets/installSkills/skills/cli.md +7 -4
  4. package/dist/assets/installSkills/skills/config.md +3 -0
  5. package/dist/assets/installSkills/skills/content.md +3 -0
  6. package/dist/assets/installSkills/skills/next_js.md +3 -0
  7. package/dist/assets/installSkills/skills/preact.md +3 -2
  8. package/dist/assets/installSkills/skills/react.md +3 -0
  9. package/dist/assets/installSkills/skills/solid.md +3 -0
  10. package/dist/assets/installSkills/skills/svelte.md +3 -0
  11. package/dist/assets/installSkills/skills/usage.md +2 -0
  12. package/dist/assets/installSkills/skills/vue.md +3 -0
  13. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
  14. package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
  15. package/dist/cjs/build.cjs +1 -51
  16. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +1 -53
  17. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
  18. package/dist/cjs/buildIntlayerDictionary/index.cjs +1 -6
  19. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +1 -26
  20. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
  21. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +4 -78
  22. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
  23. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +4 -62
  24. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
  25. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -46
  26. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
  27. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +1 -50
  28. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
  29. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +1 -59
  30. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
  31. package/dist/cjs/cleanOutputDir.cjs +1 -30
  32. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  33. package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -96
  34. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
  35. package/dist/cjs/cli.cjs +1 -21
  36. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -70
  37. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
  38. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +7 -41
  39. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
  40. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +1 -23
  41. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
  42. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +1 -24
  43. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
  44. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +1 -24
  45. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
  46. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +1 -23
  47. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
  48. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +1 -23
  49. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
  50. package/dist/cjs/createDictionaryEntryPoint/index.cjs +1 -16
  51. package/dist/cjs/createType/createModuleAugmentation.cjs +9 -110
  52. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
  53. package/dist/cjs/createType/createType.cjs +1 -29
  54. package/dist/cjs/createType/createType.cjs.map +1 -1
  55. package/dist/cjs/createType/index.cjs +1 -8
  56. package/dist/cjs/fetchDistantDictionaries.cjs +1 -50
  57. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  58. package/dist/cjs/filterInvalidDictionaries.cjs +1 -49
  59. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
  60. package/dist/cjs/formatDictionary.cjs +1 -49
  61. package/dist/cjs/formatDictionary.cjs.map +1 -1
  62. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +1 -39
  63. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
  64. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +1 -34
  65. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
  66. package/dist/cjs/handleContentDeclarationFileChange.cjs +1 -49
  67. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
  68. package/dist/cjs/handleContentDeclarationFileMoved.cjs +1 -24
  69. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
  70. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -37
  71. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
  72. package/dist/cjs/index.cjs +1 -131
  73. package/dist/cjs/init/index.cjs +1 -242
  74. package/dist/cjs/init/index.cjs.map +1 -1
  75. package/dist/cjs/init/utils/configManipulation.cjs +1 -164
  76. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
  77. package/dist/cjs/init/utils/fileSystem.cjs +1 -30
  78. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
  79. package/dist/cjs/init/utils/index.cjs +1 -13
  80. package/dist/cjs/init/utils/jsonParser.cjs +3 -42
  81. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
  82. package/dist/cjs/init/utils/tsConfig.cjs +1 -18
  83. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
  84. package/dist/cjs/initConfig/index.cjs +1 -38
  85. package/dist/cjs/initConfig/index.cjs.map +1 -1
  86. package/dist/cjs/installSkills/index.cjs +1 -172
  87. package/dist/cjs/installSkills/index.cjs.map +1 -1
  88. package/dist/cjs/listDictionariesPath.cjs +1 -41
  89. package/dist/cjs/listDictionariesPath.cjs.map +1 -1
  90. package/dist/cjs/listGitFiles.cjs +5 -95
  91. package/dist/cjs/listGitFiles.cjs.map +1 -1
  92. package/dist/cjs/listProjects.cjs +1 -47
  93. package/dist/cjs/listProjects.cjs.map +1 -1
  94. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -66
  95. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
  96. package/dist/cjs/loadDictionaries/index.cjs +1 -12
  97. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -72
  98. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
  99. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -125
  100. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  101. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -28
  102. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
  103. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +1 -61
  104. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
  105. package/dist/cjs/loadDictionaries/log.cjs +3 -135
  106. package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
  107. package/dist/cjs/prepareIntlayer.cjs +1 -95
  108. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  109. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +1 -30
  110. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
  111. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +1 -12
  112. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
  113. package/dist/cjs/transformFiles/extractDictionaryKey.cjs +1 -16
  114. package/dist/cjs/transformFiles/extractDictionaryKey.cjs.map +1 -1
  115. package/dist/cjs/transformFiles/index.cjs +1 -10
  116. package/dist/cjs/transformFiles/transformFiles.cjs +1 -251
  117. package/dist/cjs/transformFiles/transformFiles.cjs.map +1 -1
  118. package/dist/cjs/utils/autoDecorateContent.cjs +1 -87
  119. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
  120. package/dist/cjs/utils/buildFilesList.cjs +1 -50
  121. package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
  122. package/dist/cjs/utils/chunkJSON.cjs +1 -336
  123. package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
  124. package/dist/cjs/utils/formatter.cjs +1 -16
  125. package/dist/cjs/utils/formatter.cjs.map +1 -1
  126. package/dist/cjs/utils/getChunk.cjs +1 -34
  127. package/dist/cjs/utils/getChunk.cjs.map +1 -1
  128. package/dist/cjs/utils/getComponentTransformPattern.cjs +1 -48
  129. package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
  130. package/dist/cjs/utils/getFileHash.cjs +1 -12
  131. package/dist/cjs/utils/getFileHash.cjs.map +1 -1
  132. package/dist/cjs/utils/getFormatFromExtension.cjs +1 -31
  133. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
  134. package/dist/cjs/utils/index.cjs +1 -46
  135. package/dist/cjs/utils/pLimit.cjs +1 -128
  136. package/dist/cjs/utils/pLimit.cjs.map +1 -1
  137. package/dist/cjs/utils/parallelize.cjs +1 -11
  138. package/dist/cjs/utils/parallelize.cjs.map +1 -1
  139. package/dist/cjs/utils/parallelizeGlobal.cjs +1 -29
  140. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
  141. package/dist/cjs/utils/reduceObjectFormat.cjs +1 -31
  142. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
  143. package/dist/cjs/utils/resolveObjectPromises.cjs +1 -21
  144. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
  145. package/dist/cjs/utils/runOnce.cjs +1 -95
  146. package/dist/cjs/utils/runOnce.cjs.map +1 -1
  147. package/dist/cjs/utils/runParallel/bin.cjs +1 -54
  148. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
  149. package/dist/cjs/utils/runParallel/bootstrap.cjs +1 -24
  150. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
  151. package/dist/cjs/utils/runParallel/index.cjs +1 -110
  152. package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
  153. package/dist/cjs/utils/runParallel/pidTree.cjs +1 -145
  154. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
  155. package/dist/cjs/utils/runParallel/ps.cjs +1 -49
  156. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
  157. package/dist/cjs/utils/runParallel/runTask.cjs +1 -154
  158. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
  159. package/dist/cjs/utils/runParallel/spawnPosix.cjs +1 -59
  160. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
  161. package/dist/cjs/utils/runParallel/spawnWin32.cjs +1 -43
  162. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
  163. package/dist/cjs/utils/runParallel/wmic.cjs +1 -52
  164. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
  165. package/dist/cjs/utils/sortAlphabetically.cjs +1 -7
  166. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
  167. package/dist/cjs/utils/splitTextByLine.cjs +1 -11
  168. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
  169. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +1 -60
  170. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
  171. package/dist/cjs/watcher.cjs +1 -95
  172. package/dist/cjs/watcher.cjs.map +1 -1
  173. package/dist/cjs/writeConfiguration/index.cjs +1 -34
  174. package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
  175. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +1 -28
  176. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
  177. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs +1 -31
  178. package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs.map +1 -1
  179. package/dist/cjs/writeContentDeclaration/index.cjs +1 -12
  180. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +1 -93
  181. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
  182. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +2 -1775
  183. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
  184. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +1 -77
  185. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
  186. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -123
  187. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  188. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +1 -71
  189. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
  190. package/dist/cjs/writeFileIfChanged.cjs +1 -12
  191. package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
  192. package/dist/cjs/writeJsonIfChanged.cjs +1 -17
  193. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
  194. package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
  195. package/dist/esm/_virtual/_utils_asset.mjs +2 -97
  196. package/dist/esm/build.mjs +1 -24
  197. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +1 -51
  198. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
  199. package/dist/esm/buildIntlayerDictionary/index.mjs +1 -4
  200. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +1 -24
  201. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
  202. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +4 -75
  203. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
  204. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +4 -59
  205. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
  206. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -44
  207. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
  208. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +1 -48
  209. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
  210. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +1 -56
  211. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
  212. package/dist/esm/cleanOutputDir.mjs +1 -28
  213. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  214. package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -93
  215. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
  216. package/dist/esm/cli.mjs +1 -8
  217. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -68
  218. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
  219. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +7 -39
  220. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
  221. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +1 -20
  222. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
  223. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +1 -21
  224. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
  225. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +1 -21
  226. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
  227. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +1 -20
  228. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
  229. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +1 -20
  230. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
  231. package/dist/esm/createDictionaryEntryPoint/index.mjs +1 -9
  232. package/dist/esm/createType/createModuleAugmentation.mjs +9 -106
  233. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
  234. package/dist/esm/createType/createType.mjs +1 -26
  235. package/dist/esm/createType/createType.mjs.map +1 -1
  236. package/dist/esm/createType/index.mjs +1 -4
  237. package/dist/esm/fetchDistantDictionaries.mjs +1 -48
  238. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  239. package/dist/esm/filterInvalidDictionaries.mjs +1 -46
  240. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
  241. package/dist/esm/formatDictionary.mjs +1 -44
  242. package/dist/esm/formatDictionary.mjs.map +1 -1
  243. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +1 -37
  244. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
  245. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +1 -32
  246. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
  247. package/dist/esm/handleContentDeclarationFileChange.mjs +1 -47
  248. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
  249. package/dist/esm/handleContentDeclarationFileMoved.mjs +1 -22
  250. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
  251. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -35
  252. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
  253. package/dist/esm/index.mjs +1 -57
  254. package/dist/esm/init/index.mjs +1 -240
  255. package/dist/esm/init/index.mjs.map +1 -1
  256. package/dist/esm/init/utils/configManipulation.mjs +1 -161
  257. package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
  258. package/dist/esm/init/utils/fileSystem.mjs +1 -26
  259. package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
  260. package/dist/esm/init/utils/index.mjs +1 -6
  261. package/dist/esm/init/utils/jsonParser.mjs +3 -40
  262. package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
  263. package/dist/esm/init/utils/tsConfig.mjs +1 -16
  264. package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
  265. package/dist/esm/initConfig/index.mjs +1 -36
  266. package/dist/esm/initConfig/index.mjs.map +1 -1
  267. package/dist/esm/installSkills/index.mjs +1 -167
  268. package/dist/esm/installSkills/index.mjs.map +1 -1
  269. package/dist/esm/listDictionariesPath.mjs +1 -37
  270. package/dist/esm/listDictionariesPath.mjs.map +1 -1
  271. package/dist/esm/listGitFiles.mjs +5 -90
  272. package/dist/esm/listGitFiles.mjs.map +1 -1
  273. package/dist/esm/listProjects.mjs +1 -43
  274. package/dist/esm/listProjects.mjs.map +1 -1
  275. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -65
  276. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
  277. package/dist/esm/loadDictionaries/index.mjs +1 -6
  278. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -69
  279. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
  280. package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -123
  281. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  282. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -26
  283. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
  284. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +1 -58
  285. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
  286. package/dist/esm/loadDictionaries/log.mjs +3 -132
  287. package/dist/esm/loadDictionaries/log.mjs.map +1 -1
  288. package/dist/esm/prepareIntlayer.mjs +1 -92
  289. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  290. package/dist/esm/reduceDictionaryContent/applyMask.mjs +1 -28
  291. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
  292. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +1 -10
  293. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
  294. package/dist/esm/transformFiles/extractDictionaryKey.mjs +1 -14
  295. package/dist/esm/transformFiles/extractDictionaryKey.mjs.map +1 -1
  296. package/dist/esm/transformFiles/index.mjs +1 -4
  297. package/dist/esm/transformFiles/transformFiles.mjs +1 -244
  298. package/dist/esm/transformFiles/transformFiles.mjs.map +1 -1
  299. package/dist/esm/utils/autoDecorateContent.mjs +1 -85
  300. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
  301. package/dist/esm/utils/buildFilesList.mjs +1 -47
  302. package/dist/esm/utils/buildFilesList.mjs.map +1 -1
  303. package/dist/esm/utils/chunkJSON.mjs +1 -333
  304. package/dist/esm/utils/chunkJSON.mjs.map +1 -1
  305. package/dist/esm/utils/formatter.mjs +1 -12
  306. package/dist/esm/utils/formatter.mjs.map +1 -1
  307. package/dist/esm/utils/getChunk.mjs +1 -33
  308. package/dist/esm/utils/getChunk.mjs.map +1 -1
  309. package/dist/esm/utils/getComponentTransformPattern.mjs +1 -44
  310. package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
  311. package/dist/esm/utils/getFileHash.mjs +1 -9
  312. package/dist/esm/utils/getFileHash.mjs.map +1 -1
  313. package/dist/esm/utils/getFormatFromExtension.mjs +1 -28
  314. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
  315. package/dist/esm/utils/index.mjs +1 -20
  316. package/dist/esm/utils/pLimit.mjs +1 -125
  317. package/dist/esm/utils/pLimit.mjs.map +1 -1
  318. package/dist/esm/utils/parallelize.mjs +1 -10
  319. package/dist/esm/utils/parallelize.mjs.map +1 -1
  320. package/dist/esm/utils/parallelizeGlobal.mjs +1 -26
  321. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
  322. package/dist/esm/utils/reduceObjectFormat.mjs +1 -29
  323. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
  324. package/dist/esm/utils/resolveObjectPromises.mjs +1 -19
  325. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
  326. package/dist/esm/utils/runOnce.mjs +1 -92
  327. package/dist/esm/utils/runOnce.mjs.map +1 -1
  328. package/dist/esm/utils/runParallel/bin.mjs +1 -52
  329. package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
  330. package/dist/esm/utils/runParallel/bootstrap.mjs +1 -22
  331. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
  332. package/dist/esm/utils/runParallel/index.mjs +1 -108
  333. package/dist/esm/utils/runParallel/index.mjs.map +1 -1
  334. package/dist/esm/utils/runParallel/pidTree.mjs +1 -142
  335. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
  336. package/dist/esm/utils/runParallel/ps.mjs +1 -46
  337. package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
  338. package/dist/esm/utils/runParallel/runTask.mjs +1 -152
  339. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
  340. package/dist/esm/utils/runParallel/spawnPosix.mjs +1 -57
  341. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
  342. package/dist/esm/utils/runParallel/spawnWin32.mjs +1 -41
  343. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
  344. package/dist/esm/utils/runParallel/wmic.mjs +1 -49
  345. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
  346. package/dist/esm/utils/sortAlphabetically.mjs +1 -5
  347. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
  348. package/dist/esm/utils/splitTextByLine.mjs +1 -9
  349. package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
  350. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +1 -58
  351. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
  352. package/dist/esm/watcher.mjs +1 -92
  353. package/dist/esm/watcher.mjs.map +1 -1
  354. package/dist/esm/writeConfiguration/index.mjs +1 -31
  355. package/dist/esm/writeConfiguration/index.mjs.map +1 -1
  356. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +1 -26
  357. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
  358. package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +1 -29
  359. package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +1 -1
  360. package/dist/esm/writeContentDeclaration/index.mjs +1 -7
  361. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +1 -91
  362. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
  363. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +2 -1773
  364. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
  365. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +1 -75
  366. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
  367. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -121
  368. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  369. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +1 -69
  370. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
  371. package/dist/esm/writeFileIfChanged.mjs +1 -10
  372. package/dist/esm/writeFileIfChanged.mjs.map +1 -1
  373. package/dist/esm/writeJsonIfChanged.mjs +1 -16
  374. package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
  375. package/dist/types/build.d.ts +3 -1
  376. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
  377. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
  378. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
  379. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
  380. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
  381. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
  382. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  383. package/dist/types/index.d.ts +16 -24
  384. package/dist/types/initConfig/index.d.ts +1 -1
  385. package/dist/types/initConfig/index.d.ts.map +1 -1
  386. package/dist/types/listGitFiles.d.ts.map +1 -1
  387. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -1
  388. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
  389. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  390. package/dist/types/transformFiles/transformFiles.d.ts +1 -1
  391. package/dist/types/transformFiles/transformFiles.d.ts.map +1 -1
  392. package/dist/types/utils/formatter.d.ts +1 -1
  393. package/dist/types/watcher.d.ts +1 -1
  394. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
  395. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
  396. package/package.json +10 -15
@@ -1 +1 @@
1
- {"version":3,"file":"getContentDeclarationFileTemplate.mjs","names":[],"sources":["../../../src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts"],"sourcesContent":["import { readAsset } from 'utils:asset';\nimport { kebabCaseToCamelCase } from '@intlayer/config';\nimport type { Format } from '../utils/getFormatFromExtension';\n\nexport const getContentDeclarationFileTemplate = async (\n key: string,\n format: Format,\n fileParams: Record<string, any> = {}\n) => {\n let fileTemplate: string;\n\n switch (format) {\n case 'ts':\n fileTemplate = './tsTemplate.txt';\n break;\n case 'cjs':\n fileTemplate = './cjsTemplate.txt';\n break;\n case 'json':\n case 'jsonc':\n case 'json5':\n fileTemplate = './jsonTemplate.txt';\n break;\n default:\n fileTemplate = './esmTemplate.txt';\n break;\n }\n\n const fileContent = readAsset(fileTemplate);\n const camelCaseKey = kebabCaseToCamelCase(key);\n const nonCapitalizedCamelCaseKey =\n camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\n const fileParamsString = Object.entries(fileParams)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => {\n const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key)\n ? key\n : JSON.stringify(key);\n\n if (typeof value === 'object') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return `\\n ${formattedKey}: ${value},`;\n }\n\n if (typeof value === 'string') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n return `\\n ${formattedKey}: ${value},`;\n })\n .join('');\n\n return fileContent\n .replace('{{key}}', key)\n .replaceAll('{{name}}', nonCapitalizedCamelCaseKey)\n .replace('{{fileParams}}', fileParamsString);\n};\n"],"mappings":";;;;AAIA,MAAa,oCAAoC,OAC/C,KACA,QACA,aAAkC,EAAE,KACjC;CACH,IAAI;AAEJ,SAAQ,QAAR;EACE,KAAK;AACH,kBAAe;AACf;EACF,KAAK;AACH,kBAAe;AACf;EACF,KAAK;EACL,KAAK;EACL,KAAK;AACH,kBAAe;AACf;EACF;AACE,kBAAe;AACf;;CAGJ,MAAM,cAAc,UAAU,aAAa;CAC3C,MAAM,eAAe,qBAAqB,IAAI;CAC9C,MAAM,6BACJ,aAAa,OAAO,EAAE,CAAC,aAAa,GAAG,aAAa,MAAM,EAAE;CAE9D,MAAM,mBAAmB,OAAO,QAAQ,WAAW,CAChD,QAAQ,GAAG,WAAW,UAAU,OAAU,CAC1C,KAAK,CAAC,KAAK,WAAW;EACrB,MAAM,eAAe,6BAA6B,KAAK,IAAI,GACvD,MACA,KAAK,UAAU,IAAI;AAEvB,MAAI,OAAO,UAAU,SACnB,QAAO,OAAO,aAAa,IAAI,KAAK,UAAU,MAAM,CAAC;AAGvD,MAAI,OAAO,UAAU,aAAa,OAAO,UAAU,SACjD,QAAO,OAAO,aAAa,IAAI,MAAM;AAGvC,MAAI,OAAO,UAAU,SACnB,QAAO,OAAO,aAAa,IAAI,KAAK,UAAU,MAAM,CAAC;AAGvD,SAAO,OAAO,aAAa,IAAI,MAAM;GACrC,CACD,KAAK,GAAG;AAEX,QAAO,YACJ,QAAQ,WAAW,IAAI,CACvB,WAAW,YAAY,2BAA2B,CAClD,QAAQ,kBAAkB,iBAAiB"}
1
+ {"version":3,"file":"getContentDeclarationFileTemplate.mjs","names":[],"sources":["../../../src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts"],"sourcesContent":["import { readAsset } from 'utils:asset';\nimport { kebabCaseToCamelCase } from '@intlayer/config/utils';\nimport type { Format } from '../utils/getFormatFromExtension';\n\nexport const getContentDeclarationFileTemplate = async (\n key: string,\n format: Format,\n fileParams: Record<string, any> = {}\n) => {\n let fileTemplate: string;\n\n switch (format) {\n case 'ts':\n fileTemplate = './tsTemplate.txt';\n break;\n case 'cjs':\n fileTemplate = './cjsTemplate.txt';\n break;\n case 'json':\n case 'jsonc':\n case 'json5':\n fileTemplate = './jsonTemplate.txt';\n break;\n default:\n fileTemplate = './esmTemplate.txt';\n break;\n }\n\n const fileContent = readAsset(fileTemplate);\n const camelCaseKey = kebabCaseToCamelCase(key);\n const nonCapitalizedCamelCaseKey =\n camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\n const fileParamsString = Object.entries(fileParams)\n .filter(([, value]) => value !== undefined)\n .map(([key, value]) => {\n const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(key)\n ? key\n : JSON.stringify(key);\n\n if (typeof value === 'object') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n if (typeof value === 'boolean' || typeof value === 'number') {\n return `\\n ${formattedKey}: ${value},`;\n }\n\n if (typeof value === 'string') {\n return `\\n ${formattedKey}: ${JSON.stringify(value)},`;\n }\n\n return `\\n ${formattedKey}: ${value},`;\n })\n .join('');\n\n return fileContent\n .replace('{{key}}', key)\n .replaceAll('{{name}}', nonCapitalizedCamelCaseKey)\n .replace('{{fileParams}}', fileParamsString);\n};\n"],"mappings":"uHAIA,MAAa,EAAoC,MAC/C,EACA,EACA,EAAkC,EAAE,GACjC,CACH,IAAI,EAEJ,OAAQ,EAAR,CACE,IAAK,KACH,EAAe,mBACf,MACF,IAAK,MACH,EAAe,oBACf,MACF,IAAK,OACL,IAAK,QACL,IAAK,QACH,EAAe,qBACf,MACF,QACE,EAAe,oBACf,MAGJ,IAAM,EAAc,EAAU,EAAa,CACrC,EAAe,EAAqB,EAAI,CACxC,EACJ,EAAa,OAAO,EAAE,CAAC,aAAa,CAAG,EAAa,MAAM,EAAE,CAExD,EAAmB,OAAO,QAAQ,EAAW,CAChD,QAAQ,EAAG,KAAW,IAAU,IAAA,GAAU,CAC1C,KAAK,CAAC,EAAK,KAAW,CACrB,IAAM,EAAe,6BAA6B,KAAK,EAAI,CACvD,EACA,KAAK,UAAU,EAAI,CAcvB,OAZI,OAAO,GAAU,SACZ,OAAO,EAAa,IAAI,KAAK,UAAU,EAAM,CAAC,GAGnD,OAAO,GAAU,WAAa,OAAO,GAAU,SAC1C,OAAO,EAAa,IAAI,EAAM,GAGnC,OAAO,GAAU,SACZ,OAAO,EAAa,IAAI,KAAK,UAAU,EAAM,CAAC,GAGhD,OAAO,EAAa,IAAI,EAAM,IACrC,CACD,KAAK,GAAG,CAEX,OAAO,EACJ,QAAQ,UAAW,EAAI,CACvB,WAAW,WAAY,EAA2B,CAClD,QAAQ,iBAAkB,EAAiB"}
@@ -1,33 +1,2 @@
1
- import { formatPath } from "./utils/formatter.mjs";
2
- import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
3
- import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
4
- import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
5
- import { createTypes } from "./createType/createType.mjs";
6
- import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
7
- import { getAppLogger } from "@intlayer/config";
8
-
9
- //#region src/handleAdditionalContentDeclarationFile.ts
10
- const handleAdditionalContentDeclarationFile = async (filePath, config) => {
11
- const appLogger = getAppLogger(config);
12
- appLogger(`Additional file detected: ${formatPath(filePath)}`, { isVerbose: true });
13
- const dictionariesOutput = await buildDictionary(await loadLocalDictionaries(filePath, config), config);
14
- await createTypes(Object.values(dictionariesOutput?.mergedDictionaries ?? {}).map((dictionary) => dictionary.dictionary), config);
15
- await createDictionaryEntryPoint(config);
16
- appLogger("Dictionaries built", { isVerbose: true });
17
- createModuleAugmentation(config);
18
- appLogger("Module augmentation built", { isVerbose: true });
19
- for await (const plugin of config.plugins ?? []) {
20
- const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
21
- await plugin.afterBuild?.({
22
- dictionaries: {
23
- unmergedDictionaries,
24
- mergedDictionaries
25
- },
26
- configuration: config
27
- });
28
- }
29
- };
30
-
31
- //#endregion
32
- export { handleAdditionalContentDeclarationFile };
1
+ import{formatPath as e}from"./utils/formatter.mjs";import{buildDictionary as t}from"./buildIntlayerDictionary/buildIntlayerDictionary.mjs";import{createDictionaryEntryPoint as n}from"./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";import{createModuleAugmentation as r}from"./createType/createModuleAugmentation.mjs";import{createTypes as i}from"./createType/createType.mjs";import{loadLocalDictionaries as a}from"./loadDictionaries/loadLocalDictionaries.mjs";import{getAppLogger as o}from"@intlayer/config/logger";const s=async(s,c)=>{let l=o(c);l(`Additional file detected: ${e(s)}`,{isVerbose:!0});let u=await t(await a(s,c),c);await i(Object.values(u?.mergedDictionaries??{}).map(e=>e.dictionary),c),await n(c),l(`Dictionaries built`,{isVerbose:!0}),r(c),l(`Module augmentation built`,{isVerbose:!0});for await(let e of c.plugins??[]){let{unmergedDictionaries:t,mergedDictionaries:n}=u;await e.afterBuild?.({dictionaries:{unmergedDictionaries:t,mergedDictionaries:n},configuration:c})}};export{s as handleAdditionalContentDeclarationFile};
33
2
  //# sourceMappingURL=handleAdditionalContentDeclarationFile.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleAdditionalContentDeclarationFile.mjs","names":[],"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleAdditionalContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Additional file detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n await createDictionaryEntryPoint(config);\n\n appLogger('Dictionaries built', {\n isVerbose: true,\n });\n\n createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":";;;;;;;;;AAQA,MAAa,yCAAyC,OACpD,UACA,WACG;CACH,MAAM,YAAY,aAAa,OAAO;AAGtC,WAAU,6BAA6B,WAAW,SAAS,IAAI,EAC7D,WAAW,MACZ,CAAC;CAIF,MAAM,qBAAqB,MAAM,gBAFN,MAAM,sBAAsB,UAAU,OAAO,EAEH,OAAO;AAM5E,OAAM,YAJsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C,CAAC,KAAK,eAAe,WAAW,WAAW,EAEL,OAAO;AAE9C,OAAM,2BAA2B,OAAO;AAExC,WAAU,sBAAsB,EAC9B,WAAW,MACZ,CAAC;AAEF,0BAAyB,OAAO;AAEhC,WAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;AAIF,YAAW,MAAM,UAAU,OAAO,WAAW,EAAE,EAAE;EAC/C,MAAM,EAAE,sBAAsB,uBAAuB;AAErD,QAAM,OAAO,aAAa;GACxB,cAAc;IACZ;IACA;IACD;GACD,eAAe;GAChB,CAAC"}
1
+ {"version":3,"file":"handleAdditionalContentDeclarationFile.mjs","names":[],"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleAdditionalContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Additional file detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n await createDictionaryEntryPoint(config);\n\n appLogger('Dictionaries built', {\n isVerbose: true,\n });\n\n createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":"+gBAQA,MAAa,EAAyC,MACpD,EACA,IACG,CACH,IAAM,EAAY,EAAa,EAAO,CAGtC,EAAU,6BAA6B,EAAW,EAAS,GAAI,CAC7D,UAAW,GACZ,CAAC,CAIF,IAAM,EAAqB,MAAM,EAFN,MAAM,EAAsB,EAAU,EAAO,CAEH,EAAO,CAM5E,MAAM,EAJsB,OAAO,OACjC,GAAoB,oBAAsB,EAAE,CAC7C,CAAC,IAAK,GAAe,EAAW,WAAW,CAEL,EAAO,CAE9C,MAAM,EAA2B,EAAO,CAExC,EAAU,qBAAsB,CAC9B,UAAW,GACZ,CAAC,CAEF,EAAyB,EAAO,CAEhC,EAAU,4BAA6B,CACrC,UAAW,GACZ,CAAC,CAIF,UAAW,IAAM,KAAU,EAAO,SAAW,EAAE,CAAE,CAC/C,GAAM,CAAE,uBAAsB,sBAAuB,EAErD,MAAM,EAAO,aAAa,CACxB,aAAc,CACZ,uBACA,qBACD,CACD,cAAe,EAChB,CAAC"}
@@ -1,48 +1,2 @@
1
- import { formatPath } from "./utils/formatter.mjs";
2
- import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
3
- import { getBuiltDictionariesPath } from "./createDictionaryEntryPoint/getBuiltDictionariesPath.mjs";
4
- import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
5
- import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
6
- import { createTypes } from "./createType/createType.mjs";
7
- import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
8
- import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
9
- import { getAppLogger } from "@intlayer/config";
10
-
11
- //#region src/handleContentDeclarationFileChange.ts
12
- const handleContentDeclarationFileChange = async (filePath, config) => {
13
- const appLogger = getAppLogger(config);
14
- appLogger(`Change detected: ${formatPath(filePath)}`, { isVerbose: true });
15
- const allDictionariesPaths = await getBuiltDictionariesPath(config);
16
- const localeDictionaries = await loadLocalDictionaries(filePath, config);
17
- const dictionariesOutput = await buildDictionary(localeDictionaries, config);
18
- const updatedDictionaries = Object.values(dictionariesOutput?.mergedDictionaries ?? {});
19
- const updatedDictionariesPaths = updatedDictionaries.map((dictionary) => dictionary.dictionaryPath);
20
- const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(filePath, localeDictionaries.map((dictionary) => dictionary.key), config);
21
- const hasNewDictionaries = updatedDictionariesPaths.some((updatedDictionaryPath) => !allDictionariesPaths.includes(updatedDictionaryPath));
22
- if (hasRebuilt || hasNewDictionaries) {
23
- if (!hasRebuilt) {
24
- await createDictionaryEntryPoint(config, { excludeKeys });
25
- appLogger("Dictionary list built", { isVerbose: true });
26
- }
27
- }
28
- await createTypes(updatedDictionaries.map((dictionary) => dictionary.dictionary), config);
29
- appLogger("TypeScript types built", { isVerbose: true });
30
- if (hasNewDictionaries) {
31
- await createModuleAugmentation(config);
32
- appLogger("Module augmentation built", { isVerbose: true });
33
- }
34
- for await (const plugin of config.plugins ?? []) {
35
- const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
36
- await plugin.afterBuild?.({
37
- dictionaries: {
38
- unmergedDictionaries,
39
- mergedDictionaries
40
- },
41
- configuration: config
42
- });
43
- }
44
- };
45
-
46
- //#endregion
47
- export { handleContentDeclarationFileChange };
1
+ import{formatPath as e}from"./utils/formatter.mjs";import{buildDictionary as t}from"./buildIntlayerDictionary/buildIntlayerDictionary.mjs";import{getBuiltDictionariesPath as n}from"./createDictionaryEntryPoint/getBuiltDictionariesPath.mjs";import{createDictionaryEntryPoint as r}from"./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";import{createModuleAugmentation as i}from"./createType/createModuleAugmentation.mjs";import{createTypes as a}from"./createType/createType.mjs";import{loadLocalDictionaries as o}from"./loadDictionaries/loadLocalDictionaries.mjs";import{cleanRemovedContentDeclaration as s}from"./cleanRemovedContentDeclaration.mjs";import{getAppLogger as c}from"@intlayer/config/logger";const l=async(l,u)=>{let d=c(u);d(`Change detected: ${e(l)}`,{isVerbose:!0});let f=await n(u),p=await o(l,u),m=await t(p,u),h=Object.values(m?.mergedDictionaries??{}),g=h.map(e=>e.dictionaryPath),{excludeKeys:_,hasRebuilt:v}=await s(l,p.map(e=>e.key),u),y=g.some(e=>!f.includes(e));(v||y)&&(v||(await r(u,{excludeKeys:_}),d(`Dictionary list built`,{isVerbose:!0}))),await a(h.map(e=>e.dictionary),u),d(`TypeScript types built`,{isVerbose:!0}),y&&(await i(u),d(`Module augmentation built`,{isVerbose:!0}));for await(let e of u.plugins??[]){let{unmergedDictionaries:t,mergedDictionaries:n}=m;await e.afterBuild?.({dictionaries:{unmergedDictionaries:t,mergedDictionaries:n},configuration:u})}};export{l as handleContentDeclarationFileChange};
48
2
  //# sourceMappingURL=handleContentDeclarationFileChange.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleContentDeclarationFileChange.mjs","names":[],"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { getBuiltDictionariesPath } from './createDictionaryEntryPoint/getBuiltDictionariesPath';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileChange = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Change detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const allDictionariesPaths: string[] = await getBuiltDictionariesPath(config);\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n const updatedDictionaries = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n );\n const updatedDictionariesPaths = updatedDictionaries.map(\n (dictionary) => dictionary.dictionaryPath\n );\n\n const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(\n filePath,\n localeDictionaries.map((dictionary) => dictionary.key),\n config\n );\n\n const hasNewDictionaries = updatedDictionariesPaths.some(\n (updatedDictionaryPath) =>\n !allDictionariesPaths.includes(updatedDictionaryPath)\n );\n\n // Rebuild Entry Point & Module Augmentation\n // These only need to be updated if the *list* of dictionaries changed (Add/Remove/Rename)\n if (hasRebuilt || hasNewDictionaries) {\n // If hasRebuilt is true, cleanRemovedContentDeclaration has already updated the entry point\n // to remove the old keys (and it likely included the new ones if they were already on disk).\n // If NOT hasRebuilt, we explicitly need to update the entry point to include the new dictionaries.\n if (!hasRebuilt) {\n await createDictionaryEntryPoint(config, { excludeKeys });\n appLogger('Dictionary list built', {\n isVerbose: true,\n });\n }\n }\n\n // Rebuild Types\n // Always regenerate types when a file changes, as the content structure (interface) might have changed\n // even if the key is the same.\n const dictionariesToBuild = updatedDictionaries.map(\n (dictionary) => dictionary.dictionary\n );\n\n await createTypes(dictionariesToBuild, config);\n appLogger('TypeScript types built', {\n isVerbose: true,\n });\n\n if (hasNewDictionaries) {\n await createModuleAugmentation(config);\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n }\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,qCAAqC,OAChD,UACA,WACG;CACH,MAAM,YAAY,aAAa,OAAO;AAGtC,WAAU,oBAAoB,WAAW,SAAS,IAAI,EACpD,WAAW,MACZ,CAAC;CAEF,MAAM,uBAAiC,MAAM,yBAAyB,OAAO;CAE7E,MAAM,qBAAqB,MAAM,sBAAsB,UAAU,OAAO;CAExE,MAAM,qBAAqB,MAAM,gBAAgB,oBAAoB,OAAO;CAC5E,MAAM,sBAAsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C;CACD,MAAM,2BAA2B,oBAAoB,KAClD,eAAe,WAAW,eAC5B;CAED,MAAM,EAAE,aAAa,eAAe,MAAM,+BACxC,UACA,mBAAmB,KAAK,eAAe,WAAW,IAAI,EACtD,OACD;CAED,MAAM,qBAAqB,yBAAyB,MACjD,0BACC,CAAC,qBAAqB,SAAS,sBAAsB,CACxD;AAID,KAAI,cAAc,oBAIhB;MAAI,CAAC,YAAY;AACf,SAAM,2BAA2B,QAAQ,EAAE,aAAa,CAAC;AACzD,aAAU,yBAAyB,EACjC,WAAW,MACZ,CAAC;;;AAWN,OAAM,YAJsB,oBAAoB,KAC7C,eAAe,WAAW,WAC5B,EAEsC,OAAO;AAC9C,WAAU,0BAA0B,EAClC,WAAW,MACZ,CAAC;AAEF,KAAI,oBAAoB;AACtB,QAAM,yBAAyB,OAAO;AACtC,YAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;;AAKJ,YAAW,MAAM,UAAU,OAAO,WAAW,EAAE,EAAE;EAC/C,MAAM,EAAE,sBAAsB,uBAAuB;AAErD,QAAM,OAAO,aAAa;GACxB,cAAc;IACZ;IACA;IACD;GACD,eAAe;GAChB,CAAC"}
1
+ {"version":3,"file":"handleContentDeclarationFileChange.mjs","names":[],"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { getBuiltDictionariesPath } from './createDictionaryEntryPoint/getBuiltDictionariesPath';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileChange = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Change detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const allDictionariesPaths: string[] = await getBuiltDictionariesPath(config);\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n const updatedDictionaries = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n );\n const updatedDictionariesPaths = updatedDictionaries.map(\n (dictionary) => dictionary.dictionaryPath\n );\n\n const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(\n filePath,\n localeDictionaries.map((dictionary) => dictionary.key),\n config\n );\n\n const hasNewDictionaries = updatedDictionariesPaths.some(\n (updatedDictionaryPath) =>\n !allDictionariesPaths.includes(updatedDictionaryPath)\n );\n\n // Rebuild Entry Point & Module Augmentation\n // These only need to be updated if the *list* of dictionaries changed (Add/Remove/Rename)\n if (hasRebuilt || hasNewDictionaries) {\n // If hasRebuilt is true, cleanRemovedContentDeclaration has already updated the entry point\n // to remove the old keys (and it likely included the new ones if they were already on disk).\n // If NOT hasRebuilt, we explicitly need to update the entry point to include the new dictionaries.\n if (!hasRebuilt) {\n await createDictionaryEntryPoint(config, { excludeKeys });\n appLogger('Dictionary list built', {\n isVerbose: true,\n });\n }\n }\n\n // Rebuild Types\n // Always regenerate types when a file changes, as the content structure (interface) might have changed\n // even if the key is the same.\n const dictionariesToBuild = updatedDictionaries.map(\n (dictionary) => dictionary.dictionary\n );\n\n await createTypes(dictionariesToBuild, config);\n appLogger('TypeScript types built', {\n isVerbose: true,\n });\n\n if (hasNewDictionaries) {\n await createModuleAugmentation(config);\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n }\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":"0sBAWA,MAAa,EAAqC,MAChD,EACA,IACG,CACH,IAAM,EAAY,EAAa,EAAO,CAGtC,EAAU,oBAAoB,EAAW,EAAS,GAAI,CACpD,UAAW,GACZ,CAAC,CAEF,IAAM,EAAiC,MAAM,EAAyB,EAAO,CAEvE,EAAqB,MAAM,EAAsB,EAAU,EAAO,CAElE,EAAqB,MAAM,EAAgB,EAAoB,EAAO,CACtE,EAAsB,OAAO,OACjC,GAAoB,oBAAsB,EAAE,CAC7C,CACK,EAA2B,EAAoB,IAClD,GAAe,EAAW,eAC5B,CAEK,CAAE,cAAa,cAAe,MAAM,EACxC,EACA,EAAmB,IAAK,GAAe,EAAW,IAAI,CACtD,EACD,CAEK,EAAqB,EAAyB,KACjD,GACC,CAAC,EAAqB,SAAS,EAAsB,CACxD,EAIG,GAAc,KAIX,IACH,MAAM,EAA2B,EAAQ,CAAE,cAAa,CAAC,CACzD,EAAU,wBAAyB,CACjC,UAAW,GACZ,CAAC,GAWN,MAAM,EAJsB,EAAoB,IAC7C,GAAe,EAAW,WAC5B,CAEsC,EAAO,CAC9C,EAAU,yBAA0B,CAClC,UAAW,GACZ,CAAC,CAEE,IACF,MAAM,EAAyB,EAAO,CACtC,EAAU,4BAA6B,CACrC,UAAW,GACZ,CAAC,EAKJ,UAAW,IAAM,KAAU,EAAO,SAAW,EAAE,CAAE,CAC/C,GAAM,CAAE,uBAAsB,sBAAuB,EAErD,MAAM,EAAO,aAAa,CACxB,aAAc,CACZ,uBACA,qBACD,CACD,cAAe,EAChB,CAAC"}
@@ -1,23 +1,2 @@
1
- import { formatPath } from "./utils/formatter.mjs";
2
- import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
3
- import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
4
- import { handleContentDeclarationFileChange } from "./handleContentDeclarationFileChange.mjs";
5
- import { getAppLogger } from "@intlayer/config";
6
-
7
- //#region src/handleContentDeclarationFileMoved.ts
8
- const handleContentDeclarationFileMoved = async (oldFilePath, newFilePath, config) => {
9
- const appLogger = getAppLogger(config);
10
- appLogger(`File moved from ${formatPath(oldFilePath)} to ${formatPath(newFilePath)}`, { isVerbose: true });
11
- let keysToKeep = [];
12
- try {
13
- keysToKeep = (await loadLocalDictionaries(newFilePath, config)).map((d) => d.key);
14
- } catch {
15
- appLogger(`Error parsing new file during move operation: ${formatPath(newFilePath)}`, { isVerbose: true });
16
- }
17
- await cleanRemovedContentDeclaration(oldFilePath, keysToKeep, config);
18
- await handleContentDeclarationFileChange(newFilePath, config);
19
- };
20
-
21
- //#endregion
22
- export { handleContentDeclarationFileMoved };
1
+ import{formatPath as e}from"./utils/formatter.mjs";import{loadLocalDictionaries as t}from"./loadDictionaries/loadLocalDictionaries.mjs";import{cleanRemovedContentDeclaration as n}from"./cleanRemovedContentDeclaration.mjs";import{handleContentDeclarationFileChange as r}from"./handleContentDeclarationFileChange.mjs";import{getAppLogger as i}from"@intlayer/config/logger";const a=async(a,o,s)=>{let c=i(s);c(`File moved from ${e(a)} to ${e(o)}`,{isVerbose:!0});let l=[];try{l=(await t(o,s)).map(e=>e.key)}catch{c(`Error parsing new file during move operation: ${e(o)}`,{isVerbose:!0})}await n(a,l,s),await r(o,s)};export{a as handleContentDeclarationFileMoved};
23
2
  //# sourceMappingURL=handleContentDeclarationFileMoved.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleContentDeclarationFileMoved.mjs","names":[],"sources":["../../src/handleContentDeclarationFileMoved.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { handleContentDeclarationFileChange } from './handleContentDeclarationFileChange';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileMoved = async (\n oldFilePath: string,\n newFilePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n appLogger(\n `File moved from ${formatPath(oldFilePath)} to ${formatPath(newFilePath)}`,\n {\n isVerbose: true,\n }\n );\n\n let keysToKeep: string[] = [];\n\n try {\n // Pre-load the new file to identify the keys inside it.\n // We need to pass these keys to the cleaner so it knows NOT to completely delete\n // the dictionary artifacts (types/json) if the key has simply moved to a new file.\n const newLocaleDictionaries = await loadLocalDictionaries(\n newFilePath,\n config\n );\n keysToKeep = newLocaleDictionaries.map((d) => d.key);\n } catch {\n appLogger(\n `Error parsing new file during move operation: ${formatPath(newFilePath)}`,\n {\n isVerbose: true,\n }\n );\n // Proceed with empty keysToKeep; this will result in the old dictionary being cleaned up\n // entirely, and the new one being re-created in the next step.\n }\n\n // Clean up the artifacts associated with the old file path.\n // By passing 'keysToKeep', we instruct the cleaner to remove the specific file association\n // (filePath reference) from the dictionaries, but preserve the dictionary Entry Point and Types\n // if the key is still present in the new file.\n await cleanRemovedContentDeclaration(oldFilePath, keysToKeep, config);\n\n // Process the new file.\n // This will add the new file association, rebuild the dictionary JSONs with the new path,\n // and ensure types and module augmentation are up to date.\n await handleContentDeclarationFileChange(newFilePath, config);\n};\n"],"mappings":";;;;;;;AAOA,MAAa,oCAAoC,OAC/C,aACA,aACA,WACG;CACH,MAAM,YAAY,aAAa,OAAO;AAEtC,WACE,mBAAmB,WAAW,YAAY,CAAC,MAAM,WAAW,YAAY,IACxE,EACE,WAAW,MACZ,CACF;CAED,IAAI,aAAuB,EAAE;AAE7B,KAAI;AAQF,gBAJ8B,MAAM,sBAClC,aACA,OACD,EACkC,KAAK,MAAM,EAAE,IAAI;SAC9C;AACN,YACE,iDAAiD,WAAW,YAAY,IACxE,EACE,WAAW,MACZ,CACF;;AASH,OAAM,+BAA+B,aAAa,YAAY,OAAO;AAKrE,OAAM,mCAAmC,aAAa,OAAO"}
1
+ {"version":3,"file":"handleContentDeclarationFileMoved.mjs","names":[],"sources":["../../src/handleContentDeclarationFileMoved.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { handleContentDeclarationFileChange } from './handleContentDeclarationFileChange';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleContentDeclarationFileMoved = async (\n oldFilePath: string,\n newFilePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n appLogger(\n `File moved from ${formatPath(oldFilePath)} to ${formatPath(newFilePath)}`,\n {\n isVerbose: true,\n }\n );\n\n let keysToKeep: string[] = [];\n\n try {\n // Pre-load the new file to identify the keys inside it.\n // We need to pass these keys to the cleaner so it knows NOT to completely delete\n // the dictionary artifacts (types/json) if the key has simply moved to a new file.\n const newLocaleDictionaries = await loadLocalDictionaries(\n newFilePath,\n config\n );\n keysToKeep = newLocaleDictionaries.map((d) => d.key);\n } catch {\n appLogger(\n `Error parsing new file during move operation: ${formatPath(newFilePath)}`,\n {\n isVerbose: true,\n }\n );\n // Proceed with empty keysToKeep; this will result in the old dictionary being cleaned up\n // entirely, and the new one being re-created in the next step.\n }\n\n // Clean up the artifacts associated with the old file path.\n // By passing 'keysToKeep', we instruct the cleaner to remove the specific file association\n // (filePath reference) from the dictionaries, but preserve the dictionary Entry Point and Types\n // if the key is still present in the new file.\n await cleanRemovedContentDeclaration(oldFilePath, keysToKeep, config);\n\n // Process the new file.\n // This will add the new file association, rebuild the dictionary JSONs with the new path,\n // and ensure types and module augmentation are up to date.\n await handleContentDeclarationFileChange(newFilePath, config);\n};\n"],"mappings":"mXAOA,MAAa,EAAoC,MAC/C,EACA,EACA,IACG,CACH,IAAM,EAAY,EAAa,EAAO,CAEtC,EACE,mBAAmB,EAAW,EAAY,CAAC,MAAM,EAAW,EAAY,GACxE,CACE,UAAW,GACZ,CACF,CAED,IAAI,EAAuB,EAAE,CAE7B,GAAI,CAQF,GAJ8B,MAAM,EAClC,EACA,EACD,EACkC,IAAK,GAAM,EAAE,IAAI,MAC9C,CACN,EACE,iDAAiD,EAAW,EAAY,GACxE,CACE,UAAW,GACZ,CACF,CASH,MAAM,EAA+B,EAAa,EAAY,EAAO,CAKrE,MAAM,EAAmC,EAAa,EAAO"}
@@ -1,36 +1,2 @@
1
- import { formatPath } from "./utils/formatter.mjs";
2
- import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
3
- import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
4
- import { createTypes } from "./createType/createType.mjs";
5
- import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
6
- import { listDictionaries } from "./listDictionariesPath.mjs";
7
- import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
8
- import { getAppLogger } from "@intlayer/config";
9
- import { normalize } from "node:path";
10
-
11
- //#region src/handleUnlinkedContentDeclarationFile.ts
12
- const handleUnlinkedContentDeclarationFile = async (filePath, config) => {
13
- const appLogger = getAppLogger(config);
14
- appLogger(`Unlinked detected: ${formatPath(filePath)}`, { isVerbose: true });
15
- const localeDictionaries = await loadLocalDictionaries((await listDictionaries(config)).filter((file) => normalize(file) !== normalize(filePath)), config);
16
- await cleanRemovedContentDeclaration(filePath, [], config);
17
- const dictionariesOutput = await buildDictionary(localeDictionaries, config);
18
- await createTypes(Object.values(dictionariesOutput?.mergedDictionaries ?? {}).map((dictionary) => dictionary.dictionary), config);
19
- appLogger("Dictionaries rebuilt", { isVerbose: true });
20
- await createModuleAugmentation(config);
21
- appLogger("Module augmentation built", { isVerbose: true });
22
- for await (const plugin of config.plugins ?? []) {
23
- const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
24
- await plugin.afterBuild?.({
25
- dictionaries: {
26
- unmergedDictionaries,
27
- mergedDictionaries
28
- },
29
- configuration: config
30
- });
31
- }
32
- };
33
-
34
- //#endregion
35
- export { handleUnlinkedContentDeclarationFile };
1
+ import{formatPath as e}from"./utils/formatter.mjs";import{buildDictionary as t}from"./buildIntlayerDictionary/buildIntlayerDictionary.mjs";import{createModuleAugmentation as n}from"./createType/createModuleAugmentation.mjs";import{createTypes as r}from"./createType/createType.mjs";import{loadLocalDictionaries as i}from"./loadDictionaries/loadLocalDictionaries.mjs";import{listDictionaries as a}from"./listDictionariesPath.mjs";import{cleanRemovedContentDeclaration as o}from"./cleanRemovedContentDeclaration.mjs";import{normalize as s}from"node:path";import{getAppLogger as c}from"@intlayer/config/logger";const l=async(l,u)=>{let d=c(u);d(`Unlinked detected: ${e(l)}`,{isVerbose:!0});let f=await i((await a(u)).filter(e=>s(e)!==s(l)),u);await o(l,[],u);let p=await t(f,u);await r(Object.values(p?.mergedDictionaries??{}).map(e=>e.dictionary),u),d(`Dictionaries rebuilt`,{isVerbose:!0}),await n(u),d(`Module augmentation built`,{isVerbose:!0});for await(let e of u.plugins??[]){let{unmergedDictionaries:t,mergedDictionaries:n}=p;await e.afterBuild?.({dictionaries:{unmergedDictionaries:t,mergedDictionaries:n},configuration:u})}};export{l as handleUnlinkedContentDeclarationFile};
36
2
  //# sourceMappingURL=handleUnlinkedContentDeclarationFile.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"handleUnlinkedContentDeclarationFile.mjs","names":[],"sources":["../../src/handleUnlinkedContentDeclarationFile.ts"],"sourcesContent":["import { normalize } from 'node:path';\nimport { getAppLogger } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { listDictionaries } from './listDictionariesPath';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleUnlinkedContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Unlinked detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const files: string[] = await listDictionaries(config);\n\n const existingFiles = files.filter(\n (file) => normalize(file) !== normalize(filePath)\n );\n\n const localeDictionaries = await loadLocalDictionaries(existingFiles, config);\n\n await cleanRemovedContentDeclaration(filePath, [], config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n appLogger('Dictionaries rebuilt', {\n isVerbose: true,\n });\n\n await createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,uCAAuC,OAClD,UACA,WACG;CACH,MAAM,YAAY,aAAa,OAAO;AAGtC,WAAU,sBAAsB,WAAW,SAAS,IAAI,EACtD,WAAW,MACZ,CAAC;CAQF,MAAM,qBAAqB,MAAM,uBANT,MAAM,iBAAiB,OAAO,EAE1B,QACzB,SAAS,UAAU,KAAK,KAAK,UAAU,SAAS,CAClD,EAEqE,OAAO;AAE7E,OAAM,+BAA+B,UAAU,EAAE,EAAE,OAAO;CAE1D,MAAM,qBAAqB,MAAM,gBAAgB,oBAAoB,OAAO;AAM5E,OAAM,YAJsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C,CAAC,KAAK,eAAe,WAAW,WAAW,EAEL,OAAO;AAE9C,WAAU,wBAAwB,EAChC,WAAW,MACZ,CAAC;AAEF,OAAM,yBAAyB,OAAO;AAEtC,WAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;AAIF,YAAW,MAAM,UAAU,OAAO,WAAW,EAAE,EAAE;EAC/C,MAAM,EAAE,sBAAsB,uBAAuB;AAErD,QAAM,OAAO,aAAa;GACxB,cAAc;IACZ;IACA;IACD;GACD,eAAe;GAChB,CAAC"}
1
+ {"version":3,"file":"handleUnlinkedContentDeclarationFile.mjs","names":[],"sources":["../../src/handleUnlinkedContentDeclarationFile.ts"],"sourcesContent":["import { normalize } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { cleanRemovedContentDeclaration } from './cleanRemovedContentDeclaration';\nimport { createTypes } from './createType';\nimport { createModuleAugmentation } from './createType/createModuleAugmentation';\nimport { listDictionaries } from './listDictionariesPath';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleUnlinkedContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Unlinked detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const files: string[] = await listDictionaries(config);\n\n const existingFiles = files.filter(\n (file) => normalize(file) !== normalize(filePath)\n );\n\n const localeDictionaries = await loadLocalDictionaries(existingFiles, config);\n\n await cleanRemovedContentDeclaration(filePath, [], config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, config);\n\n appLogger('Dictionaries rebuilt', {\n isVerbose: true,\n });\n\n await createModuleAugmentation(config);\n\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of config.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration: config,\n });\n }\n};\n"],"mappings":"gmBAWA,MAAa,EAAuC,MAClD,EACA,IACG,CACH,IAAM,EAAY,EAAa,EAAO,CAGtC,EAAU,sBAAsB,EAAW,EAAS,GAAI,CACtD,UAAW,GACZ,CAAC,CAQF,IAAM,EAAqB,MAAM,GANT,MAAM,EAAiB,EAAO,EAE1B,OACzB,GAAS,EAAU,EAAK,GAAK,EAAU,EAAS,CAClD,CAEqE,EAAO,CAE7E,MAAM,EAA+B,EAAU,EAAE,CAAE,EAAO,CAE1D,IAAM,EAAqB,MAAM,EAAgB,EAAoB,EAAO,CAM5E,MAAM,EAJsB,OAAO,OACjC,GAAoB,oBAAsB,EAAE,CAC7C,CAAC,IAAK,GAAe,EAAW,WAAW,CAEL,EAAO,CAE9C,EAAU,uBAAwB,CAChC,UAAW,GACZ,CAAC,CAEF,MAAM,EAAyB,EAAO,CAEtC,EAAU,4BAA6B,CACrC,UAAW,GACZ,CAAC,CAIF,UAAW,IAAM,KAAU,EAAO,SAAW,EAAE,CAAE,CAC/C,GAAM,CAAE,uBAAsB,sBAAuB,EAErD,MAAM,EAAO,aAAa,CACxB,aAAc,CACZ,uBACA,qBACD,CACD,cAAe,EAChB,CAAC"}
@@ -1,57 +1 @@
1
- import { pLimit } from "./utils/pLimit.mjs";
2
- import { parallelize } from "./utils/parallelize.mjs";
3
- import { formatLocale, formatPath } from "./utils/formatter.mjs";
4
- import { isInvalidDictionary } from "./filterInvalidDictionaries.mjs";
5
- import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
6
- import { autoDecorateContent } from "./utils/autoDecorateContent.mjs";
7
- import { resolveObjectPromises } from "./utils/resolveObjectPromises.mjs";
8
- import { getFileHash } from "./utils/getFileHash.mjs";
9
- import { generateDictionaryListContent } from "./createDictionaryEntryPoint/generateDictionaryListContent.mjs";
10
- import { getBuiltDictionariesPath } from "./createDictionaryEntryPoint/getBuiltDictionariesPath.mjs";
11
- import { getBuiltDynamicDictionariesPath } from "./createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs";
12
- import { getBuiltFetchDictionariesPath } from "./createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs";
13
- import { getBuiltRemoteDictionariesPath } from "./createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs";
14
- import { getBuiltUnmergedDictionariesPath } from "./createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs";
15
- import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
16
- import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
17
- import { createTypes } from "./createType/createType.mjs";
18
- import { loadContentDeclarations } from "./loadDictionaries/loadContentDeclaration.mjs";
19
- import { formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput } from "./formatDictionary.mjs";
20
- import { fetchDistantDictionaries } from "./fetchDistantDictionaries.mjs";
21
- import { sortAlphabetically } from "./utils/sortAlphabetically.mjs";
22
- import { loadRemoteDictionaries } from "./loadDictionaries/loadRemoteDictionaries.mjs";
23
- import { loadDictionaries } from "./loadDictionaries/loadDictionaries.mjs";
24
- import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
25
- import { cleanOutputDir } from "./cleanOutputDir.mjs";
26
- import { listDictionaries, listDictionariesWithStats } from "./listDictionariesPath.mjs";
27
- import { runOnce } from "./utils/runOnce.mjs";
28
- import { prepareIntlayer } from "./prepareIntlayer.mjs";
29
- import { detectExportedComponentName } from "./writeContentDeclaration/detectExportedComponentName.mjs";
30
- import { detectFormatCommand } from "./writeContentDeclaration/detectFormatCommand.mjs";
31
- import { transformJSFile } from "./writeContentDeclaration/transformJSFile.mjs";
32
- import { getExtensionFromFormat, getFormatFromExtension } from "./utils/getFormatFromExtension.mjs";
33
- import { getContentDeclarationFileTemplate } from "./getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs";
34
- import { writeJSFile } from "./writeContentDeclaration/writeJSFile.mjs";
35
- import { writeContentDeclaration } from "./writeContentDeclaration/writeContentDeclaration.mjs";
36
- import { initIntlayer } from "./init/index.mjs";
37
- import { SKILLS, SKILLS_METADATA, installSkills } from "./installSkills/index.mjs";
38
- import { listGitFiles, listGitLines } from "./listGitFiles.mjs";
39
- import { listProjects } from "./listProjects.mjs";
40
- import { extractDictionaryKey } from "./transformFiles/extractDictionaryKey.mjs";
41
- import { ATTRIBUTES_TO_EXTRACT, extractIntlayer, generateKey, shouldExtract, transformFiles } from "./transformFiles/transformFiles.mjs";
42
- import { handleAdditionalContentDeclarationFile } from "./handleAdditionalContentDeclarationFile.mjs";
43
- import { handleContentDeclarationFileChange } from "./handleContentDeclarationFileChange.mjs";
44
- import { handleUnlinkedContentDeclarationFile } from "./handleUnlinkedContentDeclarationFile.mjs";
45
- import { reduceDictionaryContent } from "./reduceDictionaryContent/reduceDictionaryContent.mjs";
46
- import { buildFilesList } from "./utils/buildFilesList.mjs";
47
- import { splitTextByLines } from "./utils/splitTextByLine.mjs";
48
- import { getChunk } from "./utils/getChunk.mjs";
49
- import { assembleJSON, chunkJSON, reconstructFromSingleChunk } from "./utils/chunkJSON.mjs";
50
- import { getComponentTransformPattern, getComponentTransformPatternSync } from "./utils/getComponentTransformPattern.mjs";
51
- import { getGlobalLimiter, getTaskLimiter, parallelizeGlobal } from "./utils/parallelizeGlobal.mjs";
52
- import { reduceObjectFormat } from "./utils/reduceObjectFormat.mjs";
53
- import { runParallel } from "./utils/runParallel/index.mjs";
54
- import { verifyIdenticObjectFormat } from "./utils/verifyIdenticObjectFormat.mjs";
55
- import { buildAndWatchIntlayer, watch } from "./watcher.mjs";
56
-
57
- export { ATTRIBUTES_TO_EXTRACT, SKILLS, SKILLS_METADATA, assembleJSON, autoDecorateContent, buildAndWatchIntlayer, buildDictionary, buildFilesList, chunkJSON, cleanOutputDir, createDictionaryEntryPoint, createModuleAugmentation, createTypes, detectExportedComponentName, detectFormatCommand, extractDictionaryKey, extractIntlayer, fetchDistantDictionaries, formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput, formatLocale, formatPath, generateDictionaryListContent, generateKey, getBuiltDictionariesPath, getBuiltDynamicDictionariesPath, getBuiltFetchDictionariesPath, getBuiltRemoteDictionariesPath, getBuiltUnmergedDictionariesPath, getChunk, getComponentTransformPattern, getComponentTransformPatternSync, getContentDeclarationFileTemplate, getExtensionFromFormat, getFileHash, getFormatFromExtension, getGlobalLimiter, getTaskLimiter, handleAdditionalContentDeclarationFile, handleContentDeclarationFileChange, handleUnlinkedContentDeclarationFile, initIntlayer, installSkills, isInvalidDictionary, listDictionaries, listDictionariesWithStats, listGitFiles, listGitLines, listProjects, loadContentDeclarations, loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, pLimit, parallelize, parallelizeGlobal, prepareIntlayer, reconstructFromSingleChunk, reduceDictionaryContent, reduceObjectFormat, resolveObjectPromises, runOnce, runParallel, shouldExtract, sortAlphabetically, splitTextByLines, transformFiles, transformJSFile, verifyIdenticObjectFormat, watch, writeContentDeclaration, writeJSFile };
1
+ import{Queue as e,pLimit as t}from"./utils/pLimit.mjs";import{parallelize as n}from"./utils/parallelize.mjs";import{formatLocale as r,formatPath as i}from"./utils/formatter.mjs";import{buildDictionary as a}from"./buildIntlayerDictionary/buildIntlayerDictionary.mjs";import{autoDecorateContent as o}from"./utils/autoDecorateContent.mjs";import{resolveObjectPromises as s}from"./utils/resolveObjectPromises.mjs";import{processContentDeclaration as c}from"./buildIntlayerDictionary/processContentDeclaration.mjs";import{cleanOutputDir as l}from"./cleanOutputDir.mjs";import{getFileHash as u}from"./utils/getFileHash.mjs";import{generateDictionaryListContent as d}from"./createDictionaryEntryPoint/generateDictionaryListContent.mjs";import{getBuiltDictionariesPath as f}from"./createDictionaryEntryPoint/getBuiltDictionariesPath.mjs";import{getBuiltDynamicDictionariesPath as p}from"./createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs";import{getBuiltFetchDictionariesPath as m}from"./createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs";import{getBuiltRemoteDictionariesPath as h}from"./createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs";import{getBuiltUnmergedDictionariesPath as g}from"./createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs";import{createDictionaryEntryPoint as _}from"./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";import{createModuleAugmentation as v,getTypeName as y}from"./createType/createModuleAugmentation.mjs";import{createTypes as b,generateTypeScriptType as x}from"./createType/createType.mjs";import{formatDictionaries as S,formatDictionariesOutput as C,formatDictionary as w,formatDictionaryOutput as T}from"./formatDictionary.mjs";import{formatLocalDictionaries as E,loadContentDeclarations as D}from"./loadDictionaries/loadContentDeclaration.mjs";import{sortAlphabetically as O}from"./utils/sortAlphabetically.mjs";import{formatDistantDictionaries as k,loadRemoteDictionaries as A}from"./loadDictionaries/loadRemoteDictionaries.mjs";import{loadDictionaries as j}from"./loadDictionaries/loadDictionaries.mjs";import{loadLocalDictionaries as M}from"./loadDictionaries/loadLocalDictionaries.mjs";import{runOnce as N}from"./utils/runOnce.mjs";import{isCachedConfigurationUpToDate as P,writeConfiguration as F}from"./writeConfiguration/index.mjs";import{prepareIntlayer as I}from"./prepareIntlayer.mjs";import{detectExportedComponentName as L}from"./writeContentDeclaration/detectExportedComponentName.mjs";import{detectFormatCommand as R}from"./writeContentDeclaration/detectFormatCommand.mjs";import{transformJSFile as z}from"./writeContentDeclaration/transformJSFile.mjs";import{getExtensionFromFormat as B,getFormatFromExtension as V}from"./utils/getFormatFromExtension.mjs";import{writeJSFile as H}from"./writeContentDeclaration/writeJSFile.mjs";import{writeContentDeclaration as U}from"./writeContentDeclaration/writeContentDeclaration.mjs";import{initIntlayer as W}from"./init/index.mjs";import{SKILLS as G,SKILLS_METADATA as K,installSkills as q}from"./installSkills/index.mjs";import{listGitFiles as J,listGitLines as Y}from"./listGitFiles.mjs";import{listProjects as X}from"./listProjects.mjs";import{extractDictionaryKey as Z}from"./transformFiles/extractDictionaryKey.mjs";import{ATTRIBUTES_TO_EXTRACT as Q,extractIntlayer as $,generateKey as ee,shouldExtract as te,transformFiles as ne}from"./transformFiles/transformFiles.mjs";import{buildFilesList as re}from"./utils/buildFilesList.mjs";import{splitTextByLines as ie}from"./utils/splitTextByLine.mjs";import{getChunk as ae}from"./utils/getChunk.mjs";import{assembleJSON as oe,chunkJSON as se,reconstructFromSingleChunk as ce}from"./utils/chunkJSON.mjs";import{getComponentTransformPattern as le,getComponentTransformPatternSync as ue}from"./utils/getComponentTransformPattern.mjs";import{getGlobalLimiter as de,getTaskLimiter as fe,parallelizeGlobal as pe}from"./utils/parallelizeGlobal.mjs";import{reduceObjectFormat as me}from"./utils/reduceObjectFormat.mjs";import{runParallel as he}from"./utils/runParallel/index.mjs";import{verifyIdenticObjectFormat as ge}from"./utils/verifyIdenticObjectFormat.mjs";import{buildAndWatchIntlayer as _e,watch as ve}from"./watcher.mjs";export{Q as ATTRIBUTES_TO_EXTRACT,e as Queue,G as SKILLS,K as SKILLS_METADATA,oe as assembleJSON,o as autoDecorateContent,_e as buildAndWatchIntlayer,a as buildDictionary,re as buildFilesList,se as chunkJSON,l as cleanOutputDir,_ as createDictionaryEntryPoint,v as createModuleAugmentation,b as createTypes,L as detectExportedComponentName,R as detectFormatCommand,Z as extractDictionaryKey,$ as extractIntlayer,S as formatDictionaries,C as formatDictionariesOutput,w as formatDictionary,T as formatDictionaryOutput,k as formatDistantDictionaries,E as formatLocalDictionaries,r as formatLocale,i as formatPath,d as generateDictionaryListContent,ee as generateKey,x as generateTypeScriptType,f as getBuiltDictionariesPath,p as getBuiltDynamicDictionariesPath,m as getBuiltFetchDictionariesPath,h as getBuiltRemoteDictionariesPath,g as getBuiltUnmergedDictionariesPath,ae as getChunk,le as getComponentTransformPattern,ue as getComponentTransformPatternSync,B as getExtensionFromFormat,u as getFileHash,V as getFormatFromExtension,de as getGlobalLimiter,fe as getTaskLimiter,y as getTypeName,W as initIntlayer,q as installSkills,P as isCachedConfigurationUpToDate,J as listGitFiles,Y as listGitLines,X as listProjects,D as loadContentDeclarations,j as loadDictionaries,M as loadLocalDictionaries,A as loadRemoteDictionaries,t as pLimit,n as parallelize,pe as parallelizeGlobal,I as prepareIntlayer,c as processContentDeclaration,ce as reconstructFromSingleChunk,me as reduceObjectFormat,s as resolveObjectPromises,N as runOnce,he as runParallel,te as shouldExtract,O as sortAlphabetically,ie as splitTextByLines,ne as transformFiles,z as transformJSFile,ge as verifyIdenticObjectFormat,ve as watch,F as writeConfiguration,U as writeContentDeclaration,H as writeJSFile};
@@ -1,241 +1,2 @@
1
- import { initConfig } from "../initConfig/index.mjs";
2
- import { updateNextConfig, updateViteConfig } from "./utils/configManipulation.mjs";
3
- import { exists, readFileFromRoot, writeFileToRoot } from "./utils/fileSystem.mjs";
4
- import { parseJSONWithComments } from "./utils/jsonParser.mjs";
5
- import { findTsConfigFiles } from "./utils/tsConfig.mjs";
6
- import { ANSIColors, colorize, colorizePath, getAlias, getConfiguration, logger, v, x } from "@intlayer/config";
7
-
8
- //#region src/init/index.ts
9
- /**
10
- * Documentation URL Constants
11
- */
12
- const DocumentationRouter = {
13
- NextJS: "https://intlayer.org/doc/environment/nextjs.md",
14
- NextJS_15: "https://intlayer.org/doc/environment/nextjs/15.md",
15
- NextJS_14: "https://intlayer.org/doc/environment/nextjs/14.md",
16
- CRA: "https://intlayer.org/doc/environment/create-react-app.md",
17
- Astro: "https://intlayer.org/doc/environment/astro.md",
18
- ViteAndReact: "https://intlayer.org/doc/environment/vite-and-react.md",
19
- ViteAndReact_ReactRouterV7: "https://intlayer.org/doc/environment/vite-and-react/react-router-v7.md",
20
- ViteAndReact_ReactRouterV7_FSRoutes: "https://intlayer.org/doc/environment/vite-and-react/react-router-v7-fs-routes.md",
21
- ViteAndVue: "https://intlayer.org/doc/environment/vite-and-vue.md",
22
- ViteAndSolid: "https://intlayer.org/doc/environment/vite-and-solid.md",
23
- ViteAndSvelte: "https://intlayer.org/doc/environment/vite-and-svelte.md",
24
- ViteAndPreact: "https://intlayer.org/doc/environment/vite-and-preact.md",
25
- TanStackRouter: "https://intlayer.org/doc/environment/tanstack.md",
26
- NuxtAndVue: "https://intlayer.org/doc/environment/nuxt-and-vue.md",
27
- Angular: "https://intlayer.org/doc/environment/angular.md",
28
- SvelteKit: "https://intlayer.org/doc/environment/sveltekit.md",
29
- ReactNativeAndExpo: "https://intlayer.org/doc/environment/react-native-and-expo.md",
30
- Lynx: "https://intlayer.org/doc/environment/lynx-and-react.md",
31
- Express: "https://intlayer.org/doc/environment/express.md",
32
- NestJS: "https://intlayer.org/doc/environment/nestjs.md",
33
- Fastify: "https://intlayer.org/doc/environment/fastify.md",
34
- Default: "https://intlayer.org/doc/get-started",
35
- NextIntl: "https://intlayer.org/blog/intlayer-with-next-intl.md",
36
- ReactI18Next: "https://intlayer.org/blog/intlayer-with-react-i18next.md",
37
- ReactIntl: "https://intlayer.org/blog/intlayer-with-react-intl.md",
38
- NextI18Next: "https://intlayer.org/blog/intlayer-with-next-i18next.md",
39
- VueI18n: "https://intlayer.org/blog/intlayer-with-vue-i18n.md"
40
- };
41
- /**
42
- * Helper: Detects the environment and returns the doc URL
43
- */
44
- const getDocumentationUrl = (packageJson) => {
45
- const deps = {
46
- ...packageJson.dependencies,
47
- ...packageJson.devDependencies
48
- };
49
- /**
50
- * Helper to check if a version string matches a specific major version
51
- * Matches: "15", "^15.0.0", "~15.2", "15.0.0-beta"
52
- */
53
- const isVersion = (versionString, major) => {
54
- if (!versionString || typeof versionString !== "string") return false;
55
- return new RegExp(`^[\\^~]?${major}(?:\\.|$)`).test(versionString);
56
- };
57
- if (deps["@lynx-js/react"] || deps["@lynx-js/core"]) return DocumentationRouter.Lynx;
58
- if (deps["react-native"] || deps["expo"]) return DocumentationRouter.ReactNativeAndExpo;
59
- if (deps["next"]) {
60
- const version = deps["next"];
61
- if (isVersion(version, 14)) return DocumentationRouter.NextJS_14;
62
- if (isVersion(version, 15)) return DocumentationRouter.NextJS_15;
63
- return DocumentationRouter.NextJS;
64
- }
65
- if (deps["nuxt"]) return DocumentationRouter.NuxtAndVue;
66
- if (deps["astro"]) return DocumentationRouter.Astro;
67
- if (deps["@sveltejs/kit"]) return DocumentationRouter.SvelteKit;
68
- if (deps["@tanstack/react-router"]) return DocumentationRouter.TanStackRouter;
69
- const reactRouterVersion = deps["react-router"];
70
- if (reactRouterVersion && typeof reactRouterVersion === "string") {
71
- if (deps["@react-router/fs-routes"]) return DocumentationRouter.ViteAndReact_ReactRouterV7_FSRoutes;
72
- if (isVersion(reactRouterVersion, 7)) return DocumentationRouter.ViteAndReact_ReactRouterV7;
73
- }
74
- if (deps["vite"]) {
75
- if (deps["vue"]) return DocumentationRouter.ViteAndVue;
76
- if (deps["solid-js"]) return DocumentationRouter.ViteAndSolid;
77
- if (deps["svelte"]) return DocumentationRouter.ViteAndSvelte;
78
- if (deps["preact"]) return DocumentationRouter.ViteAndPreact;
79
- return DocumentationRouter.ViteAndReact;
80
- }
81
- if (deps["react-scripts"]) return DocumentationRouter.CRA;
82
- if (deps["@angular/core"]) return DocumentationRouter.Angular;
83
- if (deps["@nestjs/core"]) return DocumentationRouter.NestJS;
84
- if (deps["express"]) return DocumentationRouter.Express;
85
- if (deps["fastify"]) return DocumentationRouter.Fastify;
86
- if (deps["next-intl"]) return DocumentationRouter.NextIntl;
87
- if (deps["react-i18next"] || deps["i18next"]) return DocumentationRouter.ReactI18Next;
88
- if (deps["react-intl"]) return DocumentationRouter.ReactIntl;
89
- if (deps["next-i18next"]) return DocumentationRouter.NextI18Next;
90
- if (deps["vue-i18n"]) return DocumentationRouter.VueI18n;
91
- return DocumentationRouter.Default;
92
- };
93
- /**
94
- * MAIN LOGIC
95
- */
96
- const initIntlayer = async (rootDir) => {
97
- logger(colorize("Checking Intlayer configuration...", ANSIColors.CYAN));
98
- const packageJsonPath = "package.json";
99
- if (!await exists(rootDir, packageJsonPath)) {
100
- logger(`${x} No ${colorizePath("package.json")} found. Please run this script from the project root.`, { level: "error" });
101
- process.exit(1);
102
- }
103
- const packageJsonContent = await readFileFromRoot(rootDir, packageJsonPath);
104
- let packageJson;
105
- try {
106
- packageJson = JSON.parse(packageJsonContent);
107
- } catch {
108
- logger(`${x} Could not parse ${colorizePath("package.json")}.`, { level: "error" });
109
- process.exit(1);
110
- }
111
- const guideUrl = getDocumentationUrl(packageJson);
112
- const gitignorePath = ".gitignore";
113
- if (await exists(rootDir, gitignorePath)) {
114
- const gitignoreContent = await readFileFromRoot(rootDir, gitignorePath);
115
- if (!gitignoreContent.includes("intlayer")) {
116
- await writeFileToRoot(rootDir, gitignorePath, `${gitignoreContent}\n# Intlayer\n.intlayer\n`);
117
- logger(`${v} Added ${colorizePath(".intlayer")} to ${colorizePath(gitignorePath)}`);
118
- } else logger(`${v} ${colorizePath(gitignorePath)} already includes .intlayer`);
119
- }
120
- const tsConfigFiles = await findTsConfigFiles(rootDir);
121
- let hasTsConfig = false;
122
- for (const fileName of tsConfigFiles) if (await exists(rootDir, fileName)) {
123
- hasTsConfig = true;
124
- try {
125
- const config = parseJSONWithComments(await readFileFromRoot(rootDir, fileName));
126
- const typeDefinition = ".intlayer/**/*.ts";
127
- let updated = false;
128
- if (!config.include) {} else if (Array.isArray(config.include) && !config.include.some((pattern) => pattern.includes(".intlayer"))) {
129
- config.include.push(typeDefinition);
130
- updated = true;
131
- } else if (config.include.includes(typeDefinition)) logger(`${v} ${colorizePath(fileName)} already includes intlayer types`);
132
- if (updated) {
133
- await writeFileToRoot(rootDir, fileName, JSON.stringify(config, null, 2));
134
- logger(`${v} Updated ${colorizePath(fileName)} to include intlayer types`);
135
- }
136
- } catch {
137
- logger(`${x} Could not parse or update ${colorizePath(fileName)}. You may need to add ${colorizePath(".intlayer/types/**/*.ts")} manually.`, { level: "warn" });
138
- }
139
- }
140
- await initConfig(hasTsConfig ? "intlayer.config.ts" : "intlayer.config.mjs", rootDir);
141
- let hasAliasConfiguration = false;
142
- for (const file of [
143
- "vite.config.ts",
144
- "vite.config.js",
145
- "vite.config.mjs"
146
- ]) if (await exists(rootDir, file)) {
147
- hasAliasConfiguration = true;
148
- const content = await readFileFromRoot(rootDir, file);
149
- if (!content.includes("vite-intlayer")) {
150
- await writeFileToRoot(rootDir, file, updateViteConfig(content, file.split(".").pop()));
151
- logger(`${v} Updated ${colorizePath(file)} to include Intlayer plugin`);
152
- }
153
- break;
154
- }
155
- for (const file of [
156
- "next.config.js",
157
- "next.config.mjs",
158
- "next.config.ts"
159
- ]) if (await exists(rootDir, file)) {
160
- hasAliasConfiguration = true;
161
- const content = await readFileFromRoot(rootDir, file);
162
- if (!content.includes("next-intlayer")) {
163
- await writeFileToRoot(rootDir, file, updateNextConfig(content, file.split(".").pop()));
164
- logger(`${v} Updated ${colorizePath(file)} to include Intlayer plugin`);
165
- }
166
- break;
167
- }
168
- for (const file of [
169
- "webpack.config.js",
170
- "webpack.config.ts",
171
- "webpack.config.mjs",
172
- "webpack.config.cjs"
173
- ]) if (await exists(rootDir, file)) {
174
- hasAliasConfiguration = true;
175
- logger(`${v} Found ${colorizePath(file)}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`);
176
- break;
177
- }
178
- if (!hasAliasConfiguration) {
179
- const aliases = getAlias({ configuration: getConfiguration({ baseDir: rootDir }) });
180
- if (hasTsConfig && tsConfigFiles.length > 0) {
181
- const tsConfigPath = tsConfigFiles.find((f) => f === "tsconfig.json") || tsConfigFiles[0];
182
- const config = parseJSONWithComments(await readFileFromRoot(rootDir, tsConfigPath));
183
- config.compilerOptions ??= {};
184
- config.compilerOptions.paths ??= {};
185
- let updated = false;
186
- Object.entries(aliases).forEach(([alias, path]) => {
187
- if (!config.compilerOptions.paths[alias]) {
188
- config.compilerOptions.paths[alias] = [path];
189
- updated = true;
190
- }
191
- });
192
- if (updated) {
193
- await writeFileToRoot(rootDir, tsConfigPath, JSON.stringify(config, null, 2));
194
- logger(`${v} Updated ${colorizePath(tsConfigPath)} to include Intlayer aliases`);
195
- }
196
- } else {
197
- const jsConfigPath = "jsconfig.json";
198
- if (await exists(rootDir, jsConfigPath)) {
199
- const config = parseJSONWithComments(await readFileFromRoot(rootDir, jsConfigPath));
200
- config.compilerOptions ??= {};
201
- config.compilerOptions.paths ??= {};
202
- let updated = false;
203
- Object.entries(aliases).forEach(([alias, path]) => {
204
- if (!config.compilerOptions.paths[alias]) {
205
- config.compilerOptions.paths[alias] = [path];
206
- updated = true;
207
- }
208
- });
209
- if (updated) {
210
- await writeFileToRoot(rootDir, jsConfigPath, JSON.stringify(config, null, 2));
211
- logger(`${v} Updated ${colorizePath(jsConfigPath)} to include Intlayer aliases`);
212
- }
213
- } else {
214
- packageJson.imports ??= {};
215
- let updated = false;
216
- Object.entries(aliases).forEach(([alias, path]) => {
217
- const importAlias = alias.replace("@", "#");
218
- const importPath = path.startsWith(".") ? path : `./${path}`;
219
- if (!packageJson.imports[importAlias]) {
220
- packageJson.imports[importAlias] = importPath;
221
- updated = true;
222
- }
223
- });
224
- if (updated) {
225
- await writeFileToRoot(rootDir, packageJsonPath, JSON.stringify(packageJson, null, 2));
226
- logger(`${v} Updated ${colorizePath(packageJsonPath)} to include Intlayer imports`);
227
- }
228
- }
229
- }
230
- }
231
- logger(`${v} ${colorize("Intlayer init setup complete.", ANSIColors.GREEN)}`);
232
- logger([
233
- colorize("Next →", ANSIColors.MAGENTA),
234
- colorize(`Follow the instructions in the documentation to complete the setup:`, ANSIColors.GREY_LIGHT),
235
- colorizePath(guideUrl)
236
- ]);
237
- };
238
-
239
- //#endregion
240
- export { initIntlayer };
1
+ import{initConfig as e}from"../initConfig/index.mjs";import{updateNextConfig as t,updateViteConfig as n}from"./utils/configManipulation.mjs";import{exists as r,readFileFromRoot as i,writeFileToRoot as a}from"./utils/fileSystem.mjs";import{parseJSONWithComments as o}from"./utils/jsonParser.mjs";import{findTsConfigFiles as s}from"./utils/tsConfig.mjs";import{getConfiguration as c}from"@intlayer/config/node";import{ANSIColors as l,colorize as u,colorizePath as d,logger as f,v as p,x as m}from"@intlayer/config/logger";import{getAlias as h}from"@intlayer/config/utils";const g={NextJS:`https://intlayer.org/doc/environment/nextjs.md`,NextJS_15:`https://intlayer.org/doc/environment/nextjs/15.md`,NextJS_14:`https://intlayer.org/doc/environment/nextjs/14.md`,CRA:`https://intlayer.org/doc/environment/create-react-app.md`,Astro:`https://intlayer.org/doc/environment/astro.md`,ViteAndReact:`https://intlayer.org/doc/environment/vite-and-react.md`,ViteAndReact_ReactRouterV7:`https://intlayer.org/doc/environment/vite-and-react/react-router-v7.md`,ViteAndReact_ReactRouterV7_FSRoutes:`https://intlayer.org/doc/environment/vite-and-react/react-router-v7-fs-routes.md`,ViteAndVue:`https://intlayer.org/doc/environment/vite-and-vue.md`,ViteAndSolid:`https://intlayer.org/doc/environment/vite-and-solid.md`,ViteAndSvelte:`https://intlayer.org/doc/environment/vite-and-svelte.md`,ViteAndPreact:`https://intlayer.org/doc/environment/vite-and-preact.md`,TanStackRouter:`https://intlayer.org/doc/environment/tanstack.md`,NuxtAndVue:`https://intlayer.org/doc/environment/nuxt-and-vue.md`,Angular:`https://intlayer.org/doc/environment/angular.md`,SvelteKit:`https://intlayer.org/doc/environment/sveltekit.md`,ReactNativeAndExpo:`https://intlayer.org/doc/environment/react-native-and-expo.md`,Lynx:`https://intlayer.org/doc/environment/lynx-and-react.md`,Express:`https://intlayer.org/doc/environment/express.md`,NestJS:`https://intlayer.org/doc/environment/nestjs.md`,Fastify:`https://intlayer.org/doc/environment/fastify.md`,Default:`https://intlayer.org/doc/get-started`,NextIntl:`https://intlayer.org/blog/intlayer-with-next-intl.md`,ReactI18Next:`https://intlayer.org/blog/intlayer-with-react-i18next.md`,ReactIntl:`https://intlayer.org/blog/intlayer-with-react-intl.md`,NextI18Next:`https://intlayer.org/blog/intlayer-with-next-i18next.md`,VueI18n:`https://intlayer.org/blog/intlayer-with-vue-i18n.md`},_=e=>{let t={...e.dependencies,...e.devDependencies},n=(e,t)=>!e||typeof e!=`string`?!1:RegExp(`^[\\^~]?${t}(?:\\.|$)`).test(e);if(t[`@lynx-js/react`]||t[`@lynx-js/core`])return g.Lynx;if(t[`react-native`]||t.expo)return g.ReactNativeAndExpo;if(t.next){let e=t.next;return n(e,14)?g.NextJS_14:n(e,15)?g.NextJS_15:g.NextJS}if(t.nuxt)return g.NuxtAndVue;if(t.astro)return g.Astro;if(t[`@sveltejs/kit`])return g.SvelteKit;if(t[`@tanstack/react-router`])return g.TanStackRouter;let r=t[`react-router`];if(r&&typeof r==`string`){if(t[`@react-router/fs-routes`])return g.ViteAndReact_ReactRouterV7_FSRoutes;if(n(r,7))return g.ViteAndReact_ReactRouterV7}return t.vite?t.vue?g.ViteAndVue:t[`solid-js`]?g.ViteAndSolid:t.svelte?g.ViteAndSvelte:t.preact?g.ViteAndPreact:g.ViteAndReact:t[`react-scripts`]?g.CRA:t[`@angular/core`]?g.Angular:t[`@nestjs/core`]?g.NestJS:t.express?g.Express:t.fastify?g.Fastify:t[`next-intl`]?g.NextIntl:t[`react-i18next`]||t.i18next?g.ReactI18Next:t[`react-intl`]?g.ReactIntl:t[`next-i18next`]?g.NextI18Next:t[`vue-i18n`]?g.VueI18n:g.Default},v=async g=>{f(u(`Checking Intlayer configuration...`,l.CYAN));let v=`package.json`;await r(g,v)||(f(`${m} No ${d(`package.json`)} found. Please run this script from the project root.`,{level:`error`}),process.exit(1));let y=await i(g,v),b;try{b=JSON.parse(y)}catch{f(`${m} Could not parse ${d(`package.json`)}.`,{level:`error`}),process.exit(1)}let x=_(b),S=`.gitignore`;if(await r(g,S)){let e=await i(g,S);e.includes(`intlayer`)?f(`${p} ${d(S)} already includes .intlayer`):(await a(g,S,`${e}\n# Intlayer\n.intlayer\n`),f(`${p} Added ${d(`.intlayer`)} to ${d(S)}`))}let C=await s(g),w=!1;for(let e of C)if(await r(g,e)){w=!0;try{let t=o(await i(g,e)),n=`.intlayer/**/*.ts`,r=!1;t.include&&(Array.isArray(t.include)&&!t.include.some(e=>e.includes(`.intlayer`))?(t.include.push(n),r=!0):t.include.includes(n)&&f(`${p} ${d(e)} already includes intlayer types`)),r&&(await a(g,e,JSON.stringify(t,null,2)),f(`${p} Updated ${d(e)} to include intlayer types`))}catch{f(`${m} Could not parse or update ${d(e)}. You may need to add ${d(`.intlayer/types/**/*.ts`)} manually.`,{level:`warn`})}}await e(w?`intlayer.config.ts`:`intlayer.config.mjs`,g);let T=!1;for(let e of[`vite.config.ts`,`vite.config.js`,`vite.config.mjs`])if(await r(g,e)){T=!0;let t=await i(g,e);t.includes(`vite-intlayer`)||(await a(g,e,n(t,e.split(`.`).pop())),f(`${p} Updated ${d(e)} to include Intlayer plugin`));break}for(let e of[`next.config.js`,`next.config.mjs`,`next.config.ts`])if(await r(g,e)){T=!0;let n=await i(g,e);n.includes(`next-intlayer`)||(await a(g,e,t(n,e.split(`.`).pop())),f(`${p} Updated ${d(e)} to include Intlayer plugin`));break}for(let e of[`webpack.config.js`,`webpack.config.ts`,`webpack.config.mjs`,`webpack.config.cjs`])if(await r(g,e)){T=!0,f(`${p} Found ${d(e)}. Make sure to configure aliases manually or use the Intlayer Webpack plugin.`);break}if(!T){let e=h({configuration:c({baseDir:g})});if(w&&C.length>0){let t=C.find(e=>e===`tsconfig.json`)||C[0],n=o(await i(g,t));n.compilerOptions??={},n.compilerOptions.paths??={};let r=!1;Object.entries(e).forEach(([e,t])=>{n.compilerOptions.paths[e]||(n.compilerOptions.paths[e]=[t],r=!0)}),r&&(await a(g,t,JSON.stringify(n,null,2)),f(`${p} Updated ${d(t)} to include Intlayer aliases`))}else{let t=`jsconfig.json`;if(await r(g,t)){let n=o(await i(g,t));n.compilerOptions??={},n.compilerOptions.paths??={};let r=!1;Object.entries(e).forEach(([e,t])=>{n.compilerOptions.paths[e]||(n.compilerOptions.paths[e]=[t],r=!0)}),r&&(await a(g,t,JSON.stringify(n,null,2)),f(`${p} Updated ${d(t)} to include Intlayer aliases`))}else{b.imports??={};let t=!1;Object.entries(e).forEach(([e,n])=>{let r=e.replace(`@`,`#`),i=n.startsWith(`.`)?n:`./${n}`;b.imports[r]||(b.imports[r]=i,t=!0)}),t&&(await a(g,v,JSON.stringify(b,null,2)),f(`${p} Updated ${d(v)} to include Intlayer imports`))}}}f(`${p} ${u(`Intlayer init setup complete.`,l.GREEN)}`),f([u(`Next →`,l.MAGENTA),u(`Follow the instructions in the documentation to complete the setup:`,l.GREY_LIGHT),d(x)])};export{v as initIntlayer};
241
2
  //# sourceMappingURL=index.mjs.map