@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
package/dist/cjs/init.cjs CHANGED
@@ -1,17 +1,19 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_auth_login = require('./auth/login.cjs');
3
- const require_loadPrompts = require('./loadPrompts.cjs');
4
- const require_utils_isInteractiveTerminal = require('./utils/isInteractiveTerminal.cjs');
5
- const require_utils_parseChoice = require('./utils/parseChoice.cjs');
6
- const require_initChromeExtension = require('./initChromeExtension.cjs');
7
- const require_initInfra = require('./initInfra.cjs');
8
- const require_initSkills = require('./initSkills.cjs');
9
- const require_initMCP = require('./initMCP.cjs');
2
+ const require_auth_login = require("./auth/login.cjs");
3
+ const require_auth_setupRepository = require("./auth/setupRepository.cjs");
4
+ const require_initChromeExtension = require("./initChromeExtension.cjs");
5
+ const require_initInfra = require("./initInfra.cjs");
6
+ const require_initMCP = require("./initMCP.cjs");
7
+ const require_initSkills = require("./initSkills.cjs");
8
+ const require_loadPrompts = require("./loadPrompts.cjs");
9
+ const require_utils_detectGitRepository = require("./utils/detectGitRepository.cjs");
10
+ const require_utils_isInteractiveTerminal = require("./utils/isInteractiveTerminal.cjs");
11
+ const require_utils_parseChoice = require("./utils/parseChoice.cjs");
10
12
  let _intlayer_engine_cli = require("@intlayer/engine/cli");
11
- let node_fs = require("node:fs");
12
13
  let node_path = require("node:path");
14
+ let node_fs = require("node:fs");
13
15
 
