@intlayer/cli 9.6.0 → 9.7.1

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 (332) hide show
  1. package/dist/cjs/IntlayerEventListener.cjs +1 -2
  2. package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
  4. package/dist/cjs/_virtual/_utils_asset.cjs +2 -3
  5. package/dist/cjs/auth/login.cjs +19 -9
  6. package/dist/cjs/auth/login.cjs.map +1 -1
  7. package/dist/cjs/auth/sessionToken.cjs +1 -2
  8. package/dist/cjs/auth/setupRepository.cjs +94 -0
  9. package/dist/cjs/auth/setupRepository.cjs.map +1 -0
  10. package/dist/cjs/build.cjs +2 -3
  11. package/dist/cjs/bundle.cjs +1 -2
  12. package/dist/cjs/ci.cjs +2 -3
  13. package/dist/cjs/cli.cjs +17 -12
  14. package/dist/cjs/cli.cjs.map +1 -1
  15. package/dist/cjs/config.cjs +2 -3
  16. package/dist/cjs/editor.cjs +62 -34
  17. package/dist/cjs/editor.cjs.map +1 -1
  18. package/dist/cjs/extract.cjs +7 -8
  19. package/dist/cjs/fill/deepMergeContent.cjs +1 -2
  20. package/dist/cjs/fill/extractTranslatableContent.cjs +1 -2
  21. package/dist/cjs/fill/fill.cjs +9 -10
  22. package/dist/cjs/fill/fill.cjs.map +1 -1
  23. package/dist/cjs/fill/formatAutoFilledFilePath.cjs +2 -3
  24. package/dist/cjs/fill/formatFillData.cjs +2 -3
  25. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +1 -2
  26. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +1 -2
  27. package/dist/cjs/fill/index.cjs +2 -2
  28. package/dist/cjs/fill/listTranslationsTasks.cjs +4 -5
  29. package/dist/cjs/fill/translateDictionary.cjs +6 -7
  30. package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
  31. package/dist/cjs/fill/writeFill.cjs +4 -5
  32. package/dist/cjs/getTargetDictionary.cjs +2 -3
  33. package/dist/cjs/index.cjs +37 -23
  34. package/dist/cjs/init.cjs +175 -22
  35. package/dist/cjs/init.cjs.map +1 -1
  36. package/dist/cjs/initChromeExtension.cjs +5 -6
  37. package/dist/cjs/initInfra.cjs +3 -4
  38. package/dist/cjs/initMCP.cjs +6 -7
  39. package/dist/cjs/initSkills.cjs +6 -7
  40. package/dist/cjs/listContentDeclaration.cjs +3 -4
  41. package/dist/cjs/listProjects.cjs +1 -2
  42. package/dist/cjs/liveSync.cjs +4 -5
  43. package/dist/cjs/liveSync.cjs.map +1 -1
  44. package/dist/cjs/loadPrompts.cjs +1 -2
  45. package/dist/cjs/pull.cjs +9 -11
  46. package/dist/cjs/pull.cjs.map +1 -1
  47. package/dist/cjs/push/pullLog.cjs +2 -3
  48. package/dist/cjs/push/push.cjs +10 -10
  49. package/dist/cjs/push/push.cjs.map +1 -1
  50. package/dist/cjs/pushConfig.cjs +4 -5
  51. package/dist/cjs/pushLog.cjs +2 -3
  52. package/dist/cjs/reviewDoc/reviewDoc.cjs +15 -15
  53. package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
  54. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +8 -9
  55. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
  56. package/dist/cjs/reviewDoc/reviewDocLog.cjs +2 -3
  57. package/dist/cjs/reviewDoc/reviewDocProgress.cjs +2 -3
  58. package/dist/cjs/reviewDoc/reviewDocSynthesis.cjs +2 -3
  59. package/dist/cjs/scan.cjs +2 -3
  60. package/dist/cjs/searchDoc.cjs +2 -3
  61. package/dist/cjs/test/index.cjs +2 -2
  62. package/dist/cjs/test/listMissingTranslations.cjs +2 -3
  63. package/dist/cjs/test/test.cjs +3 -4
  64. package/dist/cjs/translateDoc/index.cjs +3 -3
  65. package/dist/cjs/translateDoc/translateDoc.cjs +12 -13
  66. package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
  67. package/dist/cjs/translateDoc/translateFile.cjs +8 -9
  68. package/dist/cjs/translateDoc/validation.cjs +1 -2
  69. package/dist/cjs/upgrade.cjs +2 -3
  70. package/dist/cjs/utils/calculateChunks.cjs +1 -2
  71. package/dist/cjs/utils/checkAccess.cjs +5 -6
  72. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  73. package/dist/cjs/utils/checkConfigConsistency.cjs +1 -2
  74. package/dist/cjs/utils/checkFileModifiedRange.cjs +3 -4
  75. package/dist/cjs/utils/checkLastUpdateTime.cjs +1 -2
  76. package/dist/cjs/utils/chunkInference.cjs +2 -3
  77. package/dist/cjs/utils/detectGitRepository.cjs +86 -0
  78. package/dist/cjs/utils/detectGitRepository.cjs.map +1 -0
  79. package/dist/cjs/utils/fixChunkStartEndChars.cjs +1 -2
  80. package/dist/cjs/utils/formatLineRanges.cjs +1 -2
  81. package/dist/cjs/utils/formatTimeDiff.cjs +1 -2
  82. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +1 -2
  83. package/dist/cjs/utils/getOutputFilePath.cjs +1 -2
  84. package/dist/cjs/utils/getParentPackageJSON.cjs +2 -3
  85. package/dist/cjs/utils/isInteractiveTerminal.cjs +1 -2
  86. package/dist/cjs/utils/listSpecialChars.cjs +1 -2
  87. package/dist/cjs/utils/mapChunksBetweenFiles.cjs +2 -3
  88. package/dist/cjs/utils/openBrowser.cjs +1 -2
  89. package/dist/cjs/utils/parseChoice.cjs +1 -2
  90. package/dist/cjs/utils/reorderParagraphs.cjs +2 -3
  91. package/dist/cjs/utils/selectCmsEnvironment.cjs +2 -3
  92. package/dist/cjs/utils/setupAI.cjs +3 -4
  93. package/dist/cjs/watch.cjs +2 -3
  94. package/dist/esm/IntlayerEventListener.mjs +1 -2
  95. package/dist/esm/IntlayerEventListener.mjs.map +1 -1
  96. package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -2
  97. package/dist/esm/_virtual/_utils_asset.mjs +2 -3
  98. package/dist/esm/auth/login.mjs +15 -5
  99. package/dist/esm/auth/login.mjs.map +1 -1
  100. package/dist/esm/auth/sessionToken.mjs +1 -2
  101. package/dist/esm/auth/setupRepository.mjs +89 -0
  102. package/dist/esm/auth/setupRepository.mjs.map +1 -0
  103. package/dist/esm/build.mjs +2 -3
  104. package/dist/esm/bundle.mjs +1 -2
  105. package/dist/esm/ci.mjs +2 -3
  106. package/dist/esm/cli.mjs +16 -11
  107. package/dist/esm/cli.mjs.map +1 -1
  108. package/dist/esm/config.mjs +2 -3
  109. package/dist/esm/editor.mjs +63 -36
  110. package/dist/esm/editor.mjs.map +1 -1
  111. package/dist/esm/extract.mjs +5 -6
  112. package/dist/esm/fill/deepMergeContent.mjs +1 -2
  113. package/dist/esm/fill/extractTranslatableContent.mjs +1 -2
  114. package/dist/esm/fill/fill.mjs +3 -4
  115. package/dist/esm/fill/fill.mjs.map +1 -1
  116. package/dist/esm/fill/formatAutoFilledFilePath.mjs +2 -3
  117. package/dist/esm/fill/formatFillData.mjs +1 -2
  118. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +1 -2
  119. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +1 -2
  120. package/dist/esm/fill/index.mjs +1 -1
  121. package/dist/esm/fill/listTranslationsTasks.mjs +2 -3
  122. package/dist/esm/fill/translateDictionary.mjs +2 -3
  123. package/dist/esm/fill/translateDictionary.mjs.map +1 -1
  124. package/dist/esm/fill/writeFill.mjs +2 -3
  125. package/dist/esm/getTargetDictionary.mjs +2 -3
  126. package/dist/esm/index.mjs +15 -11
  127. package/dist/esm/init.mjs +169 -20
  128. package/dist/esm/init.mjs.map +1 -1
  129. package/dist/esm/initChromeExtension.mjs +2 -3
  130. package/dist/esm/initInfra.mjs +1 -2
  131. package/dist/esm/initMCP.mjs +3 -4
  132. package/dist/esm/initSkills.mjs +2 -3
  133. package/dist/esm/listContentDeclaration.mjs +3 -4
  134. package/dist/esm/listProjects.mjs +1 -2
  135. package/dist/esm/liveSync.mjs +2 -3
  136. package/dist/esm/liveSync.mjs.map +1 -1
  137. package/dist/esm/loadPrompts.mjs +1 -2
  138. package/dist/esm/pull.mjs +6 -8
  139. package/dist/esm/pull.mjs.map +1 -1
  140. package/dist/esm/push/pullLog.mjs +1 -2
  141. package/dist/esm/push/push.mjs +6 -6
  142. package/dist/esm/push/push.mjs.map +1 -1
  143. package/dist/esm/pushConfig.mjs +2 -3
  144. package/dist/esm/pushLog.mjs +1 -2
  145. package/dist/esm/reviewDoc/reviewDoc.mjs +8 -8
  146. package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
  147. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +3 -4
  148. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
  149. package/dist/esm/reviewDoc/reviewDocLog.mjs +2 -3
  150. package/dist/esm/reviewDoc/reviewDocProgress.mjs +1 -2
  151. package/dist/esm/reviewDoc/reviewDocSynthesis.mjs +1 -2
  152. package/dist/esm/scan.mjs +1 -2
  153. package/dist/esm/searchDoc.mjs +2 -3
  154. package/dist/esm/test/listMissingTranslations.mjs +2 -3
  155. package/dist/esm/test/test.mjs +1 -2
  156. package/dist/esm/translateDoc/index.mjs +2 -2
  157. package/dist/esm/translateDoc/translateDoc.mjs +7 -8
  158. package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
  159. package/dist/esm/translateDoc/translateFile.mjs +4 -5
  160. package/dist/esm/translateDoc/validation.mjs +1 -2
  161. package/dist/esm/upgrade.mjs +1 -2
  162. package/dist/esm/utils/calculateChunks.mjs +1 -2
  163. package/dist/esm/utils/checkAccess.mjs +2 -3
  164. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  165. package/dist/esm/utils/checkConfigConsistency.mjs +1 -2
  166. package/dist/esm/utils/checkFileModifiedRange.mjs +1 -2
  167. package/dist/esm/utils/checkLastUpdateTime.mjs +1 -2
  168. package/dist/esm/utils/chunkInference.mjs +1 -2
  169. package/dist/esm/utils/detectGitRepository.mjs +84 -0
  170. package/dist/esm/utils/detectGitRepository.mjs.map +1 -0
  171. package/dist/esm/utils/fixChunkStartEndChars.mjs +1 -2
  172. package/dist/esm/utils/formatLineRanges.mjs +1 -2
  173. package/dist/esm/utils/formatTimeDiff.mjs +1 -2
  174. package/dist/esm/utils/getIsFileUpdatedRecently.mjs +1 -2
  175. package/dist/esm/utils/getOutputFilePath.mjs +1 -2
  176. package/dist/esm/utils/getParentPackageJSON.mjs +2 -3
  177. package/dist/esm/utils/isInteractiveTerminal.mjs +1 -2
  178. package/dist/esm/utils/listSpecialChars.mjs +1 -2
  179. package/dist/esm/utils/mapChunksBetweenFiles.mjs +1 -2
  180. package/dist/esm/utils/openBrowser.mjs +1 -2
  181. package/dist/esm/utils/parseChoice.mjs +1 -2
  182. package/dist/esm/utils/reorderParagraphs.mjs +1 -2
  183. package/dist/esm/utils/selectCmsEnvironment.mjs +1 -2
  184. package/dist/esm/utils/setupAI.mjs +1 -2
  185. package/dist/esm/watch.mjs +2 -3
  186. package/dist/types/IntlayerEventListener.d.ts +1 -3
  187. package/dist/types/IntlayerEventListener.d.ts.map +1 -1
  188. package/dist/types/auth/login.d.ts +6 -2
  189. package/dist/types/auth/login.d.ts.map +1 -1
  190. package/dist/types/auth/sessionToken.d.ts +0 -2
  191. package/dist/types/auth/sessionToken.d.ts.map +1 -1
  192. package/dist/types/auth/setupRepository.d.ts +24 -0
  193. package/dist/types/auth/setupRepository.d.ts.map +1 -0
  194. package/dist/types/build.d.ts +1 -2
  195. package/dist/types/build.d.ts.map +1 -1
  196. package/dist/types/bundle.d.ts +0 -2
  197. package/dist/types/bundle.d.ts.map +1 -1
  198. package/dist/types/ci.d.ts +1 -2
  199. package/dist/types/ci.d.ts.map +1 -1
  200. package/dist/types/cli.d.ts +1 -2
  201. package/dist/types/cli.d.ts.map +1 -1
  202. package/dist/types/config.d.ts +1 -2
  203. package/dist/types/config.d.ts.map +1 -1
  204. package/dist/types/editor.d.ts +11 -2
  205. package/dist/types/editor.d.ts.map +1 -1
  206. package/dist/types/extract.d.ts +1 -2
  207. package/dist/types/extract.d.ts.map +1 -1
  208. package/dist/types/fill/deepMergeContent.d.ts +0 -2
  209. package/dist/types/fill/deepMergeContent.d.ts.map +1 -1
  210. package/dist/types/fill/extractTranslatableContent.d.ts +0 -2
  211. package/dist/types/fill/extractTranslatableContent.d.ts.map +1 -1
  212. package/dist/types/fill/fill.d.ts +1 -3
  213. package/dist/types/fill/fill.d.ts.map +1 -1
  214. package/dist/types/fill/formatAutoFilledFilePath.d.ts +0 -2
  215. package/dist/types/fill/formatAutoFilledFilePath.d.ts.map +1 -1
  216. package/dist/types/fill/formatFillData.d.ts +0 -2
  217. package/dist/types/fill/formatFillData.d.ts.map +1 -1
  218. package/dist/types/fill/getAvailableLocalesInDictionary.d.ts +0 -2
  219. package/dist/types/fill/getAvailableLocalesInDictionary.d.ts.map +1 -1
  220. package/dist/types/fill/getFilterMissingContentPerLocale.d.ts +0 -2
  221. package/dist/types/fill/getFilterMissingContentPerLocale.d.ts.map +1 -1
  222. package/dist/types/fill/listTranslationsTasks.d.ts +0 -2
  223. package/dist/types/fill/listTranslationsTasks.d.ts.map +1 -1
  224. package/dist/types/fill/translateDictionary.d.ts +3 -5
  225. package/dist/types/fill/translateDictionary.d.ts.map +1 -1
  226. package/dist/types/fill/writeFill.d.ts +0 -2
  227. package/dist/types/fill/writeFill.d.ts.map +1 -1
  228. package/dist/types/getTargetDictionary.d.ts +0 -2
  229. package/dist/types/getTargetDictionary.d.ts.map +1 -1
  230. package/dist/types/index.d.ts +7 -3
  231. package/dist/types/init.d.ts +20 -4
  232. package/dist/types/init.d.ts.map +1 -1
  233. package/dist/types/initChromeExtension.d.ts +0 -2
  234. package/dist/types/initChromeExtension.d.ts.map +1 -1
  235. package/dist/types/initInfra.d.ts +0 -2
  236. package/dist/types/initInfra.d.ts.map +1 -1
  237. package/dist/types/initMCP.d.ts +0 -2
  238. package/dist/types/initMCP.d.ts.map +1 -1
  239. package/dist/types/initSkills.d.ts +0 -2
  240. package/dist/types/initSkills.d.ts.map +1 -1
  241. package/dist/types/listContentDeclaration.d.ts +1 -2
  242. package/dist/types/listContentDeclaration.d.ts.map +1 -1
  243. package/dist/types/listProjects.d.ts +0 -2
  244. package/dist/types/listProjects.d.ts.map +1 -1
  245. package/dist/types/liveSync.d.ts +1 -2
  246. package/dist/types/liveSync.d.ts.map +1 -1
  247. package/dist/types/loadPrompts.d.ts +0 -2
  248. package/dist/types/loadPrompts.d.ts.map +1 -1
  249. package/dist/types/pull.d.ts +1 -2
  250. package/dist/types/pull.d.ts.map +1 -1
  251. package/dist/types/push/pullLog.d.ts +0 -2
  252. package/dist/types/push/pullLog.d.ts.map +1 -1
  253. package/dist/types/push/push.d.ts +1 -2
  254. package/dist/types/push/push.d.ts.map +1 -1
  255. package/dist/types/pushConfig.d.ts +1 -2
  256. package/dist/types/pushConfig.d.ts.map +1 -1
  257. package/dist/types/pushLog.d.ts +0 -2
  258. package/dist/types/pushLog.d.ts.map +1 -1
  259. package/dist/types/reviewDoc/reviewDoc.d.ts +2 -3
  260. package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
  261. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -4
  262. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts.map +1 -1
  263. package/dist/types/reviewDoc/reviewDocLog.d.ts +0 -2
  264. package/dist/types/reviewDoc/reviewDocLog.d.ts.map +1 -1
  265. package/dist/types/reviewDoc/reviewDocProgress.d.ts +0 -2
  266. package/dist/types/reviewDoc/reviewDocProgress.d.ts.map +1 -1
  267. package/dist/types/reviewDoc/reviewDocSynthesis.d.ts +0 -2
  268. package/dist/types/reviewDoc/reviewDocSynthesis.d.ts.map +1 -1
  269. package/dist/types/scan.d.ts +0 -2
  270. package/dist/types/scan.d.ts.map +1 -1
  271. package/dist/types/searchDoc.d.ts +1 -2
  272. package/dist/types/searchDoc.d.ts.map +1 -1
  273. package/dist/types/test/listMissingTranslations.d.ts +0 -2
  274. package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
  275. package/dist/types/test/test.d.ts +1 -2
  276. package/dist/types/test/test.d.ts.map +1 -1
  277. package/dist/types/translateDoc/index.d.ts +1 -1
  278. package/dist/types/translateDoc/translateDoc.d.ts +0 -2
  279. package/dist/types/translateDoc/translateDoc.d.ts.map +1 -1
  280. package/dist/types/translateDoc/translateFile.d.ts +0 -2
  281. package/dist/types/translateDoc/translateFile.d.ts.map +1 -1
  282. package/dist/types/translateDoc/types.d.ts +1 -3
  283. package/dist/types/translateDoc/types.d.ts.map +1 -1
  284. package/dist/types/translateDoc/validation.d.ts +0 -2
  285. package/dist/types/translateDoc/validation.d.ts.map +1 -1
  286. package/dist/types/upgrade.d.ts +0 -2
  287. package/dist/types/upgrade.d.ts.map +1 -1
  288. package/dist/types/utils/calculateChunks.d.ts +0 -2
  289. package/dist/types/utils/calculateChunks.d.ts.map +1 -1
  290. package/dist/types/utils/checkAccess.d.ts +2 -3
  291. package/dist/types/utils/checkAccess.d.ts.map +1 -1
  292. package/dist/types/utils/checkConfigConsistency.d.ts +0 -2
  293. package/dist/types/utils/checkConfigConsistency.d.ts.map +1 -1
  294. package/dist/types/utils/checkFileModifiedRange.d.ts +1 -2
  295. package/dist/types/utils/checkFileModifiedRange.d.ts.map +1 -1
  296. package/dist/types/utils/checkLastUpdateTime.d.ts +0 -2
  297. package/dist/types/utils/checkLastUpdateTime.d.ts.map +1 -1
  298. package/dist/types/utils/chunkInference.d.ts +1 -2
  299. package/dist/types/utils/chunkInference.d.ts.map +1 -1
  300. package/dist/types/utils/detectGitRepository.d.ts +32 -0
  301. package/dist/types/utils/detectGitRepository.d.ts.map +1 -0
  302. package/dist/types/utils/fixChunkStartEndChars.d.ts +0 -2
  303. package/dist/types/utils/fixChunkStartEndChars.d.ts.map +1 -1
  304. package/dist/types/utils/formatLineRanges.d.ts +0 -2
  305. package/dist/types/utils/formatLineRanges.d.ts.map +1 -1
  306. package/dist/types/utils/formatTimeDiff.d.ts +0 -2
  307. package/dist/types/utils/formatTimeDiff.d.ts.map +1 -1
  308. package/dist/types/utils/getIsFileUpdatedRecently.d.ts +0 -2
  309. package/dist/types/utils/getIsFileUpdatedRecently.d.ts.map +1 -1
  310. package/dist/types/utils/getOutputFilePath.d.ts +0 -2
  311. package/dist/types/utils/getOutputFilePath.d.ts.map +1 -1
  312. package/dist/types/utils/getParentPackageJSON.d.ts +1 -2
  313. package/dist/types/utils/getParentPackageJSON.d.ts.map +1 -1
  314. package/dist/types/utils/isInteractiveTerminal.d.ts +0 -2
  315. package/dist/types/utils/isInteractiveTerminal.d.ts.map +1 -1
  316. package/dist/types/utils/listSpecialChars.d.ts +1 -2
  317. package/dist/types/utils/listSpecialChars.d.ts.map +1 -1
  318. package/dist/types/utils/mapChunksBetweenFiles.d.ts +0 -2
  319. package/dist/types/utils/mapChunksBetweenFiles.d.ts.map +1 -1
  320. package/dist/types/utils/openBrowser.d.ts +0 -2
  321. package/dist/types/utils/openBrowser.d.ts.map +1 -1
  322. package/dist/types/utils/parseChoice.d.ts +0 -2
  323. package/dist/types/utils/parseChoice.d.ts.map +1 -1
  324. package/dist/types/utils/reorderParagraphs.d.ts +0 -2
  325. package/dist/types/utils/reorderParagraphs.d.ts.map +1 -1
  326. package/dist/types/utils/selectCmsEnvironment.d.ts +1 -3
  327. package/dist/types/utils/selectCmsEnvironment.d.ts.map +1 -1
  328. package/dist/types/utils/setupAI.d.ts +1 -2
  329. package/dist/types/utils/setupAI.d.ts.map +1 -1
  330. package/dist/types/watch.d.ts +1 -2
  331. package/dist/types/watch.d.ts.map +1 -1
  332. package/package.json +14 -14
