@intlayer/chokidar 6.1.6 → 7.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cjs → 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,167 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var listGitFiles_exports = {};
|
|
30
|
-
__export(listGitFiles_exports, {
|
|
31
|
-
listGitFiles: () => listGitFiles,
|
|
32
|
-
listGitLines: () => listGitLines
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(listGitFiles_exports);
|
|
35
|
-
var import_config = require("@intlayer/config");
|
|
36
|
-
var import_built = __toESM(require("@intlayer/config/built"));
|
|
37
|
-
var import_fs = require("fs");
|
|
38
|
-
var import_path = require("path");
|
|
39
|
-
var import_simple_git = __toESM(require("simple-git"));
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let node_fs = require("node:fs");
|
|
3
|
+
node_fs = require_rolldown_runtime.__toESM(node_fs);
|
|
4
|
+
let __intlayer_config = require("@intlayer/config");
|
|
5
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
6
|
+
let node_path = require("node:path");
|
|
7
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
8
|
+
let __intlayer_config_built = require("@intlayer/config/built");
|
|
9
|
+
__intlayer_config_built = require_rolldown_runtime.__toESM(__intlayer_config_built);
|
|
10
|
+
let simple_git = require("simple-git");
|
|
11
|
+
simple_git = require_rolldown_runtime.__toESM(simple_git);
|
|
12
|
+
|
|
13
|
+
//#region src/listGitFiles.ts
|
|
40
14
|
const getGitRootDir = async () => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
appLogger("Error getting git root directory:" + error, {
|
|
48
|
-
level: "error"
|
|
49
|
-
});
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
15
|
+
try {
|
|
16
|
+
return (await (0, simple_git.default)().revparse(["--show-toplevel"])).trim();
|
|
17
|
+
} catch (error) {
|
|
18
|
+
(0, __intlayer_config.getAppLogger)(__intlayer_config_built.default)(`Error getting git root directory: ${error}`, { level: "error" });
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
52
21
|
};
|
|
53
|
-
const listGitFiles = async ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}) =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const unpushedDiff = await git.diff(["--name-only", "@{push}...HEAD"]);
|
|
74
|
-
const unpushedFiles = unpushedDiff.split("\n").filter(Boolean);
|
|
75
|
-
unpushedFiles.forEach((file) => diff.add(file));
|
|
76
|
-
}
|
|
77
|
-
if (mode.includes("gitDiff")) {
|
|
78
|
-
await git.fetch(baseRef);
|
|
79
|
-
const diffBranch = await git.diff([
|
|
80
|
-
"--name-only",
|
|
81
|
-
`${baseRef}...${currentRef}`
|
|
82
|
-
]);
|
|
83
|
-
const gitDiffFiles = diffBranch.split("\n").filter(Boolean);
|
|
84
|
-
gitDiffFiles.forEach((file) => diff.add(file));
|
|
85
|
-
}
|
|
86
|
-
if (absolute) {
|
|
87
|
-
const gitRootDir = await getGitRootDir();
|
|
88
|
-
if (!gitRootDir) {
|
|
89
|
-
return [];
|
|
90
|
-
}
|
|
91
|
-
return Array.from(diff).map((file) => (0, import_path.join)(gitRootDir, file));
|
|
92
|
-
}
|
|
93
|
-
return Array.from(diff);
|
|
94
|
-
} catch (error) {
|
|
95
|
-
console.warn("Failed to get changes list:", error);
|
|
96
|
-
}
|
|
22
|
+
const listGitFiles = async ({ mode, baseRef = "origin/main", currentRef = "HEAD", absolute = true }) => {
|
|
23
|
+
try {
|
|
24
|
+
const git = (0, simple_git.default)();
|
|
25
|
+
const diff = /* @__PURE__ */ new Set();
|
|
26
|
+
if (mode.includes("untracked")) (await git.status()).not_added.forEach((f) => diff.add(f));
|
|
27
|
+
if (mode.includes("uncommitted")) (await git.diff(["--name-only", "HEAD"])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
28
|
+
if (mode.includes("unpushed")) (await git.diff(["--name-only", "@{push}...HEAD"])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
29
|
+
if (mode.includes("gitDiff")) {
|
|
30
|
+
await git.fetch(baseRef);
|
|
31
|
+
(await git.diff(["--name-only", `${baseRef}...${currentRef}`])).split("\n").filter(Boolean).forEach((file) => diff.add(file));
|
|
32
|
+
}
|
|
33
|
+
if (absolute) {
|
|
34
|
+
const gitRootDir = await getGitRootDir();
|
|
35
|
+
if (!gitRootDir) return [];
|
|
36
|
+
return Array.from(diff).map((file) => (0, node_path.join)(gitRootDir, file));
|
|
37
|
+
}
|
|
38
|
+
return Array.from(diff);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.warn("Failed to get changes list:", error);
|
|
41
|
+
}
|
|
97
42
|
};
|
|
98
|
-
const listGitLines = async (filePath, {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
collectLinesFromDiff(diffOutput);
|
|
149
|
-
}
|
|
150
|
-
if (mode.includes("gitDiff")) {
|
|
151
|
-
await git.fetch(baseRef);
|
|
152
|
-
const diffOutput = await git.diff([
|
|
153
|
-
"--unified=0",
|
|
154
|
-
`${baseRef}...${currentRef}`,
|
|
155
|
-
"--",
|
|
156
|
-
filePath
|
|
157
|
-
]);
|
|
158
|
-
collectLinesFromDiff(diffOutput);
|
|
159
|
-
}
|
|
160
|
-
return Array.from(changedLines).sort((a, b) => a - b);
|
|
43
|
+
const listGitLines = async (filePath, { mode, baseRef = "origin/main", currentRef = "HEAD" }) => {
|
|
44
|
+
const git = (0, simple_git.default)();
|
|
45
|
+
const changedLines = /* @__PURE__ */ new Set();
|
|
46
|
+
/**
|
|
47
|
+
* Extracts line numbers from a diff generated with `--unified=0`.
|
|
48
|
+
* Each hunk header looks like: @@ -<oldStart>,<oldCount> +<newStart>,<newCount> @@
|
|
49
|
+
* We consider both the "+" (new) side for additions and the "-" (old) side for deletions.
|
|
50
|
+
* For deletions, we add the line before and after the deletion point in the current file.
|
|
51
|
+
*/
|
|
52
|
+
const collectLinesFromDiff = (diffOutput) => {
|
|
53
|
+
const hunkRegex = /@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/g;
|
|
54
|
+
let match;
|
|
55
|
+
while ((match = hunkRegex.exec(diffOutput)) !== null) {
|
|
56
|
+
const oldCount = match[2] ? Number(match[2]) : 1;
|
|
57
|
+
const newStart = Number(match[3]);
|
|
58
|
+
const newCount = match[4] ? Number(match[4]) : 1;
|
|
59
|
+
if (newCount > 0) for (let i = 0; i < newCount; i++) changedLines.add(newStart + i);
|
|
60
|
+
if (oldCount > 0 && newCount === 0) {
|
|
61
|
+
if (newStart > 1) changedLines.add(newStart - 1);
|
|
62
|
+
changedLines.add(newStart);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
if (mode.includes("untracked")) {
|
|
67
|
+
if ((await git.status()).not_added.includes(filePath)) try {
|
|
68
|
+
(0, node_fs.readFileSync)(filePath, "utf-8").split("\n").forEach((_, idx) => changedLines.add(idx + 1));
|
|
69
|
+
} catch {}
|
|
70
|
+
}
|
|
71
|
+
if (mode.includes("uncommitted")) collectLinesFromDiff(await git.diff([
|
|
72
|
+
"--unified=0",
|
|
73
|
+
"HEAD",
|
|
74
|
+
"--",
|
|
75
|
+
filePath
|
|
76
|
+
]));
|
|
77
|
+
if (mode.includes("unpushed")) collectLinesFromDiff(await git.diff([
|
|
78
|
+
"--unified=0",
|
|
79
|
+
"@{push}...HEAD",
|
|
80
|
+
"--",
|
|
81
|
+
filePath
|
|
82
|
+
]));
|
|
83
|
+
if (mode.includes("gitDiff")) {
|
|
84
|
+
await git.fetch(baseRef);
|
|
85
|
+
collectLinesFromDiff(await git.diff([
|
|
86
|
+
"--unified=0",
|
|
87
|
+
`${baseRef}...${currentRef}`,
|
|
88
|
+
"--",
|
|
89
|
+
filePath
|
|
90
|
+
]));
|
|
91
|
+
}
|
|
92
|
+
return Array.from(changedLines).sort((a, b) => a - b);
|
|
161
93
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
});
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.listGitFiles = listGitFiles;
|
|
97
|
+
exports.listGitLines = listGitLines;
|
|
167
98
|
//# sourceMappingURL=listGitFiles.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/listGitFiles.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"listGitFiles.cjs","names":["configuration","diff: Set<string>","changedLines: Set<number>","match: RegExpExecArray | null"],"sources":["../../src/listGitFiles.ts"],"sourcesContent":["import { readFileSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { getAppLogger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport simpleGit from 'simple-git';\n\nexport type DiffMode = 'gitDiff' | 'uncommitted' | 'unpushed' | 'untracked';\n\nconst getGitRootDir = async (): Promise<string | null> => {\n try {\n const git = simpleGit();\n const rootDir = await git.revparse(['--show-toplevel']);\n return rootDir.trim();\n } catch (error) {\n const appLogger = getAppLogger(configuration);\n appLogger(`Error getting git root directory: ${error}`, {\n level: 'error',\n });\n return null;\n }\n};\n\nexport type ListGitFilesOptions = {\n mode: DiffMode[];\n baseRef?: string;\n currentRef?: string;\n absolute?: boolean;\n};\n\nexport const listGitFiles = async ({\n mode,\n baseRef = 'origin/main',\n currentRef = 'HEAD', // HEAD points to the current branch's latest commit\n absolute = true,\n}: ListGitFilesOptions) => {\n try {\n const git = simpleGit();\n const diff: Set<string> = new Set();\n\n if (mode.includes('untracked')) {\n const status = await git.status();\n status.not_added.forEach((f) => diff.add(f));\n }\n\n if (mode.includes('uncommitted')) {\n // Get uncommitted changes\n const uncommittedDiff = await git.diff(['--name-only', 'HEAD']);\n\n const uncommittedFiles = uncommittedDiff.split('\\n').filter(Boolean);\n\n uncommittedFiles.forEach((file) => diff.add(file));\n }\n\n if (mode.includes('unpushed')) {\n // Get unpushed commits\n const unpushedDiff = await git.diff(['--name-only', '@{push}...HEAD']);\n\n const unpushedFiles = unpushedDiff.split('\\n').filter(Boolean);\n\n unpushedFiles.forEach((file) => diff.add(file));\n }\n\n if (mode.includes('gitDiff')) {\n // Get the base branch (usually main/master) from CI environment\n\n await git.fetch(baseRef);\n\n const diffBranch = await git.diff([\n '--name-only',\n `${baseRef}...${currentRef}`,\n ]);\n\n const gitDiffFiles = diffBranch.split('\\n').filter(Boolean);\n\n gitDiffFiles.forEach((file) => diff.add(file));\n }\n\n if (absolute) {\n const gitRootDir = await getGitRootDir();\n if (!gitRootDir) {\n return [];\n }\n return Array.from(diff).map((file) => join(gitRootDir, file));\n }\n\n return Array.from(diff);\n } catch (error) {\n console.warn('Failed to get changes list:', error);\n }\n};\n\nexport type ListGitLinesOptions = {\n mode: DiffMode[];\n baseRef?: string;\n currentRef?: string;\n};\n\nexport const listGitLines = async (\n filePath: string,\n {\n mode,\n baseRef = 'origin/main',\n currentRef = 'HEAD', // HEAD points to the current branch's latest commit\n }: ListGitLinesOptions\n): Promise<number[]> => {\n const git = simpleGit();\n // We collect **line numbers** (1-based) that were modified/added by the diff.\n // Using a Set ensures uniqueness when the same line is reported by several modes.\n const changedLines: Set<number> = new Set();\n\n /**\n * Extracts line numbers from a diff generated with `--unified=0`.\n * Each hunk header looks like: @@ -<oldStart>,<oldCount> +<newStart>,<newCount> @@\n * We consider both the \"+\" (new) side for additions and the \"-\" (old) side for deletions.\n * For deletions, we add the line before and after the deletion point in the current file.\n */\n const collectLinesFromDiff = (diffOutput: string) => {\n const hunkRegex = /@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/g;\n let match: RegExpExecArray | null;\n\n while ((match = hunkRegex.exec(diffOutput)) !== null) {\n const oldCount = match[2] ? Number(match[2]) : 1;\n const newStart = Number(match[3]);\n const newCount = match[4] ? Number(match[4]) : 1;\n\n // Handle additions/modifications (+ side)\n if (newCount > 0) {\n for (let i = 0; i < newCount; i++) {\n changedLines.add(newStart + i);\n }\n }\n\n // Handle deletions (- side)\n if (oldCount > 0 && newCount === 0) {\n // For deletions, add the line before and after the deletion point\n // The deletion point in the new file is at newStart\n if (newStart > 1) {\n changedLines.add(newStart - 1); // Line before deletion\n }\n changedLines.add(newStart); // Line after deletion (if it exists)\n }\n }\n };\n\n // 1. Handle untracked files – when a file is untracked its entire content is new.\n if (mode.includes('untracked')) {\n const status = await git.status();\n const isUntracked = status.not_added.includes(filePath);\n if (isUntracked) {\n try {\n const content = readFileSync(filePath, 'utf-8');\n content.split('\\n').forEach((_, idx) => changedLines.add(idx + 1));\n } catch {\n // ignore read errors – file may have been deleted, etc.\n }\n }\n }\n\n // 2. Uncommitted changes (working tree vs HEAD)\n if (mode.includes('uncommitted')) {\n const diffOutput = await git.diff(['--unified=0', 'HEAD', '--', filePath]);\n collectLinesFromDiff(diffOutput);\n }\n\n // 3. Unpushed commits – compare local branch to its upstream\n if (mode.includes('unpushed')) {\n const diffOutput = await git.diff([\n '--unified=0',\n '@{push}...HEAD',\n '--',\n filePath,\n ]);\n collectLinesFromDiff(diffOutput);\n }\n\n // 4. Regular git diff between baseRef and currentRef (e.g., CI pull-request diff)\n if (mode.includes('gitDiff')) {\n await git.fetch(baseRef);\n const diffOutput = await git.diff([\n '--unified=0',\n `${baseRef}...${currentRef}`,\n '--',\n filePath,\n ]);\n collectLinesFromDiff(diffOutput);\n }\n\n // Return the list sorted for convenience\n return Array.from(changedLines).sort((a, b) => a - b);\n};\n"],"mappings":";;;;;;;;;;;;;AAQA,MAAM,gBAAgB,YAAoC;AACxD,KAAI;AAGF,UADgB,+BADO,CACG,SAAS,CAAC,kBAAkB,CAAC,EACxC,MAAM;UACd,OAAO;AAEd,sCAD+BA,gCAAc,CACnC,qCAAqC,SAAS,EACtD,OAAO,SACR,CAAC;AACF,SAAO;;;AAWX,MAAa,eAAe,OAAO,EACjC,MACA,UAAU,eACV,aAAa,QACb,WAAW,WACc;AACzB,KAAI;EACF,MAAM,+BAAiB;EACvB,MAAMC,uBAAoB,IAAI,KAAK;AAEnC,MAAI,KAAK,SAAS,YAAY,CAE5B,EADe,MAAM,IAAI,QAAQ,EAC1B,UAAU,SAAS,MAAM,KAAK,IAAI,EAAE,CAAC;AAG9C,MAAI,KAAK,SAAS,cAAc,CAM9B,EAJwB,MAAM,IAAI,KAAK,CAAC,eAAe,OAAO,CAAC,EAEtB,MAAM,KAAK,CAAC,OAAO,QAAQ,CAEnD,SAAS,SAAS,KAAK,IAAI,KAAK,CAAC;AAGpD,MAAI,KAAK,SAAS,WAAW,CAM3B,EAJqB,MAAM,IAAI,KAAK,CAAC,eAAe,iBAAiB,CAAC,EAEnC,MAAM,KAAK,CAAC,OAAO,QAAQ,CAEhD,SAAS,SAAS,KAAK,IAAI,KAAK,CAAC;AAGjD,MAAI,KAAK,SAAS,UAAU,EAAE;AAG5B,SAAM,IAAI,MAAM,QAAQ;AASxB,IAPmB,MAAM,IAAI,KAAK,CAChC,eACA,GAAG,QAAQ,KAAK,aACjB,CAAC,EAE8B,MAAM,KAAK,CAAC,OAAO,QAAQ,CAE9C,SAAS,SAAS,KAAK,IAAI,KAAK,CAAC;;AAGhD,MAAI,UAAU;GACZ,MAAM,aAAa,MAAM,eAAe;AACxC,OAAI,CAAC,WACH,QAAO,EAAE;AAEX,UAAO,MAAM,KAAK,KAAK,CAAC,KAAK,6BAAc,YAAY,KAAK,CAAC;;AAG/D,SAAO,MAAM,KAAK,KAAK;UAChB,OAAO;AACd,UAAQ,KAAK,+BAA+B,MAAM;;;AAUtD,MAAa,eAAe,OAC1B,UACA,EACE,MACA,UAAU,eACV,aAAa,aAEO;CACtB,MAAM,+BAAiB;CAGvB,MAAMC,+BAA4B,IAAI,KAAK;;;;;;;CAQ3C,MAAM,wBAAwB,eAAuB;EACnD,MAAM,YAAY;EAClB,IAAIC;AAEJ,UAAQ,QAAQ,UAAU,KAAK,WAAW,MAAM,MAAM;GACpD,MAAM,WAAW,MAAM,KAAK,OAAO,MAAM,GAAG,GAAG;GAC/C,MAAM,WAAW,OAAO,MAAM,GAAG;GACjC,MAAM,WAAW,MAAM,KAAK,OAAO,MAAM,GAAG,GAAG;AAG/C,OAAI,WAAW,EACb,MAAK,IAAI,IAAI,GAAG,IAAI,UAAU,IAC5B,cAAa,IAAI,WAAW,EAAE;AAKlC,OAAI,WAAW,KAAK,aAAa,GAAG;AAGlC,QAAI,WAAW,EACb,cAAa,IAAI,WAAW,EAAE;AAEhC,iBAAa,IAAI,SAAS;;;;AAMhC,KAAI,KAAK,SAAS,YAAY,EAG5B;OAFe,MAAM,IAAI,QAAQ,EACN,UAAU,SAAS,SAAS,CAErD,KAAI;AAEF,6BAD6B,UAAU,QAAQ,CACvC,MAAM,KAAK,CAAC,SAAS,GAAG,QAAQ,aAAa,IAAI,MAAM,EAAE,CAAC;UAC5D;;AAOZ,KAAI,KAAK,SAAS,cAAc,CAE9B,sBADmB,MAAM,IAAI,KAAK;EAAC;EAAe;EAAQ;EAAM;EAAS,CAAC,CAC1C;AAIlC,KAAI,KAAK,SAAS,WAAW,CAO3B,sBANmB,MAAM,IAAI,KAAK;EAChC;EACA;EACA;EACA;EACD,CAAC,CAC8B;AAIlC,KAAI,KAAK,SAAS,UAAU,EAAE;AAC5B,QAAM,IAAI,MAAM,QAAQ;AAOxB,uBANmB,MAAM,IAAI,KAAK;GAChC;GACA,GAAG,QAAQ,KAAK;GAChB;GACA;GACD,CAAC,CAC8B;;AAIlC,QAAO,MAAM,KAAK,aAAa,CAAC,MAAM,GAAG,MAAM,IAAI,EAAE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
let node_path = require("node:path");
|
|
5
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
7
|
+
node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises);
|
|
8
|
+
let node_module = require("node:module");
|
|
9
|
+
node_module = require_rolldown_runtime.__toESM(node_module);
|
|
10
|
+
|
|
11
|
+
//#region src/loadDictionaries/getIntlayerBundle.ts
|
|
12
|
+
/**
|
|
13
|
+
* Rewrites selected bare specifiers (and any of their subpaths) to absolute file paths,
|
|
14
|
+
* using the provided localeRequire (either createRequire(import.meta.url) or require).
|
|
15
|
+
*
|
|
16
|
+
* Example:
|
|
17
|
+
* rewritePathsPlugin(["@intlayer/config", "@intlayer/core"], localeRequire)
|
|
18
|
+
* …will also rewrite "@intlayer/core/file" etc.
|
|
19
|
+
*/
|
|
20
|
+
const rewritePathsPlugin = (replaceModules, excludeModules) => {
|
|
21
|
+
return {
|
|
22
|
+
name: "rewrite-paths",
|
|
23
|
+
setup(build) {
|
|
24
|
+
build.onResolve({ filter: /.*/ }, (args) => {
|
|
25
|
+
const exact = replaceModules[args.path];
|
|
26
|
+
if (excludeModules?.includes(args.path)) return null;
|
|
27
|
+
if (exact) return {
|
|
28
|
+
path: exact,
|
|
29
|
+
namespace: "intlayer-replace-modules",
|
|
30
|
+
external: true
|
|
31
|
+
};
|
|
32
|
+
for (const key of Object.keys(replaceModules)) if (args.path === key || args.path.startsWith(`${key}/`)) {
|
|
33
|
+
const sub = args.path.slice(key.length);
|
|
34
|
+
return {
|
|
35
|
+
path: replaceModules[key] + sub,
|
|
36
|
+
namespace: "intlayer-replace-modules",
|
|
37
|
+
external: true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Get the intlayer bundle to embed @intlayer/core and be able to mock @intlayer/config/built to mock the configuration file.
|
|
46
|
+
*/
|
|
47
|
+
const getIntlayerBundle = async (configuration) => {
|
|
48
|
+
const rootRequire = __intlayer_config.ESMxCJSRequire;
|
|
49
|
+
const configPackageRequire = __intlayer_config.configESMxCJSRequire;
|
|
50
|
+
const localRequire = __intlayer_config.isESModule ? (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href) : require;
|
|
51
|
+
const configurationPath = (0, node_path.join)(configuration.content.configDir, `configuration.json`);
|
|
52
|
+
const replaceModules = {
|
|
53
|
+
deepmerge: localRequire.resolve("deepmerge"),
|
|
54
|
+
esbuild: configPackageRequire.resolve("esbuild"),
|
|
55
|
+
"@intlayer/config/built": configurationPath,
|
|
56
|
+
"@intlayer/config": localRequire.resolve("@intlayer/config"),
|
|
57
|
+
"@intlayer/config/client": localRequire.resolve("@intlayer/config/client"),
|
|
58
|
+
"@intlayer/core/file": localRequire.resolve("@intlayer/core/file")
|
|
59
|
+
};
|
|
60
|
+
const filePath = rootRequire.resolve("intlayer");
|
|
61
|
+
return await (0, __intlayer_config.bundleFile)(await (0, node_fs_promises.readFile)(filePath, "utf-8"), filePath, {
|
|
62
|
+
external: [...node_module.builtinModules, ...node_module.builtinModules.map((mod) => `node:${mod}`)],
|
|
63
|
+
minify: true,
|
|
64
|
+
plugins: [rewritePathsPlugin(replaceModules)]
|
|
65
|
+
}) ?? "";
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
exports.getIntlayerBundle = getIntlayerBundle;
|
|
70
|
+
//# sourceMappingURL=getIntlayerBundle.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIntlayerBundle.cjs","names":["ESMxCJSRequire","configESMxCJSRequire","isESModule","builtinModules"],"sources":["../../../src/loadDictionaries/getIntlayerBundle.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises';\nimport { builtinModules, createRequire } from 'node:module';\nimport { join } from 'node:path';\nimport type { ESBuildPlugin } from '@intlayer/config';\nimport {\n bundleFile,\n configESMxCJSRequire,\n ESMxCJSRequire,\n isESModule,\n} from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\n\n/**\n * Rewrites selected bare specifiers (and any of their subpaths) to absolute file paths,\n * using the provided localeRequire (either createRequire(import.meta.url) or require).\n *\n * Example:\n * rewritePathsPlugin([\"@intlayer/config\", \"@intlayer/core\"], localeRequire)\n * …will also rewrite \"@intlayer/core/file\" etc.\n */\nconst rewritePathsPlugin = (\n replaceModules: Record<string, string>,\n excludeModules?: string[]\n): ESBuildPlugin => {\n return {\n name: 'rewrite-paths',\n setup(build) {\n build.onResolve({ filter: /.*/ }, (args) => {\n const exact = replaceModules[args.path];\n\n if (excludeModules?.includes(args.path)) {\n return null;\n }\n\n if (exact) {\n return {\n path: exact,\n namespace: 'intlayer-replace-modules',\n external: true, // ← prevents onLoad requirement\n };\n }\n\n // Optional: support subpaths like \"@intlayer/core/xyz\"\n for (const key of Object.keys(replaceModules)) {\n if (args.path === key || args.path.startsWith(`${key}/`)) {\n const sub = args.path.slice(key.length); // '' or '/...'\n return {\n path: replaceModules[key] + sub,\n namespace: 'intlayer-replace-modules',\n external: true, // ← prevents onLoad requirement\n };\n }\n }\n });\n },\n };\n};\n\n/**\n * Get the intlayer bundle to embed @intlayer/core and be able to mock @intlayer/config/built to mock the configuration file.\n */\nexport const getIntlayerBundle = async (configuration: IntlayerConfig) => {\n const rootRequire = ESMxCJSRequire;\n const configPackageRequire = configESMxCJSRequire;\n const localRequire = isESModule ? createRequire(import.meta.url) : require;\n\n const configurationPath = join(\n configuration.content.configDir,\n `configuration.json`\n );\n\n const replaceModules = {\n deepmerge: localRequire.resolve('deepmerge'),\n esbuild: configPackageRequire.resolve('esbuild'),\n '@intlayer/config/built': configurationPath,\n '@intlayer/config': localRequire.resolve('@intlayer/config'),\n '@intlayer/config/client': localRequire.resolve('@intlayer/config/client'),\n '@intlayer/core/file': localRequire.resolve('@intlayer/core/file'),\n };\n\n const filePath = rootRequire.resolve('intlayer');\n const code = await readFile(filePath, 'utf-8');\n\n const output = await bundleFile(code, filePath, {\n external: [\n ...builtinModules,\n ...builtinModules.map((mod) => `node:${mod}`),\n ],\n minify: true,\n plugins: [rewritePathsPlugin(replaceModules)],\n });\n\n return output ?? '';\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,MAAM,sBACJ,gBACA,mBACkB;AAClB,QAAO;EACL,MAAM;EACN,MAAM,OAAO;AACX,SAAM,UAAU,EAAE,QAAQ,MAAM,GAAG,SAAS;IAC1C,MAAM,QAAQ,eAAe,KAAK;AAElC,QAAI,gBAAgB,SAAS,KAAK,KAAK,CACrC,QAAO;AAGT,QAAI,MACF,QAAO;KACL,MAAM;KACN,WAAW;KACX,UAAU;KACX;AAIH,SAAK,MAAM,OAAO,OAAO,KAAK,eAAe,CAC3C,KAAI,KAAK,SAAS,OAAO,KAAK,KAAK,WAAW,GAAG,IAAI,GAAG,EAAE;KACxD,MAAM,MAAM,KAAK,KAAK,MAAM,IAAI,OAAO;AACvC,YAAO;MACL,MAAM,eAAe,OAAO;MAC5B,WAAW;MACX,UAAU;MACX;;KAGL;;EAEL;;;;;AAMH,MAAa,oBAAoB,OAAO,kBAAkC;CACxE,MAAM,cAAcA;CACpB,MAAM,uBAAuBC;CAC7B,MAAM,eAAeC,4GAA2C,GAAG;CAEnE,MAAM,wCACJ,cAAc,QAAQ,WACtB,qBACD;CAED,MAAM,iBAAiB;EACrB,WAAW,aAAa,QAAQ,YAAY;EAC5C,SAAS,qBAAqB,QAAQ,UAAU;EAChD,0BAA0B;EAC1B,oBAAoB,aAAa,QAAQ,mBAAmB;EAC5D,2BAA2B,aAAa,QAAQ,0BAA0B;EAC1E,uBAAuB,aAAa,QAAQ,sBAAsB;EACnE;CAED,MAAM,WAAW,YAAY,QAAQ,WAAW;AAYhD,QATe,wCAFF,qCAAe,UAAU,QAAQ,EAER,UAAU;EAC9C,UAAU,CACR,GAAGC,4BACH,GAAGA,2BAAe,KAAK,QAAQ,QAAQ,MAAM,CAC9C;EACD,QAAQ;EACR,SAAS,CAAC,mBAAmB,eAAe,CAAC;EAC9C,CAAC,IAEe"}
|
|
@@ -1,29 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var loadDictionaries_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(loadDictionaries_exports);
|
|
18
|
-
__reExport(loadDictionaries_exports, require('./loadContentDeclaration.cjs'), module.exports);
|
|
19
|
-
__reExport(loadDictionaries_exports, require('./loadDictionaries.cjs'), module.exports);
|
|
20
|
-
__reExport(loadDictionaries_exports, require('./loadLocalDictionaries.cjs'), module.exports);
|
|
21
|
-
__reExport(loadDictionaries_exports, require('./loadRemoteDictionaries.cjs'), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require('./loadContentDeclaration.cjs'),
|
|
25
|
-
...require('./loadDictionaries.cjs'),
|
|
26
|
-
...require('./loadLocalDictionaries.cjs'),
|
|
27
|
-
...require('./loadRemoteDictionaries.cjs')
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=index.cjs.map
|
|
1
|
+
const require_loadDictionaries_loadContentDeclaration = require('./loadContentDeclaration.cjs');
|
|
2
|
+
const require_loadDictionaries_loadLocalDictionaries = require('./loadLocalDictionaries.cjs');
|
|
3
|
+
const require_loadDictionaries_loadRemoteDictionaries = require('./loadRemoteDictionaries.cjs');
|
|
4
|
+
const require_loadDictionaries_loadDictionaries = require('./loadDictionaries.cjs');
|
|
5
|
+
|
|
6
|
+
exports.formatDistantDictionaries = require_loadDictionaries_loadRemoteDictionaries.formatDistantDictionaries;
|
|
7
|
+
exports.formatLocalDictionaries = require_loadDictionaries_loadContentDeclaration.formatLocalDictionaries;
|
|
8
|
+
exports.loadContentDeclarations = require_loadDictionaries_loadContentDeclaration.loadContentDeclarations;
|
|
9
|
+
exports.loadDictionaries = require_loadDictionaries_loadDictionaries.loadDictionaries;
|
|
10
|
+
exports.loadLocalDictionaries = require_loadDictionaries_loadLocalDictionaries.loadLocalDictionaries;
|
|
11
|
+
exports.loadRemoteDictionaries = require_loadDictionaries_loadRemoteDictionaries.loadRemoteDictionaries;
|
|
@@ -1,93 +1,71 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var loadContentDeclaration_exports = {};
|
|
20
|
-
__export(loadContentDeclaration_exports, {
|
|
21
|
-
formatLocalDictionaries: () => formatLocalDictionaries,
|
|
22
|
-
loadContentDeclarations: () => loadContentDeclarations
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(loadContentDeclaration_exports);
|
|
25
|
-
var import_config = require("@intlayer/config");
|
|
26
|
-
var import_path = require("path");
|
|
27
|
-
var import_processContentDeclaration = require('../buildIntlayerDictionary/processContentDeclaration.cjs');
|
|
28
|
-
var import_filterInvalidDictionaries = require('../filterInvalidDictionaries.cjs');
|
|
29
|
-
var import_parallelize = require('../utils/parallelize.cjs');
|
|
30
|
-
const formatLocalDictionaries = (dictionariesRecord, configuration) => Object.entries(dictionariesRecord).filter(([_relativePath, dict]) => (0, import_filterInvalidDictionaries.isInvalidDictionary)(dict, configuration)).map(([relativePath, dict]) => ({
|
|
31
|
-
...dict,
|
|
32
|
-
localId: `${dict.key}::local::${relativePath}`,
|
|
33
|
-
location: "locale",
|
|
34
|
-
filePath: relativePath
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_utils_parallelize = require('../utils/parallelize.cjs');
|
|
3
|
+
const require_filterInvalidDictionaries = require('../filterInvalidDictionaries.cjs');
|
|
4
|
+
const require_buildIntlayerDictionary_processContentDeclaration = require('../buildIntlayerDictionary/processContentDeclaration.cjs');
|
|
5
|
+
const require_loadDictionaries_getIntlayerBundle = require('./getIntlayerBundle.cjs');
|
|
6
|
+
let __intlayer_config = require("@intlayer/config");
|
|
7
|
+
__intlayer_config = require_rolldown_runtime.__toESM(__intlayer_config);
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
node_path = require_rolldown_runtime.__toESM(node_path);
|
|
10
|
+
let node_fs_promises = require("node:fs/promises");
|
|
11
|
+
node_fs_promises = require_rolldown_runtime.__toESM(node_fs_promises);
|
|
12
|
+
|
|
13
|
+
//#region src/loadDictionaries/loadContentDeclaration.ts
|
|
14
|
+
const formatLocalDictionaries = (dictionariesRecord, configuration) => Object.entries(dictionariesRecord).filter(([_relativePath, dict]) => require_filterInvalidDictionaries.isInvalidDictionary(dict, configuration)).map(([relativePath, dict]) => ({
|
|
15
|
+
...dict,
|
|
16
|
+
localId: `${dict.key}::local::${relativePath}`,
|
|
17
|
+
location: "local",
|
|
18
|
+
filePath: relativePath
|
|
35
19
|
}));
|
|
36
|
-
const loadContentDeclarations = async (contentDeclarationFilePath, configuration
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]);
|
|
83
|
-
return processedContentDeclaration;
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
return (0, import_filterInvalidDictionaries.filterInvalidDictionaries)(processedDictionaries);
|
|
20
|
+
const loadContentDeclarations = async (contentDeclarationFilePath, configuration, onStatusUpdate) => {
|
|
21
|
+
const { build, content } = configuration;
|
|
22
|
+
const { set, isValid } = (0, __intlayer_config.localCache)(configuration, ["intlayer-bundle"], { ttlMs: 1e3 * 60 * 60 * 24 * 5 });
|
|
23
|
+
const filePath = (0, node_path.join)(content.cacheDir, "intlayer-bundle.cjs");
|
|
24
|
+
if (!await isValid()) {
|
|
25
|
+
await (0, node_fs_promises.writeFile)(filePath, await require_loadDictionaries_getIntlayerBundle.getIntlayerBundle(configuration));
|
|
26
|
+
await set("ok");
|
|
27
|
+
}
|
|
28
|
+
try {
|
|
29
|
+
const dictionariesPromises = contentDeclarationFilePath.map(async (path) => {
|
|
30
|
+
return {
|
|
31
|
+
relativePath: (0, node_path.relative)(configuration.content.baseDir, path),
|
|
32
|
+
dictionary: await (0, __intlayer_config.loadExternalFile)(path, {
|
|
33
|
+
projectRequire: build.require,
|
|
34
|
+
buildOptions: { banner: { js: [`globalThis.INTLAYER_FILE_PATH = '${path}';`, `globalThis.INTLAYER_BASE_DIR = '${configuration.content.baseDir}';`].join("\n") } },
|
|
35
|
+
aliases: { intlayer: filePath }
|
|
36
|
+
})
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const contentDeclarations = formatLocalDictionaries((await Promise.all(dictionariesPromises)).reduce((acc, { relativePath, dictionary }) => {
|
|
40
|
+
acc[relativePath] = dictionary;
|
|
41
|
+
return acc;
|
|
42
|
+
}, {}), configuration);
|
|
43
|
+
const listFoundDictionaries = contentDeclarations.map((declaration) => ({
|
|
44
|
+
dictionaryKey: declaration.key,
|
|
45
|
+
type: "local",
|
|
46
|
+
status: "found"
|
|
47
|
+
}));
|
|
48
|
+
onStatusUpdate?.(listFoundDictionaries);
|
|
49
|
+
return require_filterInvalidDictionaries.filterInvalidDictionaries(await require_utils_parallelize.parallelize(contentDeclarations, async (contentDeclaration) => {
|
|
50
|
+
if (!contentDeclaration) return;
|
|
51
|
+
onStatusUpdate?.([{
|
|
52
|
+
dictionaryKey: contentDeclaration.key,
|
|
53
|
+
type: "local",
|
|
54
|
+
status: "building"
|
|
55
|
+
}]);
|
|
56
|
+
const processedContentDeclaration = await require_buildIntlayerDictionary_processContentDeclaration.processContentDeclaration(contentDeclaration);
|
|
57
|
+
if (!processedContentDeclaration) return;
|
|
58
|
+
onStatusUpdate?.([{
|
|
59
|
+
dictionaryKey: processedContentDeclaration.key,
|
|
60
|
+
type: "local",
|
|
61
|
+
status: "built"
|
|
62
|
+
}]);
|
|
63
|
+
return processedContentDeclaration;
|
|
64
|
+
}), configuration);
|
|
65
|
+
} finally {}
|
|
87
66
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
exports.formatLocalDictionaries = formatLocalDictionaries;
|
|
70
|
+
exports.loadContentDeclarations = loadContentDeclarations;
|
|
93
71
|
//# sourceMappingURL=loadContentDeclaration.cjs.map
|