@intlayer/cli 9.7.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/_virtual/_rolldown/runtime.cjs +1 -2
- package/dist/cjs/_virtual/_utils_asset.cjs +2 -3
- package/dist/cjs/auth/login.cjs +8 -9
- package/dist/cjs/auth/sessionToken.cjs +1 -2
- package/dist/cjs/auth/setupRepository.cjs +6 -7
- 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 +5 -6
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/config.cjs +2 -3
- package/dist/cjs/editor.cjs +3 -4
- 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/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/writeFill.cjs +4 -5
- package/dist/cjs/getTargetDictionary.cjs +2 -3
- package/dist/cjs/index.cjs +27 -27
- package/dist/cjs/init.cjs +12 -13
- 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/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/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/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 +2 -3
- 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/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/esm/_virtual/_utils_asset.mjs +2 -3
- package/dist/esm/auth/login.mjs +4 -5
- package/dist/esm/auth/sessionToken.mjs +1 -2
- package/dist/esm/auth/setupRepository.mjs +3 -4
- 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 +4 -5
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/config.mjs +2 -3
- package/dist/esm/editor.mjs +2 -3
- 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/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/writeFill.mjs +2 -3
- package/dist/esm/getTargetDictionary.mjs +2 -3
- package/dist/esm/index.mjs +13 -13
- package/dist/esm/init.mjs +6 -7
- 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/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/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/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 +2 -3
- 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 +0 -2
- package/dist/types/IntlayerEventListener.d.ts.map +1 -1
- package/dist/types/auth/login.d.ts +1 -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 +1 -2
- package/dist/types/auth/setupRepository.d.ts.map +1 -1
- 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 +1 -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 +0 -2
- 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 +2 -3
- 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 +1 -1
- package/dist/types/init.d.ts +1 -2
- 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 +1 -2
- package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +0 -2
- 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 +0 -2
- 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 +0 -2
- 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 +0 -2
- package/dist/types/utils/detectGitRepository.d.ts.map +1 -1
- 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 +0 -2
- 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 +13 -13
package/dist/cjs/test/test.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_test_listMissingTranslations = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_test_listMissingTranslations = require("./listMissingTranslations.cjs");
|
|
4
4
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
5
5
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
6
6
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
@@ -8,7 +8,7 @@ let _intlayer_config_node = require("@intlayer/config/node");
|
|
|
8
8
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
9
9
|
let _intlayer_engine_build = require("@intlayer/engine/build");
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// src/test/test.ts
|
|
12
12
|
const testMissingTranslations = async (options) => {
|
|
13
13
|
const config = (0, _intlayer_config_node.getConfiguration)(options?.configOptions);
|
|
14
14
|
const { locales, requiredLocales } = config.internationalization;
|
|
@@ -52,6 +52,5 @@ const testMissingTranslations = async (options) => {
|
|
|
52
52
|
if (result.missingRequiredLocales.length > 0) process.exit(1);
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
//#endregion
|
|
56
55
|
exports.testMissingTranslations = testMissingTranslations;
|
|
57
56
|
//# sourceMappingURL=test.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const
|
|
3
|
-
const require_translateDoc_translateFile = require(
|
|
4
|
-
const
|
|
2
|
+
const require_translateDoc_translateDoc = require("./translateDoc.cjs");
|
|
3
|
+
const require_translateDoc_translateFile = require("./translateFile.cjs");
|
|
4
|
+
const require_translateDoc_validation = require("./validation.cjs");
|
|
5
5
|
|
|
6
6
|
exports.sanitizeChunk = require_translateDoc_validation.sanitizeChunk;
|
|
7
7
|
exports.translateDoc = require_translateDoc_translateDoc.translateDoc;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const
|
|
4
|
-
const require_utils_getOutputFilePath = require(
|
|
5
|
-
const
|
|
6
|
-
const require_translateDoc_translateFile = require(
|
|
7
|
-
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
8
|
-
let node_fs = require("node:fs");
|
|
9
|
-
let node_path = require("node:path");
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils_checkFileModifiedRange = require("../utils/checkFileModifiedRange.cjs");
|
|
4
|
+
const require_utils_getOutputFilePath = require("../utils/getOutputFilePath.cjs");
|
|
5
|
+
const require_utils_setupAI = require("../utils/setupAI.cjs");
|
|
6
|
+
const require_translateDoc_translateFile = require("./translateFile.cjs");
|
|
10
7
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
11
8
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
12
9
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
13
10
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
14
|
-
let
|
|
11
|
+
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
12
|
+
let node_path = require("node:path");
|
|
13
|
+
let node_fs = require("node:fs");
|
|
14
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
15
15
|
let fast_glob = require("fast-glob");
|
|
16
16
|
fast_glob = require_runtime.__toESM(fast_glob);
|
|
17
17
|
let node_perf_hooks = require("node:perf_hooks");
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
// src/translateDoc/translateDoc.ts
|
|
20
20
|
const translateDoc = async ({ docPattern, locales, excludedGlobPattern, baseLocale, aiOptions, nbSimultaneousFileProcessed = 20, configOptions, customInstructions, skipIfModifiedBefore, skipIfModifiedAfter, skipIfExists, gitOptions, flushStrategy = "incremental" }) => {
|
|
21
21
|
const configuration = (0, _intlayer_config_node.getConfiguration)(configOptions);
|
|
22
22
|
(0, _intlayer_engine_cli.logConfigDetails)(configOptions);
|
|
23
23
|
const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration);
|
|
24
24
|
const maxConcurrentChunks = nbSimultaneousFileProcessed;
|
|
25
|
-
const globalChunkLimiter = (0,
|
|
25
|
+
const globalChunkLimiter = (0, _intlayer_config_utils.pLimit)(maxConcurrentChunks);
|
|
26
26
|
let docList = await (0, fast_glob.default)(docPattern, { ignore: excludedGlobPattern });
|
|
27
27
|
const aiResult = await require_utils_setupAI.setupAI(configuration, aiOptions);
|
|
28
28
|
if (!aiResult?.hasAIAccess) return;
|
|
@@ -77,12 +77,11 @@ const translateDoc = async ({ docPattern, locales, excludedGlobPattern, baseLoca
|
|
|
77
77
|
limit: globalChunkLimiter
|
|
78
78
|
});
|
|
79
79
|
}));
|
|
80
|
-
await (0,
|
|
80
|
+
await (0, _intlayer_config_utils.parallelize)(allTasks, (task) => task(), 50);
|
|
81
81
|
const batchDuration = ((node_perf_hooks.performance.now() - batchStartTime) / 1e3).toFixed(2);
|
|
82
82
|
if (errorState.count > 0) appLogger(`Finished with ${errorState.count} errors in ${batchDuration}s.`);
|
|
83
83
|
else appLogger(`${(0, _intlayer_config_logger.colorize)("✔", _intlayer_config_colors.GREEN)} Batch completed successfully in ${(0, _intlayer_config_logger.colorizeNumber)(batchDuration)}s.`);
|
|
84
84
|
};
|
|
85
85
|
|
|
86
|
-
//#endregion
|
|
87
86
|
exports.translateDoc = translateDoc;
|
|
88
87
|
//# sourceMappingURL=translateDoc.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateDoc.cjs","names":["getConfiguration","getAppLogger","pLimit","fg","setupAI","x","listGitFiles","join","performance","colorizeNumber","getOutputFilePath","existsSync","dirname","checkFileModifiedRange","translateFile","parallelize","colorize","ANSIColors"],"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.cjs","names":["getConfiguration","getAppLogger","pLimit","fg","setupAI","x","listGitFiles","join","performance","colorizeNumber","getOutputFilePath","existsSync","dirname","checkFileModifiedRange","translateFile","parallelize","colorize","ANSIColors"],"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,oBAAgBA,wCAAiB,aAAa;CACpD,2CAAiB,aAAa;CAE9B,MAAM,gBAAYC,sCAAa,aAAa;CAK5C,MAAM,sBAAsB;CAC5B,MAAM,yBAAqBC,+BAAO,mBAAmB;CAErD,IAAI,UAAoB,UAAMC,mBAAG,YAAY,EAC3C,QAAQ,oBACV,CAAC;CAED,MAAM,WAAW,MAAMC,8BAAQ,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,GAAGC,0BAAE,GAAG,OAAO;GACzB;EACF;CACF;CAEA,IAAI,YAAY;EACd,MAAM,kBAAkB,UAAMC,mCAAa,UAAU;EACrD,IAAI,iBACF,UAAU,QAAQ,QAAQ,SACxB,gBAAgB,MAAM,gBAAYC,gBAAK,QAAQ,IAAI,GAAG,IAAI,MAAM,OAAO,CACzE;CAEJ;CAEA,MAAM,iBAAiBC,4BAAY,IAAI;CAEvC,UACE,mBAAeC,wCAAe,QAAQ,MAAM,EAAE,gBAAYA,wCAAe,QAAQ,MAAM,EAAE,sCAChEA,wCAAe,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,2BAAuBF,gBAAK,cAAc,OAAO,SAAS,OAAO;EACvE,MAAM,iBAAiBG,kDACrB,sBACA,QACA,UACF;EAGA,IAAI,oBAAgBC,oBAAW,cAAc,GAAG;EAEhD,IAAI,kBAAkB,iBAAiB,KAACA,oBAAW,cAAc,GAAG;GAClE,2BAAUC,mBAAQ,cAAc,GAAG,EAAE,WAAW,KAAK,CAAC;GACtD,2BAAc,gBAAgB,EAAE;EAClC;EAEA,MAAM,uBAAuBC,4DAAuB,gBAAgB;GAClE;GACA;EACF,CAAC;EAED,IAAI,qBAAqB,WAAW;GAClC,UAAU,qBAAqB,OAAO;GACtC;EACF;EAGA,MAAMC,iDAAc;GAClB,cAAc;GACd;GACQ;GACR;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA,OAAO;EACT,CAAC;CACH,CAAC,CACH;CAQA,UAAMC,oCAAY,WAAW,SAAS,KAAK,GAAG,EAAe;CAG7D,MAAM,kBADeP,4BAAY,IACE,IAAI,kBAAkB,IAAI,CAAE,QAAQ,CAAC;CAExE,IAAI,WAAW,QAAQ,GACrB,UAAU,iBAAiB,WAAW,MAAM,aAAa,cAAc,GAAG;MAE1E,UACE,OAAGQ,kCAAS,KAAKC,wBAAW,KAAK,EAAE,uCAAmCR,wCAAe,aAAa,EAAE,GACtG;AAEJ"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require__utils_asset = require(
|
|
4
|
-
const
|
|
5
|
-
const require_utils_chunkInference = require(
|
|
6
|
-
const require_utils_fixChunkStartEndChars = require(
|
|
7
|
-
const
|
|
8
|
-
let node_path = require("node:path");
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require__utils_asset = require("../_virtual/_utils_asset.cjs");
|
|
4
|
+
const require_utils_calculateChunks = require("../utils/calculateChunks.cjs");
|
|
5
|
+
const require_utils_chunkInference = require("../utils/chunkInference.cjs");
|
|
6
|
+
const require_utils_fixChunkStartEndChars = require("../utils/fixChunkStartEndChars.cjs");
|
|
7
|
+
const require_translateDoc_validation = require("./validation.cjs");
|
|
9
8
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
10
9
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
11
10
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
11
|
+
let node_path = require("node:path");
|
|
12
12
|
let node_fs_promises = require("node:fs/promises");
|
|
13
13
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
14
14
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
15
15
|
let node_perf_hooks = require("node:perf_hooks");
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
// src/translateDoc/translateFile.ts
|
|
18
18
|
const translateFile = async ({ baseFilePath, outputFilePath, locale, baseLocale, configuration, errorState, aiOptions, customInstructions, aiClient, aiConfig, flushStrategy = "incremental", onChunkReceive, limit }) => {
|
|
19
19
|
if (errorState.shouldStop) return null;
|
|
20
20
|
const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration, { config: { prefix: "" } });
|
|
@@ -103,6 +103,5 @@ const translateFile = async ({ baseFilePath, outputFilePath, locale, baseLocale,
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
//#endregion
|
|
107
106
|
exports.translateFile = translateFile;
|
|
108
107
|
//# sourceMappingURL=translateFile.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/translateDoc/validation.ts
|
|
3
3
|
/**
|
|
4
4
|
* Validates that the translated content matches the structure of the original.
|
|
5
5
|
* Throws an error if a mismatch is found, triggering a retry.
|
|
@@ -43,7 +43,6 @@ const sanitizeChunk = (translated, original) => {
|
|
|
43
43
|
return cleaned;
|
|
44
44
|
};
|
|
45
45
|
|
|
46
|
-
//#endregion
|
|
47
46
|
exports.sanitizeChunk = sanitizeChunk;
|
|
48
47
|
exports.validateTranslation = validateTranslation;
|
|
49
48
|
//# sourceMappingURL=validation.cjs.map
|
package/dist/cjs/upgrade.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require(
|
|
2
|
+
const require_init = require("./init.cjs");
|
|
3
3
|
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/upgrade.ts
|
|
7
7
|
/**
|
|
8
8
|
* Lists the Intlayer packages of every `package.json` of the project and
|
|
9
9
|
* upgrades them to the version of the given dist-tag.
|
|
@@ -13,6 +13,5 @@ const upgrade = async (projectRoot, options) => {
|
|
|
13
13
|
await (0, _intlayer_engine_cli.upgradeIntlayerPackages)(root, options);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
//#endregion
|
|
17
16
|
exports.upgrade = upgrade;
|
|
18
17
|
//# sourceMappingURL=upgrade.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/calculateChunks.ts
|
|
5
5
|
const DEFAULT_MAX_CHARS_PER_CHUNK = 800;
|
|
6
6
|
const DEFAULT_OVERLAP_CHARS = 0;
|
|
7
7
|
const chunkText = (text, maxCharsPerChunk = DEFAULT_MAX_CHARS_PER_CHUNK, overlapChars = DEFAULT_OVERLAP_CHARS) => {
|
|
@@ -84,6 +84,5 @@ const chunkText = (text, maxCharsPerChunk = DEFAULT_MAX_CHARS_PER_CHUNK, overlap
|
|
|
84
84
|
return overlapChunks;
|
|
85
85
|
};
|
|
86
86
|
|
|
87
|
-
//#endregion
|
|
88
87
|
exports.chunkText = chunkText;
|
|
89
88
|
//# sourceMappingURL=calculateChunks.cjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const require_utils_checkConfigConsistency = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_auth_login = require("../auth/login.cjs");
|
|
4
|
+
const require_auth_sessionToken = require("../auth/sessionToken.cjs");
|
|
5
|
+
const require_utils_checkConfigConsistency = require("./checkConfigConsistency.cjs");
|
|
6
6
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
7
7
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
8
8
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
9
9
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
10
10
|
let _intlayer_api = require("@intlayer/api");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// src/utils/checkAccess.ts
|
|
13
13
|
const getAuthenticatedAPI = async (configuration) => {
|
|
14
14
|
let sessionData = null;
|
|
15
15
|
if (configuration) sessionData = await require_auth_sessionToken.readCliSessionToken(configuration);
|
|
@@ -111,7 +111,6 @@ const checkAIAccess = async (configuration, aiOptions, shouldCheckConfigConsiste
|
|
|
111
111
|
return await checkCMSAuth(configuration, shouldCheckConfigConsistency);
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
//#endregion
|
|
115
114
|
exports.checkAIAccess = checkAIAccess;
|
|
116
115
|
exports.checkCMSAuth = checkCMSAuth;
|
|
117
116
|
exports.getAuthenticatedAPI = getAuthenticatedAPI;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/checkConfigConsistency.ts
|
|
3
3
|
const checkConfigConsistency = (subset, superset) => {
|
|
4
4
|
for (const key in subset) {
|
|
5
5
|
const val1 = subset[key];
|
|
@@ -11,6 +11,5 @@ const checkConfigConsistency = (subset, superset) => {
|
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.checkConfigConsistency = checkConfigConsistency;
|
|
16
15
|
//# sourceMappingURL=checkConfigConsistency.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_checkLastUpdateTime = require(
|
|
3
|
-
const require_utils_formatTimeDiff = require(
|
|
2
|
+
const require_utils_checkLastUpdateTime = require("./checkLastUpdateTime.cjs");
|
|
3
|
+
const require_utils_formatTimeDiff = require("./formatTimeDiff.cjs");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/checkFileModifiedRange.ts
|
|
6
6
|
/**
|
|
7
7
|
* Threshold that helps us differentiate between a numeric *timestamp* (ms from epoch)
|
|
8
8
|
* and a numeric *duration* (ms ago).
|
|
@@ -78,6 +78,5 @@ const checkFileModifiedRange = (filePath, options) => {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
//#endregion
|
|
82
81
|
exports.checkFileModifiedRange = checkFileModifiedRange;
|
|
83
82
|
//# sourceMappingURL=checkFileModifiedRange.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let node_fs = require("node:fs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/checkLastUpdateTime.ts
|
|
5
5
|
/**
|
|
6
6
|
* Returns the last modification date of a file.
|
|
7
7
|
*
|
|
@@ -14,6 +14,5 @@ const checkLastUpdateTime = (filePath) => {
|
|
|
14
14
|
return new Date(stats.mtime);
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.checkLastUpdateTime = checkLastUpdateTime;
|
|
19
18
|
//# sourceMappingURL=checkLastUpdateTime.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_checkAccess = require(
|
|
2
|
+
const require_utils_checkAccess = require("./checkAccess.cjs");
|
|
3
3
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/chunkInference.ts
|
|
6
6
|
/**
|
|
7
7
|
* Translates a single chunk via the OpenAI API.
|
|
8
8
|
* Includes retry logic if the call fails.
|
|
@@ -41,6 +41,5 @@ const processContent = (content) => {
|
|
|
41
41
|
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", "");
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
//#endregion
|
|
45
44
|
exports.chunkInference = chunkInference;
|
|
46
45
|
//# sourceMappingURL=chunkInference.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let node_path = require("node:path");
|
|
3
2
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
4
|
let node_child_process = require("node:child_process");
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/utils/detectGitRepository.ts
|
|
7
7
|
const HOST_PROVIDERS = {
|
|
8
8
|
"github.com": "github",
|
|
9
9
|
"gitlab.com": "gitlab",
|
|
@@ -81,7 +81,6 @@ const detectGitRepository = (projectRoot) => {
|
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
//#endregion
|
|
85
84
|
exports.detectGitRepository = detectGitRepository;
|
|
86
85
|
exports.parseGitRemoteUrl = parseGitRemoteUrl;
|
|
87
86
|
//# sourceMappingURL=detectGitRepository.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/fixChunkStartEndChars.ts
|
|
3
3
|
const CHAR_TO_CHECK_FORMATTING = [
|
|
4
4
|
"```",
|
|
5
5
|
"\n\n",
|
|
@@ -23,6 +23,5 @@ const fixChunkStartEndChars = (reviewedChunkResult, baseChunkContext) => {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
//#endregion
|
|
27
26
|
exports.fixChunkStartEndChars = fixChunkStartEndChars;
|
|
28
27
|
//# sourceMappingURL=fixChunkStartEndChars.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/formatLineRanges.ts
|
|
3
3
|
/**
|
|
4
4
|
* Formats a list of line numbers into a compact, human-readable string where
|
|
5
5
|
* runs of consecutive lines are collapsed into ranges.
|
|
@@ -38,6 +38,5 @@ const formatLineRanges = (lineNumbers, separator = ", ") => {
|
|
|
38
38
|
return groups.join(separator);
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
//#endregion
|
|
42
41
|
exports.formatLineRanges = formatLineRanges;
|
|
43
42
|
//# sourceMappingURL=formatLineRanges.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/formatTimeDiff.ts
|
|
3
3
|
const formatTimeDiff = (realtiveTime) => {
|
|
4
4
|
const diff = realtiveTime.getTime();
|
|
5
5
|
const MS_IN_SECOND = 1e3;
|
|
@@ -15,6 +15,5 @@ const formatTimeDiff = (realtiveTime) => {
|
|
|
15
15
|
return `${minutes}m ${seconds}s`;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.formatTimeDiff = formatTimeDiff;
|
|
20
19
|
//# sourceMappingURL=formatTimeDiff.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
let node_fs = require("node:fs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/getIsFileUpdatedRecently.ts
|
|
5
5
|
const SKIP_RANGE_OF_LAST_UPDATE_TIME = 0;
|
|
6
6
|
/**
|
|
7
7
|
* Check if file was updated recently, to skip re-translation
|
|
@@ -11,6 +11,5 @@ const getIsFileUpdatedRecently = (localeFilePath) => {
|
|
|
11
11
|
return new Date(stats.mtime) > /* @__PURE__ */ new Date(Date.now() - SKIP_RANGE_OF_LAST_UPDATE_TIME);
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//#endregion
|
|
15
14
|
exports.getIsFileUpdatedRecently = getIsFileUpdatedRecently;
|
|
16
15
|
//# sourceMappingURL=getIsFileUpdatedRecently.cjs.map
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
3
3
|
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/getOutputFilePath.ts
|
|
6
6
|
/**
|
|
7
7
|
* Get the output file path by replacing the base locale with the target locale
|
|
8
8
|
*
|
|
@@ -102,7 +102,6 @@ const resolveOutputPattern = async (output, locale, context, sourceFilePath, bas
|
|
|
102
102
|
return (0, _intlayer_engine_utils.resolveRelativePath)(rawPath, sourceFilePath, baseDir);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
-
//#endregion
|
|
106
105
|
exports.getOutputFilePath = getOutputFilePath;
|
|
107
106
|
exports.getPatternForLocale = getPatternForLocale;
|
|
108
107
|
exports.resolveOutputPattern = resolveOutputPattern;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let node_fs = require("node:fs");
|
|
3
2
|
let node_path = require("node:path");
|
|
3
|
+
let node_fs = require("node:fs");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/getParentPackageJSON.ts
|
|
6
6
|
const getParentPackageJSON = (startDir) => {
|
|
7
7
|
let currentDir = startDir;
|
|
8
8
|
while (currentDir !== (0, node_path.dirname)(currentDir)) {
|
|
@@ -15,6 +15,5 @@ const getParentPackageJSON = (startDir) => {
|
|
|
15
15
|
throw new Error(`No package.json found in any parent directory of ${startDir}`);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
exports.getParentPackageJSON = getParentPackageJSON;
|
|
20
19
|
//# sourceMappingURL=getParentPackageJSON.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/isInteractiveTerminal.ts
|
|
3
3
|
/**
|
|
4
4
|
* Whether the process can prompt: both stdin and stdout are attached to a
|
|
5
5
|
* terminal. False for AI agents, CI and piped runs, where a prompt would print
|
|
@@ -7,6 +7,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
7
7
|
*/
|
|
8
8
|
const isInteractiveTerminal = () => Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
9
9
|
|
|
10
|
-
//#endregion
|
|
11
10
|
exports.isInteractiveTerminal = isInteractiveTerminal;
|
|
12
11
|
//# sourceMappingURL=isInteractiveTerminal.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/listSpecialChars.ts
|
|
3
3
|
const SPECIAL_CHARS = [
|
|
4
4
|
" ",
|
|
5
5
|
"\\",
|
|
@@ -49,6 +49,5 @@ const listSpecialChars = (text) => {
|
|
|
49
49
|
return results;
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
-
//#endregion
|
|
53
52
|
exports.listSpecialChars = listSpecialChars;
|
|
54
53
|
//# sourceMappingURL=listSpecialChars.cjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_calculateChunks = require(
|
|
2
|
+
const require_utils_calculateChunks = require("./calculateChunks.cjs");
|
|
3
3
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/mapChunksBetweenFiles.ts
|
|
6
6
|
/**
|
|
7
7
|
* Maps chunks from base file to corresponding chunks in updated file,
|
|
8
8
|
* handling insertions, deletions, and modifications properly.
|
|
@@ -97,6 +97,5 @@ const determineIfChunkHasChanges = (baseChunk, updatedChunk, changedLines) => {
|
|
|
97
97
|
return baseChunk.content !== updatedChunk.content;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
//#endregion
|
|
101
100
|
exports.mapChunksBetweenFiles = mapChunksBetweenFiles;
|
|
102
101
|
//# sourceMappingURL=mapChunksBetweenFiles.cjs.map
|
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
let node_child_process = require("node:child_process");
|
|
3
3
|
let node_os = require("node:os");
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/utils/openBrowser.ts
|
|
6
6
|
const openBrowser = (url) => {
|
|
7
7
|
const osPlatform = (0, node_os.platform)();
|
|
8
8
|
let command = "";
|
|
@@ -14,6 +14,5 @@ const openBrowser = (url) => {
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//#endregion
|
|
18
17
|
exports.openBrowser = openBrowser;
|
|
19
18
|
//# sourceMappingURL=openBrowser.cjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
|
|
2
|
+
// src/utils/parseChoice.ts
|
|
3
3
|
/**
|
|
4
4
|
* Resolves a command-line value against its allowed choices, ignoring case.
|
|
5
5
|
*
|
|
@@ -16,6 +16,5 @@ const parseChoice = (value, choices, optionName) => {
|
|
|
16
16
|
return choice;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
exports.parseChoice = parseChoice;
|
|
21
20
|
//# sourceMappingURL=parseChoice.cjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_utils_listSpecialChars = require(
|
|
2
|
+
const require_utils_listSpecialChars = require("./listSpecialChars.cjs");
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/utils/reorderParagraphs.ts
|
|
5
5
|
/**
|
|
6
6
|
* Split a text into paragraphs.
|
|
7
7
|
*
|
|
@@ -89,6 +89,5 @@ const reorderParagraphs = (textToReorder, baseFileContent) => {
|
|
|
89
89
|
return [...leadingExtras, ...result].join("\n\n");
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
//#endregion
|
|
93
92
|
exports.reorderParagraphs = reorderParagraphs;
|
|
94
93
|
//# sourceMappingURL=reorderParagraphs.cjs.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
4
4
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
5
5
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/utils/selectCmsEnvironment.ts
|
|
8
8
|
/**
|
|
9
9
|
* Selects the CMS project environment that matches `environmentName`.
|
|
10
10
|
*
|
|
@@ -42,6 +42,5 @@ const selectCmsEnvironment = async (environmentName, intlayerAPI, config) => {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
//#endregion
|
|
46
45
|
exports.selectCmsEnvironment = selectCmsEnvironment;
|
|
47
46
|
//# sourceMappingURL=selectCmsEnvironment.cjs.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_utils_checkAccess = require(
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_utils_checkAccess = require("./checkAccess.cjs");
|
|
4
4
|
let _intlayer_config_colors = require("@intlayer/config/colors");
|
|
5
5
|
_intlayer_config_colors = require_runtime.__toESM(_intlayer_config_colors);
|
|
6
6
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/utils/setupAI.ts
|
|
9
9
|
globalThis.AI_SDK_LOG_WARNINGS = false;
|
|
10
10
|
const logAIConfig = (aiOptions, appLogger) => {
|
|
11
11
|
appLogger([
|
|
@@ -63,6 +63,5 @@ const setupAI = async (configuration, aiOptions) => {
|
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
//#endregion
|
|
67
66
|
exports.setupAI = setupAI;
|
|
68
67
|
//# sourceMappingURL=setupAI.cjs.map
|
package/dist/cjs/watch.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
3
2
|
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
4
3
|
let _intlayer_config_node = require("@intlayer/config/node");
|
|
4
|
+
let _intlayer_engine_cli = require("@intlayer/engine/cli");
|
|
5
5
|
let _intlayer_engine_utils = require("@intlayer/engine/utils");
|
|
6
6
|
let _intlayer_engine_watcher = require("@intlayer/engine/watcher");
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// src/watch.ts
|
|
9
9
|
/**
|
|
10
10
|
* Grace period granted to the `--with` child (e.g. Next.js/Turbopack) to exit
|
|
11
11
|
* after SIGTERM before it is force-killed with SIGKILL. Detached dev servers
|
|
@@ -68,6 +68,5 @@ const watchContentDeclaration = async (options) => {
|
|
|
68
68
|
process.on("SIGTERM", handleShutdown);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
//#endregion
|
|
72
71
|
exports.watchContentDeclaration = watchContentDeclaration;
|
|
73
72
|
//# sourceMappingURL=watch.cjs.map
|
|
@@ -3,7 +3,7 @@ import { getIntlayerAPIProxy } from "@intlayer/api";
|
|
|
3
3
|
import { editor, log } from "@intlayer/config/built";
|
|
4
4
|
import { EventSource } from "eventsource";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/IntlayerEventListener.ts
|
|
7
7
|
/**
|
|
8
8
|
* IntlayerEventListener class to listen for dictionary changes via SSE (Server-Sent Events).
|
|
9
9
|
*
|
|
@@ -179,6 +179,5 @@ var IntlayerEventListener = class {
|
|
|
179
179
|
}
|
|
180
180
|
};
|
|
181
181
|
|
|
182
|
-
//#endregion
|
|
183
182
|
export { IntlayerEventListener };
|
|
184
183
|
//# sourceMappingURL=IntlayerEventListener.mjs.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
|
|
3
3
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
4
4
|
throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
//#endregion
|
|
8
7
|
export { __require };
|