@@ -1,25 +1,29 @@
1
- import { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, EXTENSION_BROWSERS, EXTENSION_URL_BY_BROWSER, MOZILLA_EXTENSION_URL, initChromeExtension, parseExtensionBrowsers } from "./initChromeExtension.mjs";
2
- import { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, initInfra, parseInfraMode } from "./initInfra.mjs";
3
- import { PLATFORM_OPTIONS, initSkills, parsePlatform, parseSkills, promptPlatform, resolvePlatformWithoutPrompt } from "./initSkills.mjs";
4
- import { DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, LOCALE_ROUTING_CHOICES, OPT_IN_INIT_STEPS, findProjectRoot, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initCms, initSteps, isEslintInstalled, parseLocaleRoutingChoice, resolveProjectRoot } from "./init.mjs";
1
+ import { login } from "./auth/login.mjs";
2
+ import { clearCliSessionToken, readCliSessionToken } from "./auth/sessionToken.mjs";
5
3
  import { build } from "./build.mjs";
6
- import { listProjectsCommand } from "./listProjects.mjs";
7
- import { startEditor } from "./editor.mjs";
8
- import { scan } from "./scan.mjs";
4
+ import { bundle } from "./bundle.mjs";
9
5
  import { dirname, setAPI } from "./cli.mjs";
