@intlayer/engine 9.0.0-canary.12

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 (833) hide show
  1. package/README.md +330 -0
  2. package/dist/assets/initConfig/templates/cjs.txt +140 -0
  3. package/dist/assets/initConfig/templates/json.txt +98 -0
  4. package/dist/assets/initConfig/templates/mjs.txt +140 -0
  5. package/dist/assets/initConfig/templates/ts.txt +139 -0
  6. package/dist/assets/installSkills/LICENCE.md +201 -0
  7. package/dist/assets/installSkills/skills/angular.md +159 -0
  8. package/dist/assets/installSkills/skills/astro.md +40 -0
  9. package/dist/assets/installSkills/skills/cli.md +68 -0
  10. package/dist/assets/installSkills/skills/compiler.md +32 -0
  11. package/dist/assets/installSkills/skills/config.md +63 -0
  12. package/dist/assets/installSkills/skills/content.md +377 -0
  13. package/dist/assets/installSkills/skills/next-js.md +130 -0
  14. package/dist/assets/installSkills/skills/preact.md +83 -0
  15. package/dist/assets/installSkills/skills/react.md +105 -0
  16. package/dist/assets/installSkills/skills/remote-content.md +31 -0
  17. package/dist/assets/installSkills/skills/solid.md +90 -0
  18. package/dist/assets/installSkills/skills/svelte.md +84 -0
  19. package/dist/assets/installSkills/skills/usage.md +44 -0
  20. package/dist/assets/installSkills/skills/vue.md +56 -0
  21. package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
  22. package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
  23. package/dist/cjs/build.cjs +60 -0
  24. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +80 -0
  25. package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -0
  26. package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -0
  27. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +27 -0
  28. package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -0
  29. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +206 -0
  30. package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -0
  31. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +59 -0
  32. package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -0
  33. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +49 -0
  34. package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -0
  35. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +51 -0
  36. package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -0
  37. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +62 -0
  38. package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -0
  39. package/dist/cjs/cleanOutputDir.cjs +31 -0
  40. package/dist/cjs/cleanOutputDir.cjs.map +1 -0
  41. package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -0
  42. package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -0
  43. package/dist/cjs/cli.cjs +48 -0
  44. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +71 -0
  45. package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -0
  46. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +43 -0
  47. package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -0
  48. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +25 -0
  49. package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -0
  50. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +26 -0
  51. package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -0
  52. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +26 -0
  53. package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -0
  54. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +25 -0
  55. package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -0
  56. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +25 -0
  57. package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
  58. package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -0
  59. package/dist/cjs/createType/createModuleAugmentation.cjs +126 -0
  60. package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -0
  61. package/dist/cjs/createType/createType.cjs +30 -0
  62. package/dist/cjs/createType/createType.cjs.map +1 -0
  63. package/dist/cjs/createType/index.cjs +8 -0
  64. package/dist/cjs/detectFormatCommand.cjs +33 -0
  65. package/dist/cjs/detectFormatCommand.cjs.map +1 -0
  66. package/dist/cjs/docReview/alignBlocks.cjs +79 -0
  67. package/dist/cjs/docReview/alignBlocks.cjs.map +1 -0
  68. package/dist/cjs/docReview/computeSimilarity.cjs +42 -0
  69. package/dist/cjs/docReview/computeSimilarity.cjs.map +1 -0
  70. package/dist/cjs/docReview/fingerprintBlock.cjs +35 -0
  71. package/dist/cjs/docReview/fingerprintBlock.cjs.map +1 -0
  72. package/dist/cjs/docReview/index.cjs +25 -0
  73. package/dist/cjs/docReview/mapChangedLinesToBlocks.cjs +27 -0
  74. package/dist/cjs/docReview/mapChangedLinesToBlocks.cjs.map +1 -0
  75. package/dist/cjs/docReview/normalizeBlock.cjs +34 -0
  76. package/dist/cjs/docReview/normalizeBlock.cjs.map +1 -0
  77. package/dist/cjs/docReview/pipeline.cjs +144 -0
  78. package/dist/cjs/docReview/pipeline.cjs.map +1 -0
  79. package/dist/cjs/docReview/planActions.cjs +58 -0
  80. package/dist/cjs/docReview/planActions.cjs.map +1 -0
  81. package/dist/cjs/docReview/rebuildDocument.cjs +65 -0
  82. package/dist/cjs/docReview/rebuildDocument.cjs.map +1 -0
  83. package/dist/cjs/docReview/reviewReport.cjs +200 -0
  84. package/dist/cjs/docReview/reviewReport.cjs.map +1 -0
  85. package/dist/cjs/docReview/segmentDocument.cjs +134 -0
  86. package/dist/cjs/docReview/segmentDocument.cjs.map +1 -0
  87. package/dist/cjs/docReview/types.cjs +0 -0
  88. package/dist/cjs/fetchDistantDictionaries.cjs +53 -0
  89. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -0
  90. package/dist/cjs/filterInvalidDictionaries.cjs +57 -0
  91. package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -0
  92. package/dist/cjs/formatDictionary.cjs +60 -0
  93. package/dist/cjs/formatDictionary.cjs.map +1 -0
  94. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +83 -0
  95. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -0
  96. package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -0
  97. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +35 -0
  98. package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -0
  99. package/dist/cjs/handleContentDeclarationFileChange.cjs +56 -0
  100. package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -0
  101. package/dist/cjs/handleContentDeclarationFileMoved.cjs +25 -0
  102. package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -0
  103. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +38 -0
  104. package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -0
  105. package/dist/cjs/init/cms.cjs +140 -0
  106. package/dist/cjs/init/cms.cjs.map +1 -0
  107. package/dist/cjs/init/frameworkSetup/index.cjs +27 -0
  108. package/dist/cjs/init/frameworkSetup/index.cjs.map +1 -0
  109. package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs +56 -0
  110. package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs.map +1 -0
  111. package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs +107 -0
  112. package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs.map +1 -0
  113. package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs +163 -0
  114. package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs.map +1 -0
  115. package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs +122 -0
  116. package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs.map +1 -0
  117. package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs +196 -0
  118. package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs.map +1 -0
  119. package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs +31 -0
  120. package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs.map +1 -0
  121. package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs +76 -0
  122. package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs.map +1 -0
  123. package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs +116 -0
  124. package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs.map +1 -0
  125. package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs +106 -0
  126. package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs.map +1 -0
  127. package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs +141 -0
  128. package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs.map +1 -0
  129. package/dist/cjs/init/frameworkSetup/types.cjs +0 -0
  130. package/dist/cjs/init/index.cjs +521 -0
  131. package/dist/cjs/init/index.cjs.map +1 -0
  132. package/dist/cjs/init/utils/astImports.cjs +56 -0
  133. package/dist/cjs/init/utils/astImports.cjs.map +1 -0
  134. package/dist/cjs/init/utils/configManipulation.cjs +516 -0
  135. package/dist/cjs/init/utils/configManipulation.cjs.map +1 -0
  136. package/dist/cjs/init/utils/fileSystem.cjs +231 -0
  137. package/dist/cjs/init/utils/fileSystem.cjs.map +1 -0
  138. package/dist/cjs/init/utils/githubActions.cjs +159 -0
  139. package/dist/cjs/init/utils/githubActions.cjs.map +1 -0
  140. package/dist/cjs/init/utils/index.cjs +51 -0
  141. package/dist/cjs/init/utils/jsonParser.cjs +43 -0
  142. package/dist/cjs/init/utils/jsonParser.cjs.map +1 -0
  143. package/dist/cjs/init/utils/nextCompilerBabel.cjs +119 -0
  144. package/dist/cjs/init/utils/nextCompilerBabel.cjs.map +1 -0
  145. package/dist/cjs/init/utils/packageManager.cjs +303 -0
  146. package/dist/cjs/init/utils/packageManager.cjs.map +1 -0
  147. package/dist/cjs/init/utils/tsConfig.cjs +19 -0
  148. package/dist/cjs/init/utils/tsConfig.cjs.map +1 -0
  149. package/dist/cjs/initConfig/index.cjs +49 -0
  150. package/dist/cjs/initConfig/index.cjs.map +1 -0
  151. package/dist/cjs/installLSP.cjs +58 -0
  152. package/dist/cjs/installLSP.cjs.map +1 -0
  153. package/dist/cjs/installMCP/installMCP.cjs +51 -0
  154. package/dist/cjs/installMCP/installMCP.cjs.map +1 -0
  155. package/dist/cjs/installSkills/index.cjs +307 -0
  156. package/dist/cjs/installSkills/index.cjs.map +1 -0
  157. package/dist/cjs/listDictionariesPath.cjs +43 -0
  158. package/dist/cjs/listDictionariesPath.cjs.map +1 -0
  159. package/dist/cjs/listGitFiles.cjs +105 -0
  160. package/dist/cjs/listGitFiles.cjs.map +1 -0
  161. package/dist/cjs/listProjects.cjs +48 -0
  162. package/dist/cjs/listProjects.cjs.map +1 -0
  163. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +56 -0
  164. package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -0
  165. package/dist/cjs/loadDictionaries/index.cjs +14 -0
  166. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +133 -0
  167. package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -0
  168. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +128 -0
  169. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -0
  170. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +28 -0
  171. package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -0
  172. package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs +45 -0
  173. package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs.map +1 -0
  174. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +63 -0
  175. package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -0
  176. package/dist/cjs/loadDictionaries/loadYamlContentDeclaration.cjs +27 -0
  177. package/dist/cjs/loadDictionaries/loadYamlContentDeclaration.cjs.map +1 -0
  178. package/dist/cjs/loadDictionaries/log.cjs +138 -0
  179. package/dist/cjs/loadDictionaries/log.cjs.map +1 -0
  180. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +64 -0
  181. package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -0
  182. package/dist/cjs/logConfigDetails.cjs +40 -0
  183. package/dist/cjs/logConfigDetails.cjs.map +1 -0
  184. package/dist/cjs/prepareIntlayer.cjs +104 -0
  185. package/dist/cjs/prepareIntlayer.cjs.map +1 -0
  186. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +31 -0
  187. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -0
  188. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +13 -0
  189. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -0
  190. package/dist/cjs/scan/analyzeBundleContent.cjs +182 -0
  191. package/dist/cjs/scan/analyzeBundleContent.cjs.map +1 -0
  192. package/dist/cjs/scan/calculateScore.cjs +65 -0
  193. package/dist/cjs/scan/calculateScore.cjs.map +1 -0
  194. package/dist/cjs/scan/checks.cjs +274 -0
  195. package/dist/cjs/scan/checks.cjs.map +1 -0
  196. package/dist/cjs/scan/index.cjs +31 -0
  197. package/dist/cjs/scan/parseHtml.cjs +127 -0
  198. package/dist/cjs/scan/parseHtml.cjs.map +1 -0
  199. package/dist/cjs/scan/scanWebsite.cjs +205 -0
  200. package/dist/cjs/scan/scanWebsite.cjs.map +1 -0
  201. package/dist/cjs/scan/types.cjs +0 -0
  202. package/dist/cjs/utils/autoDecorateContent.cjs +90 -0
  203. package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -0
  204. package/dist/cjs/utils/buildComponentFilesList.cjs +94 -0
  205. package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -0
  206. package/dist/cjs/utils/buildFilesList.cjs +84 -0
  207. package/dist/cjs/utils/buildFilesList.cjs.map +1 -0
  208. package/dist/cjs/utils/chunkJSON.cjs +337 -0
  209. package/dist/cjs/utils/chunkJSON.cjs.map +1 -0
  210. package/dist/cjs/utils/formatter.cjs +18 -0
  211. package/dist/cjs/utils/formatter.cjs.map +1 -0
  212. package/dist/cjs/utils/getChunk.cjs +35 -0
  213. package/dist/cjs/utils/getChunk.cjs.map +1 -0
  214. package/dist/cjs/utils/getContentExtension.cjs +30 -0
  215. package/dist/cjs/utils/getContentExtension.cjs.map +1 -0
  216. package/dist/cjs/utils/getFormatFromExtension.cjs +41 -0
  217. package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -0
  218. package/dist/cjs/utils/getPathHash.cjs +22 -0
  219. package/dist/cjs/utils/getPathHash.cjs.map +1 -0
  220. package/dist/cjs/utils/index.cjs +50 -0
  221. package/dist/cjs/utils/mergeChunks.cjs +29 -0
  222. package/dist/cjs/utils/mergeChunks.cjs.map +1 -0
  223. package/dist/cjs/utils/pLimit.cjs +134 -0
  224. package/dist/cjs/utils/pLimit.cjs.map +1 -0
  225. package/dist/cjs/utils/parallelize.cjs +12 -0
  226. package/dist/cjs/utils/parallelize.cjs.map +1 -0
  227. package/dist/cjs/utils/parallelizeGlobal.cjs +30 -0
  228. package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -0
  229. package/dist/cjs/utils/readDictionariesFromDisk.cjs +25 -0
  230. package/dist/cjs/utils/readDictionariesFromDisk.cjs.map +1 -0
  231. package/dist/cjs/utils/reduceObjectFormat.cjs +70 -0
  232. package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -0
  233. package/dist/cjs/utils/resolveObjectPromises.cjs +22 -0
  234. package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -0
  235. package/dist/cjs/utils/resolveRelativePath.cjs +22 -0
  236. package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -0
  237. package/dist/cjs/utils/runOnce.cjs +96 -0
  238. package/dist/cjs/utils/runOnce.cjs.map +1 -0
  239. package/dist/cjs/utils/runParallel/bin.cjs +55 -0
  240. package/dist/cjs/utils/runParallel/bin.cjs.map +1 -0
  241. package/dist/cjs/utils/runParallel/bootstrap.cjs +25 -0
  242. package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -0
  243. package/dist/cjs/utils/runParallel/index.cjs +102 -0
  244. package/dist/cjs/utils/runParallel/index.cjs.map +1 -0
  245. package/dist/cjs/utils/runParallel/pidTree.cjs +146 -0
  246. package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -0
  247. package/dist/cjs/utils/runParallel/ps.cjs +50 -0
  248. package/dist/cjs/utils/runParallel/ps.cjs.map +1 -0
  249. package/dist/cjs/utils/runParallel/runTask.cjs +155 -0
  250. package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -0
  251. package/dist/cjs/utils/runParallel/spawnPosix.cjs +49 -0
  252. package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -0
  253. package/dist/cjs/utils/runParallel/spawnWin32.cjs +44 -0
  254. package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -0
  255. package/dist/cjs/utils/runParallel/wmic.cjs +53 -0
  256. package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -0
  257. package/dist/cjs/utils/sortAlphabetically.cjs +8 -0
  258. package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -0
  259. package/dist/cjs/utils/splitTextByLine.cjs +12 -0
  260. package/dist/cjs/utils/splitTextByLine.cjs.map +1 -0
  261. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +66 -0
  262. package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -0
  263. package/dist/cjs/watcher.cjs +230 -0
  264. package/dist/cjs/watcher.cjs.map +1 -0
  265. package/dist/cjs/writeConfiguration/generateConfigurationContent.cjs +35 -0
  266. package/dist/cjs/writeConfiguration/generateConfigurationContent.cjs.map +1 -0
  267. package/dist/cjs/writeConfiguration/index.cjs +25 -0
  268. package/dist/cjs/writeConfiguration/index.cjs.map +1 -0
  269. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +29 -0
  270. package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -0
  271. package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs +0 -0
  272. package/dist/cjs/writeContentDeclaration/index.cjs +10 -0
  273. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +95 -0
  274. package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -0
  275. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +417 -0
  276. package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -0
  277. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +128 -0
  278. package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -0
  279. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +164 -0
  280. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -0
  281. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +93 -0
  282. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -0
  283. package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs +66 -0
  284. package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs.map +1 -0
  285. package/dist/cjs/writeContentDeclaration/writeYamlFile.cjs +44 -0
  286. package/dist/cjs/writeContentDeclaration/writeYamlFile.cjs.map +1 -0
  287. package/dist/cjs/writeFileIfChanged.cjs +51 -0
  288. package/dist/cjs/writeFileIfChanged.cjs.map +1 -0
  289. package/dist/cjs/writeJsonIfChanged.cjs +18 -0
  290. package/dist/cjs/writeJsonIfChanged.cjs.map +1 -0
  291. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  292. package/dist/esm/_virtual/_utils_asset.mjs +97 -0
  293. package/dist/esm/build.mjs +26 -0
  294. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +78 -0
  295. package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -0
  296. package/dist/esm/buildIntlayerDictionary/index.mjs +4 -0
  297. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +25 -0
  298. package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -0
  299. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +201 -0
  300. package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -0
  301. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +56 -0
  302. package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -0
  303. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +47 -0
  304. package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -0
  305. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +49 -0
  306. package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -0
  307. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +59 -0
  308. package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -0
  309. package/dist/esm/cleanOutputDir.mjs +29 -0
  310. package/dist/esm/cleanOutputDir.mjs.map +1 -0
  311. package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -0
  312. package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -0
  313. package/dist/esm/cli.mjs +20 -0
  314. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +69 -0
  315. package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -0
  316. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +41 -0
  317. package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -0
  318. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +22 -0
  319. package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -0
  320. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +23 -0
  321. package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -0
  322. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +23 -0
  323. package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -0
  324. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +22 -0
  325. package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -0
  326. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +22 -0
  327. package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
  328. package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -0
  329. package/dist/esm/createType/createModuleAugmentation.mjs +122 -0
  330. package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -0
  331. package/dist/esm/createType/createType.mjs +27 -0
  332. package/dist/esm/createType/createType.mjs.map +1 -0
  333. package/dist/esm/createType/index.mjs +4 -0
  334. package/dist/esm/detectFormatCommand.mjs +31 -0
  335. package/dist/esm/detectFormatCommand.mjs.map +1 -0
  336. package/dist/esm/docReview/alignBlocks.mjs +78 -0
  337. package/dist/esm/docReview/alignBlocks.mjs.map +1 -0
  338. package/dist/esm/docReview/computeSimilarity.mjs +39 -0
  339. package/dist/esm/docReview/computeSimilarity.mjs.map +1 -0
  340. package/dist/esm/docReview/fingerprintBlock.mjs +32 -0
  341. package/dist/esm/docReview/fingerprintBlock.mjs.map +1 -0
  342. package/dist/esm/docReview/index.mjs +12 -0
  343. package/dist/esm/docReview/mapChangedLinesToBlocks.mjs +25 -0
  344. package/dist/esm/docReview/mapChangedLinesToBlocks.mjs.map +1 -0
  345. package/dist/esm/docReview/normalizeBlock.mjs +32 -0
  346. package/dist/esm/docReview/normalizeBlock.mjs.map +1 -0
  347. package/dist/esm/docReview/pipeline.mjs +142 -0
  348. package/dist/esm/docReview/pipeline.mjs.map +1 -0
  349. package/dist/esm/docReview/planActions.mjs +56 -0
  350. package/dist/esm/docReview/planActions.mjs.map +1 -0
  351. package/dist/esm/docReview/rebuildDocument.mjs +62 -0
  352. package/dist/esm/docReview/rebuildDocument.mjs.map +1 -0
  353. package/dist/esm/docReview/reviewReport.mjs +196 -0
  354. package/dist/esm/docReview/reviewReport.mjs.map +1 -0
  355. package/dist/esm/docReview/segmentDocument.mjs +131 -0
  356. package/dist/esm/docReview/segmentDocument.mjs.map +1 -0
  357. package/dist/esm/docReview/types.mjs +0 -0
  358. package/dist/esm/fetchDistantDictionaries.mjs +51 -0
  359. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -0
  360. package/dist/esm/filterInvalidDictionaries.mjs +53 -0
  361. package/dist/esm/filterInvalidDictionaries.mjs.map +1 -0
  362. package/dist/esm/formatDictionary.mjs +55 -0
  363. package/dist/esm/formatDictionary.mjs.map +1 -0
  364. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +81 -0
  365. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -0
  366. package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -0
  367. package/dist/esm/handleAdditionalContentDeclarationFile.mjs +33 -0
  368. package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -0
  369. package/dist/esm/handleContentDeclarationFileChange.mjs +54 -0
  370. package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -0
  371. package/dist/esm/handleContentDeclarationFileMoved.mjs +23 -0
  372. package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -0
  373. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +36 -0
  374. package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -0
  375. package/dist/esm/init/cms.mjs +131 -0
  376. package/dist/esm/init/cms.mjs.map +1 -0
  377. package/dist/esm/init/frameworkSetup/index.mjs +26 -0
  378. package/dist/esm/init/frameworkSetup/index.mjs.map +1 -0
  379. package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs +52 -0
  380. package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs.map +1 -0
  381. package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs +104 -0
  382. package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs.map +1 -0
  383. package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs +157 -0
  384. package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs.map +1 -0
  385. package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs +113 -0
  386. package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs.map +1 -0
  387. package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs +193 -0
  388. package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs.map +1 -0
  389. package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs +28 -0
  390. package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs.map +1 -0
  391. package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs +73 -0
  392. package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs.map +1 -0
  393. package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs +108 -0
  394. package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs.map +1 -0
  395. package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs +102 -0
  396. package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs.map +1 -0
  397. package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs +139 -0
  398. package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs.map +1 -0
  399. package/dist/esm/init/frameworkSetup/types.mjs +0 -0
  400. package/dist/esm/init/index.mjs +518 -0
  401. package/dist/esm/init/index.mjs.map +1 -0
  402. package/dist/esm/init/utils/astImports.mjs +51 -0
  403. package/dist/esm/init/utils/astImports.mjs.map +1 -0
  404. package/dist/esm/init/utils/configManipulation.mjs +499 -0
  405. package/dist/esm/init/utils/configManipulation.mjs.map +1 -0
  406. package/dist/esm/init/utils/fileSystem.mjs +222 -0
  407. package/dist/esm/init/utils/fileSystem.mjs.map +1 -0
  408. package/dist/esm/init/utils/githubActions.mjs +155 -0
  409. package/dist/esm/init/utils/githubActions.mjs.map +1 -0
  410. package/dist/esm/init/utils/index.mjs +10 -0
  411. package/dist/esm/init/utils/jsonParser.mjs +41 -0
  412. package/dist/esm/init/utils/jsonParser.mjs.map +1 -0
  413. package/dist/esm/init/utils/nextCompilerBabel.mjs +115 -0
  414. package/dist/esm/init/utils/nextCompilerBabel.mjs.map +1 -0
  415. package/dist/esm/init/utils/packageManager.mjs +294 -0
  416. package/dist/esm/init/utils/packageManager.mjs.map +1 -0
  417. package/dist/esm/init/utils/tsConfig.mjs +17 -0
  418. package/dist/esm/init/utils/tsConfig.mjs.map +1 -0
  419. package/dist/esm/initConfig/index.mjs +47 -0
  420. package/dist/esm/initConfig/index.mjs.map +1 -0
  421. package/dist/esm/installLSP.mjs +55 -0
  422. package/dist/esm/installLSP.mjs.map +1 -0
  423. package/dist/esm/installMCP/installMCP.mjs +47 -0
  424. package/dist/esm/installMCP/installMCP.mjs.map +1 -0
  425. package/dist/esm/installSkills/index.mjs +299 -0
  426. package/dist/esm/installSkills/index.mjs.map +1 -0
  427. package/dist/esm/listDictionariesPath.mjs +39 -0
  428. package/dist/esm/listDictionariesPath.mjs.map +1 -0
  429. package/dist/esm/listGitFiles.mjs +101 -0
  430. package/dist/esm/listGitFiles.mjs.map +1 -0
  431. package/dist/esm/listProjects.mjs +44 -0
  432. package/dist/esm/listProjects.mjs.map +1 -0
  433. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +54 -0
  434. package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -0
  435. package/dist/esm/loadDictionaries/index.mjs +6 -0
  436. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +128 -0
  437. package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -0
  438. package/dist/esm/loadDictionaries/loadDictionaries.mjs +125 -0
  439. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -0
  440. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +26 -0
  441. package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -0
  442. package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs +43 -0
  443. package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs.map +1 -0
  444. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +60 -0
  445. package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -0
  446. package/dist/esm/loadDictionaries/loadYamlContentDeclaration.mjs +25 -0
  447. package/dist/esm/loadDictionaries/loadYamlContentDeclaration.mjs.map +1 -0
  448. package/dist/esm/loadDictionaries/log.mjs +135 -0
  449. package/dist/esm/loadDictionaries/log.mjs.map +1 -0
  450. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +62 -0
  451. package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -0
  452. package/dist/esm/logConfigDetails.mjs +37 -0
  453. package/dist/esm/logConfigDetails.mjs.map +1 -0
  454. package/dist/esm/prepareIntlayer.mjs +100 -0
  455. package/dist/esm/prepareIntlayer.mjs.map +1 -0
  456. package/dist/esm/reduceDictionaryContent/applyMask.mjs +29 -0
  457. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -0
  458. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +11 -0
  459. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -0
  460. package/dist/esm/scan/analyzeBundleContent.mjs +180 -0
  461. package/dist/esm/scan/analyzeBundleContent.mjs.map +1 -0
  462. package/dist/esm/scan/calculateScore.mjs +61 -0
  463. package/dist/esm/scan/calculateScore.mjs.map +1 -0
  464. package/dist/esm/scan/checks.mjs +265 -0
  465. package/dist/esm/scan/checks.mjs.map +1 -0
  466. package/dist/esm/scan/index.mjs +7 -0
  467. package/dist/esm/scan/parseHtml.mjs +115 -0
  468. package/dist/esm/scan/parseHtml.mjs.map +1 -0
  469. package/dist/esm/scan/scanWebsite.mjs +203 -0
  470. package/dist/esm/scan/scanWebsite.mjs.map +1 -0
  471. package/dist/esm/scan/types.mjs +0 -0
  472. package/dist/esm/utils/autoDecorateContent.mjs +87 -0
  473. package/dist/esm/utils/autoDecorateContent.mjs.map +1 -0
  474. package/dist/esm/utils/buildComponentFilesList.mjs +91 -0
  475. package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -0
  476. package/dist/esm/utils/buildFilesList.mjs +80 -0
  477. package/dist/esm/utils/buildFilesList.mjs.map +1 -0
  478. package/dist/esm/utils/chunkJSON.mjs +334 -0
  479. package/dist/esm/utils/chunkJSON.mjs.map +1 -0
  480. package/dist/esm/utils/formatter.mjs +14 -0
  481. package/dist/esm/utils/formatter.mjs.map +1 -0
  482. package/dist/esm/utils/getChunk.mjs +34 -0
  483. package/dist/esm/utils/getChunk.mjs.map +1 -0
  484. package/dist/esm/utils/getContentExtension.mjs +28 -0
  485. package/dist/esm/utils/getContentExtension.mjs.map +1 -0
  486. package/dist/esm/utils/getFormatFromExtension.mjs +38 -0
  487. package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -0
  488. package/dist/esm/utils/getPathHash.mjs +20 -0
  489. package/dist/esm/utils/getPathHash.mjs.map +1 -0
  490. package/dist/esm/utils/index.mjs +22 -0
  491. package/dist/esm/utils/mergeChunks.mjs +27 -0
  492. package/dist/esm/utils/mergeChunks.mjs.map +1 -0
  493. package/dist/esm/utils/pLimit.mjs +131 -0
  494. package/dist/esm/utils/pLimit.mjs.map +1 -0
  495. package/dist/esm/utils/parallelize.mjs +11 -0
  496. package/dist/esm/utils/parallelize.mjs.map +1 -0
  497. package/dist/esm/utils/parallelizeGlobal.mjs +27 -0
  498. package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -0
  499. package/dist/esm/utils/readDictionariesFromDisk.mjs +23 -0
  500. package/dist/esm/utils/readDictionariesFromDisk.mjs.map +1 -0
  501. package/dist/esm/utils/reduceObjectFormat.mjs +67 -0
  502. package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -0
  503. package/dist/esm/utils/resolveObjectPromises.mjs +20 -0
  504. package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -0
  505. package/dist/esm/utils/resolveRelativePath.mjs +20 -0
  506. package/dist/esm/utils/resolveRelativePath.mjs.map +1 -0
  507. package/dist/esm/utils/runOnce.mjs +93 -0
  508. package/dist/esm/utils/runOnce.mjs.map +1 -0
  509. package/dist/esm/utils/runParallel/bin.mjs +53 -0
  510. package/dist/esm/utils/runParallel/bin.mjs.map +1 -0
  511. package/dist/esm/utils/runParallel/bootstrap.mjs +23 -0
  512. package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -0
  513. package/dist/esm/utils/runParallel/index.mjs +100 -0
  514. package/dist/esm/utils/runParallel/index.mjs.map +1 -0
  515. package/dist/esm/utils/runParallel/pidTree.mjs +143 -0
  516. package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -0
  517. package/dist/esm/utils/runParallel/ps.mjs +47 -0
  518. package/dist/esm/utils/runParallel/ps.mjs.map +1 -0
  519. package/dist/esm/utils/runParallel/runTask.mjs +153 -0
  520. package/dist/esm/utils/runParallel/runTask.mjs.map +1 -0
  521. package/dist/esm/utils/runParallel/spawnPosix.mjs +47 -0
  522. package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -0
  523. package/dist/esm/utils/runParallel/spawnWin32.mjs +42 -0
  524. package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -0
  525. package/dist/esm/utils/runParallel/wmic.mjs +50 -0
  526. package/dist/esm/utils/runParallel/wmic.mjs.map +1 -0
  527. package/dist/esm/utils/sortAlphabetically.mjs +6 -0
  528. package/dist/esm/utils/sortAlphabetically.mjs.map +1 -0
  529. package/dist/esm/utils/splitTextByLine.mjs +10 -0
  530. package/dist/esm/utils/splitTextByLine.mjs.map +1 -0
  531. package/dist/esm/utils/verifyIdenticObjectFormat.mjs +64 -0
  532. package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -0
  533. package/dist/esm/watcher.mjs +226 -0
  534. package/dist/esm/watcher.mjs.map +1 -0
  535. package/dist/esm/writeConfiguration/generateConfigurationContent.mjs +33 -0
  536. package/dist/esm/writeConfiguration/generateConfigurationContent.mjs.map +1 -0
  537. package/dist/esm/writeConfiguration/index.mjs +22 -0
  538. package/dist/esm/writeConfiguration/index.mjs.map +1 -0
  539. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +27 -0
  540. package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -0
  541. package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs +0 -0
  542. package/dist/esm/writeContentDeclaration/index.mjs +6 -0
  543. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +92 -0
  544. package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -0
  545. package/dist/esm/writeContentDeclaration/transformJSFile.mjs +412 -0
  546. package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -0
  547. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +125 -0
  548. package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -0
  549. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +162 -0
  550. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -0
  551. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +91 -0
  552. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -0
  553. package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs +64 -0
  554. package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs.map +1 -0
  555. package/dist/esm/writeContentDeclaration/writeYamlFile.mjs +42 -0
  556. package/dist/esm/writeContentDeclaration/writeYamlFile.mjs.map +1 -0
  557. package/dist/esm/writeFileIfChanged.mjs +49 -0
  558. package/dist/esm/writeFileIfChanged.mjs.map +1 -0
  559. package/dist/esm/writeJsonIfChanged.mjs +17 -0
  560. package/dist/esm/writeJsonIfChanged.mjs.map +1 -0
  561. package/dist/types/build.d.ts +26 -0
  562. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -0
  563. package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
  564. package/dist/types/buildIntlayerDictionary/index.d.ts +3 -0
  565. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -0
  566. package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
  567. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +77 -0
  568. package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
  569. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +25 -0
  570. package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -0
  571. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +40 -0
  572. package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
  573. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +29 -0
  574. package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -0
  575. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -0
  576. package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
  577. package/dist/types/cleanOutputDir.d.ts +7 -0
  578. package/dist/types/cleanOutputDir.d.ts.map +1 -0
  579. package/dist/types/cleanRemovedContentDeclaration.d.ts +11 -0
  580. package/dist/types/cleanRemovedContentDeclaration.d.ts.map +1 -0
  581. package/dist/types/cli.d.ts +21 -0
  582. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -0
  583. package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
  584. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -0
  585. package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
  586. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -0
  587. package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
  588. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -0
  589. package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
  590. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -0
  591. package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
  592. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -0
  593. package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
  594. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -0
  595. package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  596. package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -0
  597. package/dist/types/createType/createModuleAugmentation.d.ts +9 -0
  598. package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
  599. package/dist/types/createType/createType.d.ts +12 -0
  600. package/dist/types/createType/createType.d.ts.map +1 -0
  601. package/dist/types/createType/index.d.ts +3 -0
  602. package/dist/types/detectFormatCommand.d.ts +7 -0
  603. package/dist/types/detectFormatCommand.d.ts.map +1 -0
  604. package/dist/types/docReview/alignBlocks.d.ts +18 -0
  605. package/dist/types/docReview/alignBlocks.d.ts.map +1 -0
  606. package/dist/types/docReview/computeSimilarity.d.ts +22 -0
  607. package/dist/types/docReview/computeSimilarity.d.ts.map +1 -0
  608. package/dist/types/docReview/fingerprintBlock.d.ts +18 -0
  609. package/dist/types/docReview/fingerprintBlock.d.ts.map +1 -0
  610. package/dist/types/docReview/index.d.ts +12 -0
  611. package/dist/types/docReview/mapChangedLinesToBlocks.d.ts +15 -0
  612. package/dist/types/docReview/mapChangedLinesToBlocks.d.ts.map +1 -0
  613. package/dist/types/docReview/normalizeBlock.d.ts +18 -0
  614. package/dist/types/docReview/normalizeBlock.d.ts.map +1 -0
  615. package/dist/types/docReview/pipeline.d.ts +46 -0
  616. package/dist/types/docReview/pipeline.d.ts.map +1 -0
  617. package/dist/types/docReview/planActions.d.ts +18 -0
  618. package/dist/types/docReview/planActions.d.ts.map +1 -0
  619. package/dist/types/docReview/rebuildDocument.d.ts +46 -0
  620. package/dist/types/docReview/rebuildDocument.d.ts.map +1 -0
  621. package/dist/types/docReview/reviewReport.d.ts +82 -0
  622. package/dist/types/docReview/reviewReport.d.ts.map +1 -0
  623. package/dist/types/docReview/segmentDocument.d.ts +40 -0
  624. package/dist/types/docReview/segmentDocument.d.ts.map +1 -0
  625. package/dist/types/docReview/types.d.ts +73 -0
  626. package/dist/types/docReview/types.d.ts.map +1 -0
  627. package/dist/types/fetchDistantDictionaries.d.ts +16 -0
  628. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -0
  629. package/dist/types/filterInvalidDictionaries.d.ts +12 -0
  630. package/dist/types/filterInvalidDictionaries.d.ts.map +1 -0
  631. package/dist/types/formatDictionary.d.ts +62 -0
  632. package/dist/types/formatDictionary.d.ts.map +1 -0
  633. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -0
  634. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  635. package/dist/types/getContentDeclarationFileTemplate/index.d.ts +2 -0
  636. package/dist/types/handleAdditionalContentDeclarationFile.d.ts +7 -0
  637. package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -0
  638. package/dist/types/handleContentDeclarationFileChange.d.ts +7 -0
  639. package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -0
  640. package/dist/types/handleContentDeclarationFileMoved.d.ts +7 -0
  641. package/dist/types/handleContentDeclarationFileMoved.d.ts.map +1 -0
  642. package/dist/types/handleUnlinkedContentDeclarationFile.d.ts +7 -0
  643. package/dist/types/handleUnlinkedContentDeclarationFile.d.ts.map +1 -0
  644. package/dist/types/init/cms.d.ts +51 -0
  645. package/dist/types/init/cms.d.ts.map +1 -0
  646. package/dist/types/init/frameworkSetup/index.d.ts +13 -0
  647. package/dist/types/init/frameworkSetup/index.d.ts.map +1 -0
  648. package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts +25 -0
  649. package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts.map +1 -0
  650. package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts +12 -0
  651. package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts.map +1 -0
  652. package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts +56 -0
  653. package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts.map +1 -0
  654. package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts +26 -0
  655. package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts.map +1 -0
  656. package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts +23 -0
  657. package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts.map +1 -0
  658. package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts +19 -0
  659. package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts.map +1 -0
  660. package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts +13 -0
  661. package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts.map +1 -0
  662. package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts +68 -0
  663. package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts.map +1 -0
  664. package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts +22 -0
  665. package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts.map +1 -0
  666. package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts +17 -0
  667. package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts.map +1 -0
  668. package/dist/types/init/frameworkSetup/types.d.ts +43 -0
  669. package/dist/types/init/frameworkSetup/types.d.ts.map +1 -0
  670. package/dist/types/init/index.d.ts +46 -0
  671. package/dist/types/init/index.d.ts.map +1 -0
  672. package/dist/types/init/utils/astImports.d.ts +29 -0
  673. package/dist/types/init/utils/astImports.d.ts.map +1 -0
  674. package/dist/types/init/utils/configManipulation.d.ts +99 -0
  675. package/dist/types/init/utils/configManipulation.d.ts.map +1 -0
  676. package/dist/types/init/utils/fileSystem.d.ts +111 -0
  677. package/dist/types/init/utils/fileSystem.d.ts.map +1 -0
  678. package/dist/types/init/utils/githubActions.d.ts +19 -0
  679. package/dist/types/init/utils/githubActions.d.ts.map +1 -0
  680. package/dist/types/init/utils/index.d.ts +9 -0
  681. package/dist/types/init/utils/jsonParser.d.ts +8 -0
  682. package/dist/types/init/utils/jsonParser.d.ts.map +1 -0
  683. package/dist/types/init/utils/nextCompilerBabel.d.ts +53 -0
  684. package/dist/types/init/utils/nextCompilerBabel.d.ts.map +1 -0
  685. package/dist/types/init/utils/packageManager.d.ts +149 -0
  686. package/dist/types/init/utils/packageManager.d.ts.map +1 -0
  687. package/dist/types/init/utils/tsConfig.d.ts +8 -0
  688. package/dist/types/init/utils/tsConfig.d.ts.map +1 -0
  689. package/dist/types/initConfig/index.d.ts +10 -0
  690. package/dist/types/initConfig/index.d.ts.map +1 -0
  691. package/dist/types/installLSP.d.ts +12 -0
  692. package/dist/types/installLSP.d.ts.map +1 -0
  693. package/dist/types/installMCP/installMCP.d.ts +11 -0
  694. package/dist/types/installMCP/installMCP.d.ts.map +1 -0
  695. package/dist/types/installSkills/index.d.ts +42 -0
  696. package/dist/types/installSkills/index.d.ts.map +1 -0
  697. package/dist/types/listDictionariesPath.d.ts +17 -0
  698. package/dist/types/listDictionariesPath.d.ts.map +1 -0
  699. package/dist/types/listGitFiles.d.ts +27 -0
  700. package/dist/types/listGitFiles.d.ts.map +1 -0
  701. package/dist/types/listProjects.d.ts +26 -0
  702. package/dist/types/listProjects.d.ts.map +1 -0
  703. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts +7 -0
  704. package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -0
  705. package/dist/types/loadDictionaries/index.d.ts +5 -0
  706. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +15 -0
  707. package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
  708. package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -0
  709. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
  710. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -0
  711. package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
  712. package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts +7 -0
  713. package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts.map +1 -0
  714. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -0
  715. package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
  716. package/dist/types/loadDictionaries/loadYamlContentDeclaration.d.ts +7 -0
  717. package/dist/types/loadDictionaries/loadYamlContentDeclaration.d.ts.map +1 -0
  718. package/dist/types/loadDictionaries/log.d.ts +36 -0
  719. package/dist/types/loadDictionaries/log.d.ts.map +1 -0
  720. package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts +7 -0
  721. package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts.map +1 -0
  722. package/dist/types/logConfigDetails.d.ts +7 -0
  723. package/dist/types/logConfigDetails.d.ts.map +1 -0
  724. package/dist/types/prepareIntlayer.d.ts +15 -0
  725. package/dist/types/prepareIntlayer.d.ts.map +1 -0
  726. package/dist/types/reduceDictionaryContent/applyMask.d.ts +7 -0
  727. package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -0
  728. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +7 -0
  729. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -0
  730. package/dist/types/scan/analyzeBundleContent.d.ts +16 -0
  731. package/dist/types/scan/analyzeBundleContent.d.ts.map +1 -0
  732. package/dist/types/scan/calculateScore.d.ts +65 -0
  733. package/dist/types/scan/calculateScore.d.ts.map +1 -0
  734. package/dist/types/scan/checks.d.ts +38 -0
  735. package/dist/types/scan/checks.d.ts.map +1 -0
  736. package/dist/types/scan/index.d.ts +7 -0
  737. package/dist/types/scan/parseHtml.d.ts +54 -0
  738. package/dist/types/scan/parseHtml.d.ts.map +1 -0
  739. package/dist/types/scan/scanWebsite.d.ts +18 -0
  740. package/dist/types/scan/scanWebsite.d.ts.map +1 -0
  741. package/dist/types/scan/types.d.ts +76 -0
  742. package/dist/types/scan/types.d.ts.map +1 -0
  743. package/dist/types/utils/autoDecorateContent.d.ts +13 -0
  744. package/dist/types/utils/autoDecorateContent.d.ts.map +1 -0
  745. package/dist/types/utils/buildComponentFilesList.d.ts +28 -0
  746. package/dist/types/utils/buildComponentFilesList.d.ts.map +1 -0
  747. package/dist/types/utils/buildFilesList.d.ts +62 -0
  748. package/dist/types/utils/buildFilesList.d.ts.map +1 -0
  749. package/dist/types/utils/chunkJSON.d.ts +56 -0
  750. package/dist/types/utils/chunkJSON.d.ts.map +1 -0
  751. package/dist/types/utils/formatter.d.ts +9 -0
  752. package/dist/types/utils/formatter.d.ts.map +1 -0
  753. package/dist/types/utils/getChunk.d.ts +11 -0
  754. package/dist/types/utils/getChunk.d.ts.map +1 -0
  755. package/dist/types/utils/getContentExtension.d.ts +15 -0
  756. package/dist/types/utils/getContentExtension.d.ts.map +1 -0
  757. package/dist/types/utils/getFormatFromExtension.d.ts +8 -0
  758. package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
  759. package/dist/types/utils/getPathHash.d.ts +8 -0
  760. package/dist/types/utils/getPathHash.d.ts.map +1 -0
  761. package/dist/types/utils/index.d.ts +21 -0
  762. package/dist/types/utils/mergeChunks.d.ts +5 -0
  763. package/dist/types/utils/mergeChunks.d.ts.map +1 -0
  764. package/dist/types/utils/pLimit.d.ts +16 -0
  765. package/dist/types/utils/pLimit.d.ts.map +1 -0
  766. package/dist/types/utils/parallelize.d.ts +5 -0
  767. package/dist/types/utils/parallelize.d.ts.map +1 -0
  768. package/dist/types/utils/parallelizeGlobal.d.ts +20 -0
  769. package/dist/types/utils/parallelizeGlobal.d.ts.map +1 -0
  770. package/dist/types/utils/readDictionariesFromDisk.d.ts +9 -0
  771. package/dist/types/utils/readDictionariesFromDisk.d.ts.map +1 -0
  772. package/dist/types/utils/reduceObjectFormat.d.ts +30 -0
  773. package/dist/types/utils/reduceObjectFormat.d.ts.map +1 -0
  774. package/dist/types/utils/resolveObjectPromises.d.ts +9 -0
  775. package/dist/types/utils/resolveObjectPromises.d.ts.map +1 -0
  776. package/dist/types/utils/resolveRelativePath.d.ts +5 -0
  777. package/dist/types/utils/resolveRelativePath.d.ts.map +1 -0
  778. package/dist/types/utils/runOnce.d.ts +45 -0
  779. package/dist/types/utils/runOnce.d.ts.map +1 -0
  780. package/dist/types/utils/runParallel/bin.d.ts +15 -0
  781. package/dist/types/utils/runParallel/bin.d.ts.map +1 -0
  782. package/dist/types/utils/runParallel/bootstrap.d.ts +5 -0
  783. package/dist/types/utils/runParallel/bootstrap.d.ts.map +1 -0
  784. package/dist/types/utils/runParallel/index.d.ts +14 -0
  785. package/dist/types/utils/runParallel/index.d.ts.map +1 -0
  786. package/dist/types/utils/runParallel/pidTree.d.ts +24 -0
  787. package/dist/types/utils/runParallel/pidTree.d.ts.map +1 -0
  788. package/dist/types/utils/runParallel/ps.d.ts +11 -0
  789. package/dist/types/utils/runParallel/ps.d.ts.map +1 -0
  790. package/dist/types/utils/runParallel/runTask.d.ts +26 -0
  791. package/dist/types/utils/runParallel/runTask.d.ts.map +1 -0
  792. package/dist/types/utils/runParallel/spawnPosix.d.ts +20 -0
  793. package/dist/types/utils/runParallel/spawnPosix.d.ts.map +1 -0
  794. package/dist/types/utils/runParallel/spawnWin32.d.ts +20 -0
  795. package/dist/types/utils/runParallel/spawnWin32.d.ts.map +1 -0
  796. package/dist/types/utils/runParallel/wmic.d.ts +11 -0
  797. package/dist/types/utils/runParallel/wmic.d.ts.map +1 -0
  798. package/dist/types/utils/sortAlphabetically.d.ts +5 -0
  799. package/dist/types/utils/sortAlphabetically.d.ts.map +1 -0
  800. package/dist/types/utils/splitTextByLine.d.ts +5 -0
  801. package/dist/types/utils/splitTextByLine.d.ts.map +1 -0
  802. package/dist/types/utils/verifyIdenticObjectFormat.d.ts +23 -0
  803. package/dist/types/utils/verifyIdenticObjectFormat.d.ts.map +1 -0
  804. package/dist/types/watcher.d.ts +17 -0
  805. package/dist/types/watcher.d.ts.map +1 -0
  806. package/dist/types/writeConfiguration/generateConfigurationContent.d.ts +7 -0
  807. package/dist/types/writeConfiguration/generateConfigurationContent.d.ts.map +1 -0
  808. package/dist/types/writeConfiguration/index.d.ts +8 -0
  809. package/dist/types/writeConfiguration/index.d.ts.map +1 -0
  810. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -0
  811. package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
  812. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -0
  813. package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
  814. package/dist/types/writeContentDeclaration/index.d.ts +6 -0
  815. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts +14 -0
  816. package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -0
  817. package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -0
  818. package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
  819. package/dist/types/writeContentDeclaration/transformJSONFile.d.ts +7 -0
  820. package/dist/types/writeContentDeclaration/transformJSONFile.d.ts.map +1 -0
  821. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -0
  822. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
  823. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -0
  824. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  825. package/dist/types/writeContentDeclaration/writeMarkdownFile.d.ts +8 -0
  826. package/dist/types/writeContentDeclaration/writeMarkdownFile.d.ts.map +1 -0
  827. package/dist/types/writeContentDeclaration/writeYamlFile.d.ts +8 -0
  828. package/dist/types/writeContentDeclaration/writeYamlFile.d.ts.map +1 -0
  829. package/dist/types/writeFileIfChanged.d.ts +11 -0
  830. package/dist/types/writeFileIfChanged.d.ts.map +1 -0
  831. package/dist/types/writeJsonIfChanged.d.ts +9 -0
  832. package/dist/types/writeJsonIfChanged.d.ts.map +1 -0
  833. package/package.json +159 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segmentDocument.mjs","names":[],"sources":["../../../src/docReview/segmentDocument.ts"],"sourcesContent":["import type { Block, BlockType } from './types';\n\nconst isBlankLine = (line: string): boolean => line.trim().length === 0;\nconst isFencedCodeDelimiter = (line: string): boolean => /^\\s*```/.test(line);\nconst isHeading = (line: string): boolean => /^\\s*#{1,6}\\s+/.test(line);\nconst isFrontmatterDelimiter = (line: string): boolean =>\n /^\\s*---\\s*$/.test(line);\n\n/**\n * A content unit (heading, paragraph, code block or frontmatter) spanning a\n * 0-based, inclusive line range. Blank-line runs are not units of their own;\n * they are folded into the preceding unit as trailing separators (see\n * {@link segmentDocument}) so that the concatenation of every block's content\n * reproduces the document byte-for-byte.\n */\ntype ContentUnit = {\n type: BlockType;\n startIndex: number;\n endIndex: number;\n};\n\n/**\n * Split a markdown document into fine-grained blocks.\n *\n * Boundaries are drawn at headings, blank lines (paragraph breaks) and fenced\n * code blocks, while frontmatter and the inside of code fences are kept intact.\n * Each blank-line run is appended to the block that precedes it, so the blocks\n * form an exact partition of the document: concatenating every `content` (in\n * order) yields the original text unchanged. This is what lets the block-aware\n * review re-translate only the paragraphs/snippets that actually changed instead\n * of the whole heading section.\n *\n * @param text - The full markdown document.\n * @returns The ordered list of blocks with their 1-based line ranges.\n */\nexport const segmentDocument = (text: string): Block[] => {\n const lines = text.split('\\n');\n const lineCount = lines.length;\n\n // 1. Tokenize into content units, skipping blank-line runs (folded in below).\n const units: ContentUnit[] = [];\n let index = 0;\n\n while (index < lineCount) {\n const currentLine = lines[index];\n\n if (isBlankLine(currentLine)) {\n index += 1;\n continue;\n }\n\n // Frontmatter: only when it opens the document.\n if (units.length === 0 && isFrontmatterDelimiter(currentLine)) {\n const startIndex = index;\n index += 1;\n while (index < lineCount && !isFrontmatterDelimiter(lines[index])) {\n index += 1;\n }\n // Include the closing delimiter when present.\n if (index < lineCount) index += 1;\n units.push({ type: 'unknown', startIndex, endIndex: index - 1 });\n continue;\n }\n\n // Fenced code block: consumed whole so inner blank lines and `#` lines are\n // never treated as boundaries.\n if (isFencedCodeDelimiter(currentLine)) {\n const startIndex = index;\n index += 1;\n while (index < lineCount && !isFencedCodeDelimiter(lines[index])) {\n index += 1;\n }\n // Include the closing fence when present.\n if (index < lineCount) index += 1;\n units.push({ type: 'code_block', startIndex, endIndex: index - 1 });\n continue;\n }\n\n // Heading: a single self-contained line.\n if (isHeading(currentLine)) {\n units.push({ type: 'heading', startIndex: index, endIndex: index });\n index += 1;\n continue;\n }\n\n // Paragraph: a run of consecutive lines until a blank line, a heading or a\n // code fence. Tables and tight lists stay together (no blank line between\n // their rows/items).\n const startIndex = index;\n while (\n index < lineCount &&\n !isBlankLine(lines[index]) &&\n !isHeading(lines[index]) &&\n !isFencedCodeDelimiter(lines[index])\n ) {\n index += 1;\n }\n units.push({ type: 'paragraph', startIndex, endIndex: index - 1 });\n }\n\n if (units.length === 0) return [];\n\n // 2. Turn each unit into a block whose line range extends to just before the\n // next unit, so the trailing blank-line run is owned by it. The first block\n // also absorbs any leading blank lines, and the last block runs to EOF.\n return units.map((unit, unitIndex): Block => {\n const blockStartIndex = unitIndex === 0 ? 0 : unit.startIndex;\n const blockEndIndex =\n unitIndex === units.length - 1\n ? lineCount - 1\n : units[unitIndex + 1].startIndex - 1;\n\n const blockLines = lines.slice(blockStartIndex, blockEndIndex + 1);\n // Re-append the boundary newline dropped by `split` for every block but the\n // one ending at EOF, so concatenating all blocks rebuilds the document.\n const content =\n blockEndIndex < lineCount - 1\n ? `${blockLines.join('\\n')}\\n`\n : blockLines.join('\\n');\n\n return {\n type: unit.type,\n content,\n lineStart: blockStartIndex + 1,\n lineEnd: blockEndIndex + 1,\n };\n });\n};\n\n/**\n * Split a markdown document into coarse, heading-anchored sections.\n *\n * Built by grouping the fine blocks of {@link segmentDocument}: frontmatter and\n * each heading open a new section, and the following non-heading blocks are\n * folded into it. Because it only concatenates adjacent fine blocks, the result\n * is still an exact partition of the document (sections concatenate back to the\n * source unchanged).\n *\n * Sections are the robust alignment unit between a base document and its\n * translation — both share the same heading structure, so they align almost\n * perfectly and a translation that splits its prose into a different number of\n * paragraphs never causes a section to be dropped. Fine-grained review happens\n * within a section once it is known to have changed.\n *\n * @param text - The full markdown document.\n * @returns The ordered list of sections with their 1-based line ranges.\n */\nexport const segmentSections = (text: string): Block[] => {\n const fineBlocks = segmentDocument(text);\n const sections: Block[] = [];\n let currentBlocks: Block[] = [];\n\n const flushSection = (): void => {\n if (currentBlocks.length === 0) return;\n\n const [firstBlock] = currentBlocks;\n const lastBlock = currentBlocks[currentBlocks.length - 1];\n\n sections.push({\n type: firstBlock.type,\n content: currentBlocks.map((block) => block.content).join(''),\n lineStart: firstBlock.lineStart,\n lineEnd: lastBlock.lineEnd,\n });\n currentBlocks = [];\n };\n\n for (const block of fineBlocks) {\n // Frontmatter (a leading `unknown` block) and every heading open a section.\n const opensSection =\n block.type === 'heading' ||\n (block.type === 'unknown' && sections.length === 0);\n\n if (opensSection) flushSection();\n currentBlocks.push(block);\n if (block.type === 'unknown' && sections.length === 0) flushSection();\n }\n\n flushSection();\n\n return sections;\n};\n"],"mappings":";AAEA,MAAM,eAAe,SAA0B,KAAK,MAAM,CAAC,WAAW;AACtE,MAAM,yBAAyB,SAA0B,UAAU,KAAK,KAAK;AAC7E,MAAM,aAAa,SAA0B,gBAAgB,KAAK,KAAK;AACvE,MAAM,0BAA0B,SAC9B,cAAc,KAAK,KAAK;;;;;;;;;;;;;;;AA6B1B,MAAa,mBAAmB,SAA0B;CACxD,MAAM,QAAQ,KAAK,MAAM,KAAK;CAC9B,MAAM,YAAY,MAAM;CAGxB,MAAM,QAAuB,EAAE;CAC/B,IAAI,QAAQ;AAEZ,QAAO,QAAQ,WAAW;EACxB,MAAM,cAAc,MAAM;AAE1B,MAAI,YAAY,YAAY,EAAE;AAC5B,YAAS;AACT;;AAIF,MAAI,MAAM,WAAW,KAAK,uBAAuB,YAAY,EAAE;GAC7D,MAAM,aAAa;AACnB,YAAS;AACT,UAAO,QAAQ,aAAa,CAAC,uBAAuB,MAAM,OAAO,CAC/D,UAAS;AAGX,OAAI,QAAQ,UAAW,UAAS;AAChC,SAAM,KAAK;IAAE,MAAM;IAAW;IAAY,UAAU,QAAQ;IAAG,CAAC;AAChE;;AAKF,MAAI,sBAAsB,YAAY,EAAE;GACtC,MAAM,aAAa;AACnB,YAAS;AACT,UAAO,QAAQ,aAAa,CAAC,sBAAsB,MAAM,OAAO,CAC9D,UAAS;AAGX,OAAI,QAAQ,UAAW,UAAS;AAChC,SAAM,KAAK;IAAE,MAAM;IAAc;IAAY,UAAU,QAAQ;IAAG,CAAC;AACnE;;AAIF,MAAI,UAAU,YAAY,EAAE;AAC1B,SAAM,KAAK;IAAE,MAAM;IAAW,YAAY;IAAO,UAAU;IAAO,CAAC;AACnE,YAAS;AACT;;EAMF,MAAM,aAAa;AACnB,SACE,QAAQ,aACR,CAAC,YAAY,MAAM,OAAO,IAC1B,CAAC,UAAU,MAAM,OAAO,IACxB,CAAC,sBAAsB,MAAM,OAAO,CAEpC,UAAS;AAEX,QAAM,KAAK;GAAE,MAAM;GAAa;GAAY,UAAU,QAAQ;GAAG,CAAC;;AAGpE,KAAI,MAAM,WAAW,EAAG,QAAO,EAAE;AAKjC,QAAO,MAAM,KAAK,MAAM,cAAqB;EAC3C,MAAM,kBAAkB,cAAc,IAAI,IAAI,KAAK;EACnD,MAAM,gBACJ,cAAc,MAAM,SAAS,IACzB,YAAY,IACZ,MAAM,YAAY,GAAG,aAAa;EAExC,MAAM,aAAa,MAAM,MAAM,iBAAiB,gBAAgB,EAAE;EAGlE,MAAM,UACJ,gBAAgB,YAAY,IACxB,GAAG,WAAW,KAAK,KAAK,CAAC,MACzB,WAAW,KAAK,KAAK;AAE3B,SAAO;GACL,MAAM,KAAK;GACX;GACA,WAAW,kBAAkB;GAC7B,SAAS,gBAAgB;GAC1B;GACD;;;;;;;;;;;;;;;;;;;;AAqBJ,MAAa,mBAAmB,SAA0B;CACxD,MAAM,aAAa,gBAAgB,KAAK;CACxC,MAAM,WAAoB,EAAE;CAC5B,IAAI,gBAAyB,EAAE;CAE/B,MAAM,qBAA2B;AAC/B,MAAI,cAAc,WAAW,EAAG;EAEhC,MAAM,CAAC,cAAc;EACrB,MAAM,YAAY,cAAc,cAAc,SAAS;AAEvD,WAAS,KAAK;GACZ,MAAM,WAAW;GACjB,SAAS,cAAc,KAAK,UAAU,MAAM,QAAQ,CAAC,KAAK,GAAG;GAC7D,WAAW,WAAW;GACtB,SAAS,UAAU;GACpB,CAAC;AACF,kBAAgB,EAAE;;AAGpB,MAAK,MAAM,SAAS,YAAY;AAM9B,MAHE,MAAM,SAAS,aACd,MAAM,SAAS,aAAa,SAAS,WAAW,EAEjC,eAAc;AAChC,gBAAc,KAAK,MAAM;AACzB,MAAI,MAAM,SAAS,aAAa,SAAS,WAAW,EAAG,eAAc;;AAGvE,eAAc;AAEd,QAAO"}
