@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.
- package/dist/cjs/IntlayerEventListener.cjs +1 -2
- package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/_virtual/_utils_asset.cjs +2 -3
- package/dist/cjs/auth/login.cjs +19 -9
- package/dist/cjs/auth/login.cjs.map +1 -1
- package/dist/cjs/auth/sessionToken.cjs +1 -2
- package/dist/cjs/auth/setupRepository.cjs +94 -0
- package/dist/cjs/auth/setupRepository.cjs.map +1 -0
- package/dist/cjs/build.cjs +2 -3
- package/dist/cjs/bundle.cjs +1 -2
- package/dist/cjs/ci.cjs +2 -3
- package/dist/cjs/cli.cjs +17 -12
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/config.cjs +2 -3
- package/dist/cjs/editor.cjs +62 -34
- package/dist/cjs/editor.cjs.map +1 -1
- package/dist/cjs/extract.cjs +7 -8
- package/dist/cjs/fill/deepMergeContent.cjs +1 -2
- package/dist/cjs/fill/extractTranslatableContent.cjs +1 -2
- package/dist/cjs/fill/fill.cjs +9 -10
- package/dist/cjs/fill/fill.cjs.map +1 -1
- package/dist/cjs/fill/formatAutoFilledFilePath.cjs +2 -3
- package/dist/cjs/fill/formatFillData.cjs +2 -3
- package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +1 -2
- package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +1 -2
- package/dist/cjs/fill/index.cjs +2 -2
- package/dist/cjs/fill/listTranslationsTasks.cjs +4 -5
- package/dist/cjs/fill/translateDictionary.cjs +6 -7
- package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
- package/dist/cjs/fill/writeFill.cjs +4 -5
- package/dist/cjs/getTargetDictionary.cjs +2 -3
- package/dist/cjs/index.cjs +37 -23
- package/dist/cjs/init.cjs +175 -22
- package/dist/cjs/init.cjs.map +1 -1
- package/dist/cjs/initChromeExtension.cjs +5 -6
- package/dist/cjs/initInfra.cjs +3 -4
- package/dist/cjs/initMCP.cjs +6 -7
- package/dist/cjs/initSkills.cjs +6 -7
- package/dist/cjs/listContentDeclaration.cjs +3 -4
- package/dist/cjs/listProjects.cjs +1 -2
- package/dist/cjs/liveSync.cjs +4 -5
- package/dist/cjs/liveSync.cjs.map +1 -1
- package/dist/cjs/loadPrompts.cjs +1 -2
- package/dist/cjs/pull.cjs +9 -11
- package/dist/cjs/pull.cjs.map +1 -1
- package/dist/cjs/push/pullLog.cjs +2 -3
- package/dist/cjs/push/push.cjs +10 -10
- package/dist/cjs/push/push.cjs.map +1 -1
- package/dist/cjs/pushConfig.cjs +4 -5
- package/dist/cjs/pushLog.cjs +2 -3
- package/dist/cjs/reviewDoc/reviewDoc.cjs +15 -15
- package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
- package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +8 -9
- package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
- package/dist/cjs/reviewDoc/reviewDocLog.cjs +2 -3
- package/dist/cjs/reviewDoc/reviewDocProgress.cjs +2 -3
- package/dist/cjs/reviewDoc/reviewDocSynthesis.cjs +2 -3
- package/dist/cjs/scan.cjs +2 -3
- package/dist/cjs/searchDoc.cjs +2 -3
- package/dist/cjs/test/index.cjs +2 -2
- package/dist/cjs/test/listMissingTranslations.cjs +2 -3
- package/dist/cjs/test/test.cjs +3 -4
- package/dist/cjs/translateDoc/index.cjs +3 -3
- package/dist/cjs/translateDoc/translateDoc.cjs +12 -13
- package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
- package/dist/cjs/translateDoc/translateFile.cjs +8 -9
- package/dist/cjs/translateDoc/validation.cjs +1 -2
- package/dist/cjs/upgrade.cjs +2 -3
- package/dist/cjs/utils/calculateChunks.cjs +1 -2
- package/dist/cjs/utils/checkAccess.cjs +5 -6
- package/dist/cjs/utils/checkAccess.cjs.map +1 -1
- package/dist/cjs/utils/checkConfigConsistency.cjs +1 -2
- package/dist/cjs/utils/checkFileModifiedRange.cjs +3 -4
- package/dist/cjs/utils/checkLastUpdateTime.cjs +1 -2
- package/dist/cjs/utils/chunkInference.cjs +2 -3
- package/dist/cjs/utils/detectGitRepository.cjs +86 -0
- package/dist/cjs/utils/detectGitRepository.cjs.map +1 -0
- package/dist/cjs/utils/fixChunkStartEndChars.cjs +1 -2
- package/dist/cjs/utils/formatLineRanges.cjs +1 -2
- package/dist/cjs/utils/formatTimeDiff.cjs +1 -2
- package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +1 -2
- package/dist/cjs/utils/getOutputFilePath.cjs +1 -2
- package/dist/cjs/utils/getParentPackageJSON.cjs +2 -3
- package/dist/cjs/utils/isInteractiveTerminal.cjs +1 -2
- package/dist/cjs/utils/listSpecialChars.cjs +1 -2
- package/dist/cjs/utils/mapChunksBetweenFiles.cjs +2 -3
- package/dist/cjs/utils/openBrowser.cjs +1 -2
- package/dist/cjs/utils/parseChoice.cjs +1 -2
- package/dist/cjs/utils/reorderParagraphs.cjs +2 -3
- package/dist/cjs/utils/selectCmsEnvironment.cjs +2 -3
- package/dist/cjs/utils/setupAI.cjs +3 -4
- package/dist/cjs/watch.cjs +2 -3
- package/dist/esm/IntlayerEventListener.mjs +1 -2
- package/dist/esm/IntlayerEventListener.mjs.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/esm/_virtual/_utils_asset.mjs +2 -3
- package/dist/esm/auth/login.mjs +15 -5
- package/dist/esm/auth/login.mjs.map +1 -1
- package/dist/esm/auth/sessionToken.mjs +1 -2
- package/dist/esm/auth/setupRepository.mjs +89 -0
- package/dist/esm/auth/setupRepository.mjs.map +1 -0
- package/dist/esm/build.mjs +2 -3
- package/dist/esm/bundle.mjs +1 -2
- package/dist/esm/ci.mjs +2 -3
- package/dist/esm/cli.mjs +16 -11
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/config.mjs +2 -3
- package/dist/esm/editor.mjs +63 -36
- package/dist/esm/editor.mjs.map +1 -1
- package/dist/esm/extract.mjs +5 -6
- package/dist/esm/fill/deepMergeContent.mjs +1 -2
- package/dist/esm/fill/extractTranslatableContent.mjs +1 -2
- package/dist/esm/fill/fill.mjs +3 -4
- package/dist/esm/fill/fill.mjs.map +1 -1
- package/dist/esm/fill/formatAutoFilledFilePath.mjs +2 -3
- package/dist/esm/fill/formatFillData.mjs +1 -2
- package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +1 -2
- package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +1 -2
- package/dist/esm/fill/index.mjs +1 -1
- package/dist/esm/fill/listTranslationsTasks.mjs +2 -3
- package/dist/esm/fill/translateDictionary.mjs +2 -3
- package/dist/esm/fill/translateDictionary.mjs.map +1 -1
- package/dist/esm/fill/writeFill.mjs +2 -3
- package/dist/esm/getTargetDictionary.mjs +2 -3
- package/dist/esm/index.mjs +15 -11
- package/dist/esm/init.mjs +169 -20
- package/dist/esm/init.mjs.map +1 -1
- package/dist/esm/initChromeExtension.mjs +2 -3
- package/dist/esm/initInfra.mjs +1 -2
- package/dist/esm/initMCP.mjs +3 -4
- package/dist/esm/initSkills.mjs +2 -3
- package/dist/esm/listContentDeclaration.mjs +3 -4
- package/dist/esm/listProjects.mjs +1 -2
- package/dist/esm/liveSync.mjs +2 -3
- package/dist/esm/liveSync.mjs.map +1 -1
- package/dist/esm/loadPrompts.mjs +1 -2
- package/dist/esm/pull.mjs +6 -8
- package/dist/esm/pull.mjs.map +1 -1
- package/dist/esm/push/pullLog.mjs +1 -2
- package/dist/esm/push/push.mjs +6 -6
- package/dist/esm/push/push.mjs.map +1 -1
- package/dist/esm/pushConfig.mjs +2 -3
- package/dist/esm/pushLog.mjs +1 -2
- package/dist/esm/reviewDoc/reviewDoc.mjs +8 -8
- package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
- package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +3 -4
- package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
- package/dist/esm/reviewDoc/reviewDocLog.mjs +2 -3
- package/dist/esm/reviewDoc/reviewDocProgress.mjs +1 -2
- package/dist/esm/reviewDoc/reviewDocSynthesis.mjs +1 -2
- package/dist/esm/scan.mjs +1 -2
- package/dist/esm/searchDoc.mjs +2 -3
- package/dist/esm/test/listMissingTranslations.mjs +2 -3
- package/dist/esm/test/test.mjs +1 -2
- package/dist/esm/translateDoc/index.mjs +2 -2
- package/dist/esm/translateDoc/translateDoc.mjs +7 -8
- package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
- package/dist/esm/translateDoc/translateFile.mjs +4 -5
- package/dist/esm/translateDoc/validation.mjs +1 -2
- package/dist/esm/upgrade.mjs +1 -2
- package/dist/esm/utils/calculateChunks.mjs +1 -2
- package/dist/esm/utils/checkAccess.mjs +2 -3
- package/dist/esm/utils/checkAccess.mjs.map +1 -1
- package/dist/esm/utils/checkConfigConsistency.mjs +1 -2
- package/dist/esm/utils/checkFileModifiedRange.mjs +1 -2
- package/dist/esm/utils/checkLastUpdateTime.mjs +1 -2
- package/dist/esm/utils/chunkInference.mjs +1 -2
- package/dist/esm/utils/detectGitRepository.mjs +84 -0
- package/dist/esm/utils/detectGitRepository.mjs.map +1 -0
- package/dist/esm/utils/fixChunkStartEndChars.mjs +1 -2
- package/dist/esm/utils/formatLineRanges.mjs +1 -2
- package/dist/esm/utils/formatTimeDiff.mjs +1 -2
- package/dist/esm/utils/getIsFileUpdatedRecently.mjs +1 -2
- package/dist/esm/utils/getOutputFilePath.mjs +1 -2
- package/dist/esm/utils/getParentPackageJSON.mjs +2 -3
- package/dist/esm/utils/isInteractiveTerminal.mjs +1 -2
- package/dist/esm/utils/listSpecialChars.mjs +1 -2
- package/dist/esm/utils/mapChunksBetweenFiles.mjs +1 -2
- package/dist/esm/utils/openBrowser.mjs +1 -2
- package/dist/esm/utils/parseChoice.mjs +1 -2
- package/dist/esm/utils/reorderParagraphs.mjs +1 -2
- package/dist/esm/utils/selectCmsEnvironment.mjs +1 -2
- package/dist/esm/utils/setupAI.mjs +1 -2
- package/dist/esm/watch.mjs +2 -3
- package/dist/types/IntlayerEventListener.d.ts +1 -3
- package/dist/types/IntlayerEventListener.d.ts.map +1 -1
- package/dist/types/auth/login.d.ts +6 -2
- package/dist/types/auth/login.d.ts.map +1 -1
- package/dist/types/auth/sessionToken.d.ts +0 -2
- package/dist/types/auth/sessionToken.d.ts.map +1 -1
- package/dist/types/auth/setupRepository.d.ts +24 -0
- package/dist/types/auth/setupRepository.d.ts.map +1 -0
- package/dist/types/build.d.ts +1 -2
- package/dist/types/build.d.ts.map +1 -1
- package/dist/types/bundle.d.ts +0 -2
- package/dist/types/bundle.d.ts.map +1 -1
- package/dist/types/ci.d.ts +1 -2
- package/dist/types/ci.d.ts.map +1 -1
- package/dist/types/cli.d.ts +1 -2
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -2
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/editor.d.ts +11 -2
- package/dist/types/editor.d.ts.map +1 -1
- package/dist/types/extract.d.ts +1 -2
- package/dist/types/extract.d.ts.map +1 -1
- package/dist/types/fill/deepMergeContent.d.ts +0 -2
- package/dist/types/fill/deepMergeContent.d.ts.map +1 -1
- package/dist/types/fill/extractTranslatableContent.d.ts +0 -2
- package/dist/types/fill/extractTranslatableContent.d.ts.map +1 -1
- package/dist/types/fill/fill.d.ts +1 -3
- package/dist/types/fill/fill.d.ts.map +1 -1
- package/dist/types/fill/formatAutoFilledFilePath.d.ts +0 -2
- package/dist/types/fill/formatAutoFilledFilePath.d.ts.map +1 -1
- package/dist/types/fill/formatFillData.d.ts +0 -2
- package/dist/types/fill/formatFillData.d.ts.map +1 -1
- package/dist/types/fill/getAvailableLocalesInDictionary.d.ts +0 -2
- package/dist/types/fill/getAvailableLocalesInDictionary.d.ts.map +1 -1
- package/dist/types/fill/getFilterMissingContentPerLocale.d.ts +0 -2
- package/dist/types/fill/getFilterMissingContentPerLocale.d.ts.map +1 -1
- package/dist/types/fill/listTranslationsTasks.d.ts +0 -2
- package/dist/types/fill/listTranslationsTasks.d.ts.map +1 -1
- package/dist/types/fill/translateDictionary.d.ts +3 -5
- package/dist/types/fill/translateDictionary.d.ts.map +1 -1
- package/dist/types/fill/writeFill.d.ts +0 -2
- package/dist/types/fill/writeFill.d.ts.map +1 -1
- package/dist/types/getTargetDictionary.d.ts +0 -2
- package/dist/types/getTargetDictionary.d.ts.map +1 -1
- package/dist/types/index.d.ts +7 -3
- package/dist/types/init.d.ts +20 -4
- package/dist/types/init.d.ts.map +1 -1
- package/dist/types/initChromeExtension.d.ts +0 -2
- package/dist/types/initChromeExtension.d.ts.map +1 -1
- package/dist/types/initInfra.d.ts +0 -2
- package/dist/types/initInfra.d.ts.map +1 -1
- package/dist/types/initMCP.d.ts +0 -2
- package/dist/types/initMCP.d.ts.map +1 -1
- package/dist/types/initSkills.d.ts +0 -2
- package/dist/types/initSkills.d.ts.map +1 -1
- package/dist/types/listContentDeclaration.d.ts +1 -2
- package/dist/types/listContentDeclaration.d.ts.map +1 -1
- package/dist/types/listProjects.d.ts +0 -2
- package/dist/types/listProjects.d.ts.map +1 -1
- package/dist/types/liveSync.d.ts +1 -2
- package/dist/types/liveSync.d.ts.map +1 -1
- package/dist/types/loadPrompts.d.ts +0 -2
- package/dist/types/loadPrompts.d.ts.map +1 -1
- package/dist/types/pull.d.ts +1 -2
- package/dist/types/pull.d.ts.map +1 -1
- package/dist/types/push/pullLog.d.ts +0 -2
- package/dist/types/push/pullLog.d.ts.map +1 -1
- package/dist/types/push/push.d.ts +1 -2
- package/dist/types/push/push.d.ts.map +1 -1
- package/dist/types/pushConfig.d.ts +1 -2
- package/dist/types/pushConfig.d.ts.map +1 -1
- package/dist/types/pushLog.d.ts +0 -2
- package/dist/types/pushLog.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDoc.d.ts +2 -3
- package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -4
- package/dist/types/reviewDoc/reviewDocBlockAware.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocLog.d.ts +0 -2
- package/dist/types/reviewDoc/reviewDocLog.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocProgress.d.ts +0 -2
- package/dist/types/reviewDoc/reviewDocProgress.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocSynthesis.d.ts +0 -2
- package/dist/types/reviewDoc/reviewDocSynthesis.d.ts.map +1 -1
- package/dist/types/scan.d.ts +0 -2
- package/dist/types/scan.d.ts.map +1 -1
- package/dist/types/searchDoc.d.ts +1 -2
- package/dist/types/searchDoc.d.ts.map +1 -1
- package/dist/types/test/listMissingTranslations.d.ts +0 -2
- package/dist/types/test/listMissingTranslations.d.ts.map +1 -1
- package/dist/types/test/test.d.ts +1 -2
- package/dist/types/test/test.d.ts.map +1 -1
- package/dist/types/translateDoc/index.d.ts +1 -1
- package/dist/types/translateDoc/translateDoc.d.ts +0 -2
- package/dist/types/translateDoc/translateDoc.d.ts.map +1 -1
- package/dist/types/translateDoc/translateFile.d.ts +0 -2
- package/dist/types/translateDoc/translateFile.d.ts.map +1 -1
- package/dist/types/translateDoc/types.d.ts +1 -3
- package/dist/types/translateDoc/types.d.ts.map +1 -1
- package/dist/types/translateDoc/validation.d.ts +0 -2
- package/dist/types/translateDoc/validation.d.ts.map +1 -1
- package/dist/types/upgrade.d.ts +0 -2
- package/dist/types/upgrade.d.ts.map +1 -1
- package/dist/types/utils/calculateChunks.d.ts +0 -2
- package/dist/types/utils/calculateChunks.d.ts.map +1 -1
- package/dist/types/utils/checkAccess.d.ts +2 -3
- package/dist/types/utils/checkAccess.d.ts.map +1 -1
- package/dist/types/utils/checkConfigConsistency.d.ts +0 -2
- package/dist/types/utils/checkConfigConsistency.d.ts.map +1 -1
- package/dist/types/utils/checkFileModifiedRange.d.ts +1 -2
- package/dist/types/utils/checkFileModifiedRange.d.ts.map +1 -1
- package/dist/types/utils/checkLastUpdateTime.d.ts +0 -2
- package/dist/types/utils/checkLastUpdateTime.d.ts.map +1 -1
- package/dist/types/utils/chunkInference.d.ts +1 -2
- package/dist/types/utils/chunkInference.d.ts.map +1 -1
- package/dist/types/utils/detectGitRepository.d.ts +32 -0
- package/dist/types/utils/detectGitRepository.d.ts.map +1 -0
- package/dist/types/utils/fixChunkStartEndChars.d.ts +0 -2
- package/dist/types/utils/fixChunkStartEndChars.d.ts.map +1 -1
- package/dist/types/utils/formatLineRanges.d.ts +0 -2
- package/dist/types/utils/formatLineRanges.d.ts.map +1 -1
- package/dist/types/utils/formatTimeDiff.d.ts +0 -2
- package/dist/types/utils/formatTimeDiff.d.ts.map +1 -1
- package/dist/types/utils/getIsFileUpdatedRecently.d.ts +0 -2
- package/dist/types/utils/getIsFileUpdatedRecently.d.ts.map +1 -1
- package/dist/types/utils/getOutputFilePath.d.ts +0 -2
- package/dist/types/utils/getOutputFilePath.d.ts.map +1 -1
- package/dist/types/utils/getParentPackageJSON.d.ts +1 -2
- package/dist/types/utils/getParentPackageJSON.d.ts.map +1 -1
- package/dist/types/utils/isInteractiveTerminal.d.ts +0 -2
- package/dist/types/utils/isInteractiveTerminal.d.ts.map +1 -1
- package/dist/types/utils/listSpecialChars.d.ts +1 -2
- package/dist/types/utils/listSpecialChars.d.ts.map +1 -1
- package/dist/types/utils/mapChunksBetweenFiles.d.ts +0 -2
- package/dist/types/utils/mapChunksBetweenFiles.d.ts.map +1 -1
- package/dist/types/utils/openBrowser.d.ts +0 -2
- package/dist/types/utils/openBrowser.d.ts.map +1 -1
- package/dist/types/utils/parseChoice.d.ts +0 -2
- package/dist/types/utils/parseChoice.d.ts.map +1 -1
- package/dist/types/utils/reorderParagraphs.d.ts +0 -2
- package/dist/types/utils/reorderParagraphs.d.ts.map +1 -1
- package/dist/types/utils/selectCmsEnvironment.d.ts +1 -3
- package/dist/types/utils/selectCmsEnvironment.d.ts.map +1 -1
- package/dist/types/utils/setupAI.d.ts +1 -2
- package/dist/types/utils/setupAI.d.ts.map +1 -1
- package/dist/types/watch.d.ts +1 -2
- package/dist/types/watch.d.ts.map +1 -1
- package/package.json +14 -14
|
@@ -2,7 +2,7 @@ import * as ANSIColors from "@intlayer/config/colors";
|
|
|
2
2
|
import { colorize, colorizeNumber } from "@intlayer/config/logger";
|
|
3
3
|
import { formatPath } from "@intlayer/engine/utils";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/reviewDoc/reviewDocSynthesis.ts
|
|
6
6
|
/** Group results by base document path, preserving the first-seen order. */
|
|
7
7
|
const groupResultsByDocPath = (results) => {
|
|
8
8
|
const grouped = /* @__PURE__ */ new Map();
|
|
@@ -72,6 +72,5 @@ const formatReviewSynthesis = (results, options) => {
|
|
|
72
72
|
].join("\n");
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
//#endregion
|
|
76
75
|
export { formatReviewSynthesis };
|
|
77
76
|
//# sourceMappingURL=reviewDocSynthesis.mjs.map
|
package/dist/esm/scan.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
|
3
3
|
import { getConfiguration } from "@intlayer/config/node";
|
|
4
4
|
import { formatSize, getCheckDetailLines, scanWebsite } from "@intlayer/engine/scan";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/scan.ts
|
|
7
7
|
/** Human-readable labels for each scorable check type. */
|
|
8
8
|
const checkLabels = {
|
|
9
9
|
robots_robotsPresent: "robots.txt present",
|
|
@@ -104,6 +104,5 @@ const scan = async (url, options = {}) => {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
-
//#endregion
|
|
108
107
|
export { scan };
|
|
109
108
|
//# sourceMappingURL=scan.mjs.map
|
package/dist/esm/searchDoc.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
2
1
|
import { colorizeKey, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
3
2
|
import { getConfiguration } from "@intlayer/config/node";
|
|
3
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
4
4
|
import { getSearchAPI } from "@intlayer/api";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/searchDoc.ts
|
|
7
7
|
const searchDoc = async ({ query, limit = 10, configOptions }) => {
|
|
8
8
|
const config = getConfiguration(configOptions);
|
|
9
9
|
logConfigDetails(configOptions);
|
|
@@ -36,6 +36,5 @@ const searchDoc = async ({ query, limit = 10, configOptions }) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
//#endregion
|
|
40
39
|
export { searchDoc };
|
|
41
40
|
//# sourceMappingURL=searchDoc.mjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
2
1
|
import { getConfiguration } from "@intlayer/config/node";
|
|
2
|
+
import { logConfigDetails } from "@intlayer/engine/cli";
|
|
3
3
|
import { getUnmergedDictionaries } from "@intlayer/dictionaries-entry/unmerged";
|
|
4
4
|
import { getMissingLocalesContentFromDictionary } from "@intlayer/core/plugins";
|
|
5
5
|
import { getDictionaries } from "@intlayer/dictionaries-entry";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/test/listMissingTranslations.ts
|
|
8
8
|
const listMissingTranslationsWithConfig = (configuration) => {
|
|
9
9
|
const unmergedDictionariesRecord = getUnmergedDictionaries(configuration);
|
|
10
10
|
const mergedDictionaries = getDictionaries(configuration);
|
|
@@ -59,6 +59,5 @@ const listMissingTranslations = (configurationOptions) => {
|
|
|
59
59
|
return listMissingTranslationsWithConfig(configuration);
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
//#endregion
|
|
63
62
|
export { listMissingTranslations, listMissingTranslationsWithConfig };
|
|
64
63
|
//# sourceMappingURL=listMissingTranslations.mjs.map
|
package/dist/esm/test/test.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { getConfiguration } from "@intlayer/config/node";
|
|
|
5
5
|
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
6
6
|
import { prepareIntlayer } from "@intlayer/engine/build";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/test/test.ts
|
|
9
9
|
const testMissingTranslations = async (options) => {
|
|
10
10
|
const config = getConfiguration(options?.configOptions);
|
|
11
11
|
const { locales, requiredLocales } = config.internationalization;
|
|
@@ -49,6 +49,5 @@ const testMissingTranslations = async (options) => {
|
|
|
49
49
|
if (result.missingRequiredLocales.length > 0) process.exit(1);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
export { testMissingTranslations };
|
|
54
53
|
//# sourceMappingURL=test.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { sanitizeChunk, validateTranslation } from "./validation.mjs";
|
|
2
|
-
import { translateFile } from "./translateFile.mjs";
|
|
3
1
|
import { translateDoc } from "./translateDoc.mjs";
|
|
2
|
+
import { translateFile } from "./translateFile.mjs";
|
|
3
|
+
import { sanitizeChunk, validateTranslation } from "./validation.mjs";
|
|
4
4
|
|
|
5
5
|
export { sanitizeChunk, translateDoc, translateFile, validateTranslation };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { setupAI } from "../utils/setupAI.mjs";
|
|
2
|
-
import { getOutputFilePath } from "../utils/getOutputFilePath.mjs";
|
|
3
1
|
import { checkFileModifiedRange } from "../utils/checkFileModifiedRange.mjs";
|
|
2
|
+
import { getOutputFilePath } from "../utils/getOutputFilePath.mjs";
|
|
3
|
+
import { setupAI } from "../utils/setupAI.mjs";
|
|
4
4
|
import { translateFile } from "./translateFile.mjs";
|
|
5
|
-
import { listGitFiles, logConfigDetails } from "@intlayer/engine/cli";
|
|
6
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
7
|
-
import { dirname, join } from "node:path";
|
|
8
5
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
9
6
|
import { colorize, colorizeNumber, getAppLogger, x } from "@intlayer/config/logger";
|
|
10
7
|
import { getConfiguration } from "@intlayer/config/node";
|
|
11
|
-
import {
|
|
8
|
+
import { listGitFiles, logConfigDetails } from "@intlayer/engine/cli";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
11
|
+
import { pLimit, parallelize } from "@intlayer/config/utils";
|
|
12
12
|
import fg from "fast-glob";
|
|
13
13
|
import { performance } from "node:perf_hooks";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
// src/translateDoc/translateDoc.ts
|
|
16
16
|
const translateDoc = async ({ docPattern, locales, excludedGlobPattern, baseLocale, aiOptions, nbSimultaneousFileProcessed = 20, configOptions, customInstructions, skipIfModifiedBefore, skipIfModifiedAfter, skipIfExists, gitOptions, flushStrategy = "incremental" }) => {
|
|
17
17
|
const configuration = getConfiguration(configOptions);
|
|
18
18
|
logConfigDetails(configOptions);
|
|
@@ -79,6 +79,5 @@ const translateDoc = async ({ docPattern, locales, excludedGlobPattern, baseLoca
|
|
|
79
79
|
else appLogger(`${colorize("✔", ANSIColors.GREEN)} Batch completed successfully in ${colorizeNumber(batchDuration)}s.`);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
-
//#endregion
|
|
83
82
|
export { translateDoc };
|
|
84
83
|
//# sourceMappingURL=translateDoc.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateDoc.mjs","names":[],"sources":["../../../src/translateDoc/translateDoc.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { performance } from 'node:perf_hooks';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport {\n colorize,\n colorizeNumber,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {
|
|
1
|
+
{"version":3,"file":"translateDoc.mjs","names":[],"sources":["../../../src/translateDoc/translateDoc.ts"],"sourcesContent":["import { existsSync, mkdirSync, writeFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { performance } from 'node:perf_hooks';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport {\n colorize,\n colorizeNumber,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { parallelize, pLimit } from '@intlayer/config/utils';\nimport { listGitFiles, logConfigDetails } from '@intlayer/engine/cli';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport fg from 'fast-glob';\nimport { checkFileModifiedRange } from '../utils/checkFileModifiedRange';\nimport { getOutputFilePath } from '../utils/getOutputFilePath';\nimport { setupAI } from '../utils/setupAI';\nimport { translateFile } from './translateFile';\nimport type { ErrorState, TranslateDocOptions } from './types';\n\nexport const translateDoc = async ({\n docPattern,\n locales,\n excludedGlobPattern,\n baseLocale,\n aiOptions,\n nbSimultaneousFileProcessed = 20, // Default to a higher concurrency for chunks\n configOptions,\n customInstructions,\n skipIfModifiedBefore,\n skipIfModifiedAfter,\n skipIfExists,\n gitOptions,\n flushStrategy = 'incremental',\n}: TranslateDocOptions) => {\n const configuration = getConfiguration(configOptions);\n logConfigDetails(configOptions);\n\n const appLogger = getAppLogger(configuration);\n\n // 1. GLOBAL QUEUE SETUP\n // We use pLimit to create a single bottleneck for AI requests.\n // This queue is shared across all files and locales.\n const maxConcurrentChunks = nbSimultaneousFileProcessed;\n const globalChunkLimiter = pLimit(maxConcurrentChunks);\n\n let docList: string[] = await fg(docPattern, {\n ignore: excludedGlobPattern,\n });\n\n const aiResult = await setupAI(configuration, aiOptions);\n if (!aiResult?.hasAIAccess) return;\n\n const { aiClient, aiConfig, isCustomAI } = aiResult;\n if (isCustomAI && aiClient && aiConfig) {\n const { hasAIAccess, error } = await aiClient.checkAISDKAccess(aiConfig);\n if (!hasAIAccess) {\n appLogger(`${x} ${error}`);\n return;\n }\n }\n\n if (gitOptions) {\n const gitChangedFiles = await listGitFiles(gitOptions);\n if (gitChangedFiles) {\n docList = docList.filter((path) =>\n gitChangedFiles.some((gitFile) => join(process.cwd(), path) === gitFile)\n );\n }\n }\n\n const batchStartTime = performance.now();\n\n appLogger(\n `Translating ${colorizeNumber(docList.length)} files to ${colorizeNumber(locales.length)} locales. \\n` +\n `Global Concurrency: ${colorizeNumber(maxConcurrentChunks)} chunks in parallel.`\n );\n\n const errorState: ErrorState = {\n count: 0,\n maxErrors: 5,\n shouldStop: false,\n };\n\n // FLATTENED TASK LIST\n // We create a task for every File x Locale combination.\n const allTasks = docList.flatMap((docPath) =>\n locales.map((locale) => async () => {\n if (errorState.shouldStop) return;\n\n const absoluteBaseFilePath = join(configuration.system.baseDir, docPath);\n const outputFilePath = getOutputFilePath(\n absoluteBaseFilePath,\n locale,\n baseLocale\n );\n\n // Skip logic\n if (skipIfExists && existsSync(outputFilePath)) return;\n\n if (flushStrategy === 'incremental' && !existsSync(outputFilePath)) {\n mkdirSync(dirname(outputFilePath), { recursive: true });\n writeFileSync(outputFilePath, '');\n }\n\n const fileModificationData = checkFileModifiedRange(outputFilePath, {\n skipIfModifiedBefore,\n skipIfModifiedAfter,\n });\n\n if (fileModificationData.isSkipped) {\n appLogger(fileModificationData.message);\n return;\n }\n\n // Execute translation using the SHARED limiter\n await translateFile({\n baseFilePath: absoluteBaseFilePath,\n outputFilePath,\n locale: locale as Locale,\n baseLocale,\n configuration,\n errorState,\n aiOptions,\n customInstructions,\n aiClient,\n aiConfig,\n flushStrategy,\n limit: globalChunkLimiter, // Pass the global queue\n });\n })\n );\n\n // HIGH-THROUGHPUT FILE OPENER\n // We open many files simultaneously (e.g., 50) to ensure the global chunk queue\n // is always saturated with work.\n // If we open too few files, the chunk queue might drain faster than we can read new files.\n const FILE_OPEN_LIMIT = 50;\n\n await parallelize(allTasks, (task) => task(), FILE_OPEN_LIMIT);\n\n const batchEndTime = performance.now();\n const batchDuration = ((batchEndTime - batchStartTime) / 1000).toFixed(2);\n\n if (errorState.count > 0) {\n appLogger(`Finished with ${errorState.count} errors in ${batchDuration}s.`);\n } else {\n appLogger(\n `${colorize('✔', ANSIColors.GREEN)} Batch completed successfully in ${colorizeNumber(batchDuration)}s.`\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;AAqBA,MAAa,eAAe,OAAO,EACjC,YACA,SACA,qBACA,YACA,WACA,8BAA8B,IAC9B,eACA,oBACA,sBACA,qBACA,cACA,YACA,gBAAgB,oBACS;CACzB,MAAM,gBAAgB,iBAAiB,aAAa;CACpD,iBAAiB,aAAa;CAE9B,MAAM,YAAY,aAAa,aAAa;CAK5C,MAAM,sBAAsB;CAC5B,MAAM,qBAAqB,OAAO,mBAAmB;CAErD,IAAI,UAAoB,MAAM,GAAG,YAAY,EAC3C,QAAQ,oBACV,CAAC;CAED,MAAM,WAAW,MAAM,QAAQ,eAAe,SAAS;CACvD,IAAI,CAAC,UAAU,aAAa;CAE5B,MAAM,EAAE,UAAU,UAAU,eAAe;CAC3C,IAAI,cAAc,YAAY,UAAU;EACtC,MAAM,EAAE,aAAa,UAAU,MAAM,SAAS,iBAAiB,QAAQ;EACvE,IAAI,CAAC,aAAa;GAChB,UAAU,GAAG,EAAE,GAAG,OAAO;GACzB;EACF;CACF;CAEA,IAAI,YAAY;EACd,MAAM,kBAAkB,MAAM,aAAa,UAAU;EACrD,IAAI,iBACF,UAAU,QAAQ,QAAQ,SACxB,gBAAgB,MAAM,YAAY,KAAK,QAAQ,IAAI,GAAG,IAAI,MAAM,OAAO,CACzE;CAEJ;CAEA,MAAM,iBAAiB,YAAY,IAAI;CAEvC,UACE,eAAe,eAAe,QAAQ,MAAM,EAAE,YAAY,eAAe,QAAQ,MAAM,EAAE,kCAChE,eAAe,mBAAmB,EAAE,qBAC/D;CAEA,MAAM,aAAyB;EAC7B,OAAO;EACP,WAAW;EACX,YAAY;CACd;CAIA,MAAM,WAAW,QAAQ,SAAS,YAChC,QAAQ,KAAK,WAAW,YAAY;EAClC,IAAI,WAAW,YAAY;EAE3B,MAAM,uBAAuB,KAAK,cAAc,OAAO,SAAS,OAAO;EACvE,MAAM,iBAAiB,kBACrB,sBACA,QACA,UACF;EAGA,IAAI,gBAAgB,WAAW,cAAc,GAAG;EAEhD,IAAI,kBAAkB,iBAAiB,CAAC,WAAW,cAAc,GAAG;GAClE,UAAU,QAAQ,cAAc,GAAG,EAAE,WAAW,KAAK,CAAC;GACtD,cAAc,gBAAgB,EAAE;EAClC;EAEA,MAAM,uBAAuB,uBAAuB,gBAAgB;GAClE;GACA;EACF,CAAC;EAED,IAAI,qBAAqB,WAAW;GAClC,UAAU,qBAAqB,OAAO;GACtC;EACF;EAGA,MAAM,cAAc;GAClB,cAAc;GACd;GACQ;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,OAAO;EACT,CAAC;CACH,CAAC,CACH;CAQA,MAAM,YAAY,WAAW,SAAS,KAAK,GAAG,EAAe;CAG7D,MAAM,kBADe,YAAY,IACE,IAAI,kBAAkB,IAAI,CAAE,QAAQ,CAAC;CAExE,IAAI,WAAW,QAAQ,GACrB,UAAU,iBAAiB,WAAW,MAAM,aAAa,cAAc,GAAG;MAE1E,UACE,GAAG,SAAS,KAAK,WAAW,KAAK,EAAE,mCAAmC,eAAe,aAAa,EAAE,GACtG;AAEJ"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { readAsset } from "../_virtual/_utils_asset.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { chunkText } from "../utils/calculateChunks.mjs";
|
|
3
3
|
import { chunkInference } from "../utils/chunkInference.mjs";
|
|
4
4
|
import { fixChunkStartEndChars } from "../utils/fixChunkStartEndChars.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { dirname, relative } from "node:path";
|
|
5
|
+
import { sanitizeChunk, validateTranslation } from "./validation.mjs";
|
|
7
6
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
8
7
|
import { colon, colorize, colorizeNumber, getAppLogger } from "@intlayer/config/logger";
|
|
8
|
+
import { dirname, relative } from "node:path";
|
|
9
9
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
10
10
|
import { formatLocale, formatPath } from "@intlayer/engine/utils";
|
|
11
11
|
import { retryManager } from "@intlayer/config/utils";
|
|
12
12
|
import { performance } from "node:perf_hooks";
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
// src/translateDoc/translateFile.ts
|
|
15
15
|
const translateFile = async ({ baseFilePath, outputFilePath, locale, baseLocale, configuration, errorState, aiOptions, customInstructions, aiClient, aiConfig, flushStrategy = "incremental", onChunkReceive, limit }) => {
|
|
16
16
|
if (errorState.shouldStop) return null;
|
|
17
17
|
const appLogger = getAppLogger(configuration, { config: { prefix: "" } });
|
|
@@ -100,6 +100,5 @@ const translateFile = async ({ baseFilePath, outputFilePath, locale, baseLocale,
|
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
-
//#endregion
|
|
104
103
|
export { translateFile };
|
|
105
104
|
//# sourceMappingURL=translateFile.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/translateDoc/validation.ts
|
|
2
2
|
/**
|
|
3
3
|
* Validates that the translated content matches the structure of the original.
|
|
4
4
|
* Throws an error if a mismatch is found, triggering a retry.
|
|
@@ -42,6 +42,5 @@ const sanitizeChunk = (translated, original) => {
|
|
|
42
42
|
return cleaned;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
export { sanitizeChunk, validateTranslation };
|
|
47
46
|
//# sourceMappingURL=validation.mjs.map
|
package/dist/esm/upgrade.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { findProjectRoot } from "./init.mjs";
|
|
|
2
2
|
import { upgradeIntlayerPackages } from "@intlayer/engine/cli";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/upgrade.ts
|
|
6
6
|
/**
|
|
7
7
|
* Lists the Intlayer packages of every `package.json` of the project and
|
|
8
8
|
* upgrades them to the version of the given dist-tag.
|
|
@@ -12,6 +12,5 @@ const upgrade = async (projectRoot, options) => {
|
|
|
12
12
|
await upgradeIntlayerPackages(root, options);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
//#endregion
|
|
16
15
|
export { upgrade };
|
|
17
16
|
//# sourceMappingURL=upgrade.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { splitTextByLines } from "@intlayer/engine/utils";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/calculateChunks.ts
|
|
4
4
|
const DEFAULT_MAX_CHARS_PER_CHUNK = 800;
|
|
5
5
|
const DEFAULT_OVERLAP_CHARS = 0;
|
|
6
6
|
const chunkText = (text, maxCharsPerChunk = DEFAULT_MAX_CHARS_PER_CHUNK, overlapChars = DEFAULT_OVERLAP_CHARS) => {
|
|
@@ -83,6 +83,5 @@ const chunkText = (text, maxCharsPerChunk = DEFAULT_MAX_CHARS_PER_CHUNK, overlap
|
|
|
83
83
|
return overlapChunks;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
//#endregion
|
|
87
86
|
export { chunkText };
|
|
88
87
|
//# sourceMappingURL=calculateChunks.mjs.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { readCliSessionToken } from "../auth/sessionToken.mjs";
|
|
2
1
|
import { login } from "../auth/login.mjs";
|
|
2
|
+
import { readCliSessionToken } from "../auth/sessionToken.mjs";
|
|
3
3
|
import { checkConfigConsistency } from "./checkConfigConsistency.mjs";
|
|
4
4
|
import * as ANSIColors from "@intlayer/config/colors";
|
|
5
5
|
import { colorize, getAppLogger } from "@intlayer/config/logger";
|
|
6
6
|
import { extractErrorMessage } from "@intlayer/config/utils";
|
|
7
7
|
import { getIntlayerAPIProxy } from "@intlayer/api";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/utils/checkAccess.ts
|
|
10
10
|
const getAuthenticatedAPI = async (configuration) => {
|
|
11
11
|
let sessionData = null;
|
|
12
12
|
if (configuration) sessionData = await readCliSessionToken(configuration);
|
|
@@ -108,6 +108,5 @@ const checkAIAccess = async (configuration, aiOptions, shouldCheckConfigConsiste
|
|
|
108
108
|
return await checkCMSAuth(configuration, shouldCheckConfigConsistency);
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
//#endregion
|
|
112
111
|
export { checkAIAccess, checkCMSAuth, getAuthenticatedAPI };
|
|
113
112
|
//# sourceMappingURL=checkAccess.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions
|
|
1
|
+
{"version":3,"file":"checkAccess.mjs","names":[],"sources":["../../../src/utils/checkAccess.ts"],"sourcesContent":["import type { AIOptions } from '@intlayer/ai';\nimport type { IntlayerAPIProxy } from '@intlayer/api';\nimport { getIntlayerAPIProxy } from '@intlayer/api';\nimport * as ANSIColors from '@intlayer/config/colors';\nimport { colorize, getAppLogger } from '@intlayer/config/logger';\nimport { extractErrorMessage } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { login } from '../auth/login';\nimport { type CliSessionData, readCliSessionToken } from '../auth/sessionToken';\nimport { checkConfigConsistency } from './checkConfigConsistency';\n\nexport const getAuthenticatedAPI = async (\n configuration?: IntlayerConfig\n): Promise<IntlayerAPIProxy> => {\n let sessionData: CliSessionData | null = null;\n\n // First use session data if it exists\n if (configuration) {\n sessionData = await readCliSessionToken(configuration);\n }\n\n return getIntlayerAPIProxy(undefined, configuration, sessionData?.token);\n};\n\nconst checkProjectConfigConsistency = (\n project: { configuration?: any } | null | undefined,\n configuration: IntlayerConfig,\n appLogger: ReturnType<typeof getAppLogger>\n): void => {\n if (!project?.configuration) return;\n\n try {\n let remoteConfigToCheck = project.configuration;\n\n if (\n remoteConfigToCheck.ai &&\n 'apiKeyConfigured' in remoteConfigToCheck.ai\n ) {\n const { apiKeyConfigured, ...restAi } = remoteConfigToCheck.ai as any;\n remoteConfigToCheck = { ...remoteConfigToCheck, ai: restAi };\n }\n\n checkConfigConsistency(remoteConfigToCheck, configuration);\n } catch {\n appLogger(\n [\n 'Remote configuration is not up to date. The project configuration does not match the local configuration.',\n 'You can push the configuration by running',\n colorize('npx intlayer configuration push', ANSIColors.CYAN),\n colorize('(see doc:', ANSIColors.GREY_LIGHT),\n colorize(\n 'https://intlayer.org/doc/concept/cli/push',\n ANSIColors.GREY_DARK\n ),\n colorize(')', ANSIColors.GREY_LIGHT),\n '.',\n ],\n { level: 'warn' }\n );\n }\n};\n\nexport const checkCMSAuth = async (\n configuration: IntlayerConfig,\n shouldCheckConfigConsistency: boolean = true,\n shouldAutoLogin: boolean = true\n): Promise<boolean> => {\n const appLogger = getAppLogger(configuration);\n\n // Try CLI session token first (short-lived 2h token stored in tempDir)\n const sessionData = await readCliSessionToken(configuration);\n if (sessionData) {\n const intlayerAPI = getIntlayerAPIProxy(\n undefined,\n configuration,\n sessionData.token\n );\n\n try {\n const result = await intlayerAPI.oAuth.getCliSessionMe();\n const project = result.data?.project;\n\n if (project && shouldCheckConfigConsistency) {\n checkProjectConfigConsistency(project, configuration, appLogger);\n }\n\n return true;\n } catch (error) {\n const message = extractErrorMessage(error);\n appLogger(message, { level: 'error' });\n appLogger(\n [\n 'Run',\n colorize('npx intlayer login', ANSIColors.CYAN),\n 'to set up a new session.',\n ],\n { level: 'error' }\n );\n return false;\n }\n }\n\n // Fall back to client_credentials (access key)\n const hasCMSAuth =\n configuration.editor.clientId && configuration.editor.clientSecret;\n if (!hasCMSAuth) {\n if (shouldAutoLogin) {\n appLogger(\n [\n 'No credentials found. Starting login...',\n colorize('( Set', ANSIColors.GREY_LIGHT),\n colorize('INTLAYER_CLIENT_ID', ANSIColors.BLUE),\n colorize('and', ANSIColors.GREY_LIGHT),\n colorize('INTLAYER_CLIENT_SECRET', ANSIColors.BLUE),\n colorize('in your .env to skip this step)', ANSIColors.GREY_LIGHT),\n ],\n { level: 'warn' }\n );\n await login({ exitAfter: false });\n return checkCMSAuth(configuration, shouldCheckConfigConsistency, false);\n }\n\n appLogger(\n [\n 'CMS auth not provided. Run',\n colorize('npx intlayer login', ANSIColors.CYAN),\n 'to authenticate, or set',\n colorize('INTLAYER_CLIENT_ID', ANSIColors.BLUE),\n 'and',\n colorize('INTLAYER_CLIENT_SECRET', ANSIColors.BLUE),\n 'in your .env file',\n colorize('(see doc:', ANSIColors.GREY_LIGHT),\n colorize('https://intlayer.org/doc/concept/cms', ANSIColors.GREY_DARK),\n colorize(')', ANSIColors.GREY_LIGHT),\n '.',\n ],\n { level: 'error' }\n );\n\n return false;\n }\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n try {\n const result = await intlayerAPI.oAuth.getOAuth2AccessToken();\n\n const project = result.data?.project;\n\n if (!project) {\n appLogger('Project not found');\n return true;\n }\n\n if (shouldCheckConfigConsistency) {\n checkProjectConfigConsistency(project, configuration, appLogger);\n }\n } catch (error) {\n const message = extractErrorMessage(error);\n appLogger(message, { level: 'error' });\n appLogger(\n [\n 'Your access keys appear to be invalid. Run',\n colorize('npx intlayer login', ANSIColors.CYAN),\n 'to set up new access keys.',\n ],\n { level: 'error' }\n );\n return false;\n }\n\n return true;\n};\n\nexport const checkAIAccess = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions,\n shouldCheckConfigConsistency: boolean = true\n): Promise<boolean> => {\n const isOllama =\n configuration.ai?.provider === 'ollama' || aiOptions?.provider === 'ollama';\n const hasHisOwnAIAPIKey = Boolean(\n configuration.ai?.apiKey || aiOptions?.apiKey\n );\n\n if (hasHisOwnAIAPIKey || isOllama) {\n return true;\n }\n\n // No local AI key — delegate to CMS auth check (which will auto-login if needed)\n return await checkCMSAuth(configuration, shouldCheckConfigConsistency);\n};\n"],"mappings":";;;;;;;;;AAWA,MAAa,sBAAsB,OACjC,kBAC8B;CAC9B,IAAI,cAAqC;CAGzC,IAAI,eACF,cAAc,MAAM,oBAAoB,aAAa;CAGvD,OAAO,oBAAoB,QAAW,eAAe,aAAa,KAAK;AACzE;AAEA,MAAM,iCACJ,SACA,eACA,cACS;CACT,IAAI,CAAC,SAAS,eAAe;CAE7B,IAAI;EACF,IAAI,sBAAsB,QAAQ;EAElC,IACE,oBAAoB,MACpB,sBAAsB,oBAAoB,IAC1C;GACA,MAAM,EAAE,kBAAkB,GAAG,WAAW,oBAAoB;GAC5D,sBAAsB;IAAE,GAAG;IAAqB,IAAI;GAAO;EAC7D;EAEA,uBAAuB,qBAAqB,aAAa;CAC3D,QAAQ;EACN,UACE;GACE;GACA;GACA,SAAS,mCAAmC,WAAW,IAAI;GAC3D,SAAS,aAAa,WAAW,UAAU;GAC3C,SACE,6CACA,WAAW,SACb;GACA,SAAS,KAAK,WAAW,UAAU;GACnC;EACF,GACA,EAAE,OAAO,OAAO,CAClB;CACF;AACF;AAEA,MAAa,eAAe,OAC1B,eACA,+BAAwC,MACxC,kBAA2B,SACN;CACrB,MAAM,YAAY,aAAa,aAAa;CAG5C,MAAM,cAAc,MAAM,oBAAoB,aAAa;CAC3D,IAAI,aAAa;EACf,MAAM,cAAc,oBAClB,QACA,eACA,YAAY,KACd;EAEA,IAAI;GAEF,MAAM,WAAU,MADK,YAAY,MAAM,gBAAgB,EACjC,CAAC,MAAM;GAE7B,IAAI,WAAW,8BACb,8BAA8B,SAAS,eAAe,SAAS;GAGjE,OAAO;EACT,SAAS,OAAO;GAEd,UADgB,oBAAoB,KACpB,GAAG,EAAE,OAAO,QAAQ,CAAC;GACrC,UACE;IACE;IACA,SAAS,sBAAsB,WAAW,IAAI;IAC9C;GACF,GACA,EAAE,OAAO,QAAQ,CACnB;GACA,OAAO;EACT;CACF;CAKA,IAAI,EADF,cAAc,OAAO,YAAY,cAAc,OAAO,eACvC;EACf,IAAI,iBAAiB;GACnB,UACE;IACE;IACA,SAAS,SAAS,WAAW,UAAU;IACvC,SAAS,sBAAsB,WAAW,IAAI;IAC9C,SAAS,OAAO,WAAW,UAAU;IACrC,SAAS,0BAA0B,WAAW,IAAI;IAClD,SAAS,mCAAmC,WAAW,UAAU;GACnE,GACA,EAAE,OAAO,OAAO,CAClB;GACA,MAAM,MAAM,EAAE,WAAW,MAAM,CAAC;GAChC,OAAO,aAAa,eAAe,8BAA8B,KAAK;EACxE;EAEA,UACE;GACE;GACA,SAAS,sBAAsB,WAAW,IAAI;GAC9C;GACA,SAAS,sBAAsB,WAAW,IAAI;GAC9C;GACA,SAAS,0BAA0B,WAAW,IAAI;GAClD;GACA,SAAS,aAAa,WAAW,UAAU;GAC3C,SAAS,wCAAwC,WAAW,SAAS;GACrE,SAAS,KAAK,WAAW,UAAU;GACnC;EACF,GACA,EAAE,OAAO,QAAQ,CACnB;EAEA,OAAO;CACT;CAEA,MAAM,cAAc,oBAAoB,QAAW,aAAa;CAEhE,IAAI;EAGF,MAAM,WAAU,MAFK,YAAY,MAAM,qBAAqB,EAEtC,CAAC,MAAM;EAE7B,IAAI,CAAC,SAAS;GACZ,UAAU,mBAAmB;GAC7B,OAAO;EACT;EAEA,IAAI,8BACF,8BAA8B,SAAS,eAAe,SAAS;CAEnE,SAAS,OAAO;EAEd,UADgB,oBAAoB,KACpB,GAAG,EAAE,OAAO,QAAQ,CAAC;EACrC,UACE;GACE;GACA,SAAS,sBAAsB,WAAW,IAAI;GAC9C;EACF,GACA,EAAE,OAAO,QAAQ,CACnB;EACA,OAAO;CACT;CAEA,OAAO;AACT;AAEA,MAAa,gBAAgB,OAC3B,eACA,WACA,+BAAwC,SACnB;CACrB,MAAM,WACJ,cAAc,IAAI,aAAa,YAAY,WAAW,aAAa;CAKrE,IAJ0B,QACxB,cAAc,IAAI,UAAU,WAAW,MAGrB,KAAK,UACvB,OAAO;CAIT,OAAO,MAAM,aAAa,eAAe,4BAA4B;AACvE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/checkConfigConsistency.ts
|
|
2
2
|
const checkConfigConsistency = (subset, superset) => {
|
|
3
3
|
for (const key in subset) {
|
|
4
4
|
const val1 = subset[key];
|
|
@@ -10,6 +10,5 @@ const checkConfigConsistency = (subset, superset) => {
|
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { checkConfigConsistency };
|
|
15
14
|
//# sourceMappingURL=checkConfigConsistency.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { checkLastUpdateTime } from "./checkLastUpdateTime.mjs";
|
|
2
2
|
import { formatTimeDiff } from "./formatTimeDiff.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/checkFileModifiedRange.ts
|
|
5
5
|
/**
|
|
6
6
|
* Threshold that helps us differentiate between a numeric *timestamp* (ms from epoch)
|
|
7
7
|
* and a numeric *duration* (ms ago).
|
|
@@ -77,6 +77,5 @@ const checkFileModifiedRange = (filePath, options) => {
|
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
|
|
80
|
-
//#endregion
|
|
81
80
|
export { checkFileModifiedRange };
|
|
82
81
|
//# sourceMappingURL=checkFileModifiedRange.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { statSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/checkLastUpdateTime.ts
|
|
4
4
|
/**
|
|
5
5
|
* Returns the last modification date of a file.
|
|
6
6
|
*
|
|
@@ -13,6 +13,5 @@ const checkLastUpdateTime = (filePath) => {
|
|
|
13
13
|
return new Date(stats.mtime);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { checkLastUpdateTime };
|
|
18
17
|
//# sourceMappingURL=checkLastUpdateTime.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getAuthenticatedAPI } from "./checkAccess.mjs";
|
|
2
2
|
import { retryManager } from "@intlayer/config/utils";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/chunkInference.ts
|
|
5
5
|
/**
|
|
6
6
|
* Translates a single chunk via the OpenAI API.
|
|
7
7
|
* Includes retry logic if the call fails.
|
|
@@ -40,6 +40,5 @@ const processContent = (content) => {
|
|
|
40
40
|
return content.replaceAll("///chunksStart///", "").replaceAll("///chunkStart///", "").replaceAll("///chunksEnd///", "").replaceAll("///chunkEnd///", "").replaceAll("///chunksStart///", "").replaceAll("chunkStart///", "").replaceAll("chunksEnd///", "").replaceAll("chunkEnd///", "").replaceAll("///chunksStart", "").replaceAll("///chunkStart", "").replaceAll("///chunksEnd", "").replaceAll("///chunkEnd", "").replaceAll("chunksStart", "").replaceAll("chunkStart", "").replaceAll("chunksEnd", "").replaceAll("chunkEnd", "");
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { chunkInference };
|
|
45
44
|
//# sourceMappingURL=chunkInference.mjs.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { searchConfigurationFile } from "@intlayer/config/node";
|
|
2
|
+
import { relative, sep } from "node:path";
|
|
3
|
+
import { spawnSync } from "node:child_process";
|
|
4
|
+
|
|
5
|
+
// src/utils/detectGitRepository.ts
|
|
6
|
+
const HOST_PROVIDERS = {
|
|
7
|
+
"github.com": "github",
|
|
8
|
+
"gitlab.com": "gitlab",
|
|
9
|
+
"bitbucket.org": "bitbucket",
|
|
10
|
+
"codeberg.org": "codeberg",
|
|
11
|
+
"gitee.com": "gitee"
|
|
12
|
+
};
|
|
13
|
+
/** Provider of a host; any host naming GitLab is taken as self-managed. */
|
|
14
|
+
const getHostProvider = (host) => HOST_PROVIDERS[host] ?? (host.includes("gitlab") ? "gitlab" : void 0);
|
|
15
|
+
/**
|
|
16
|
+
* Parses an HTTPS, SSH (`ssh://`) or scp-like (`git@host:owner/repo.git`)
|
|
17
|
+
* remote URL. Returns `null` for an unknown host or a malformed URL.
|
|
18
|
+
*/
|
|
19
|
+
const parseGitRemoteUrl = (remoteUrl) => {
|
|
20
|
+
const trimmedUrl = remoteUrl.trim();
|
|
21
|
+
const scpLikeMatch = /^(?:[^@/\s]+@)?([^:/\s]+):(?!\/)(.+)$/.exec(trimmedUrl);
|
|
22
|
+
let host;
|
|
23
|
+
let path;
|
|
24
|
+
if (scpLikeMatch && !trimmedUrl.includes("://")) [, host, path] = scpLikeMatch;
|
|
25
|
+
else try {
|
|
26
|
+
const url = new URL(trimmedUrl);
|
|
27
|
+
host = url.hostname;
|
|
28
|
+
path = url.pathname;
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const provider = getHostProvider(host.toLowerCase());
|
|
33
|
+
const segments = path.replace(/^\/+|\/+$/g, "").replace(/\.git$/, "").split("/").filter(Boolean);
|
|
34
|
+
if (!provider || segments.length < 2) return null;
|
|
35
|
+
if (provider !== "gitlab" && segments.length !== 2) return null;
|
|
36
|
+
const repository = segments[segments.length - 1];
|
|
37
|
+
const owner = segments.slice(0, -1).join("/");
|
|
38
|
+
const isSelfManagedGitLab = provider === "gitlab" && host !== "gitlab.com";
|
|
39
|
+
return {
|
|
40
|
+
provider,
|
|
41
|
+
owner,
|
|
42
|
+
repository,
|
|
43
|
+
url: `https://${host}/${owner}/${repository}`,
|
|
44
|
+
...isSelfManagedGitLab && { instanceUrl: `https://${host}` }
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
/** Output of a git command, `undefined` when it fails. */
|
|
48
|
+
const runGit = (cwd, args) => {
|
|
49
|
+
const result = spawnSync("git", args, {
|
|
50
|
+
cwd,
|
|
51
|
+
encoding: "utf-8"
|
|
52
|
+
});
|
|
53
|
+
if (result.status !== 0) return void 0;
|
|
54
|
+
return result.stdout.trim() || void 0;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Detects the hosted repository of the project from its `origin` remote,
|
|
58
|
+
* with the checked-out branch and the config file path in the repository.
|
|
59
|
+
* Returns `null` outside a git repository or for an unsupported host.
|
|
60
|
+
*/
|
|
61
|
+
const detectGitRepository = (projectRoot) => {
|
|
62
|
+
const remoteUrl = runGit(projectRoot, [
|
|
63
|
+
"remote",
|
|
64
|
+
"get-url",
|
|
65
|
+
"origin"
|
|
66
|
+
]);
|
|
67
|
+
const remote = remoteUrl ? parseGitRemoteUrl(remoteUrl) : null;
|
|
68
|
+
if (!remote) return null;
|
|
69
|
+
const branch = runGit(projectRoot, [
|
|
70
|
+
"rev-parse",
|
|
71
|
+
"--abbrev-ref",
|
|
72
|
+
"HEAD"
|
|
73
|
+
]);
|
|
74
|
+
const gitRoot = runGit(projectRoot, ["rev-parse", "--show-toplevel"]);
|
|
75
|
+
const { configurationFilePath } = searchConfigurationFile(projectRoot);
|
|
76
|
+
return {
|
|
77
|
+
...remote,
|
|
78
|
+
branch: branch && branch !== "HEAD" ? branch : void 0,
|
|
79
|
+
configFilePath: gitRoot && configurationFilePath ? relative(gitRoot, configurationFilePath).split(sep).join("/") : void 0
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export { detectGitRepository, parseGitRemoteUrl };
|
|
84
|
+
//# sourceMappingURL=detectGitRepository.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectGitRepository.mjs","names":[],"sources":["../../../src/utils/detectGitRepository.ts"],"sourcesContent":["import { spawnSync } from 'node:child_process';\nimport { relative, sep } from 'node:path';\nimport { searchConfigurationFile } from '@intlayer/config/node';\n\n/** Git providers the Intlayer CMS can connect a repository from. */\nexport type GitRepositoryProvider =\n | 'github'\n | 'gitlab'\n | 'bitbucket'\n | 'codeberg'\n | 'gitee';\n\n/** Repository a git remote points to. */\nexport type GitRemoteRepository = {\n provider: GitRepositoryProvider;\n /** Owner, group path (GitLab sub-groups included) or workspace */\n owner: string;\n repository: string;\n /** Web URL of the repository */\n url: string;\n /** Self-managed GitLab instance (ex: https://gitlab.company.com) */\n instanceUrl?: string;\n};\n\n/** Local repository of the project, as sent to the CMS login page. */\nexport type DetectedGitRepository = GitRemoteRepository & {\n /** Checked-out branch */\n branch?: string;\n /** Intlayer configuration file, relative to the repository root (posix) */\n configFilePath?: string;\n};\n\nconst HOST_PROVIDERS: Record<string, GitRepositoryProvider> = {\n 'github.com': 'github',\n 'gitlab.com': 'gitlab',\n 'bitbucket.org': 'bitbucket',\n 'codeberg.org': 'codeberg',\n 'gitee.com': 'gitee',\n};\n\n/** Provider of a host; any host naming GitLab is taken as self-managed. */\nconst getHostProvider = (host: string): GitRepositoryProvider | undefined =>\n HOST_PROVIDERS[host] ?? (host.includes('gitlab') ? 'gitlab' : undefined);\n\n/**\n * Parses an HTTPS, SSH (`ssh://`) or scp-like (`git@host:owner/repo.git`)\n * remote URL. Returns `null` for an unknown host or a malformed URL.\n */\nexport const parseGitRemoteUrl = (\n remoteUrl: string\n): GitRemoteRepository | null => {\n const trimmedUrl = remoteUrl.trim();\n const scpLikeMatch = /^(?:[^@/\\s]+@)?([^:/\\s]+):(?!\\/)(.+)$/.exec(trimmedUrl);\n\n let host: string;\n let path: string;\n\n if (scpLikeMatch && !trimmedUrl.includes('://')) {\n [, host, path] = scpLikeMatch as unknown as [string, string, string];\n } else {\n try {\n const url = new URL(trimmedUrl);\n host = url.hostname;\n path = url.pathname;\n } catch {\n return null;\n }\n }\n\n const provider = getHostProvider(host.toLowerCase());\n const segments = path\n .replace(/^\\/+|\\/+$/g, '')\n .replace(/\\.git$/, '')\n .split('/')\n .filter(Boolean);\n\n if (!provider || segments.length < 2) return null;\n\n // Only GitLab nests groups: elsewhere the path is exactly `owner/repo`\n if (provider !== 'gitlab' && segments.length !== 2) return null;\n\n const repository = segments[segments.length - 1] as string;\n const owner = segments.slice(0, -1).join('/');\n const isSelfManagedGitLab = provider === 'gitlab' && host !== 'gitlab.com';\n\n return {\n provider,\n owner,\n repository,\n url: `https://${host}/${owner}/${repository}`,\n ...(isSelfManagedGitLab && { instanceUrl: `https://${host}` }),\n };\n};\n\n/** Output of a git command, `undefined` when it fails. */\nconst runGit = (cwd: string, args: string[]): string | undefined => {\n const result = spawnSync('git', args, { cwd, encoding: 'utf-8' });\n\n if (result.status !== 0) return undefined;\n\n return result.stdout.trim() || undefined;\n};\n\n/**\n * Detects the hosted repository of the project from its `origin` remote,\n * with the checked-out branch and the config file path in the repository.\n * Returns `null` outside a git repository or for an unsupported host.\n */\nexport const detectGitRepository = (\n projectRoot: string\n): DetectedGitRepository | null => {\n const remoteUrl = runGit(projectRoot, ['remote', 'get-url', 'origin']);\n const remote = remoteUrl ? parseGitRemoteUrl(remoteUrl) : null;\n\n if (!remote) return null;\n\n const branch = runGit(projectRoot, ['rev-parse', '--abbrev-ref', 'HEAD']);\n const gitRoot = runGit(projectRoot, ['rev-parse', '--show-toplevel']);\n const { configurationFilePath } = searchConfigurationFile(projectRoot);\n\n return {\n ...remote,\n // A detached HEAD has no branch to connect\n branch: branch && branch !== 'HEAD' ? branch : undefined,\n configFilePath:\n gitRoot && configurationFilePath\n ? relative(gitRoot, configurationFilePath).split(sep).join('/')\n : undefined,\n };\n};\n"],"mappings":";;;;;AAgCA,MAAM,iBAAwD;CAC5D,cAAc;CACd,cAAc;CACd,iBAAiB;CACjB,gBAAgB;CAChB,aAAa;AACf;;AAGA,MAAM,mBAAmB,SACvB,eAAe,UAAU,KAAK,SAAS,QAAQ,IAAI,WAAW;;;;;AAMhE,MAAa,qBACX,cAC+B;CAC/B,MAAM,aAAa,UAAU,KAAK;CAClC,MAAM,eAAe,wCAAwC,KAAK,UAAU;CAE5E,IAAI;CACJ,IAAI;CAEJ,IAAI,gBAAgB,CAAC,WAAW,SAAS,KAAK,GAC5C,GAAG,MAAM,QAAQ;MAEjB,IAAI;EACF,MAAM,MAAM,IAAI,IAAI,UAAU;EAC9B,OAAO,IAAI;EACX,OAAO,IAAI;CACb,QAAQ;EACN,OAAO;CACT;CAGF,MAAM,WAAW,gBAAgB,KAAK,YAAY,CAAC;CACnD,MAAM,WAAW,KACd,QAAQ,cAAc,EAAE,CAAC,CACzB,QAAQ,UAAU,EAAE,CAAC,CACrB,MAAM,GAAG,CAAC,CACV,OAAO,OAAO;CAEjB,IAAI,CAAC,YAAY,SAAS,SAAS,GAAG,OAAO;CAG7C,IAAI,aAAa,YAAY,SAAS,WAAW,GAAG,OAAO;CAE3D,MAAM,aAAa,SAAS,SAAS,SAAS;CAC9C,MAAM,QAAQ,SAAS,MAAM,GAAG,EAAE,CAAC,CAAC,KAAK,GAAG;CAC5C,MAAM,sBAAsB,aAAa,YAAY,SAAS;CAE9D,OAAO;EACL;EACA;EACA;EACA,KAAK,WAAW,KAAK,GAAG,MAAM,GAAG;EACjC,GAAI,uBAAuB,EAAE,aAAa,WAAW,OAAO;CAC9D;AACF;;AAGA,MAAM,UAAU,KAAa,SAAuC;CAClE,MAAM,SAAS,UAAU,OAAO,MAAM;EAAE;EAAK,UAAU;CAAQ,CAAC;CAEhE,IAAI,OAAO,WAAW,GAAG,OAAO;CAEhC,OAAO,OAAO,OAAO,KAAK,KAAK;AACjC;;;;;;AAOA,MAAa,uBACX,gBACiC;CACjC,MAAM,YAAY,OAAO,aAAa;EAAC;EAAU;EAAW;CAAQ,CAAC;CACrE,MAAM,SAAS,YAAY,kBAAkB,SAAS,IAAI;CAE1D,IAAI,CAAC,QAAQ,OAAO;CAEpB,MAAM,SAAS,OAAO,aAAa;EAAC;EAAa;EAAgB;CAAM,CAAC;CACxE,MAAM,UAAU,OAAO,aAAa,CAAC,aAAa,iBAAiB,CAAC;CACpE,MAAM,EAAE,0BAA0B,wBAAwB,WAAW;CAErE,OAAO;EACL,GAAG;EAEH,QAAQ,UAAU,WAAW,SAAS,SAAS;EAC/C,gBACE,WAAW,wBACP,SAAS,SAAS,qBAAqB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,IAC5D;CACR;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/fixChunkStartEndChars.ts
|
|
2
2
|
const CHAR_TO_CHECK_FORMATTING = [
|
|
3
3
|
"```",
|
|
4
4
|
"\n\n",
|
|
@@ -22,6 +22,5 @@ const fixChunkStartEndChars = (reviewedChunkResult, baseChunkContext) => {
|
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
//#endregion
|
|
26
25
|
export { fixChunkStartEndChars };
|
|
27
26
|
//# sourceMappingURL=fixChunkStartEndChars.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/formatLineRanges.ts
|
|
2
2
|
/**
|
|
3
3
|
* Formats a list of line numbers into a compact, human-readable string where
|
|
4
4
|
* runs of consecutive lines are collapsed into ranges.
|
|
@@ -37,6 +37,5 @@ const formatLineRanges = (lineNumbers, separator = ", ") => {
|
|
|
37
37
|
return groups.join(separator);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
//#endregion
|
|
41
40
|
export { formatLineRanges };
|
|
42
41
|
//# sourceMappingURL=formatLineRanges.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/formatTimeDiff.ts
|
|
2
2
|
const formatTimeDiff = (realtiveTime) => {
|
|
3
3
|
const diff = realtiveTime.getTime();
|
|
4
4
|
const MS_IN_SECOND = 1e3;
|
|
@@ -14,6 +14,5 @@ const formatTimeDiff = (realtiveTime) => {
|
|
|
14
14
|
return `${minutes}m ${seconds}s`;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { formatTimeDiff };
|
|
19
18
|
//# sourceMappingURL=formatTimeDiff.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { statSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/utils/getIsFileUpdatedRecently.ts
|
|
4
4
|
const SKIP_RANGE_OF_LAST_UPDATE_TIME = 0;
|
|
5
5
|
/**
|
|
6
6
|
* Check if file was updated recently, to skip re-translation
|
|
@@ -10,6 +10,5 @@ const getIsFileUpdatedRecently = (localeFilePath) => {
|
|
|
10
10
|
return new Date(stats.mtime) > /* @__PURE__ */ new Date(Date.now() - SKIP_RANGE_OF_LAST_UPDATE_TIME);
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
//#endregion
|
|
14
13
|
export { getIsFileUpdatedRecently };
|
|
15
14
|
//# sourceMappingURL=getIsFileUpdatedRecently.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveRelativePath } from "@intlayer/engine/utils";
|
|
2
2
|
import { parseStringPattern } from "@intlayer/config/utils";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/getOutputFilePath.ts
|
|
5
5
|
/**
|
|
6
6
|
* Get the output file path by replacing the base locale with the target locale
|
|
7
7
|
*
|
|
@@ -101,6 +101,5 @@ const resolveOutputPattern = async (output, locale, context, sourceFilePath, bas
|
|
|
101
101
|
return resolveRelativePath(rawPath, sourceFilePath, baseDir);
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
//#endregion
|
|
105
104
|
export { getOutputFilePath, getPatternForLocale, resolveOutputPattern };
|
|
106
105
|
//# sourceMappingURL=getOutputFilePath.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
2
1
|
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/getParentPackageJSON.ts
|
|
5
5
|
const getParentPackageJSON = (startDir) => {
|
|
6
6
|
let currentDir = startDir;
|
|
7
7
|
while (currentDir !== dirname(currentDir)) {
|
|
@@ -14,6 +14,5 @@ const getParentPackageJSON = (startDir) => {
|
|
|
14
14
|
throw new Error(`No package.json found in any parent directory of ${startDir}`);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
export { getParentPackageJSON };
|
|
19
18
|
//# sourceMappingURL=getParentPackageJSON.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/isInteractiveTerminal.ts
|
|
2
2
|
/**
|
|
3
3
|
* Whether the process can prompt: both stdin and stdout are attached to a
|
|
4
4
|
* terminal. False for AI agents, CI and piped runs, where a prompt would print
|
|
@@ -6,6 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
const isInteractiveTerminal = () => Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
8
8
|
|
|
9
|
-
//#endregion
|
|
10
9
|
export { isInteractiveTerminal };
|
|
11
10
|
//# sourceMappingURL=isInteractiveTerminal.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/utils/listSpecialChars.ts
|
|
2
2
|
const SPECIAL_CHARS = [
|
|
3
3
|
" ",
|
|
4
4
|
"\\",
|
|
@@ -48,6 +48,5 @@ const listSpecialChars = (text) => {
|
|
|
48
48
|
return results;
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
//#endregion
|
|
52
51
|
export { listSpecialChars };
|
|
53
52
|
//# sourceMappingURL=listSpecialChars.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { chunkText } from "./calculateChunks.mjs";
|
|
2
2
|
import { splitTextByLines } from "@intlayer/engine/utils";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/mapChunksBetweenFiles.ts
|
|
5
5
|
/**
|
|
6
6
|
* Maps chunks from base file to corresponding chunks in updated file,
|
|
7
7
|
* handling insertions, deletions, and modifications properly.
|
|
@@ -96,6 +96,5 @@ const determineIfChunkHasChanges = (baseChunk, updatedChunk, changedLines) => {
|
|
|
96
96
|
return baseChunk.content !== updatedChunk.content;
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
//#endregion
|
|
100
99
|
export { mapChunksBetweenFiles };
|
|
101
100
|
//# sourceMappingURL=mapChunksBetweenFiles.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { exec } from "node:child_process";
|
|
2
2
|
import { platform } from "node:os";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/openBrowser.ts
|
|
5
5
|
const openBrowser = (url) => {
|
|
6
6
|
const osPlatform = platform();
|
|
7
7
|
let command = "";
|
|
@@ -13,6 +13,5 @@ const openBrowser = (url) => {
|
|
|
13
13
|
});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
export { openBrowser };
|
|
18
17
|
//# sourceMappingURL=openBrowser.mjs.map
|