@intlayer/chokidar 6.1.6-canary.0 → 7.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cjs → assets}/getContentDeclarationFileTemplate/cjsTemplate.txt +3 -2
- package/dist/{cjs → assets}/getContentDeclarationFileTemplate/esmTemplate.txt +2 -1
- package/dist/{cjs → assets}/getContentDeclarationFileTemplate/jsonTemplate.txt +2 -1
- package/dist/{cjs → assets}/getContentDeclarationFileTemplate/tsTemplate.txt +2 -1
- package/dist/cjs/_virtual/_utils_asset.cjs +104 -0
- package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +42 -80
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/index.cjs +5 -25
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +21 -42
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +79 -116
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +62 -86
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +48 -69
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +42 -52
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +60 -82
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/cleanOutputDir.cjs +20 -60
- package/dist/cjs/cleanOutputDir.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +64 -103
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +41 -73
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +19 -49
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +20 -50
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +20 -50
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +19 -49
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +19 -49
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/index.cjs +15 -35
- package/dist/cjs/createType/createModuleAugmentation.cjs +56 -108
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/createType/createType.cjs +29 -58
- package/dist/cjs/createType/createType.cjs.map +1 -1
- package/dist/cjs/createType/index.cjs +7 -25
- package/dist/cjs/fetchDistantDictionaries.cjs +49 -77
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs +26 -59
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +32 -68
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +32 -51
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileChange.cjs +35 -56
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +36 -0
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -0
- package/dist/cjs/index.cjs +103 -156
- package/dist/cjs/listDictionariesPath.cjs +27 -59
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +93 -162
- package/dist/cjs/listGitFiles.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +70 -0
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/index.cjs +11 -29
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +68 -90
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +111 -166
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +27 -53
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +60 -102
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +107 -182
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +73 -130
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs +27 -61
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +10 -32
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
- package/dist/cjs/utils/chunkJSON.cjs +329 -0
- package/dist/cjs/utils/chunkJSON.cjs.map +1 -0
- package/dist/cjs/utils/extractErrorMessage.cjs +92 -135
- package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
- package/dist/cjs/utils/formatter.cjs +19 -49
- package/dist/cjs/utils/formatter.cjs.map +1 -1
- package/dist/cjs/utils/getChunk.cjs +34 -0
- package/dist/cjs/utils/getChunk.cjs.map +1 -0
- package/dist/cjs/utils/getFileHash.cjs +9 -40
- package/dist/cjs/utils/getFileHash.cjs.map +1 -1
- package/dist/cjs/utils/getFormatFromExtension.cjs +23 -54
- package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
- package/dist/cjs/utils/kebabCaseToCamelCase.cjs +11 -36
- package/dist/cjs/utils/kebabCaseToCamelCase.cjs.map +1 -1
- package/dist/cjs/utils/pLimit.cjs +128 -0
- package/dist/cjs/utils/pLimit.cjs.map +1 -0
- package/dist/cjs/utils/parallelize.cjs +10 -169
- package/dist/cjs/utils/parallelize.cjs.map +1 -1
- package/dist/cjs/utils/parallelizeGlobal.cjs +29 -0
- package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -0
- package/dist/cjs/utils/reduceObjectFormat.cjs +31 -0
- package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -0
- package/dist/cjs/utils/resolveObjectPromises.cjs +18 -48
- package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
- package/dist/cjs/utils/runOnce.cjs +80 -57
- package/dist/cjs/utils/runOnce.cjs.map +1 -1
- package/dist/cjs/utils/runParallel.cjs +163 -74
- package/dist/cjs/utils/runParallel.cjs.map +1 -1
- package/dist/cjs/utils/sortAlphabetically.cjs +5 -27
- package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
- package/dist/cjs/utils/splitTextByLine.cjs +11 -0
- package/dist/cjs/utils/splitTextByLine.cjs.map +1 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat copy.cjs +54 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat copy.cjs.map +1 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +60 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +61 -83
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeConfiguration/index.cjs +15 -35
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +25 -51
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs +0 -17
- package/dist/cjs/writeContentDeclaration/index.cjs +9 -33
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +77 -0
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +1731 -755
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +113 -112
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +56 -66
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/cjs/writeFileIfChanged.cjs +10 -43
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
- package/dist/cjs/writeJsonIfChanged.cjs +14 -31
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
- package/dist/esm/_virtual/_utils_asset.mjs +100 -0
- package/dist/esm/_virtual/rolldown_runtime.mjs +8 -0
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +35 -54
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/index.mjs +4 -3
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +18 -17
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +69 -91
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +53 -61
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +40 -42
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +35 -25
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +53 -56
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
- package/dist/esm/cleanOutputDir.mjs +17 -36
- package/dist/esm/cleanOutputDir.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +51 -70
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +36 -47
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +14 -14
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +15 -15
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +15 -15
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +14 -14
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +14 -14
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -8
- package/dist/esm/createType/createModuleAugmentation.mjs +48 -71
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/createType/createType.mjs +24 -35
- package/dist/esm/createType/createType.mjs.map +1 -1
- package/dist/esm/createType/index.mjs +4 -3
- package/dist/esm/fetchDistantDictionaries.mjs +45 -52
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs +22 -37
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +31 -42
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +27 -24
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileChange.mjs +30 -29
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +34 -0
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -0
- package/dist/esm/index.mjs +39 -99
- package/dist/esm/listDictionariesPath.mjs +24 -24
- package/dist/esm/listDictionariesPath.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +83 -124
- package/dist/esm/listGitFiles.mjs.map +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +66 -0
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -0
- package/dist/esm/loadDictionaries/index.mjs +6 -5
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +61 -70
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +105 -146
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +23 -31
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +52 -74
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/log.mjs +105 -165
- package/dist/esm/loadDictionaries/log.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +64 -97
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/applyMask.mjs +26 -37
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +7 -7
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
- package/dist/esm/utils/chunkJSON.mjs +327 -0
- package/dist/esm/utils/chunkJSON.mjs.map +1 -0
- package/dist/esm/utils/extractErrorMessage.mjs +91 -111
- package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +10 -12
- package/dist/esm/utils/formatter.mjs.map +1 -1
- package/dist/esm/utils/getChunk.mjs +34 -0
- package/dist/esm/utils/getChunk.mjs.map +1 -0
- package/dist/esm/utils/getFileHash.mjs +6 -5
- package/dist/esm/utils/getFileHash.mjs.map +1 -1
- package/dist/esm/utils/getFormatFromExtension.mjs +21 -29
- package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
- package/dist/esm/utils/kebabCaseToCamelCase.mjs +10 -12
- package/dist/esm/utils/kebabCaseToCamelCase.mjs.map +1 -1
- package/dist/esm/utils/pLimit.mjs +126 -0
- package/dist/esm/utils/pLimit.mjs.map +1 -0
- package/dist/esm/utils/parallelize.mjs +10 -144
- package/dist/esm/utils/parallelize.mjs.map +1 -1
- package/dist/esm/utils/parallelizeGlobal.mjs +27 -0
- package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -0
- package/dist/esm/utils/reduceObjectFormat.mjs +30 -0
- package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -0
- package/dist/esm/utils/resolveObjectPromises.mjs +17 -24
- package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
- package/dist/esm/utils/runOnce.mjs +76 -33
- package/dist/esm/utils/runOnce.mjs.map +1 -1
- package/dist/esm/utils/runParallel.mjs +160 -40
- package/dist/esm/utils/runParallel.mjs.map +1 -1
- package/dist/esm/utils/sortAlphabetically.mjs +4 -3
- package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
- package/dist/esm/utils/splitTextByLine.mjs +10 -0
- package/dist/esm/utils/splitTextByLine.mjs.map +1 -0
- package/dist/esm/utils/verifyIdenticObjectFormat copy.mjs +53 -0
- package/dist/esm/utils/verifyIdenticObjectFormat copy.mjs.map +1 -0
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs +59 -0
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -0
- package/dist/esm/watcher.mjs +53 -58
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeConfiguration/index.mjs +11 -10
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +24 -27
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs +0 -1
- package/dist/esm/writeContentDeclaration/index.mjs +6 -7
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +71 -0
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +1726 -735
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +105 -76
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +48 -46
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/esm/writeFileIfChanged.mjs +7 -18
- package/dist/esm/writeFileIfChanged.mjs.map +1 -1
- package/dist/esm/writeJsonIfChanged.mjs +14 -7
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +14 -7
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/index.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +7 -2
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +14 -10
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +8 -3
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +12 -7
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +8 -2
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +10 -6
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -1
- package/dist/types/cleanOutputDir.d.ts +6 -1
- package/dist/types/cleanOutputDir.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +6 -1
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +6 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +7 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +7 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +7 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +7 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +7 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -8
- package/dist/types/createType/createModuleAugmentation.d.ts +8 -5
- package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -1
- package/dist/types/createType/createType.d.ts +7 -4
- package/dist/types/createType/createType.d.ts.map +1 -1
- package/dist/types/createType/index.d.ts +3 -3
- package/dist/types/fetchDistantDictionaries.d.ts +10 -7
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/filterInvalidDictionaries.d.ts +7 -4
- package/dist/types/filterInvalidDictionaries.d.ts.map +1 -1
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +6 -2
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -1
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts +6 -2
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -1
- package/dist/types/handleContentDeclarationFileChange.d.ts +6 -2
- package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -1
- package/dist/types/handleUnlinkedContentDeclarationFile.d.ts +7 -0
- package/dist/types/handleUnlinkedContentDeclarationFile.d.ts.map +1 -0
- package/dist/types/index.d.ts +49 -33
- package/dist/types/listDictionariesPath.d.ts +7 -2
- package/dist/types/listDictionariesPath.d.ts.map +1 -1
- package/dist/types/listGitFiles.d.ts +24 -12
- package/dist/types/listGitFiles.d.ts.map +1 -1
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts +11 -0
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -0
- package/dist/types/loadDictionaries/index.d.ts +5 -5
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +8 -5
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +18 -14
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +6 -3
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +13 -8
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/log.d.ts +28 -24
- package/dist/types/loadDictionaries/log.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts +12 -2
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/reduceDictionaryContent/applyMask.d.ts +6 -2
- package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -1
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +6 -2
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -1
- package/dist/types/utils/chunkJSON.d.ts +56 -0
- package/dist/types/utils/chunkJSON.d.ts.map +1 -0
- package/dist/types/utils/extractErrorMessage.d.ts +4 -1
- package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
- package/dist/types/utils/formatter.d.ts +8 -3
- package/dist/types/utils/formatter.d.ts.map +1 -1
- package/dist/types/utils/getChunk.d.ts +11 -0
- package/dist/types/utils/getChunk.d.ts.map +1 -0
- package/dist/types/utils/getFileHash.d.ts +4 -1
- package/dist/types/utils/getFileHash.d.ts.map +1 -1
- package/dist/types/utils/getFormatFromExtension.d.ts +7 -4
- package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -1
- package/dist/types/utils/kebabCaseToCamelCase.d.ts +4 -1
- package/dist/types/utils/kebabCaseToCamelCase.d.ts.map +1 -1
- package/dist/types/utils/pLimit.d.ts +16 -0
- package/dist/types/utils/pLimit.d.ts.map +1 -0
- package/dist/types/utils/parallelize.d.ts +4 -13
- package/dist/types/utils/parallelize.d.ts.map +1 -1
- package/dist/types/utils/parallelizeGlobal.d.ts +22 -0
- package/dist/types/utils/parallelizeGlobal.d.ts.map +1 -0
- package/dist/types/utils/reduceObjectFormat.d.ts +17 -0
- package/dist/types/utils/reduceObjectFormat.d.ts.map +1 -0
- package/dist/types/utils/resolveObjectPromises.d.ts +4 -1
- package/dist/types/utils/resolveObjectPromises.d.ts.map +1 -1
- package/dist/types/utils/runOnce.d.ts +23 -2
- package/dist/types/utils/runOnce.d.ts.map +1 -1
- package/dist/types/utils/runParallel.d.ts +9 -6
- package/dist/types/utils/runParallel.d.ts.map +1 -1
- package/dist/types/utils/sortAlphabetically.d.ts +4 -1
- package/dist/types/utils/sortAlphabetically.d.ts.map +1 -1
- package/dist/types/utils/splitTextByLine.d.ts +5 -0
- package/dist/types/utils/splitTextByLine.d.ts.map +1 -0
- package/dist/types/utils/verifyIdenticObjectFormat copy.d.ts +23 -0
- package/dist/types/utils/verifyIdenticObjectFormat copy.d.ts.map +1 -0
- package/dist/types/utils/verifyIdenticObjectFormat.d.ts +23 -0
- package/dist/types/utils/verifyIdenticObjectFormat.d.ts.map +1 -0
- package/dist/types/watcher.d.ts +13 -9
- package/dist/types/watcher.d.ts.map +1 -1
- package/dist/types/writeConfiguration/index.d.ts +6 -2
- package/dist/types/writeConfiguration/index.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +4 -1
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +4 -1
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/index.d.ts +6 -7
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts +7 -0
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts +33 -6
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +14 -6
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +7 -3
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
- package/dist/types/writeFileIfChanged.d.ts +7 -2
- package/dist/types/writeFileIfChanged.d.ts.map +1 -1
- package/dist/types/writeJsonIfChanged.d.ts +7 -2
- package/dist/types/writeJsonIfChanged.d.ts.map +1 -1
- package/package.json +48 -54
- package/LICENSE +0 -202
- package/dist/cjs/buildIntlayerDictionary/index.cjs.map +0 -1
- package/dist/cjs/createDictionaryEntryPoint/index.cjs.map +0 -1
- package/dist/cjs/createType/index.cjs.map +0 -1
- package/dist/cjs/handleUnlikedContentDeclarationFile.cjs +0 -57
- package/dist/cjs/handleUnlikedContentDeclarationFile.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/loadDictionaries/index.cjs.map +0 -1
- package/dist/cjs/mergeDictionaries.cjs +0 -143
- package/dist/cjs/mergeDictionaries.cjs.map +0 -1
- package/dist/cjs/orderDictionaries.cjs +0 -71
- package/dist/cjs/orderDictionaries.cjs.map +0 -1
- package/dist/cjs/prepareContentDeclaration.cjs +0 -93
- package/dist/cjs/prepareContentDeclaration.cjs.map +0 -1
- package/dist/cjs/processPerLocaleDictionary.cjs +0 -49
- package/dist/cjs/processPerLocaleDictionary.cjs.map +0 -1
- package/dist/cjs/utils/getExtention.cjs +0 -37
- package/dist/cjs/utils/getExtention.cjs.map +0 -1
- package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs.map +0 -1
- package/dist/cjs/writeContentDeclaration/formatCode.cjs +0 -78
- package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +0 -1
- package/dist/cjs/writeContentDeclaration/index.cjs.map +0 -1
- package/dist/esm/buildIntlayerDictionary/index.mjs.map +0 -1
- package/dist/esm/createDictionaryEntryPoint/index.mjs.map +0 -1
- package/dist/esm/createType/index.mjs.map +0 -1
- package/dist/esm/getContentDeclarationFileTemplate/cjsTemplate.txt +0 -9
- package/dist/esm/getContentDeclarationFileTemplate/esmTemplate.txt +0 -9
- package/dist/esm/getContentDeclarationFileTemplate/jsonTemplate.txt +0 -5
- package/dist/esm/getContentDeclarationFileTemplate/tsTemplate.txt +0 -8
- package/dist/esm/handleUnlikedContentDeclarationFile.mjs +0 -33
- package/dist/esm/handleUnlikedContentDeclarationFile.mjs.map +0 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/loadDictionaries/index.mjs.map +0 -1
- package/dist/esm/mergeDictionaries.mjs +0 -109
- package/dist/esm/mergeDictionaries.mjs.map +0 -1
- package/dist/esm/orderDictionaries.mjs +0 -37
- package/dist/esm/orderDictionaries.mjs.map +0 -1
- package/dist/esm/prepareContentDeclaration.mjs +0 -72
- package/dist/esm/prepareContentDeclaration.mjs.map +0 -1
- package/dist/esm/processPerLocaleDictionary.mjs +0 -25
- package/dist/esm/processPerLocaleDictionary.mjs.map +0 -1
- package/dist/esm/utils/getExtention.mjs +0 -13
- package/dist/esm/utils/getExtention.mjs.map +0 -1
- package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs.map +0 -1
- package/dist/esm/writeContentDeclaration/formatCode.mjs +0 -44
- package/dist/esm/writeContentDeclaration/formatCode.mjs.map +0 -1
- package/dist/esm/writeContentDeclaration/index.mjs.map +0 -1
- package/dist/types/buildIntlayerDictionary/index.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/index.d.ts.map +0 -1
- package/dist/types/createType/index.d.ts.map +0 -1
- package/dist/types/handleUnlikedContentDeclarationFile.d.ts +0 -3
- package/dist/types/handleUnlikedContentDeclarationFile.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/loadDictionaries/index.d.ts.map +0 -1
- package/dist/types/mergeDictionaries.d.ts +0 -3
- package/dist/types/mergeDictionaries.d.ts.map +0 -1
- package/dist/types/orderDictionaries.d.ts +0 -10
- package/dist/types/orderDictionaries.d.ts.map +0 -1
- package/dist/types/prepareContentDeclaration.d.ts +0 -3
- package/dist/types/prepareContentDeclaration.d.ts.map +0 -1
- package/dist/types/processPerLocaleDictionary.d.ts +0 -32
- package/dist/types/processPerLocaleDictionary.d.ts.map +0 -1
- package/dist/types/utils/getExtention.d.ts +0 -3
- package/dist/types/utils/getExtention.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/formatCode.d.ts +0 -2
- package/dist/types/writeContentDeclaration/formatCode.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/index.d.ts.map +0 -1
|
@@ -1,106 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var loadRemoteDictionaries_exports = {};
|
|
20
|
-
__export(loadRemoteDictionaries_exports, {
|
|
21
|
-
formatDistantDictionaries: () => formatDistantDictionaries,
|
|
22
|
-
loadRemoteDictionaries: () => loadRemoteDictionaries
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(loadRemoteDictionaries_exports);
|
|
25
|
-
var import_api = require("@intlayer/api");
|
|
26
|
-
var import_config = require("@intlayer/config");
|
|
27
|
-
var import_remote_dictionaries_entry = require("@intlayer/remote-dictionaries-entry");
|
|
28
|
-
var import_fetchDistantDictionaries = require('../fetchDistantDictionaries.cjs');
|
|
29
|
-
var import_sortAlphabetically = require('../utils/sortAlphabetically.cjs');
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_fetchDistantDictionaries = require('../fetchDistantDictionaries.cjs');
|
|
3
|
+
const require_utils_sortAlphabetically = require('../utils/sortAlphabetically.cjs');
|
|
4
|
+
let __intlayer_config = require("@intlayer/config");
|
|
5
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
6
|
+
let __intlayer_api = require("@intlayer/api");
|
|
7
|
+
__intlayer_api = require_rolldown_runtime.__toESM(__intlayer_api);
|
|
8
|
+
let __intlayer_remote_dictionaries_entry = require("@intlayer/remote-dictionaries-entry");
|
|
9
|
+
__intlayer_remote_dictionaries_entry = require_rolldown_runtime.__toESM(__intlayer_remote_dictionaries_entry);
|
|
10
|
+
|
|
11
|
+
//#region src/loadDictionaries/loadRemoteDictionaries.ts
|
|
30
12
|
const formatDistantDictionaries = (dictionaries) => dictionaries.map((dict) => ({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
13
|
+
...dict,
|
|
14
|
+
localId: `${dict.key}::remote::${dict.id}`,
|
|
15
|
+
location: "remote"
|
|
34
16
|
}));
|
|
35
|
-
const loadRemoteDictionaries = async (configuration = (0,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
orderedDistantDictionaryKeys.map((key) => ({
|
|
78
|
-
dictionaryKey: key,
|
|
79
|
-
type: "remote",
|
|
80
|
-
status: "pending"
|
|
81
|
-
}))
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
const distantDictionariesData = await (0, import_fetchDistantDictionaries.fetchDistantDictionaries)(
|
|
85
|
-
{
|
|
86
|
-
dictionaryKeys: orderedDistantDictionaryKeys
|
|
87
|
-
},
|
|
88
|
-
onStatusUpdate
|
|
89
|
-
);
|
|
90
|
-
const distantDictionaries = formatDistantDictionaries(
|
|
91
|
-
distantDictionariesData
|
|
92
|
-
);
|
|
93
|
-
return [...cachedDictionaries, ...distantDictionaries];
|
|
94
|
-
} catch (error) {
|
|
95
|
-
options?.onError?.(error);
|
|
96
|
-
return [];
|
|
97
|
-
} finally {
|
|
98
|
-
options?.onStopRemoteCheck?.();
|
|
99
|
-
}
|
|
17
|
+
const loadRemoteDictionaries = async (configuration = (0, __intlayer_config.getConfiguration)(), onStatusUpdate, options) => {
|
|
18
|
+
const { editor } = configuration;
|
|
19
|
+
const remoteDictionariesRecord = (0, __intlayer_remote_dictionaries_entry.getRemoteDictionaries)(configuration);
|
|
20
|
+
if (!Boolean(editor.clientId && editor.clientSecret)) return [];
|
|
21
|
+
try {
|
|
22
|
+
options?.onStartRemoteCheck?.();
|
|
23
|
+
const distantDictionaryUpdateTimeStamp = (await (0, __intlayer_api.getIntlayerAPIProxy)(void 0, configuration).dictionary.getDictionariesUpdateTimestamp()).data;
|
|
24
|
+
if (!distantDictionaryUpdateTimeStamp) throw new Error("No distant dictionaries found");
|
|
25
|
+
const dictionariesKeysToFetch = Object.entries(distantDictionaryUpdateTimeStamp).filter(([dictionaryKey, remoteUpdatedAt]) => {
|
|
26
|
+
if (!remoteUpdatedAt) return true;
|
|
27
|
+
const local = remoteDictionariesRecord[dictionaryKey];
|
|
28
|
+
if (!local) return true;
|
|
29
|
+
const localUpdatedAtRaw = local?.updatedAt;
|
|
30
|
+
const localUpdatedAt = typeof localUpdatedAtRaw === "number" ? localUpdatedAtRaw : localUpdatedAtRaw ? new Date(localUpdatedAtRaw).getTime() : void 0;
|
|
31
|
+
if (typeof localUpdatedAt !== "number") return true;
|
|
32
|
+
return remoteUpdatedAt > localUpdatedAt;
|
|
33
|
+
}).map(([dictionaryKey]) => dictionaryKey);
|
|
34
|
+
const cachedDictionaries = Object.entries(remoteDictionariesRecord).filter(([key, dictionary]) => {
|
|
35
|
+
const remoteUpdatedAt = distantDictionaryUpdateTimeStamp[key];
|
|
36
|
+
const localUpdatedAtRaw = dictionary?.updatedAt;
|
|
37
|
+
const localUpdatedAt = typeof localUpdatedAtRaw === "number" ? localUpdatedAtRaw : localUpdatedAtRaw ? new Date(localUpdatedAtRaw).getTime() : void 0;
|
|
38
|
+
return typeof localUpdatedAt === "number" && typeof remoteUpdatedAt === "number" && localUpdatedAt >= remoteUpdatedAt;
|
|
39
|
+
}).map(([, dictionary]) => dictionary);
|
|
40
|
+
if (cachedDictionaries.length > 0) onStatusUpdate?.(cachedDictionaries.map((d) => ({
|
|
41
|
+
dictionaryKey: d.key,
|
|
42
|
+
type: "remote",
|
|
43
|
+
status: "imported"
|
|
44
|
+
})));
|
|
45
|
+
const orderedDistantDictionaryKeys = dictionariesKeysToFetch.sort(require_utils_sortAlphabetically.sortAlphabetically);
|
|
46
|
+
if (orderedDistantDictionaryKeys.length > 0) onStatusUpdate?.(orderedDistantDictionaryKeys.map((key) => ({
|
|
47
|
+
dictionaryKey: key,
|
|
48
|
+
type: "remote",
|
|
49
|
+
status: "pending"
|
|
50
|
+
})));
|
|
51
|
+
const distantDictionaries = formatDistantDictionaries(await require_fetchDistantDictionaries.fetchDistantDictionaries({ dictionaryKeys: orderedDistantDictionaryKeys }, onStatusUpdate));
|
|
52
|
+
return [...cachedDictionaries, ...distantDictionaries];
|
|
53
|
+
} catch (error) {
|
|
54
|
+
options?.onError?.(error);
|
|
55
|
+
return [];
|
|
56
|
+
} finally {
|
|
57
|
+
options?.onStopRemoteCheck?.();
|
|
58
|
+
}
|
|
100
59
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
60
|
+
|
|
61
|
+
//#endregion
|
|
62
|
+
exports.formatDistantDictionaries = formatDistantDictionaries;
|
|
63
|
+
exports.loadRemoteDictionaries = loadRemoteDictionaries;
|
|
106
64
|
//# sourceMappingURL=loadRemoteDictionaries.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config';\nimport
|
|
1
|
+
{"version":3,"file":"loadRemoteDictionaries.cjs","names":["distantDictionaryUpdateTimeStamp: Record<string, number> | null","sortAlphabetically","distantDictionaries: DictionaryAPI[]","fetchDistantDictionaries"],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config';\nimport { getRemoteDictionaries } from '@intlayer/remote-dictionaries-entry';\nimport type { Dictionary } from '@intlayer/types';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\nimport type { DictionariesStatus } from '../loadDictionaries/loadDictionaries';\nimport { sortAlphabetically } from '../utils/sortAlphabetically';\n\nexport const formatDistantDictionaries = (\n dictionaries: (DictionaryAPI | Dictionary)[]\n): Dictionary[] =>\n dictionaries.map((dict) => ({\n ...dict,\n localId: `${dict.key}::remote::${dict.id}`,\n location: 'remote' as const,\n }));\n\nexport const loadRemoteDictionaries = async (\n configuration = getConfiguration(),\n onStatusUpdate?: (status: DictionariesStatus[]) => void,\n options?: {\n onStartRemoteCheck?: () => void;\n onStopRemoteCheck?: () => void;\n onError?: (error: Error) => void;\n }\n): Promise<DictionaryAPI[]> => {\n const { editor } = configuration;\n const remoteDictionariesRecord = getRemoteDictionaries(configuration);\n\n const hasRemoteDictionaries = Boolean(editor.clientId && editor.clientSecret);\n\n if (!hasRemoteDictionaries) return [];\n\n try {\n options?.onStartRemoteCheck?.();\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n const distantDictionaryUpdateTimeStamp: Record<string, number> | null =\n getDictionariesKeysResult.data;\n\n if (!distantDictionaryUpdateTimeStamp) {\n throw new Error('No distant dictionaries found');\n }\n\n const dictionariesKeysToFetch = Object.entries(\n distantDictionaryUpdateTimeStamp\n )\n .filter(([dictionaryKey, remoteUpdatedAt]) => {\n // If remote doesn't provide updatedAt, fetch to be safe\n if (!remoteUpdatedAt) return true;\n\n // If no local cache exists, fetch\n const local = (remoteDictionariesRecord as any)[dictionaryKey];\n if (!local) return true;\n\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // If local timestamp missing or older than remote, fetch\n if (typeof localUpdatedAt !== 'number') return true;\n return remoteUpdatedAt > localUpdatedAt;\n })\n .map(([dictionaryKey]) => dictionaryKey);\n\n const cachedDictionaries = Object.entries(remoteDictionariesRecord)\n .filter(([key, dictionary]) => {\n const remoteUpdatedAt = distantDictionaryUpdateTimeStamp[key];\n const localUpdatedAtRaw = (dictionary as any)?.updatedAt as\n | number\n | string\n | undefined;\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n // Consider as cached/imported when local exists and is up-to-date or newer\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n })\n .map(([, dictionary]) => dictionary as any);\n\n // Report cached as already imported\n if (cachedDictionaries.length > 0) {\n onStatusUpdate?.(\n cachedDictionaries.map((d) => ({\n dictionaryKey: d.key,\n type: 'remote',\n status: 'imported',\n }))\n );\n }\n\n const orderedDistantDictionaryKeys =\n dictionariesKeysToFetch.sort(sortAlphabetically);\n\n // Report pending for keys to be fetched so totals are visible immediately\n if (orderedDistantDictionaryKeys.length > 0) {\n onStatusUpdate?.(\n orderedDistantDictionaryKeys.map((key) => ({\n dictionaryKey: key,\n type: 'remote',\n status: 'pending',\n }))\n );\n }\n\n const distantDictionariesData = await fetchDistantDictionaries(\n {\n dictionaryKeys: orderedDistantDictionaryKeys,\n },\n onStatusUpdate\n );\n\n const distantDictionaries: DictionaryAPI[] = formatDistantDictionaries(\n distantDictionariesData\n ) as DictionaryAPI[];\n\n return [...cachedDictionaries, ...distantDictionaries];\n } catch (error) {\n options?.onError?.(error as Error);\n return [];\n } finally {\n options?.onStopRemoteCheck?.();\n }\n};\n"],"mappings":";;;;;;;;;;;AAUA,MAAa,6BACX,iBAEA,aAAa,KAAK,UAAU;CAC1B,GAAG;CACH,SAAS,GAAG,KAAK,IAAI,YAAY,KAAK;CACtC,UAAU;CACX,EAAE;AAEL,MAAa,yBAAyB,OACpC,yDAAkC,EAClC,gBACA,YAK6B;CAC7B,MAAM,EAAE,WAAW;CACnB,MAAM,2FAAiD,cAAc;AAIrE,KAAI,CAF0B,QAAQ,OAAO,YAAY,OAAO,aAAa,CAEjD,QAAO,EAAE;AAErC,KAAI;AACF,WAAS,sBAAsB;EAQ/B,MAAMA,oCAFJ,8CAJsC,QAAW,cAAc,CAI7C,WAAW,gCAAgC,EAGnC;AAE5B,MAAI,CAAC,iCACH,OAAM,IAAI,MAAM,gCAAgC;EAGlD,MAAM,0BAA0B,OAAO,QACrC,iCACD,CACE,QAAQ,CAAC,eAAe,qBAAqB;AAE5C,OAAI,CAAC,gBAAiB,QAAO;GAG7B,MAAM,QAAS,yBAAiC;AAChD,OAAI,CAAC,MAAO,QAAO;GAEnB,MAAM,oBAAqB,OAAe;GAI1C,MAAM,iBACJ,OAAO,sBAAsB,WACzB,oBACA,oBACE,IAAI,KAAK,kBAAkB,CAAC,SAAS,GACrC;AAGR,OAAI,OAAO,mBAAmB,SAAU,QAAO;AAC/C,UAAO,kBAAkB;IACzB,CACD,KAAK,CAAC,mBAAmB,cAAc;EAE1C,MAAM,qBAAqB,OAAO,QAAQ,yBAAyB,CAChE,QAAQ,CAAC,KAAK,gBAAgB;GAC7B,MAAM,kBAAkB,iCAAiC;GACzD,MAAM,oBAAqB,YAAoB;GAI/C,MAAM,iBACJ,OAAO,sBAAsB,WACzB,oBACA,oBACE,IAAI,KAAK,kBAAkB,CAAC,SAAS,GACrC;AAER,UACE,OAAO,mBAAmB,YAC1B,OAAO,oBAAoB,YAC3B,kBAAkB;IAEpB,CACD,KAAK,GAAG,gBAAgB,WAAkB;AAG7C,MAAI,mBAAmB,SAAS,EAC9B,kBACE,mBAAmB,KAAK,OAAO;GAC7B,eAAe,EAAE;GACjB,MAAM;GACN,QAAQ;GACT,EAAE,CACJ;EAGH,MAAM,+BACJ,wBAAwB,KAAKC,oDAAmB;AAGlD,MAAI,6BAA6B,SAAS,EACxC,kBACE,6BAA6B,KAAK,SAAS;GACzC,eAAe;GACf,MAAM;GACN,QAAQ;GACT,EAAE,CACJ;EAUH,MAAMC,sBAAuC,0BAPb,MAAMC,0DACpC,EACE,gBAAgB,8BACjB,EACD,eACD,CAIA;AAED,SAAO,CAAC,GAAG,oBAAoB,GAAG,oBAAoB;UAC/C,OAAO;AACd,WAAS,UAAU,MAAe;AAClC,SAAO,EAAE;WACD;AACR,WAAS,qBAAqB"}
|
|
@@ -1,184 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __intlayer_config = require("@intlayer/config");
|
|
3
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
4
|
+
|
|
5
|
+
//#region src/loadDictionaries/log.ts
|
|
6
|
+
var DictionariesLogger = class {
|
|
7
|
+
statuses = [];
|
|
8
|
+
spinnerTimer = null;
|
|
9
|
+
spinnerIndex = 0;
|
|
10
|
+
renderedLines = 0;
|
|
11
|
+
spinnerFrames = __intlayer_config.spinnerFrames;
|
|
12
|
+
isFinished = false;
|
|
13
|
+
prefix;
|
|
14
|
+
lastRenderedState = "";
|
|
15
|
+
remoteCheckInProgress = false;
|
|
16
|
+
expectRemote = false;
|
|
17
|
+
remoteError;
|
|
18
|
+
constructor() {
|
|
19
|
+
this.prefix = (0, __intlayer_config.getConfiguration)().log.prefix;
|
|
20
|
+
}
|
|
21
|
+
setExpectRemote(expect) {
|
|
22
|
+
this.expectRemote = expect;
|
|
23
|
+
}
|
|
24
|
+
startRemoteCheck() {
|
|
25
|
+
if (this.isFinished) return;
|
|
26
|
+
this.remoteCheckInProgress = true;
|
|
27
|
+
this.startSpinner();
|
|
28
|
+
this.render();
|
|
29
|
+
}
|
|
30
|
+
stopRemoteCheck() {
|
|
31
|
+
this.remoteCheckInProgress = false;
|
|
32
|
+
}
|
|
33
|
+
update(newStatuses) {
|
|
34
|
+
if (this.isFinished) return;
|
|
35
|
+
for (const status of newStatuses) {
|
|
36
|
+
const index = this.statuses.findIndex((s) => s.dictionaryKey === status.dictionaryKey && s.type === status.type);
|
|
37
|
+
if (index >= 0) this.statuses[index] = status;
|
|
38
|
+
else this.statuses.push(status);
|
|
39
|
+
}
|
|
40
|
+
const { remoteTotal } = this.computeProgress();
|
|
41
|
+
if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) return;
|
|
42
|
+
this.startSpinner();
|
|
43
|
+
this.render();
|
|
44
|
+
}
|
|
45
|
+
finish() {
|
|
46
|
+
this.isFinished = true;
|
|
47
|
+
this.stopSpinner();
|
|
48
|
+
this.render();
|
|
49
|
+
}
|
|
50
|
+
startSpinner() {
|
|
51
|
+
if (this.spinnerTimer || this.isFinished) return;
|
|
52
|
+
this.spinnerTimer = setInterval(() => {
|
|
53
|
+
this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;
|
|
54
|
+
this.render();
|
|
55
|
+
}, 100);
|
|
56
|
+
}
|
|
57
|
+
stopSpinner() {
|
|
58
|
+
if (!this.spinnerTimer) return;
|
|
59
|
+
clearInterval(this.spinnerTimer);
|
|
60
|
+
this.spinnerTimer = null;
|
|
61
|
+
}
|
|
62
|
+
setRemoteError = (error) => {
|
|
63
|
+
this.remoteError = (0, __intlayer_config.extractErrorMessage)(error);
|
|
64
|
+
this.stopRemoteCheck();
|
|
65
|
+
this.render();
|
|
66
|
+
};
|
|
67
|
+
render() {
|
|
68
|
+
const { localTotal, localDone, remoteTotal, remoteDone } = this.computeProgress();
|
|
69
|
+
const frame = this.spinnerFrames[this.spinnerIndex];
|
|
70
|
+
const clock = (0, __intlayer_config.colorize)(frame, __intlayer_config.ANSIColors.BLUE);
|
|
71
|
+
const lines = [];
|
|
72
|
+
const isLocalDone = localDone === localTotal;
|
|
73
|
+
const isRemoteDone = remoteDone === remoteTotal;
|
|
74
|
+
if (!(this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0)) if (isLocalDone) lines.push(`${this.prefix} ${__intlayer_config.v} Local content: ${(0, __intlayer_config.colorize)(`${localDone}`, __intlayer_config.ANSIColors.GREEN)}${(0, __intlayer_config.colorize)(`/${localTotal}`, __intlayer_config.ANSIColors.GREY)}`);
|
|
75
|
+
else lines.push(`${this.prefix} ${clock} Local content: ${(0, __intlayer_config.colorize)(`${localDone}`, __intlayer_config.ANSIColors.BLUE)}${(0, __intlayer_config.colorize)(`/${localTotal}`, __intlayer_config.ANSIColors.GREY)}`);
|
|
76
|
+
if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) if (this.remoteError) lines.push(`${this.prefix} ${__intlayer_config.x} Remote content: ${(0, __intlayer_config.colorize)(this.remoteError, __intlayer_config.ANSIColors.RED)}`);
|
|
77
|
+
else if (remoteTotal === 0) lines.push(`${this.prefix} ${clock} Remote content: ${(0, __intlayer_config.colorize)("Check server", __intlayer_config.ANSIColors.BLUE)}`);
|
|
78
|
+
else if (isRemoteDone) lines.push(`${this.prefix} ${__intlayer_config.v} Remote content: ${(0, __intlayer_config.colorize)(`${remoteDone}`, __intlayer_config.ANSIColors.GREEN)}${(0, __intlayer_config.colorize)(`/${remoteTotal}`, __intlayer_config.ANSIColors.GREY)}`);
|
|
79
|
+
else lines.push(`${this.prefix} ${clock} Remote content: ${(0, __intlayer_config.colorize)(`${remoteDone}`, __intlayer_config.ANSIColors.BLUE)}${(0, __intlayer_config.colorize)(`/${remoteTotal}`, __intlayer_config.ANSIColors.GREY)}`);
|
|
80
|
+
const currentState = lines.join("\n");
|
|
81
|
+
if (currentState === this.lastRenderedState) return;
|
|
82
|
+
this.lastRenderedState = currentState;
|
|
83
|
+
if (this.renderedLines > 0) process.stdout.write(`\x1b[${this.renderedLines}F`);
|
|
84
|
+
const totalLinesToClear = Math.max(this.renderedLines, lines.length);
|
|
85
|
+
for (let i = 0; i < totalLinesToClear; i++) {
|
|
86
|
+
process.stdout.write("\x1B[2K");
|
|
87
|
+
const line = lines[i];
|
|
88
|
+
if (line !== void 0) process.stdout.write(line);
|
|
89
|
+
process.stdout.write("\n");
|
|
90
|
+
}
|
|
91
|
+
this.renderedLines = lines.length;
|
|
92
|
+
}
|
|
93
|
+
computeProgress() {
|
|
94
|
+
const localKeys = new Set(this.statuses.filter((s) => s.type === "local").map((s) => s.dictionaryKey));
|
|
95
|
+
const localDoneKeys = new Set(this.statuses.filter((s) => s.type === "local" && (s.status === "built" || s.status === "error")).map((s) => s.dictionaryKey));
|
|
96
|
+
const remoteKeys = new Set(this.statuses.filter((s) => s.type === "remote").map((s) => s.dictionaryKey));
|
|
97
|
+
const remoteDoneKeys = new Set(this.statuses.filter((s) => s.type === "remote" && (s.status === "fetched" || s.status === "imported" || s.status === "error")).map((s) => s.dictionaryKey));
|
|
98
|
+
return {
|
|
99
|
+
localTotal: localKeys.size,
|
|
100
|
+
localDone: localDoneKeys.size,
|
|
101
|
+
remoteTotal: remoteKeys.size,
|
|
102
|
+
remoteDone: remoteDoneKeys.size
|
|
103
|
+
};
|
|
104
|
+
}
|
|
9
105
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var log_exports = {};
|
|
20
|
-
__export(log_exports, {
|
|
21
|
-
DictionariesLogger: () => DictionariesLogger
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(log_exports);
|
|
24
|
-
var import_config = require("@intlayer/config");
|
|
25
|
-
var import_extractErrorMessage = require('../utils/extractErrorMessage.cjs');
|
|
26
|
-
class DictionariesLogger {
|
|
27
|
-
statuses = [];
|
|
28
|
-
spinnerTimer = null;
|
|
29
|
-
spinnerIndex = 0;
|
|
30
|
-
renderedLines = 0;
|
|
31
|
-
spinnerFrames = import_config.spinnerFrames;
|
|
32
|
-
isFinished = false;
|
|
33
|
-
prefix;
|
|
34
|
-
lastRenderedState = "";
|
|
35
|
-
remoteCheckInProgress = false;
|
|
36
|
-
expectRemote = false;
|
|
37
|
-
remoteError;
|
|
38
|
-
constructor() {
|
|
39
|
-
const configuration = (0, import_config.getConfiguration)();
|
|
40
|
-
this.prefix = configuration.log.prefix;
|
|
41
|
-
}
|
|
42
|
-
setExpectRemote(expect) {
|
|
43
|
-
this.expectRemote = expect;
|
|
44
|
-
}
|
|
45
|
-
startRemoteCheck() {
|
|
46
|
-
if (this.isFinished) return;
|
|
47
|
-
this.remoteCheckInProgress = true;
|
|
48
|
-
this.startSpinner();
|
|
49
|
-
this.render();
|
|
50
|
-
}
|
|
51
|
-
stopRemoteCheck() {
|
|
52
|
-
this.remoteCheckInProgress = false;
|
|
53
|
-
}
|
|
54
|
-
update(newStatuses) {
|
|
55
|
-
if (this.isFinished) return;
|
|
56
|
-
for (const status of newStatuses) {
|
|
57
|
-
const index = this.statuses.findIndex(
|
|
58
|
-
(s) => s.dictionaryKey === status.dictionaryKey && s.type === status.type
|
|
59
|
-
);
|
|
60
|
-
if (index >= 0) {
|
|
61
|
-
this.statuses[index] = status;
|
|
62
|
-
} else {
|
|
63
|
-
this.statuses.push(status);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const { remoteTotal } = this.computeProgress();
|
|
67
|
-
if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
this.startSpinner();
|
|
71
|
-
this.render();
|
|
72
|
-
}
|
|
73
|
-
finish() {
|
|
74
|
-
this.isFinished = true;
|
|
75
|
-
this.stopSpinner();
|
|
76
|
-
this.render();
|
|
77
|
-
}
|
|
78
|
-
startSpinner() {
|
|
79
|
-
if (this.spinnerTimer || this.isFinished) return;
|
|
80
|
-
this.spinnerTimer = setInterval(() => {
|
|
81
|
-
this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;
|
|
82
|
-
this.render();
|
|
83
|
-
}, 100);
|
|
84
|
-
}
|
|
85
|
-
stopSpinner() {
|
|
86
|
-
if (!this.spinnerTimer) return;
|
|
87
|
-
clearInterval(this.spinnerTimer);
|
|
88
|
-
this.spinnerTimer = null;
|
|
89
|
-
}
|
|
90
|
-
setRemoteError = (error) => {
|
|
91
|
-
this.remoteError = (0, import_extractErrorMessage.extractErrorMessage)(error);
|
|
92
|
-
this.stopRemoteCheck();
|
|
93
|
-
this.render();
|
|
94
|
-
};
|
|
95
|
-
render() {
|
|
96
|
-
const { localTotal, localDone, remoteTotal, remoteDone } = this.computeProgress();
|
|
97
|
-
const frame = this.spinnerFrames[this.spinnerIndex];
|
|
98
|
-
const clock = (0, import_config.colorize)(frame, import_config.ANSIColors.BLUE);
|
|
99
|
-
const lines = [];
|
|
100
|
-
const isLocalDone = localDone === localTotal;
|
|
101
|
-
const isRemoteDone = remoteDone === remoteTotal;
|
|
102
|
-
const suppressLocalWhileCheckingRemote = this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;
|
|
103
|
-
if (!suppressLocalWhileCheckingRemote) {
|
|
104
|
-
if (isLocalDone) {
|
|
105
|
-
lines.push(
|
|
106
|
-
`${this.prefix} ${import_config.v} Local content: ${(0, import_config.colorize)(`${localDone}`, import_config.ANSIColors.GREEN)}${(0, import_config.colorize)(`/${localTotal}`, import_config.ANSIColors.GREY)}`
|
|
107
|
-
);
|
|
108
|
-
} else {
|
|
109
|
-
lines.push(
|
|
110
|
-
`${this.prefix} ${clock} Local content: ${(0, import_config.colorize)(`${localDone}`, import_config.ANSIColors.BLUE)}${(0, import_config.colorize)(`/${localTotal}`, import_config.ANSIColors.GREY)}`
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {
|
|
115
|
-
if (this.remoteError) {
|
|
116
|
-
lines.push(
|
|
117
|
-
`${this.prefix} ${import_config.x} Remote content: ${(0, import_config.colorize)(
|
|
118
|
-
this.remoteError,
|
|
119
|
-
import_config.ANSIColors.RED
|
|
120
|
-
)}`
|
|
121
|
-
);
|
|
122
|
-
} else if (remoteTotal === 0) {
|
|
123
|
-
lines.push(
|
|
124
|
-
`${this.prefix} ${clock} Remote content: ${(0, import_config.colorize)("Check server", import_config.ANSIColors.BLUE)}`
|
|
125
|
-
);
|
|
126
|
-
} else if (isRemoteDone) {
|
|
127
|
-
lines.push(
|
|
128
|
-
`${this.prefix} ${import_config.v} Remote content: ${(0, import_config.colorize)(`${remoteDone}`, import_config.ANSIColors.GREEN)}${(0, import_config.colorize)(`/${remoteTotal}`, import_config.ANSIColors.GREY)}`
|
|
129
|
-
);
|
|
130
|
-
} else {
|
|
131
|
-
lines.push(
|
|
132
|
-
`${this.prefix} ${clock} Remote content: ${(0, import_config.colorize)(`${remoteDone}`, import_config.ANSIColors.BLUE)}${(0, import_config.colorize)(`/${remoteTotal}`, import_config.ANSIColors.GREY)}`
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
const currentState = lines.join("\n");
|
|
137
|
-
if (currentState === this.lastRenderedState) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
this.lastRenderedState = currentState;
|
|
141
|
-
if (this.renderedLines > 0) {
|
|
142
|
-
process.stdout.write(`\x1B[${this.renderedLines}F`);
|
|
143
|
-
}
|
|
144
|
-
const totalLinesToClear = Math.max(this.renderedLines, lines.length);
|
|
145
|
-
for (let i = 0; i < totalLinesToClear; i++) {
|
|
146
|
-
process.stdout.write("\x1B[2K");
|
|
147
|
-
const line = lines[i];
|
|
148
|
-
if (line !== void 0) {
|
|
149
|
-
process.stdout.write(line);
|
|
150
|
-
}
|
|
151
|
-
process.stdout.write("\n");
|
|
152
|
-
}
|
|
153
|
-
this.renderedLines = lines.length;
|
|
154
|
-
}
|
|
155
|
-
computeProgress() {
|
|
156
|
-
const localKeys = new Set(
|
|
157
|
-
this.statuses.filter((s) => s.type === "local").map((s) => s.dictionaryKey)
|
|
158
|
-
);
|
|
159
|
-
const localDoneKeys = new Set(
|
|
160
|
-
this.statuses.filter(
|
|
161
|
-
(s) => s.type === "local" && (s.status === "built" || s.status === "error")
|
|
162
|
-
).map((s) => s.dictionaryKey)
|
|
163
|
-
);
|
|
164
|
-
const remoteKeys = new Set(
|
|
165
|
-
this.statuses.filter((s) => s.type === "remote").map((s) => s.dictionaryKey)
|
|
166
|
-
);
|
|
167
|
-
const remoteDoneKeys = new Set(
|
|
168
|
-
this.statuses.filter(
|
|
169
|
-
(s) => s.type === "remote" && (s.status === "fetched" || s.status === "imported" || s.status === "error")
|
|
170
|
-
).map((s) => s.dictionaryKey)
|
|
171
|
-
);
|
|
172
|
-
return {
|
|
173
|
-
localTotal: localKeys.size,
|
|
174
|
-
localDone: localDoneKeys.size,
|
|
175
|
-
remoteTotal: remoteKeys.size,
|
|
176
|
-
remoteDone: remoteDoneKeys.size
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
181
|
-
0 && (module.exports = {
|
|
182
|
-
DictionariesLogger
|
|
183
|
-
});
|
|
106
|
+
|
|
107
|
+
//#endregion
|
|
108
|
+
exports.DictionariesLogger = DictionariesLogger;
|
|
184
109
|
//# sourceMappingURL=log.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n getConfiguration,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config';\nimport { extractErrorMessage } from '../utils/extractErrorMessage';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n\n constructor() {\n const configuration = getConfiguration();\n this.prefix = configuration.log.prefix;\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n private render() {\n const { localTotal, localDone, remoteTotal, remoteDone } =\n this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n } as const;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAOO;AACP,iCAAoC;AAG7B,MAAM,mBAAmB;AAAA,EACtB,WAAiC,CAAC;AAAA,EAClC,eAAsC;AAAA,EACtC,eAAe;AAAA,EACf,gBAAgB;AAAA,EACP,gBAAgB;AAAA,EACzB,aAAa;AAAA,EACJ;AAAA,EACT,oBAA4B;AAAA,EAC5B,wBAAwB;AAAA,EACxB,eAAe;AAAA,EACf;AAAA,EAER,cAAc;AACZ,UAAM,oBAAgB,gCAAiB;AACvC,SAAK,SAAS,cAAc,IAAI;AAAA,EAClC;AAAA,EAEA,gBAAgB,QAAiB;AAC/B,SAAK,eAAe;AAAA,EACtB;AAAA,EAEA,mB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EAAE,WAAW,cACb,EAAE,WAAW;AAAA,MACnB,EACC,IAAI,CAAC,MAAM,EAAE,aAAa;AAAA,IAC/B;AAEA,WAAO;AAAA,MACL,YAAY,UAAU;AAAA,MACtB,WAAW,cAAc;AAAA,MACzB,aAAa,WAAW;AAAA,MACxB,YAAY,eAAe;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"file":"log.cjs","names":["spinnerFrames","ANSIColors","lines: string[]","v","x"],"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import {\n ANSIColors,\n colorize,\n extractErrorMessage,\n getConfiguration,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n\n constructor() {\n const configuration = getConfiguration();\n this.prefix = configuration.log.prefix;\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n private render() {\n const { localTotal, localDone, remoteTotal, remoteDone } =\n this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n } as const;\n }\n}\n"],"mappings":";;;;;AAWA,IAAa,qBAAb,MAAgC;CAC9B,AAAQ,WAAiC,EAAE;CAC3C,AAAQ,eAAsC;CAC9C,AAAQ,eAAe;CACvB,AAAQ,gBAAgB;CACxB,AAAiB,gBAAgBA;CACjC,AAAQ,aAAa;CACrB,AAAiB;CACjB,AAAQ,oB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