@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,127 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+
3
+ //#region src/scan/parseHtml.ts
4
+ /**
5
+ * Tiny dependency-free HTML extraction helpers.
6
+ *
7
+ * The hosted backend audit relies on Cheerio + a real browser, but the CLI scan
8
+ * must stay dependency-light. These regex-based helpers cover the handful of
9
+ * head/anchor signals the score needs. They are intentionally forgiving: when a
10
+ * tag can't be parsed it is simply skipped rather than throwing.
11
+ */
12
+ /** Compute the UTF-8 byte length of a string in both Node and browser builds. */
13
+ const byteLength = (text) => typeof Buffer !== "undefined" ? Buffer.byteLength(text, "utf-8") : new TextEncoder().encode(text).length;
14
+ /** Read an attribute value off a single tag's attribute string. */
15
+ const readAttribute = (attributes, attributeName) => {
16
+ const match = attributes.match(new RegExp(`${attributeName}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`, "i"));
17
+ if (!match) return void 0;
18
+ return match[2] ?? match[3] ?? match[4];
19
+ };
20
+ /** Extract the `lang` attribute of the `<html>` element, if present. */
21
+ const extractHtmlLang = (html) => {
22
+ const htmlTag = html.match(/<html\b([^>]*)>/i);
23
+ return htmlTag ? readAttribute(htmlTag[1], "lang") : void 0;
24
+ };
25
+ /** Extract the `dir` attribute of the `<html>` element, if present. */
26
+ const extractHtmlDir = (html) => {
27
+ const htmlTag = html.match(/<html\b([^>]*)>/i);
28
+ return htmlTag ? readAttribute(htmlTag[1], "dir") : void 0;
29
+ };
30
+ /** Extract the document `<title>` text. */
31
+ const extractTitle = (html) => {
32
+ const match = html.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
33
+ return match ? match[1].trim() : "";
34
+ };
35
+ /** Extract the `<meta name="description">` content. */
36
+ const extractMetaDescription = (html) => {
37
+ const metas = html.match(/<meta\b[^>]*>/gi) ?? [];
38
+ for (const meta of metas) if (/name\s*=\s*("|')?description\1?/i.test(meta)) return readAttribute(meta, "content") ?? "";
39
+ return "";
40
+ };
41
+ /** Extract the `<meta property="og:image">` content. */
42
+ const extractOgImage = (html) => {
43
+ const metas = html.match(/<meta\b[^>]*>/gi) ?? [];
44
+ for (const meta of metas) if (/property\s*=\s*("|')?og:image\1?/i.test(meta)) return readAttribute(meta, "content");
45
+ };
46
+ /** Whether a `<link rel="canonical">` element is present. */
47
+ const hasCanonical = (html) => {
48
+ return (html.match(/<link\b[^>]*>/gi) ?? []).some((link) => /rel\s*=\s*("|')?canonical\1?/i.test(link));
49
+ };
50
+ /** Extract every `<link rel="alternate" hreflang="…" href="…">` element. */
51
+ const extractHreflangs = (html) => {
52
+ const links = html.match(/<link\b[^>]*>/gi) ?? [];
53
+ const result = [];
54
+ for (const link of links) {
55
+ if (!/rel\s*=\s*("|')?alternate\1?/i.test(link)) continue;
56
+ const hreflang = readAttribute(link, "hreflang");
57
+ const href = readAttribute(link, "href");
58
+ if (hreflang && href) result.push({
59
+ hreflang,
60
+ href
61
+ });
62
+ }
63
+ return result;
64
+ };
65
+ /**
66
+ * Extract every eagerly-loaded script URL: `<script src>`,
67
+ * `<link rel="modulepreload">` and `<link rel="preload" as="script">`.
68
+ *
69
+ * @param html - The raw HTML document.
70
+ * @param baseUrl - Base URL used to resolve relative script URLs.
71
+ * @returns Absolute, de-duplicated script URLs.
72
+ */
73
+ const extractScriptUrls = (html, baseUrl) => {
74
+ const urls = /* @__PURE__ */ new Set();
75
+ const add = (raw) => {
76
+ if (!raw) return;
77
+ try {
78
+ urls.add(new URL(raw, baseUrl).href);
79
+ } catch {}
80
+ };
81
+ for (const script of html.match(/<script\b[^>]*>/gi) ?? []) add(readAttribute(script, "src"));
82
+ for (const link of html.match(/<link\b[^>]*>/gi) ?? []) {
83
+ const rel = readAttribute(link, "rel")?.toLowerCase();
84
+ const as = readAttribute(link, "as")?.toLowerCase();
85
+ if (rel === "modulepreload" || rel === "preload" && as === "script") add(readAttribute(link, "href"));
86
+ }
87
+ return Array.from(urls);
88
+ };
89
+ /** Extract every `<a href="…">text</a>` anchor from the document. */
90
+ const extractAnchors = (html) => {
91
+ const anchors = [];
92
+ const anchorPattern = /<a\b([^>]*)>([\s\S]*?)<\/a>/gi;
93
+ let match = anchorPattern.exec(html);
94
+ while (match !== null) {
95
+ const href = readAttribute(match[1], "href");
96
+ if (href) {
97
+ const text = match[2].replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim();
98
+ anchors.push({
99
+ href,
100
+ text
101
+ });
102
+ }
103
+ match = anchorPattern.exec(html);
104
+ }
105
+ return anchors;
106
+ };
107
+ /**
108
+ * Extract visible text snippets from an HTML document (scripts, styles and
109
+ * tags stripped). Used to approximate the rendered content size without a DOM.
110
+ */
111
+ const extractVisibleTextStrings = (html) => {
112
+ return html.replace(/<script[\s\S]*?<\/script>/gi, " ").replace(/<style[\s\S]*?<\/style>/gi, " ").replace(/<noscript[\s\S]*?<\/noscript>/gi, " ").replace(/<!--[\s\S]*?-->/g, " ").replace(/<[^>]+>/g, "\n").split("\n").map((line) => line.replace(/\s+/g, " ").trim()).filter((line) => line.length > 1);
113
+ };
114
+
115
+ //#endregion
116
+ exports.byteLength = byteLength;
117
+ exports.extractAnchors = extractAnchors;
118
+ exports.extractHreflangs = extractHreflangs;
119
+ exports.extractHtmlDir = extractHtmlDir;
120
+ exports.extractHtmlLang = extractHtmlLang;
121
+ exports.extractMetaDescription = extractMetaDescription;
122
+ exports.extractOgImage = extractOgImage;
123
+ exports.extractScriptUrls = extractScriptUrls;
124
+ exports.extractTitle = extractTitle;
125
+ exports.extractVisibleTextStrings = extractVisibleTextStrings;
126
+ exports.hasCanonical = hasCanonical;
127
+ //# sourceMappingURL=parseHtml.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseHtml.cjs","names":[],"sources":["../../../src/scan/parseHtml.ts"],"sourcesContent":["/**\n * Tiny dependency-free HTML extraction helpers.\n *\n * The hosted backend audit relies on Cheerio + a real browser, but the CLI scan\n * must stay dependency-light. These regex-based helpers cover the handful of\n * head/anchor signals the score needs. They are intentionally forgiving: when a\n * tag can't be parsed it is simply skipped rather than throwing.\n */\n\n/** Compute the UTF-8 byte length of a string in both Node and browser builds. */\nexport const byteLength = (text: string): number =>\n typeof Buffer !== 'undefined'\n ? Buffer.byteLength(text, 'utf-8')\n : new TextEncoder().encode(text).length;\n\n/** Read an attribute value off a single tag's attribute string. */\nconst readAttribute = (\n attributes: string,\n attributeName: string\n): string | undefined => {\n const match = attributes.match(\n new RegExp(`${attributeName}\\\\s*=\\\\s*(\"([^\"]*)\"|'([^']*)'|([^\\\\s>]+))`, 'i')\n );\n if (!match) return undefined;\n return match[2] ?? match[3] ?? match[4];\n};\n\n/** Extract the `lang` attribute of the `<html>` element, if present. */\nexport const extractHtmlLang = (html: string): string | undefined => {\n const htmlTag = html.match(/<html\\b([^>]*)>/i);\n return htmlTag ? readAttribute(htmlTag[1], 'lang') : undefined;\n};\n\n/** Extract the `dir` attribute of the `<html>` element, if present. */\nexport const extractHtmlDir = (html: string): string | undefined => {\n const htmlTag = html.match(/<html\\b([^>]*)>/i);\n return htmlTag ? readAttribute(htmlTag[1], 'dir') : undefined;\n};\n\n/** Extract the document `<title>` text. */\nexport const extractTitle = (html: string): string => {\n const match = html.match(/<title[^>]*>([\\s\\S]*?)<\\/title>/i);\n return match ? match[1].trim() : '';\n};\n\n/** Extract the `<meta name=\"description\">` content. */\nexport const extractMetaDescription = (html: string): string => {\n const metas = html.match(/<meta\\b[^>]*>/gi) ?? [];\n for (const meta of metas) {\n if (/name\\s*=\\s*(\"|')?description\\1?/i.test(meta)) {\n return readAttribute(meta, 'content') ?? '';\n }\n }\n return '';\n};\n\n/** Extract the `<meta property=\"og:image\">` content. */\nexport const extractOgImage = (html: string): string | undefined => {\n const metas = html.match(/<meta\\b[^>]*>/gi) ?? [];\n for (const meta of metas) {\n if (/property\\s*=\\s*(\"|')?og:image\\1?/i.test(meta)) {\n return readAttribute(meta, 'content');\n }\n }\n return undefined;\n};\n\n/** Whether a `<link rel=\"canonical\">` element is present. */\nexport const hasCanonical = (html: string): boolean => {\n const links = html.match(/<link\\b[^>]*>/gi) ?? [];\n return links.some((link) => /rel\\s*=\\s*(\"|')?canonical\\1?/i.test(link));\n};\n\n/** A parsed `<link rel=\"alternate\" hreflang>` element. */\nexport type HreflangLink = { hreflang: string; href: string };\n\n/** Extract every `<link rel=\"alternate\" hreflang=\"…\" href=\"…\">` element. */\nexport const extractHreflangs = (html: string): HreflangLink[] => {\n const links = html.match(/<link\\b[^>]*>/gi) ?? [];\n const result: HreflangLink[] = [];\n for (const link of links) {\n if (!/rel\\s*=\\s*(\"|')?alternate\\1?/i.test(link)) continue;\n const hreflang = readAttribute(link, 'hreflang');\n const href = readAttribute(link, 'href');\n if (hreflang && href) result.push({ hreflang, href });\n }\n return result;\n};\n\n/**\n * Extract every eagerly-loaded script URL: `<script src>`,\n * `<link rel=\"modulepreload\">` and `<link rel=\"preload\" as=\"script\">`.\n *\n * @param html - The raw HTML document.\n * @param baseUrl - Base URL used to resolve relative script URLs.\n * @returns Absolute, de-duplicated script URLs.\n */\nexport const extractScriptUrls = (html: string, baseUrl: string): string[] => {\n const urls = new Set<string>();\n\n const add = (raw: string | undefined) => {\n if (!raw) return;\n try {\n urls.add(new URL(raw, baseUrl).href);\n } catch {\n /* ignore malformed URLs */\n }\n };\n\n for (const script of html.match(/<script\\b[^>]*>/gi) ?? []) {\n add(readAttribute(script, 'src'));\n }\n\n for (const link of html.match(/<link\\b[^>]*>/gi) ?? []) {\n const rel = readAttribute(link, 'rel')?.toLowerCase();\n const as = readAttribute(link, 'as')?.toLowerCase();\n if (rel === 'modulepreload' || (rel === 'preload' && as === 'script')) {\n add(readAttribute(link, 'href'));\n }\n }\n\n return Array.from(urls);\n};\n\n/** A parsed `<a href>` anchor. */\nexport type Anchor = { href: string; text: string };\n\n/** Extract every `<a href=\"…\">text</a>` anchor from the document. */\nexport const extractAnchors = (html: string): Anchor[] => {\n const anchors: Anchor[] = [];\n const anchorPattern = /<a\\b([^>]*)>([\\s\\S]*?)<\\/a>/gi;\n let match = anchorPattern.exec(html);\n while (match !== null) {\n const href = readAttribute(match[1], 'href');\n if (href) {\n const text = match[2]\n .replace(/<[^>]+>/g, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n anchors.push({ href, text });\n }\n match = anchorPattern.exec(html);\n }\n return anchors;\n};\n\n/**\n * Extract visible text snippets from an HTML document (scripts, styles and\n * tags stripped). Used to approximate the rendered content size without a DOM.\n */\nexport const extractVisibleTextStrings = (html: string): string[] => {\n const withoutNonVisible = html\n .replace(/<script[\\s\\S]*?<\\/script>/gi, ' ')\n .replace(/<style[\\s\\S]*?<\\/style>/gi, ' ')\n .replace(/<noscript[\\s\\S]*?<\\/noscript>/gi, ' ')\n .replace(/<!--[\\s\\S]*?-->/g, ' ');\n\n return withoutNonVisible\n .replace(/<[^>]+>/g, '\\n')\n .split('\\n')\n .map((line) => line.replace(/\\s+/g, ' ').trim())\n .filter((line) => line.length > 1);\n};\n"],"mappings":"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"}
@@ -0,0 +1,205 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ const require_scan_calculateScore = require('./calculateScore.cjs');
4
+ const require_scan_parseHtml = require('./parseHtml.cjs');
5
+ const require_scan_checks = require('./checks.cjs');
6
+ let _intlayer_config_logger = require("@intlayer/config/logger");
7
+ let _intlayer_config_colors = require("@intlayer/config/colors");
8
+
9
+ //#region src/scan/scanWebsite.ts
10
+ const DEFAULT_USER_AGENT = "Mozilla/5.0 (compatible; IntlayerScanBot/1.0; +https://intlayer.org)";
11
+ const DEFAULT_TIMEOUT_MS = 3e4;
12
+ /**
13
+ * Log a recommendation to install `puppeteer` for a deeper scan. Mirrors the
14
+ * style used by other optional-dependency hints across the CLI.
15
+ */
16
+ const logDeepScanRecommendation = () => {
17
+ (0, _intlayer_config_logger.logger)([
18
+ (0, _intlayer_config_logger.colorize)("Recommended: Install", _intlayer_config_colors.GREY),
19
+ (0, _intlayer_config_logger.colorize)("puppeteer", _intlayer_config_colors.GREY_LIGHT),
20
+ (0, _intlayer_config_logger.colorize)("package to enable a deeper scan (renders client-side content & lazy-loaded chunks). See documentation:", _intlayer_config_colors.GREY),
21
+ (0, _intlayer_config_logger.colorize)("https://intlayer.org/doc/concept/cli#scan", _intlayer_config_colors.GREY_LIGHT)
22
+ ]);
23
+ };
24
+ /**
25
+ * Render the page with a locally installed `puppeteer` to capture
26
+ * client-rendered content, the accurate transfer size, and lazy-loaded chunks.
27
+ *
28
+ * `puppeteer` is imported dynamically through a non-literal specifier so it is
29
+ * never bundled and stays an optional dependency: when it is absent the import
30
+ * rejects and the caller falls back to the basic scan.
31
+ *
32
+ * @returns The deep-scan result, or `null` when `puppeteer` is unavailable.
33
+ */
34
+ const runDeepScan = async (targetUrl, userAgent, timeoutMs) => {
35
+ const moduleName = "puppeteer";
36
+ let puppeteer;
37
+ try {
38
+ const mod = await import(moduleName);
39
+ puppeteer = mod.default ?? mod;
40
+ } catch {
41
+ return null;
42
+ }
43
+ let browser;
44
+ try {
45
+ browser = await puppeteer.launch({
46
+ headless: true,
47
+ executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,
48
+ args: [
49
+ "--no-sandbox",
50
+ "--disable-setuid-sandbox",
51
+ "--disable-dev-shm-usage",
52
+ "--disable-gpu"
53
+ ]
54
+ });
55
+ const page = await browser.newPage();
56
+ await page.setUserAgent(userAgent);
57
+ await page.setExtraHTTPHeaders({ "Accept-Language": "en-US,en;q=0.9" });
58
+ const origin = new URL(targetUrl).origin;
59
+ const jsResponseMap = /* @__PURE__ */ new Map();
60
+ let totalPageSize = 0;
61
+ const pendingResponses = [];
62
+ page.on("response", (response) => {
63
+ pendingResponses.push((async () => {
64
+ try {
65
+ if (response.status() !== 200) return;
66
+ const buffer = await response.buffer();
67
+ totalPageSize += buffer.length;
68
+ const responseUrl = response.url();
69
+ if (((response.headers()["content-type"] ?? "").includes("javascript") || /\.(js|mjs|cjs)(\?|$)/.test(responseUrl)) && responseUrl.startsWith(origin)) jsResponseMap.set(responseUrl, buffer.toString("utf-8"));
70
+ } catch {}
71
+ })());
72
+ });
73
+ await page.goto(targetUrl, {
74
+ waitUntil: "domcontentloaded",
75
+ timeout: timeoutMs
76
+ });
77
+ await page.waitForNetworkIdle({
78
+ idleTime: 1e3,
79
+ timeout: 1e4
80
+ }).catch(() => {});
81
+ await Promise.allSettled(pendingResponses);
82
+ const html = await page.content();
83
+ const mainBundleUrls = new Set(require_scan_parseHtml.extractScriptUrls(html, targetUrl));
84
+ const chunks = Array.from(jsResponseMap.entries()).map(([url, content]) => ({
85
+ url,
86
+ isMainBundle: mainBundleUrls.has(url),
87
+ content
88
+ }));
89
+ return {
90
+ html,
91
+ totalPageSize,
92
+ chunks
93
+ };
94
+ } finally {
95
+ if (browser) await browser.close();
96
+ }
97
+ };
98
+ /** Fetch the raw HTML document, measuring its byte size. */
99
+ const fetchHtml = async (url, userAgent, timeoutMs) => {
100
+ const controller = new AbortController();
101
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
102
+ try {
103
+ const response = await fetch(url, {
104
+ headers: {
105
+ "User-Agent": userAgent,
106
+ "Accept-Language": "en-US,en;q=0.9"
107
+ },
108
+ signal: controller.signal
109
+ });
110
+ return {
111
+ html: await response.text(),
112
+ finalUrl: response.url || url
113
+ };
114
+ } finally {
115
+ clearTimeout(timer);
116
+ }
117
+ };
118
+ /**
119
+ * Fetch every eagerly-loaded script. Same-origin scripts keep their content so
120
+ * their locale weight can be analyzed; third-party scripts only contribute to
121
+ * the measured page size (their locale-like keys cause false positives).
122
+ */
123
+ const fetchScripts = async (scriptUrls, origin, userAgent) => {
124
+ const chunks = [];
125
+ let scriptBytes = 0;
126
+ await Promise.all(scriptUrls.map(async (scriptUrl) => {
127
+ try {
128
+ const response = await fetch(scriptUrl, { headers: { "User-Agent": userAgent } });
129
+ if (!response.ok) return;
130
+ const content = await response.text();
131
+ scriptBytes += require_scan_parseHtml.byteLength(content);
132
+ if (scriptUrl.startsWith(origin)) chunks.push({
133
+ url: scriptUrl,
134
+ isMainBundle: true,
135
+ content
136
+ });
137
+ } catch {}
138
+ }));
139
+ return {
140
+ chunks,
141
+ scriptBytes
142
+ };
143
+ };
144
+ /**
145
+ * Scan a single web page for i18n/SEO health and bundle weight.
146
+ *
147
+ * In `deep` mode (default) the page is rendered with a locally installed
148
+ * `puppeteer`; when `puppeteer` is missing the scan transparently falls back to
149
+ * a `basic` fetch-based pass and logs a recommendation to install it.
150
+ *
151
+ * @param targetUrl - The absolute URL to scan.
152
+ * @param options - {@link ScanOptions} controlling depth, timeout and UA.
153
+ * @returns The {@link ScanResult} including score, page size and per-check events.
154
+ */
155
+ const scanWebsite = async (targetUrl, options = {}) => {
156
+ const { deep = true, timeoutMs = DEFAULT_TIMEOUT_MS, userAgent = DEFAULT_USER_AGENT } = options;
157
+ const origin = new URL(targetUrl).origin;
158
+ let mode = "basic";
159
+ let html;
160
+ let totalPageSize;
161
+ let chunks;
162
+ const deepResult = deep ? await runDeepScan(targetUrl, userAgent, timeoutMs) : null;
163
+ if (deepResult) {
164
+ mode = "deep";
165
+ html = deepResult.html;
166
+ chunks = deepResult.chunks;
167
+ totalPageSize = deepResult.totalPageSize;
168
+ } else {
169
+ if (deep) logDeepScanRecommendation();
170
+ const { html: fetchedHtml, finalUrl } = await fetchHtml(targetUrl, userAgent, timeoutMs);
171
+ html = fetchedHtml;
172
+ const { chunks: fetchedChunks, scriptBytes } = await fetchScripts(require_scan_parseHtml.extractScriptUrls(fetchedHtml, finalUrl), origin, userAgent);
173
+ chunks = fetchedChunks;
174
+ totalPageSize = require_scan_parseHtml.byteLength(fetchedHtml) + scriptBytes;
175
+ }
176
+ const htmlSize = require_scan_parseHtml.byteLength(html);
177
+ const events = [];
178
+ const localesSet = /* @__PURE__ */ new Set();
179
+ const { langTag } = require_scan_checks.checkHtmlAttributes(html, targetUrl, events);
180
+ require_scan_checks.checkCanonical(html, targetUrl, events);
181
+ require_scan_checks.checkLinguisticStructure(html, targetUrl, localesSet, events);
182
+ require_scan_checks.checkUrlStructure(require_scan_parseHtml.extractAnchors(html), origin, targetUrl, events);
183
+ const bundle = require_scan_checks.checkBundleContent(chunks, html, langTag, targetUrl, totalPageSize, events);
184
+ await require_scan_checks.checkRobots(origin, localesSet, userAgent, events);
185
+ await require_scan_checks.checkSitemap(origin, localesSet, userAgent, events);
186
+ const rawScore = events.reduce((score, event) => require_scan_calculateScore.mutateScore(score, event), {
187
+ score: 0,
188
+ totalScore: 0
189
+ });
190
+ return {
191
+ url: targetUrl,
192
+ mode,
193
+ totalPageSize,
194
+ htmlSize,
195
+ score: require_scan_calculateScore.toScorePercent(rawScore),
196
+ rawScore,
197
+ events,
198
+ locales: Array.from(localesSet),
199
+ bundle
200
+ };
201
+ };
202
+
203
+ //#endregion
204
+ exports.scanWebsite = scanWebsite;
205
+ //# sourceMappingURL=scanWebsite.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scanWebsite.cjs","names":["GREY","GREY_LIGHT","extractScriptUrls","byteLength","checkHtmlAttributes","extractAnchors","checkBundleContent","checkRobots","checkSitemap","mutateScore","toScorePercent"],"sources":["../../../src/scan/scanWebsite.ts"],"sourcesContent":["import { GREY, GREY_LIGHT } from '@intlayer/config/colors';\nimport { colorize, logger } from '@intlayer/config/logger';\nimport { mutateScore, type Score, toScorePercent } from './calculateScore';\nimport {\n checkBundleContent,\n checkCanonical,\n checkHtmlAttributes,\n checkLinguisticStructure,\n checkRobots,\n checkSitemap,\n checkUrlStructure,\n} from './checks';\nimport { byteLength, extractAnchors, extractScriptUrls } from './parseHtml';\nimport type {\n BundleChunkInput,\n ScanEvent,\n ScanOptions,\n ScanResult,\n} from './types';\n\nconst DEFAULT_USER_AGENT =\n 'Mozilla/5.0 (compatible; IntlayerScanBot/1.0; +https://intlayer.org)';\nconst DEFAULT_TIMEOUT_MS = 30_000;\n\n/**\n * Log a recommendation to install `puppeteer` for a deeper scan. Mirrors the\n * style used by other optional-dependency hints across the CLI.\n */\nconst logDeepScanRecommendation = (): void => {\n logger([\n colorize('Recommended: Install', GREY),\n colorize('puppeteer', GREY_LIGHT),\n colorize(\n 'package to enable a deeper scan (renders client-side content & lazy-loaded chunks). See documentation:',\n GREY\n ),\n colorize('https://intlayer.org/doc/concept/cli#scan', GREY_LIGHT),\n ]);\n};\n\n/** Outcome of a render-based deep scan. */\ntype DeepScanResult = {\n html: string;\n totalPageSize: number;\n chunks: BundleChunkInput[];\n};\n\n/**\n * Render the page with a locally installed `puppeteer` to capture\n * client-rendered content, the accurate transfer size, and lazy-loaded chunks.\n *\n * `puppeteer` is imported dynamically through a non-literal specifier so it is\n * never bundled and stays an optional dependency: when it is absent the import\n * rejects and the caller falls back to the basic scan.\n *\n * @returns The deep-scan result, or `null` when `puppeteer` is unavailable.\n */\nconst runDeepScan = async (\n targetUrl: string,\n userAgent: string,\n timeoutMs: number\n): Promise<DeepScanResult | null> => {\n const moduleName = 'puppeteer';\n // Optional dependency resolved at runtime — typed as `any` because it is not\n // a declared dependency of this package.\n let puppeteer: any;\n try {\n const mod: any = await import(moduleName);\n puppeteer = mod.default ?? mod;\n } catch {\n return null;\n }\n\n let browser: any;\n try {\n browser = await puppeteer.launch({\n headless: true,\n executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,\n args: [\n '--no-sandbox',\n '--disable-setuid-sandbox',\n '--disable-dev-shm-usage',\n '--disable-gpu',\n ],\n });\n\n const page = await browser.newPage();\n await page.setUserAgent(userAgent);\n await page.setExtraHTTPHeaders({ 'Accept-Language': 'en-US,en;q=0.9' });\n\n const origin = new URL(targetUrl).origin;\n const jsResponseMap = new Map<string, string>();\n let totalPageSize = 0;\n const pendingResponses: Promise<void>[] = [];\n\n page.on('response', (response: any) => {\n pendingResponses.push(\n (async () => {\n try {\n if (response.status() !== 200) return;\n const buffer = await response.buffer();\n totalPageSize += buffer.length;\n\n const responseUrl: string = response.url();\n const contentType: string =\n response.headers()['content-type'] ?? '';\n const isJavaScript =\n contentType.includes('javascript') ||\n /\\.(js|mjs|cjs)(\\?|$)/.test(responseUrl);\n if (isJavaScript && responseUrl.startsWith(origin)) {\n jsResponseMap.set(responseUrl, buffer.toString('utf-8'));\n }\n } catch {\n /* response already consumed or aborted */\n }\n })()\n );\n });\n\n await page.goto(targetUrl, {\n waitUntil: 'domcontentloaded',\n timeout: timeoutMs,\n });\n await page\n .waitForNetworkIdle({ idleTime: 1000, timeout: 10_000 })\n .catch(() => {\n /* ok if it never fully idles */\n });\n await Promise.allSettled(pendingResponses);\n\n const html: string = await page.content();\n const mainBundleUrls = new Set(extractScriptUrls(html, targetUrl));\n const chunks: BundleChunkInput[] = Array.from(jsResponseMap.entries()).map(\n ([url, content]) => ({\n url,\n isMainBundle: mainBundleUrls.has(url),\n content,\n })\n );\n\n return { html, totalPageSize, chunks };\n } finally {\n if (browser) await browser.close();\n }\n};\n\n/** Fetch the raw HTML document, measuring its byte size. */\nconst fetchHtml = async (\n url: string,\n userAgent: string,\n timeoutMs: number\n): Promise<{ html: string; finalUrl: string }> => {\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), timeoutMs);\n try {\n const response = await fetch(url, {\n headers: { 'User-Agent': userAgent, 'Accept-Language': 'en-US,en;q=0.9' },\n signal: controller.signal,\n });\n const html = await response.text();\n return { html, finalUrl: response.url || url };\n } finally {\n clearTimeout(timer);\n }\n};\n\n/**\n * Fetch every eagerly-loaded script. Same-origin scripts keep their content so\n * their locale weight can be analyzed; third-party scripts only contribute to\n * the measured page size (their locale-like keys cause false positives).\n */\nconst fetchScripts = async (\n scriptUrls: string[],\n origin: string,\n userAgent: string\n): Promise<{ chunks: BundleChunkInput[]; scriptBytes: number }> => {\n const chunks: BundleChunkInput[] = [];\n let scriptBytes = 0;\n\n await Promise.all(\n scriptUrls.map(async (scriptUrl) => {\n try {\n const response = await fetch(scriptUrl, {\n headers: { 'User-Agent': userAgent },\n });\n if (!response.ok) return;\n const content = await response.text();\n scriptBytes += byteLength(content);\n if (scriptUrl.startsWith(origin)) {\n chunks.push({ url: scriptUrl, isMainBundle: true, content });\n }\n } catch {\n /* ignore unreachable scripts */\n }\n })\n );\n\n return { chunks, scriptBytes };\n};\n\n/**\n * Scan a single web page for i18n/SEO health and bundle weight.\n *\n * In `deep` mode (default) the page is rendered with a locally installed\n * `puppeteer`; when `puppeteer` is missing the scan transparently falls back to\n * a `basic` fetch-based pass and logs a recommendation to install it.\n *\n * @param targetUrl - The absolute URL to scan.\n * @param options - {@link ScanOptions} controlling depth, timeout and UA.\n * @returns The {@link ScanResult} including score, page size and per-check events.\n */\nexport const scanWebsite = async (\n targetUrl: string,\n options: ScanOptions = {}\n): Promise<ScanResult> => {\n const {\n deep = true,\n timeoutMs = DEFAULT_TIMEOUT_MS,\n userAgent = DEFAULT_USER_AGENT,\n } = options;\n\n const origin = new URL(targetUrl).origin;\n\n let mode: ScanResult['mode'] = 'basic';\n let html: string;\n let totalPageSize: number;\n let chunks: BundleChunkInput[];\n\n const deepResult = deep\n ? await runDeepScan(targetUrl, userAgent, timeoutMs)\n : null;\n\n if (deepResult) {\n mode = 'deep';\n html = deepResult.html;\n chunks = deepResult.chunks;\n totalPageSize = deepResult.totalPageSize;\n } else {\n if (deep) logDeepScanRecommendation();\n const { html: fetchedHtml, finalUrl } = await fetchHtml(\n targetUrl,\n userAgent,\n timeoutMs\n );\n html = fetchedHtml;\n const scriptUrls = extractScriptUrls(fetchedHtml, finalUrl);\n const { chunks: fetchedChunks, scriptBytes } = await fetchScripts(\n scriptUrls,\n origin,\n userAgent\n );\n chunks = fetchedChunks;\n totalPageSize = byteLength(fetchedHtml) + scriptBytes;\n }\n\n const htmlSize = byteLength(html);\n\n const events: ScanEvent[] = [];\n const localesSet = new Set<string>();\n\n const { langTag } = checkHtmlAttributes(html, targetUrl, events);\n checkCanonical(html, targetUrl, events);\n checkLinguisticStructure(html, targetUrl, localesSet, events);\n checkUrlStructure(extractAnchors(html), origin, targetUrl, events);\n const bundle = checkBundleContent(\n chunks,\n html,\n langTag,\n targetUrl,\n totalPageSize,\n events\n );\n await checkRobots(origin, localesSet, userAgent, events);\n await checkSitemap(origin, localesSet, userAgent, events);\n\n const rawScore = events.reduce<Score>(\n (score, event) => mutateScore(score, event),\n { score: 0, totalScore: 0 }\n );\n\n return {\n url: targetUrl,\n mode,\n totalPageSize,\n htmlSize,\n score: toScorePercent(rawScore),\n rawScore,\n events,\n locales: Array.from(localesSet),\n bundle,\n };\n};\n"],"mappings":"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"}
File without changes
@@ -0,0 +1,90 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let _intlayer_core_markdown = require("@intlayer/core/markdown");
4
+ let _intlayer_core_transpiler = require("@intlayer/core/transpiler");
5
+ let _intlayer_types_nodeType = require("@intlayer/types/nodeType");
6
+ _intlayer_types_nodeType = require_runtime.__toESM(_intlayer_types_nodeType);
7
+
8
+ //#region src/utils/autoDecorateContent.ts
9
+ /**
10
+ * Check if a string is a markdown string
11
+ */
12
+ const isMarkdown = (str) => {
13
+ return [
14
+ /^\s*---/m,
15
+ /^\s*#+\s/m,
16
+ /^\s*[-*+]\s/m,
17
+ /^\s*\d+\.\s/m,
18
+ /^\s*>\s/m,
19
+ /\[.+\]\(.+\)/,
20
+ /!\[.+\]\(.+\)/,
21
+ /`{1,3}.+`{1,3}/,
22
+ /\*\*.+\*\*/,
23
+ /__.+__/,
24
+ /<(https?:\/\/[^\s>]+)>/
25
+ ].some((pattern) => pattern.test(str));
26
+ };
27
+ /**
28
+ * Check if a string is an insertion string
29
+ */
30
+ const isInsertion = (str) => (0, _intlayer_core_transpiler.getInsertionValues)(str).length > 0;
31
+ /**
32
+ * Check if a string is an HTML/JSX string
33
+ * Matches:
34
+ * - <Tag>
35
+ * - </Tag>
36
+ * - <Tag />
37
+ * - <Tag attribute="value">
38
+ * - <Component.SubComponent>
39
+ */
40
+ const isHTML = (str) => {
41
+ return /<[a-zA-Z][a-zA-Z0-9\-.]*(\s+[^>]*)?\/?>/.test(str) || /<\/[a-zA-Z][a-zA-Z0-9\-.]*\s*>/.test(str);
42
+ };
43
+ const leafNodeTypes = [
44
+ _intlayer_types_nodeType.HTML,
45
+ _intlayer_types_nodeType.MARKDOWN,
46
+ _intlayer_types_nodeType.INSERTION,
47
+ _intlayer_types_nodeType.FILE,
48
+ _intlayer_types_nodeType.REACT_NODE,
49
+ _intlayer_types_nodeType.TEXT,
50
+ _intlayer_types_nodeType.NUMBER,
51
+ _intlayer_types_nodeType.BOOLEAN,
52
+ _intlayer_types_nodeType.NULL,
53
+ _intlayer_types_nodeType.UNKNOWN
54
+ ];
55
+ /**
56
+ * Automatically decorate content strings with md() or insert() if they match
57
+ */
58
+ const autoDecorateContent = (content, options = true) => {
59
+ if (options === false) return content;
60
+ const { markdown = true, html: htmlOption = true, insertion = true } = typeof options === "object" ? options : {};
61
+ if (typeof content === "string") {
62
+ if (markdown && isMarkdown(content)) return {
63
+ ...(0, _intlayer_core_transpiler.md)(content),
64
+ metadata: (0, _intlayer_core_markdown.getMarkdownMetadata)(content)
65
+ };
66
+ if (htmlOption && isHTML(content)) return (0, _intlayer_core_transpiler.html)(content);
67
+ if (insertion && isInsertion(content)) return (0, _intlayer_core_transpiler.insert)(content);
68
+ return content;
69
+ }
70
+ if (Array.isArray(content)) return content.map((item) => autoDecorateContent(item, options));
71
+ if (content && typeof content === "object") {
72
+ if ("nodeType" in content) {
73
+ const nodeType = content.nodeType;
74
+ if (leafNodeTypes.includes(nodeType)) return content;
75
+ if (nodeType in content) return {
76
+ ...content,
77
+ [nodeType]: autoDecorateContent(content[nodeType], options)
78
+ };
79
+ return content;
80
+ }
81
+ const result = {};
82
+ for (const key of Object.keys(content)) result[key] = autoDecorateContent(content[key], options);
83
+ return result;
84
+ }
85
+ return content;
86
+ };
87
+
88
+ //#endregion
89
+ exports.autoDecorateContent = autoDecorateContent;
90
+ //# sourceMappingURL=autoDecorateContent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoDecorateContent.cjs","names":["NodeTypes"],"sources":["../../../src/utils/autoDecorateContent.ts"],"sourcesContent":["import { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport {\n getInsertionValues,\n html,\n insert,\n md,\n} from '@intlayer/core/transpiler';\nimport * as NodeTypes from '@intlayer/types/nodeType';\n\n/**\n * Check if a string is a markdown string\n */\nconst isMarkdown = (str: string): boolean => {\n // Check for common markdown indicators\n const patterns = [\n /^\\s*---/m, // Front Matter\n /^\\s*#+\\s/m, // Headers: # Title\n /^\\s*[-*+]\\s/m, // Unordered lists: - Item or * Item\n /^\\s*\\d+\\.\\s/m, // Ordered lists: 1. Item\n /^\\s*>\\s/m, // Blockquotes: > Quote\n /\\[.+\\]\\(.+\\)/, // Links: [text](url)\n /!\\[.+\\]\\(.+\\)/, // Images: ![alt](url)\n /`{1,3}.+`{1,3}/, // Code blocks or inline code: `code` or ```code```\n /\\*\\*.+\\*\\*/, // Bold: **text**\n /__.+__/, // Bold: __text__\n /<(https?:\\/\\/[^\\s>]+)>/, // Autolinks: <http://...>\n ];\n\n return patterns.some((pattern) => pattern.test(str));\n};\n\n/**\n * Check if a string is an insertion string\n */\nconst isInsertion = (str: string): boolean =>\n getInsertionValues(str).length > 0;\n\n/**\n * Check if a string is an HTML/JSX string\n * Matches:\n * - <Tag>\n * - </Tag>\n * - <Tag />\n * - <Tag attribute=\"value\">\n * - <Component.SubComponent>\n */\nconst isHTML = (str: string): boolean => {\n // 1. Matches opening or self-closing tags: <Tag ... > or <Tag ... />\n // - Must start with < followed by a letter (to avoid math comparisons like a < b)\n // - Allows alphanumeric, hyphens, and dots (for Namespaced components) in tag name\n // - Allows attributes until the closing >\n const openTagRegex = /<[a-zA-Z][a-zA-Z0-9\\-.]*(\\s+[^>]*)?\\/?>/;\n\n // 2. Matches closing tags: </Tag>\n const closeTagRegex = /<\\/[a-zA-Z][a-zA-Z0-9\\-.]*\\s*>/;\n\n return openTagRegex.test(str) || closeTagRegex.test(str);\n};\n\nconst leafNodeTypes: string[] = [\n NodeTypes.HTML,\n NodeTypes.MARKDOWN,\n NodeTypes.INSERTION,\n NodeTypes.FILE,\n NodeTypes.REACT_NODE,\n NodeTypes.TEXT,\n NodeTypes.NUMBER,\n NodeTypes.BOOLEAN,\n NodeTypes.NULL,\n NodeTypes.UNKNOWN,\n];\n\ntype AutoTransformationOptions = {\n markdown?: boolean;\n html?: boolean;\n insertion?: boolean;\n};\n\n/**\n * Automatically decorate content strings with md() or insert() if they match\n */\nexport const autoDecorateContent = (\n content: any,\n options: boolean | AutoTransformationOptions = true\n): any => {\n if (options === false) {\n return content;\n }\n\n const {\n markdown = true,\n html: htmlOption = true,\n insertion = true,\n } = typeof options === 'object' ? options : {};\n\n if (typeof content === 'string') {\n if (markdown && isMarkdown(content)) {\n const markdownNode = md(content);\n\n return {\n ...markdownNode,\n metadata: getMarkdownMetadata(content),\n };\n }\n\n if (htmlOption && isHTML(content)) {\n return html(content);\n }\n\n if (insertion && isInsertion(content)) {\n return insert(content);\n }\n\n return content;\n }\n\n if (Array.isArray(content)) {\n return content.map((item) => autoDecorateContent(item, options));\n }\n\n if (content && typeof content === 'object') {\n // If it's already a decorated node (has nodeType)\n if ('nodeType' in content) {\n const nodeType = content.nodeType;\n\n // If it's a leaf node type, don't re-decorate its content\n if (leafNodeTypes.includes(nodeType)) {\n return content;\n }\n\n // If it's a container node type (like translation, enumeration, etc.), recurse into its content field\n if (nodeType in content) {\n return {\n ...content,\n [nodeType]: autoDecorateContent(content[nodeType], options),\n };\n }\n\n return content;\n }\n\n // Plain object, recurse into all keys\n const result: Record<string, any> = {};\n for (const key of Object.keys(content)) {\n result[key] = autoDecorateContent(content[key], options);\n }\n return result;\n }\n\n return content;\n};\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,cAAc,QAAyB;AAgB3C,QAAO;EAbL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAGa,CAAC,MAAM,YAAY,QAAQ,KAAK,IAAI,CAAC;;;;;AAMtD,MAAM,eAAe,0DACA,IAAI,CAAC,SAAS;;;;;;;;;;AAWnC,MAAM,UAAU,QAAyB;AAUvC,QAAO,0CAAa,KAAK,IAAI,IAAI,iCAAc,KAAK,IAAI;;AAG1D,MAAM,gBAA0B;CAC9BA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACVA,yBAAU;CACX;;;;AAWD,MAAa,uBACX,SACA,UAA+C,SACvC;AACR,KAAI,YAAY,MACd,QAAO;CAGT,MAAM,EACJ,WAAW,MACX,MAAM,aAAa,MACnB,YAAY,SACV,OAAO,YAAY,WAAW,UAAU,EAAE;AAE9C,KAAI,OAAO,YAAY,UAAU;AAC/B,MAAI,YAAY,WAAW,QAAQ,CAGjC,QAAO;GACL,qCAHsB,QAGP;GACf,2DAA8B,QAAQ;GACvC;AAGH,MAAI,cAAc,OAAO,QAAQ,CAC/B,4CAAY,QAAQ;AAGtB,MAAI,aAAa,YAAY,QAAQ,CACnC,8CAAc,QAAQ;AAGxB,SAAO;;AAGT,KAAI,MAAM,QAAQ,QAAQ,CACxB,QAAO,QAAQ,KAAK,SAAS,oBAAoB,MAAM,QAAQ,CAAC;AAGlE,KAAI,WAAW,OAAO,YAAY,UAAU;AAE1C,MAAI,cAAc,SAAS;GACzB,MAAM,WAAW,QAAQ;AAGzB,OAAI,cAAc,SAAS,SAAS,CAClC,QAAO;AAIT,OAAI,YAAY,QACd,QAAO;IACL,GAAG;KACF,WAAW,oBAAoB,QAAQ,WAAW,QAAQ;IAC5D;AAGH,UAAO;;EAIT,MAAM,SAA8B,EAAE;AACtC,OAAK,MAAM,OAAO,OAAO,KAAK,QAAQ,CACpC,QAAO,OAAO,oBAAoB,QAAQ,MAAM,QAAQ;AAE1D,SAAO;;AAGT,QAAO"}
@@ -0,0 +1,94 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
+ let node_path = require("node:path");
4
+ let fast_glob = require("fast-glob");
5
+ fast_glob = require_runtime.__toESM(fast_glob);
6
+ let _intlayer_config_utils = require("@intlayer/config/utils");
7
+ let _intlayer_config_defaultValues = require("@intlayer/config/defaultValues");
8
+
9
+ //#region src/utils/buildComponentFilesList.ts
10
+ /**
11
+ * Normalizes a pattern value to an array
12
+ */
13
+ const normalizeToArray = (value) => Array.isArray(value) ? value : [value];
14
+ /**
15
+ * Remove directories that are subdirectories of others in the list so files
16
+ * are never scanned twice.
17
+ * Example: ['/root', '/root/src'] → ['/root']
18
+ */
19
+ const getDistinctRootDirs = (dirs) => {
20
+ const uniqueDirs = Array.from(new Set(dirs.map((dir) => (0, node_path.resolve)(dir))));
21
+ uniqueDirs.sort((a, b) => a.length - b.length);
22
+ return uniqueDirs.reduce((acc, dir) => {
23
+ if (!acc.some((parent) => {
24
+ const rel = (0, node_path.relative)(parent, dir);
25
+ return !rel.startsWith("..") && !(0, node_path.isAbsolute)(rel) && rel !== "";
26
+ })) acc.push(dir);
27
+ return acc;
28
+ }, []);
29
+ };
30
+ /**
31
+ * Returns true when the resolved path passes through a `node_modules` segment.
32
+ * Works on both POSIX and Windows paths.
33
+ */
34
+ const isInsideNodeModules = (dir) => (0, node_path.resolve)(dir).split(node_path.sep).includes("node_modules");
35
+ /**
36
+ * Default exclude patterns derived from TRAVERSE_PATTERN.
37
+ * Extracted once so the function body can reference them without re-computing.
38
+ */
39
+ const DEFAULT_EXCLUDE_PATTERNS = _intlayer_config_defaultValues.TRAVERSE_PATTERN.filter((p) => typeof p === "string" && p.startsWith("!")).map((p) => p.slice(1));
40
+ /**
41
+ * Builds a deduplicated list of absolute file paths matching the given patterns.
42
+ *
43
+ * Handles multiple root directories (deduplicates overlapping roots), exclude
44
+ * patterns, negation patterns embedded in `traversePattern`, and optional
45
+ * dot-file inclusion.
46
+ *
47
+ * Special case: `codeDir` entries that live inside `node_modules` (e.g. a
48
+ * design-system package installed as a workspace dependency) are scanned as
49
+ * their own explicit roots. They are NOT collapsed into the project root so
50
+ * the `*\/node_modules\/**` exclusion does not silently drop them.
51
+ *
52
+ * @example
53
+ * // Single root with excludes
54
+ * const files = buildComponentFilesList(config);
55
+ *
56
+ * @example
57
+ * // Design-system package inside node_modules is still scanned
58
+ * // intlayer.config.ts: { content: { codeDir: ['node_modules/my-ds/src'] } }
59
+ * const files = buildComponentFilesList(config);
60
+ */
61
+ const buildComponentFilesList = (config, excludePattern) => {
62
+ const traversePattern = config.build.traversePattern;
63
+ const compilerTransformPattern = config.compiler.transformPattern;
64
+ const contentDeclarationPattern = config.content.fileExtensions.map((ext) => `/**/*${ext}`);
65
+ const patterns = [...traversePattern, ...normalizeToArray(compilerTransformPattern)].filter((pattern) => typeof pattern === "string").filter((pattern) => !pattern.startsWith("!")).map(_intlayer_config_utils.normalizePath);
66
+ const userExcludes = traversePattern.filter((pattern) => typeof pattern === "string" && pattern.startsWith("!")).map((pattern) => pattern.slice(1));
67
+ const baseExcludePatterns = Array.from(new Set([
68
+ ...DEFAULT_EXCLUDE_PATTERNS,
69
+ ...userExcludes,
70
+ ...excludePattern ?? [],
71
+ ...contentDeclarationPattern
72
+ ])).filter((pattern) => typeof pattern === "string").map(_intlayer_config_utils.normalizePath);
73
+ const resolvedCodeDirs = (config.content.codeDir ?? []).map((dir) => (0, node_path.resolve)(dir));
74
+ const inNodeModulesCodeDirs = resolvedCodeDirs.filter(isInsideNodeModules);
75
+ const normalCodeDirs = resolvedCodeDirs.filter((dir) => !isInsideNodeModules(dir));
76
+ const normalFiles = getDistinctRootDirs([config.system.baseDir, ...normalCodeDirs]).flatMap((root) => fast_glob.default.sync(patterns, {
77
+ cwd: root,
78
+ ignore: baseExcludePatterns,
79
+ absolute: true,
80
+ dot: true
81
+ }));
82
+ const nodeModulesExcludePatterns = baseExcludePatterns.filter((pattern) => !pattern.includes("node_modules"));
83
+ const nodeModulesFiles = inNodeModulesCodeDirs.flatMap((dir) => fast_glob.default.sync(patterns, {
84
+ cwd: dir,
85
+ ignore: nodeModulesExcludePatterns,
86
+ absolute: true,
87
+ dot: false
88
+ }));
89
+ return Array.from(new Set([...normalFiles, ...nodeModulesFiles]));
90
+ };
91
+
92
+ //#endregion
93
+ exports.buildComponentFilesList = buildComponentFilesList;
94
+ //# sourceMappingURL=buildComponentFilesList.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildComponentFilesList.cjs","names":["sep","TRAVERSE_PATTERN","normalizePath","fg"],"sources":["../../../src/utils/buildComponentFilesList.ts"],"sourcesContent":["import { isAbsolute, relative, resolve, sep } from 'node:path';\nimport { TRAVERSE_PATTERN } from '@intlayer/config/defaultValues';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/**\n * Remove directories that are subdirectories of others in the list so files\n * are never scanned twice.\n * Example: ['/root', '/root/src'] → ['/root']\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n const uniqueDirs = Array.from(new Set(dirs.map((dir) => resolve(dir))));\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const rel = relative(parent, dir);\n\n return !rel.startsWith('..') && !isAbsolute(rel) && rel !== '';\n });\n if (!isNested) acc.push(dir);\n\n return acc;\n }, []);\n};\n\n/**\n * Returns true when the resolved path passes through a `node_modules` segment.\n * Works on both POSIX and Windows paths.\n */\nconst isInsideNodeModules = (dir: string): boolean =>\n resolve(dir).split(sep).includes('node_modules');\n\n/**\n * Default exclude patterns derived from TRAVERSE_PATTERN.\n * Extracted once so the function body can reference them without re-computing.\n */\nconst DEFAULT_EXCLUDE_PATTERNS: string[] = TRAVERSE_PATTERN.filter(\n (p): p is string => typeof p === 'string' && p.startsWith('!')\n).map((p) => p.slice(1));\n\n/**\n * Builds a deduplicated list of absolute file paths matching the given patterns.\n *\n * Handles multiple root directories (deduplicates overlapping roots), exclude\n * patterns, negation patterns embedded in `traversePattern`, and optional\n * dot-file inclusion.\n *\n * Special case: `codeDir` entries that live inside `node_modules` (e.g. a\n * design-system package installed as a workspace dependency) are scanned as\n * their own explicit roots. They are NOT collapsed into the project root so\n * the `*\\/node_modules\\/**` exclusion does not silently drop them.\n *\n * @example\n * // Single root with excludes\n * const files = buildComponentFilesList(config);\n *\n * @example\n * // Design-system package inside node_modules is still scanned\n * // intlayer.config.ts: { content: { codeDir: ['node_modules/my-ds/src'] } }\n * const files = buildComponentFilesList(config);\n */\nexport const buildComponentFilesList = (\n config: IntlayerConfig,\n excludePattern?: string[]\n): string[] => {\n const traversePattern = config.build.traversePattern;\n const compilerTransformPattern = config.compiler.transformPattern;\n const contentDeclarationPattern = config.content.fileExtensions.map(\n (ext) => `/**/*${ext}`\n );\n\n const patterns = [\n ...traversePattern,\n ...normalizeToArray(compilerTransformPattern),\n ]\n .filter((pattern) => typeof pattern === 'string')\n .filter((pattern) => !pattern.startsWith('!'))\n .map(normalizePath);\n\n // User-supplied negations from traversePattern\n const userExcludes = traversePattern\n .filter(\n (pattern): pattern is string =>\n typeof pattern === 'string' && pattern.startsWith('!')\n )\n .map((pattern) => pattern.slice(1));\n\n // Full exclude list: defaults (from TRAVERSE_PATTERN) + user overrides + caller extras + content files.\n // DEFAULT_EXCLUDE_PATTERNS acts as a safety floor — if the user provides a\n // partial traversePattern that omits some defaults, they are still applied.\n const baseExcludePatterns = Array.from(\n new Set([\n ...DEFAULT_EXCLUDE_PATTERNS,\n ...userExcludes,\n ...(excludePattern ?? []),\n ...contentDeclarationPattern,\n ])\n )\n .filter((pattern): pattern is string => typeof pattern === 'string')\n .map(normalizePath);\n\n // Separate codeDir entries that live inside node_modules.\n // getDistinctRootDirs would collapse them into the project root, after which\n // the **/node_modules/** ignore would silently exclude them.\n const resolvedCodeDirs = (config.content.codeDir ?? []).map((dir) =>\n resolve(dir)\n );\n const inNodeModulesCodeDirs = resolvedCodeDirs.filter(isInsideNodeModules);\n const normalCodeDirs = resolvedCodeDirs.filter(\n (dir) => !isInsideNodeModules(dir)\n );\n\n // Normal roots: project base + regular codeDir entries, deduplicated.\n const normalRoots = getDistinctRootDirs([\n config.system.baseDir,\n ...normalCodeDirs,\n ]);\n\n const normalFiles = normalRoots.flatMap((root) =>\n fg.sync(patterns, {\n cwd: root,\n ignore: baseExcludePatterns,\n absolute: true,\n dot: true, // needed for .intlayer and similar\n })\n );\n\n // node_modules codeDir roots: scanned directly from the package root.\n // **/node_modules/** is removed from the ignore list so it doesn't block\n // the scan (it is still applied inside the package for nested node_modules).\n const nodeModulesExcludePatterns = baseExcludePatterns.filter(\n (pattern) => !pattern.includes('node_modules')\n );\n\n const nodeModulesFiles = inNodeModulesCodeDirs.flatMap((dir) =>\n fg.sync(patterns, {\n cwd: dir,\n ignore: nodeModulesExcludePatterns,\n absolute: true,\n dot: false,\n })\n );\n\n return Array.from(new Set([...normalFiles, ...nodeModulesFiles]));\n};\n"],"mappings":";;;;;;;;;;;;AASA,MAAM,oBAAuB,UAC3B,MAAM,QAAQ,MAAM,GAAG,QAAQ,CAAC,MAAM;;;;;;AAOxC,MAAM,uBAAuB,SAA6B;CACxD,MAAM,aAAa,MAAM,KAAK,IAAI,IAAI,KAAK,KAAK,+BAAgB,IAAI,CAAC,CAAC,CAAC;AACvE,YAAW,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,OAAO;AAE9C,QAAO,WAAW,QAAQ,KAAe,QAAQ;AAM/C,MAAI,CALa,IAAI,MAAM,WAAW;GACpC,MAAM,8BAAe,QAAQ,IAAI;AAEjC,UAAO,CAAC,IAAI,WAAW,KAAK,IAAI,2BAAY,IAAI,IAAI,QAAQ;IAEjD,CAAE,KAAI,KAAK,IAAI;AAE5B,SAAO;IACN,EAAE,CAAC;;;;;;AAOR,MAAM,uBAAuB,+BACnB,IAAI,CAAC,MAAMA,cAAI,CAAC,SAAS,eAAe;;;;;AAMlD,MAAM,2BAAqCC,gDAAiB,QACzD,MAAmB,OAAO,MAAM,YAAY,EAAE,WAAW,IAAI,CAC/D,CAAC,KAAK,MAAM,EAAE,MAAM,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;AAuBxB,MAAa,2BACX,QACA,mBACa;CACb,MAAM,kBAAkB,OAAO,MAAM;CACrC,MAAM,2BAA2B,OAAO,SAAS;CACjD,MAAM,4BAA4B,OAAO,QAAQ,eAAe,KAC7D,QAAQ,QAAQ,MAClB;CAED,MAAM,WAAW,CACf,GAAG,iBACH,GAAG,iBAAiB,yBAAyB,CAC9C,CACE,QAAQ,YAAY,OAAO,YAAY,SAAS,CAChD,QAAQ,YAAY,CAAC,QAAQ,WAAW,IAAI,CAAC,CAC7C,IAAIC,qCAAc;CAGrB,MAAM,eAAe,gBAClB,QACE,YACC,OAAO,YAAY,YAAY,QAAQ,WAAW,IAAI,CACzD,CACA,KAAK,YAAY,QAAQ,MAAM,EAAE,CAAC;CAKrC,MAAM,sBAAsB,MAAM,KAChC,IAAI,IAAI;EACN,GAAG;EACH,GAAG;EACH,GAAI,kBAAkB,EAAE;EACxB,GAAG;EACJ,CAAC,CACH,CACE,QAAQ,YAA+B,OAAO,YAAY,SAAS,CACnE,IAAIA,qCAAc;CAKrB,MAAM,oBAAoB,OAAO,QAAQ,WAAW,EAAE,EAAE,KAAK,+BACnD,IAAI,CACb;CACD,MAAM,wBAAwB,iBAAiB,OAAO,oBAAoB;CAC1E,MAAM,iBAAiB,iBAAiB,QACrC,QAAQ,CAAC,oBAAoB,IAAI,CACnC;CAQD,MAAM,cALc,oBAAoB,CACtC,OAAO,OAAO,SACd,GAAG,eACJ,CAE8B,CAAC,SAAS,SACvCC,kBAAG,KAAK,UAAU;EAChB,KAAK;EACL,QAAQ;EACR,UAAU;EACV,KAAK;EACN,CAAC,CACH;CAKD,MAAM,6BAA6B,oBAAoB,QACpD,YAAY,CAAC,QAAQ,SAAS,eAAe,CAC/C;CAED,MAAM,mBAAmB,sBAAsB,SAAS,QACtDA,kBAAG,KAAK,UAAU;EAChB,KAAK;EACL,QAAQ;EACR,UAAU;EACV,KAAK;EACN,CAAC,CACH;AAED,QAAO,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,aAAa,GAAG,iBAAiB,CAAC,CAAC"}