@intlayer/cli 8.1.1 → 8.1.3-canary.0

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 (304) hide show
  1. package/dist/cjs/IntlayerEventListener.cjs +1 -186
  2. package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
  3. package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
  4. package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
  5. package/dist/cjs/auth/login.cjs +2 -85
  6. package/dist/cjs/auth/login.cjs.map +1 -1
  7. package/dist/cjs/build.cjs +1 -27
  8. package/dist/cjs/build.cjs.map +1 -1
  9. package/dist/cjs/ci.cjs +1 -73
  10. package/dist/cjs/ci.cjs.map +1 -1
  11. package/dist/cjs/cli.cjs +1 -476
  12. package/dist/cjs/cli.cjs.map +1 -1
  13. package/dist/cjs/config.cjs +1 -12
  14. package/dist/cjs/config.cjs.map +1 -1
  15. package/dist/cjs/editor.cjs +1 -50
  16. package/dist/cjs/editor.cjs.map +1 -1
  17. package/dist/cjs/extract.cjs +1 -96
  18. package/dist/cjs/extract.cjs.map +1 -1
  19. package/dist/cjs/fill/deepMergeContent.cjs +1 -27
  20. package/dist/cjs/fill/deepMergeContent.cjs.map +1 -1
  21. package/dist/cjs/fill/fill.cjs +1 -78
  22. package/dist/cjs/fill/fill.cjs.map +1 -1
  23. package/dist/cjs/fill/formatAutoFilledFilePath.cjs +1 -29
  24. package/dist/cjs/fill/formatAutoFilledFilePath.cjs.map +1 -1
  25. package/dist/cjs/fill/formatFillData.cjs +1 -50
  26. package/dist/cjs/fill/formatFillData.cjs.map +1 -1
  27. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +1 -26
  28. package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs.map +1 -1
  29. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +1 -50
  30. package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs.map +1 -1
  31. package/dist/cjs/fill/index.cjs +1 -6
  32. package/dist/cjs/fill/listTranslationsTasks.cjs +1 -70
  33. package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -1
  34. package/dist/cjs/fill/mergeChunks.cjs +1 -28
  35. package/dist/cjs/fill/mergeChunks.cjs.map +1 -1
  36. package/dist/cjs/fill/translateDictionary.cjs +1 -205
  37. package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
  38. package/dist/cjs/fill/writeFill.cjs +1 -54
  39. package/dist/cjs/fill/writeFill.cjs.map +1 -1
  40. package/dist/cjs/getTargetDictionary.cjs +1 -36
  41. package/dist/cjs/getTargetDictionary.cjs.map +1 -1
  42. package/dist/cjs/index.cjs +1 -39
  43. package/dist/cjs/init.cjs +1 -322
  44. package/dist/cjs/init.cjs.map +1 -1
  45. package/dist/cjs/listContentDeclaration.cjs +1 -41
  46. package/dist/cjs/listContentDeclaration.cjs.map +1 -1
  47. package/dist/cjs/listProjects.cjs +1 -28
  48. package/dist/cjs/listProjects.cjs.map +1 -1
  49. package/dist/cjs/liveSync.cjs +8 -151
  50. package/dist/cjs/liveSync.cjs.map +1 -1
  51. package/dist/cjs/pull.cjs +1 -146
  52. package/dist/cjs/pull.cjs.map +1 -1
  53. package/dist/cjs/push/pullLog.cjs +3 -102
  54. package/dist/cjs/push/pullLog.cjs.map +1 -1
  55. package/dist/cjs/push/push.cjs +1 -206
  56. package/dist/cjs/push/push.cjs.map +1 -1
  57. package/dist/cjs/pushConfig.cjs +1 -19
  58. package/dist/cjs/pushConfig.cjs.map +1 -1
  59. package/dist/cjs/pushLog.cjs +3 -84
  60. package/dist/cjs/pushLog.cjs.map +1 -1
  61. package/dist/cjs/reviewDoc/reviewDoc.cjs +1 -68
  62. package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
  63. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +1 -94
  64. package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
  65. package/dist/cjs/searchDoc.cjs +1 -38
  66. package/dist/cjs/searchDoc.cjs.map +1 -1
  67. package/dist/cjs/test/index.cjs +1 -7
  68. package/dist/cjs/test/listMissingTranslations.cjs +1 -49
  69. package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
  70. package/dist/cjs/test/test.cjs +1 -51
  71. package/dist/cjs/test/test.cjs.map +1 -1
  72. package/dist/cjs/translateDoc/index.cjs +1 -9
  73. package/dist/cjs/translateDoc/translateDoc.cjs +1 -74
  74. package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
  75. package/dist/cjs/translateDoc/translateFile.cjs +2 -103
  76. package/dist/cjs/translateDoc/translateFile.cjs.map +1 -1
  77. package/dist/cjs/translateDoc/validation.cjs +5 -49
  78. package/dist/cjs/translateDoc/validation.cjs.map +1 -1
  79. package/dist/cjs/translation-alignment/alignBlocks.cjs +1 -67
  80. package/dist/cjs/translation-alignment/alignBlocks.cjs.map +1 -1
  81. package/dist/cjs/translation-alignment/computeSimilarity.cjs +1 -25
  82. package/dist/cjs/translation-alignment/computeSimilarity.cjs.map +1 -1
  83. package/dist/cjs/translation-alignment/fingerprintBlock.cjs +1 -23
  84. package/dist/cjs/translation-alignment/fingerprintBlock.cjs.map +1 -1
  85. package/dist/cjs/translation-alignment/index.cjs +1 -22
  86. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs +1 -18
  87. package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs.map +1 -1
  88. package/dist/cjs/translation-alignment/normalizeBlock.cjs +1 -22
  89. package/dist/cjs/translation-alignment/normalizeBlock.cjs.map +1 -1
  90. package/dist/cjs/translation-alignment/pipeline.cjs +1 -37
  91. package/dist/cjs/translation-alignment/pipeline.cjs.map +1 -1
  92. package/dist/cjs/translation-alignment/planActions.cjs +1 -46
  93. package/dist/cjs/translation-alignment/planActions.cjs.map +1 -1
  94. package/dist/cjs/translation-alignment/rebuildDocument.cjs +2 -49
  95. package/dist/cjs/translation-alignment/rebuildDocument.cjs.map +1 -1
  96. package/dist/cjs/translation-alignment/segmentDocument.cjs +5 -66
  97. package/dist/cjs/translation-alignment/segmentDocument.cjs.map +1 -1
  98. package/dist/cjs/utils/calculateChunks.cjs +2 -89
  99. package/dist/cjs/utils/calculateChunks.cjs.map +1 -1
  100. package/dist/cjs/utils/checkAccess.cjs +1 -81
  101. package/dist/cjs/utils/checkAccess.cjs.map +1 -1
  102. package/dist/cjs/utils/checkConfigConsistency.cjs +1 -16
  103. package/dist/cjs/utils/checkConfigConsistency.cjs.map +1 -1
  104. package/dist/cjs/utils/checkFileModifiedRange.cjs +1 -81
  105. package/dist/cjs/utils/checkFileModifiedRange.cjs.map +1 -1
  106. package/dist/cjs/utils/checkLastUpdateTime.cjs +1 -19
  107. package/dist/cjs/utils/checkLastUpdateTime.cjs.map +1 -1
  108. package/dist/cjs/utils/chunkInference.cjs +1 -45
  109. package/dist/cjs/utils/chunkInference.cjs.map +1 -1
  110. package/dist/cjs/utils/fixChunkStartEndChars.cjs +3 -27
  111. package/dist/cjs/utils/fixChunkStartEndChars.cjs.map +1 -1
  112. package/dist/cjs/utils/formatTimeDiff.cjs +1 -20
  113. package/dist/cjs/utils/formatTimeDiff.cjs.map +1 -1
  114. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +1 -16
  115. package/dist/cjs/utils/getIsFileUpdatedRecently.cjs.map +1 -1
  116. package/dist/cjs/utils/getOutputFilePath.cjs +1 -74
  117. package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
  118. package/dist/cjs/utils/getParentPackageJSON.cjs +1 -20
  119. package/dist/cjs/utils/getParentPackageJSON.cjs.map +1 -1
  120. package/dist/cjs/utils/listSpecialChars.cjs +2 -54
  121. package/dist/cjs/utils/listSpecialChars.cjs.map +1 -1
  122. package/dist/cjs/utils/mapChunksBetweenFiles.cjs +1 -102
  123. package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -1
  124. package/dist/cjs/utils/openBrowser.cjs +1 -19
  125. package/dist/cjs/utils/openBrowser.cjs.map +1 -1
  126. package/dist/cjs/utils/reorderParagraphs.cjs +3 -91
  127. package/dist/cjs/utils/reorderParagraphs.cjs.map +1 -1
  128. package/dist/cjs/utils/setupAI.cjs +1 -64
  129. package/dist/cjs/utils/setupAI.cjs.map +1 -1
  130. package/dist/cjs/watch.cjs +1 -43
  131. package/dist/cjs/watch.cjs.map +1 -1
  132. package/dist/esm/IntlayerEventListener.mjs +1 -183
  133. package/dist/esm/IntlayerEventListener.mjs.map +1 -1
  134. package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
  135. package/dist/esm/_virtual/_utils_asset.mjs +2 -97
  136. package/dist/esm/auth/login.mjs +2 -82
  137. package/dist/esm/auth/login.mjs.map +1 -1
  138. package/dist/esm/build.mjs +1 -25
  139. package/dist/esm/build.mjs.map +1 -1
  140. package/dist/esm/ci.mjs +1 -71
  141. package/dist/esm/ci.mjs.map +1 -1
  142. package/dist/esm/cli.mjs +1 -473
  143. package/dist/esm/cli.mjs.map +1 -1
  144. package/dist/esm/config.mjs +1 -10
  145. package/dist/esm/config.mjs.map +1 -1
  146. package/dist/esm/editor.mjs +1 -49
  147. package/dist/esm/editor.mjs.map +1 -1
  148. package/dist/esm/extract.mjs +1 -93
  149. package/dist/esm/extract.mjs.map +1 -1
  150. package/dist/esm/fill/deepMergeContent.mjs +1 -25
  151. package/dist/esm/fill/deepMergeContent.mjs.map +1 -1
  152. package/dist/esm/fill/fill.mjs +1 -76
  153. package/dist/esm/fill/fill.mjs.map +1 -1
  154. package/dist/esm/fill/formatAutoFilledFilePath.mjs +1 -27
  155. package/dist/esm/fill/formatAutoFilledFilePath.mjs.map +1 -1
  156. package/dist/esm/fill/formatFillData.mjs +1 -49
  157. package/dist/esm/fill/formatFillData.mjs.map +1 -1
  158. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +1 -24
  159. package/dist/esm/fill/getAvailableLocalesInDictionary.mjs.map +1 -1
  160. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +1 -48
  161. package/dist/esm/fill/getFilterMissingContentPerLocale.mjs.map +1 -1
  162. package/dist/esm/fill/index.mjs +1 -4
  163. package/dist/esm/fill/listTranslationsTasks.mjs +1 -68
  164. package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -1
  165. package/dist/esm/fill/mergeChunks.mjs +1 -26
  166. package/dist/esm/fill/mergeChunks.mjs.map +1 -1
  167. package/dist/esm/fill/translateDictionary.mjs +1 -203
  168. package/dist/esm/fill/translateDictionary.mjs.map +1 -1
  169. package/dist/esm/fill/writeFill.mjs +1 -52
  170. package/dist/esm/fill/writeFill.mjs.map +1 -1
  171. package/dist/esm/getTargetDictionary.mjs +1 -33
  172. package/dist/esm/getTargetDictionary.mjs.map +1 -1
  173. package/dist/esm/index.mjs +1 -18
  174. package/dist/esm/init.mjs +1 -317
  175. package/dist/esm/init.mjs.map +1 -1
  176. package/dist/esm/listContentDeclaration.mjs +1 -38
  177. package/dist/esm/listContentDeclaration.mjs.map +1 -1
  178. package/dist/esm/listProjects.mjs +1 -26
  179. package/dist/esm/listProjects.mjs.map +1 -1
  180. package/dist/esm/liveSync.mjs +8 -148
  181. package/dist/esm/liveSync.mjs.map +1 -1
  182. package/dist/esm/pull.mjs +1 -144
  183. package/dist/esm/pull.mjs.map +1 -1
  184. package/dist/esm/push/pullLog.mjs +3 -100
  185. package/dist/esm/push/pullLog.mjs.map +1 -1
  186. package/dist/esm/push/push.mjs +1 -203
  187. package/dist/esm/push/push.mjs.map +1 -1
  188. package/dist/esm/pushConfig.mjs +1 -17
  189. package/dist/esm/pushConfig.mjs.map +1 -1
  190. package/dist/esm/pushLog.mjs +3 -82
  191. package/dist/esm/pushLog.mjs.map +1 -1
  192. package/dist/esm/reviewDoc/reviewDoc.mjs +1 -65
  193. package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
  194. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +1 -92
  195. package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
  196. package/dist/esm/searchDoc.mjs +1 -36
  197. package/dist/esm/searchDoc.mjs.map +1 -1
  198. package/dist/esm/test/index.mjs +1 -4
  199. package/dist/esm/test/listMissingTranslations.mjs +1 -46
  200. package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
  201. package/dist/esm/test/test.mjs +1 -49
  202. package/dist/esm/test/test.mjs.map +1 -1
  203. package/dist/esm/translateDoc/index.mjs +1 -5
  204. package/dist/esm/translateDoc/translateDoc.mjs +1 -71
  205. package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
  206. package/dist/esm/translateDoc/translateFile.mjs +2 -101
  207. package/dist/esm/translateDoc/translateFile.mjs.map +1 -1
  208. package/dist/esm/translateDoc/validation.mjs +5 -46
  209. package/dist/esm/translateDoc/validation.mjs.map +1 -1
  210. package/dist/esm/translation-alignment/alignBlocks.mjs +1 -66
  211. package/dist/esm/translation-alignment/alignBlocks.mjs.map +1 -1
  212. package/dist/esm/translation-alignment/computeSimilarity.mjs +1 -22
  213. package/dist/esm/translation-alignment/computeSimilarity.mjs.map +1 -1
  214. package/dist/esm/translation-alignment/fingerprintBlock.mjs +1 -20
  215. package/dist/esm/translation-alignment/fingerprintBlock.mjs.map +1 -1
  216. package/dist/esm/translation-alignment/index.mjs +1 -11
  217. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs +1 -16
  218. package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs.map +1 -1
  219. package/dist/esm/translation-alignment/normalizeBlock.mjs +1 -20
  220. package/dist/esm/translation-alignment/normalizeBlock.mjs.map +1 -1
  221. package/dist/esm/translation-alignment/pipeline.mjs +1 -35
  222. package/dist/esm/translation-alignment/pipeline.mjs.map +1 -1
  223. package/dist/esm/translation-alignment/planActions.mjs +1 -44
  224. package/dist/esm/translation-alignment/planActions.mjs.map +1 -1
  225. package/dist/esm/translation-alignment/rebuildDocument.mjs +2 -46
  226. package/dist/esm/translation-alignment/rebuildDocument.mjs.map +1 -1
  227. package/dist/esm/translation-alignment/segmentDocument.mjs +5 -64
  228. package/dist/esm/translation-alignment/segmentDocument.mjs.map +1 -1
  229. package/dist/esm/utils/calculateChunks.mjs +2 -87
  230. package/dist/esm/utils/calculateChunks.mjs.map +1 -1
  231. package/dist/esm/utils/checkAccess.mjs +1 -78
  232. package/dist/esm/utils/checkAccess.mjs.map +1 -1
  233. package/dist/esm/utils/checkConfigConsistency.mjs +1 -14
  234. package/dist/esm/utils/checkConfigConsistency.mjs.map +1 -1
  235. package/dist/esm/utils/checkFileModifiedRange.mjs +1 -80
  236. package/dist/esm/utils/checkFileModifiedRange.mjs.map +1 -1
  237. package/dist/esm/utils/checkLastUpdateTime.mjs +1 -17
  238. package/dist/esm/utils/checkLastUpdateTime.mjs.map +1 -1
  239. package/dist/esm/utils/chunkInference.mjs +1 -43
  240. package/dist/esm/utils/chunkInference.mjs.map +1 -1
  241. package/dist/esm/utils/fixChunkStartEndChars.mjs +3 -25
  242. package/dist/esm/utils/fixChunkStartEndChars.mjs.map +1 -1
  243. package/dist/esm/utils/formatTimeDiff.mjs +1 -18
  244. package/dist/esm/utils/formatTimeDiff.mjs.map +1 -1
  245. package/dist/esm/utils/getIsFileUpdatedRecently.mjs +1 -14
  246. package/dist/esm/utils/getIsFileUpdatedRecently.mjs.map +1 -1
  247. package/dist/esm/utils/getOutputFilePath.mjs +1 -72
  248. package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
  249. package/dist/esm/utils/getParentPackageJSON.mjs +1 -18
  250. package/dist/esm/utils/getParentPackageJSON.mjs.map +1 -1
  251. package/dist/esm/utils/listSpecialChars.mjs +2 -52
  252. package/dist/esm/utils/listSpecialChars.mjs.map +1 -1
  253. package/dist/esm/utils/mapChunksBetweenFiles.mjs +1 -100
  254. package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -1
  255. package/dist/esm/utils/openBrowser.mjs +1 -17
  256. package/dist/esm/utils/openBrowser.mjs.map +1 -1
  257. package/dist/esm/utils/reorderParagraphs.mjs +3 -90
  258. package/dist/esm/utils/reorderParagraphs.mjs.map +1 -1
  259. package/dist/esm/utils/setupAI.mjs +1 -62
  260. package/dist/esm/utils/setupAI.mjs.map +1 -1
  261. package/dist/esm/watch.mjs +1 -41
  262. package/dist/esm/watch.mjs.map +1 -1
  263. package/dist/types/auth/login.d.ts +1 -1
  264. package/dist/types/auth/login.d.ts.map +1 -1
  265. package/dist/types/build.d.ts +1 -1
  266. package/dist/types/build.d.ts.map +1 -1
  267. package/dist/types/config.d.ts +1 -1
  268. package/dist/types/extract.d.ts +1 -1
  269. package/dist/types/extract.d.ts.map +1 -1
  270. package/dist/types/fill/fill.d.ts +1 -1
  271. package/dist/types/fill/fill.d.ts.map +1 -1
  272. package/dist/types/fill/translateDictionary.d.ts +2 -2
  273. package/dist/types/fill/translateDictionary.d.ts.map +1 -1
  274. package/dist/types/fill/writeFill.d.ts.map +1 -1
  275. package/dist/types/getTargetDictionary.d.ts +2 -2
  276. package/dist/types/index.d.ts +4 -1
  277. package/dist/types/init.d.ts +1 -1
  278. package/dist/types/listContentDeclaration.d.ts +1 -1
  279. package/dist/types/listContentDeclaration.d.ts.map +1 -1
  280. package/dist/types/listProjects.d.ts +1 -1
  281. package/dist/types/listProjects.d.ts.map +1 -1
  282. package/dist/types/liveSync.d.ts +1 -1
  283. package/dist/types/pull.d.ts +1 -1
  284. package/dist/types/pull.d.ts.map +1 -1
  285. package/dist/types/push/pullLog.d.ts +1 -1
  286. package/dist/types/push/pullLog.d.ts.map +1 -1
  287. package/dist/types/push/push.d.ts +2 -2
  288. package/dist/types/pushConfig.d.ts +1 -1
  289. package/dist/types/reviewDoc/reviewDoc.d.ts +2 -2
  290. package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
  291. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -1
  292. package/dist/types/reviewDoc/reviewDocBlockAware.d.ts.map +1 -1
  293. package/dist/types/searchDoc.d.ts +1 -1
  294. package/dist/types/searchDoc.d.ts.map +1 -1
  295. package/dist/types/test/listMissingTranslations.d.ts +1 -1
  296. package/dist/types/test/test.d.ts +1 -1
  297. package/dist/types/test/test.d.ts.map +1 -1
  298. package/dist/types/translateDoc/translateDoc.d.ts.map +1 -1
  299. package/dist/types/translateDoc/types.d.ts +2 -2
  300. package/dist/types/translateDoc/validation.d.ts +1 -1
  301. package/dist/types/utils/checkAccess.d.ts.map +1 -1
  302. package/dist/types/watch.d.ts +1 -1
  303. package/dist/types/watch.d.ts.map +1 -1
  304. package/package.json +13 -13