6
+ import { getRemoteEditorRunners, startEditor } from "./editor.mjs";
10
7
  import { extract } from "./extract.mjs";
11
- import { bundle } from "./bundle.mjs";
12
- import { checkCMSAuth, getAuthenticatedAPI } from "./utils/checkAccess.mjs";
8
+ import { fill } from "./fill/fill.mjs";
9
+ import { IntlayerEventListener } from "./IntlayerEventListener.mjs";
13
10
  import { listMissingTranslations, listMissingTranslationsWithConfig } from "./test/listMissingTranslations.mjs";
14
11
  import { testMissingTranslations } from "./test/test.mjs";
15
- import { fill } from "./fill/fill.mjs";
12
+ import { CONTENT_LAYOUT_CHOICES, DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, LOCALE_ROUTING_CHOICES, OPT_IN_INIT_STEPS, findProjectRoot, getContentInitOptions, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initCms, initRepository, initSteps, isEslintInstalled, parseContentLayoutChoice, parseLocaleRoutingChoice, resolveProjectRoot } from "./init.mjs";
13
+ import { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, EXTENSION_BROWSERS, EXTENSION_URL_BY_BROWSER, MOZILLA_EXTENSION_URL, initChromeExtension, parseExtensionBrowsers } from "./initChromeExtension.mjs";
14
+ import { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, initInfra, parseInfraMode } from "./initInfra.mjs";
15
+ import { PLATFORM_OPTIONS, initSkills, parsePlatform, parseSkills, promptPlatform, resolvePlatformWithoutPrompt } from "./initSkills.mjs";
16
16
  import { listContentDeclaration, listContentDeclarationRows } from "./listContentDeclaration.mjs";
17
+ import { listProjectsCommand } from "./listProjects.mjs";
17
18
  import { liveSync } from "./liveSync.mjs";
18
19
  import { pull } from "./pull.mjs";
19
20
  import { push } from "./push/push.mjs";
20
21
  import { pushConfig } from "./pushConfig.mjs";
21
22
  import { reviewDoc } from "./reviewDoc/reviewDoc.mjs";
23
+ import { scan } from "./scan.mjs";
22
24
  import { searchDoc } from "./searchDoc.mjs";
23
25
  import { translateDoc } from "./translateDoc/translateDoc.mjs";
26
+ import { checkCMSAuth, getAuthenticatedAPI } from "./utils/checkAccess.mjs";
27
+ import { checkConfigConsistency } from "./utils/checkConfigConsistency.mjs";
24
28
 