14
- //#region src/init.ts
16
+ // src/init.ts
15
17
  const findProjectRoot = (startDir) => {
16
18
  let currentDir = startDir;
17
19
  while (currentDir !== (0, node_path.resolve)(currentDir, "..")) {
@@ -41,7 +43,7 @@ const DEFAULT_INIT_STEPS = ["packages", "projectSetup"];
41
43
  */
42
44
  const INIT_STEP_COMMANDS = {
43
45
  packages: "intlayer init packages",
44
- projectSetup: "intlayer init project [--routing <routing>]",
46
+ projectSetup: "intlayer init project [--routing <routing>] [--content <layout>] [--content-format <format>] [--message-format <format>]",
45
47
  githubActions: "intlayer init github-actions",
46
48
  vscodeExtension: "intlayer init vscode-extension",
47
49
  eslint: "intlayer init eslint",
@@ -50,6 +52,7 @@ const INIT_STEP_COMMANDS = {
50
52
  mcp: "intlayer init mcp [--platform <platform>] [--transport <stdio|sse>]",
51
53
  lsp: "intlayer init lsp",
52
54
  cms: "intlayer init cms",
55
+ repository: "intlayer init repository",
53
56
  infra: "intlayer init infra --mode <desktop|docker|compose>"
54
57
  };
55
58
  /**
@@ -88,6 +91,18 @@ const initCms = async (projectRoot) => {
88
91
  onCredentials: (credentials) => (0, _intlayer_engine_cli.setupCmsCredentials)(root, credentials)
89
92
  });
90
93
  };
94
+ /**
95
+ * Connects the git repository of the project to its CMS project (and sets
96
+ * its build settings) in the browser, pre-filled with the `origin` remote.
97
+ */
98
+ const initRepository = async (projectRoot) => {
99
+ const root = resolveProjectRoot(projectRoot);
100
+ const p = await require_loadPrompts.loadPrompts();
101
+ const detectedRepository = require_utils_detectGitRepository.detectGitRepository(root);
102
+ p.log.info(detectedRepository ? `Detected repository: ${detectedRepository.provider} ${detectedRepository.owner}/${detectedRepository.repository}` : "No supported git remote detected: pick the repository in the browser.");
103
+ p.log.info("Opening your browser to connect the repository...");
104
+ await require_auth_setupRepository.setupRepository({ detectedRepository });
105
+ };
91
106
  /** Explains why `--interactive` cannot run, and what to run instead. */
92
107
  const getNoTerminalMessage = () => [
93
108
  "`intlayer init --interactive` needs a terminal to answer its prompts (none is attached, e.g. when run by an AI agent or in CI).",
@@ -148,15 +163,23 @@ const INIT_STEP_GROUPS = {
148
163
  hint: "go-to-definition from keys to .content files"
149
164
  }
150
165
  ],
151
- CMS: [{
152
- value: "cms",
153
- label: "CMS",
154
- hint: "log in through your browser, then store the credentials in your .env"
155
- }, {
156
- value: "infra",
157
- label: "Infrastructure (desktop app / self-hosting)",
158
- hint: "install the desktop app, or self-host with Docker (all-in-one or Compose)"
159
- }]
166
+ CMS: [
167
+ {
168
+ value: "cms",
169
+ label: "CMS",
170
+ hint: "log in through your browser, then store the credentials in your .env"
171
+ },
172
+ {
173
+ value: "repository",
174
+ label: "Git repository",
175
+ hint: "connect the git repository to the CMS project and set its build settings (GitHub, GitLab, Bitbucket, Codeberg, Gitee)"
176
+ },
177
+ {
178
+ value: "infra",
179
+ label: "Infrastructure (desktop app / self-hosting)",
180
+ hint: "install the desktop app, or self-host with Docker (all-in-one or Compose)"
181
+ }
182
+ ]
160
183
  };
161
184
  /** Locale routing strategies offered by the interactive init flow. */
162
185
  const ROUTING_OPTIONS = [
@@ -198,6 +221,83 @@ const getRoutingInitOptions = (choice) => choice === "none" ? {
198
221
  routingMode: choice,
199
222
  enableProxy: true
200
223
  };
224
+ /** Content declaration layouts offered by the interactive init flow. */
225
+ const CONTENT_LAYOUT_OPTIONS = [
226
+ {
227
+ value: "multilingual",
228
+ label: "Multilingual content declaration",
229
+ hint: "/**/{fileName}.content.{ts,json} — every locale in one file"
230
+ },
231
+ {
232
+ value: "per-locale",
233
+ label: "Per-locale content declaration",
234
+ hint: "/**/{fileName}.{locale}.content.{ts,json}"
235
+ },
236
+ {
237
+ value: "centralized",
238
+ label: "Centralized",
239
+ hint: "/locales/{locale}.{json,po}"
240
+ },
241
+ {
242
+ value: "namespaces",
243
+ label: "Namespaces",
244
+ hint: "/locales/{locale}/{namespace}.{json,po}"
245
+ }
246
+ ];
247
+ /** Labels of the content formats offered by the interactive init flow. */
248
+ const CONTENT_FORMAT_LABELS = {
249
+ ts: "TypeScript (.ts)",
250
+ json: "JSON (.json)",
251
+ po: "Gettext (.po)"
252
+ };
253
+ /** Labels of the JSON catalog message formats, in display order. */
254
+ const CATALOG_MESSAGE_FORMAT_OPTIONS = {
255
+ icu: {
256
+ label: "ICU",
257
+ hint: "{count, plural, one {# item} other {# items}}"
258
+ },
259
+ i18next: {
260
+ label: "i18next",
261
+ hint: "{{count}} item, key_one / key_other"
262
+ },
263
+ "vue-i18n": {
264
+ label: "vue-i18n",
265
+ hint: "{count} item | {count} items"
266
+ },
267
+ intlayer: {
268
+ label: "Intlayer",
269
+ hint: "Intlayer dictionary content"
270
+ }
271
+ };
272
+ /** Content layouts accepted by `--content`. */
273
+ const CONTENT_LAYOUT_CHOICES = CONTENT_LAYOUT_OPTIONS.map((option) => option.value);
274
+ /** Validates a `--content` value, throwing on an unknown layout. */
275
+ const parseContentLayoutChoice = (value) => require_utils_parseChoice.parseChoice(value, CONTENT_LAYOUT_CHOICES, "--content");
276
+ /** Whether a layout + format pair produces a JSON catalog (sync plugin). */
277
+ const isJsonCatalog = (layout, format) => (layout === "centralized" || layout === "namespaces") && format === "json";
278
+ /**
279
+ * Validates `--content` / `--content-format` / `--message-format` and maps
280
+ * them to the init options. The format must be one the layout accepts, and the
281
+ * message format only applies to JSON catalogs.
282
+ */
283
+ const getContentInitOptions = (layoutValue, formatValue, messageFormatValue) => {
284
+ if (!layoutValue) {
285
+ if (formatValue || messageFormatValue) throw new Error("--content-format and --message-format require --content.");
286
+ return {};
287
+ }
288
+ const contentLayout = parseContentLayoutChoice(layoutValue);
289
+ const contentFormat = formatValue ? require_utils_parseChoice.parseChoice(formatValue, _intlayer_engine_cli.CONTENT_FORMATS_BY_LAYOUT[contentLayout], "--content-format") : void 0;
290
+ if (!messageFormatValue) return {
291
+ contentLayout,
292
+ contentFormat
293
+ };
294
+ if (!isJsonCatalog(contentLayout, contentFormat ?? "json")) throw new Error("--message-format only applies to JSON catalogs (--content centralized | namespaces with json).");
295
+ return {
296
+ contentLayout,
297
+ contentFormat,
298
+ contentMessageFormat: require_utils_parseChoice.parseChoice(messageFormatValue, _intlayer_engine_cli.CATALOG_MESSAGE_FORMATS, "--message-format")
299
+ };
300
+ };
201
301
  /** Known ESLint and oxlint configuration file names. */
202
302
  const ESLINT_CONFIG_FILES = [
203
303
  "eslint.config.js",
@@ -289,10 +389,59 @@ const runInteractiveInit = async (root, baseOptions) => {
289
389
  }
290
390
  routingOptions = getRoutingInitOptions(selectedRouting);
291
391
  }
392
+ let contentOptions = {};
393
+ if (steps.includes("projectSetup") && baseOptions?.contentLayout === void 0 && !hasCompatLib) {
394
+ const contentLayout = await p.select({
395
+ message: "How do you want to declare your content?",
396
+ options: CONTENT_LAYOUT_OPTIONS,
397
+ initialValue: "multilingual"
398
+ });
399
+ if (p.isCancel(contentLayout)) {
400
+ p.cancel("Operation cancelled.");
401
+ return;
402
+ }
403
+ const acceptedFormats = _intlayer_engine_cli.CONTENT_FORMATS_BY_LAYOUT[contentLayout];
404
+ const hasTypeScript = (0, node_fs.existsSync)((0, node_path.join)(root, "tsconfig.json"));
405
+ const contentFormat = await p.select({
406
+ message: "Which format for your content?",
407
+ options: acceptedFormats.map((format) => ({
408
+ value: format,
409
+ label: CONTENT_FORMAT_LABELS[format]
410
+ })),
411
+ initialValue: acceptedFormats.includes("ts") && !hasTypeScript ? "json" : acceptedFormats[0]
412
+ });
413
+ if (p.isCancel(contentFormat)) {
414
+ p.cancel("Operation cancelled.");
415
+ return;
416
+ }
417
+ contentOptions = {
418
+ contentLayout,
419
+ contentFormat
420
+ };
421
+ if (isJsonCatalog(contentLayout, contentFormat)) {
422
+ const contentMessageFormat = await p.select({
423
+ message: "Which message format do your JSON catalogs use?",
424
+ options: _intlayer_engine_cli.CATALOG_MESSAGE_FORMATS.map((messageFormat) => ({
425
+ value: messageFormat,
426
+ ...CATALOG_MESSAGE_FORMAT_OPTIONS[messageFormat]
427
+ })),
428
+ initialValue: _intlayer_engine_cli.CATALOG_MESSAGE_FORMATS[0]
429
+ });
430
+ if (p.isCancel(contentMessageFormat)) {
431
+ p.cancel("Operation cancelled.");
432
+ return;
433
+ }
434
+ contentOptions = {
435
+ ...contentOptions,
436
+ contentMessageFormat
437
+ };
438
+ }
439
+ }
292
440
  const options = {
293
441
  ...getInitOptionsForSteps(steps, {
294
442
  ...baseOptions,
295
- ...routingOptions
443
+ ...routingOptions,
444
+ ...contentOptions
296
445
  }),
297
446
  skipFinalMessage: true
298
447
  };
@@ -302,6 +451,7 @@ const runInteractiveInit = async (root, baseOptions) => {
302
451
  if (steps.includes("infra")) await require_initInfra.initInfra();
303
452
  if (steps.includes("chromeExtension")) await require_initChromeExtension.initChromeExtension();
304
453
  if (steps.includes("cms")) await initCms(root);
454
+ if (steps.includes("repository")) await initRepository(root);
305
455
  p.outro("Intlayer initialization complete");
306
456
  if (guideUrl) (0, _intlayer_engine_cli.logInitSuccessMessage)(guideUrl);
307
457
  };
@@ -323,7 +473,7 @@ const init = async (projectRoot, options, interactive) => {
323
473
  await runInteractiveInit(resolveProjectRoot(projectRoot), options);
324
474
  };
325
475
 
326
- //#endregion
476
+ exports.CONTENT_LAYOUT_CHOICES = CONTENT_LAYOUT_CHOICES;
327
477
  exports.DEFAULT_INIT_STEPS = DEFAULT_INIT_STEPS;
328
478
  exports.ESLINT_CONFIG_FILES = ESLINT_CONFIG_FILES;
329
479
  exports.INIT_STEP_COMMANDS = INIT_STEP_COMMANDS;
@@ -331,14 +481,17 @@ exports.INIT_STEP_GROUPS = INIT_STEP_GROUPS;
331
481
  exports.LOCALE_ROUTING_CHOICES = LOCALE_ROUTING_CHOICES;
332
482
  exports.OPT_IN_INIT_STEPS = OPT_IN_INIT_STEPS;
333
483
  exports.findProjectRoot = findProjectRoot;
484
+ exports.getContentInitOptions = getContentInitOptions;
334
485
  exports.getInitOptionsForSteps = getInitOptionsForSteps;
335
486
  exports.getInitialInitSteps = getInitialInitSteps;
336
487
  exports.getProjectDependencies = getProjectDependencies;
337
488
  exports.getRoutingInitOptions = getRoutingInitOptions;
338
489
  exports.init = init;
339
490
  exports.initCms = initCms;
491
+ exports.initRepository = initRepository;
340
492
  exports.initSteps = initSteps;
341
493
  exports.isEslintInstalled = isEslintInstalled;
494
+ exports.parseContentLayoutChoice = parseContentLayoutChoice;
342
495
  exports.parseLocaleRoutingChoice = parseLocaleRoutingChoice;
343
496
  exports.resolveProjectRoot = resolveProjectRoot;
344
497
  //# sourceMappingURL=init.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.cjs","names":["resolve","existsSync","join","initIntlayer","loadPrompts","login","setupCmsCredentials","parseChoice","hasLintTooling","readFileSync","detectCompatI18nLibraries","hasUrlRoutingFramework","initSkills","initMCP","initInfra","initChromeExtension","isInteractiveTerminal"],"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.exitCode = 1;\n return;\n }\n\n await runInteractiveInit(resolveProjectRoot(projectRoot), options);\n};\n"],"mappings":";;;;;;;;;;;;;;AAqBA,MAAa,mBAAmB,aAAqB;CACnD,IAAI,aAAa;CAEjB,OAAO,mBAAeA,mBAAQ,YAAY,IAAI,GAAG;EAC/C,QAAIC,wBAAWC,gBAAK,YAAY,cAAc,CAAC,GAC7C,OAAO;EAET,iBAAaF,mBAAQ,YAAY,IAAI;CACvC;CAIA,OAAO;AACT;;AAGA,MAAa,sBAAsB,gBACjC,gBAAgB,kBAAcA,mBAAQ,WAAW,IAAI,QAAQ,IAAI,CAAC;;;;;;AA4BpE,MAAa,oBAAgC,CAAC,SAAS,iBAAiB;;;;;;;AAQxE,MAAa,qBAAiC,CAAC,YAAY,cAAc;;;;;AAMzE,MAAa,qBAA+C;CAC1D,UAAU;CACV,cAAc;CACd,eAAe;CACf,iBAAiB;CACjB,QAAQ;CACR,iBAAiB;CACjB,QAAQ;CACR,KAAK;CACL,KAAK;CACL,KAAK;CACL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EA,iBAAiB,sBAAsB,eAAe;CACxD;CAEA,MAAM,UAAuB;EAC3B,GAAG,uBAAuB,OAAO;GAAE,GAAG;GAAa,GAAG;EAAe,CAAC;EACtE,kBAAkB;CACpB;CAEA,MAAM,EAAE,aAAa,UAAMR,mCAAa,MAAM,OAAO;CAGrD,MAAM,iBAAiB,MAAM,SAAS,QAAQ,IAC1C,MAAMS,8BAAW,IAAI,IACrB;CAEJ,IAAI,MAAM,SAAS,KAAK,GACtB,MAAMC,wBAAQ,MAAM,EAAE,UAAU,eAAe,CAAC;CAIlD,IAAI,MAAM,SAAS,OAAO,GACxB,MAAMC,4BAAU;CAGlB,IAAI,MAAM,SAAS,iBAAiB,GAClC,MAAMC,gDAAoB;CAM5B,IAAI,MAAM,SAAS,KAAK,GACtB,MAAM,QAAQ,IAAI;CAGpB,EAAE,MAAM,kCAAkC;CAE1C,IAAI,UACF,gDAAsB,QAAQ;AAElC;;;;;;AAOA,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,IAAI,CAAC,aAAa;EAChB,MAAM,UAAU,aAAa,oBAAoB,OAAO;EACxD;CACF;CAEA,IAAI,CAACC,0DAAsB,GAAG;EAG5B,OAFgBZ,gCAAY,EAE3B,CAAC,IAAI,MAAM,qBAAqB,CAAC;EAClC,QAAQ,WAAW;EACnB;CACF;CAEA,MAAM,mBAAmB,mBAAmB,WAAW,GAAG,OAAO;AACnE"}
1
+ {"version":3,"file":"init.cjs","names":["resolve","existsSync","join","initIntlayer","loadPrompts","login","setupCmsCredentials","detectGitRepository","setupRepository","parseChoice","CONTENT_FORMATS_BY_LAYOUT","CATALOG_MESSAGE_FORMATS","hasLintTooling","readFileSync","detectCompatI18nLibraries","hasUrlRoutingFramework","initSkills","initMCP","initInfra","initChromeExtension","isInteractiveTerminal"],"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,mBAAeA,mBAAQ,YAAY,IAAI,GAAG;EAC/C,QAAIC,wBAAWC,gBAAK,YAAY,cAAc,CAAC,GAC7C,OAAO;EAET,iBAAaF,mBAAQ,YAAY,IAAI;CACvC;CAIA,OAAO;AACT;;AAGA,MAAa,sBAAsB,gBACjC,gBAAgB,kBAAcA,mBAAQ,WAAW,IAAI,QAAQ,IAAI,CAAC;;;;;;AA6BpE,MAAa,oBAAgC,CAAC,SAAS,iBAAiB;;;;;;;AAQxE,MAAa,qBAAiC,CAAC,YAAY,cAAc;;;;;AAMzE,MAAa,qBAA+C;CAC1D,UAAU;CACV,cACE;CACF,eAAe;CACf,iBAAiB;CACjB,QAAQ;CACR,iBAAiB;CACjB,QAAQ;CACR,KAAK;CACL,KAAK;CACL,KA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AAK,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,yBAAyB,gBAAgB,KACnD,WAAW,OAAO,KACrB;;AAGA,MAAa,4BAA4B,UACvCC,sCAAY,OAAO,wBAAwB,WAAW;;AAGxD,MAAa,yBACX,WAEA,WAAW,SACP;CAAE,aAAa;CAAa,aAAa;AAAM,IAC/C;CAAE,aAAa;CAAQ,aAAa;AAAK;;AAG/C,MAAM,yBAID;CACH;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO;EACP,MAAM;CACR;CACA;EACE,OAAO;EACP,OAAO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B;EAC7D;CACF;CAEA,MAAM,UAAuB;EAC3B,GAAG,uBAAuB,OAAO;GAC/B,GAAG;GACH,GAAG;GACH,GAAG;EACL,CAAC;EACD,kBAAkB;CACpB;CAEA,MAAM,EAAE,aAAa,UAAMR,mCAAa,MAAM,OAAO;CAGrD,MAAM,iBAAiB,MAAM,SAAS,QAAQ,IAC1C,MAAMa,8BAAW,IAAI,IACrB;CAEJ,IAAI,MAAM,SAAS,KAAK,GACtB,MAAMC,wBAAQ,MAAM,EAAE,UAAU,eAAe,CAAC;CAIlD,IAAI,MAAM,SAAS,OAAO,GACxB,MAAMC,4BAAU;CAGlB,IAAI,MAAM,SAAS,iBAAiB,GAClC,MAAMC,gDAAoB;CAM5B,IAAI,MAAM,SAAS,KAAK,GACtB,MAAM,QAAQ,IAAI;CAIpB,IAAI,MAAM,SAAS,YAAY,GAC7B,MAAM,eAAe,IAAI;CAG3B,EAAE,MAAM,kCAAkC;CAE1C,IAAI,UACF,gDAAsB,QAAQ;AAElC;;;;;;AAOA,MAAa,OAAO,OAClB,aACA,SACA,gBACG;CACH,IAAI,CAAC,aAAa;EAChB,MAAM,UAAU,aAAa,oBAAoB,OAAO;EACxD;CACF;CAEA,IAAI,CAACC,0DAAsB,GAAG;EAG5B,OAFgBhB,gCAAY,EAE3B,CAAC,IAAI,MAAM,qBAAqB,CAAC;EAClC,QAAQ,WAAW;EACnB;CACF;CAEA,MAAM,mBAAmB,mBAAmB,WAAW,GAAG,OAAO;AACnE"}
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_utils_openBrowser = require('./utils/openBrowser.cjs');
3
- const require_loadPrompts = require('./loadPrompts.cjs');
4
- const require_utils_isInteractiveTerminal = require('./utils/isInteractiveTerminal.cjs');
5
- const require_utils_parseChoice = require('./utils/parseChoice.cjs');
2
+ const require_loadPrompts = require("./loadPrompts.cjs");
3
+ const require_utils_isInteractiveTerminal = require("./utils/isInteractiveTerminal.cjs");
4
+ const require_utils_openBrowser = require("./utils/openBrowser.cjs");
5
+ const require_utils_parseChoice = require("./utils/parseChoice.cjs");
6
6
 
7
- //#region src/initChromeExtension.ts
7
+ // src/initChromeExtension.ts
8
8
  const CHROME_EXTENSION_URL = "https://chromewebstore.google.com/detail/intlayer_i18n_scanner/pmlehcgmjmfimmjnembihbakhnheiabc";
9
9
  const MOZILLA_EXTENSION_URL = "https://addons.mozilla.org/en-US/firefox/addon/intlayer-i18n-scanner/";
10
10
  const BROWSER_EXTENSION_OPTIONS = [{
@@ -48,7 +48,6 @@ const initChromeExtension = async (options = {}) => {
48
48
  }
49
49
  };
50
50
 
51
- //#endregion
52
51
  exports.BROWSER_EXTENSION_OPTIONS = BROWSER_EXTENSION_OPTIONS;
53
52
  exports.CHROME_EXTENSION_URL = CHROME_EXTENSION_URL;
54
53
  exports.EXTENSION_BROWSERS = EXTENSION_BROWSERS;
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_loadPrompts = require('./loadPrompts.cjs');
3
- const require_utils_isInteractiveTerminal = require('./utils/isInteractiveTerminal.cjs');
2
+ const require_loadPrompts = require("./loadPrompts.cjs");
3
+ const require_utils_isInteractiveTerminal = require("./utils/isInteractiveTerminal.cjs");
4
4
  let node_path = require("node:path");
5
5
  let node_child_process = require("node:child_process");
6
6
  let node_os = require("node:os");
7
7
  let node_fs_promises = require("node:fs/promises");
8
8
 
9
- //#region src/initInfra.ts
9
+ // src/initInfra.ts
10
10
  /** Setup modes understood by the hosted installer. */
11
11
  const INFRA_MODES = [
12
12
  "desktop",
@@ -102,7 +102,6 @@ const initInfra = async (options = {}) => {
102
102
  }
103
103
  };
104
104
 
105
- //#endregion
106
105
  exports.INFRA_MODES = INFRA_MODES;
107
106
  exports.INSTALL_SCRIPT_URL = INSTALL_SCRIPT_URL;
108
107
  exports.INSTALL_SCRIPT_URL_WINDOWS = INSTALL_SCRIPT_URL_WINDOWS;
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_loadPrompts = require('./loadPrompts.cjs');
3
- const require_utils_isInteractiveTerminal = require('./utils/isInteractiveTerminal.cjs');
4
- const require_utils_parseChoice = require('./utils/parseChoice.cjs');
5
- const require_initSkills = require('./initSkills.cjs');
6
- const require_init = require('./init.cjs');
2
+ const require_init = require("./init.cjs");
3
+ const require_initSkills = require("./initSkills.cjs");
4
+ const require_loadPrompts = require("./loadPrompts.cjs");
5
+ const require_utils_isInteractiveTerminal = require("./utils/isInteractiveTerminal.cjs");
6
+ const require_utils_parseChoice = require("./utils/parseChoice.cjs");
7
7
  let _intlayer_engine_cli = require("@intlayer/engine/cli");
8
8
 
9
- //#region src/initMCP.ts
9
+ // src/initMCP.ts
10
10
  /** Validates a `--transport` value, ignoring case. */
11
11
  const parseMCPTransport = (value) => require_utils_parseChoice.parseChoice(value, _intlayer_engine_cli.MCP_TRANSPORTS, "--transport");
12
12
  /**
@@ -54,7 +54,6 @@ const initMCP = async (projectRoot, options = {}) => {
54
54
  p.outro("Intlayer MCP Server initialization complete");
55
55
  };
56
56
 
57
- //#endregion
58
57
  exports.initMCP = initMCP;
59
58
  exports.parseMCPTransport = parseMCPTransport;
60
59
  //# sourceMappingURL=initMCP.cjs.map
@@ -1,14 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_loadPrompts = require('./loadPrompts.cjs');
4
- const require_utils_isInteractiveTerminal = require('./utils/isInteractiveTerminal.cjs');
5
- const require_utils_parseChoice = require('./utils/parseChoice.cjs');
6
- const require_init = require('./init.cjs');
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_init = require("./init.cjs");
4
+ const require_loadPrompts = require("./loadPrompts.cjs");
5
+ const require_utils_isInteractiveTerminal = require("./utils/isInteractiveTerminal.cjs");
6
+ const require_utils_parseChoice = require("./utils/parseChoice.cjs");
7
7
  let _intlayer_engine_cli = require("@intlayer/engine/cli");
8
8
  let enquirer = require("enquirer");
9
9
  enquirer = require_runtime.__toESM(enquirer);
10
10
 
11
- //#region src/initSkills.ts
11
+ // src/initSkills.ts
12
12
  const PLATFORM_OPTIONS = _intlayer_engine_cli.PLATFORMS.map((platform) => ({
13
13
  value: platform,
14
14
  label: _intlayer_engine_cli.PLATFORMS_METADATA[platform]?.label ?? "",
@@ -100,7 +100,6 @@ const initSkills = async (projectRoot, options = {}) => {
100
100
  return platform;
101
101
  };
102
102
 
103
- //#endregion
104
103
  exports.PLATFORM_OPTIONS = PLATFORM_OPTIONS;
105
104
  exports.initSkills = initSkills;
106
105
  exports.parsePlatform = parsePlatform;
@@ -1,12 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _intlayer_engine_cli = require("@intlayer/engine/cli");
3
- let node_path = require("node:path");
4
2
  let _intlayer_config_logger = require("@intlayer/config/logger");
5
3
  let _intlayer_config_node = require("@intlayer/config/node");
4
+ let _intlayer_engine_cli = require("@intlayer/engine/cli");
5
+ let node_path = require("node:path");
6
6
  let _intlayer_engine_utils = require("@intlayer/engine/utils");
7
7
  let _intlayer_dictionaries_entry_unmerged = require("@intlayer/dictionaries-entry/unmerged");
8
8
 
9
- //#region src/listContentDeclaration.ts
9
+ // src/listContentDeclaration.ts
10
10
  const listContentDeclarationRows = async (options) => {
11
11
  const config = (0, _intlayer_config_node.getConfiguration)(options?.configOptions);
12
12
  await (0, _intlayer_engine_cli.prepareIntlayer)(config);
@@ -39,7 +39,6 @@ const listContentDeclaration = async (options) => {
39
39
  appLogger(`Total content declaration files: ${(0, _intlayer_config_logger.colorizeNumber)(rows.length)}`);
40
40
  };
41
41
 
42
- //#endregion
43
42
  exports.listContentDeclaration = listContentDeclaration;
44
43
  exports.listContentDeclarationRows = listContentDeclarationRows;
45
44
  //# sourceMappingURL=listContentDeclaration.cjs.map
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _intlayer_engine_cli = require("@intlayer/engine/cli");
3
3
  let node_path = require("node:path");
4
4
 
5
- //#region src/listProjects.ts
5
+ // src/listProjects.ts
6
6
  const listProjectsCommand = async (options) => {
7
7
  const { searchDir, projectsPath } = await (0, _intlayer_engine_cli.listProjects)(options);
8
8
  const projectsRelativePath = projectsPath.map((projectPath) => options?.absolute ? projectPath : (0, node_path.relative)(searchDir, projectPath)).map((projectPath) => projectPath === "" ? "." : projectPath);
@@ -23,6 +23,5 @@ const listProjectsCommand = async (options) => {
23
23
  });
24
24
  };
25
25
 
26
- //#endregion
27
26
  exports.listProjectsCommand = listProjectsCommand;
28
27
  //# sourceMappingURL=listProjects.cjs.map
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_IntlayerEventListener = require('./IntlayerEventListener.cjs');
4
- let node_http = require("node:http");
2
+ const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
3
+ const require_IntlayerEventListener = require("./IntlayerEventListener.cjs");
5
4
  let _intlayer_config_colors = require("@intlayer/config/colors");
6
5
  _intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
7
6
  let _intlayer_config_logger = require("@intlayer/config/logger");
8
7
  let _intlayer_config_node = require("@intlayer/config/node");
8
+ let node_http = require("node:http");
9
9
  let _intlayer_engine_utils = require("@intlayer/engine/utils");
10
10
  let _intlayer_dictionaries_entry_unmerged = require("@intlayer/dictionaries-entry/unmerged");
11
11
  let _intlayer_engine_build = require("@intlayer/engine/build");
@@ -14,7 +14,7 @@ let _intlayer_dictionaries_entry = require("@intlayer/dictionaries-entry");
14
14
  let _intlayer_config_package_json = require("@intlayer/config/package.json");
15
15
  _intlayer_config_package_json = require_runtime.__toESM(_intlayer_config_package_json);
16
16
 
17
- //#region src/liveSync.ts
17
+ // src/liveSync.ts
18
18
  const writeDictionary = async (dictionary, configuration) => {
19
19
  (0, _intlayer_config_logger.getAppLogger)(configuration)(`Writing dictionary ${dictionary.key}`);
20
20
  await (0, _intlayer_engine_build.buildDictionary)([dictionary], configuration);
@@ -162,6 +162,5 @@ const liveSync = async (options) => {
162
162
  process.on("exit", cleanup);
163
163
  };
164
164
 
165
- //#endregion
166
165
  exports.liveSync = liveSync;
167
166
  //# sourceMappingURL=liveSync.cjs.map