@intlayer/cli 8.1.2 → 8.1.3
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 -186
- package/dist/cjs/IntlayerEventListener.cjs.map +1 -1
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
- package/dist/cjs/auth/login.cjs +2 -85
- package/dist/cjs/auth/login.cjs.map +1 -1
- package/dist/cjs/build.cjs +1 -27
- package/dist/cjs/build.cjs.map +1 -1
- package/dist/cjs/ci.cjs +1 -73
- package/dist/cjs/ci.cjs.map +1 -1
- package/dist/cjs/cli.cjs +1 -476
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/config.cjs +1 -12
- package/dist/cjs/config.cjs.map +1 -1
- package/dist/cjs/editor.cjs +1 -50
- package/dist/cjs/editor.cjs.map +1 -1
- package/dist/cjs/extract.cjs +1 -96
- package/dist/cjs/extract.cjs.map +1 -1
- package/dist/cjs/fill/deepMergeContent.cjs +1 -27
- package/dist/cjs/fill/deepMergeContent.cjs.map +1 -1
- package/dist/cjs/fill/fill.cjs +1 -78
- package/dist/cjs/fill/fill.cjs.map +1 -1
- package/dist/cjs/fill/formatAutoFilledFilePath.cjs +1 -29
- package/dist/cjs/fill/formatAutoFilledFilePath.cjs.map +1 -1
- package/dist/cjs/fill/formatFillData.cjs +1 -50
- package/dist/cjs/fill/formatFillData.cjs.map +1 -1
- package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs +1 -26
- package/dist/cjs/fill/getAvailableLocalesInDictionary.cjs.map +1 -1
- package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs +1 -50
- package/dist/cjs/fill/getFilterMissingContentPerLocale.cjs.map +1 -1
- package/dist/cjs/fill/index.cjs +1 -6
- package/dist/cjs/fill/listTranslationsTasks.cjs +1 -70
- package/dist/cjs/fill/listTranslationsTasks.cjs.map +1 -1
- package/dist/cjs/fill/mergeChunks.cjs +1 -28
- package/dist/cjs/fill/mergeChunks.cjs.map +1 -1
- package/dist/cjs/fill/translateDictionary.cjs +1 -205
- package/dist/cjs/fill/translateDictionary.cjs.map +1 -1
- package/dist/cjs/fill/writeFill.cjs +1 -54
- package/dist/cjs/fill/writeFill.cjs.map +1 -1
- package/dist/cjs/getTargetDictionary.cjs +1 -36
- package/dist/cjs/getTargetDictionary.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -39
- package/dist/cjs/init.cjs +1 -322
- package/dist/cjs/init.cjs.map +1 -1
- package/dist/cjs/initSkills.cjs +2 -0
- package/dist/cjs/initSkills.cjs.map +1 -0
- package/dist/cjs/listContentDeclaration.cjs +1 -41
- package/dist/cjs/listContentDeclaration.cjs.map +1 -1
- package/dist/cjs/listProjects.cjs +1 -28
- package/dist/cjs/listProjects.cjs.map +1 -1
- package/dist/cjs/liveSync.cjs +8 -151
- package/dist/cjs/liveSync.cjs.map +1 -1
- package/dist/cjs/pull.cjs +1 -146
- package/dist/cjs/pull.cjs.map +1 -1
- package/dist/cjs/push/pullLog.cjs +3 -102
- package/dist/cjs/push/pullLog.cjs.map +1 -1
- package/dist/cjs/push/push.cjs +1 -206
- package/dist/cjs/push/push.cjs.map +1 -1
- package/dist/cjs/pushConfig.cjs +1 -19
- package/dist/cjs/pushConfig.cjs.map +1 -1
- package/dist/cjs/pushLog.cjs +3 -84
- package/dist/cjs/pushLog.cjs.map +1 -1
- package/dist/cjs/reviewDoc/reviewDoc.cjs +1 -68
- package/dist/cjs/reviewDoc/reviewDoc.cjs.map +1 -1
- package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs +1 -94
- package/dist/cjs/reviewDoc/reviewDocBlockAware.cjs.map +1 -1
- package/dist/cjs/searchDoc.cjs +1 -38
- package/dist/cjs/searchDoc.cjs.map +1 -1
- package/dist/cjs/test/index.cjs +1 -7
- package/dist/cjs/test/listMissingTranslations.cjs +1 -49
- package/dist/cjs/test/listMissingTranslations.cjs.map +1 -1
- package/dist/cjs/test/test.cjs +1 -53
- package/dist/cjs/test/test.cjs.map +1 -1
- package/dist/cjs/translateDoc/index.cjs +1 -9
- package/dist/cjs/translateDoc/translateDoc.cjs +1 -74
- package/dist/cjs/translateDoc/translateDoc.cjs.map +1 -1
- package/dist/cjs/translateDoc/translateFile.cjs +2 -103
- package/dist/cjs/translateDoc/translateFile.cjs.map +1 -1
- package/dist/cjs/translateDoc/validation.cjs +5 -49
- package/dist/cjs/translateDoc/validation.cjs.map +1 -1
- package/dist/cjs/translation-alignment/alignBlocks.cjs +1 -67
- package/dist/cjs/translation-alignment/alignBlocks.cjs.map +1 -1
- package/dist/cjs/translation-alignment/computeSimilarity.cjs +1 -25
- package/dist/cjs/translation-alignment/computeSimilarity.cjs.map +1 -1
- package/dist/cjs/translation-alignment/fingerprintBlock.cjs +1 -23
- package/dist/cjs/translation-alignment/fingerprintBlock.cjs.map +1 -1
- package/dist/cjs/translation-alignment/index.cjs +1 -22
- package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs +1 -18
- package/dist/cjs/translation-alignment/mapChangedLinesToBlocks.cjs.map +1 -1
- package/dist/cjs/translation-alignment/normalizeBlock.cjs +1 -22
- package/dist/cjs/translation-alignment/normalizeBlock.cjs.map +1 -1
- package/dist/cjs/translation-alignment/pipeline.cjs +1 -37
- package/dist/cjs/translation-alignment/pipeline.cjs.map +1 -1
- package/dist/cjs/translation-alignment/planActions.cjs +1 -46
- package/dist/cjs/translation-alignment/planActions.cjs.map +1 -1
- package/dist/cjs/translation-alignment/rebuildDocument.cjs +2 -49
- package/dist/cjs/translation-alignment/rebuildDocument.cjs.map +1 -1
- package/dist/cjs/translation-alignment/segmentDocument.cjs +5 -66
- package/dist/cjs/translation-alignment/segmentDocument.cjs.map +1 -1
- package/dist/cjs/utils/calculateChunks.cjs +2 -89
- package/dist/cjs/utils/calculateChunks.cjs.map +1 -1
- package/dist/cjs/utils/checkAccess.cjs +1 -81
- package/dist/cjs/utils/checkAccess.cjs.map +1 -1
- package/dist/cjs/utils/checkConfigConsistency.cjs +1 -16
- package/dist/cjs/utils/checkConfigConsistency.cjs.map +1 -1
- package/dist/cjs/utils/checkFileModifiedRange.cjs +1 -81
- package/dist/cjs/utils/checkFileModifiedRange.cjs.map +1 -1
- package/dist/cjs/utils/checkLastUpdateTime.cjs +1 -19
- package/dist/cjs/utils/checkLastUpdateTime.cjs.map +1 -1
- package/dist/cjs/utils/chunkInference.cjs +1 -45
- package/dist/cjs/utils/chunkInference.cjs.map +1 -1
- package/dist/cjs/utils/fixChunkStartEndChars.cjs +3 -27
- package/dist/cjs/utils/fixChunkStartEndChars.cjs.map +1 -1
- package/dist/cjs/utils/formatTimeDiff.cjs +1 -20
- package/dist/cjs/utils/formatTimeDiff.cjs.map +1 -1
- package/dist/cjs/utils/getIsFileUpdatedRecently.cjs +1 -16
- package/dist/cjs/utils/getIsFileUpdatedRecently.cjs.map +1 -1
- package/dist/cjs/utils/getOutputFilePath.cjs +1 -74
- package/dist/cjs/utils/getOutputFilePath.cjs.map +1 -1
- package/dist/cjs/utils/getParentPackageJSON.cjs +1 -20
- package/dist/cjs/utils/getParentPackageJSON.cjs.map +1 -1
- package/dist/cjs/utils/listSpecialChars.cjs +2 -54
- package/dist/cjs/utils/listSpecialChars.cjs.map +1 -1
- package/dist/cjs/utils/mapChunksBetweenFiles.cjs +1 -102
- package/dist/cjs/utils/mapChunksBetweenFiles.cjs.map +1 -1
- package/dist/cjs/utils/openBrowser.cjs +1 -19
- package/dist/cjs/utils/openBrowser.cjs.map +1 -1
- package/dist/cjs/utils/reorderParagraphs.cjs +3 -91
- package/dist/cjs/utils/reorderParagraphs.cjs.map +1 -1
- package/dist/cjs/utils/setupAI.cjs +1 -64
- package/dist/cjs/utils/setupAI.cjs.map +1 -1
- package/dist/cjs/watch.cjs +1 -43
- package/dist/cjs/watch.cjs.map +1 -1
- package/dist/esm/IntlayerEventListener.mjs +1 -183
- package/dist/esm/IntlayerEventListener.mjs.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
- package/dist/esm/_virtual/_utils_asset.mjs +2 -97
- package/dist/esm/auth/login.mjs +2 -82
- package/dist/esm/auth/login.mjs.map +1 -1
- package/dist/esm/build.mjs +1 -25
- package/dist/esm/build.mjs.map +1 -1
- package/dist/esm/ci.mjs +1 -71
- package/dist/esm/ci.mjs.map +1 -1
- package/dist/esm/cli.mjs +1 -473
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/config.mjs +1 -10
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/editor.mjs +1 -49
- package/dist/esm/editor.mjs.map +1 -1
- package/dist/esm/extract.mjs +1 -93
- package/dist/esm/extract.mjs.map +1 -1
- package/dist/esm/fill/deepMergeContent.mjs +1 -25
- package/dist/esm/fill/deepMergeContent.mjs.map +1 -1
- package/dist/esm/fill/fill.mjs +1 -76
- package/dist/esm/fill/fill.mjs.map +1 -1
- package/dist/esm/fill/formatAutoFilledFilePath.mjs +1 -27
- package/dist/esm/fill/formatAutoFilledFilePath.mjs.map +1 -1
- package/dist/esm/fill/formatFillData.mjs +1 -49
- package/dist/esm/fill/formatFillData.mjs.map +1 -1
- package/dist/esm/fill/getAvailableLocalesInDictionary.mjs +1 -24
- package/dist/esm/fill/getAvailableLocalesInDictionary.mjs.map +1 -1
- package/dist/esm/fill/getFilterMissingContentPerLocale.mjs +1 -48
- package/dist/esm/fill/getFilterMissingContentPerLocale.mjs.map +1 -1
- package/dist/esm/fill/index.mjs +1 -4
- package/dist/esm/fill/listTranslationsTasks.mjs +1 -68
- package/dist/esm/fill/listTranslationsTasks.mjs.map +1 -1
- package/dist/esm/fill/mergeChunks.mjs +1 -26
- package/dist/esm/fill/mergeChunks.mjs.map +1 -1
- package/dist/esm/fill/translateDictionary.mjs +1 -203
- package/dist/esm/fill/translateDictionary.mjs.map +1 -1
- package/dist/esm/fill/writeFill.mjs +1 -52
- package/dist/esm/fill/writeFill.mjs.map +1 -1
- package/dist/esm/getTargetDictionary.mjs +1 -33
- package/dist/esm/getTargetDictionary.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -18
- package/dist/esm/init.mjs +1 -317
- package/dist/esm/init.mjs.map +1 -1
- package/dist/esm/initSkills.mjs +2 -0
- package/dist/esm/initSkills.mjs.map +1 -0
- package/dist/esm/listContentDeclaration.mjs +1 -38
- package/dist/esm/listContentDeclaration.mjs.map +1 -1
- package/dist/esm/listProjects.mjs +1 -26
- package/dist/esm/listProjects.mjs.map +1 -1
- package/dist/esm/liveSync.mjs +8 -148
- package/dist/esm/liveSync.mjs.map +1 -1
- package/dist/esm/pull.mjs +1 -144
- package/dist/esm/pull.mjs.map +1 -1
- package/dist/esm/push/pullLog.mjs +3 -100
- package/dist/esm/push/pullLog.mjs.map +1 -1
- package/dist/esm/push/push.mjs +1 -203
- package/dist/esm/push/push.mjs.map +1 -1
- package/dist/esm/pushConfig.mjs +1 -17
- package/dist/esm/pushConfig.mjs.map +1 -1
- package/dist/esm/pushLog.mjs +3 -82
- package/dist/esm/pushLog.mjs.map +1 -1
- package/dist/esm/reviewDoc/reviewDoc.mjs +1 -65
- package/dist/esm/reviewDoc/reviewDoc.mjs.map +1 -1
- package/dist/esm/reviewDoc/reviewDocBlockAware.mjs +1 -92
- package/dist/esm/reviewDoc/reviewDocBlockAware.mjs.map +1 -1
- package/dist/esm/searchDoc.mjs +1 -36
- package/dist/esm/searchDoc.mjs.map +1 -1
- package/dist/esm/test/index.mjs +1 -4
- package/dist/esm/test/listMissingTranslations.mjs +1 -46
- package/dist/esm/test/listMissingTranslations.mjs.map +1 -1
- package/dist/esm/test/test.mjs +1 -51
- package/dist/esm/test/test.mjs.map +1 -1
- package/dist/esm/translateDoc/index.mjs +1 -5
- package/dist/esm/translateDoc/translateDoc.mjs +1 -71
- package/dist/esm/translateDoc/translateDoc.mjs.map +1 -1
- package/dist/esm/translateDoc/translateFile.mjs +2 -101
- package/dist/esm/translateDoc/translateFile.mjs.map +1 -1
- package/dist/esm/translateDoc/validation.mjs +5 -46
- package/dist/esm/translateDoc/validation.mjs.map +1 -1
- package/dist/esm/translation-alignment/alignBlocks.mjs +1 -66
- package/dist/esm/translation-alignment/alignBlocks.mjs.map +1 -1
- package/dist/esm/translation-alignment/computeSimilarity.mjs +1 -22
- package/dist/esm/translation-alignment/computeSimilarity.mjs.map +1 -1
- package/dist/esm/translation-alignment/fingerprintBlock.mjs +1 -20
- package/dist/esm/translation-alignment/fingerprintBlock.mjs.map +1 -1
- package/dist/esm/translation-alignment/index.mjs +1 -11
- package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs +1 -16
- package/dist/esm/translation-alignment/mapChangedLinesToBlocks.mjs.map +1 -1
- package/dist/esm/translation-alignment/normalizeBlock.mjs +1 -20
- package/dist/esm/translation-alignment/normalizeBlock.mjs.map +1 -1
- package/dist/esm/translation-alignment/pipeline.mjs +1 -35
- package/dist/esm/translation-alignment/pipeline.mjs.map +1 -1
- package/dist/esm/translation-alignment/planActions.mjs +1 -44
- package/dist/esm/translation-alignment/planActions.mjs.map +1 -1
- package/dist/esm/translation-alignment/rebuildDocument.mjs +2 -46
- package/dist/esm/translation-alignment/rebuildDocument.mjs.map +1 -1
- package/dist/esm/translation-alignment/segmentDocument.mjs +5 -64
- package/dist/esm/translation-alignment/segmentDocument.mjs.map +1 -1
- package/dist/esm/utils/calculateChunks.mjs +2 -87
- package/dist/esm/utils/calculateChunks.mjs.map +1 -1
- package/dist/esm/utils/checkAccess.mjs +1 -78
- package/dist/esm/utils/checkAccess.mjs.map +1 -1
- package/dist/esm/utils/checkConfigConsistency.mjs +1 -14
- package/dist/esm/utils/checkConfigConsistency.mjs.map +1 -1
- package/dist/esm/utils/checkFileModifiedRange.mjs +1 -80
- package/dist/esm/utils/checkFileModifiedRange.mjs.map +1 -1
- package/dist/esm/utils/checkLastUpdateTime.mjs +1 -17
- package/dist/esm/utils/checkLastUpdateTime.mjs.map +1 -1
- package/dist/esm/utils/chunkInference.mjs +1 -43
- package/dist/esm/utils/chunkInference.mjs.map +1 -1
- package/dist/esm/utils/fixChunkStartEndChars.mjs +3 -25
- package/dist/esm/utils/fixChunkStartEndChars.mjs.map +1 -1
- package/dist/esm/utils/formatTimeDiff.mjs +1 -18
- package/dist/esm/utils/formatTimeDiff.mjs.map +1 -1
- package/dist/esm/utils/getIsFileUpdatedRecently.mjs +1 -14
- package/dist/esm/utils/getIsFileUpdatedRecently.mjs.map +1 -1
- package/dist/esm/utils/getOutputFilePath.mjs +1 -72
- package/dist/esm/utils/getOutputFilePath.mjs.map +1 -1
- package/dist/esm/utils/getParentPackageJSON.mjs +1 -18
- package/dist/esm/utils/getParentPackageJSON.mjs.map +1 -1
- package/dist/esm/utils/listSpecialChars.mjs +2 -52
- package/dist/esm/utils/listSpecialChars.mjs.map +1 -1
- package/dist/esm/utils/mapChunksBetweenFiles.mjs +1 -100
- package/dist/esm/utils/mapChunksBetweenFiles.mjs.map +1 -1
- package/dist/esm/utils/openBrowser.mjs +1 -17
- package/dist/esm/utils/openBrowser.mjs.map +1 -1
- package/dist/esm/utils/reorderParagraphs.mjs +3 -90
- package/dist/esm/utils/reorderParagraphs.mjs.map +1 -1
- package/dist/esm/utils/setupAI.mjs +1 -62
- package/dist/esm/utils/setupAI.mjs.map +1 -1
- package/dist/esm/watch.mjs +1 -41
- package/dist/esm/watch.mjs.map +1 -1
- package/dist/types/auth/login.d.ts +1 -1
- package/dist/types/auth/login.d.ts.map +1 -1
- package/dist/types/build.d.ts +1 -1
- package/dist/types/build.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/extract.d.ts +1 -1
- package/dist/types/extract.d.ts.map +1 -1
- package/dist/types/fill/fill.d.ts +1 -1
- package/dist/types/fill/fill.d.ts.map +1 -1
- package/dist/types/fill/translateDictionary.d.ts +2 -2
- package/dist/types/fill/translateDictionary.d.ts.map +1 -1
- package/dist/types/fill/writeFill.d.ts.map +1 -1
- package/dist/types/getTargetDictionary.d.ts +2 -2
- package/dist/types/index.d.ts +7 -3
- package/dist/types/init.d.ts +2 -5
- package/dist/types/init.d.ts.map +1 -1
- package/dist/types/initSkills.d.ts +8 -0
- package/dist/types/initSkills.d.ts.map +1 -0
- package/dist/types/listContentDeclaration.d.ts +1 -1
- package/dist/types/listContentDeclaration.d.ts.map +1 -1
- package/dist/types/liveSync.d.ts +1 -1
- package/dist/types/pull.d.ts +1 -1
- package/dist/types/pull.d.ts.map +1 -1
- package/dist/types/push/pullLog.d.ts +1 -1
- package/dist/types/push/pullLog.d.ts.map +1 -1
- package/dist/types/push/push.d.ts +2 -2
- package/dist/types/pushConfig.d.ts +1 -1
- package/dist/types/reviewDoc/reviewDoc.d.ts +2 -2
- package/dist/types/reviewDoc/reviewDoc.d.ts.map +1 -1
- package/dist/types/reviewDoc/reviewDocBlockAware.d.ts +1 -1
- package/dist/types/reviewDoc/reviewDocBlockAware.d.ts.map +1 -1
- package/dist/types/searchDoc.d.ts +1 -1
- package/dist/types/searchDoc.d.ts.map +1 -1
- package/dist/types/test/listMissingTranslations.d.ts +1 -1
- package/dist/types/test/test.d.ts +1 -1
- package/dist/types/test/test.d.ts.map +1 -1
- package/dist/types/translateDoc/translateDoc.d.ts.map +1 -1
- package/dist/types/translateDoc/types.d.ts +2 -2
- package/dist/types/translateDoc/validation.d.ts +1 -1
- package/dist/types/utils/checkAccess.d.ts.map +1 -1
- package/dist/types/watch.d.ts +1 -1
- package/dist/types/watch.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { platform } from "node:os";
|
|
3
|
-
|
|
4
|
-
//#region src/utils/openBrowser.ts
|
|
5
|
-
const openBrowser = (url) => {
|
|
6
|
-
const osPlatform = platform();
|
|
7
|
-
let command = "";
|
|
8
|
-
if (osPlatform === "darwin") command = `open "${url}"`;
|
|
9
|
-
else if (osPlatform === "win32") command = `start "${url}"`;
|
|
10
|
-
else command = `xdg-open "${url}"`;
|
|
11
|
-
exec(command, (error) => {
|
|
12
|
-
if (error) console.error(`Failed to open browser: ${error.message}`);
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
//#endregion
|
|
17
|
-
export { openBrowser };
|
|
1
|
+
import{exec as e}from"node:child_process";import{platform as t}from"node:os";const n=n=>{let r=t(),i=``;i=r===`darwin`?`open "${n}"`:r===`win32`?`start "${n}"`:`xdg-open "${n}"`,e(i,e=>{e&&console.error(`Failed to open browser: ${e.message}`)})};export{n as openBrowser};
|
|
18
2
|
//# sourceMappingURL=openBrowser.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openBrowser.mjs","names":[],"sources":["../../../src/utils/openBrowser.ts"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { platform } from 'node:os';\n\nexport const openBrowser = (url: string) => {\n const osPlatform = platform();\n let command = '';\n\n if (osPlatform === 'darwin') {\n command = `open \"${url}\"`;\n } else if (osPlatform === 'win32') {\n command = `start \"${url}\"`;\n } else {\n command = `xdg-open \"${url}\"`;\n }\n\n exec(command, (error) => {\n if (error) {\n console.error(`Failed to open browser: ${error.message}`);\n }\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"openBrowser.mjs","names":[],"sources":["../../../src/utils/openBrowser.ts"],"sourcesContent":["import { exec } from 'node:child_process';\nimport { platform } from 'node:os';\n\nexport const openBrowser = (url: string) => {\n const osPlatform = platform();\n let command = '';\n\n if (osPlatform === 'darwin') {\n command = `open \"${url}\"`;\n } else if (osPlatform === 'win32') {\n command = `start \"${url}\"`;\n } else {\n command = `xdg-open \"${url}\"`;\n }\n\n exec(command, (error) => {\n if (error) {\n console.error(`Failed to open browser: ${error.message}`);\n }\n });\n};\n"],"mappings":"6EAGA,MAAa,EAAe,GAAgB,CAC1C,IAAM,EAAa,GAAU,CACzB,EAAU,GAEd,AAKE,EALE,IAAe,SACP,SAAS,EAAI,GACd,IAAe,QACd,UAAU,EAAI,GAEd,aAAa,EAAI,GAG7B,EAAK,EAAU,GAAU,CACnB,GACF,QAAQ,MAAM,2BAA2B,EAAM,UAAU,EAE3D"}
|
|
@@ -1,93 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{listSpecialChars as e}from"./listSpecialChars.mjs";const t=e=>{let t=[],n=e.split(/(\n{2,})/);for(let e=0;e<n.length;e++){let r=n[e];if(e%2==0){r&&t.push(r);continue}let i=Math.floor(r.length/2),a=Math.max(0,i-2);for(let e=0;e<a;e++)t.push(`
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Split a text into paragraphs.
|
|
6
|
-
*
|
|
7
|
-
* We consider a paragraph boundary to be a block of at least two consecutive
|
|
8
|
-
* new-lines that is immediately followed by a non-white-space character. This
|
|
9
|
-
* way, internal blank lines that are part of the same paragraph (e.g. a list
|
|
10
|
-
* item that purposely contains a visual break) are preserved while true
|
|
11
|
-
* paragraph breaks – the ones generated when calling `arr.join("\n\n")` in
|
|
12
|
-
* the tests – are still detected.
|
|
13
|
-
*/
|
|
14
|
-
const splitByParagraph = (text) => {
|
|
15
|
-
const paragraphs = [];
|
|
16
|
-
const tokens = text.split(/(\n{2,})/);
|
|
17
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
18
|
-
const token = tokens[i];
|
|
19
|
-
if (i % 2 === 0) {
|
|
20
|
-
if (token) paragraphs.push(token);
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const pairsOfNewlines = Math.floor(token.length / 2);
|
|
24
|
-
const blankParagraphs = Math.max(0, pairsOfNewlines - 2);
|
|
25
|
-
for (let j = 0; j < blankParagraphs; j++) paragraphs.push("\n\n");
|
|
26
|
-
}
|
|
27
|
-
return paragraphs;
|
|
28
|
-
};
|
|
29
|
-
/**
|
|
30
|
-
* Determine whether two paragraphs match – either exactly, or by sharing the
|
|
31
|
-
* same "special-character signature".
|
|
32
|
-
*/
|
|
33
|
-
const paragraphMatches = (paragraph, baseParagraph, paragraphSignature, baseSignature) => {
|
|
34
|
-
if (paragraph === baseParagraph) return true;
|
|
35
|
-
if (paragraphSignature.length !== baseSignature.length) return false;
|
|
36
|
-
for (let i = 0; i < paragraphSignature.length; i++) if (paragraphSignature[i].char !== baseSignature[i].char) return false;
|
|
37
|
-
return true;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Re-order `textToReorder` so that its paragraphs follow the ordering found in
|
|
41
|
-
* `baseFileContent`, while preserving any extra paragraphs (those not present
|
|
42
|
-
* in the base file) in a position that is intuitive for a human reader: right
|
|
43
|
-
* after the closest preceding paragraph coming from the base file.
|
|
44
|
-
*/
|
|
45
|
-
const reorderParagraphs = (textToReorder, baseFileContent) => {
|
|
46
|
-
const baseFileParagraphs = splitByParagraph(baseFileContent);
|
|
47
|
-
const textToReorderParagraphs = splitByParagraph(textToReorder);
|
|
48
|
-
const baseSignatures = baseFileParagraphs.map((p) => listSpecialChars(p));
|
|
49
|
-
const textSignatures = textToReorderParagraphs.map((p) => listSpecialChars(p));
|
|
50
|
-
const firstMatchIndexForBase = Array(baseFileParagraphs.length).fill(-1);
|
|
51
|
-
const paragraphMatchedBaseIdx = Array(textToReorderParagraphs.length).fill(null);
|
|
52
|
-
for (let i = 0; i < textToReorderParagraphs.length; i++) {
|
|
53
|
-
const paragraph = textToReorderParagraphs[i];
|
|
54
|
-
const sig = textSignatures[i];
|
|
55
|
-
let foundIdx = baseFileParagraphs.findIndex((baseParagraph, idx) => firstMatchIndexForBase[idx] === -1 && paragraph === baseParagraph);
|
|
56
|
-
if (foundIdx === -1) foundIdx = baseFileParagraphs.findIndex((baseParagraph, idx) => firstMatchIndexForBase[idx] === -1 && paragraphMatches(paragraph, baseParagraph, sig, baseSignatures[idx]));
|
|
57
|
-
if (foundIdx !== -1) {
|
|
58
|
-
firstMatchIndexForBase[foundIdx] = i;
|
|
59
|
-
paragraphMatchedBaseIdx[i] = foundIdx;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const insertAfterBaseIdx = Array(textToReorderParagraphs.length).fill(-1);
|
|
63
|
-
let maxBaseIdxEncountered = -1;
|
|
64
|
-
for (let i = 0; i < textToReorderParagraphs.length; i++) {
|
|
65
|
-
const matchedBase = paragraphMatchedBaseIdx[i];
|
|
66
|
-
if (matchedBase !== null) {
|
|
67
|
-
if (matchedBase > maxBaseIdxEncountered) maxBaseIdxEncountered = matchedBase;
|
|
68
|
-
} else insertAfterBaseIdx[i] = maxBaseIdxEncountered;
|
|
69
|
-
}
|
|
70
|
-
const result = [];
|
|
71
|
-
const extraParagraphsBuckets = {};
|
|
72
|
-
insertAfterBaseIdx.forEach((afterIdx, paragraphIdx) => {
|
|
73
|
-
if (afterIdx === -1) return;
|
|
74
|
-
extraParagraphsBuckets[afterIdx] = extraParagraphsBuckets[afterIdx] || [];
|
|
75
|
-
extraParagraphsBuckets[afterIdx].push(paragraphIdx);
|
|
76
|
-
});
|
|
77
|
-
for (let bIdx = 0; bIdx < baseFileParagraphs.length; bIdx++) {
|
|
78
|
-
const matchedParagraphIdx = firstMatchIndexForBase[bIdx];
|
|
79
|
-
if (matchedParagraphIdx !== -1) result.push(textToReorderParagraphs[matchedParagraphIdx]);
|
|
80
|
-
if (extraParagraphsBuckets[bIdx]) extraParagraphsBuckets[bIdx].forEach((pIdx) => {
|
|
81
|
-
result.push(textToReorderParagraphs[pIdx]);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
const leadingExtras = [];
|
|
85
|
-
insertAfterBaseIdx.forEach((afterIdx, pIdx) => {
|
|
86
|
-
if (afterIdx === -1 && paragraphMatchedBaseIdx[pIdx] === null) leadingExtras.push(textToReorderParagraphs[pIdx]);
|
|
87
|
-
});
|
|
88
|
-
return [...leadingExtras, ...result].join("\n\n");
|
|
89
|
-
};
|
|
3
|
+
`)}return t},n=(e,t,n,r)=>{if(e===t)return!0;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++)if(n[e].char!==r[e].char)return!1;return!0},r=(r,i)=>{let a=t(i),o=t(r),s=a.map(t=>e(t)),c=o.map(t=>e(t)),l=Array(a.length).fill(-1),u=Array(o.length).fill(null);for(let e=0;e<o.length;e++){let t=o[e],r=c[e],i=a.findIndex((e,n)=>l[n]===-1&&t===e);i===-1&&(i=a.findIndex((e,i)=>l[i]===-1&&n(t,e,r,s[i]))),i!==-1&&(l[i]=e,u[e]=i)}let d=Array(o.length).fill(-1),f=-1;for(let e=0;e<o.length;e++){let t=u[e];t===null?d[e]=f:t>f&&(f=t)}let p=[],m={};d.forEach((e,t)=>{e!==-1&&(m[e]=m[e]||[],m[e].push(t))});for(let e=0;e<a.length;e++){let t=l[e];t!==-1&&p.push(o[t]),m[e]&&m[e].forEach(e=>{p.push(o[e])})}let h=[];return d.forEach((e,t)=>{e===-1&&u[t]===null&&h.push(o[t])}),[...h,...p].join(`
|
|
90
4
|
|
|
91
|
-
|
|
92
|
-
export { reorderParagraphs };
|
|
5
|
+
`)};export{r as reorderParagraphs};
|
|
93
6
|
//# sourceMappingURL=reorderParagraphs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reorderParagraphs.mjs","names":[],"sources":["../../../src/utils/reorderParagraphs.ts"],"sourcesContent":["import { listSpecialChars } from './listSpecialChars';\n\n/**\n * Split a text into paragraphs.\n *\n * We consider a paragraph boundary to be a block of at least two consecutive\n * new-lines that is immediately followed by a non-white-space character. This\n * way, internal blank lines that are part of the same paragraph (e.g. a list\n * item that purposely contains a visual break) are preserved while true\n * paragraph breaks – the ones generated when calling `arr.join(\"\\n\\n\")` in\n * the tests – are still detected.\n */\nconst splitByParagraph = (text: string): string[] => {\n const paragraphs: string[] = [];\n\n // Capture the delimiter so that we can inspect how many new-lines it\n // contains. We know that the test strings only use LF, so we keep the\n // regex simple here.\n const tokens = text.split(/(\\n{2,})/);\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n // Even-indexed tokens are the actual paragraph contents.\n if (i % 2 === 0) {\n if (token) paragraphs.push(token);\n continue;\n }\n\n // Odd-indexed tokens are the delimiters (>= two consecutive new-lines).\n // The first and last pairs represent the natural separators that are\n // added when paragraphs are later joined with \"\\n\\n\". Any additional\n // pairs in between correspond to *explicit* blank paragraphs that were\n // present in the original text and must therefore be preserved.\n const pairsOfNewlines = Math.floor(token.length / 2);\n const blankParagraphs = Math.max(0, pairsOfNewlines - 2);\n\n for (let j = 0; j < blankParagraphs; j++) {\n paragraphs.push('\\n\\n');\n }\n }\n\n return paragraphs;\n};\n\n/**\n * Determine whether two paragraphs match – either exactly, or by sharing the\n * same \"special-character signature\".\n */\nconst paragraphMatches = (\n paragraph: string,\n baseParagraph: string,\n paragraphSignature: ReturnType<typeof listSpecialChars>,\n baseSignature: ReturnType<typeof listSpecialChars>\n): boolean => {\n if (paragraph === baseParagraph) return true;\n // fallback to special-character signature comparison\n if (paragraphSignature.length !== baseSignature.length) return false;\n\n for (let i = 0; i < paragraphSignature.length; i++) {\n if (paragraphSignature[i].char !== baseSignature[i].char) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Re-order `textToReorder` so that its paragraphs follow the ordering found in\n * `baseFileContent`, while preserving any extra paragraphs (those not present\n * in the base file) in a position that is intuitive for a human reader: right\n * after the closest preceding paragraph coming from the base file.\n */\nexport const reorderParagraphs = (\n textToReorder: string,\n baseFileContent: string\n): string => {\n // 1. Split both texts into paragraphs and pre-compute their signatures.\n const baseFileParagraphs = splitByParagraph(baseFileContent);\n const textToReorderParagraphs = splitByParagraph(textToReorder);\n\n const baseSignatures = baseFileParagraphs.map((p) => listSpecialChars(p));\n const textSignatures = textToReorderParagraphs.map((p) =>\n listSpecialChars(p)\n );\n\n // 2. For every paragraph in the text to reorder, find the *first* base\n // paragraph it matches. We only allow each base paragraph to be matched\n // once. Any further identical paragraphs will be treated as \"extra\" and\n // will be positioned later on, next to their closest neighbour.\n const firstMatchIndexForBase: number[] = Array(\n baseFileParagraphs.length\n ).fill(-1);\n const paragraphMatchedBaseIdx: (number | null)[] = Array(\n textToReorderParagraphs.length\n ).fill(null);\n\n for (let i = 0; i < textToReorderParagraphs.length; i++) {\n const paragraph = textToReorderParagraphs[i];\n const sig = textSignatures[i];\n\n // exact match pass first for performance\n let foundIdx = baseFileParagraphs.findIndex(\n (baseParagraph, idx) =>\n firstMatchIndexForBase[idx] === -1 && paragraph === baseParagraph\n );\n\n if (foundIdx === -1) {\n // fallback to the signature comparison\n foundIdx = baseFileParagraphs.findIndex(\n (baseParagraph, idx) =>\n firstMatchIndexForBase[idx] === -1 &&\n paragraphMatches(paragraph, baseParagraph, sig, baseSignatures[idx])\n );\n }\n\n if (foundIdx !== -1) {\n firstMatchIndexForBase[foundIdx] = i;\n paragraphMatchedBaseIdx[i] = foundIdx;\n }\n }\n\n // 3. For the paragraphs that *didn't* get matched to a base paragraph, we\n // record the highest-numbered base paragraph that was matched *before* it\n // in the original text. The extra paragraph will later be placed right\n // after that paragraph in the final ordering.\n const insertAfterBaseIdx: number[] = Array(\n textToReorderParagraphs.length\n ).fill(-1);\n let maxBaseIdxEncountered = -1;\n\n for (let i = 0; i < textToReorderParagraphs.length; i++) {\n const matchedBase = paragraphMatchedBaseIdx[i];\n\n if (matchedBase !== null) {\n if (matchedBase > maxBaseIdxEncountered) {\n maxBaseIdxEncountered = matchedBase;\n }\n } else {\n insertAfterBaseIdx[i] = maxBaseIdxEncountered;\n }\n }\n\n // 4. Build the final, reordered list of paragraphs.\n const result: string[] = [];\n\n // Helper: quickly retrieve all indices of paragraphs that should be inserted\n // after a given base index, while keeping their original order.\n const extraParagraphsBuckets: Record<number, number[]> = {};\n insertAfterBaseIdx.forEach((afterIdx, paragraphIdx) => {\n if (afterIdx === -1) return; // will be handled later (if any)\n extraParagraphsBuckets[afterIdx] = extraParagraphsBuckets[afterIdx] || [];\n extraParagraphsBuckets[afterIdx].push(paragraphIdx);\n });\n\n for (let bIdx = 0; bIdx < baseFileParagraphs.length; bIdx++) {\n const matchedParagraphIdx = firstMatchIndexForBase[bIdx];\n\n if (matchedParagraphIdx !== -1) {\n result.push(textToReorderParagraphs[matchedParagraphIdx]);\n }\n\n if (extraParagraphsBuckets[bIdx]) {\n extraParagraphsBuckets[bIdx].forEach((pIdx) => {\n result.push(textToReorderParagraphs[pIdx]);\n });\n }\n }\n\n // Finally, if there were extra paragraphs appearing *before* any matched\n // base paragraph (insertAfterBaseIdx === -1), we prepend them to the output\n // in their original order.\n const leadingExtras: string[] = [];\n insertAfterBaseIdx.forEach((afterIdx, pIdx) => {\n if (afterIdx === -1 && paragraphMatchedBaseIdx[pIdx] === null) {\n leadingExtras.push(textToReorderParagraphs[pIdx]);\n }\n });\n\n return [...leadingExtras, ...result].join('\\n\\n');\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reorderParagraphs.mjs","names":[],"sources":["../../../src/utils/reorderParagraphs.ts"],"sourcesContent":["import { listSpecialChars } from './listSpecialChars';\n\n/**\n * Split a text into paragraphs.\n *\n * We consider a paragraph boundary to be a block of at least two consecutive\n * new-lines that is immediately followed by a non-white-space character. This\n * way, internal blank lines that are part of the same paragraph (e.g. a list\n * item that purposely contains a visual break) are preserved while true\n * paragraph breaks – the ones generated when calling `arr.join(\"\\n\\n\")` in\n * the tests – are still detected.\n */\nconst splitByParagraph = (text: string): string[] => {\n const paragraphs: string[] = [];\n\n // Capture the delimiter so that we can inspect how many new-lines it\n // contains. We know that the test strings only use LF, so we keep the\n // regex simple here.\n const tokens = text.split(/(\\n{2,})/);\n\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n\n // Even-indexed tokens are the actual paragraph contents.\n if (i % 2 === 0) {\n if (token) paragraphs.push(token);\n continue;\n }\n\n // Odd-indexed tokens are the delimiters (>= two consecutive new-lines).\n // The first and last pairs represent the natural separators that are\n // added when paragraphs are later joined with \"\\n\\n\". Any additional\n // pairs in between correspond to *explicit* blank paragraphs that were\n // present in the original text and must therefore be preserved.\n const pairsOfNewlines = Math.floor(token.length / 2);\n const blankParagraphs = Math.max(0, pairsOfNewlines - 2);\n\n for (let j = 0; j < blankParagraphs; j++) {\n paragraphs.push('\\n\\n');\n }\n }\n\n return paragraphs;\n};\n\n/**\n * Determine whether two paragraphs match – either exactly, or by sharing the\n * same \"special-character signature\".\n */\nconst paragraphMatches = (\n paragraph: string,\n baseParagraph: string,\n paragraphSignature: ReturnType<typeof listSpecialChars>,\n baseSignature: ReturnType<typeof listSpecialChars>\n): boolean => {\n if (paragraph === baseParagraph) return true;\n // fallback to special-character signature comparison\n if (paragraphSignature.length !== baseSignature.length) return false;\n\n for (let i = 0; i < paragraphSignature.length; i++) {\n if (paragraphSignature[i].char !== baseSignature[i].char) {\n return false;\n }\n }\n return true;\n};\n\n/**\n * Re-order `textToReorder` so that its paragraphs follow the ordering found in\n * `baseFileContent`, while preserving any extra paragraphs (those not present\n * in the base file) in a position that is intuitive for a human reader: right\n * after the closest preceding paragraph coming from the base file.\n */\nexport const reorderParagraphs = (\n textToReorder: string,\n baseFileContent: string\n): string => {\n // 1. Split both texts into paragraphs and pre-compute their signatures.\n const baseFileParagraphs = splitByParagraph(baseFileContent);\n const textToReorderParagraphs = splitByParagraph(textToReorder);\n\n const baseSignatures = baseFileParagraphs.map((p) => listSpecialChars(p));\n const textSignatures = textToReorderParagraphs.map((p) =>\n listSpecialChars(p)\n );\n\n // 2. For every paragraph in the text to reorder, find the *first* base\n // paragraph it matches. We only allow each base paragraph to be matched\n // once. Any further identical paragraphs will be treated as \"extra\" and\n // will be positioned later on, next to their closest neighbour.\n const firstMatchIndexForBase: number[] = Array(\n baseFileParagraphs.length\n ).fill(-1);\n const paragraphMatchedBaseIdx: (number | null)[] = Array(\n textToReorderParagraphs.length\n ).fill(null);\n\n for (let i = 0; i < textToReorderParagraphs.length; i++) {\n const paragraph = textToReorderParagraphs[i];\n const sig = textSignatures[i];\n\n // exact match pass first for performance\n let foundIdx = baseFileParagraphs.findIndex(\n (baseParagraph, idx) =>\n firstMatchIndexForBase[idx] === -1 && paragraph === baseParagraph\n );\n\n if (foundIdx === -1) {\n // fallback to the signature comparison\n foundIdx = baseFileParagraphs.findIndex(\n (baseParagraph, idx) =>\n firstMatchIndexForBase[idx] === -1 &&\n paragraphMatches(paragraph, baseParagraph, sig, baseSignatures[idx])\n );\n }\n\n if (foundIdx !== -1) {\n firstMatchIndexForBase[foundIdx] = i;\n paragraphMatchedBaseIdx[i] = foundIdx;\n }\n }\n\n // 3. For the paragraphs that *didn't* get matched to a base paragraph, we\n // record the highest-numbered base paragraph that was matched *before* it\n // in the original text. The extra paragraph will later be placed right\n // after that paragraph in the final ordering.\n const insertAfterBaseIdx: number[] = Array(\n textToReorderParagraphs.length\n ).fill(-1);\n let maxBaseIdxEncountered = -1;\n\n for (let i = 0; i < textToReorderParagraphs.length; i++) {\n const matchedBase = paragraphMatchedBaseIdx[i];\n\n if (matchedBase !== null) {\n if (matchedBase > maxBaseIdxEncountered) {\n maxBaseIdxEncountered = matchedBase;\n }\n } else {\n insertAfterBaseIdx[i] = maxBaseIdxEncountered;\n }\n }\n\n // 4. Build the final, reordered list of paragraphs.\n const result: string[] = [];\n\n // Helper: quickly retrieve all indices of paragraphs that should be inserted\n // after a given base index, while keeping their original order.\n const extraParagraphsBuckets: Record<number, number[]> = {};\n insertAfterBaseIdx.forEach((afterIdx, paragraphIdx) => {\n if (afterIdx === -1) return; // will be handled later (if any)\n extraParagraphsBuckets[afterIdx] = extraParagraphsBuckets[afterIdx] || [];\n extraParagraphsBuckets[afterIdx].push(paragraphIdx);\n });\n\n for (let bIdx = 0; bIdx < baseFileParagraphs.length; bIdx++) {\n const matchedParagraphIdx = firstMatchIndexForBase[bIdx];\n\n if (matchedParagraphIdx !== -1) {\n result.push(textToReorderParagraphs[matchedParagraphIdx]);\n }\n\n if (extraParagraphsBuckets[bIdx]) {\n extraParagraphsBuckets[bIdx].forEach((pIdx) => {\n result.push(textToReorderParagraphs[pIdx]);\n });\n }\n }\n\n // Finally, if there were extra paragraphs appearing *before* any matched\n // base paragraph (insertAfterBaseIdx === -1), we prepend them to the output\n // in their original order.\n const leadingExtras: string[] = [];\n insertAfterBaseIdx.forEach((afterIdx, pIdx) => {\n if (afterIdx === -1 && paragraphMatchedBaseIdx[pIdx] === null) {\n leadingExtras.push(textToReorderParagraphs[pIdx]);\n }\n });\n\n return [...leadingExtras, ...result].join('\\n\\n');\n};\n"],"mappings":"0DAYA,MAAM,EAAoB,GAA2B,CACnD,IAAM,EAAuB,EAAE,CAKzB,EAAS,EAAK,MAAM,WAAW,CAErC,IAAK,IAAI,EAAI,EAAG,EAAI,EAAO,OAAQ,IAAK,CACtC,IAAM,EAAQ,EAAO,GAGrB,GAAI,EAAI,GAAM,EAAG,CACX,GAAO,EAAW,KAAK,EAAM,CACjC,SAQF,IAAM,EAAkB,KAAK,MAAM,EAAM,OAAS,EAAE,CAC9C,EAAkB,KAAK,IAAI,EAAG,EAAkB,EAAE,CAExD,IAAK,IAAI,EAAI,EAAG,EAAI,EAAiB,IACnC,EAAW,KAAK;;EAAO,CAI3B,OAAO,GAOH,GACJ,EACA,EACA,EACA,IACY,CACZ,GAAI,IAAc,EAAe,MAAO,GAExC,GAAI,EAAmB,SAAW,EAAc,OAAQ,MAAO,GAE/D,IAAK,IAAI,EAAI,EAAG,EAAI,EAAmB,OAAQ,IAC7C,GAAI,EAAmB,GAAG,OAAS,EAAc,GAAG,KAClD,MAAO,GAGX,MAAO,IASI,GACX,EACA,IACW,CAEX,IAAM,EAAqB,EAAiB,EAAgB,CACtD,EAA0B,EAAiB,EAAc,CAEzD,EAAiB,EAAmB,IAAK,GAAM,EAAiB,EAAE,CAAC,CACnE,EAAiB,EAAwB,IAAK,GAClD,EAAiB,EAAE,CACpB,CAMK,EAAmC,MACvC,EAAmB,OACpB,CAAC,KAAK,GAAG,CACJ,EAA6C,MACjD,EAAwB,OACzB,CAAC,KAAK,KAAK,CAEZ,IAAK,IAAI,EAAI,EAAG,EAAI,EAAwB,OAAQ,IAAK,CACvD,IAAM,EAAY,EAAwB,GACpC,EAAM,EAAe,GAGvB,EAAW,EAAmB,WAC/B,EAAe,IACd,EAAuB,KAAS,IAAM,IAAc,EACvD,CAEG,IAAa,KAEf,EAAW,EAAmB,WAC3B,EAAe,IACd,EAAuB,KAAS,IAChC,EAAiB,EAAW,EAAe,EAAK,EAAe,GAAK,CACvE,EAGC,IAAa,KACf,EAAuB,GAAY,EACnC,EAAwB,GAAK,GAQjC,IAAM,EAA+B,MACnC,EAAwB,OACzB,CAAC,KAAK,GAAG,CACN,EAAwB,GAE5B,IAAK,IAAI,EAAI,EAAG,EAAI,EAAwB,OAAQ,IAAK,CACvD,IAAM,EAAc,EAAwB,GAExC,IAAgB,KAKlB,EAAmB,GAAK,EAJpB,EAAc,IAChB,EAAwB,GAQ9B,IAAM,EAAmB,EAAE,CAIrB,EAAmD,EAAE,CAC3D,EAAmB,SAAS,EAAU,IAAiB,CACjD,IAAa,KACjB,EAAuB,GAAY,EAAuB,IAAa,EAAE,CACzE,EAAuB,GAAU,KAAK,EAAa,GACnD,CAEF,IAAK,IAAI,EAAO,EAAG,EAAO,EAAmB,OAAQ,IAAQ,CAC3D,IAAM,EAAsB,EAAuB,GAE/C,IAAwB,IAC1B,EAAO,KAAK,EAAwB,GAAqB,CAGvD,EAAuB,IACzB,EAAuB,GAAM,QAAS,GAAS,CAC7C,EAAO,KAAK,EAAwB,GAAM,EAC1C,CAON,IAAM,EAA0B,EAAE,CAOlC,OANA,EAAmB,SAAS,EAAU,IAAS,CACzC,IAAa,IAAM,EAAwB,KAAU,MACvD,EAAc,KAAK,EAAwB,GAAM,EAEnD,CAEK,CAAC,GAAG,EAAe,GAAG,EAAO,CAAC,KAAK;;EAAO"}
|
|
@@ -1,63 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ANSIColors, colorize, getAppLogger } from "@intlayer/config";
|
|
3
|
-
|
|
4
|
-
//#region src/utils/setupAI.ts
|
|
5
|
-
globalThis.AI_SDK_LOG_WARNINGS = false;
|
|
6
|
-
const logAIConfig = (aiOptions, appLogger) => {
|
|
7
|
-
appLogger([
|
|
8
|
-
colorize("Provider:", ANSIColors.GREY_DARK),
|
|
9
|
-
colorize(aiOptions?.provider ?? "(default)", ANSIColors.BLUE),
|
|
10
|
-
colorize("- Model:", ANSIColors.GREY_DARK),
|
|
11
|
-
colorize(aiOptions?.model ?? "(default)", ANSIColors.BLUE),
|
|
12
|
-
colorize("- API Key:", ANSIColors.GREY_DARK),
|
|
13
|
-
colorize(aiOptions?.apiKey ? "✓" : "(not set)", ANSIColors.BLUE)
|
|
14
|
-
]);
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Checks if the @intlayer/ai package is available and configured when an API key is provided.
|
|
18
|
-
* If API key is present but package is missing, logs a warning.
|
|
19
|
-
* Also checks if the user has access to AI (either via local key or CMS auth).
|
|
20
|
-
*/
|
|
21
|
-
const setupAI = async (configuration, aiOptions) => {
|
|
22
|
-
const appLogger = getAppLogger(configuration);
|
|
23
|
-
if (aiOptions?.apiKey || aiOptions?.provider === "ollama" || configuration.ai?.apiKey || configuration.ai?.provider === "ollama") {
|
|
24
|
-
let aiClient;
|
|
25
|
-
try {
|
|
26
|
-
aiClient = await import("@intlayer/ai");
|
|
27
|
-
} catch {
|
|
28
|
-
appLogger([
|
|
29
|
-
colorize("Using your API key, you can install the", ANSIColors.GREY),
|
|
30
|
-
colorize("@intlayer/ai", ANSIColors.GREY_LIGHT),
|
|
31
|
-
colorize("package to run the process locally, with no dependency on the Intlayer server", ANSIColors.GREY)
|
|
32
|
-
], { level: "warn" });
|
|
33
|
-
const hasAIAccess = await checkAIAccess(configuration, aiOptions);
|
|
34
|
-
logAIConfig(aiOptions ?? {}, appLogger);
|
|
35
|
-
return {
|
|
36
|
-
isCustomAI: false,
|
|
37
|
-
hasAIAccess
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
appLogger([colorize("@intlayer/ai", ANSIColors.GREY_LIGHT), colorize("found - Run process locally", ANSIColors.GREY_DARK)]);
|
|
41
|
-
const aiConfig = await aiClient.getAIConfig({
|
|
42
|
-
userOptions: aiOptions,
|
|
43
|
-
accessType: ["public"]
|
|
44
|
-
});
|
|
45
|
-
logAIConfig(aiOptions ?? {}, appLogger);
|
|
46
|
-
return {
|
|
47
|
-
aiClient,
|
|
48
|
-
aiConfig,
|
|
49
|
-
isCustomAI: true,
|
|
50
|
-
hasAIAccess: true
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const hasAIAccess = await checkAIAccess(configuration, aiOptions);
|
|
54
|
-
logAIConfig(aiOptions ?? {}, appLogger);
|
|
55
|
-
return {
|
|
56
|
-
isCustomAI: false,
|
|
57
|
-
hasAIAccess
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
//#endregion
|
|
62
|
-
export { setupAI };
|
|
1
|
+
import{checkAIAccess as e}from"./checkAccess.mjs";import{ANSIColors as t,colorize as n,getAppLogger as r}from"@intlayer/config/logger";globalThis.AI_SDK_LOG_WARNINGS=!1;const i=(e,r)=>{r([n(`Provider:`,t.GREY_DARK),n(e?.provider??`(default)`,t.BLUE),n(`- Model:`,t.GREY_DARK),n(e?.model??`(default)`,t.BLUE),n(`- API Key:`,t.GREY_DARK),n(e?.apiKey?`✓`:`(not set)`,t.BLUE)])},a=async(a,o)=>{let s=r(a);if(o?.apiKey||o?.provider===`ollama`||a.ai?.apiKey||a.ai?.provider===`ollama`){let r;try{r=await import(`@intlayer/ai`)}catch{s([n(`Using your API key, you can install the`,t.GREY),n(`@intlayer/ai`,t.GREY_LIGHT),n(`package to run the process locally, with no dependency on the Intlayer server`,t.GREY)],{level:`warn`});let r=await e(a,o);return i(o??{},s),{isCustomAI:!1,hasAIAccess:r}}s([n(`@intlayer/ai`,t.GREY_LIGHT),n(`found - Run process locally`,t.GREY_DARK)]);let c=await r.getAIConfig({userOptions:o,accessType:[`public`]});return i(o??{},s),{aiClient:r,aiConfig:c,isCustomAI:!0,hasAIAccess:!0}}let c=await e(a,o);return i(o??{},s),{isCustomAI:!1,hasAIAccess:c}};export{a as setupAI};
|
|
63
2
|
//# sourceMappingURL=setupAI.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupAI.mjs","names":[],"sources":["../../../src/utils/setupAI.ts"],"sourcesContent":["import type { AIConfig, AIOptions } from '@intlayer/ai';\nimport {\n ANSIColors,\n colorize,\n getAppLogger,\n type logger,\n} from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { checkAIAccess } from './checkAccess';\n\nexport type AIClient = typeof import('@intlayer/ai');\n\ntype SetupAIResult = {\n aiClient?: AIClient;\n aiConfig?: AIConfig;\n isCustomAI: boolean;\n hasAIAccess: boolean;\n};\n\n// Disable warnings from the AI SDK\nglobalThis.AI_SDK_LOG_WARNINGS = false;\n\nconst logAIConfig = (aiOptions: AIOptions, appLogger: typeof logger) => {\n appLogger([\n colorize('Provider:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.provider ?? '(default)', ANSIColors.BLUE),\n colorize('- Model:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.model ?? '(default)', ANSIColors.BLUE),\n colorize('- API Key:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.apiKey ? '✓' : '(not set)', ANSIColors.BLUE),\n ]);\n};\n\n/**\n * Checks if the @intlayer/ai package is available and configured when an API key is provided.\n * If API key is present but package is missing, logs a warning.\n * Also checks if the user has access to AI (either via local key or CMS auth).\n */\nexport const setupAI = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<SetupAIResult | undefined> => {\n const appLogger = getAppLogger(configuration);\n\n const isLocalAI =\n aiOptions?.apiKey ||\n aiOptions?.provider === 'ollama' ||\n configuration.ai?.apiKey ||\n configuration.ai?.provider === 'ollama';\n\n if (isLocalAI) {\n // Try to import the AI package for local AI usage\n let aiClient: AIClient | undefined;\n\n try {\n aiClient = await import('@intlayer/ai');\n } catch {\n // Package not installed - log warning and fall back to backend\n appLogger(\n [\n colorize('Using your API key, you can install the', ANSIColors.GREY),\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize(\n 'package to run the process locally, with no dependency on the Intlayer server',\n ANSIColors.GREY\n ),\n ],\n {\n level: 'warn',\n }\n );\n\n // Fall back to backend API check\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n }\n\n // Package found - now configure it (errors here should propagate, not fall back)\n appLogger([\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize('found - Run process locally', ANSIColors.GREY_DARK),\n ]);\n\n const aiConfig = await aiClient.getAIConfig({\n userOptions: aiOptions,\n accessType: ['public'],\n });\n\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n aiClient,\n aiConfig,\n isCustomAI: true,\n hasAIAccess: true, // Local AI always has access\n };\n }\n\n // No local AI configured - use backend API\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupAI.mjs","names":[],"sources":["../../../src/utils/setupAI.ts"],"sourcesContent":["import type { AIConfig, AIOptions } from '@intlayer/ai';\nimport {\n ANSIColors,\n colorize,\n getAppLogger,\n type logger,\n} from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport { checkAIAccess } from './checkAccess';\n\nexport type AIClient = typeof import('@intlayer/ai');\n\ntype SetupAIResult = {\n aiClient?: AIClient;\n aiConfig?: AIConfig;\n isCustomAI: boolean;\n hasAIAccess: boolean;\n};\n\n// Disable warnings from the AI SDK\nglobalThis.AI_SDK_LOG_WARNINGS = false;\n\nconst logAIConfig = (aiOptions: AIOptions, appLogger: typeof logger) => {\n appLogger([\n colorize('Provider:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.provider ?? '(default)', ANSIColors.BLUE),\n colorize('- Model:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.model ?? '(default)', ANSIColors.BLUE),\n colorize('- API Key:', ANSIColors.GREY_DARK),\n colorize(aiOptions?.apiKey ? '✓' : '(not set)', ANSIColors.BLUE),\n ]);\n};\n\n/**\n * Checks if the @intlayer/ai package is available and configured when an API key is provided.\n * If API key is present but package is missing, logs a warning.\n * Also checks if the user has access to AI (either via local key or CMS auth).\n */\nexport const setupAI = async (\n configuration: IntlayerConfig,\n aiOptions?: AIOptions\n): Promise<SetupAIResult | undefined> => {\n const appLogger = getAppLogger(configuration);\n\n const isLocalAI =\n aiOptions?.apiKey ||\n aiOptions?.provider === 'ollama' ||\n configuration.ai?.apiKey ||\n configuration.ai?.provider === 'ollama';\n\n if (isLocalAI) {\n // Try to import the AI package for local AI usage\n let aiClient: AIClient | undefined;\n\n try {\n aiClient = await import('@intlayer/ai');\n } catch {\n // Package not installed - log warning and fall back to backend\n appLogger(\n [\n colorize('Using your API key, you can install the', ANSIColors.GREY),\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize(\n 'package to run the process locally, with no dependency on the Intlayer server',\n ANSIColors.GREY\n ),\n ],\n {\n level: 'warn',\n }\n );\n\n // Fall back to backend API check\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n }\n\n // Package found - now configure it (errors here should propagate, not fall back)\n appLogger([\n colorize('@intlayer/ai', ANSIColors.GREY_LIGHT),\n colorize('found - Run process locally', ANSIColors.GREY_DARK),\n ]);\n\n const aiConfig = await aiClient.getAIConfig({\n userOptions: aiOptions,\n accessType: ['public'],\n });\n\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n aiClient,\n aiConfig,\n isCustomAI: true,\n hasAIAccess: true, // Local AI always has access\n };\n }\n\n // No local AI configured - use backend API\n const hasAIAccess = await checkAIAccess(configuration, aiOptions);\n logAIConfig(aiOptions ?? {}, appLogger);\n\n return {\n isCustomAI: false,\n hasAIAccess,\n };\n};\n"],"mappings":"uIAoBA,WAAW,oBAAsB,GAEjC,MAAM,GAAe,EAAsB,IAA6B,CACtE,EAAU,CACR,EAAS,YAAa,EAAW,UAAU,CAC3C,EAAS,GAAW,UAAY,YAAa,EAAW,KAAK,CAC7D,EAAS,WAAY,EAAW,UAAU,CAC1C,EAAS,GAAW,OAAS,YAAa,EAAW,KAAK,CAC1D,EAAS,aAAc,EAAW,UAAU,CAC5C,EAAS,GAAW,OAAS,IAAM,YAAa,EAAW,KAAK,CACjE,CAAC,EAQS,EAAU,MACrB,EACA,IACuC,CACvC,IAAM,EAAY,EAAa,EAAc,CAQ7C,GALE,GAAW,QACX,GAAW,WAAa,UACxB,EAAc,IAAI,QAClB,EAAc,IAAI,WAAa,SAElB,CAEb,IAAI,EAEJ,GAAI,CACF,EAAW,MAAM,OAAO,qBAClB,CAEN,EACE,CACE,EAAS,0CAA2C,EAAW,KAAK,CACpE,EAAS,eAAgB,EAAW,WAAW,CAC/C,EACE,gFACA,EAAW,KACZ,CACF,CACD,CACE,MAAO,OACR,CACF,CAGD,IAAM,EAAc,MAAM,EAAc,EAAe,EAAU,CAEjE,OADA,EAAY,GAAa,EAAE,CAAE,EAAU,CAChC,CACL,WAAY,GACZ,cACD,CAIH,EAAU,CACR,EAAS,eAAgB,EAAW,WAAW,CAC/C,EAAS,8BAA+B,EAAW,UAAU,CAC9D,CAAC,CAEF,IAAM,EAAW,MAAM,EAAS,YAAY,CAC1C,YAAa,EACb,WAAY,CAAC,SAAS,CACvB,CAAC,CAIF,OAFA,EAAY,GAAa,EAAE,CAAE,EAAU,CAEhC,CACL,WACA,WACA,WAAY,GACZ,YAAa,GACd,CAIH,IAAM,EAAc,MAAM,EAAc,EAAe,EAAU,CAGjE,OAFA,EAAY,GAAa,EAAE,CAAE,EAAU,CAEhC,CACL,WAAY,GACZ,cACD"}
|
package/dist/esm/watch.mjs
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { getAppLogger, getConfiguration } from "@intlayer/config";
|
|
3
|
-
|
|
4
|
-
//#region src/watch.ts
|
|
5
|
-
/**
|
|
6
|
-
* Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.
|
|
7
|
-
* Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}
|
|
8
|
-
*/
|
|
9
|
-
const watchContentDeclaration = async (options) => {
|
|
10
|
-
const appLogger = getAppLogger(getConfiguration(options?.configOptions));
|
|
11
|
-
let parallelProcess;
|
|
12
|
-
if (options?.with) {
|
|
13
|
-
parallelProcess = runParallel(options.with);
|
|
14
|
-
parallelProcess.result.catch(() => {
|
|
15
|
-
process.exit(1);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
appLogger("Watching Intlayer content declarations");
|
|
19
|
-
const watcher = watch({
|
|
20
|
-
persistent: true,
|
|
21
|
-
skipPrepare: options?.skipPrepare ?? false
|
|
22
|
-
});
|
|
23
|
-
const handleShutdown = async () => {
|
|
24
|
-
process.off("SIGINT", handleShutdown);
|
|
25
|
-
process.off("SIGTERM", handleShutdown);
|
|
26
|
-
appLogger("Stopping Intlayer watcher...");
|
|
27
|
-
try {
|
|
28
|
-
await watcher.close();
|
|
29
|
-
if (parallelProcess && "child" in parallelProcess) parallelProcess.child?.kill("SIGTERM");
|
|
30
|
-
} catch (error) {
|
|
31
|
-
console.error("Error during shutdown:", error);
|
|
32
|
-
} finally {
|
|
33
|
-
process.exit(0);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
process.on("SIGINT", handleShutdown);
|
|
37
|
-
process.on("SIGTERM", handleShutdown);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { watchContentDeclaration };
|
|
1
|
+
import{runParallel as e}from"@intlayer/chokidar/utils";import{watch as t}from"@intlayer/chokidar/watcher";import{getConfiguration as n}from"@intlayer/config/node";import{getAppLogger as r}from"@intlayer/config/logger";const i=async i=>{let a=r(n(i?.configOptions)),o;i?.with&&(o=e(i.with),o.result.catch(()=>{process.exit(1)})),a(`Watching Intlayer content declarations`);let s=t({persistent:!0,skipPrepare:i?.skipPrepare??!1}),c=async()=>{process.off(`SIGINT`,c),process.off(`SIGTERM`,c),a(`Stopping Intlayer watcher...`);try{await s.close(),o&&`child`in o&&o.child?.kill(`SIGTERM`)}catch(e){console.error(`Error during shutdown:`,e)}finally{process.exit(0)}};process.on(`SIGINT`,c),process.on(`SIGTERM`,c)};export{i as watchContentDeclaration};
|
|
42
2
|
//# sourceMappingURL=watch.mjs.map
|
package/dist/esm/watch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { runParallel
|
|
1
|
+
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n appLogger('Watching Intlayer content declarations');\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n process.off('SIGINT', handleShutdown);\n process.off('SIGTERM', handleShutdown);\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Close the file watcher immediately to stop \"esbuild service not running\" errors\n await watcher.close();\n\n // If runParallel exposes the child process, we can try to kill it explicitly.\n // Even if it doesn't, process.exit() below usually cleans up attached children.\n if (parallelProcess && 'child' in parallelProcess) {\n // @ts-ignore - Assuming child exists on the return type if runParallel is based on spawn/exec\n parallelProcess.child?.kill('SIGTERM');\n }\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":"0NAkBA,MAAa,EAA0B,KAAO,IAA2B,CAEvE,IAAM,EAAY,EADH,EAAiB,GAAS,cAAc,CACjB,CAGlC,EAEA,GAAS,OACX,EAAkB,EAAY,EAAQ,KAAK,CAE3C,EAAgB,OAAO,UAAY,CAEjC,QAAQ,KAAK,EAAE,EACf,EAGJ,EAAU,yCAAyC,CAGnD,IAAM,EAAU,EAAM,CACpB,WAAY,GACZ,YAAa,GAAS,aAAe,GACtC,CAAC,CAGI,EAAiB,SAAY,CAEjC,QAAQ,IAAI,SAAU,EAAe,CACrC,QAAQ,IAAI,UAAW,EAAe,CAEtC,EAAU,+BAA+B,CAEzC,GAAI,CAEF,MAAM,EAAQ,OAAO,CAIjB,GAAmB,UAAW,GAEhC,EAAgB,OAAO,KAAK,UAAU,OAEjC,EAAO,CACd,QAAQ,MAAM,yBAA0B,EAAM,QACtC,CACR,QAAQ,KAAK,EAAE,GAKnB,QAAQ,GAAG,SAAU,EAAe,CACpC,QAAQ,GAAG,UAAW,EAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","names":[],"sources":["../../../src/auth/login.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"login.d.ts","names":[],"sources":["../../../src/auth/login.ts"],"mappings":";;;KAcK,YAAA;EACH,MAAA;EACA,aAAA,GAAgB,uBAAA;AAAA;AAAA,cAGL,KAAA,GAAe,OAAA,EAAS,YAAA,KAAY,OAAA"}
|
package/dist/types/build.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","names":[],"sources":["../../src/build.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"build.d.ts","names":[],"sources":["../../src/build.ts"],"mappings":";;;KAOK,YAAA;EACH,KAAA;EACA,WAAA;EACA,IAAA;EACA,aAAA,GAAgB,uBAAA;AAAA;;;;;cAOL,KAAA,GAAe,OAAA,GAAU,YAAA,KAAY,OAAA"}
|
package/dist/types/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","names":[],"sources":["../../src/cli.ts"],"mappings":";;;cAuCa,OAAA;AAAA,KA2IR,UAAA;EACH,MAAA;EACA,OAAA;AAAA;AAAA,KAGU,oBAAA;EACV,OAAA;EACA,GAAA;EACA,OAAA;EACA,OAAA;AAAA,IACE,UAAA;;AALJ;;;;;;;cAiEa,MAAA,QAAa,OAAA"}
|
package/dist/types/config.d.ts
CHANGED
package/dist/types/extract.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","names":[],"sources":["../../src/extract.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"extract.d.ts","names":[],"sources":["../../src/extract.ts"],"mappings":";;;KAYK,cAAA;EACH,KAAA;EACA,yBAAA;EACA,aAAA,GAAgB,uBAAA;EAChB,QAAA;EACA,eAAA;AAAA;AAAA,cAoBW,OAAA,GAAiB,OAAA,EAAS,cAAA,KAAc,OAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GetTargetDictionaryOptions } from "../getTargetDictionary.js";
|
|
2
2
|
import { Locale } from "@intlayer/types";
|
|
3
3
|
import { AIOptions } from "@intlayer/api";
|
|
4
|
-
import { ListGitFilesOptions } from "@intlayer/chokidar";
|
|
4
|
+
import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
|
|
5
5
|
|
|
6
6
|
//#region src/fill/fill.d.ts
|
|
7
7
|
type FillOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"fill.d.ts","names":[],"sources":["../../../src/fill/fill.ts"],"mappings":";;;;;;KAqCY,WAAA;EACV,YAAA,GAAe,MAAA;EACf,aAAA,GAAgB,MAAA,GAAS,MAAA;EACzB,IAAA;EACA,UAAA,GAAa,mBAAA;EACb,SAAA,GAAY,SAAA;EACZ,OAAA;EACA,wBAAA;EACA,iBAAA;EACA,KAAA;EACA,YAAA;AAAA,IACE,0BAAA;;;;cAKS,IAAA,GAAc,OAAA,GAAU,WAAA,KAAc,OAAA"}
|
|
@@ -2,7 +2,7 @@ import { TranslationTask } from "./listTranslationsTasks.js";
|
|
|
2
2
|
import { AIClient } from "../utils/setupAI.js";
|
|
3
3
|
import { Dictionary, IntlayerConfig } from "@intlayer/types";
|
|
4
4
|
import { AIOptions } from "@intlayer/api";
|
|
5
|
-
import * as
|
|
5
|
+
import * as _intlayer_chokidar_utils0 from "@intlayer/chokidar/utils";
|
|
6
6
|
import { AIConfig } from "@intlayer/ai";
|
|
7
7
|
|
|
8
8
|
//#region src/fill/translateDictionary.d.ts
|
|
@@ -13,7 +13,7 @@ type TranslateDictionaryOptions = {
|
|
|
13
13
|
mode: 'complete' | 'review';
|
|
14
14
|
aiOptions?: AIOptions;
|
|
15
15
|
fillMetadata?: boolean;
|
|
16
|
-
onHandle?: ReturnType<typeof
|
|
16
|
+
onHandle?: ReturnType<typeof _intlayer_chokidar_utils0.getGlobalLimiter>;
|
|
17
17
|
onSuccess?: () => void;
|
|
18
18
|
onError?: (error: unknown) => void;
|
|
19
19
|
getAbortError?: () => Error | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translateDictionary.d.ts","names":[],"sources":["../../../src/fill/translateDictionary.ts"],"mappings":";;;;;;;;KAkCK,yBAAA,GAA4B,eAAA;EAC/B,gBAAA,EAAkB,UAAA;AAAA;AAAA,KAGf,0BAAA;EACH,IAAA;EACA,SAAA,GAAY,SAAA;EACZ,YAAA;EACA,QAAA,GAAW,UAAA,QAFU,
|
|
1
|
+
{"version":3,"file":"translateDictionary.d.ts","names":[],"sources":["../../../src/fill/translateDictionary.ts"],"mappings":";;;;;;;;KAkCK,yBAAA,GAA4B,eAAA;EAC/B,gBAAA,EAAkB,UAAA;AAAA;AAAA,KAGf,0BAAA;EACH,IAAA;EACA,SAAA,GAAY,SAAA;EACZ,YAAA;EACA,QAAA,GAAW,UAAA,QAFU,yBAAA,CAGuB,gBAAA;EAE5C,SAAA;EACA,OAAA,IAAW,KAAA;EACX,aAAA,SAAsB,KAAA;EACtB,QAAA,GAAW,QAAA;EACX,QAAA,GAAW,QAAA;AAAA;AAAA,cAcA,mBAAA,GACX,IAAA,EAAM,eAAA,EACN,aAAA,EAAe,cAAA,EACf,OAAA,GAAU,0BAAA,KACT,OAAA,CAAQ,yBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeFill.d.ts","names":[],"sources":["../../../src/fill/writeFill.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"writeFill.d.ts","names":[],"sources":["../../../src/fill/writeFill.ts"],"mappings":";;;cASa,SAAA,GACX,sBAAA,EAAwB,UAAA,EACxB,aAAA,EAAe,MAAA,IACf,aAAA,EAAe,MAAA,IACf,aAAA,EAAe,cAAA,KAAc,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dictionary } from "@intlayer/types";
|
|
2
|
-
import { GetConfigurationOptions } from "@intlayer/config";
|
|
3
|
-
import { ListGitFilesOptions } from "@intlayer/chokidar";
|
|
2
|
+
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
3
|
+
import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
|
|
4
4
|
|
|
5
5
|
//#region src/getTargetDictionary.d.ts
|
|
6
6
|
declare const ensureArray: <T>(value: T | T[]) => T[];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { ConfigurationOptions, dirname, setAPI } from "./cli.js";
|
|
|
3
3
|
import { startEditor } from "./editor.js";
|
|
4
4
|
import { extract } from "./extract.js";
|
|
5
5
|
import { FillOptions, fill } from "./fill/fill.js";
|
|
6
|
-
import {
|
|
6
|
+
import { findProjectRoot, init } from "./init.js";
|
|
7
|
+
import { getDetectedPlatform, initSkills } from "./initSkills.js";
|
|
7
8
|
import { listContentDeclaration, listContentDeclarationRows } from "./listContentDeclaration.js";
|
|
8
9
|
import { liveSync } from "./liveSync.js";
|
|
9
10
|
import { pull } from "./pull.js";
|
|
@@ -15,5 +16,8 @@ import { listMissingTranslations, listMissingTranslationsWithConfig } from "./te
|
|
|
15
16
|
import { testMissingTranslations } from "./test/test.js";
|
|
16
17
|
import "./test/index.js";
|
|
17
18
|
import { translateDoc } from "./translateDoc/translateDoc.js";
|
|
18
|
-
export * from "@intlayer/chokidar";
|
|
19
|
-
export
|
|
19
|
+
export * from "@intlayer/chokidar/cli";
|
|
20
|
+
export * from "@intlayer/chokidar/utils";
|
|
21
|
+
export * from "@intlayer/chokidar/build";
|
|
22
|
+
export * from "@intlayer/chokidar/watcher";
|
|
23
|
+
export { ConfigurationOptions, FillOptions, build, dirname, extract, fill, findProjectRoot, getDetectedPlatform, init, initSkills, listContentDeclaration, listContentDeclarationRows, listMissingTranslations, listMissingTranslationsWithConfig, liveSync, pull, push, pushConfig, reviewDoc, searchDoc, setAPI, startEditor, testMissingTranslations, translateDoc };
|
package/dist/types/init.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Platform } from "@intlayer/chokidar/cli";
|
|
2
|
-
|
|
3
1
|
//#region src/init.d.ts
|
|
2
|
+
declare const findProjectRoot: (startDir: string) => string;
|
|
4
3
|
declare const init: (projectRoot?: string) => Promise<void>;
|
|
5
|
-
declare const getDetectedPlatform: () => Platform | undefined;
|
|
6
|
-
declare const initSkills: (projectRoot?: string) => Promise<void>;
|
|
7
4
|
//#endregion
|
|
8
|
-
export {
|
|
5
|
+
export { findProjectRoot, init };
|
|
9
6
|
//# sourceMappingURL=init.d.ts.map
|
package/dist/types/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","names":[],"sources":["../../src/init.ts"],"mappings":";cAIa,eAAA,GAAmB,QAAA;AAAA,cAenB,IAAA,GAAc,WAAA,cAAoB,OAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Platform } from "@intlayer/chokidar/cli";
|
|
2
|
+
|
|
3
|
+
//#region src/initSkills.d.ts
|
|
4
|
+
declare const getDetectedPlatform: () => Platform | undefined;
|
|
5
|
+
declare const initSkills: (projectRoot?: string) => Promise<void>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { getDetectedPlatform, initSkills };
|
|
8
|
+
//# sourceMappingURL=initSkills.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initSkills.d.ts","names":[],"sources":["../../src/initSkills.ts"],"mappings":";;;cAkGa,mBAAA,QAA0B,QAAA;AAAA,cAwC1B,UAAA,GAAoB,WAAA,cAAoB,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listContentDeclaration.d.ts","names":[],"sources":["../../src/listContentDeclaration.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"listContentDeclaration.d.ts","names":[],"sources":["../../src/listContentDeclaration.ts"],"mappings":";;;KAcK,6BAAA;EACH,aAAA,GAAgB,uBAAA;EAChB,IAAA;EACA,QAAA;AAAA;AAAA,cAGW,0BAAA,GACX,OAAA,GAAU,6BAAA;;;;cAiBC,sBAAA,GACX,OAAA,GAAU,6BAAA"}
|
package/dist/types/liveSync.d.ts
CHANGED
package/dist/types/pull.d.ts
CHANGED
package/dist/types/pull.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","names":[],"sources":["../../src/pull.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"pull.d.ts","names":[],"sources":["../../src/pull.ts"],"mappings":";;;KAmBK,WAAA;EACH,YAAA;EACA,mBAAA;EACA,aAAA,GAAgB,uBAAA;AAAA;;;;;cAcL,IAAA,GAAc,OAAA,GAAU,WAAA,KAAc,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pullLog.d.ts","names":[],"sources":["../../../src/push/pullLog.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"pullLog.d.ts","names":[],"sources":["../../../src/push/pullLog.ts"],"mappings":";;;KAIY,UAAA;EACV,aAAA;EACA,MAAA,EAAQ,gBAAA;EACR,YAAA;AAAA;AAAA,cAGW,UAAA;EAAA,QACH,QAAA;EAAA,QACA,YAAA;EAAA,QACA,YAAA;EAAA,QACA,aAAA;EAAA,iBACS,aAAA;EAAA,QACT,UAAA;EAAA,iBACS,MAAA;EAAA,QACT,iBAAA;;EAOR,MAAA,CAAO,WAAA,EAAa,UAAA;EAiBpB,MAAA,CAAA;EAAA,QAMQ,YAAA;EAAA,QAQA,WAAA;EAAA,QAMA,MAAA;EAAA,QA+CA,eAAA;AAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GetConfigurationOptions } from "@intlayer/config";
|
|
2
|
-
import { ListGitFilesOptions } from "@intlayer/chokidar";
|
|
1
|
+
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
2
|
+
import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
|
|
3
3
|
|
|
4
4
|
//#region src/push/push.d.ts
|
|
5
5
|
type PushOptions = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Locale } from "@intlayer/types";
|
|
2
|
-
import { GetConfigurationOptions } from "@intlayer/config";
|
|
2
|
+
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
3
3
|
import { AIOptions } from "@intlayer/api";
|
|
4
|
-
import { ListGitFilesOptions } from "@intlayer/chokidar";
|
|
4
|
+
import { ListGitFilesOptions } from "@intlayer/chokidar/cli";
|
|
5
5
|
|
|
6
6
|
//#region src/reviewDoc/reviewDoc.d.ts
|
|
7
7
|
type ReviewDocOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewDoc.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDoc.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"reviewDoc.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDoc.ts"],"mappings":";;;;;;KA8BK,gBAAA;EACH,UAAA;EACA,OAAA,EAAS,MAAA;EACT,mBAAA;EACA,UAAA,EAAY,MAAA;EACZ,SAAA,GAAY,SAAA;EACZ,2BAAA;EACA,aAAA,GAAgB,uBAAA;EAChB,kBAAA;EACA,oBAAA,qBAAyC,IAAA;EACzC,mBAAA,qBAAwC,IAAA;EACxC,YAAA;EACA,UAAA,GAAa,mBAAA;AAAA;;;;;cAOF,SAAA;EAAmB,UAAA;EAAA,OAAA;EAAA,mBAAA;EAAA,UAAA;EAAA,SAAA;EAAA,2BAAA;EAAA,aAAA;EAAA,kBAAA;EAAA,oBAAA;EAAA,mBAAA;EAAA,YAAA;EAAA;AAAA,GAa7B,gBAAA,KAAgB,OAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AIClient } from "../utils/setupAI.js";
|
|
2
2
|
import { Locale } from "@intlayer/types";
|
|
3
|
-
import { GetConfigurationOptions } from "@intlayer/config";
|
|
3
|
+
import { GetConfigurationOptions } from "@intlayer/config/node";
|
|
4
4
|
import { AIOptions } from "@intlayer/api";
|
|
5
5
|
import { AIConfig } from "@intlayer/ai";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reviewDocBlockAware.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocBlockAware.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"reviewDocBlockAware.d.ts","names":[],"sources":["../../../src/reviewDoc/reviewDocBlockAware.ts"],"mappings":";;;;;;;;;AAuCA;;;;;;;cAAa,oBAAA,GACX,YAAA,UACA,cAAA,UACA,MAAA,EAAQ,MAAA,EACR,UAAA,EAAY,MAAA,EACZ,SAAA,GAAY,SAAA,EACZ,aAAA,GAAgB,uBAAA,EAChB,kBAAA,WACA,YAAA,aACA,QAAA,GAAW,QAAA,EACX,QAAA,GAAW,QAAA,KAAQ,OAAA"}
|