File without changes
@@ -0,0 +1,51 @@
1
+ import { parallelize } from "./utils/parallelize.mjs";
2
+ import { getAppLogger, x } from "@intlayer/config/logger";
3
+ import { getConfiguration } from "@intlayer/config/node";
4
+ import { createIntlayerCMS } from "@intlayer/api";
5
+ import { dictionaryEndpoint } from "@intlayer/api/dictionary";
6
+
7
+ //#region src/fetchDistantDictionaries.ts
8
+ /**
9
+ * Fetch distant dictionaries and update the logger with their statuses.
10
+ */
11
+ const fetchDistantDictionaries = async (options, onStatusUpdate) => {
12
+ const config = getConfiguration();
13
+ const appLogger = getAppLogger(config);
14
+ try {
15
+ const dictionary = dictionaryEndpoint(createIntlayerCMS(config));
16
+ const distantDictionariesKeys = options.dictionaryKeys;
17
+ const processDictionary = async (dictionaryKey) => {
18
+ onStatusUpdate?.([{
19
+ dictionaryKey,
20
+ type: "remote",
21
+ status: "fetching"
22
+ }]);
23
+ try {
24
+ const distantDictionary = (await dictionary.getDictionary(dictionaryKey)).data;
25
+ if (!distantDictionary) throw new Error(`Dictionary ${dictionaryKey} not found on remote`);
26
+ onStatusUpdate?.([{
27
+ dictionaryKey,
28
+ type: "remote",
29
+ status: "fetched"
30
+ }]);
31
+ return distantDictionary;
32
+ } catch (error) {
33
+ onStatusUpdate?.([{
34
+ dictionaryKey,
35
+ type: "remote",
36
+ status: "error",
37
+ error: `Error fetching dictionary ${dictionaryKey}: ${error}`
38
+ }]);
39
+ return;
40
+ }
41
+ };
42
+ return (await parallelize(distantDictionariesKeys, async (dictionaryKey) => await processDictionary(dictionaryKey))).filter((dict) => dict !== void 0);
43
+ } catch (_error) {
44
+ appLogger(`${x} Failed to fetch distant dictionaries`, { level: "error" });
45
+ return [];
46
+ }
47
+ };
48
+
49
+ //#endregion
50
+ export { fetchDistantDictionaries };
51
+ //# sourceMappingURL=fetchDistantDictionaries.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchDistantDictionaries.mjs","names":[],"sources":["../../src/fetchDistantDictionaries.ts"],"sourcesContent":["import { createIntlayerCMS } from '@intlayer/api';\nimport { dictionaryEndpoint } from '@intlayer/api/dictionary';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getAppLogger, x } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { DictionariesStatus } from './loadDictionaries';\nimport { parallelize } from './utils/parallelize';\n\ntype FetchDistantDictionariesOptions = {\n dictionaryKeys: string[];\n newDictionariesPath?: string;\n logPrefix?: string;\n};\n\n/**\n * Fetch distant dictionaries and update the logger with their statuses.\n */\nexport const fetchDistantDictionaries = async (\n options: FetchDistantDictionariesOptions,\n onStatusUpdate?: (status: DictionariesStatus[]) => void\n): Promise<DictionaryAPI[]> => {\n const config = getConfiguration();\n const appLogger = getAppLogger(config);\n try {\n const dictionary = dictionaryEndpoint(createIntlayerCMS(config));\n\n const distantDictionariesKeys = options.dictionaryKeys;\n // Process dictionaries in parallel with a concurrency limit\n const processDictionary = async (\n dictionaryKey: string\n ): Promise<DictionaryAPI | undefined> => {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'fetching',\n },\n ]);\n\n try {\n // Fetch the dictionary\n const getDictionaryResult =\n await dictionary.getDictionary(dictionaryKey);\n\n const distantDictionary = getDictionaryResult.data;\n\n if (!distantDictionary) {\n throw new Error(`Dictionary ${dictionaryKey} not found on remote`);\n }\n\n onStatusUpdate?.([\n { dictionaryKey, type: 'remote', status: 'fetched' },\n ]);\n\n return distantDictionary;\n } catch (error) {\n onStatusUpdate?.([\n {\n dictionaryKey,\n type: 'remote',\n status: 'error',\n error: `Error fetching dictionary ${dictionaryKey}: ${error}`,\n },\n ]);\n return undefined;\n }\n };\n\n const result = await parallelize(\n distantDictionariesKeys,\n async (dictionaryKey) => await processDictionary(dictionaryKey)\n );\n\n // Remove undefined values\n const filteredResult = result.filter(\n (dict: DictionaryAPI | undefined): dict is DictionaryAPI =>\n dict !== undefined\n );\n\n return filteredResult;\n } catch (_error) {\n appLogger(`${x} Failed to fetch distant dictionaries`, { level: 'error' });\n return [];\n }\n};\n"],"mappings":";;;;;;;;;;AAkBA,MAAa,2BAA2B,OACtC,SACA,mBAC6B;CAC7B,MAAM,SAAS,kBAAkB;CACjC,MAAM,YAAY,aAAa,OAAO;AACtC,KAAI;EACF,MAAM,aAAa,mBAAmB,kBAAkB,OAAO,CAAC;EAEhE,MAAM,0BAA0B,QAAQ;EAExC,MAAM,oBAAoB,OACxB,kBACuC;AACvC,oBAAiB,CACf;IACE;IACA,MAAM;IACN,QAAQ;IACT,CACF,CAAC;AAEF,OAAI;IAKF,MAAM,qBAAoB,MAFlB,WAAW,cAAc,cAAc,EAED;AAE9C,QAAI,CAAC,kBACH,OAAM,IAAI,MAAM,cAAc,cAAc,sBAAsB;AAGpE,qBAAiB,CACf;KAAE;KAAe,MAAM;KAAU,QAAQ;KAAW,CACrD,CAAC;AAEF,WAAO;YACA,OAAO;AACd,qBAAiB,CACf;KACE;KACA,MAAM;KACN,QAAQ;KACR,OAAO,6BAA6B,cAAc,IAAI;KACvD,CACF,CAAC;AACF;;;AAeJ,UALuB,MANF,YACnB,yBACA,OAAO,kBAAkB,MAAM,kBAAkB,cAAc,CAChE,EAG6B,QAC3B,SACC,SAAS,OAGQ;UACd,QAAQ;AACf,YAAU,GAAG,EAAE,wCAAwC,EAAE,OAAO,SAAS,CAAC;AAC1E,SAAO,EAAE"}
@@ -0,0 +1,53 @@
1
+ import { formatLocale, formatPath } from "./utils/formatter.mjs";
2
+ import { colorize, colorizeKey, colorizePath, getAppLogger, x } from "@intlayer/config/logger";
3
+ import * as ANSIColors from "@intlayer/config/colors";
4
+ import { getBasePlugins, getContent } from "@intlayer/core/interpreter";
5
+
6
+ //#region src/filterInvalidDictionaries.ts
7
+ const isInvalidDictionary = (dictionary, configuration, options) => {
8
+ const appLogger = getAppLogger(configuration);
9
+ if (!dictionary) return false;
10
+ const location = Boolean(dictionary.location === "local" || typeof dictionary.filePath === "string") ? "Local" : "Remote";
11
+ const hasKey = Boolean(dictionary.key);
12
+ const hasContent = Boolean(dictionary.content);
13
+ if (!hasKey) {
14
+ appLogger(`${location} dictionary has no key`, { level: "error" });
15
+ return false;
16
+ }
17
+ if (!/^[\p{L}\p{N}]+([._-][\p{L}\p{N}]+)*$/u.test(dictionary.key)) {
18
+ appLogger(`Insecure key ${colorizeKey(dictionary.key)} at ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath("Remote")} - dictionary filtered out`, { level: "error" });
19
+ return false;
20
+ }
21
+ if (!hasContent) {
22
+ appLogger(`${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath("Remote")}`, { level: "error" });
23
+ return false;
24
+ }
25
+ if (dictionary.schema && options?.checkSchema) {
26
+ if (!(typeof dictionary.content === "function" || typeof dictionary.content === "object" && dictionary.content !== null && typeof dictionary.content.then === "function")) {
27
+ const locales = configuration?.internationalization?.locales ?? [];
28
+ const isStrict = configuration?.internationalization.strictMode === "strict";
29
+ const schema = typeof dictionary.schema === "string" ? configuration?.schemas?.[dictionary.schema] : void 0;
30
+ if (schema && typeof schema.safeParse === "function") for (const locale of locales) {
31
+ const resolvedContent = getContent(dictionary.content, {
32
+ dictionaryKey: dictionary.key,
33
+ keyPath: [],
34
+ locale
35
+ }, getBasePlugins(locale, !isStrict));
36
+ const result = schema.safeParse(resolvedContent);
37
+ if (!result.success) {
38
+ appLogger(`${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath("Remote")}`, { level: "error" });
39
+ result.error.issues.forEach((issue) => {
40
+ appLogger(`${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join(".")}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`, { level: "error" });
41
+ });
42
+ return false;
43
+ }
44
+ }
45
+ }
46
+ }
47
+ return true;
48
+ };
49
+ const filterInvalidDictionaries = (dictionaries, configuration, options) => (dictionaries ?? [])?.filter((dictionary) => isInvalidDictionary(dictionary, configuration, options));
50
+
51
+ //#endregion
52
+ export { filterInvalidDictionaries, isInvalidDictionary };
53
+ //# sourceMappingURL=filterInvalidDictionaries.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filterInvalidDictionaries.mjs","names":[],"sources":["../../src/filterInvalidDictionaries.ts"],"sourcesContent":["import * as ANSIColors from '@intlayer/config/colors';\nimport {\n colorize,\n colorizeKey,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getBasePlugins, getContent } from '@intlayer/core/interpreter';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { formatLocale, formatPath } from './utils/formatter';\n\ntype IsInvalidDictionaryOptions = { checkSchema: boolean };\n\nexport const isInvalidDictionary = (\n dictionary: Dictionary | undefined,\n configuration?: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): boolean => {\n const appLogger = getAppLogger(configuration);\n\n if (!dictionary) return false;\n\n const isLocal = Boolean(\n dictionary.location === 'local' || typeof dictionary.filePath === 'string'\n );\n const location = isLocal ? 'Local' : 'Remote';\n const hasKey = Boolean(dictionary.key);\n const hasContent = Boolean(dictionary.content);\n\n if (!hasKey) {\n appLogger(`${location} dictionary has no key`, {\n level: 'error',\n });\n\n return false;\n }\n\n // Reject keys that contain path-unsafe characters.\n // A key is used as a filename component ({key}.json), so slashes, backslashes,\n // null bytes, or pure dot-segments can escape the output directory or break\n // dictionary resolution.\n // Allows alphanumeric characters, dashes, and underscores.\n // Allows dots, but not as the first or last character, and no consecutive dots.\n // Allows chinese or russian characters e.g. 你好\n const isInsecureKey = !/^[\\p{L}\\p{N}]+([._-][\\p{L}\\p{N}]+)*$/u.test(\n dictionary.key\n );\n\n if (isInsecureKey) {\n appLogger(\n `Insecure key ${colorizeKey(dictionary.key)} at ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')} - dictionary filtered out`,\n { level: 'error' }\n );\n return false;\n }\n\n if (!hasContent) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has no content - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n return false;\n }\n\n if (dictionary.schema && options?.checkSchema) {\n const isAsync =\n typeof dictionary.content === 'function' ||\n (typeof dictionary.content === 'object' &&\n dictionary.content !== null &&\n typeof (dictionary.content as any).then === 'function');\n\n if (!isAsync) {\n const locales = configuration?.internationalization?.locales ?? [];\n const isStrict =\n configuration?.internationalization.strictMode === 'strict';\n\n const schema =\n typeof dictionary.schema === 'string'\n ? configuration?.schemas?.[dictionary.schema]\n : undefined;\n\n if (schema && typeof schema.safeParse === 'function') {\n for (const locale of locales) {\n const resolvedContent = getContent(\n dictionary.content,\n {\n dictionaryKey: dictionary.key,\n keyPath: [],\n locale,\n },\n getBasePlugins(locale, !isStrict)\n );\n const result = (schema as any).safeParse(resolvedContent);\n\n if (!result.success) {\n appLogger(\n `${location} dictionary ${colorizeKey(dictionary.key)} has invalid content according to schema ${colorize(dictionary.schema as string, ANSIColors.ORANGE)} for locale ${formatLocale(locale)} - ${dictionary.filePath ? formatPath(dictionary.filePath) : colorizePath('Remote')}`,\n {\n level: 'error',\n }\n );\n\n result.error.issues.forEach((issue: any) => {\n appLogger(\n `${x} Error: ${colorizeKey(dictionary.key)} - ${formatLocale(locale)} - ${colorize(`${issue.path.join('.')}:`, ANSIColors.BLUE)} ${colorize(issue.message, ANSIColors.GREY)}`,\n {\n level: 'error',\n }\n );\n });\n\n return false;\n }\n }\n }\n }\n }\n\n return true;\n};\n\nexport const filterInvalidDictionaries = (\n dictionaries: (Dictionary | undefined)[] | undefined,\n configuration: IntlayerConfig,\n options?: IsInvalidDictionaryOptions\n): Dictionary[] =>\n (dictionaries ?? [])?.filter((dictionary) =>\n isInvalidDictionary(dictionary, configuration, options)\n ) as Dictionary[];\n"],"mappings":";;;;;;AAeA,MAAa,uBACX,YACA,eACA,YACY;CACZ,MAAM,YAAY,aAAa,cAAc;AAE7C,KAAI,CAAC,WAAY,QAAO;CAKxB,MAAM,WAHU,QACd,WAAW,aAAa,WAAW,OAAO,WAAW,aAAa,SAE5C,GAAG,UAAU;CACrC,MAAM,SAAS,QAAQ,WAAW,IAAI;CACtC,MAAM,aAAa,QAAQ,WAAW,QAAQ;AAE9C,KAAI,CAAC,QAAQ;AACX,YAAU,GAAG,SAAS,yBAAyB,EAC7C,OAAO,SACR,CAAC;AAEF,SAAO;;AAcT,KAAI,CAJmB,wCAAwC,KAC7D,WAAW,IACZ,EAEkB;AACjB,YACE,gBAAgB,YAAY,WAAW,IAAI,CAAC,MAAM,WAAW,WAAW,WAAW,WAAW,SAAS,GAAG,aAAa,SAAS,CAAC,6BACjI,EAAE,OAAO,SAAS,CACnB;AACD,SAAO;;AAGT,KAAI,CAAC,YAAY;AACf,YACE,GAAG,SAAS,cAAc,YAAY,WAAW,IAAI,CAAC,oBAAoB,WAAW,WAAW,WAAW,WAAW,SAAS,GAAG,aAAa,SAAS,IACxJ,EACE,OAAO,SACR,CACF;AACD,SAAO;;AAGT,KAAI,WAAW,UAAU,SAAS,aAOhC;MAAI,EALF,OAAO,WAAW,YAAY,cAC7B,OAAO,WAAW,YAAY,YAC7B,WAAW,YAAY,QACvB,OAAQ,WAAW,QAAgB,SAAS,aAElC;GACZ,MAAM,UAAU,eAAe,sBAAsB,WAAW,EAAE;GAClE,MAAM,WACJ,eAAe,qBAAqB,eAAe;GAErD,MAAM,SACJ,OAAO,WAAW,WAAW,WACzB,eAAe,UAAU,WAAW,UACpC;AAEN,OAAI,UAAU,OAAO,OAAO,cAAc,WACxC,MAAK,MAAM,UAAU,SAAS;IAC5B,MAAM,kBAAkB,WACtB,WAAW,SACX;KACE,eAAe,WAAW;KAC1B,SAAS,EAAE;KACX;KACD,EACD,eAAe,QAAQ,CAAC,SAAS,CAClC;IACD,MAAM,SAAU,OAAe,UAAU,gBAAgB;AAEzD,QAAI,CAAC,OAAO,SAAS;AACnB,eACE,GAAG,SAAS,cAAc,YAAY,WAAW,IAAI,CAAC,2CAA2C,SAAS,WAAW,QAAkB,WAAW,OAAO,CAAC,cAAc,aAAa,OAAO,CAAC,KAAK,WAAW,WAAW,WAAW,WAAW,SAAS,GAAG,aAAa,SAAS,IAChR,EACE,OAAO,SACR,CACF;AAED,YAAO,MAAM,OAAO,SAAS,UAAe;AAC1C,gBACE,GAAG,EAAE,UAAU,YAAY,WAAW,IAAI,CAAC,KAAK,aAAa,OAAO,CAAC,KAAK,SAAS,GAAG,MAAM,KAAK,KAAK,IAAI,CAAC,IAAI,WAAW,KAAK,CAAC,GAAG,SAAS,MAAM,SAAS,WAAW,KAAK,IAC3K,EACE,OAAO,SACR,CACF;OACD;AAEF,YAAO;;;;;AAOjB,QAAO;;AAGT,MAAa,6BACX,cACA,eACA,aAEC,gBAAgB,EAAE,GAAG,QAAQ,eAC5B,oBAAoB,YAAY,eAAe,QAAQ,CACxD"}
@@ -0,0 +1,55 @@
1
+ import { i18nextToIntlayerFormatter, icuToIntlayerFormatter, intlayerToI18nextFormatter, intlayerToICUFormatter, intlayerToPortableObjectFormatter, intlayerToVueI18nFormatter, portableObjectToIntlayerFormatter, vueI18nToIntlayerFormatter } from "@intlayer/core/messageFormat";
2
+
3
+ //#region src/formatDictionary.ts
4
+ const formatDictionary = (dictionary) => {
5
+ if (dictionary.format === "icu") return {
6
+ ...dictionary,
7
+ format: "intlayer",
8
+ content: icuToIntlayerFormatter(dictionary.content)
9
+ };
10
+ if (dictionary.format === "i18next") return {
11
+ ...dictionary,
12
+ format: "intlayer",
13
+ content: i18nextToIntlayerFormatter(dictionary.content)
14
+ };
15
+ if (dictionary.format === "vue-i18n") return {
16
+ ...dictionary,
17
+ format: "intlayer",
18
+ content: vueI18nToIntlayerFormatter(dictionary.content)
19
+ };
20
+ if (dictionary.format === "po") return {
21
+ ...dictionary,
22
+ format: "intlayer",
23
+ content: portableObjectToIntlayerFormatter(dictionary.content)
24
+ };
25
+ return dictionary;
26
+ };
27
+ const formatDictionaries = async (dictionaries) => Promise.all(dictionaries.map(formatDictionary));
28
+ const formatDictionaryOutput = (dictionary, format) => {
29
+ if (format === "icu") return {
30
+ ...dictionary,
31
+ format: "icu",
32
+ content: intlayerToICUFormatter(dictionary.content)
33
+ };
34
+ if (format === "i18next") return {
35
+ ...dictionary,
36
+ format: "i18next",
37
+ content: intlayerToI18nextFormatter(dictionary.content)
38
+ };
39
+ if (format === "vue-i18n") return {
40
+ ...dictionary,
41
+ format: "vue-i18n",
42
+ content: intlayerToVueI18nFormatter(dictionary.content)
43
+ };
44
+ if (dictionary.format === "po") return {
45
+ ...dictionary,
46
+ format: "po",
47
+ content: intlayerToPortableObjectFormatter(dictionary.content)
48
+ };
49
+ return dictionary;
50
+ };
51
+ const formatDictionariesOutput = (dictionaries, format) => dictionaries.map((dictionary) => formatDictionaryOutput(dictionary, format));
52
+
53
+ //#endregion
54
+ export { formatDictionaries, formatDictionariesOutput, formatDictionary, formatDictionaryOutput };
55
+ //# sourceMappingURL=formatDictionary.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatDictionary.mjs","names":[],"sources":["../../src/formatDictionary.ts"],"sourcesContent":["import {\n i18nextToIntlayerFormatter,\n icuToIntlayerFormatter,\n intlayerToI18nextFormatter,\n intlayerToICUFormatter,\n intlayerToPortableObjectFormatter,\n intlayerToVueI18nFormatter,\n portableObjectToIntlayerFormatter,\n vueI18nToIntlayerFormatter,\n} from '@intlayer/core/messageFormat';\nimport type { Dictionary } from '@intlayer/types/dictionary';\n\nexport const formatDictionary = (dictionary: Dictionary): Dictionary => {\n if (dictionary.format === 'icu') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: icuToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'i18next') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: i18nextToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: vueI18nToIntlayerFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'po') {\n return {\n ...dictionary,\n format: 'intlayer',\n content: portableObjectToIntlayerFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionaries = async (\n dictionaries: Dictionary[]\n): Promise<Dictionary[]> => Promise.all(dictionaries.map(formatDictionary));\n\nexport const formatDictionaryOutput = (\n dictionary: Dictionary,\n format: Dictionary['format']\n) => {\n if (format === 'icu') {\n return {\n ...dictionary,\n format: 'icu',\n content: intlayerToICUFormatter(dictionary.content),\n };\n }\n\n if (format === 'i18next') {\n return {\n ...dictionary,\n format: 'i18next',\n content: intlayerToI18nextFormatter(dictionary.content),\n };\n }\n\n if (format === 'vue-i18n') {\n return {\n ...dictionary,\n format: 'vue-i18n',\n content: intlayerToVueI18nFormatter(dictionary.content),\n };\n }\n\n if (dictionary.format === 'po') {\n return {\n ...dictionary,\n format: 'po',\n content: intlayerToPortableObjectFormatter(dictionary.content),\n };\n }\n\n return dictionary;\n};\n\nexport const formatDictionariesOutput = (\n dictionaries: Dictionary[],\n format: Dictionary['format']\n) =>\n dictionaries.map((dictionary) => formatDictionaryOutput(dictionary, format));\n"],"mappings":";;;AAYA,MAAa,oBAAoB,eAAuC;AACtE,KAAI,WAAW,WAAW,MACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,uBAAuB,WAAW,QAAQ;EACpD;AAGH,KAAI,WAAW,WAAW,UACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,2BAA2B,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WAAW,WACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,2BAA2B,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WAAW,KACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,kCAAkC,WAAW,QAAQ;EAC/D;AAGH,QAAO;;AAGT,MAAa,qBAAqB,OAChC,iBAC0B,QAAQ,IAAI,aAAa,IAAI,iBAAiB,CAAC;AAE3E,MAAa,0BACX,YACA,WACG;AACH,KAAI,WAAW,MACb,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,uBAAuB,WAAW,QAAQ;EACpD;AAGH,KAAI,WAAW,UACb,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,2BAA2B,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WACb,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,2BAA2B,WAAW,QAAQ;EACxD;AAGH,KAAI,WAAW,WAAW,KACxB,QAAO;EACL,GAAG;EACH,QAAQ;EACR,SAAS,kCAAkC,WAAW,QAAQ;EAC/D;AAGH,QAAO;;AAGT,MAAa,4BACX,cACA,WAEA,aAAa,KAAK,eAAe,uBAAuB,YAAY,OAAO,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { kebabCaseToCamelCase } from "@intlayer/config/utils";
2
+
3
+ //#region src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts
4
+ const getContentDeclarationFileTemplate = async (key, format, fileParams = {}, noMetadata) => {
5
+ const camelCaseKey = kebabCaseToCamelCase(key);
6
+ const name = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);
7
+ const fileParamsString = Object.entries(fileParams).filter(([, value]) => value !== void 0).map(([paramKey, value]) => {
8
+ return `\n ${/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(paramKey) ? paramKey : JSON.stringify(paramKey)}: ${typeof value === "object" || typeof value === "string" ? JSON.stringify(value) : value},`;
9
+ }).join("");
10
+ let content;
11
+ if (noMetadata) content = "{}";
12
+ else if (format === "json" || format === "jsonc" || format === "json5") content = [
13
+ "{",
14
+ " \"$schema\": \"https://intlayer.org/schema.json\",",
15
+ ` "key": "${key}",${fileParamsString}`,
16
+ " \"content\": {",
17
+ " }",
18
+ "}"
19
+ ].join("\n");
20
+ else content = [
21
+ "{",
22
+ ` key: '${key}',${fileParamsString}`,
23
+ " content: {",
24
+ " },",
25
+ "}"
26
+ ].join("\n");
27
+ const jsdoc = `/** @type {import('intlayer').Dictionary${noMetadata ? "['content']" : ""}} **/`;
28
+ const satisfiesType = noMetadata ? "Dictionary['content']" : "Dictionary";
29
+ switch (format) {
30
+ case "yaml": return `${[
31
+ `key: ${key}`,
32
+ ...fileParams.locale ? [`locale: ${fileParams.locale}`] : [],
33
+ ...fileParams.title ? [`title: ${JSON.stringify(fileParams.title)}`] : [],
34
+ ...fileParams.description ? [`description: ${JSON.stringify(fileParams.description)}`] : [],
35
+ ...fileParams.tags?.length ? ["tags:", ...fileParams.tags.map((tag) => ` - ${JSON.stringify(tag)}`)] : [],
36
+ "content: {}"
37
+ ].join("\n")}\n`;
38
+ case "md": return [
39
+ "---",
40
+ ...[
41
+ `key: ${key}`,
42
+ ...fileParams.locale ? [`locale: ${fileParams.locale}`] : [],
43
+ ...fileParams.title ? [`title: ${JSON.stringify(fileParams.title)}`] : [],
44
+ ...fileParams.description ? [`description: ${JSON.stringify(fileParams.description)}`] : [],
45
+ ...fileParams.tags?.length ? ["tags:", ...fileParams.tags.map((t) => ` - ${JSON.stringify(t)}`)] : []
46
+ ],
47
+ "---",
48
+ "",
49
+ ""
50
+ ].join("\n");
51
+ case "ts": return [
52
+ "import { type Dictionary } from 'intlayer';",
53
+ "",
54
+ `const ${name}Content = ${content} satisfies ${satisfiesType};`,
55
+ "",
56
+ `export default ${name}Content;`,
57
+ ""
58
+ ].join("\n");
59
+ case "cjs": return [
60
+ jsdoc,
61
+ `const ${name}Content = ${content};`,
62
+ "",
63
+ `module.exports = ${name}Content;`,
64
+ ""
65
+ ].join("\n");
66
+ case "json":
67
+ case "jsonc":
68
+ case "json5": return [content, ""].join("\n");
69
+ default: return [
70
+ jsdoc,
71
+ `const ${name}Content = ${content};`,
72
+ "",
73
+ `export default ${name}Content;`,
74
+ ""
75
+ ].join("\n");
76
+ }
77
+ };
78
+
79
+ //#endregion
80
+ export { getContentDeclarationFileTemplate };
81
+ //# sourceMappingURL=getContentDeclarationFileTemplate.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getContentDeclarationFileTemplate.mjs","names":[],"sources":["../../../src/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.ts"],"sourcesContent":["import { 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 noMetadata?: boolean\n) => {\n const camelCaseKey = kebabCaseToCamelCase(key);\n const name = camelCaseKey.charAt(0).toLowerCase() + camelCaseKey.slice(1);\n\n const fileParamsString = Object.entries(fileParams)\n .filter(([, value]) => value !== undefined)\n .map(([paramKey, value]) => {\n const formattedKey = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(paramKey)\n ? paramKey\n : JSON.stringify(paramKey);\n\n const formattedValue =\n typeof value === 'object' || typeof value === 'string'\n ? JSON.stringify(value)\n : value;\n\n return `\\n ${formattedKey}: ${formattedValue},`;\n })\n .join('');\n\n let content: string;\n\n if (noMetadata) {\n content = '{}';\n } else if (format === 'json' || format === 'jsonc' || format === 'json5') {\n content = [\n '{',\n ' \"$schema\": \"https://intlayer.org/schema.json\",',\n ` \"key\": \"${key}\",${fileParamsString}`,\n ' \"content\": {',\n ' }',\n '}',\n ].join('\\n');\n } else {\n content = [\n '{',\n ` key: '${key}',${fileParamsString}`,\n ' content: {',\n ' },',\n '}',\n ].join('\\n');\n }\n\n const jsdoc = `/** @type {import('intlayer').Dictionary${noMetadata ? \"['content']\" : ''}} **/`;\n const satisfiesType = noMetadata ? \"Dictionary['content']\" : 'Dictionary';\n\n switch (format) {\n case 'yaml': {\n const yamlLines = [\n `key: ${key}`,\n ...(fileParams.locale ? [`locale: ${fileParams.locale}`] : []),\n ...(fileParams.title\n ? [`title: ${JSON.stringify(fileParams.title)}`]\n : []),\n ...(fileParams.description\n ? [`description: ${JSON.stringify(fileParams.description)}`]\n : []),\n ...(fileParams.tags?.length\n ? [\n 'tags:',\n ...(fileParams.tags as string[]).map(\n (tag) => ` - ${JSON.stringify(tag)}`\n ),\n ]\n : []),\n 'content: {}',\n ];\n return `${yamlLines.join('\\n')}\\n`;\n }\n\n case 'md': {\n const mdFrontmatterLines = [\n `key: ${key}`,\n ...(fileParams.locale ? [`locale: ${fileParams.locale}`] : []),\n ...(fileParams.title\n ? [`title: ${JSON.stringify(fileParams.title)}`]\n : []),\n ...(fileParams.description\n ? [`description: ${JSON.stringify(fileParams.description)}`]\n : []),\n ...(fileParams.tags?.length\n ? [\n 'tags:',\n ...(fileParams.tags as string[]).map(\n (t) => ` - ${JSON.stringify(t)}`\n ),\n ]\n : []),\n ];\n return ['---', ...mdFrontmatterLines, '---', '', ''].join('\\n');\n }\n\n case 'ts':\n return [\n \"import { type Dictionary } from 'intlayer';\",\n '',\n `const ${name}Content = ${content} satisfies ${satisfiesType};`,\n '',\n `export default ${name}Content;`,\n '',\n ].join('\\n');\n\n case 'cjs':\n return [\n jsdoc,\n `const ${name}Content = ${content};`,\n '',\n `module.exports = ${name}Content;`,\n '',\n ].join('\\n');\n\n case 'json':\n case 'jsonc':\n case 'json5':\n return [content, ''].join('\\n');\n\n default: // esm\n return [\n jsdoc,\n `const ${name}Content = ${content};`,\n '',\n `export default ${name}Content;`,\n '',\n ].join('\\n');\n }\n};\n"],"mappings":";;;AAGA,MAAa,oCAAoC,OAC/C,KACA,QACA,aAAkC,EAAE,EACpC,eACG;CACH,MAAM,eAAe,qBAAqB,IAAI;CAC9C,MAAM,OAAO,aAAa,OAAO,EAAE,CAAC,aAAa,GAAG,aAAa,MAAM,EAAE;CAEzE,MAAM,mBAAmB,OAAO,QAAQ,WAAW,CAChD,QAAQ,GAAG,WAAW,UAAU,OAAU,CAC1C,KAAK,CAAC,UAAU,WAAW;AAU1B,SAAO,OATc,6BAA6B,KAAK,SAAS,GAC5D,WACA,KAAK,UAAU,SAAS,CAOD,IAJzB,OAAO,UAAU,YAAY,OAAO,UAAU,WAC1C,KAAK,UAAU,MAAM,GACrB,MAEwC;GAC9C,CACD,KAAK,GAAG;CAEX,IAAI;AAEJ,KAAI,WACF,WAAU;UACD,WAAW,UAAU,WAAW,WAAW,WAAW,QAC/D,WAAU;EACR;EACA;EACA,aAAa,IAAI,IAAI;EACrB;EACA;EACA;EACD,CAAC,KAAK,KAAK;KAEZ,WAAU;EACR;EACA,WAAW,IAAI,IAAI;EACnB;EACA;EACA;EACD,CAAC,KAAK,KAAK;CAGd,MAAM,QAAQ,2CAA2C,aAAa,gBAAgB,GAAG;CACzF,MAAM,gBAAgB,aAAa,0BAA0B;AAE7D,SAAQ,QAAR;EACE,KAAK,OAoBH,QAAO,GAAG;GAlBR,QAAQ;GACR,GAAI,WAAW,SAAS,CAAC,WAAW,WAAW,SAAS,GAAG,EAAE;GAC7D,GAAI,WAAW,QACX,CAAC,UAAU,KAAK,UAAU,WAAW,MAAM,GAAG,GAC9C,EAAE;GACN,GAAI,WAAW,cACX,CAAC,gBAAgB,KAAK,UAAU,WAAW,YAAY,GAAG,GAC1D,EAAE;GACN,GAAI,WAAW,MAAM,SACjB,CACE,SACA,GAAI,WAAW,KAAkB,KAC9B,QAAQ,OAAO,KAAK,UAAU,IAAI,GACpC,CACF,GACD,EAAE;GACN;GAEiB,CAAC,KAAK,KAAK,CAAC;EAGjC,KAAK,KAmBH,QAAO;GAAC;GAAO,GAAG;IAjBhB,QAAQ;IACR,GAAI,WAAW,SAAS,CAAC,WAAW,WAAW,SAAS,GAAG,EAAE;IAC7D,GAAI,WAAW,QACX,CAAC,UAAU,KAAK,UAAU,WAAW,MAAM,GAAG,GAC9C,EAAE;IACN,GAAI,WAAW,cACX,CAAC,gBAAgB,KAAK,UAAU,WAAW,YAAY,GAAG,GAC1D,EAAE;IACN,GAAI,WAAW,MAAM,SACjB,CACE,SACA,GAAI,WAAW,KAAkB,KAC9B,MAAM,OAAO,KAAK,UAAU,EAAE,GAChC,CACF,GACD,EAAE;IAE4B;GAAE;GAAO;GAAI;GAAG,CAAC,KAAK,KAAK;EAGjE,KAAK,KACH,QAAO;GACL;GACA;GACA,SAAS,KAAK,YAAY,QAAQ,aAAa,cAAc;GAC7D;GACA,kBAAkB,KAAK;GACvB;GACD,CAAC,KAAK,KAAK;EAEd,KAAK,MACH,QAAO;GACL;GACA,SAAS,KAAK,YAAY,QAAQ;GAClC;GACA,oBAAoB,KAAK;GACzB;GACD,CAAC,KAAK,KAAK;EAEd,KAAK;EACL,KAAK;EACL,KAAK,QACH,QAAO,CAAC,SAAS,GAAG,CAAC,KAAK,KAAK;EAEjC,QACE,QAAO;GACL;GACA,SAAS,KAAK,YAAY,QAAQ;GAClC;GACA,kBAAkB,KAAK;GACvB;GACD,CAAC,KAAK,KAAK"}
@@ -0,0 +1,3 @@
1
+ import { getContentDeclarationFileTemplate } from "./getContentDeclarationFileTemplate.mjs";
2
+
3
+ export { getContentDeclarationFileTemplate };
@@ -0,0 +1,33 @@
1
+ import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
2
+ import { formatPath } from "./utils/formatter.mjs";
3
+ import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.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/logger";
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
+ await 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 };
33
+ //# sourceMappingURL=handleAdditionalContentDeclarationFile.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleAdditionalContentDeclarationFile.mjs","names":[],"sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { loadLocalDictionaries } from './loadDictionaries/loadLocalDictionaries';\nimport { formatPath } from './utils/formatter';\n\nexport const handleAdditionalContentDeclarationFile = async (\n filePath: string,\n config: IntlayerConfig\n) => {\n const appLogger = getAppLogger(config);\n\n // Process the file with the functionToRun\n appLogger(`Additional file detected: ${formatPath(filePath)}`, {\n isVerbose: true,\n });\n\n const localeDictionaries = await loadLocalDictionaries(filePath, config);\n\n const dictionariesOutput = await buildDictionary(localeDictionaries, config);\n\n const 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 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":";;;;;;;;;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,gBAAgB,MAFhB,sBAAsB,UAAU,OAAO,EAEH,OAAO;AAM5E,OAAM,YAJsB,OAAO,OACjC,oBAAoB,sBAAsB,EAAE,CAC7C,CAAC,KAAK,eAAe,WAAW,WAEI,EAAE,OAAO;AAE9C,OAAM,2BAA2B,OAAO;AAExC,WAAU,sBAAsB,EAC9B,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"}
@@ -0,0 +1,54 @@
1
+ import { getBuiltDictionariesPath } from "./createDictionaryEntryPoint/getBuiltDictionariesPath.mjs";
2
+ import { createDictionaryEntryPoint } from "./createDictionaryEntryPoint/createDictionaryEntryPoint.mjs";
3
+ import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
4
+ import { formatPath } from "./utils/formatter.mjs";
5
+ import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
6
+ import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
7
+ import { createTypes } from "./createType/createType.mjs";
8
+ import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
9
+ import { readFile, writeFile } from "node:fs/promises";
10
+ import { join } from "node:path";
11
+ import { getAppLogger } from "@intlayer/config/logger";
12
+ import { existsSync } from "node:fs";
13
+
14
+ //#region src/handleContentDeclarationFileChange.ts
15
+ const handleContentDeclarationFileChange = async (filePath, config) => {
16
+ const appLogger = getAppLogger(config);
17
+ appLogger(`Change detected: ${formatPath(filePath)}`, { isVerbose: true });
18
+ const allDictionariesPaths = await getBuiltDictionariesPath(config);
19
+ const localeDictionaries = await loadLocalDictionaries(filePath, config);
20
+ const dictionariesOutput = await buildDictionary(localeDictionaries, config);
21
+ const updatedDictionaries = Object.values(dictionariesOutput?.mergedDictionaries ?? {});
22
+ const updatedDictionariesPaths = updatedDictionaries.map((dictionary) => dictionary.dictionaryPath);
23
+ const { excludeKeys, hasRebuilt } = await cleanRemovedContentDeclaration(filePath, localeDictionaries.map((dictionary) => dictionary.key), config);
24
+ const hasNewDictionaries = updatedDictionariesPaths.some((updatedDictionaryPath) => !allDictionariesPaths.includes(updatedDictionaryPath));
25
+ await createTypes(updatedDictionaries.map((dictionary) => dictionary.dictionary), config);
26
+ appLogger("TypeScript types built", { isVerbose: true });
27
+ await createModuleAugmentation(config);
28
+ appLogger("Module augmentation built", { isVerbose: true });
29
+ if (hasRebuilt || hasNewDictionaries) {
30
+ if (!hasRebuilt) {
31
+ await createDictionaryEntryPoint(config, { excludeKeys });
32
+ appLogger("Dictionary list built", { isVerbose: true });
33
+ }
34
+ }
35
+ const { mainDir } = config.system;
36
+ for (const extension of config.build.outputFormat) {
37
+ const entryPointPath = join(mainDir, `dictionaries.${extension}`);
38
+ if (existsSync(entryPointPath)) await writeFile(entryPointPath, await readFile(entryPointPath, "utf-8"));
39
+ }
40
+ for await (const plugin of config.plugins ?? []) {
41
+ const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;
42
+ await plugin.afterBuild?.({
43
+ dictionaries: {
44
+ unmergedDictionaries,
45
+ mergedDictionaries
46
+ },
47
+ configuration: config
48
+ });
49
+ }
50
+ };
51
+
52
+ //#endregion
53
+ export { handleContentDeclarationFileChange };
54
+ //# sourceMappingURL=handleContentDeclarationFileChange.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleContentDeclarationFileChange.mjs","names":[],"sources":["../../src/handleContentDeclarationFileChange.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { readFile, writeFile } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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 Types first — types must be ready before anything triggers a bundler rebuild.\n // esbuild (used by Angular, Vite, etc.) only watches files in its JS bundle graph; it does\n // NOT watch .intlayer/types/*.ts (TypeScript-only files). Generating types here, before\n // updating the entry point, guarantees that when the entry point write below fires esbuild's\n // file watcher the types are already up-to-date.\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 // Always regenerate the module augmentation so that structural changes to existing\n // dictionaries (new content keys, type changes) are reflected in intlayer.d.ts.\n await createModuleAugmentation(config);\n appLogger('Module augmentation built', {\n isVerbose: true,\n });\n\n // Rebuild Entry Point\n // Only needed when 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 // Force-write the entry point files so esbuild detects a change and triggers a fresh rebuild\n // now that all types are ready. Without this, the only rebuild esbuild sees is the one\n // triggered by buildDictionary's JSON writes above — which races against type generation\n // and often runs before the new .intlayer/types/*.ts files are on disk.\n const { mainDir } = config.system;\n\n for (const extension of config.build.outputFormat) {\n const entryPointPath = join(mainDir, `dictionaries.${extension}`);\n\n if (existsSync(entryPointPath)) {\n const content = await readFile(entryPointPath, 'utf-8');\n await writeFile(entryPointPath, content);\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":";;;;;;;;;;;;;;AAcA,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;AAWD,OAAM,YAJsB,oBAAoB,KAC7C,eAAe,WAAW,WAGQ,EAAE,OAAO;AAC9C,WAAU,0BAA0B,EAClC,WAAW,MACZ,CAAC;AAIF,OAAM,yBAAyB,OAAO;AACtC,WAAU,6BAA6B,EACrC,WAAW,MACZ,CAAC;AAIF,KAAI,cAAc,oBAIhB;MAAI,CAAC,YAAY;AACf,SAAM,2BAA2B,QAAQ,EAAE,aAAa,CAAC;AACzD,aAAU,yBAAyB,EACjC,WAAW,MACZ,CAAC;;;CAQN,MAAM,EAAE,YAAY,OAAO;AAE3B,MAAK,MAAM,aAAa,OAAO,MAAM,cAAc;EACjD,MAAM,iBAAiB,KAAK,SAAS,gBAAgB,YAAY;AAEjE,MAAI,WAAW,eAAe,CAE5B,OAAM,UAAU,gBAAgB,MADV,SAAS,gBAAgB,QAAQ,CACf;;AAM5C,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"}
@@ -0,0 +1,23 @@
1
+ import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
2
+ import { formatPath } from "./utils/formatter.mjs";
3
+ import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
4
+ import { handleContentDeclarationFileChange } from "./handleContentDeclarationFileChange.mjs";
5
+ import { getAppLogger } from "@intlayer/config/logger";
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 };
23
+ //# sourceMappingURL=handleContentDeclarationFileMoved.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleContentDeclarationFileMoved.mjs","names":[],"sources":["../../src/handleContentDeclarationFileMoved.ts"],"sourcesContent":["import { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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,gBAAa,MAJuB,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"}
@@ -0,0 +1,36 @@
1
+ import { cleanRemovedContentDeclaration } from "./cleanRemovedContentDeclaration.mjs";
2
+ import { formatPath } from "./utils/formatter.mjs";
3
+ import { buildDictionary } from "./buildIntlayerDictionary/buildIntlayerDictionary.mjs";
4
+ import { createModuleAugmentation } from "./createType/createModuleAugmentation.mjs";
5
+ import { createTypes } from "./createType/createType.mjs";
6
+ import { loadLocalDictionaries } from "./loadDictionaries/loadLocalDictionaries.mjs";
7
+ import { listDictionaries } from "./listDictionariesPath.mjs";
8
+ import { normalize } from "node:path";
9
+ import { getAppLogger } from "@intlayer/config/logger";
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 };
36
+ //# sourceMappingURL=handleUnlinkedContentDeclarationFile.mjs.map
@@ -0,0 +1 @@
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/config';\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,uBAJX,MAFQ,iBAAiB,OAAO,EAE1B,QACzB,SAAS,UAAU,KAAK,KAAK,UAAU,SAAS,CAGiB,EAAE,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,WAEI,EAAE,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"}