25
- export { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, EXTENSION_BROWSERS, EXTENSION_URL_BY_BROWSER, INFRA_MODES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, LOCALE_ROUTING_CHOICES, MOZILLA_EXTENSION_URL, OPT_IN_INIT_STEPS, PLATFORM_OPTIONS, build, bundle, checkCMSAuth, dirname, extract, fill, findProjectRoot, getAuthenticatedAPI, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initChromeExtension, initCms, initInfra, initSkills, initSteps, isEslintInstalled, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, parseExtensionBrowsers, parseInfraMode, parseLocaleRoutingChoice, parsePlatform, parseSkills, promptPlatform, pull, push, pushConfig, resolvePlatformWithoutPrompt, resolveProjectRoot, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
29
+ export { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, CONTENT_LAYOUT_CHOICES, DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, EXTENSION_BROWSERS, EXTENSION_URL_BY_BROWSER, INFRA_MODES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, IntlayerEventListener, LOCALE_ROUTING_CHOICES, MOZILLA_EXTENSION_URL, OPT_IN_INIT_STEPS, PLATFORM_OPTIONS, build, bundle, checkCMSAuth, checkConfigConsistency, clearCliSessionToken, dirname, extract, fill, findProjectRoot, getAuthenticatedAPI, getContentInitOptions, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRemoteEditorRunners, getRoutingInitOptions, init, initChromeExtension, initCms, initInfra, initRepository, initSkills, initSteps, isEslintInstalled, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, listProjectsCommand, liveSync, login, parseContentLayoutChoice, parseExtensionBrowsers, parseInfraMode, parseLocaleRoutingChoice, parsePlatform, parseSkills, promptPlatform, pull, push, pushConfig, readCliSessionToken, resolvePlatformWithoutPrompt, resolveProjectRoot, reviewDoc, scan, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
package/dist/esm/init.mjs CHANGED
@@ -1,16 +1,18 @@
1
1
  import { login } from "./auth/login.mjs";
2
- import { loadPrompts } from "./loadPrompts.mjs";
3
- import { isInteractiveTerminal } from "./utils/isInteractiveTerminal.mjs";
4
- import { parseChoice } from "./utils/parseChoice.mjs";
2
+ import { setupRepository } from "./auth/setupRepository.mjs";
5
3
  import { initChromeExtension } from "./initChromeExtension.mjs";
6
4
  import { initInfra } from "./initInfra.mjs";
7
- import { initSkills } from "./initSkills.mjs";
8
5
  import { initMCP } from "./initMCP.mjs";
9
- import { detectCompatI18nLibraries, hasLintTooling, hasUrlRoutingFramework, initIntlayer, logInitSuccessMessage, setupCmsCredentials } from "@intlayer/engine/cli";
10
- import { existsSync, readFileSync } from "node:fs";
6
+ import { initSkills } from "./initSkills.mjs";
7
+ import { loadPrompts } from "./loadPrompts.mjs";
8
+ import { detectGitRepository } from "./utils/detectGitRepository.mjs";
9
+ import { isInteractiveTerminal } from "./utils/isInteractiveTerminal.mjs";
10
+ import { parseChoice } from "./utils/parseChoice.mjs";
11
+ import { CATALOG_MESSAGE_FORMATS, CONTENT_FORMATS_BY_LAYOUT, detectCompatI18nLibraries, hasLintTooling, hasUrlRoutingFramework, initIntlayer, logInitSuccessMessage, setupCmsCredentials } from "@intlayer/engine/cli";
11
12
  import { join, resolve } from "node:path";
13
+ import { existsSync, readFileSync } from "node:fs";
12
14
 
13
- //#region src/init.ts
15
+ // src/init.ts
14
16
  const findProjectRoot = (startDir) => {
15
17
  let currentDir = startDir;
16
18
  while (currentDir !== resolve(currentDir, "..")) {
@@ -40,7 +42,7 @@ const DEFAULT_INIT_STEPS = ["packages", "projectSetup"];
40
42
  */
41
43
  const INIT_STEP_COMMANDS = {
42
44
  packages: "intlayer init packages",
43
- projectSetup: "intlayer init project [--routing <routing>]",
45
+ projectSetup: "intlayer init project [--routing <routing>] [--content <layout>] [--content-format <format>] [--message-format <format>]",
44
46
  githubActions: "intlayer init github-actions",
45
47
  vscodeExtension: "intlayer init vscode-extension",
46
48
  eslint: "intlayer init eslint",
@@ -49,6 +51,7 @@ const INIT_STEP_COMMANDS = {
49
51
  mcp: "intlayer init mcp [--platform <platform>] [--transport <stdio|sse>]",
50
52
  lsp: "intlayer init lsp",
51
53
  cms: "intlayer init cms",
54
+ repository: "intlayer init repository",
52
55
  infra: "intlayer init infra --mode <desktop|docker|compose>"
53
56
  };
54
57
  /**
@@ -87,6 +90,18 @@ const initCms = async (projectRoot) => {
87
90
  onCredentials: (credentials) => setupCmsCredentials(root, credentials)
88
91
  });
89
92
  };
93
+ /**
94
+ * Connects the git repository of the project to its CMS project (and sets
95
+ * its build settings) in the browser, pre-filled with the `origin` remote.
96
+ */
97
+ const initRepository = async (projectRoot) => {
98
+ const root = resolveProjectRoot(projectRoot);
99
+ const p = await loadPrompts();
100
+ const detectedRepository = detectGitRepository(root);
101
+ p.log.info(detectedRepository ? `Detected repository: ${detectedRepository.provider} ${detectedRepository.owner}/${detectedRepository.repository}` : "No supported git remote detected: pick the repository in the browser.");
102
+ p.log.info("Opening your browser to connect the repository...");
103
+ await setupRepository({ detectedRepository });
104
+ };
90
105
  /** Explains why `--interactive` cannot run, and what to run instead. */
91
106
  const getNoTerminalMessage = () => [
92
107
  "`intlayer init --interactive` needs a terminal to answer its prompts (none is attached, e.g. when run by an AI agent or in CI).",
@@ -147,15 +162,23 @@ const INIT_STEP_GROUPS = {
147
162
  hint: "go-to-definition from keys to .content files"
148
163
  }
149
164
  ],
150
- CMS: [{
151
- value: "cms",
152
- label: "CMS",
153
- hint: "log in through your browser, then store the credentials in your .env"
154
- }, {
155
- value: "infra",
156
- label: "Infrastructure (desktop app / self-hosting)",
157
- hint: "install the desktop app, or self-host with Docker (all-in-one or Compose)"
158
- }]
165
+ CMS: [
166
+ {
167
+ value: "cms",
168
+ label: "CMS",
169
+ hint: "log in through your browser, then store the credentials in your .env"
170
+ },
171
+ {
172
+ value: "repository",
173
+ label: "Git repository",
174
+ hint: "connect the git repository to the CMS project and set its build settings (GitHub, GitLab, Bitbucket, Codeberg, Gitee)"
175
+ },
176
+ {
177
+ value: "infra",
178
+ label: "Infrastructure (desktop app / self-hosting)",
179
+ hint: "install the desktop app, or self-host with Docker (all-in-one or Compose)"
180
+ }
181
+ ]
159
182
  };
160
183
  /** Locale routing strategies offered by the interactive init flow. */
161
184
  const ROUTING_OPTIONS = [
@@ -197,6 +220,83 @@ const getRoutingInitOptions = (choice) => choice === "none" ? {
197
220
  routingMode: choice,
198
221
  enableProxy: true
199
222
  };
223
+ /** Content declaration layouts offered by the interactive init flow. */
224
+ const CONTENT_LAYOUT_OPTIONS = [
225
+ {
226
+ value: "multilingual",
227
+ label: "Multilingual content declaration",
228
+ hint: "/**/{fileName}.content.{ts,json} — every locale in one file"
229
+ },
230
+ {
231
+ value: "per-locale",
232
+ label: "Per-locale content declaration",
233
+ hint: "/**/{fileName}.{locale}.content.{ts,json}"
234
+ },
235
+ {
236
+ value: "centralized",
237
+ label: "Centralized",
238
+ hint: "/locales/{locale}.{json,po}"
239
+ },
240
+ {
241
+ value: "namespaces",
242
+ label: "Namespaces",
243
+ hint: "/locales/{locale}/{namespace}.{json,po}"
244
+ }
245
+ ];
246
+ /** Labels of the content formats offered by the interactive init flow. */
247
+ const CONTENT_FORMAT_LABELS = {
248
+ ts: "TypeScript (.ts)",
249
+ json: "JSON (.json)",
250
+ po: "Gettext (.po)"
251
+ };
252
+ /** Labels of the JSON catalog message formats, in display order. */
253
+ const CATALOG_MESSAGE_FORMAT_OPTIONS = {
254
+ icu: {
255
+ label: "ICU",
256
+ hint: "{count, plural, one {# item} other {# items}}"
257
+ },
258
+ i18next: {
259
+ label: "i18next",
260
+ hint: "{{count}} item, key_one / key_other"
261
+ },
262
+ "vue-i18n": {
263
+ label: "vue-i18n",
264
+ hint: "{count} item | {count} items"
265
+ },
266
+ intlayer: {
267
+ label: "Intlayer",
268
+ hint: "Intlayer dictionary content"
269
+ }
270
+ };
271
+ /** Content layouts accepted by `--content`. */
272
+ const CONTENT_LAYOUT_CHOICES = CONTENT_LAYOUT_OPTIONS.map((option) => option.value);
273
+ /** Validates a `--content` value, throwing on an unknown layout. */
274
+ const parseContentLayoutChoice = (value) => parseChoice(value, CONTENT_LAYOUT_CHOICES, "--content");
275
+ /** Whether a layout + format pair produces a JSON catalog (sync plugin). */
276
+ const isJsonCatalog = (layout, format) => (layout === "centralized" || layout === "namespaces") && format === "json";
277
+ /**
278
+ * Validates `--content` / `--content-format` / `--message-format` and maps
279
+ * them to the init options. The format must be one the layout accepts, and the
280
+ * message format only applies to JSON catalogs.
281
+ */
282
+ const getContentInitOptions = (layoutValue, formatValue, messageFormatValue) => {
283
+ if (!layoutValue) {
284
+ if (formatValue || messageFormatValue) throw new Error("--content-format and --message-format require --content.");
285
+ return {};
286
+ }
287
+ const contentLayout = parseContentLayoutChoice(layoutValue);
288
+ const contentFormat = formatValue ? parseChoice(formatValue, CONTENT_FORMATS_BY_LAYOUT[contentLayout], "--content-format") : void 0;
289
+ if (!messageFormatValue) return {
290
+ contentLayout,
291
+ contentFormat
292
+ };
293
+ if (!isJsonCatalog(contentLayout, contentFormat ?? "json")) throw new Error("--message-format only applies to JSON catalogs (--content centralized | namespaces with json).");
294
+ return {
295
+ contentLayout,
296
+ contentFormat,
297
+ contentMessageFormat: parseChoice(messageFormatValue, CATALOG_MESSAGE_FORMATS, "--message-format")
298
+ };
299
+ };
200
300
  /** Known ESLint and oxlint configuration file names. */
201
301
  const ESLINT_CONFIG_FILES = [
202
302
  "eslint.config.js",
@@ -288,10 +388,59 @@ const runInteractiveInit = async (root, baseOptions) => {
288
388
  }
289
389
  routingOptions = getRoutingInitOptions(selectedRouting);
290
390
  }
391
+ let contentOptions = {};
392
+ if (steps.includes("projectSetup") && baseOptions?.contentLayout === void 0 && !hasCompatLib) {
393
+ const contentLayout = await p.select({
394
+ message: "How do you want to declare your content?",
395
+ options: CONTENT_LAYOUT_OPTIONS,
396
+ initialValue: "multilingual"
397
+ });
398
+ if (p.isCancel(contentLayout)) {
399
+ p.cancel("Operation cancelled.");
400
+ return;
401
+ }
402
+ const acceptedFormats = CONTENT_FORMATS_BY_LAYOUT[contentLayout];
403
+ const hasTypeScript = existsSync(join(root, "tsconfig.json"));
404
+ const contentFormat = await p.select({
405
+ message: "Which format for your content?",
406
+ options: acceptedFormats.map((format) => ({
407
+ value: format,
408
+ label: CONTENT_FORMAT_LABELS[format]
409
+ })),
410
+ initialValue: acceptedFormats.includes("ts") && !hasTypeScript ? "json" : acceptedFormats[0]
411
+ });
412
+ if (p.isCancel(contentFormat)) {
413
+ p.cancel("Operation cancelled.");
414
+ return;
415
+ }
416
+ contentOptions = {
417
+ contentLayout,
418
+ contentFormat
419
+ };
420
+ if (isJsonCatalog(contentLayout, contentFormat)) {
421
+ const contentMessageFormat = await p.select({
422
+ message: "Which message format do your JSON catalogs use?",
423
+ options: CATALOG_MESSAGE_FORMATS.map((messageFormat) => ({
424
+ value: messageFormat,
425
+ ...CATALOG_MESSAGE_FORMAT_OPTIONS[messageFormat]
426
+ })),
427
+ initialValue: CATALOG_MESSAGE_FORMATS[0]
428
+ });
429
+ if (p.isCancel(contentMessageFormat)) {
430
+ p.cancel("Operation cancelled.");
431
+ return;
432
+ }
433
+ contentOptions = {
434
+ ...contentOptions,
435
+ contentMessageFormat
436
+ };
437
+ }
438
+ }
291
439
  const options = {
292
440
  ...getInitOptionsForSteps(steps, {
293
441
  ...baseOptions,
294
- ...routingOptions
442
+ ...routingOptions,
443
+ ...contentOptions
295
444
  }),
296
445
  skipFinalMessage: true
297
446
  };
@@ -301,6 +450,7 @@ const runInteractiveInit = async (root, baseOptions) => {
301
450
  if (steps.includes("infra")) await initInfra();
302
451
  if (steps.includes("chromeExtension")) await initChromeExtension();
303
452
  if (steps.includes("cms")) await initCms(root);
453
+ if (steps.includes("repository")) await initRepository(root);
304
454
  p.outro("Intlayer initialization complete");
305
455
  if (guideUrl) logInitSuccessMessage(guideUrl);
306
456
  };
@@ -322,6 +472,5 @@ const init = async (projectRoot, options, interactive) => {
322
472
  await runInteractiveInit(resolveProjectRoot(projectRoot), options);
323
473
  };
324
474
 
325
- //#endregion
326
- export { DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, LOCALE_ROUTING_CHOICES, OPT_IN_INIT_STEPS, findProjectRoot, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initCms, initSteps, isEslintInstalled, parseLocaleRoutingChoice, resolveProjectRoot };
475
+ export { CONTENT_LAYOUT_CHOICES, DEFAULT_INIT_STEPS, ESLINT_CONFIG_FILES, INIT_STEP_COMMANDS, INIT_STEP_GROUPS, LOCALE_ROUTING_CHOICES, OPT_IN_INIT_STEPS, findProjectRoot, getContentInitOptions, getInitOptionsForSteps, getInitialInitSteps, getProjectDependencies, getRoutingInitOptions, init, initCms, initRepository, initSteps, isEslintInstalled, parseContentLayoutChoice, parseLocaleRoutingChoice, resolveProjectRoot };
327
476
  //# sourceMappingURL=init.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.mjs","names":[],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n detectCompatI18nLibraries,\n hasLintTooling,\n hasUrlRoutingFramework,\n type InitOptions,\n initIntlayer,\n logInitSuccessMessage,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport { login } from './auth/login';\nimport { initChromeExtension } from './initChromeExtension';\nimport { initInfra } from './initInfra';\nimport { initMCP } from './initMCP';\nimport { initSkills } from './initSkills';\nimport { loadPrompts } from './loadPrompts';\nimport { isInteractiveTerminal } from './utils/isInteractiveTerminal';\nimport { parseChoice } from './utils/parseChoice';\n\nexport const findProjectRoot = (startDir: string) => {\n let currentDir = startDir;\n\n while (currentDir !== resolve(currentDir, '..')) {\n if (existsSync(join(currentDir, 'package.json'))) {\n return currentDir;\n }\n currentDir = resolve(currentDir, '..');\n }\n\n // If no package.json is found, return the start directory.\n // The initIntlayer function will handle the missing package.json error.\n return startDir;\n};\n\n/** Resolves the project root from `--project-root`, else the working directory. */\nexport const resolveProjectRoot = (projectRoot?: string): string =>\n findProjectRoot(projectRoot ? resolve(projectRoot) : process.cwd());\n\n/** Individually selectable setup steps exposed by the interactive init flow. */\nexport type InitStep =\n | 'packages'\n | 'githubActions'\n | 'projectSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'eslint'\n | 'skills'\n | 'mcp'\n | 'infra'\n | 'cms'\n | 'chromeExtension';\n\n/** A checkbox entry of the interactive init flow. */\nexport type InitStepOption = {\n value: InitStep;\n label: string;\n hint: string;\n};\n\n/**\n * Steps shown but not pre-selected. The infrastructure installer touches the\n * machine (downloads an app, pulls Docker images) and browser extensions open external URLs\n * rather than modifying the project, so they must be an explicit choice.\n */\nexport const OPT_IN_INIT_STEPS: InitStep[] = ['infra', 'chromeExtension'];\n\n/**\n * Steps run by `intlayer init` without `--interactive`: install the packages\n * and set up the framework. Every other step has its own command\n * ({@link INIT_STEP_COMMANDS}), so nothing outside the app code is touched\n * unless asked for.\n */\nexport const DEFAULT_INIT_STEPS: InitStep[] = ['packages', 'projectSetup'];\n\n/**\n * Command running each interactive step on its own, without prompts when every\n * value is passed as a flag. Printed when `--interactive` has no terminal.\n */\nexport const INIT_STEP_COMMANDS: Record<InitStep, string> = {\n packages: 'intlayer init packages',\n projectSetup: 'intlayer init project [--routing <routing>]',\n githubActions: 'intlayer init github-actions',\n vscodeExtension: 'intlayer init vscode-extension',\n eslint: 'intlayer init eslint',\n chromeExtension: 'intlayer init extension [--browser <chrome|firefox>]',\n skills: 'intlayer init skills [--platform <platform>] [--skills <skills...>]',\n mcp: 'intlayer init mcp [--platform <platform>] [--transport <stdio|sse>]',\n lsp: 'intlayer init lsp',\n cms: 'intlayer init cms',\n infra: 'intlayer init infra --mode <desktop|docker|compose>',\n};\n\n/**\n * Maps setup steps to the {@link initIntlayer} options: every step handled by\n * `initIntlayer` that is not listed is skipped. Explicit `--no-*` flags in\n * `baseOptions` still win over a listed step.\n */\nexport const getInitOptionsForSteps = (\n steps: InitStep[],\n baseOptions?: InitOptions\n): InitOptions => ({\n ...baseOptions,\n noInstallPackages:\n baseOptions?.noInstallPackages || !steps.includes('packages'),\n // The `.gitignore` entry is tied to project setup.\n noGitignore: baseOptions?.noGitignore || !steps.includes('projectSetup'),\n noGithubActions:\n baseOptions?.noGithubActions || !steps.includes('githubActions'),\n noFrameworkSetup:\n baseOptions?.noFrameworkSetup || !steps.includes('projectSetup'),\n noVscodeExtension:\n baseOptions?.noVscodeExtension || !steps.includes('vscodeExtension'),\n noLsp: baseOptions?.noLsp || !steps.includes('lsp'),\n noEslint: baseOptions?.noEslint || !steps.includes('eslint'),\n // The documentation link only matters once the project itself is set up.\n skipFinalMessage:\n baseOptions?.skipFinalMessage || !steps.includes('projectSetup'),\n});\n\n/**\n * Runs the given {@link initIntlayer} steps only (packages, project setup, CI,\n * VS Code extension, LSP, lint rules). Backs `intlayer init` and its\n * single-step subcommands.\n */\nexport const initSteps = async (\n projectRoot: string | undefined,\n steps: InitStep[],\n options?: InitOptions\n): Promise<void> => {\n await initIntlayer(\n resolveProjectRoot(projectRoot),\n getInitOptionsForSteps(steps, options)\n );\n};\n\n/**\n * Logs in to the Intlayer CMS through the browser, then stores the access-key\n * credentials in `.env` and enables the editor in the config file.\n */\nexport const initCms = async (projectRoot?: string): Promise<void> => {\n const root = resolveProjectRoot(projectRoot);\n const p = await loadPrompts();\n\n p.log.info('Opening your browser to log in to the Intlayer CMS...');\n // `exitAfter: false` keeps the process alive so the flow can finish; the\n // credentials are persisted to `.env` and the editor enabled in the config.\n await login({\n exitAfter: false,\n onCredentials: (credentials) => setupCmsCredentials(root, credentials),\n });\n};\n\n/** Explains why `--interactive` cannot run, and what to run instead. */\nconst getNoTerminalMessage = (): string =>\n [\n '`intlayer init --interactive` needs a terminal to answer its prompts (none is attached, e.g. when run by an AI agent or in CI).',\n 'Run the steps directly instead:',\n ' intlayer init (installs the packages and sets up the framework)',\n ...Object.values(INIT_STEP_COMMANDS).map((command) => ` ${command}`),\n ].join('\\n');\n\n/** Grouped checkbox entries of the interactive init flow, in display order. */\nexport const INIT_STEP_GROUPS: Record<string, InitStepOption[]> = {\n Codebase: [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\n },\n {\n value: 'projectSetup',\n label: 'Project setup',\n hint: 'intlayer config, tsconfig, bundler plugin, middleware/proxy and providers in layout/page',\n },\n {\n value: 'githubActions',\n label: 'CI/CD (GitHub Actions)',\n hint: 'scaffold the fill and test workflows that run on every pull request (covers every project in a monorepo)',\n },\n ],\n DevTools: [\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'eslint',\n label: 'Lint rules (ESLint / oxlint)',\n hint: 'flag hardcoded text and dynamic calls the compiler cannot optimize',\n },\n {\n value: 'chromeExtension',\n label: 'Chrome extension',\n hint: 'for audit, debug and analysis purpose',\n },\n ],\n 'Coding assistant': [\n {\n value: 'skills',\n label: 'AI skills',\n hint: 'install the Intlayer documentation as agent skills',\n },\n {\n value: 'mcp',\n label: 'MCP server',\n hint: 'configure the Intlayer MCP server',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\n ],\n CMS: [\n {\n value: 'cms',\n label: 'CMS',\n hint: 'log in through your browser, then store the credentials in your .env',\n },\n {\n value: 'infra',\n label: 'Infrastructure (desktop app / self-hosting)',\n hint: 'install the desktop app, or self-host with Docker (all-in-one or Compose)',\n },\n ],\n};\n\n/**\n * Locale routing choice: a `routing.mode` served through the locale proxy, or\n * `none` to leave routing to the app (`no-prefix` with the proxy disabled).\n */\nexport type LocaleRoutingChoice = RoutingMode | 'none';\n\n/** Locale routing strategies offered by the interactive init flow. */\nconst ROUTING_OPTIONS: Array<{\n value: LocaleRoutingChoice;\n label: string;\n hint: string;\n}> = [\n {\n value: 'prefix-no-default',\n label: 'Prefix all except the default locale',\n hint: '/about, /fr/about (default)',\n },\n {\n value: 'prefix-all',\n label: 'Prefix all locales',\n hint: '/en/about, /fr/about',\n },\n {\n value: 'no-prefix',\n label: 'No locale in the URL',\n hint: '/about',\n },\n {\n value: 'search-params',\n label: 'Use a search parameter',\n hint: '/about?locale=fr',\n },\n {\n value: 'none',\n label: 'No locale routing',\n hint: 'no proxy, no locale route segment — handle the locale yourself',\n },\n];\n\n/** Locale routing choices accepted by `--routing`. */\nexport const LOCALE_ROUTING_CHOICES = ROUTING_OPTIONS.map(\n (option) => option.value\n);\n\n/** Validates a `--routing` value, throwing on an unknown choice. */\nexport const parseLocaleRoutingChoice = (value: string): LocaleRoutingChoice =>\n parseChoice(value, LOCALE_ROUTING_CHOICES, '--routing');\n\n/** Maps a routing choice to the init options it sets. */\nexport const getRoutingInitOptions = (\n choice: LocaleRoutingChoice\n): Pick<InitOptions, 'routingMode' | 'enableProxy'> =>\n choice === 'none'\n ? { routingMode: 'no-prefix', enableProxy: false }\n : { routingMode: choice, enableProxy: true };\n\n/** Known ESLint and oxlint configuration file names. */\nexport const ESLINT_CONFIG_FILES = [\n 'eslint.config.js',\n 'eslint.config.mjs',\n 'eslint.config.cjs',\n 'eslint.config.ts',\n 'eslint.config.mts',\n 'eslint.config.cts',\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n '.eslintrc',\n '.oxlintrc.json',\n];\n\n/**\n * Checks whether ESLint or a compatible linter (oxlint) is installed or\n * configured in the project.\n */\nexport const isEslintInstalled = (\n dependencies: Record<string, string>,\n root?: string\n): boolean => {\n if (hasLintTooling(dependencies)) return true;\n if (dependencies.eslint || dependencies.oxlint) return true;\n\n if (root) {\n return ESLINT_CONFIG_FILES.some((file) => existsSync(join(root, file)));\n }\n\n return false;\n};\n\n/**\n * Computes the initial setup steps selected by default in the interactive prompt.\n * Steps like infrastructure and browser extension require opt-in, while\n * eslint is preselected only if installed on the project.\n */\nexport const getInitialInitSteps = (\n dependencies: Record<string, string>,\n root?: string\n): InitStep[] => {\n const isEslintPresent = isEslintInstalled(dependencies, root);\n\n return Object.values(INIT_STEP_GROUPS)\n .flat()\n .map((option) => option.value)\n .filter((step) => {\n if (OPT_IN_INIT_STEPS.includes(step)) return false;\n if (step === 'eslint' && !isEslintPresent) return false;\n return true;\n });\n};\n\n/** Reads the merged dependencies of the project at `root`. */\nexport const getProjectDependencies = (\n root: string\n): Record<string, string> => {\n try {\n const packageJsonPath = join(root, 'package.json');\n if (!existsSync(packageJsonPath)) return {};\n const { dependencies = {}, devDependencies = {} } = JSON.parse(\n readFileSync(packageJsonPath, 'utf-8')\n );\n return { ...dependencies, ...devDependencies };\n } catch {\n return {};\n }\n};\n\n/**\n * Runs `init` in interactive mode: prompts the user with a checkbox of setup\n * steps, then forwards the selection to {@link initIntlayer} (packages, GitHub\n * Actions, VS Code extension, LSP) and runs the dedicated skills/MCP installers\n * for the steps that own their own prompts. The `.gitignore` entry is not\n * offered as a checkbox — it is always added (unless `--no-gitignore` is set).\n */\nconst runInteractiveInit = async (\n root: string,\n baseOptions?: InitOptions\n): Promise<void> => {\n const p = await loadPrompts();\n\n p.intro('Initialize Intlayer');\n\n const projectDependencies = getProjectDependencies(root);\n\n const selected = await p.groupMultiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: INIT_STEP_GROUPS,\n initialValues: getInitialInitSteps(projectDependencies, root),\n required: false,\n });\n\n if (p.isCancel(selected)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const steps = selected as InitStep[];\n\n // Compat i18n library detection — never asked, always derived from the\n // installed packages. `detectMissingIntlayerPackages` reads the very same\n // dependency map to schedule the compat adapter, the sync plugin and the\n // catalog template, so a project without any of those packages is simply set\n // up on Intlayer alone.\n const detectedCompatLibraries =\n detectCompatI18nLibraries(projectDependencies);\n const hasCompatLib = detectedCompatLibraries.length > 0;\n\n if (hasCompatLib) {\n p.log.info(\n `Detected existing i18n ${detectedCompatLibraries.length > 1 ? 'libraries' : 'library'}: ${detectedCompatLibraries.join(', ')} — the matching Intlayer compat adapter and catalog sync will be set up.`\n );\n }\n\n // Locale routing → `routing.mode` + `routing.enableProxy` in the config, and\n // the route segment the framework scaffolding creates. Only asked for web\n // frontends; projects without URL routing (backend, React Native / Expo) keep\n // only `routing.storage` in a freshly created config. Skipped for compat\n // i18n libraries, which keep their own routing.\n let routingOptions: Pick<InitOptions, 'routingMode' | 'enableProxy'> = {};\n\n if (\n steps.includes('projectSetup') &&\n baseOptions?.routingMode === undefined &&\n !hasCompatLib &&\n hasUrlRoutingFramework(projectDependencies)\n ) {\n const selectedRouting = await p.select<LocaleRoutingChoice>({\n message: 'How should the locale appear in your URLs?',\n options: ROUTING_OPTIONS,\n initialValue: 'prefix-no-default',\n });\n\n if (p.isCancel(selectedRouting)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n routingOptions = getRoutingInitOptions(selectedRouting);\n }\n\n const options: InitOptions = {\n ...getInitOptionsForSteps(steps, { ...baseOptions, ...routingOptions }),\n skipFinalMessage: true,\n };\n\n const { guideUrl } = await initIntlayer(root, options);\n\n // Skills ask for the platform after the skill selection; MCP reuses it.\n const skillsPlatform = steps.includes('skills')\n ? await initSkills(root)\n : undefined;\n\n if (steps.includes('mcp')) {\n await initMCP(root, { platform: skillsPlatform });\n }\n\n // Delegated to the hosted install script, which owns its own menu.\n if (steps.includes('infra')) {\n await initInfra();\n }\n\n if (steps.includes('chromeExtension')) {\n await initChromeExtension();\n }\n\n // CMS / visual editor runs last: the browser login persists the access-key\n // credentials to `.env` and enables the editor in the config file. Kept last\n // so the browser flow does not interrupt setup.\n if (steps.includes('cms')) {\n await initCms(root);\n }\n\n p.outro('Intlayer initialization complete');\n\n if (guideUrl) {\n logInitSuccessMessage(guideUrl);\n }\n};\n\n/**\n * `intlayer init`: installs the packages and sets up the framework, or, with\n * `interactive`, lets the user pick every setup step. `--interactive` needs a\n * terminal; without one it fails and lists the single-step commands instead.\n */\nexport const init = async (\n projectRoot?: string,\n options?: InitOptions,\n interactive?: boolean\n) => {\n if (!interactive) {\n await initSteps(projectRoot, DEFAULT_INIT_STEPS, options);\n return;\n }\n\n if (!isInteractiveTerminal()) {\n const p = await loadPrompts();\n\n p.log.error(getNoTerminalMessage());\n process.exitC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C;CACpE,MAAM,OAAO,mBAAmB,WAAW;CAG3C,OAFgB,YAAY,EAE3B,CAAC,IAAI,KAAK,uDAAuD;CAGlE,MAAM,MAAM;EACV,WAAW;EACX,gBAAgB,gBAAgB,oBAAoB,MAAM,WAAW;CACvE,CAAC;AACH;;AAGA,MAAM,6BACJ;CACE;CACA;CACA;CACA,GAAG,OAAO,OAAO,kBAAkB,CAAC,CAAC,KAAK,YAAY,KAAK,SAAS;AACtE,CAAC,CAAC,KAAK,IAAI;;AAGb,MAAa,mBAAqD;CAChE,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,oBAAoB;EAClB;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,KAAK,CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,GACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR,CACF;AACF;;AASA,MAAM,kBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;AACF;;AAGA,MAAa,yBAAyB,gBAAgB,KACnD,WAAW,OAAO,KACrB;;AAGA,MAAa,4BAA4B,UACvC,YAAY,OAAO,wBAAwB,WAAW;;AAGxD,MAAa,yBACX,WA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AAU,aAAa,oBAAoB,OAAO;EACxD;CACF;CAEA,IAAI,CAAC,sBAAsB,GAAG;EAG5B,OAFgB,YAAY,EAE3B,CAAC,IAAI,MAAM,qBAAqB,CAAC;EAClC,QAAQ,WAAW;EACnB;CACF;CAEA,MAAM,mBAAmB,mBAAmB,WAAW,GAAG,OAAO;AACnE"}
1
+ {"version":3,"file":"init.mjs","names":[],"sources":["../../src/init.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport {\n CATALOG_MESSAGE_FORMATS,\n type CatalogMessageFormat,\n CONTENT_FORMATS_BY_LAYOUT,\n type ContentFormat,\n type ContentLayout,\n detectCompatI18nLibraries,\n hasLintTooling,\n hasUrlRoutingFramework,\n type InitOptions,\n initIntlayer,\n logInitSuccessMessage,\n type RoutingMode,\n setupCmsCredentials,\n} from '@intlayer/engine/cli';\nimport { login } from './auth/login';\nimport { setupRepository } from './auth/setupRepository';\nimport { initChromeExtension } from './initChromeExtension';\nimport { initInfra } from './initInfra';\nimport { initMCP } from './initMCP';\nimport { initSkills } from './initSkills';\nimport { loadPrompts } from './loadPrompts';\nimport { detectGitRepository } from './utils/detectGitRepository';\nimport { isInteractiveTerminal } from './utils/isInteractiveTerminal';\nimport { parseChoice } from './utils/parseChoice';\n\nexport const findProjectRoot = (startDir: string) => {\n let currentDir = startDir;\n\n while (currentDir !== resolve(currentDir, '..')) {\n if (existsSync(join(currentDir, 'package.json'))) {\n return currentDir;\n }\n currentDir = resolve(currentDir, '..');\n }\n\n // If no package.json is found, return the start directory.\n // The initIntlayer function will handle the missing package.json error.\n return startDir;\n};\n\n/** Resolves the project root from `--project-root`, else the working directory. */\nexport const resolveProjectRoot = (projectRoot?: string): string =>\n findProjectRoot(projectRoot ? resolve(projectRoot) : process.cwd());\n\n/** Individually selectable setup steps exposed by the interactive init flow. */\nexport type InitStep =\n | 'packages'\n | 'githubActions'\n | 'projectSetup'\n | 'vscodeExtension'\n | 'lsp'\n | 'eslint'\n | 'skills'\n | 'mcp'\n | 'infra'\n | 'cms'\n | 'repository'\n | 'chromeExtension';\n\n/** A checkbox entry of the interactive init flow. */\nexport type InitStepOption = {\n value: InitStep;\n label: string;\n hint: string;\n};\n\n/**\n * Steps shown but not pre-selected. The infrastructure installer touches the\n * machine (downloads an app, pulls Docker images) and browser extensions open external URLs\n * rather than modifying the project, so they must be an explicit choice.\n */\nexport const OPT_IN_INIT_STEPS: InitStep[] = ['infra', 'chromeExtension'];\n\n/**\n * Steps run by `intlayer init` without `--interactive`: install the packages\n * and set up the framework. Every other step has its own command\n * ({@link INIT_STEP_COMMANDS}), so nothing outside the app code is touched\n * unless asked for.\n */\nexport const DEFAULT_INIT_STEPS: InitStep[] = ['packages', 'projectSetup'];\n\n/**\n * Command running each interactive step on its own, without prompts when every\n * value is passed as a flag. Printed when `--interactive` has no terminal.\n */\nexport const INIT_STEP_COMMANDS: Record<InitStep, string> = {\n packages: 'intlayer init packages',\n projectSetup:\n 'intlayer init project [--routing <routing>] [--content <layout>] [--content-format <format>] [--message-format <format>]',\n githubActions: 'intlayer init github-actions',\n vscodeExtension: 'intlayer init vscode-extension',\n eslint: 'intlayer init eslint',\n chromeExtension: 'intlayer init extension [--browser <chrome|firefox>]',\n skills: 'intlayer init skills [--platform <platform>] [--skills <skills...>]',\n mcp: 'intlayer init mcp [--platform <platform>] [--transport <stdio|sse>]',\n lsp: 'intlayer init lsp',\n cms: 'intlayer init cms',\n repository: 'intlayer init repository',\n infra: 'intlayer init infra --mode <desktop|docker|compose>',\n};\n\n/**\n * Maps setup steps to the {@link initIntlayer} options: every step handled by\n * `initIntlayer` that is not listed is skipped. Explicit `--no-*` flags in\n * `baseOptions` still win over a listed step.\n */\nexport const getInitOptionsForSteps = (\n steps: InitStep[],\n baseOptions?: InitOptions\n): InitOptions => ({\n ...baseOptions,\n noInstallPackages:\n baseOptions?.noInstallPackages || !steps.includes('packages'),\n // The `.gitignore` entry is tied to project setup.\n noGitignore: baseOptions?.noGitignore || !steps.includes('projectSetup'),\n noGithubActions:\n baseOptions?.noGithubActions || !steps.includes('githubActions'),\n noFrameworkSetup:\n baseOptions?.noFrameworkSetup || !steps.includes('projectSetup'),\n noVscodeExtension:\n baseOptions?.noVscodeExtension || !steps.includes('vscodeExtension'),\n noLsp: baseOptions?.noLsp || !steps.includes('lsp'),\n noEslint: baseOptions?.noEslint || !steps.includes('eslint'),\n // The documentation link only matters once the project itself is set up.\n skipFinalMessage:\n baseOptions?.skipFinalMessage || !steps.includes('projectSetup'),\n});\n\n/**\n * Runs the given {@link initIntlayer} steps only (packages, project setup, CI,\n * VS Code extension, LSP, lint rules). Backs `intlayer init` and its\n * single-step subcommands.\n */\nexport const initSteps = async (\n projectRoot: string | undefined,\n steps: InitStep[],\n options?: InitOptions\n): Promise<void> => {\n await initIntlayer(\n resolveProjectRoot(projectRoot),\n getInitOptionsForSteps(steps, options)\n );\n};\n\n/**\n * Logs in to the Intlayer CMS through the browser, then stores the access-key\n * credentials in `.env` and enables the editor in the config file.\n */\nexport const initCms = async (projectRoot?: string): Promise<void> => {\n const root = resolveProjectRoot(projectRoot);\n const p = await loadPrompts();\n\n p.log.info('Opening your browser to log in to the Intlayer CMS...');\n // `exitAfter: false` keeps the process alive so the flow can finish; the\n // credentials are persisted to `.env` and the editor enabled in the config.\n await login({\n exitAfter: false,\n onCredentials: (credentials) => setupCmsCredentials(root, credentials),\n });\n};\n\n/**\n * Connects the git repository of the project to its CMS project (and sets\n * its build settings) in the browser, pre-filled with the `origin` remote.\n */\nexport const initRepository = async (projectRoot?: string): Promise<void> => {\n const root = resolveProjectRoot(projectRoot);\n const p = await loadPrompts();\n const detectedRepository = detectGitRepository(root);\n\n p.log.info(\n detectedRepository\n ? `Detected repository: ${detectedRepository.provider} ${detectedRepository.owner}/${detectedRepository.repository}`\n : 'No supported git remote detected: pick the repository in the browser.'\n );\n p.log.info('Opening your browser to connect the repository...');\n\n await setupRepository({ detectedRepository });\n};\n\n/** Explains why `--interactive` cannot run, and what to run instead. */\nconst getNoTerminalMessage = (): string =>\n [\n '`intlayer init --interactive` needs a terminal to answer its prompts (none is attached, e.g. when run by an AI agent or in CI).',\n 'Run the steps directly instead:',\n ' intlayer init (installs the packages and sets up the framework)',\n ...Object.values(INIT_STEP_COMMANDS).map((command) => ` ${command}`),\n ].join('\\n');\n\n/** Grouped checkbox entries of the interactive init flow, in display order. */\nexport const INIT_STEP_GROUPS: Record<string, InitStepOption[]> = {\n Codebase: [\n {\n value: 'packages',\n label: 'Install & upgrade packages',\n hint: 'install missing Intlayer dependencies and upgrade outdated ones',\n },\n {\n value: 'projectSetup',\n label: 'Project setup',\n hint: 'intlayer config, tsconfig, bundler plugin, middleware/proxy and providers in layout/page',\n },\n {\n value: 'githubActions',\n label: 'CI/CD (GitHub Actions)',\n hint: 'scaffold the fill and test workflows that run on every pull request (covers every project in a monorepo)',\n },\n ],\n DevTools: [\n {\n value: 'vscodeExtension',\n label: 'VS Code extension',\n hint: 'recommend the Intlayer extension',\n },\n {\n value: 'eslint',\n label: 'Lint rules (ESLint / oxlint)',\n hint: 'flag hardcoded text and dynamic calls the compiler cannot optimize',\n },\n {\n value: 'chromeExtension',\n label: 'Chrome extension',\n hint: 'for audit, debug and analysis purpose',\n },\n ],\n 'Coding assistant': [\n {\n value: 'skills',\n label: 'AI skills',\n hint: 'install the Intlayer documentation as agent skills',\n },\n {\n value: 'mcp',\n label: 'MCP server',\n hint: 'configure the Intlayer MCP server',\n },\n {\n value: 'lsp',\n label: 'Editor LSP',\n hint: 'go-to-definition from keys to .content files',\n },\n ],\n CMS: [\n {\n value: 'cms',\n label: 'CMS',\n hint: 'log in through your browser, then store the credentials in your .env',\n },\n {\n value: 'repository',\n label: 'Git repository',\n hint: 'connect the git repository to the CMS project and set its build settings (GitHub, GitLab, Bitbucket, Codeberg, Gitee)',\n },\n {\n value: 'infra',\n label: 'Infrastructure (desktop app / self-hosting)',\n hint: 'install the desktop app, or self-host with Docker (all-in-one or Compose)',\n },\n ],\n};\n\n/**\n * Locale routing choice: a `routing.mode` served through the locale proxy, or\n * `none` to leave routing to the app (`no-prefix` with the proxy disabled).\n */\nexport type LocaleRoutingChoice = RoutingMode | 'none';\n\n/** Locale routing strategies offered by the interactive init flow. */\nconst ROUTING_OPTIONS: Array<{\n value: LocaleRoutingChoice;\n label: string;\n hint: string;\n}> = [\n {\n value: 'prefix-no-default',\n label: 'Prefix all except the default locale',\n hint: '/about, /fr/about (default)',\n },\n {\n value: 'prefix-all',\n label: 'Prefix all locales',\n hint: '/en/about, /fr/about',\n },\n {\n value: 'no-prefix',\n label: 'No locale in the URL',\n hint: '/about',\n },\n {\n value: 'search-params',\n label: 'Use a search parameter',\n hint: '/about?locale=fr',\n },\n {\n value: 'none',\n label: 'No locale routing',\n hint: 'no proxy, no locale route segment — handle the locale yourself',\n },\n];\n\n/** Locale routing choices accepted by `--routing`. */\nexport const LOCALE_ROUTING_CHOICES = ROUTING_OPTIONS.map(\n (option) => option.value\n);\n\n/** Validates a `--routing` value, throwing on an unknown choice. */\nexport const parseLocaleRoutingChoice = (value: string): LocaleRoutingChoice =>\n parseChoice(value, LOCALE_ROUTING_CHOICES, '--routing');\n\n/** Maps a routing choice to the init options it sets. */\nexport const getRoutingInitOptions = (\n choice: LocaleRoutingChoice\n): Pick<InitOptions, 'routingMode' | 'enableProxy'> =>\n choice === 'none'\n ? { routingMode: 'no-prefix', enableProxy: false }\n : { routingMode: choice, enableProxy: true };\n\n/** Content declaration layouts offered by the interactive init flow. */\nconst CONTENT_LAYOUT_OPTIONS: Array<{\n value: ContentLayout;\n label: string;\n hint: string;\n}> = [\n {\n value: 'multilingual',\n label: 'Multilingual content declaration',\n hint: '/**/{fileName}.content.{ts,json} — every locale in one file',\n },\n {\n value: 'per-locale',\n label: 'Per-locale content declaration',\n hint: '/**/{fileName}.{locale}.content.{ts,json}',\n },\n {\n value: 'centralized',\n label: 'Centralized',\n hint: '/locales/{locale}.{json,po}',\n },\n {\n value: 'namespaces',\n label: 'Namespaces',\n hint: '/locales/{locale}/{namespace}.{json,po}',\n },\n];\n\n/** Labels of the content formats offered by the interactive init flow. */\nconst CONTENT_FORMAT_LABELS: Record<ContentFormat, string> = {\n ts: 'TypeScript (.ts)',\n json: 'JSON (.json)',\n po: 'Gettext (.po)',\n};\n\n/** Labels of the JSON catalog message formats, in display order. */\nconst CATALOG_MESSAGE_FORMAT_OPTIONS: Record<\n CatalogMessageFormat,\n { label: string; hint: string }\n> = {\n icu: { label: 'ICU', hint: '{count, plural, one {# item} other {# items}}' },\n i18next: { label: 'i18next', hint: '{{count}} item, key_one / key_other' },\n 'vue-i18n': { label: 'vue-i18n', hint: '{count} item | {count} items' },\n intlayer: { label: 'Intlayer', hint: 'Intlayer dictionary content' },\n};\n\n/** Content layouts accepted by `--content`. */\nexport const CONTENT_LAYOUT_CHOICES = CONTENT_LAYOUT_OPTIONS.map(\n (option) => option.value\n);\n\n/** Validates a `--content` value, throwing on an unknown layout. */\nexport const parseContentLayoutChoice = (value: string): ContentLayout =>\n parseChoice(value, CONTENT_LAYOUT_CHOICES, '--content');\n\n/** Init options set by the content layout questions / flags. */\ntype ContentInitOptions = Pick<\n InitOptions,\n 'contentLayout' | 'contentFormat' | 'contentMessageFormat'\n>;\n\n/** Whether a layout + format pair produces a JSON catalog (sync plugin). */\nconst isJsonCatalog = (layout: ContentLayout, format: ContentFormat): boolean =>\n (layout === 'centralized' || layout === 'namespaces') && format === 'json';\n\n/**\n * Validates `--content` / `--content-format` / `--message-format` and maps\n * them to the init options. The format must be one the layout accepts, and the\n * message format only applies to JSON catalogs.\n */\nexport const getContentInitOptions = (\n layoutValue?: string,\n formatValue?: string,\n messageFormatValue?: string\n): ContentInitOptions => {\n if (!layoutValue) {\n if (formatValue || messageFormatValue) {\n throw new Error(\n '--content-format and --message-format require --content.'\n );\n }\n return {};\n }\n\n const contentLayout = parseContentLayoutChoice(layoutValue);\n const contentFormat = formatValue\n ? parseChoice(\n formatValue,\n CONTENT_FORMATS_BY_LAYOUT[contentLayout],\n '--content-format'\n )\n : undefined;\n\n if (!messageFormatValue) return { contentLayout, contentFormat };\n\n // Catalog layouts default to JSON.\n if (!isJsonCatalog(contentLayout, contentFormat ?? 'json')) {\n throw new Error(\n '--message-format only applies to JSON catalogs (--content centralized | namespaces with json).'\n );\n }\n\n return {\n contentLayout,\n contentFormat,\n contentMessageFormat: parseChoice(\n messageFormatValue,\n CATALOG_MESSAGE_FORMATS,\n '--message-format'\n ),\n };\n};\n\n/** Known ESLint and oxlint configuration file names. */\nexport const ESLINT_CONFIG_FILES = [\n 'eslint.config.js',\n 'eslint.config.mjs',\n 'eslint.config.cjs',\n 'eslint.config.ts',\n 'eslint.config.mts',\n 'eslint.config.cts',\n '.eslintrc.js',\n '.eslintrc.cjs',\n '.eslintrc.yaml',\n '.eslintrc.yml',\n '.eslintrc.json',\n '.eslintrc',\n '.oxlintrc.json',\n];\n\n/**\n * Checks whether ESLint or a compatible linter (oxlint) is installed or\n * configured in the project.\n */\nexport const isEslintInstalled = (\n dependencies: Record<string, string>,\n root?: string\n): boolean => {\n if (hasLintTooling(dependencies)) return true;\n if (dependencies.eslint || dependencies.oxlint) return true;\n\n if (root) {\n return ESLINT_CONFIG_FILES.some((file) => existsSync(join(root, file)));\n }\n\n return false;\n};\n\n/**\n * Computes the initial setup steps selected by default in the interactive prompt.\n * Steps like infrastructure and browser extension require opt-in, while\n * eslint is preselected only if installed on the project.\n */\nexport const getInitialInitSteps = (\n dependencies: Record<string, string>,\n root?: string\n): InitStep[] => {\n const isEslintPresent = isEslintInstalled(dependencies, root);\n\n return Object.values(INIT_STEP_GROUPS)\n .flat()\n .map((option) => option.value)\n .filter((step) => {\n if (OPT_IN_INIT_STEPS.includes(step)) return false;\n if (step === 'eslint' && !isEslintPresent) return false;\n return true;\n });\n};\n\n/** Reads the merged dependencies of the project at `root`. */\nexport const getProjectDependencies = (\n root: string\n): Record<string, string> => {\n try {\n const packageJsonPath = join(root, 'package.json');\n if (!existsSync(packageJsonPath)) return {};\n const { dependencies = {}, devDependencies = {} } = JSON.parse(\n readFileSync(packageJsonPath, 'utf-8')\n );\n return { ...dependencies, ...devDependencies };\n } catch {\n return {};\n }\n};\n\n/**\n * Runs `init` in interactive mode: prompts the user with a checkbox of setup\n * steps, then forwards the selection to {@link initIntlayer} (packages, GitHub\n * Actions, VS Code extension, LSP) and runs the dedicated skills/MCP installers\n * for the steps that own their own prompts. The `.gitignore` entry is not\n * offered as a checkbox — it is always added (unless `--no-gitignore` is set).\n */\nconst runInteractiveInit = async (\n root: string,\n baseOptions?: InitOptions\n): Promise<void> => {\n const p = await loadPrompts();\n\n p.intro('Initialize Intlayer');\n\n const projectDependencies = getProjectDependencies(root);\n\n const selected = await p.groupMultiselect<InitStep>({\n message: 'Select what you want to set up:',\n options: INIT_STEP_GROUPS,\n initialValues: getInitialInitSteps(projectDependencies, root),\n required: false,\n });\n\n if (p.isCancel(selected)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const steps = selected as InitStep[];\n\n // Compat i18n library detection — never asked, always derived from the\n // installed packages. `detectMissingIntlayerPackages` reads the very same\n // dependency map to schedule the compat adapter, the sync plugin and the\n // catalog template, so a project without any of those packages is simply set\n // up on Intlayer alone.\n const detectedCompatLibraries =\n detectCompatI18nLibraries(projectDependencies);\n const hasCompatLib = detectedCompatLibraries.length > 0;\n\n if (hasCompatLib) {\n p.log.info(\n `Detected existing i18n ${detectedCompatLibraries.length > 1 ? 'libraries' : 'library'}: ${detectedCompatLibraries.join(', ')} — the matching Intlayer compat adapter and catalog sync will be set up.`\n );\n }\n\n // Locale routing → `routing.mode` + `routing.enableProxy` in the config, and\n // the route segment the framework scaffolding creates. Only asked for web\n // frontends; projects without URL routing (backend, React Native / Expo) keep\n // only `routing.storage` in a freshly created config. Skipped for compat\n // i18n libraries, which keep their own routing.\n let routingOptions: Pick<InitOptions, 'routingMode' | 'enableProxy'> = {};\n\n if (\n steps.includes('projectSetup') &&\n baseOptions?.routingMode === undefined &&\n !hasCompatLib &&\n hasUrlRoutingFramework(projectDependencies)\n ) {\n const selectedRouting = await p.select<LocaleRoutingChoice>({\n message: 'How should the locale appear in your URLs?',\n options: ROUTING_OPTIONS,\n initialValue: 'prefix-no-default',\n });\n\n if (p.isCancel(selectedRouting)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n routingOptions = getRoutingInitOptions(selectedRouting);\n }\n\n // Content layout → `compiler.output` (+ `dictionary.locale`) for `.content`\n // files, or the syncJSON / syncPO plugin for catalogs. Skipped for compat\n // i18n libraries, which keep their own catalogs.\n let contentOptions: ContentInitOptions = {};\n\n if (\n steps.includes('projectSetup') &&\n baseOptions?.contentLayout === undefined &&\n !hasCompatLib\n ) {\n const contentLayout = await p.select<ContentLayout>({\n message: 'How do you want to declare your content?',\n options: CONTENT_LAYOUT_OPTIONS,\n initialValue: 'multilingual',\n });\n\n if (p.isCancel(contentLayout)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n const acceptedFormats = CONTENT_FORMATS_BY_LAYOUT[contentLayout];\n const hasTypeScript = existsSync(join(root, 'tsconfig.json'));\n\n const contentFormat = await p.select<ContentFormat>({\n message: 'Which format for your content?',\n options: acceptedFormats.map((format) => ({\n value: format,\n label: CONTENT_FORMAT_LABELS[format],\n })),\n initialValue:\n acceptedFormats.includes('ts') && !hasTypeScript\n ? 'json'\n : acceptedFormats[0],\n });\n\n if (p.isCancel(contentFormat)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n contentOptions = { contentLayout, contentFormat };\n\n // JSON catalogs carry a message syntax (plurals, interpolation…).\n if (isJsonCatalog(contentLayout, contentFormat)) {\n const contentMessageFormat = await p.select<CatalogMessageFormat>({\n message: 'Which message format do your JSON catalogs use?',\n options: CATALOG_MESSAGE_FORMATS.map((messageFormat) => ({\n value: messageFormat,\n ...CATALOG_MESSAGE_FORMAT_OPTIONS[messageFormat],\n })),\n initialValue: CATALOG_MESSAGE_FORMATS[0],\n });\n\n if (p.isCancel(contentMessageFormat)) {\n p.cancel('Operation cancelled.');\n return;\n }\n\n contentOptions = { ...contentOptions, contentMessageFormat };\n }\n }\n\n const options: InitOptions = {\n ...getInitOptionsForSteps(steps, {\n ...baseOptions,\n ...routingOptions,\n ...contentOptions,\n }),\n skipFinalMessage: true,\n };\n\n const { guideUrl } = await initIntlayer(root, options);\n\n // Skills ask for the platform after the skill selection; MCP reuses it.\n const skillsPlatform = steps.includes('skills')\n ? await initSkills(root)\n : undefined;\n\n if (steps.includes('mcp')) {\n await initMCP(root, { platform: skillsPlatform });\n }\n\n // Delegated to the hosted install script, which owns its own menu.\n if (steps.includes('infra')) {\n await initInfra();\n }\n\n if (steps.includes('chromeExtension')) {\n await initChromeExtension();\n }\n\n // CMS / visual editor runs last: the browser login persists the access-key\n // credentials to `.env` and enables the editor in the config file. Kept last\n // so the browser flow does not interrupt setup.\n if (steps.includes('cms')) {\n await initCms(root);\n }\n\n // After the CMS login, so the browser is already signed in\n if (steps.includes('repository')) {\n await initRepository(root);\n }\n\n p.outro('Intlayer initialization complete');\n\n if (guideUrl) {\n logInitSuccessMessage(guideUrl);\n }\n};\n\n/**\n * `intlayer init`: installs the packages and sets up the framework, or, with\n * `interactive`, lets the user pick every setup step. `--interactive` needs a\n * terminal; without one it fails and lists the single-step commands instead.\n */\nexport const init = async (\n projectRoot?: string,\n options?: InitOptions,\n interactive?: boolean\n) => {\n if (!interactive) {\n await initSteps(projectRoot, DEFAULT_INIT_STEPS, options);\n return;\n }\n\n if (!isInteractiveTerminal()) {\n const p = await loadPrompts();\n\n p.log.error(getNoTerminalMessage());\n process.exitCode = 1;\n return;\n }\n\n await runInteractiveInit(resolveProjectRoot(projectRoot), options);\n};\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;CAEjB,OAAO,eAAe,QAAQ,YAAY,IAAI,GAAG;EAC/C,IAAI,WAAW,KAAK,YAAY,cAAc,CAAC,GAC7C,OAAO;EAET,aAAa,QAAQ,YAAY,I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WAAW;CAC3C,MAAM,IAAI,MAAM,YAAY;CAC5B,MAAM,qBAAqB,oBAAoB,IAAI;CAEnD,EAAE,IAAI,KACJ,qBACI,wBAAwB,mBAAmB,SAAS,GAAG,mBAAmB,MAAM,GAAG,mBAAmB,eACtG,uEACN;CACA,EAAE,IAAI,KAAK,mDAAmD;CAE9D,MAAM,gBAAgB,EAAE,mBAAmB,CAAC;AAC9C;;AAGA,MAAM,6BACJ;CACE;CACA;CACA;CACA,GAAG,OAAO,OAAO,kBAAkB,CAAC,CAAC,KAAK,YAAY,KAAK,SAAS;AACtE,CAAC,CAAC,KAAK,IAAI;;AAGb,MAAa,mBAAqD;CAChE,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,UAAU;EACR;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,oBAAoB;EAClB;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;CACA,KAAK;EACH;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;EACA;GACE,OAAO;GACP,OAAO;GACP,MAAM;EACR;CACF;AACF;;AASA,MAAM,kBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;AACF;;AAGA,MAAa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openBrowser } from "./utils/openBrowser.mjs";
2
1
  import { loadPrompts } from "./loadPrompts.mjs";
3
2
  import { isInteractiveTerminal } from "./utils/isInteractiveTerminal.mjs";
3
+ import { openBrowser } from "./utils/openBrowser.mjs";
4
4
  import { parseChoice } from "./utils/parseChoice.mjs";
5
5
 
6
- //#region src/initChromeExtension.ts
6
+ // src/initChromeExtension.ts
7
7
  const CHROME_EXTENSION_URL = "https://chromewebstore.google.com/detail/intlayer_i18n_scanner/pmlehcgmjmfimmjnembihbakhnheiabc";
8
8
  const MOZILLA_EXTENSION_URL = "https://addons.mozilla.org/en-US/firefox/addon/intlayer-i18n-scanner/";
9
9
  const BROWSER_EXTENSION_OPTIONS = [{
@@ -47,6 +47,5 @@ const initChromeExtension = async (options = {}) => {
47
47
  }
48
48
  };
49
49
 
50
- //#endregion
51
50
  export { BROWSER_EXTENSION_OPTIONS, CHROME_EXTENSION_URL, EXTENSION_BROWSERS, EXTENSION_URL_BY_BROWSER, MOZILLA_EXTENSION_URL, initChromeExtension, parseExtensionBrowsers };
52
51
  //# sourceMappingURL=initChromeExtension.mjs.map
@@ -5,7 +5,7 @@ import { spawn } from "node:child_process";
5
5
  import { tmpdir } from "node:os";
6
6
  import { mkdtemp, rm, writeFile } from "node:fs/promises";
7
7
 
8
- //#region src/initInfra.ts
8
+ // src/initInfra.ts
9
9
  /** Setup modes understood by the hosted installer. */
10
10
  const INFRA_MODES = [
11
11
  "desktop",
@@ -101,6 +101,5 @@ const initInfra = async (options = {}) => {
101
101
  }
102
102
  };
103
103
 
104
- //#endregion
105
104
  export { INFRA_MODES, INSTALL_SCRIPT_URL, INSTALL_SCRIPT_URL_WINDOWS, initInfra, parseInfraMode };
106
105
  //# sourceMappingURL=initInfra.mjs.map
@@ -1,11 +1,11 @@
1
+ import { resolveProjectRoot } from "./init.mjs";
2
+ import { promptPlatform, resolvePlatformWithoutPrompt } from "./initSkills.mjs";
1
3
  import { loadPrompts } from "./loadPrompts.mjs";
2
4
  import { isInteractiveTerminal } from "./utils/isInteractiveTerminal.mjs";
3
5
  import { parseChoice } from "./utils/parseChoice.mjs";
4
- import { promptPlatform, resolvePlatformWithoutPrompt } from "./initSkills.mjs";
5
- import { resolveProjectRoot } from "./init.mjs";
6
6
  import { MCP_TRANSPORTS, installMCP } from "@intlayer/engine/cli";
7
7
 
8
- //#region src/initMCP.ts
8
+ // src/initMCP.ts
9
9
  /** Validates a `--transport` value, ignoring case. */
10
10
  const parseMCPTransport = (value) => parseChoice(value, MCP_TRANSPORTS, "--transport");
11
11
  /**
@@ -53,6 +53,5 @@ const initMCP = async (projectRoot, options = {}) => {
53
53
  p.outro("Intlayer MCP Server initialization complete");
54
54
  };
55
55
 
56
- //#endregion
57
56
  export { initMCP, parseMCPTransport };
58
57
  //# sourceMappingURL=initMCP.mjs.map
@@ -1,11 +1,11 @@
1
+ import { getProjectDependencies, resolveProjectRoot } from "./init.mjs";
1
2
  import { loadPrompts } from "./loadPrompts.mjs";
2
3
  import { isInteractiveTerminal } from "./utils/isInteractiveTerminal.mjs";
3
4
  import { parseChoice } from "./utils/parseChoice.mjs";
4
- import { getProjectDependencies, resolveProjectRoot } from "./init.mjs";
5
5
  import { PLATFORMS, PLATFORMS_METADATA, SKILLS, SKILLS_METADATA, detectPlatform, getInitialSkills, installSkills } from "@intlayer/engine/cli";
6
6
  import enquirer from "enquirer";
7
7
 
8
- //#region src/initSkills.ts
8
+ // src/initSkills.ts
9
9
  const PLATFORM_OPTIONS = PLATFORMS.map((platform) => ({
10
10
  value: platform,
11
11
  label: PLATFORMS_METADATA[platform]?.label ?? "",
@@ -97,6 +97,5 @@ const initSkills = async (projectRoot, options = {}) => {
97
97
  return platform;
98
98
  };
99
99
 
100
- //#endregion
101
100
  export { PLATFORM_OPTIONS, initSkills, parsePlatform, parseSkills, promptPlatform, resolvePlatformWithoutPrompt };
102
101
  //# sourceMappingURL=initSkills.mjs.map
@@ -1,11 +1,11 @@
1
- import { prepareIntlayer } from "@intlayer/engine/cli";
2
- import { relative } from "node:path";
3
1
  import { colon, colorizeKey, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
4
2
  import { getConfiguration } from "@intlayer/config/node";
3
+ import { prepareIntlayer } from "@intlayer/engine/cli";
4
+ import { relative } from "node:path";
5
5
  import { formatPath } from "@intlayer/engine/utils";
6
6
  import { getUnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
7
7
 
8
- //#region src/listContentDeclaration.ts
8
+ // src/listContentDeclaration.ts
9
9
  const listContentDeclarationRows = async (options) => {
10
10
  const config = getConfiguration(options?.configOptions);
11
11
  await prepareIntlayer(config);
@@ -38,6 +38,5 @@ const listContentDeclaration = async (options) => {
38
38
  appLogger(`Total content declaration files: ${colorizeNumber(rows.length)}`);
39
39
  };
40
40
 
41
- //#endregion
42
41
  export { listContentDeclaration, listContentDeclarationRows };
43
42
  //# sourceMappingURL=listContentDeclaration.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { listProjects } from "@intlayer/engine/cli";
2
2
  import { relative } from "node:path";
3
3
 
4
- //#region src/listProjects.ts
4
+ // src/listProjects.ts
5
5
  const listProjectsCommand = async (options) => {
6
6
  const { searchDir, projectsPath } = await listProjects(options);
7
7
  const projectsRelativePath = projectsPath.map((projectPath) => options?.absolute ? projectPath : relative(searchDir, projectPath)).map((projectPath) => projectPath === "" ? "." : projectPath);
@@ -22,6 +22,5 @@ const listProjectsCommand = async (options) => {
22
22
  });
23
23
  };
24
24
 
25
- //#endregion
26
25
  export { listProjectsCommand };
27
26
  //# sourceMappingURL=listProjects.mjs.map
@@ -1,8 +1,8 @@
1
1
  import { IntlayerEventListener } from "./IntlayerEventListener.mjs";
2
- import { createServer } from "node:http";
3
2
  import * as ANSIColors from "@intlayer/config/colors";
4
3
  import { colorize, getAppLogger } from "@intlayer/config/logger";
5
4
  import { getConfiguration } from "@intlayer/config/node";
5
+ import { createServer } from "node:http";
6
6
  import { runParallel } from "@intlayer/engine/utils";
7
7
  import { getUnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
8
8
  import { buildDictionary } from "@intlayer/engine/build";
@@ -10,7 +10,7 @@ import { getLocalizedContent } from "@intlayer/core/plugins";
10
10
  import { getDictionaries } from "@intlayer/dictionaries-entry";
11
11
  import packageJson from "@intlayer/config/package.json" with { type: "json" };
12
12
 
13
- //#region src/liveSync.ts
13
+ // src/liveSync.ts
14
14
  const writeDictionary = async (dictionary, configuration) => {
15
15
  getAppLogger(configuration)(`Writing dictionary ${dictionary.key}`);
16
16
  await buildDictionary([dictionary], configuration);
@@ -158,6 +158,5 @@ const liveSync = async (options) => {
158
158
  process.on("exit", cleanup);
159
159
  };
160
160
 
161
- //#endregion
162
161
  export { liveSync };
163
162
  //# sourceMappingURL=liveSync.mjs.map