package/dist/cjs/ci.cjs CHANGED
@@ -1,74 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- let _intlayer_chokidar = require("@intlayer/chokidar");
4
- let _intlayer_config = require("@intlayer/config");
5
- let node_child_process = require("node:child_process");
6
- let node_path = require("node:path");
7
-
8
- //#region src/ci.ts
9
- const getPackageManagerCommand = () => {
10
- const userAgent = process.env.npm_config_user_agent;
11
- if (userAgent?.startsWith("bun")) return {
12
- command: "bun",
13
- args: ["intlayer"]
14
- };
15
- if (userAgent?.startsWith("pnpm")) return {
16
- command: "pnpm",
17
- args: ["exec", "intlayer"]
18
- };
19
- if (userAgent?.startsWith("yarn")) return {
20
- command: "yarn",
21
- args: ["run", "intlayer"]
22
- };
23
- return {
24
- command: "npx",
25
- args: ["intlayer"]
26
- };
27
- };
28
- const runCI = async (commands) => {
29
- const credentialsEnv = process.env.INTLAYER_PROJECT_CREDENTIALS;
30
- let credentials = {};
31
- if (credentialsEnv) try {
32
- credentials = JSON.parse(credentialsEnv);
33
- } catch {
34
- (0, _intlayer_config.logger)("INTLAYER_PROJECT_CREDENTIALS is not valid JSON. Proceeding without credentials.", { level: "warn" });
35
- }
36
- const cwd = process.cwd();
37
- const { projectsPath } = await (0, _intlayer_chokidar.listProjects)();
38
- if (projectsPath.length === 0) {
39
- (0, _intlayer_config.logger)("No Intlayer projects found.", { level: "warn" });
40
- return;
41
- }
42
- const currentProject = projectsPath.find((p) => cwd === p);
43
- const projectsToRun = currentProject ? [currentProject] : projectsPath;
44
- const { command, args: pmArgs } = getPackageManagerCommand();
45
- const finalArgs = [...pmArgs, ...commands];
46
- (0, _intlayer_config.logger)(`CI: Using package manager: ${command}`, { level: "verbose" });
47
- if (currentProject) (0, _intlayer_config.logger)(`CI: Detected project context: ${currentProject}`, { level: "info" });
48
- else (0, _intlayer_config.logger)(`CI: No specific project context detected. Iterating over ${projectsToRun.length} discovered projects...`, { level: "info" });
49
- let hasError = false;
50
- for (const projectPath of projectsToRun) {
51
- const creds = Object.entries(credentials).find(([key]) => {
52
- return (0, node_path.resolve)(key) === projectPath || projectPath.endsWith((0, node_path.normalize)(key));
53
- })?.[1];
54
- (0, _intlayer_config.logger)(`\nCI: Executing for ${projectPath}...`, { level: "info" });
55
- const envVars = { ...process.env };
56
- if (creds) {
57
- envVars.INTLAYER_CLIENT_ID = creds.clientId;
58
- envVars.INTLAYER_CLIENT_SECRET = creds.clientSecret;
59
- } else if (credentialsEnv) (0, _intlayer_config.logger)(`CI: No matching credentials found for ${projectPath} in INTLAYER_PROJECT_CREDENTIALS.`, { level: "verbose" });
60
- if ((0, node_child_process.spawnSync)(command, finalArgs, {
61
- cwd: projectPath,
62
- stdio: "inherit",
63
- env: envVars
64
- }).status !== 0) {
65
- (0, _intlayer_config.logger)(`CI: Failed for ${projectPath}`, { level: "error" });
66
- hasError = true;
67
- }
68
- }
69
- if (hasError) process.exit(1);
70
- };
71
-
72
- //#endregion
73
- exports.runCI = runCI;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`node:child_process`),t=require(`node:path`),n=require(`@intlayer/chokidar/cli`),r=require(`@intlayer/config/logger`);const i=()=>{let e=process.env.npm_config_user_agent;return e?.startsWith(`bun`)?{command:`bun`,args:[`intlayer`]}:e?.startsWith(`pnpm`)?{command:`pnpm`,args:[`exec`,`intlayer`]}:e?.startsWith(`yarn`)?{command:`yarn`,args:[`run`,`intlayer`]}:{command:`npx`,args:[`intlayer`]}},a=async a=>{let o=process.env.INTLAYER_PROJECT_CREDENTIALS,s={};if(o)try{s=JSON.parse(o)}catch{(0,r.logger)(`INTLAYER_PROJECT_CREDENTIALS is not valid JSON. Proceeding without credentials.`,{level:`warn`})}let c=process.cwd(),{projectsPath:l}=await(0,n.listProjects)();if(l.length===0){(0,r.logger)(`No Intlayer projects found.`,{level:`warn`});return}let u=l.find(e=>c===e),d=u?[u]:l,{command:f,args:p}=i(),m=[...p,...a];(0,r.logger)(`CI: Using package manager: ${f}`,{level:`verbose`}),u?(0,r.logger)(`CI: Detected project context: ${u}`,{level:`info`}):(0,r.logger)(`CI: No specific project context detected. Iterating over ${d.length} discovered projects...`,{level:`info`});let h=!1;for(let n of d){let i=Object.entries(s).find(([e])=>(0,t.resolve)(e)===n||n.endsWith((0,t.normalize)(e)))?.[1];(0,r.logger)(`\nCI: Executing for ${n}...`,{level:`info`});let a={...process.env};i?(a.INTLAYER_CLIENT_ID=i.clientId,a.INTLAYER_CLIENT_SECRET=i.clientSecret):o&&(0,r.logger)(`CI: No matching credentials found for ${n} in INTLAYER_PROJECT_CREDENTIALS.`,{level:`verbose`}),(0,e.spawnSync)(f,m,{cwd:n,stdio:`inherit`,env:a}).status!==0&&((0,r.logger)(`CI: Failed for ${n}`,{level:`error`}),h=!0)}h&&process.exit(1)};exports.runCI=a;
74
2
  //# sourceMappingURL=ci.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ci.cjs","names":[],"sources":["../../src/ci.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport { normalize, resolve } from 'node:path';\nimport { listProjects } from '@intlayer/chokidar';\nimport { logger } from '@intlayer/config';\n\n// Helper to detect the package manager used to run the command\nconst getPackageManagerCommand = () => {\n const userAgent = process.env.npm_config_user_agent;\n\n if (userAgent?.startsWith('bun')) {\n return { command: 'bun', args: ['intlayer'] }; // Bun runs local bins natively\n }\n if (userAgent?.startsWith('pnpm')) {\n return { command: 'pnpm', args: ['exec', 'intlayer'] }; // pnpm requires 'exec'\n }\n if (userAgent?.startsWith('yarn')) {\n return { command: 'yarn', args: ['run', 'intlayer'] }; // yarn requires 'run' or 'exec'\n }\n\n // Default fallback\n return { command: 'npx', args: ['intlayer'] };\n};\n\nexport const runCI = async (commands: string[]) => {\n const credentialsEnv = process.env.INTLAYER_PROJECT_CREDENTIALS;\n let credentials: Record<string, { clientId: string; clientSecret: string }> =\n {};\n\n // Parse Credentials (Optional now)\n if (credentialsEnv) {\n try {\n credentials = JSON.parse(credentialsEnv);\n } catch {\n logger(\n 'INTLAYER_PROJECT_CREDENTIALS is not valid JSON. Proceeding without credentials.',\n {\n level: 'warn',\n }\n );\n }\n }\n\n const cwd = process.cwd();\n\n // Discover Projects\n const { projectsPath } = await listProjects();\n\n if (projectsPath.length === 0) {\n logger('No Intlayer projects found.', { level: 'warn' });\n return;\n }\n\n // 3. Determine Context: Single Project vs All Projects\n // Check if the current directory matches one of the discovered project paths\n const currentProject = projectsPath.find((p) => cwd === p);\n const projectsToRun = currentProject ? [currentProject] : projectsPath;\n\n const { command, args: pmArgs } = getPackageManagerCommand();\n const finalArgs = [...pmArgs, ...commands];\n\n logger(`CI: Using package manager: ${command}`, { level: 'verbose' });\n\n if (currentProject) {\n logger(`CI: Detected project context: ${currentProject}`, {\n level: 'info',\n });\n } else {\n logger(\n `CI: No specific project context detected. Iterating over ${projectsToRun.length} discovered projects...`,\n {\n level: 'info',\n }\n );\n }\n\n let hasError = false;\n\n // Iterate and Execute\n for (const projectPath of projectsToRun) {\n // Attempt to match credentials to the project path\n // We check if the key (relative or absolute) matches the resolved project path\n const credsEntry = Object.entries(credentials).find(([key]) => {\n const absKey = resolve(key);\n return absKey === projectPath || projectPath.endsWith(normalize(key));\n });\n\n const creds = credsEntry?.[1];\n\n logger(`\\nCI: Executing for ${projectPath}...`, {\n level: 'info',\n });\n\n const envVars = { ...process.env };\n\n if (creds) {\n envVars.INTLAYER_CLIENT_ID = creds.clientId;\n envVars.INTLAYER_CLIENT_SECRET = creds.clientSecret;\n } else if (credentialsEnv) {\n logger(\n `CI: No matching credentials found for ${projectPath} in INTLAYER_PROJECT_CREDENTIALS.`,\n { level: 'verbose' }\n );\n }\n\n const result = spawnSync(command, finalArgs, {\n cwd: projectPath,\n stdio: 'inherit',\n env: envVars,\n });\n\n if (result.status !== 0) {\n logger(`CI: Failed for ${projectPath}`, {\n level: 'error',\n });\n hasError = true;\n }\n }\n\n if (hasError) process.exit(1);\n};\n"],"mappings":";;;;;;;;AAMA,MAAM,iCAAiC;CACrC,MAAM,YAAY,QAAQ,IAAI;AAE9B,KAAI,WAAW,WAAW,MAAM,CAC9B,QAAO;EAAE,SAAS;EAAO,MAAM,CAAC,WAAW;EAAE;AAE/C,KAAI,WAAW,WAAW,OAAO,CAC/B,QAAO;EAAE,SAAS;EAAQ,MAAM,CAAC,QAAQ,WAAW;EAAE;AAExD,KAAI,WAAW,WAAW,OAAO,CAC/B,QAAO;EAAE,SAAS;EAAQ,MAAM,CAAC,OAAO,WAAW;EAAE;AAIvD,QAAO;EAAE,SAAS;EAAO,MAAM,CAAC,WAAW;EAAE;;AAG/C,MAAa,QAAQ,OAAO,aAAuB;CACjD,MAAM,iBAAiB,QAAQ,IAAI;CACnC,IAAI,cACF,EAAE;AAGJ,KAAI,eACF,KAAI;AACF,gBAAc,KAAK,MAAM,eAAe;SAClC;AACN,+BACE,mFACA,EACE,OAAO,QACR,CACF;;CAIL,MAAM,MAAM,QAAQ,KAAK;CAGzB,MAAM,EAAE,iBAAiB,4CAAoB;AAE7C,KAAI,aAAa,WAAW,GAAG;AAC7B,+BAAO,+BAA+B,EAAE,OAAO,QAAQ,CAAC;AACxD;;CAKF,MAAM,iBAAiB,aAAa,MAAM,MAAM,QAAQ,EAAE;CAC1D,MAAM,gBAAgB,iBAAiB,CAAC,eAAe,GAAG;CAE1D,MAAM,EAAE,SAAS,MAAM,WAAW,0BAA0B;CAC5D,MAAM,YAAY,CAAC,GAAG,QAAQ,GAAG,SAAS;AAE1C,8BAAO,8BAA8B,WAAW,EAAE,OAAO,WAAW,CAAC;AAErE,KAAI,eACF,8BAAO,iCAAiC,kBAAkB,EACxD,OAAO,QACR,CAAC;KAEF,8BACE,4DAA4D,cAAc,OAAO,0BACjF,EACE,OAAO,QACR,CACF;CAGH,IAAI,WAAW;AAGf,MAAK,MAAM,eAAe,eAAe;EAQvC,MAAM,QALa,OAAO,QAAQ,YAAY,CAAC,MAAM,CAAC,SAAS;AAE7D,iCADuB,IAAI,KACT,eAAe,YAAY,kCAAmB,IAAI,CAAC;IACrE,GAEyB;AAE3B,+BAAO,uBAAuB,YAAY,MAAM,EAC9C,OAAO,QACR,CAAC;EAEF,MAAM,UAAU,EAAE,GAAG,QAAQ,KAAK;AAElC,MAAI,OAAO;AACT,WAAQ,qBAAqB,MAAM;AACnC,WAAQ,yBAAyB,MAAM;aAC9B,eACT,8BACE,yCAAyC,YAAY,oCACrD,EAAE,OAAO,WAAW,CACrB;AASH,wCANyB,SAAS,WAAW;GAC3C,KAAK;GACL,OAAO;GACP,KAAK;GACN,CAAC,CAES,WAAW,GAAG;AACvB,gCAAO,kBAAkB,eAAe,EACtC,OAAO,SACR,CAAC;AACF,cAAW;;;AAIf,KAAI,SAAU,SAAQ,KAAK,EAAE"}
1
+ {"version":3,"file":"ci.cjs","names":[],"sources":["../../src/ci.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport { normalize, resolve } from 'node:path';\nimport { listProjects } from '@intlayer/chokidar/cli';\nimport { logger } from '@intlayer/config/logger';\n\n// Helper to detect the package manager used to run the command\nconst getPackageManagerCommand = () => {\n const userAgent = process.env.npm_config_user_agent;\n\n if (userAgent?.startsWith('bun')) {\n return { command: 'bun', args: ['intlayer'] }; // Bun runs local bins natively\n }\n if (userAgent?.startsWith('pnpm')) {\n return { command: 'pnpm', args: ['exec', 'intlayer'] }; // pnpm requires 'exec'\n }\n if (userAgent?.startsWith('yarn')) {\n return { command: 'yarn', args: ['run', 'intlayer'] }; // yarn requires 'run' or 'exec'\n }\n\n // Default fallback\n return { command: 'npx', args: ['intlayer'] };\n};\n\nexport const runCI = async (commands: string[]) => {\n const credentialsEnv = process.env.INTLAYER_PROJECT_CREDENTIALS;\n let credentials: Record<string, { clientId: string; clientSecret: string }> =\n {};\n\n // Parse Credentials (Optional now)\n if (credentialsEnv) {\n try {\n credentials = JSON.parse(credentialsEnv);\n } catch {\n logger(\n 'INTLAYER_PROJECT_CREDENTIALS is not valid JSON. Proceeding without credentials.',\n {\n level: 'warn',\n }\n );\n }\n }\n\n const cwd = process.cwd();\n\n // Discover Projects\n const { projectsPath } = await listProjects();\n\n if (projectsPath.length === 0) {\n logger('No Intlayer projects found.', { level: 'warn' });\n return;\n }\n\n // 3. Determine Context: Single Project vs All Projects\n // Check if the current directory matches one of the discovered project paths\n const currentProject = projectsPath.find((p) => cwd === p);\n const projectsToRun = currentProject ? [currentProject] : projectsPath;\n\n const { command, args: pmArgs } = getPackageManagerCommand();\n const finalArgs = [...pmArgs, ...commands];\n\n logger(`CI: Using package manager: ${command}`, { level: 'verbose' });\n\n if (currentProject) {\n logger(`CI: Detected project context: ${currentProject}`, {\n level: 'info',\n });\n } else {\n logger(\n `CI: No specific project context detected. Iterating over ${projectsToRun.length} discovered projects...`,\n {\n level: 'info',\n }\n );\n }\n\n let hasError = false;\n\n // Iterate and Execute\n for (const projectPath of projectsToRun) {\n // Attempt to match credentials to the project path\n // We check if the key (relative or absolute) matches the resolved project path\n const credsEntry = Object.entries(credentials).find(([key]) => {\n const absKey = resolve(key);\n return absKey === projectPath || projectPath.endsWith(normalize(key));\n });\n\n const creds = credsEntry?.[1];\n\n logger(`\\nCI: Executing for ${projectPath}...`, {\n level: 'info',\n });\n\n const envVars = { ...process.env };\n\n if (creds) {\n envVars.INTLAYER_CLIENT_ID = creds.clientId;\n envVars.INTLAYER_CLIENT_SECRET = creds.clientSecret;\n } else if (credentialsEnv) {\n logger(\n `CI: No matching credentials found for ${projectPath} in INTLAYER_PROJECT_CREDENTIALS.`,\n { level: 'verbose' }\n );\n }\n\n const result = spawnSync(command, finalArgs, {\n cwd: projectPath,\n stdio: 'inherit',\n env: envVars,\n });\n\n if (result.status !== 0) {\n logger(`CI: Failed for ${projectPath}`, {\n level: 'error',\n });\n hasError = true;\n }\n }\n\n if (hasError) process.exit(1);\n};\n"],"mappings":"mPAMA,MAAM,MAAiC,CACrC,IAAM,EAAY,QAAQ,IAAI,sBAa9B,OAXI,GAAW,WAAW,MAAM,CACvB,CAAE,QAAS,MAAO,KAAM,CAAC,WAAW,CAAE,CAE3C,GAAW,WAAW,OAAO,CACxB,CAAE,QAAS,OAAQ,KAAM,CAAC,OAAQ,WAAW,CAAE,CAEpD,GAAW,WAAW,OAAO,CACxB,CAAE,QAAS,OAAQ,KAAM,CAAC,MAAO,WAAW,CAAE,CAIhD,CAAE,QAAS,MAAO,KAAM,CAAC,WAAW,CAAE,EAGlC,EAAQ,KAAO,IAAuB,CACjD,IAAM,EAAiB,QAAQ,IAAI,6BAC/B,EACF,EAAE,CAGJ,GAAI,EACF,GAAI,CACF,EAAc,KAAK,MAAM,EAAe,MAClC,EACN,EAAA,EAAA,QACE,kFACA,CACE,MAAO,OACR,CACF,CAIL,IAAM,EAAM,QAAQ,KAAK,CAGnB,CAAE,gBAAiB,MAAA,EAAA,EAAA,eAAoB,CAE7C,GAAI,EAAa,SAAW,EAAG,EAC7B,EAAA,EAAA,QAAO,8BAA+B,CAAE,MAAO,OAAQ,CAAC,CACxD,OAKF,IAAM,EAAiB,EAAa,KAAM,GAAM,IAAQ,EAAE,CACpD,EAAgB,EAAiB,CAAC,EAAe,CAAG,EAEpD,CAAE,UAAS,KAAM,GAAW,GAA0B,CACtD,EAAY,CAAC,GAAG,EAAQ,GAAG,EAAS,EAE1C,EAAA,EAAA,QAAO,8BAA8B,IAAW,CAAE,MAAO,UAAW,CAAC,CAEjE,GACF,EAAA,EAAA,QAAO,iCAAiC,IAAkB,CACxD,MAAO,OACR,CAAC,EAEF,EAAA,EAAA,QACE,4DAA4D,EAAc,OAAO,yBACjF,CACE,MAAO,OACR,CACF,CAGH,IAAI,EAAW,GAGf,IAAK,IAAM,KAAe,EAAe,CAQvC,IAAM,EALa,OAAO,QAAQ,EAAY,CAAC,MAAM,CAAC,MAEpD,EAAA,EAAA,SADuB,EAAI,GACT,GAAe,EAAY,UAAA,EAAA,EAAA,WAAmB,EAAI,CAAC,CACrE,GAEyB,IAE3B,EAAA,EAAA,QAAO,uBAAuB,EAAY,KAAM,CAC9C,MAAO,OACR,CAAC,CAEF,IAAM,EAAU,CAAE,GAAG,QAAQ,IAAK,CAE9B,GACF,EAAQ,mBAAqB,EAAM,SACnC,EAAQ,uBAAyB,EAAM,cAC9B,IACT,EAAA,EAAA,QACE,yCAAyC,EAAY,mCACrD,CAAE,MAAO,UAAW,CACrB,EASH,EAAA,EAAA,WANyB,EAAS,EAAW,CAC3C,IAAK,EACL,MAAO,UACP,IAAK,EACN,CAAC,CAES,SAAW,KACpB,EAAA,EAAA,QAAO,kBAAkB,IAAe,CACtC,MAAO,QACR,CAAC,CACF,EAAW,IAIX,GAAU,QAAQ,KAAK,EAAE"}
package/dist/cjs/cli.cjs CHANGED
@@ -1,477 +1,2 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_build = require('./build.cjs');
4
- const require_ci = require('./ci.cjs');
5
- const require_auth_login = require('./auth/login.cjs');
6
- const require_config = require('./config.cjs');
7
- const require_editor = require('./editor.cjs');
8
- const require_extract = require('./extract.cjs');
9
- const require_test_test = require('./test/test.cjs');
10
- const require_fill_fill = require('./fill/fill.cjs');
11
- const require_init = require('./init.cjs');
12
- const require_listContentDeclaration = require('./listContentDeclaration.cjs');
13
- const require_listProjects = require('./listProjects.cjs');
14
- const require_liveSync = require('./liveSync.cjs');
15
- const require_pull = require('./pull.cjs');
16
- const require_push_push = require('./push/push.cjs');
17
- const require_pushConfig = require('./pushConfig.cjs');
18
- const require_reviewDoc_reviewDoc = require('./reviewDoc/reviewDoc.cjs');
19
- const require_searchDoc = require('./searchDoc.cjs');
20
- const require_translateDoc_translateDoc = require('./translateDoc/translateDoc.cjs');
21
- const require_utils_getParentPackageJSON = require('./utils/getParentPackageJSON.cjs');
22
- const require_watch = require('./watch.cjs');
23
- let _intlayer_config = require("@intlayer/config");
24
- let node_path = require("node:path");
25
- let node_url = require("node:url");
26
- let commander = require("commander");
27
-
28
- //#region src/cli.ts
29
- const isESModule = typeof require("url").pathToFileURL(__filename).href === "string";
30
- const dirname = isESModule ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : __dirname;
31
- const packageJson = require_utils_getParentPackageJSON.getParentPackageJSON(dirname);
32
- const configurationOptions = [
33
- ["--env-file [envFile]", "Environment file"],
34
- ["-e, --env [env]", "Environment"],
35
- ["--base-dir [baseDir]", "Base directory"],
36
- ["--no-cache [noCache]", "No cache"],
37
- ...[["--verbose", "Verbose (default to true using CLI)"], ["--prefix [prefix]", "Prefix"]]
38
- ];
39
- const aiOptions = [
40
- ["--provider [provider]", "Provider"],
41
- ["--temperature [temperature]", "Temperature"],
42
- ["--model [model]", "Model"],
43
- ["--api-key [apiKey]", "Provider API key"],
44
- ["--custom-prompt [prompt]", "Custom prompt"],
45
- ["--application-context [applicationContext]", "Application context"],
46
- ["--data-serialization [dataSerialization]", "Data serialization"]
47
- ];
48
- const gitOptions = [
49
- ["--git-diff [gitDiff]", "Git diff mode - Check git diff between two refs"],
50
- ["--git-diff-base [gitDiffBase]", "Git diff base ref"],
51
- ["--git-diff-current [gitDiffCurrent]", "Git diff current ref"],
52
- ["--uncommitted [uncommitted]", "Uncommitted"],
53
- ["--unpushed [unpushed]", "Unpushed"],
54
- ["--untracked [untracked]", "Untracked"]
55
- ];
56
- const extractKeysFromOptions = (options, keys) => keys.filter((key) => options[key]);
57
- /**
58
- * Helper functions to apply common options to commands
59
- */
60
- const applyOptions = (command, options) => {
61
- options.forEach(([flag, description]) => {
62
- command.option(flag, description);
63
- });
64
- return command;
65
- };
66
- const removeUndefined = (obj) => Object.fromEntries(Object.entries(obj).filter(([_, value]) => value !== void 0));
67
- const applyConfigOptions = (command) => applyOptions(command, configurationOptions);
68
- const applyAIOptions = (command) => applyOptions(command, aiOptions);
69
- const applyGitOptions = (command) => applyOptions(command, gitOptions);
70
- const extractAiOptions = (options) => {
71
- const { apiKey, provider, model, temperature, applicationContext, customPrompt, dataSerialization } = options;
72
- const configuration = (0, _intlayer_config.getConfiguration)();
73
- const { ai } = configuration;
74
- return removeUndefined({
75
- ...ai,
76
- apiKey: apiKey ?? configuration.ai?.apiKey,
77
- provider: provider ?? configuration.ai?.provider,
78
- model: model ?? configuration.ai?.model,
79
- temperature: temperature ?? configuration.ai?.temperature,
80
- applicationContext: applicationContext ?? configuration.ai?.applicationContext,
81
- customPrompt: customPrompt ?? configuration.ai?.customPrompt,
82
- dataSerialization: dataSerialization ?? configuration.ai?.dataSerialization
83
- });
84
- };
85
- const gitOptionKeys = [
86
- "gitDiff",
87
- "gitDiffBase",
88
- "gitDiffCurrent",
89
- "uncommitted",
90
- "unpushed",
91
- "untracked"
92
- ];
93
- const extractGitOptions = (options) => {
94
- const filteredOptions = extractKeysFromOptions(options, gitOptionKeys);
95
- if (!Object.values(filteredOptions).some(Boolean)) return void 0;
96
- const { gitDiff, gitDiffBase, gitDiffCurrent, uncommitted, unpushed, untracked } = options;
97
- return removeUndefined({
98
- mode: [
99
- gitDiff && "gitDiff",
100
- uncommitted && "uncommitted",
101
- unpushed && "unpushed",
102
- untracked && "untracked"
103
- ].filter(Boolean),
104
- baseRef: gitDiffBase,
105
- currentRef: gitDiffCurrent,
106
- absolute: true
107
- });
108
- };
109
- const configurationOptionKeys = [
110
- "baseDir",
111
- "env",
112
- "envFile",
113
- "verbose",
114
- "prefix"
115
- ];
116
- const extractConfigOptions = (options) => {
117
- const configuration = (0, _intlayer_config.getConfiguration)(options);
118
- const filteredOptions = extractKeysFromOptions(options, configurationOptionKeys);
119
- if (!Object.values(filteredOptions).some(Boolean)) return;
120
- const { baseDir, env, envFile, verbose, prefix, noCache } = options;
121
- const addPrefix = Boolean(options.with);
122
- if (typeof prefix === "string") (0, _intlayer_config.setPrefix)(prefix);
123
- else if (addPrefix) (0, _intlayer_config.setPrefix)(configuration.log.prefix);
124
- return removeUndefined({
125
- baseDir,
126
- env,
127
- envFile,
128
- override: { log: { verbose: verbose ?? true } },
129
- cache: !noCache
130
- });
131
- };
132
- /**
133
- * Set the API for the CLI
134
- *
135
- * Example of commands:
136
- *
137
- * npm run intlayer build --watch
138
- * npm run intlayer push --dictionaries id1 id2 id3 --deleteLocaleDir
139
- */
140
- const setAPI = () => {
141
- (0, _intlayer_config.setPrefix)("");
142
- const program = new commander.Command();
143
- program.version(packageJson.version).description("Intlayer CLI");
144
- program.command("version").description("Print the Intlayer CLI version").action(() => {
145
- console.log(packageJson.version ?? "unknown");
146
- });
147
- /**
148
- * AUTH
149
- */
150
- const loginCmd = program.command("login").description("Login to Intlayer").option("--cms-url [cmsUrl]", "CMS URL");
151
- applyConfigOptions(loginCmd);
152
- loginCmd.action((options) => {
153
- const configOptions = extractConfigOptions(options) ?? { override: { log: {
154
- prefix: "",
155
- verbose: true
156
- } } };
157
- return require_auth_login.login({
158
- cmsUrl: options.cmsUrl,
159
- configOptions
160
- });
161
- });
162
- program.command("init").description("Initialize Intlayer in the project").option("--project-root [projectRoot]", "Project root directory").action((options) => require_init.init(options.projectRoot)).command("skills").description("Initialize Intlayer skills in the project").option("--project-root [projectRoot]", "Project root directory").action((options) => require_init.initSkills(options.projectRoot));
163
- /**
164
- * DICTIONARIES
165
- */
166
- const dictionariesProgram = program.command("dictionary").alias("dictionaries").alias("dic").description("Dictionaries operations");
167
- const buildOptions = {
168
- description: "Build the dictionaries",
169
- options: [
170
- ["-w, --watch", "Watch for changes"],
171
- ["--skip-prepare", "Skip the prepare step"],
172
- ["--with [with...]", "Start command in parallel with the build"]
173
- ]
174
- };
175
- const dictionariesBuildCmd = dictionariesProgram.command("build").description(buildOptions.description);
176
- applyOptions(dictionariesBuildCmd, buildOptions.options);
177
- applyConfigOptions(dictionariesBuildCmd);
178
- dictionariesBuildCmd.action((options) => {
179
- require_build.build({
180
- ...options,
181
- configOptions: extractConfigOptions(options)
182
- });
183
- });
184
- const rootBuildCmd = program.command("build").description(buildOptions.description);
185
- applyOptions(rootBuildCmd, buildOptions.options);
186
- applyConfigOptions(rootBuildCmd);
187
- rootBuildCmd.action((options) => {
188
- require_build.build({
189
- ...options,
190
- configOptions: extractConfigOptions(options)
191
- });
192
- });
193
- const watchOptions = {
194
- description: "Watch the dictionaries changes",
195
- options: [["--with [with...]", "Start command in parallel with the build"]]
196
- };
197
- const dictionariesWatchCmd = dictionariesProgram.command("watch").description(buildOptions.description);
198
- applyOptions(dictionariesWatchCmd, watchOptions.options);
199
- applyConfigOptions(dictionariesWatchCmd);
200
- dictionariesWatchCmd.action((options) => {
201
- require_watch.watchContentDeclaration({
202
- ...options,
203
- configOptions: extractConfigOptions(options)
204
- });
205
- });
206
- const rootWatchCmd = program.command("watch").description(buildOptions.description);
207
- applyOptions(rootWatchCmd, watchOptions.options);
208
- applyConfigOptions(rootWatchCmd);
209
- rootWatchCmd.action((options) => {
210
- require_watch.watchContentDeclaration({
211
- ...options,
212
- configOptions: extractConfigOptions(options)
213
- });
214
- });
215
- const pullOptions = {
216
- description: "Pull dictionaries from the server",
217
- options: [
218
- ["-d, --dictionaries [ids...]", "List of dictionary IDs to pull"],
219
- ["--dictionary [ids...]", "List of dictionary IDs to pull (alias for --dictionaries)"],
220
- ["--new-dictionaries-path [path]", "Path to save the new dictionaries"],
221
- ["--newDictionariesPath [path]", "[alias] Path to save the new dictionaries"]
222
- ]
223
- };
224
- const dictionariesPullCmd = dictionariesProgram.command("pull").description(pullOptions.description);
225
- applyOptions(dictionariesPullCmd, pullOptions.options);
226
- applyConfigOptions(dictionariesPullCmd);
227
- dictionariesPullCmd.action((options) => {
228
- const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
229
- require_pull.pull({
230
- ...options,
231
- dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
232
- configOptions: {
233
- ...options.configOptions,
234
- baseDir: options.baseDir
235
- }
236
- });
237
- });
238
- const rootPullCmd = program.command("pull").description(pullOptions.description);
239
- applyOptions(rootPullCmd, pullOptions.options);
240
- applyConfigOptions(rootPullCmd);
241
- rootPullCmd.action((options) => {
242
- const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
243
- require_pull.pull({
244
- ...options,
245
- dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
246
- configOptions: extractConfigOptions(options)
247
- });
248
- });
249
- const pushOptions = {
250
- description: "Push all dictionaries. Create or update the pushed dictionaries",
251
- options: [
252
- ["-d, --dictionaries [ids...]", "List of dictionary IDs to push"],
253
- ["--dictionary [ids...]", "List of dictionary IDs to push (alias for --dictionaries)"],
254
- ["-r, --delete-locale-dictionary", "Delete the local dictionaries after pushing"],
255
- ["-k, --keep-locale-dictionary", "Keep the local dictionaries after pushing"],
256
- ["--deleteLocaleDictionary", "[alias] Delete the local dictionaries after pushing"],
257
- ["--keepLocaleDictionary", "[alias] Keep the local dictionaries after pushing"],
258
- ["--build [build]", "Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build"]
259
- ]
260
- };
261
- const dictionariesPushCmd = dictionariesProgram.command("push").description(pushOptions.description);
262
- applyOptions(dictionariesPushCmd, pushOptions.options);
263
- applyConfigOptions(dictionariesPushCmd);
264
- applyGitOptions(dictionariesPushCmd);
265
- dictionariesPushCmd.action((options) => {
266
- const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
267
- return require_push_push.push({
268
- ...options,
269
- dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
270
- gitOptions: extractGitOptions(options),
271
- configOptions: extractConfigOptions(options)
272
- });
273
- });
274
- const rootPushCmd = program.command("push").description(pushOptions.description);
275
- applyOptions(rootPushCmd, pushOptions.options);
276
- applyConfigOptions(rootPushCmd);
277
- applyGitOptions(rootPushCmd);
278
- rootPushCmd.action((options) => {
279
- const dictionaries = [...options.dictionaries || [], ...options.dictionary || []];
280
- return require_push_push.push({
281
- ...options,
282
- dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
283
- gitOptions: extractGitOptions(options),
284
- configOptions: extractConfigOptions(options)
285
- });
286
- });
287
- /**
288
- * CONFIGURATION
289
- */
290
- const configurationProgram = program.command("configuration").alias("config").alias("conf").description("Configuration operations");
291
- const configGetCmd = configurationProgram.command("get").description("Get the configuration");
292
- applyConfigOptions(configGetCmd);
293
- configGetCmd.action((options) => {
294
- require_config.getConfig({
295
- ...options,
296
- configOptions: extractConfigOptions(options)
297
- });
298
- });
299
- const configPushCmd = configurationProgram.command("push").description("Push the configuration");
300
- applyConfigOptions(configPushCmd);
301
- configPushCmd.action((options) => {
302
- require_pushConfig.pushConfig({
303
- ...options,
304
- configOptions: extractConfigOptions(options)
305
- });
306
- });
307
- program.command("projects").alias("project").description("List Intlayer projects").command("list").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--json", "Output the results as JSON").action((options) => {
308
- require_listProjects.listProjectsCommand({
309
- baseDir: options.baseDir,
310
- gitRoot: options.gitRoot,
311
- json: options.json
312
- });
313
- });
314
- program.command("projects-list").alias("pl").description("List all Intlayer projects in the directory").option("--base-dir [baseDir]", "Base directory to search from").option("--git-root", "Search from the git root directory instead of the base directory").option("--absolute", "Output the results as absolute paths").option("--json", "Output the results as JSON").action((options) => {
315
- require_listProjects.listProjectsCommand({
316
- baseDir: options.baseDir,
317
- gitRoot: options.gitRoot,
318
- json: options.json,
319
- absolute: options.absolute
320
- });
321
- });
322
- /**
323
- * CONTENT DECLARATION
324
- */
325
- const contentProgram = program.command("content").description("Content declaration operations");
326
- contentProgram.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
327
- require_listContentDeclaration.listContentDeclaration({
328
- json: options.json,
329
- absolute: options.absolute
330
- });
331
- });
332
- program.command("list").description("List the content declaration files").option("--json", "Output the results as JSON").option("--absolute", "Output the results as absolute paths").action((options) => {
333
- require_listContentDeclaration.listContentDeclaration({
334
- json: options.json,
335
- absolute: options.absolute
336
- });
337
- });
338
- const testProgram = contentProgram.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
339
- applyConfigOptions(testProgram);
340
- testProgram.action((options) => {
341
- require_test_test.testMissingTranslations({
342
- ...options,
343
- configOptions: extractConfigOptions(options)
344
- });
345
- });
346
- const rootTestCmd = program.command("test").description("Test if there are missing translations").option("--build [build]", "Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build");
347
- applyConfigOptions(rootTestCmd);
348
- rootTestCmd.action((options) => {
349
- require_test_test.testMissingTranslations({
350
- ...options,
351
- configOptions: extractConfigOptions(options)
352
- });
353
- });
354
- const fillProgram = program.command("fill").description("Fill the dictionaries").option("-f, --file [files...]", "List of Dictionary files to fill").option("--source-locale [sourceLocale]", "Source locale to translate from").option("--output-locales [outputLocales...]", "Target locales to translate to").option("--mode [mode]", "Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys", "complete").option("-k, --keys [keys...]", "Filter dictionaries based on keys").option("--key [keys...]", "Filter dictionaries based on keys (alias for --keys)").option("--excluded-keys [excludedKeys...]", "Filter out dictionaries based on keys").option("--excluded-key [excludedKeys...]", "Filter out dictionaries based on keys (alias for --excluded-keys)").option("--path-filter [pathFilters...]", "Filter dictionaries based on glob pattern").option("--build [build]", "Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build").option("--skip-metadata", "Skip filling missing metadata (description, title, tags) for dictionaries");
355
- applyConfigOptions(fillProgram);
356
- applyAIOptions(fillProgram);
357
- applyGitOptions(fillProgram);
358
- fillProgram.action((options) => {
359
- const keys = [...options.keys ?? [], ...options.key ?? []];
360
- const excludedKeys = [...options.excludedKeys ?? [], ...options.excludedKey ?? []];
361
- const dictionaries = [...options.dictionaries ?? [], ...options.dictionary ?? []];
362
- return require_fill_fill.fill({
363
- ...options,
364
- keys: keys.length > 0 ? keys : void 0,
365
- excludedKeys: excludedKeys.length > 0 ? excludedKeys : void 0,
366
- dictionaries: dictionaries.length > 0 ? dictionaries : void 0,
367
- aiOptions: extractAiOptions(options),
368
- gitOptions: extractGitOptions(options),
369
- configOptions: extractConfigOptions(options)
370
- });
371
- });
372
- /**
373
- * DOCS
374
- */
375
- const docParams = [
376
- ["--doc-pattern [docPattern...]", "Documentation pattern"],
377
- ["--excluded-glob-pattern [excludedGlobPattern...]", "Excluded glob pattern"],
378
- ["--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]", "Number of simultaneous file processed"],
379
- ["--locales [locales...]", "Locales"],
380
- ["--base-locale [baseLocale]", "Base locale"],
381
- ["--custom-instructions [customInstructions]", "Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc."],
382
- ["--skip-if-modified-before [skipIfModifiedBefore]", "Skip the file if it has been modified before the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file."],
383
- ["--skip-if-modified-after [skipIfModifiedAfter]", "Skip the file if it has been modified within the given time. Can be an absolute time as \"2025-12-05\" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file."],
384
- ["--skip-if-exists", "Skip the file if it already exists"]
385
- ];
386
- const docProgram = program.command("doc").description("Documentation operations");
387
- const translateProgram = docProgram.command("translate").description("Translate the documentation");
388
- applyConfigOptions(translateProgram);
389
- applyAIOptions(translateProgram);
390
- applyGitOptions(translateProgram);
391
- applyOptions(translateProgram, docParams);
392
- translateProgram.action((options) => require_translateDoc_translateDoc.translateDoc({
393
- docPattern: options.docPattern,
394
- excludedGlobPattern: options.excludedGlobPattern,
395
- locales: options.locales,
396
- baseLocale: options.baseLocale,
397
- aiOptions: extractAiOptions(options),
398
- gitOptions: extractGitOptions(options),
399
- nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
400
- configOptions: extractConfigOptions(options),
401
- customInstructions: options.customInstructions,
402
- skipIfModifiedBefore: options.skipIfModifiedBefore,
403
- skipIfModifiedAfter: options.skipIfModifiedAfter,
404
- skipIfExists: options.skipIfExists
405
- }));
406
- const reviewProgram = docProgram.command("review").description("Review the documentation");
407
- applyConfigOptions(reviewProgram);
408
- applyAIOptions(reviewProgram);
409
- applyGitOptions(reviewProgram);
410
- applyOptions(reviewProgram, docParams);
411
- reviewProgram.action((options) => require_reviewDoc_reviewDoc.reviewDoc({
412
- docPattern: options.docPattern,
413
- excludedGlobPattern: options.excludedGlobPattern,
414
- locales: options.locales,
415
- baseLocale: options.baseLocale,
416
- aiOptions: extractAiOptions(options),
417
- gitOptions: extractGitOptions(options),
418
- nbSimultaneousFileProcessed: options.nbSimultaneousFileProcessed,
419
- configOptions: extractConfigOptions(options),
420
- customInstructions: options.customInstructions,
421
- skipIfModifiedBefore: options.skipIfModifiedBefore,
422
- skipIfModifiedAfter: options.skipIfModifiedAfter,
423
- skipIfExists: options.skipIfExists
424
- }));
425
- const searchProgram = docProgram.command("search").description("Search the documentation").argument("<query>", "Search query").option("--limit [limit]", "Limit the number of results", "10");
426
- applyConfigOptions(searchProgram);
427
- searchProgram.action((query, options) => require_searchDoc.searchDoc({
428
- query,
429
- limit: options.limit ? parseInt(options.limit, 10) : 10,
430
- configOptions: extractConfigOptions(options)
431
- }));
432
- /**
433
- * LIVE SYNC
434
- */
435
- const liveOptions = [["--with [with...]", "Start command in parallel with the live sync"]];
436
- const liveCmd = program.command("live").description("Live sync - Watch for changes made on the CMS and update the application content accordingly");
437
- applyOptions(liveCmd, liveOptions);
438
- applyConfigOptions(liveCmd);
439
- liveCmd.action((options) => require_liveSync.liveSync(options));
440
- const editorStartCmd = program.command("editor").description("Visual editor operations").command("start").description("Start the Intlayer visual editor");
441
- applyConfigOptions(editorStartCmd);
442
- editorStartCmd.action((options) => {
443
- require_editor.startEditor({
444
- env: options.env,
445
- envFile: options.envFile
446
- });
447
- });
448
- /**
449
- * EXTRACT
450
- */
451
- const extractProgram = program.command("extract").alias("ext").description("Extract strings from components to be placed in a .content file close to the component");
452
- extractProgram.option("-f, --file [files...]", "List of files to extract").option("-o, --output-content-declarations [outputContentDeclarations]", "Path to output content declaration files").option("--code-only", "Only extract the component code", false).option("--declaration-only", "Only generate content declaration", false).action((options) => {
453
- require_extract.extract({
454
- files: options.file,
455
- outputContentDeclarations: options.outputContentDeclarations,
456
- configOptions: extractConfigOptions(options),
457
- codeOnly: options.codeOnly,
458
- declarationOnly: options.declarationOnly
459
- });
460
- });
461
- applyConfigOptions(extractProgram);
462
- program.parse(process.argv);
463
- /**
464
- * CI / AUTOMATION
465
- *
466
- * Used to iterate over all projects in a monorepo, and help to parse secrets
467
- */
468
- program.command("ci").description("Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.").argument("<command...>", "The intlayer command to execute (e.g., \"fill\", \"push\")").allowUnknownOption().action((args) => {
469
- require_ci.runCI(args);
470
- });
471
- return program;
472
- };
473
-
474
- //#endregion
475
- exports.dirname = dirname;
476
- exports.setAPI = setAPI;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);const e=require(`./build.cjs`),t=require(`./ci.cjs`),n=require(`./auth/login.cjs`),r=require(`./config.cjs`),i=require(`./editor.cjs`),a=require(`./extract.cjs`),o=require(`./test/test.cjs`),s=require(`./fill/fill.cjs`),c=require(`./init.cjs`),l=require(`./listContentDeclaration.cjs`),u=require(`./listProjects.cjs`),ee=require(`./liveSync.cjs`),d=require(`./pull.cjs`),f=require(`./push/push.cjs`),te=require(`./pushConfig.cjs`),ne=require(`./reviewDoc/reviewDoc.cjs`),re=require(`./searchDoc.cjs`),ie=require(`./translateDoc/translateDoc.cjs`),p=require(`./utils/getParentPackageJSON.cjs`),m=require(`./watch.cjs`);let h=require(`@intlayer/config/node`),g=require(`node:path`),_=require(`@intlayer/config/logger`),v=require(`node:url`),y=require(`commander`);const b=typeof require(`url`).pathToFileURL(__filename).href==`string`?(0,g.dirname)((0,v.fileURLToPath)(require(`url`).pathToFileURL(__filename).href)):__dirname,x=p.getParentPackageJSON(b),S=[[`--env-file [envFile]`,`Environment file`],[`-e, --env [env]`,`Environment`],[`--base-dir [baseDir]`,`Base directory`],[`--no-cache [noCache]`,`No cache`],...[[`--verbose`,`Verbose (default to true using CLI)`],[`--prefix [prefix]`,`Prefix`]]],C=[[`--provider [provider]`,`Provider`],[`--temperature [temperature]`,`Temperature`],[`--model [model]`,`Model`],[`--api-key [apiKey]`,`Provider API key`],[`--custom-prompt [prompt]`,`Custom prompt`],[`--application-context [applicationContext]`,`Application context`],[`--data-serialization [dataSerialization]`,`Data serialization`]],w=[[`--git-diff [gitDiff]`,`Git diff mode - Check git diff between two refs`],[`--git-diff-base [gitDiffBase]`,`Git diff base ref`],[`--git-diff-current [gitDiffCurrent]`,`Git diff current ref`],[`--uncommitted [uncommitted]`,`Uncommitted`],[`--unpushed [unpushed]`,`Unpushed`],[`--untracked [untracked]`,`Untracked`]],T=(e,t)=>t.filter(t=>e[t]),E=(e,t)=>(t.forEach(([t,n])=>{e.option(t,n)}),e),D=e=>Object.fromEntries(Object.entries(e).filter(([e,t])=>t!==void 0)),O=e=>E(e,S),k=e=>E(e,C),A=e=>E(e,w),j=e=>{let{apiKey:t,provider:n,model:r,temperature:i,applicationContext:a,customPrompt:o,dataSerialization:s}=e,c=(0,h.getConfiguration)(),{ai:l}=c;return D({...l,apiKey:t??c.ai?.apiKey,provider:n??c.ai?.provider,model:r??c.ai?.model,temperature:i??c.ai?.temperature,applicationContext:a??c.ai?.applicationContext,customPrompt:o??c.ai?.customPrompt,dataSerialization:s??c.ai?.dataSerialization})},M=[`gitDiff`,`gitDiffBase`,`gitDiffCurrent`,`uncommitted`,`unpushed`,`untracked`],N=e=>{let t=T(e,M);if(!Object.values(t).some(Boolean))return;let{gitDiff:n,gitDiffBase:r,gitDiffCurrent:i,uncommitted:a,unpushed:o,untracked:s}=e;return D({mode:[n&&`gitDiff`,a&&`uncommitted`,o&&`unpushed`,s&&`untracked`].filter(Boolean),baseRef:r,currentRef:i,absolute:!0})},P=[`baseDir`,`env`,`envFile`,`verbose`,`prefix`],F=e=>{let t=(0,h.getConfiguration)(e),n=T(e,P);if(!Object.values(n).some(Boolean))return;let{baseDir:r,env:i,envFile:a,verbose:o,prefix:s,noCache:c}=e,l=!!e.with;return typeof s==`string`?(0,_.setPrefix)(s):l&&(0,_.setPrefix)(t.log.prefix),D({baseDir:r,env:i,envFile:a,override:{log:{verbose:o??!0}},cache:!c})},I=()=>{(0,_.setPrefix)(``);let p=new y.Command;p.version(x.version).description(`Intlayer CLI`),p.command(`version`).description(`Print the Intlayer CLI version`).action(()=>{console.log(x.version??`unknown`)});let h=p.command(`login`).description(`Login to Intlayer`).option(`--cms-url [cmsUrl]`,`CMS URL`);O(h),h.action(e=>{let t=F(e)??{override:{log:{prefix:``,verbose:!0}}};return n.login({cmsUrl:e.cmsUrl,configOptions:t})}),p.command(`init`).description(`Initialize Intlayer in the project`).option(`--project-root [projectRoot]`,`Project root directory`).action(e=>c.init(e.projectRoot)).command(`skills`).description(`Initialize Intlayer skills in the project`).option(`--project-root [projectRoot]`,`Project root directory`).action(e=>c.initSkills(e.projectRoot));let g=p.command(`dictionary`).alias(`dictionaries`).alias(`dic`).description(`Dictionaries operations`),v={description:`Build the dictionaries`,options:[[`-w, --watch`,`Watch for changes`],[`--skip-prepare`,`Skip the prepare step`],[`--with [with...]`,`Start command in parallel with the build`]]},b=g.command(`build`).description(v.description);E(b,v.options),O(b),b.action(t=>{e.build({...t,configOptions:F(t)})});let S=p.command(`build`).description(v.description);E(S,v.options),O(S),S.action(t=>{e.build({...t,configOptions:F(t)})});let C={description:`Watch the dictionaries changes`,options:[[`--with [with...]`,`Start command in parallel with the build`]]},w=g.command(`watch`).description(v.description);E(w,C.options),O(w),w.action(e=>{m.watchContentDeclaration({...e,configOptions:F(e)})});let T=p.command(`watch`).description(v.description);E(T,C.options),O(T),T.action(e=>{m.watchContentDeclaration({...e,configOptions:F(e)})});let D={description:`Pull dictionaries from the server`,options:[[`-d, --dictionaries [ids...]`,`List of dictionary IDs to pull`],[`--dictionary [ids...]`,`List of dictionary IDs to pull (alias for --dictionaries)`],[`--new-dictionaries-path [path]`,`Path to save the new dictionaries`],[`--newDictionariesPath [path]`,`[alias] Path to save the new dictionaries`]]},M=g.command(`pull`).description(D.description);E(M,D.options),O(M),M.action(e=>{let t=[...e.dictionaries??[],...e.dictionary??[]];d.pull({...e,dictionaries:t.length>0?t:void 0,configOptions:{...e.configOptions,baseDir:e.baseDir}})});let P=p.command(`pull`).description(D.description);E(P,D.options),O(P),P.action(e=>{let t=[...e.dictionaries??[],...e.dictionary??[]];d.pull({...e,dictionaries:t.length>0?t:void 0,configOptions:F(e)})});let I={description:`Push all dictionaries. Create or update the pushed dictionaries`,options:[[`-d, --dictionaries [ids...]`,`List of dictionary IDs to push`],[`--dictionary [ids...]`,`List of dictionary IDs to push (alias for --dictionaries)`],[`-r, --delete-locale-dictionary`,`Delete the local dictionaries after pushing`],[`-k, --keep-locale-dictionary`,`Keep the local dictionaries after pushing`],[`--deleteLocaleDictionary`,`[alias] Delete the local dictionaries after pushing`],[`--keepLocaleDictionary`,`[alias] Keep the local dictionaries after pushing`],[`--build [build]`,`Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`]]},L=g.command(`push`).description(I.description);E(L,I.options),O(L),A(L),L.action(e=>{let t=[...e.dictionaries||[],...e.dictionary||[]];return f.push({...e,dictionaries:t.length>0?t:void 0,gitOptions:N(e),configOptions:F(e)})});let R=p.command(`push`).description(I.description);E(R,I.options),O(R),A(R),R.action(e=>{let t=[...e.dictionaries||[],...e.dictionary||[]];return f.push({...e,dictionaries:t.length>0?t:void 0,gitOptions:N(e),configOptions:F(e)})});let z=p.command(`configuration`).alias(`config`).alias(`conf`).description(`Configuration operations`),B=z.command(`get`).description(`Get the configuration`);O(B),B.action(e=>{r.getConfig({...e,configOptions:F(e)})});let V=z.command(`push`).description(`Push the configuration`);O(V),V.action(e=>{te.pushConfig({...e,configOptions:F(e)})}),p.command(`projects`).alias(`project`).description(`List Intlayer projects`).command(`list`).description(`List all Intlayer projects in the directory`).option(`--base-dir [baseDir]`,`Base directory to search from`).option(`--git-root`,`Search from the git root directory instead of the base directory`).option(`--json`,`Output the results as JSON`).action(e=>{u.listProjectsCommand({baseDir:e.baseDir,gitRoot:e.gitRoot,json:e.json})}),p.command(`projects-list`).alias(`pl`).description(`List all Intlayer projects in the directory`).option(`--base-dir [baseDir]`,`Base directory to search from`).option(`--git-root`,`Search from the git root directory instead of the base directory`).option(`--absolute`,`Output the results as absolute paths`).option(`--json`,`Output the results as JSON`).action(e=>{u.listProjectsCommand({baseDir:e.baseDir,gitRoot:e.gitRoot,json:e.json,absolute:e.absolute})});let H=p.command(`content`).description(`Content declaration operations`);H.command(`list`).description(`List the content declaration files`).option(`--json`,`Output the results as JSON`).option(`--absolute`,`Output the results as absolute paths`).action(e=>{l.listContentDeclaration({json:e.json,absolute:e.absolute})}),p.command(`list`).description(`List the content declaration files`).option(`--json`,`Output the results as JSON`).option(`--absolute`,`Output the results as absolute paths`).action(e=>{l.listContentDeclaration({json:e.json,absolute:e.absolute})});let U=H.command(`test`).description(`Test if there are missing translations`).option(`--build [build]`,`Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`);O(U),U.action(e=>{o.testMissingTranslations({...e,configOptions:F(e)})});let W=p.command(`test`).description(`Test if there are missing translations`).option(`--build [build]`,`Build the dictionaries before testing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`);O(W),W.action(e=>{o.testMissingTranslations({...e,configOptions:F(e)})});let G=p.command(`fill`).description(`Fill the dictionaries`).option(`-f, --file [files...]`,`List of Dictionary files to fill`).option(`--source-locale [sourceLocale]`,`Source locale to translate from`).option(`--output-locales [outputLocales...]`,`Target locales to translate to`).option(`--mode [mode]`,`Fill mode: complete, review. Complete will fill all missing content, review will fill missing content and review existing keys`,`complete`).option(`-k, --keys [keys...]`,`Filter dictionaries based on keys`).option(`--key [keys...]`,`Filter dictionaries based on keys (alias for --keys)`).option(`--excluded-keys [excludedKeys...]`,`Filter out dictionaries based on keys`).option(`--excluded-key [excludedKeys...]`,`Filter out dictionaries based on keys (alias for --excluded-keys)`).option(`--path-filter [pathFilters...]`,`Filter dictionaries based on glob pattern`).option(`--build [build]`,`Build the dictionaries before filling to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build`).option(`--skip-metadata`,`Skip filling missing metadata (description, title, tags) for dictionaries`);O(G),k(G),A(G),G.action(e=>{let t=[...e.keys??[],...e.key??[]],n=[...e.excludedKeys??[],...e.excludedKey??[]],r=[...e.dictionaries??[],...e.dictionary??[]];return s.fill({...e,keys:t.length>0?t:void 0,excludedKeys:n.length>0?n:void 0,dictionaries:r.length>0?r:void 0,aiOptions:j(e),gitOptions:N(e),configOptions:F(e)})});let K=[[`--doc-pattern [docPattern...]`,`Documentation pattern`],[`--excluded-glob-pattern [excludedGlobPattern...]`,`Excluded glob pattern`],[`--nb-simultaneous-file-processed [nbSimultaneousFileProcessed]`,`Number of simultaneous file processed`],[`--locales [locales...]`,`Locales`],[`--base-locale [baseLocale]`,`Base locale`],[`--custom-instructions [customInstructions]`,`Custom instructions added to the prompt. Usefull to apply specific rules regarding formatting, urls translation, etc.`],[`--skip-if-modified-before [skipIfModifiedBefore]`,'Skip the file if it has been modified before the given time. Can be an absolute time as "2025-12-05" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.'],[`--skip-if-modified-after [skipIfModifiedAfter]`,'Skip the file if it has been modified within the given time. Can be an absolute time as "2025-12-05" (string or Date) or a relative time in ms `1 * 60 * 60 * 1000` (1 hour). This option check update time of the file using the `fs.stat` method. So it could be impacted by Git or other tools that modify the file.'],[`--skip-if-exists`,`Skip the file if it already exists`]],q=p.command(`doc`).description(`Documentation operations`),J=q.command(`translate`).description(`Translate the documentation`);O(J),k(J),A(J),E(J,K),J.action(e=>ie.translateDoc({docPattern:e.docPattern,excludedGlobPattern:e.excludedGlobPattern,locales:e.locales,baseLocale:e.baseLocale,aiOptions:j(e),gitOptions:N(e),nbSimultaneousFileProcessed:e.nbSimultaneousFileProcessed,configOptions:F(e),customInstructions:e.customInstructions,skipIfModifiedBefore:e.skipIfModifiedBefore,skipIfModifiedAfter:e.skipIfModifiedAfter,skipIfExists:e.skipIfExists}));let Y=q.command(`review`).description(`Review the documentation`);O(Y),k(Y),A(Y),E(Y,K),Y.action(e=>ne.reviewDoc({docPattern:e.docPattern,excludedGlobPattern:e.excludedGlobPattern,locales:e.locales,baseLocale:e.baseLocale,aiOptions:j(e),gitOptions:N(e),nbSimultaneousFileProcessed:e.nbSimultaneousFileProcessed,configOptions:F(e),customInstructions:e.customInstructions,skipIfModifiedBefore:e.skipIfModifiedBefore,skipIfModifiedAfter:e.skipIfModifiedAfter,skipIfExists:e.skipIfExists}));let X=q.command(`search`).description(`Search the documentation`).argument(`<query>`,`Search query`).option(`--limit [limit]`,`Limit the number of results`,`10`);O(X),X.action((e,t)=>re.searchDoc({query:e,limit:t.limit?parseInt(t.limit,10):10,configOptions:F(t)}));let ae=[[`--with [with...]`,`Start command in parallel with the live sync`]],Z=p.command(`live`).description(`Live sync - Watch for changes made on the CMS and update the application content accordingly`);E(Z,ae),O(Z),Z.action(e=>ee.liveSync(e));let Q=p.command(`editor`).description(`Visual editor operations`).command(`start`).description(`Start the Intlayer visual editor`);O(Q),Q.action(e=>{i.startEditor({env:e.env,envFile:e.envFile})});let $=p.command(`extract`).alias(`ext`).description(`Extract strings from components to be placed in a .content file close to the component`);return $.option(`-f, --file [files...]`,`List of files to extract`).option(`-o, --output-content-declarations [outputContentDeclarations]`,`Path to output content declaration files`).option(`--code-only`,`Only extract the component code`,!1).option(`--declaration-only`,`Only generate content declaration`,!1).action(e=>{a.extract({files:e.file,outputContentDeclarations:e.outputContentDeclarations,configOptions:F(e),codeOnly:e.codeOnly,declarationOnly:e.declarationOnly})}),O($),p.parse(process.argv),p.command(`ci`).description(`Run Intlayer commands with auto-injected credentials from INTLAYER_PROJECT_CREDENTIALS. Detects current project or iterates over all projects.`).argument(`<command...>`,`The intlayer command to execute (e.g., "fill", "push")`).allowUnknownOption().action(e=>{t.runCI(e)}),p};exports.dirname=b,exports.setAPI=I;
477
2
  //# sourceMappingURL=cli.cjs.map