@intlayer/chokidar 6.0.2 → 6.1.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/README.md +249 -66
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.cjs +18 -2
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.cjs +4 -4
- package/dist/cjs/buildIntlayerDictionary/index.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.cjs +3 -3
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.cjs +2 -2
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.cjs +4 -4
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.cjs +4 -4
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.cjs +4 -4
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -0
- package/dist/cjs/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.cjs +7 -7
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -0
- package/dist/cjs/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/index.cjs +35 -0
- package/dist/cjs/createDictionaryEntryPoint/index.cjs.map +1 -0
- package/dist/cjs/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.cjs +3 -3
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -0
- package/dist/cjs/{transpiler/dictionary_to_type → createType}/createType.cjs +1 -1
- package/dist/cjs/createType/createType.cjs.map +1 -0
- package/dist/cjs/{transpiler/dictionary_to_type → createType}/index.cjs +4 -4
- package/dist/cjs/createType/index.cjs.map +1 -0
- package/dist/cjs/filterInvalidDictionaries.cjs +32 -40
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +54 -0
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -0
- package/dist/cjs/handleContentDeclarationFileChange.cjs +59 -0
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -0
- package/dist/cjs/handleUnlikedContentDeclarationFile.cjs +57 -0
- package/dist/cjs/handleUnlikedContentDeclarationFile.cjs.map +1 -0
- package/dist/cjs/index.cjs +35 -12
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +6 -3
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +8 -4
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +10 -8
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +2 -2
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
- package/dist/cjs/utils/extractErrorMessage.cjs +22 -10
- package/dist/cjs/utils/extractErrorMessage.cjs.map +1 -1
- package/dist/cjs/utils/parallelize.cjs +139 -12
- package/dist/cjs/utils/parallelize.cjs.map +1 -1
- package/dist/cjs/utils/runParallel.cjs +77 -0
- package/dist/cjs/utils/runParallel.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +89 -0
- package/dist/cjs/watcher.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +770 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +46 -55
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +12 -288
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.mjs +18 -2
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/index.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.mjs +1 -1
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.mjs +3 -3
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.mjs +2 -2
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.mjs +4 -4
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.mjs +4 -4
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -0
- package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.mjs +4 -4
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -0
- package/dist/esm/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.mjs +7 -7
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -0
- package/dist/esm/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/index.mjs +8 -0
- package/dist/esm/createDictionaryEntryPoint/index.mjs.map +1 -0
- package/dist/esm/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.mjs +3 -3
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -0
- package/dist/esm/{transpiler/dictionary_to_type → createType}/createType.mjs +1 -1
- package/dist/esm/createType/createType.mjs.map +1 -0
- package/dist/esm/createType/index.mjs.map +1 -0
- package/dist/esm/filterInvalidDictionaries.mjs +29 -28
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +30 -0
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -0
- package/dist/esm/handleContentDeclarationFileChange.mjs +35 -0
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -0
- package/dist/esm/handleUnlikedContentDeclarationFile.mjs +33 -0
- package/dist/esm/handleUnlikedContentDeclarationFile.mjs.map +1 -0
- package/dist/esm/index.mjs +29 -14
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/listDictionariesPath.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +10 -4
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +12 -5
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +8 -9
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +2 -2
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
- package/dist/esm/utils/extractErrorMessage.mjs +22 -10
- package/dist/esm/utils/extractErrorMessage.mjs.map +1 -1
- package/dist/esm/utils/parallelize.mjs +137 -1
- package/dist/esm/utils/parallelize.mjs.map +1 -1
- package/dist/esm/utils/runParallel.mjs +43 -0
- package/dist/esm/utils/runParallel.mjs.map +1 -0
- package/dist/esm/watcher.mjs +67 -0
- package/dist/esm/watcher.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +751 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +47 -56
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +15 -279
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/buildIntlayerDictionary.d.ts +1 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/index.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -0
- package/dist/types/createDictionaryEntryPoint/index.d.ts.map +1 -0
- package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
- package/dist/types/createType/createType.d.ts.map +1 -0
- package/dist/types/createType/index.d.ts.map +1 -0
- package/dist/types/filterInvalidDictionaries.d.ts +3 -1
- package/dist/types/filterInvalidDictionaries.d.ts.map +1 -1
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts +3 -0
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -0
- package/dist/types/handleContentDeclarationFileChange.d.ts +3 -0
- package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -0
- package/dist/types/handleUnlikedContentDeclarationFile.d.ts +3 -0
- package/dist/types/handleUnlikedContentDeclarationFile.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/listDictionariesPath.d.ts +5 -0
- package/dist/types/listDictionariesPath.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +1 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +2 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +1 -1
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -1
- package/dist/types/utils/extractErrorMessage.d.ts.map +1 -1
- package/dist/types/utils/parallelize.d.ts +12 -0
- package/dist/types/utils/parallelize.d.ts.map +1 -1
- package/dist/types/utils/runParallel.d.ts +11 -0
- package/dist/types/utils/runParallel.d.ts.map +1 -0
- package/dist/types/watcher.d.ts +12 -0
- package/dist/types/watcher.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts +9 -0
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +3 -2
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
- package/package.json +22 -27
- package/dist/cjs/chokidar/index.cjs +0 -23
- package/dist/cjs/chokidar/index.cjs.map +0 -1
- package/dist/cjs/chokidar/watcher.cjs +0 -157
- package/dist/cjs/chokidar/watcher.cjs.map +0 -1
- package/dist/cjs/getBuiltDictionariesPath.cjs.map +0 -1
- package/dist/cjs/getBuiltDynamicDictionariesPath.cjs.map +0 -1
- package/dist/cjs/getBuiltFetchDictionariesPath.cjs.map +0 -1
- package/dist/cjs/getBuiltRemoteDictionariesPath.cjs.map +0 -1
- package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs.map +0 -1
- package/dist/cjs/reduceDictionaryContent/buildMask.cjs +0 -49
- package/dist/cjs/reduceDictionaryContent/buildMask.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_main/generateDictionaryListContent.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_main/index.cjs +0 -25
- package/dist/cjs/transpiler/dictionary_to_main/index.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createModuleAugmentation.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/createType.cjs.map +0 -1
- package/dist/cjs/transpiler/dictionary_to_type/index.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/buildIntlayerDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/index.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/processContentDeclaration.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/writeDynamicDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/writeFetchDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/writeMergedDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/writeRemoteDictionary.cjs.map +0 -1
- package/dist/cjs/transpiler/intlayer_dictionary/writeUnmergedDictionary.cjs.map +0 -1
- package/dist/esm/chokidar/index.mjs +0 -2
- package/dist/esm/chokidar/index.mjs.map +0 -1
- package/dist/esm/chokidar/watcher.mjs +0 -135
- package/dist/esm/chokidar/watcher.mjs.map +0 -1
- package/dist/esm/getBuiltDictionariesPath.mjs.map +0 -1
- package/dist/esm/getBuiltDynamicDictionariesPath.mjs.map +0 -1
- package/dist/esm/getBuiltFetchDictionariesPath.mjs.map +0 -1
- package/dist/esm/getBuiltRemoteDictionariesPath.mjs.map +0 -1
- package/dist/esm/getBuiltUnmergedDictionariesPath.mjs.map +0 -1
- package/dist/esm/reduceDictionaryContent/buildMask.mjs +0 -24
- package/dist/esm/reduceDictionaryContent/buildMask.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_main/generateDictionaryListContent.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_main/index.mjs +0 -3
- package/dist/esm/transpiler/dictionary_to_main/index.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/createModuleAugmentation.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/createType.mjs.map +0 -1
- package/dist/esm/transpiler/dictionary_to_type/index.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/buildIntlayerDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/index.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/processContentDeclaration.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/writeDynamicDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/writeFetchDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/writeMergedDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/writeRemoteDictionary.mjs.map +0 -1
- package/dist/esm/transpiler/intlayer_dictionary/writeUnmergedDictionary.mjs.map +0 -1
- package/dist/types/chokidar/index.d.ts +0 -2
- package/dist/types/chokidar/index.d.ts.map +0 -1
- package/dist/types/chokidar/watcher.d.ts +0 -14
- package/dist/types/chokidar/watcher.d.ts.map +0 -1
- package/dist/types/getBuiltDictionariesPath.d.ts.map +0 -1
- package/dist/types/getBuiltDynamicDictionariesPath.d.ts.map +0 -1
- package/dist/types/getBuiltFetchDictionariesPath.d.ts.map +0 -1
- package/dist/types/getBuiltRemoteDictionariesPath.d.ts.map +0 -1
- package/dist/types/getBuiltUnmergedDictionariesPath.d.ts.map +0 -1
- package/dist/types/reduceDictionaryContent/buildMask.d.ts +0 -5
- package/dist/types/reduceDictionaryContent/buildMask.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_main/generateDictionaryListContent.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_main/index.d.ts +0 -3
- package/dist/types/transpiler/dictionary_to_main/index.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_type/createModuleAugmentation.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_type/createType.d.ts.map +0 -1
- package/dist/types/transpiler/dictionary_to_type/index.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/buildIntlayerDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/index.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/processContentDeclaration.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/writeDynamicDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/writeFetchDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/writeMergedDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/writeRemoteDictionary.d.ts.map +0 -1
- package/dist/types/transpiler/intlayer_dictionary/writeUnmergedDictionary.d.ts.map +0 -1
- /package/dist/cjs/{getBuiltDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltDictionariesPath.cjs} +0 -0
- /package/dist/cjs/{getBuiltDynamicDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs} +0 -0
- /package/dist/cjs/{getBuiltFetchDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs} +0 -0
- /package/dist/cjs/{getBuiltRemoteDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs} +0 -0
- /package/dist/cjs/{getBuiltUnmergedDictionariesPath.cjs → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs} +0 -0
- /package/dist/esm/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.mjs +0 -0
- /package/dist/esm/{getBuiltDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltDictionariesPath.mjs} +0 -0
- /package/dist/esm/{getBuiltDynamicDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs} +0 -0
- /package/dist/esm/{getBuiltFetchDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs} +0 -0
- /package/dist/esm/{getBuiltRemoteDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs} +0 -0
- /package/dist/esm/{getBuiltUnmergedDictionariesPath.mjs → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs} +0 -0
- /package/dist/esm/{transpiler/dictionary_to_type → createType}/index.mjs +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/index.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/processContentDeclaration.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeDynamicDictionary.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeFetchDictionary.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeMergedDictionary.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeRemoteDictionary.d.ts +0 -0
- /package/dist/types/{transpiler/intlayer_dictionary → buildIntlayerDictionary}/writeUnmergedDictionary.d.ts +0 -0
- /package/dist/types/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/createDictionaryEntryPoint.d.ts +0 -0
- /package/dist/types/{transpiler/dictionary_to_main → createDictionaryEntryPoint}/generateDictionaryListContent.d.ts +0 -0
- /package/dist/types/{getBuiltDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts} +0 -0
- /package/dist/types/{getBuiltDynamicDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts} +0 -0
- /package/dist/types/{getBuiltFetchDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts} +0 -0
- /package/dist/types/{getBuiltRemoteDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts} +0 -0
- /package/dist/types/{getBuiltUnmergedDictionariesPath.d.ts → createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts} +0 -0
- /package/dist/types/{transpiler/dictionary_to_type → createType}/createModuleAugmentation.d.ts +0 -0
- /package/dist/types/{transpiler/dictionary_to_type → createType}/createType.d.ts +0 -0
- /package/dist/types/{transpiler/dictionary_to_type → createType}/index.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"sourcesContent":["import * as generate from '@babel/generator';\nimport * as babelParser from '@babel/parser';\nimport type { NodePath } from '@babel/traverse';\nimport * as babelTraverse from '@babel/traverse';\nimport * as t from '@babel/types';\nimport { getAppLogger, logger } from '@intlayer/config';\nimport configuration from '@intlayer/config/built';\nimport {\n Dictionary,\n NodeType,\n TranslationContent,\n TypedNode,\n} from '@intlayer/core';\nimport { existsSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { extname } from 'path';\nimport { getContentDeclarationFileTemplate } from '../getContentDeclarationFileTemplate/getContentDeclarationFileTemplate';\nimport { formatCode } from './formatCode';\n\n/**\n * Updates a JavaScriptå/TypeScript file based on the provided JSON instructions.\n * It targets a specific dictionary object within the file (identified by its 'key' property)\n * and updates its 'content' entries. Currently, it focuses on modifying arguments\n * of 't' (translation) function calls.\n */\nexport const writeJSFile = async (\n filePath: string,\n dictionary: Dictionary\n): Promise<void> => {\n // Ensure compatibility with various ESM/CJS interop shapes of @babel/traverse\n const normalizeTraverse = (mod: unknown) => {\n const candidate = mod as any;\n if (typeof candidate === 'function') return candidate;\n if (candidate?.default) {\n if (typeof candidate.default === 'function') return candidate.default;\n if (typeof candidate.default?.default === 'function')\n return candidate.default.default;\n if (typeof candidate.default?.traverse === 'function')\n return candidate.default.traverse;\n }\n if (typeof candidate?.traverse === 'function') return candidate.traverse;\n return candidate;\n };\n\n const traverse = normalizeTraverse(babelTraverse) as any;\n const appLogger = getAppLogger(configuration);\n\n const {\n key: dictionaryIdentifierKey,\n content: updatesToApply,\n locale,\n autoFilled,\n } = dictionary;\n const isPerLocaleDeclarationFile = typeof locale === 'string';\n\n // Check if the file exist\n if (!existsSync(filePath)) {\n const fileExtension = extname(filePath);\n\n let format = 'ts' as 'ts' | 'cjs' | 'esm';\n\n if (fileExtension === '.ts' || fileExtension === '.tsx') {\n format = 'ts';\n } else if (fileExtension === '.cjs' || fileExtension === '.cjsx') {\n format = 'cjs';\n } else {\n format = 'esm';\n }\n\n appLogger('File does not exist, creating it', {\n isVerbose: true,\n });\n const template = await getContentDeclarationFileTemplate(\n dictionaryIdentifierKey,\n format,\n { locale, autoFilled }\n );\n\n await writeFile(filePath, template, 'utf-8');\n }\n\n let sourceCode: string;\n try {\n sourceCode = await readFile(filePath, 'utf-8');\n } catch (error) {\n const err = error as Error;\n appLogger(`Failed to read file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to read file ${filePath}: ${err.message}`);\n }\n\n const ast = babelParser.parse(sourceCode, {\n sourceType: 'module',\n plugins: ['typescript', 'jsx'],\n tokens: true,\n });\n\n let dictionaryObjectPath: NodePath<t.ObjectExpression> | null = null;\n let dictionaryIdentifier: string | null = null;\n\n // First look for direct objects with the right key, regardless of variable assignments\n traverse(ast, {\n ObjectExpression(path: NodePath<t.ObjectExpression>) {\n if (dictionaryObjectPath) return; // Already found\n\n // Check if this object has a key property with the right value\n const keyProp = path.node.properties.find(\n (prop: t.ObjectProperty | t.SpreadElement | t.ObjectMethod) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n\n if (keyName !== 'key' || !t.isStringLiteral(prop.value)) return false;\n\n // Unescape the value for comparison\n const propValue = prop.value.value;\n // Compare actual string content, not just raw representation\n return propValue === dictionaryIdentifierKey;\n }\n );\n\n if (keyProp) {\n dictionaryObjectPath = path;\n path.stop();\n }\n },\n });\n\n // If not found directly, look for variable declarations and exports\n if (!dictionaryObjectPath) {\n appLogger(`Looking for variable declarations`, {\n isVerbose: true,\n });\n\n // Collect all variable declarations with objects\n const candidateVars: { id: string; path: NodePath<t.ObjectExpression> }[] =\n [];\n\n traverse(ast, {\n VariableDeclarator(path: NodePath<t.VariableDeclarator>) {\n const { node } = path;\n if (!t.isIdentifier(node.id)) return;\n\n let objPath: NodePath<t.ObjectExpression> | null = null;\n\n // Direct object assignment\n if (node.init && t.isObjectExpression(node.init)) {\n objPath = path.get('init') as NodePath<t.ObjectExpression>;\n }\n // Object with TS type assertion (satisfies/as)\n else if (\n node.init &&\n (t.isTSAsExpression(node.init) || t.isTSTypeAssertion(node.init)) &&\n t.isObjectExpression(node.init.expression)\n ) {\n objPath = path.get('init.expression') as NodePath<t.ObjectExpression>;\n }\n\n if (objPath) {\n candidateVars.push({ id: node.id.name, path: objPath });\n }\n },\n });\n\n appLogger(`Found ${candidateVars.length} candidate variables`, {\n isVerbose: true,\n });\n\n // Check each candidate for the key property\n for (const { id, path } of candidateVars) {\n const keyProp = path.node.properties.find((prop) => {\n if (!t.isObjectProperty(prop)) return false;\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return false;\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n return (\n keyName === 'key' &&\n t.isStringLiteral(prop.value) &&\n prop.value.value === dictionaryIdentifierKey\n );\n });\n\n if (keyProp) {\n appLogger(`Found match in variable: ${id}`);\n dictionaryObjectPath = path;\n dictionaryIdentifier = id;\n break;\n }\n }\n\n // If still not found, dump all object expressions for debugging\n if (!dictionaryObjectPath) {\n appLogger('Could not find dictionary object. Dumping all objects:', {\n isVerbose: true,\n });\n traverse(ast, {\n ObjectExpression(path: NodePath<t.ObjectExpression>) {\n const props = path.node.properties\n .map(\n (prop: t.ObjectProperty | t.SpreadElement | t.ObjectMethod) => {\n if (!t.isObjectProperty(prop)) return 'non-object-property';\n if (!t.isIdentifier(prop.key) && !t.isStringLiteral(prop.key))\n return 'complex-key';\n\n const keyName = t.isIdentifier(prop.key)\n ? prop.key.name\n : prop.key.value;\n let valueDesc = 'unknown-value';\n\n if (t.isStringLiteral(prop.value)) {\n valueDesc = `\"${prop.value.value}\"`;\n }\n\n return `${keyName}: ${valueDesc}`;\n }\n )\n .join(', ');\n\n appLogger(`Object: { ${props} }`);\n },\n });\n }\n }\n\n if (!dictionaryObjectPath) {\n throw new Error(\n `Could not find dictionary object with key '${dictionaryIdentifierKey}' in ${filePath}`\n );\n }\n\n // Find the 'content' property within the identified dictionary object\n const contentPropertyPath = (\n (dictionaryObjectPath as any).get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === 'content';\n });\n\n if (\n !contentPropertyPath ||\n !contentPropertyPath.isObjectProperty() ||\n !(contentPropertyPath.get('value') as NodePath).isObjectExpression()\n ) {\n throw new Error(\n `Could not find 'content' object property, or it's not an object, in dictionary in ${filePath}`\n );\n }\n\n const contentObjectPath = contentPropertyPath.get(\n 'value'\n ) as NodePath<t.ObjectExpression>;\n\n /**\n * Build a Babel Expression for any JSON-serializable value or TypedNode.\n * - Translation nodes become t({...}) or string literal in per-locale files\n * - Objects recurse to ObjectExpression\n * - Arrays recurse to ArrayExpression\n * - Strings/numbers/booleans/null to corresponding literals\n */\n const buildValueNodeFromData = (data: any): t.Expression => {\n // Translation typed node\n if ((data as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = data as TranslationContent;\n if (\n isPerLocaleDeclarationFile &&\n typeof locale === 'string' &&\n translationContent?.[NodeType.Translation]?.[locale] !== undefined\n ) {\n return buildValueNodeFromData(\n translationContent[NodeType.Translation][locale]\n );\n }\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) => {\n const keyNode = t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey);\n return t.objectProperty(keyNode, buildValueNodeFromData(langValue));\n }\n )\n );\n return t.callExpression(t.identifier('t'), [translationsObj]);\n }\n\n // Arrays\n if (Array.isArray(data)) {\n return t.arrayExpression(data.map((el) => buildValueNodeFromData(el)));\n }\n\n // Objects (plain)\n if (data && typeof data === 'object') {\n const props = Object.entries(data).map(([k, v]) => {\n const key = t.isValidIdentifier(k)\n ? t.identifier(k)\n : t.stringLiteral(k);\n return t.objectProperty(key, buildValueNodeFromData(v));\n });\n return t.objectExpression(props);\n }\n\n // Primitives\n switch (typeof data) {\n case 'string':\n return t.stringLiteral(data);\n case 'number':\n return t.numericLiteral(data);\n case 'boolean':\n return t.booleanLiteral(data);\n default:\n return t.nullLiteral();\n }\n };\n\n /** Ensure an object property exists on a given object expression path. */\n const ensureObjectProperty = (\n objPath: NodePath<t.ObjectExpression>,\n key: string\n ): NodePath<t.ObjectProperty> => {\n const existing = (\n objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === key;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (existing) return existing;\n\n const keyNode = t.isValidIdentifier(key)\n ? t.identifier(key)\n : t.stringLiteral(key);\n const newProp = t.objectProperty(keyNode, t.objectExpression([]));\n objPath.node.properties.push(newProp);\n\n // Return a fresh path for the newly pushed property\n const props = objPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n return props[props.length - 1] as NodePath<t.ObjectProperty>;\n };\n\n /** Recursively merge a JSON-like value into an ObjectExpression property path. */\n const mergeValueIntoProperty = (\n propPath: NodePath<t.ObjectProperty>,\n value: any,\n propKeyForLogs: string\n ) => {\n const valuePath = propPath.get('value') as NodePath;\n\n // Translation typed node → either update t() args or replace value\n if ((value as TypedNode)?.nodeType === NodeType.Translation) {\n const translationContent = value as TranslationContent;\n if (\n valuePath.isCallExpression() &&\n t.isIdentifier(valuePath.node.callee) &&\n valuePath.node.callee.name === 't'\n ) {\n // Replace argument with the full translations object (simpler and robust)\n const translationsObj = t.objectExpression(\n Object.entries(translationContent?.[NodeType.Translation] ?? {}).map(\n ([langKey, langValue]) =>\n t.objectProperty(\n t.isValidIdentifier(langKey)\n ? t.identifier(langKey)\n : t.stringLiteral(langKey),\n buildValueNodeFromData(langValue)\n )\n )\n );\n\n if (isPerLocaleDeclarationFile && typeof locale === 'string') {\n const localized =\n translationContent?.[NodeType.Translation]?.[locale];\n if (localized !== undefined) {\n valuePath.replaceWith(buildValueNodeFromData(localized));\n return;\n }\n }\n\n (valuePath.node as t.CallExpression).arguments = [translationsObj];\n return;\n }\n\n // Otherwise, replace with a fresh node\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Arrays → replace entirely\n if (Array.isArray(value)) {\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n }\n\n // Objects → ensure object expression and recurse into each key\n if (value && typeof value === 'object') {\n if (!valuePath.isObjectExpression()) {\n valuePath.replaceWith(t.objectExpression([]));\n }\n const objPath = valuePath as NodePath<t.ObjectExpression>;\n for (const [k, v] of Object.entries(value)) {\n const childProp = ensureObjectProperty(objPath, k);\n mergeValueIntoProperty(childProp, v, `${propKeyForLogs}.${k}`);\n }\n return;\n }\n\n // Primitives → replace\n valuePath.replaceWith(buildValueNodeFromData(value));\n return;\n };\n\n // Apply updates to each entry specified in the JSON (now supports deep nesting)\n for (const [entryKeyToUpdate, newEntryData] of Object.entries(\n updatesToApply\n )) {\n let targetPropertyPath = (\n contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[]\n ).find((propPath) => {\n if (!propPath.isObjectProperty()) return false;\n const propNode = propPath.node;\n const keyName = t.isIdentifier(propNode.key)\n ? propNode.key.name\n : t.isStringLiteral(propNode.key)\n ? propNode.key.value\n : null;\n return keyName === entryKeyToUpdate;\n }) as NodePath<t.ObjectProperty> | undefined;\n\n if (!targetPropertyPath) {\n const keyNode = t.isValidIdentifier(entryKeyToUpdate)\n ? t.identifier(entryKeyToUpdate)\n : t.stringLiteral(entryKeyToUpdate);\n // By default create an empty object; merge will replace if needed\n const newProperty = t.objectProperty(keyNode, t.objectExpression([]));\n contentObjectPath.node.properties.push(newProperty);\n const props = contentObjectPath.get('properties') as NodePath<\n t.ObjectProperty | t.SpreadElement | t.ObjectMethod\n >[];\n targetPropertyPath = props[\n props.length - 1\n ] as NodePath<t.ObjectProperty>;\n }\n\n mergeValueIntoProperty(targetPropertyPath, newEntryData, entryKeyToUpdate);\n }\n\n // Generate JavaScript/TypeScript code from the modified AST\n const generatedCode = generate.generate(ast, {\n retainLines: true,\n comments: true,\n jsescOption: {\n minimal: true, // This ensures Unicode characters are not escaped\n },\n }).code;\n\n let finalCode = generatedCode;\n\n finalCode = await formatCode(filePath, finalCode);\n\n // Write the modified code back to the file\n try {\n await writeFile(filePath, finalCode, 'utf-8');\n logger(`Successfully updated ${filePath}`, {\n level: 'info',\n isVerbose: true,\n });\n } catch (error) {\n const err = error as Error;\n logger(`Failed to write updated file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to write updated file ${filePath}: ${err.message}`);\n }\n};\n"],"mappings":"AAAA,YAAY,cAAc;AAC1B,YAAY,iBAAiB;AAE7B,YAAY,mBAAmB;AAC/B,YAAY,OAAO;AACnB,SAAS,cAAc,cAAc;AACrC,OAAO,mBAAmB;AAC1B;AAAA,EAEE;AAAA,OAGK;AACP,SAAS,kBAAkB;AAC3B,SAAS,UAAU,iBAAiB;AACpC,SAAS,eAAe;AACxB,SAAS,yCAAyC;AAClD,SAAS,kBAAkB;AAQpB,MAAM,cAAc,OACzB,UACA,eACkB;AAElB,QAAM,oBAAoB,CAAC,QAAiB;AAC1C,UAAM,YAAY;AAClB,QAAI,OAAO,cAAc,WAAY,QAAO;AAC5C,QAAI,WAAW,SAAS;AACtB,UAAI,OAAO,UAAU,YAAY,WAAY,QAAO,UAAU;AAC9D,UAAI,OAAO,UAAU,SAAS,YAAY;AACxC,eAAO,UAAU,QAAQ;AAC3B,UAAI,OAAO,UAAU,SAAS,aAAa;AACzC,eAAO,UAAU,QAAQ;AAAA,IAC7B;AACA,QAAI,OAAO,WAAW,aAAa,WAAY,QAAO,UAAU;AAChE,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,kBAAkB,aAAa;AAChD,QAAM,YAAY,aAAa,aAAa;AAE5C,QAAM;AAAA,IACJ,KAAK;AAAA,IACL,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,6BAA6B,OAAO,WAAW;AAGr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AS,iBAAiB,EAAG,QAAO;AACzC,YAAM,WAAW,SAAS;AAC1B,YAAM,UAAU,EAAE,aAAa,SAAS,GAAG,IACvC,SAAS,IAAI,OACb,EAAE,gBAAgB,SAAS,GAAG,IAC5B,SAAS,IAAI,QACb;AACN,aAAO,YAAY;AAAA,IACrB,CAAC;AAED,QAAI,CAAC,oBAAoB;AACvB,YAAM,UAAU,EAAE,kBAAkB,gBAAgB,IAChD,EAAE,WAAW,gBAAgB,IAC7B,EAAE,cAAc,gBAAgB;AAEpC,YAAM,cAAc,EAAE,eAAe,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACpE,wBAAkB,KAAK,WAAW,KAAK,WAAW;AAClD,YAAM,QAAQ,kBAAkB,IAAI,YAAY;AAGhD,2BAAqB,MACnB,MAAM,SAAS,CACjB;AAAA,IACF;AAEA,2BAAuB,oBAAoB,cAAc,gBAAgB;AAAA,EAC3E;AAGA,QAAM,gBAAgB,SAAS,SAAS,KAAK;AAAA,IAC3C,aAAa;AAAA,IACb,UAAU;AAAA,IACV,aAAa;AAAA,MACX,SAAS;AAAA;AAAA,IACX;AAAA,EACF,CAAC,EAAE;AAEH,MAAI,YAAY;AAEhB,cAAY,MAAM,WAAW,UAAU,SAAS;AAGhD,MAAI;AACF,UAAM,UAAU,UAAU,WAAW,OAAO;AAC5C,WAAO,wBAAwB,QAAQ,IAAI;AAAA,MACzC,OAAO;AAAA,MACP,WAAW;AAAA,IACb,CAAC;AAAA,EACH,SAAS,OAAO;AACd,UAAM,MAAM;AACZ,WAAO,iCAAiC,QAAQ,IAAI;AAAA,MAClD,OAAO;AAAA,IACT,CAAC;AACD,UAAM,IAAI,MAAM,gCAAgC,QAAQ,KAAK,IAAI,OAAO,EAAE;AAAA,EAC5E;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"sourcesContent":["import {\n getAppLogger,\n getConfiguration,\n IntlayerConfig,\n logger,\n} from '@intlayer/config';\nimport { Dictionary } from '@intlayer/core';\nimport { existsSync } from 'fs';\nimport { readFile, writeFile } from 'fs/promises';\nimport { extname } from 'path';\nimport { getContentDeclarationFileTemplate } from '../getContentDeclarationFileTemplate/getContentDeclarationFileTemplate';\nimport { formatCode } from './formatCode';\nimport { transformJSFile } from './transformJSFile';\n\n/**\n * Updates a JavaScript/TypeScript file based on the provided JSON instructions.\n * It targets a specific dictionary object within the file (identified by its 'key' property)\n * and updates its 'content' entries. Currently, it focuses on modifying arguments\n * of 't' (translation) function calls.\n */\nexport const writeJSFile = async (\n filePath: string,\n dictionary: Dictionary,\n configuration: IntlayerConfig = getConfiguration()\n): Promise<void> => {\n const { key, locale, autoFilled } = dictionary;\n const appLogger = getAppLogger(configuration);\n\n // Check if the file exist\n if (!existsSync(filePath)) {\n const fileExtension = extname(filePath);\n\n let format = 'ts' as 'ts' | 'cjs' | 'esm';\n\n if (fileExtension === '.ts' || fileExtension === '.tsx') {\n format = 'ts';\n } else if (fileExtension === '.cjs' || fileExtension === '.cjsx') {\n format = 'cjs';\n } else {\n format = 'esm';\n }\n\n appLogger('File does not exist, creating it', {\n isVerbose: true,\n });\n const template = await getContentDeclarationFileTemplate(key, format, {\n locale,\n autoFilled,\n });\n\n await writeFile(filePath, template, 'utf-8');\n }\n\n const fileContent = await readFile(filePath, 'utf-8');\n\n const finalCode = await transformJSFile(fileContent, dictionary);\n\n const formattedCode = await formatCode(filePath, finalCode);\n\n // Write the modified code back to the file\n try {\n await writeFile(filePath, formattedCode, 'utf-8');\n logger(`Successfully updated ${filePath}`, {\n level: 'info',\n isVerbose: true,\n });\n } catch (error) {\n const err = error as Error;\n logger(`Failed to write updated file: ${filePath}`, {\n level: 'error',\n });\n throw new Error(`Failed to write updated file ${filePath}: ${err.message}`);\n }\n};\n"],"mappings":"AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,kBAAkB;AAC3B,SAAS,UAAU,iBAAiB;AACpC,SAAS,eAAe;AACxB,SAAS,yCAAyC;AAClD,SAAS,kBAAkB;AAC3B,SAAS,uBAAuB;AAQzB,MAAM,cAAc,OACzB,UACA,YACA,gBAAgC,iBAAiB,MAC/B;AAClB,QAAM,EAAE,KAAK,QAAQ,WAAW,IAAI;AACpC,QAAM,YAAY,aAAa,aAAa;AAG5C,MAAI,CAAC,WAAW,QAAQ,GAAG;AACzB,UAAM,gBAAgB,QAAQ,QAAQ;AAEtC,QAAI,SAAS;AAEb,QAAI,kBAAkB,SAAS,kBAAkB,QAAQ;AACvD,eAAS;AAAA,IACX,WAAW,kBAAkB,UAAU,kBAAkB,SAAS;AAChE,eAAS;AAAA,IACX,OAAO;AACL,eAAS;AAAA,IACX;AAEA,cAAU,oCAAoC;AAAA,MAC5C,WAAW;AAAA,IACb,CAAC;AACD,UAAM,WAAW,MAAM,kCAAkC,KAAK,QAAQ;AAAA,MACpE;AAAA,MACA;AAAA,IACF,CAAC;AAED,UAAM,UAAU,UAAU,UAAU,OAAO;AAAA,EAC7C;AAEA,QAAM,cAAc,MAAM,SAAS,UAAU,OAAO;AAEpD,QAAM,YAAY,MAAM,gBAAgB,aAAa,UAAU;AAE/D,QAAM,gBAAgB,MAAM,WAAW,UAAU,SAAS;AAG1D,MAAI;AACF,UAAM,UAAU,UAAU,eAAe,OAAO;AAChD,WAAO,wBAAwB,QAAQ,IAAI;AAAA,MACzC,OAAO;AAAA,MACP,WAAW;AAAA,IACb,CAAC;AAAA,EACH,SAAS,OAAO;AACd,UAAM,MAAM;AACZ,WAAO,iCAAiC,QAAQ,IAAI;AAAA,MAClD,OAAO;AAAA,IACT,CAAC;AACD,UAAM,IAAI,MAAM,gCAAgC,QAAQ,KAAK,IAAI,OAAO,EAAE;AAAA,EAC5E;AACF;","names":[]}
|
|
@@ -3,7 +3,7 @@ import { LocalizedDictionaryOutput } from './writeDynamicDictionary';
|
|
|
3
3
|
/**
|
|
4
4
|
* This function transpile the bundled code to to make dictionaries as JSON files
|
|
5
5
|
*/
|
|
6
|
-
export declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig, formats?: ("cjs" | "esm")[]) => Promise<{
|
|
6
|
+
export declare const buildDictionary: (localDictionariesEntries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig, formats?: ("cjs" | "esm")[], importOtherDictionaries?: boolean) => Promise<{
|
|
7
7
|
unmergedDictionaries: import("./writeUnmergedDictionary").UnmergedDictionaryOutput;
|
|
8
8
|
mergedDictionaries: import("./writeMergedDictionary").MergedDictionaryOutput;
|
|
9
9
|
dynamicDictionaries: LocalizedDictionaryOutput;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildIntlayerDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/buildIntlayerDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EACL,yBAAyB,EAE1B,MAAM,0BAA0B,CAAC;AAKlC;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,0BAA0B,UAAU,EAAE,EACtC,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,EAC3C,iCAA8B;;;;;EAkE/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/processContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD;;GAEG;AACH,eAAO,MAAM,yBAAyB,GACpC,oBAAoB,UAAU,KAC7B,OAAO,CAAC,UAAU,GAAG,SAAS,CAehC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeDynamicDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/writeDynamicDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,OAAO,EAER,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAuB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAC7C,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAClC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C,MAAM,EACN,yBAAyB,CAC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MAgCF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GACjC,oBAAoB,sBAAsB,EAC1C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CAwEnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeFetchDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/writeFetchDictionary.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,eAAO,MAAM,4BAA4B,GACvC,gCAAgC,yBAAyB,EACzD,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA4BF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAC/B,qBAAqB,yBAAyB,EAC9C,yDAAkC,EAClC,UAAS,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,KAC1C,OAAO,CAAC,yBAAyB,CAoCnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeMergedDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/writeMergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;AAE5E;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,uBAAuB,GAClC,qBAAqB,wBAAwB,EAC7C,yDAAkC,KACjC,OAAO,CAAC,sBAAsB,CAgDhC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeRemoteDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/writeRemoteDictionary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,GAChC,oBAAoB,UAAU,EAAE,EAChC,yDAAkC,KACjC,OAAO,CAAC,UAAU,EAAE,CA0BtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeUnmergedDictionary.d.ts","sourceRoot":"","sources":["../../../src/buildIntlayerDictionary/writeUnmergedDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAuBjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,UAAU,EAAE,EAC1B,yDAAkC,KACjC,OAAO,CAAC,wBAAwB,CAsDlC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AA0CA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,EAClC,mBAAmB,MAAM,EAAE,EAC3B,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC,EAAE,kBAqD5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,cAAc,MAAM,EAAE,EACtB,cAAc,MAAM,EACpB,SAAQ,KAAK,GAAG,KAAa,EAC7B,yDAAkC,KACjC,MA0CF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltDictionariesPath.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,aAcnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltDynamicDictionariesPath.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,+BAA+B,GAC1C,yDAAkC,EAClC,SAAQ,KAAK,GAAG,KAAa,aAgB9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltFetchDictionariesPath.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,6BAA6B,GACxC,yDAAkC,EAClC,SAAQ,KAAK,GAAG,KAAa,aAgB9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltRemoteDictionariesPath.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,8BAA8B,GACzC,yDAAkC,aAcnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltUnmergedDictionariesPath.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,yDAAkC,aAcnC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './createDictionaryEntryPoint';
|
|
2
|
+
export * from './generateDictionaryListContent';
|
|
3
|
+
export * from './getBuiltDictionariesPath';
|
|
4
|
+
export * from './getBuiltDynamicDictionariesPath';
|
|
5
|
+
export * from './getBuiltFetchDictionariesPath';
|
|
6
|
+
export * from './getBuiltRemoteDictionariesPath';
|
|
7
|
+
export * from './getBuiltUnmergedDictionariesPath';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/createDictionaryEntryPoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createModuleAugmentation.d.ts","sourceRoot":"","sources":["../../../src/createType/createModuleAugmentation.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,KAAG,MACH,CAAC;AA8FxC;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,yDAAkC,kBAoBnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createType.d.ts","sourceRoot":"","sources":["../../../src/createType/createType.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAUjD,eAAO,MAAM,sBAAsB,GAAI,YAAY,UAAU,WAI5D,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,mBAAmB,MAAM,EAAE,EAC3B,gBAAe,cAAmC,KACjD,OAAO,CAAC,MAAM,EAAE,CA0BlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/createType/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type IntlayerConfig } from '@intlayer/config';
|
|
1
2
|
import type { Dictionary } from '@intlayer/core';
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const isInvalidDictionary: (dictionary: Dictionary | undefined, configuration?: IntlayerConfig) => boolean;
|
|
4
|
+
export declare const filterInvalidDictionaries: (dictionaries: (Dictionary | undefined)[] | undefined, configuration?: IntlayerConfig) => Dictionary[];
|
|
3
5
|
//# sourceMappingURL=filterInvalidDictionaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterInvalidDictionaries.d.ts","sourceRoot":"","sources":["../../src/filterInvalidDictionaries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filterInvalidDictionaries.d.ts","sourceRoot":"","sources":["../../src/filterInvalidDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,mBAAmB,GAC9B,YAAY,UAAU,GAAG,SAAS,EAClC,gBAAgB,cAAc,KAC7B,OA+BF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GACpC,cAAc,CAAC,UAAU,GAAG,SAAS,CAAC,EAAE,GAAG,SAAS,EACpD,gBAAgB,cAAc,KAC7B,UAAU,EAGM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleAdditionalContentDeclarationFile.d.ts","sourceRoot":"","sources":["../../src/handleAdditionalContentDeclarationFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAOrE,eAAO,MAAM,sCAAsC,GACjD,UAAU,MAAM,EAChB,QAAQ,cAAc,kBA8BvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleContentDeclarationFileChange.d.ts","sourceRoot":"","sources":["../../src/handleContentDeclarationFileChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AAQrE,eAAO,MAAM,kCAAkC,GAC7C,UAAU,MAAM,EAChB,QAAQ,cAAc,kBAmCvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleUnlikedContentDeclarationFile.d.ts","sourceRoot":"","sources":["../../src/handleUnlikedContentDeclarationFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAgB,MAAM,kBAAkB,CAAC;AASrE,eAAO,MAAM,mCAAmC,GAC9C,UAAU,MAAM,EAChB,QAAQ,cAAc,kBAgCvB,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';
|
|
2
2
|
export { cleanOutputDir } from './cleanOutputDir';
|
|
3
|
+
export { createDictionaryEntryPoint, generateDictionaryListContent, getBuiltDictionariesPath, getBuiltDynamicDictionariesPath, getBuiltFetchDictionariesPath, getBuiltRemoteDictionariesPath, getBuiltUnmergedDictionariesPath, } from './createDictionaryEntryPoint';
|
|
4
|
+
export { createTypes } from './createType';
|
|
5
|
+
export { createModuleAugmentation } from './createType/createModuleAugmentation';
|
|
3
6
|
export { fetchDistantDictionaries } from './fetchDistantDictionaries';
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
7
|
+
export { isInvalidDictionary } from './filterInvalidDictionaries';
|
|
8
|
+
export { getContentDeclarationFileTemplate } from './getContentDeclarationFileTemplate/getContentDeclarationFileTemplate';
|
|
9
|
+
export { handleAdditionalContentDeclarationFile } from './handleAdditionalContentDeclarationFile';
|
|
10
|
+
export { handleContentDeclarationFileChange } from './handleContentDeclarationFileChange';
|
|
11
|
+
export { handleUnlikedContentDeclarationFile } from './handleUnlikedContentDeclarationFile';
|
|
6
12
|
export { listDictionaries } from './listDictionariesPath';
|
|
7
13
|
export { listGitFiles, listGitLines, type DiffMode, type ListGitFilesOptions, type ListGitLinesOptions, } from './listGitFiles';
|
|
8
|
-
export { loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, } from './loadDictionaries
|
|
14
|
+
export { loadContentDeclarations, loadDictionaries, loadLocalDictionaries, loadRemoteDictionaries, } from './loadDictionaries';
|
|
9
15
|
export { mergeDictionaries } from './mergeDictionaries';
|
|
10
16
|
export { prepareContentDeclaration } from './prepareContentDeclaration';
|
|
11
17
|
export { prepareIntlayer } from './prepareIntlayer';
|
|
12
18
|
export { processPerLocaleDictionary } from './processPerLocaleDictionary';
|
|
13
19
|
export { reduceDictionaryContent } from './reduceDictionaryContent/reduceDictionaryContent';
|
|
14
|
-
export { createDictionaryEntryPoint, generateDictionaryListContent, } from './transpiler/dictionary_to_main';
|
|
15
|
-
export { createModuleAugmentation } from './transpiler/dictionary_to_type/createModuleAugmentation';
|
|
16
|
-
export { buildDictionary } from './transpiler/intlayer_dictionary/buildIntlayerDictionary';
|
|
17
20
|
export { extractErrorMessage } from './utils/extractErrorMessage';
|
|
18
21
|
export { formatLocale, formatPath } from './utils/formatter';
|
|
19
22
|
export { getExtension } from './utils/getExtention';
|
|
@@ -22,6 +25,8 @@ export { kebabCaseToCamelCase } from './utils/kebabCaseToCamelCase';
|
|
|
22
25
|
export { parallelize } from './utils/parallelize';
|
|
23
26
|
export { resolveObjectPromises } from './utils/resolveObjectPromises';
|
|
24
27
|
export { runOnce } from './utils/runOnce';
|
|
28
|
+
export { runParallel, type ParallelHandle } from './utils/runParallel';
|
|
25
29
|
export { sortAlphabetically } from './utils/sortAlphabetically';
|
|
30
|
+
export { buildAndWatchIntlayer, watch } from './watcher';
|
|
26
31
|
export { writeContentDeclaration, type DictionaryStatus, } from './writeContentDeclaration';
|
|
27
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":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mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,KAAK,gBAAgB,GACtB,MAAM,2BAA2B,CAAC"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { type IntlayerConfig } from '@intlayer/config';
|
|
2
|
+
/**
|
|
3
|
+
* List all dictionaries absolute paths in the project
|
|
4
|
+
* @param configuration - The configuration object
|
|
5
|
+
* @returns An array of dictionary paths
|
|
6
|
+
*/
|
|
2
7
|
export declare const listDictionaries: (configuration?: IntlayerConfig) => string[];
|
|
3
8
|
//# sourceMappingURL=listDictionariesPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listDictionariesPath.d.ts","sourceRoot":"","sources":["../../src/listDictionariesPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,kBAAkB,CAAC;AAGzE,eAAO,MAAM,gBAAgB,GAC3B,gBAAe,cAAmC,KACjD,MAAM,EAqBR,CAAC"}
|
|
1
|
+
{"version":3,"file":"listDictionariesPath.d.ts","sourceRoot":"","sources":["../../src/listDictionariesPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,kBAAkB,CAAC;AAGzE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAC3B,gBAAe,cAAmC,KACjD,MAAM,EAqBR,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntlayerConfig } from '@intlayer/config';
|
|
2
2
|
import type { Dictionary } from '@intlayer/core';
|
|
3
3
|
import { DictionariesStatus } from './loadDictionaries';
|
|
4
|
-
export declare const formatLocalDictionaries: (dictionariesRecord: Record<string, Dictionary
|
|
4
|
+
export declare const formatLocalDictionaries: (dictionariesRecord: Record<string, Dictionary>, configuration?: IntlayerConfig) => Dictionary[];
|
|
5
5
|
export declare const loadContentDeclarations: (contentDeclarationFilePath: string[], configuration?: IntlayerConfig, projectRequire?: NodeJS.Require, onStatusUpdate?: (status: DictionariesStatus[]) => void) => Promise<Dictionary[]>;
|
|
6
6
|
//# sourceMappingURL=loadContentDeclaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,eAAO,MAAM,uBAAuB,GAClC,oBAAoB,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAC9C,gBAAgB,cAAc,KAC7B,UAAU,EAQN,CAAC;AAER,eAAO,MAAM,uBAAuB,GAClC,4BAA4B,MAAM,EAAE,EACpC,gBAAe,cAAmC,EAClD,+BAA+B,EAC/B,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,KACtD,OAAO,CAAC,UAAU,EAAE,CA4DtB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type IntlayerConfig } from '@intlayer/config';
|
|
1
2
|
import type { Dictionary } from '@intlayer/core';
|
|
2
|
-
export declare const loadLocalDictionaries: (contentDeclarationsPaths: string[] | string) => Promise<Dictionary[]>;
|
|
3
|
+
export declare const loadLocalDictionaries: (contentDeclarationsPaths: string[] | string, configuration?: IntlayerConfig, projectRequire?: NodeJS.Require) => Promise<Dictionary[]>;
|
|
3
4
|
//# sourceMappingURL=loadLocalDictionaries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadLocalDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadLocalDictionaries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadLocalDictionaries.d.ts","sourceRoot":"","sources":["../../../src/loadDictionaries/loadLocalDictionaries.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAKjD,eAAO,MAAM,qBAAqB,GAChC,0BAA0B,MAAM,EAAE,GAAG,MAAM,EAC3C,gBAAe,cAAmC,EAClD,+BAA+B,KAC9B,OAAO,CAAC,UAAU,EAAE,CA+BtB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type IntlayerConfig } from '@intlayer/config';
|
|
2
|
-
export declare const prepareIntlayer: (configuration?: IntlayerConfig, projectRequire?: NodeJS.Require, clean?: boolean) => Promise<void>;
|
|
2
|
+
export declare const prepareIntlayer: (configuration?: IntlayerConfig, projectRequire?: NodeJS.Require, clean?: boolean, format?: ("cjs" | "esm")[]) => Promise<void>;
|
|
3
3
|
//# sourceMappingURL=prepareIntlayer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareIntlayer.d.ts","sourceRoot":"","sources":["../../src/prepareIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAIpB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"prepareIntlayer.d.ts","sourceRoot":"","sources":["../../src/prepareIntlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAIpB,MAAM,kBAAkB,CAAC;AAW1B,eAAO,MAAM,eAAe,GAC1B,gBAAe,cAAmC,EAClD,+BAA+B,EAC/B,eAAa,EACb,SAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,EAAmB,kBA8G3C,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Dictionary } from '@intlayer/core';
|
|
2
2
|
export declare const reduceDictionaryContent: (fullDictionary: Dictionary, partialDictionary: Dictionary) => Dictionary;
|
|
3
3
|
//# sourceMappingURL=reduceDictionaryContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceDictionaryContent.d.ts","sourceRoot":"","sources":["../../../src/reduceDictionaryContent/reduceDictionaryContent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"reduceDictionaryContent.d.ts","sourceRoot":"","sources":["../../../src/reduceDictionaryContent/reduceDictionaryContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAkB,MAAM,gBAAgB,CAAC;AAGjE,eAAO,MAAM,uBAAuB,GAClC,gBAAgB,UAAU,EAC1B,mBAAmB,UAAU,eAM9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/extractErrorMessage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAAI,OAAO,OAAO,KAAG,
|
|
1
|
+
{"version":3,"file":"extractErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/utils/extractErrorMessage.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,GAAI,OAAO,OAAO,KAAG,MA+JpD,CAAC"}
|
|
@@ -1,2 +1,14 @@
|
|
|
1
|
+
export default class Queue<T> {
|
|
2
|
+
#private;
|
|
3
|
+
constructor();
|
|
4
|
+
enqueue(value: T): void;
|
|
5
|
+
dequeue(): T | undefined;
|
|
6
|
+
peek(): T | undefined;
|
|
7
|
+
clear(): void;
|
|
8
|
+
get size(): number;
|
|
9
|
+
[Symbol.iterator](): Generator<T, void, unknown>;
|
|
10
|
+
drain(): Generator<T | undefined, void, unknown>;
|
|
11
|
+
}
|
|
12
|
+
export declare const pLimit: (concurrency: number) => (function_: (...args: any[]) => Promise<any>, ...arguments_: any[]) => Promise<any>;
|
|
1
13
|
export declare const parallelize: <T, R>(items: T[], callback: (item: T) => Promise<R>, parallelLimit?: number) => Promise<R[]>;
|
|
2
14
|
//# sourceMappingURL=parallelize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallelize.d.ts","sourceRoot":"","sources":["../../../src/utils/parallelize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parallelize.d.ts","sourceRoot":"","sources":["../../../src/utils/parallelize.ts"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,OAAO,KAAK,CAAC,CAAC;;;IAS1B,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAcvB,OAAO,IAAI,CAAC,GAAG,SAAS;IAWxB,IAAI,IAAI,CAAC,GAAG,SAAS;IAWrB,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI,MAAM,CAEjB;IAEA,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC;IAShD,KAAK,IAAI,SAAS,CAAC,CAAC,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC;CAKlD;AAED,eAAO,MAAM,MAAM,GAAI,aAAa,MAAM,iBA2D3B,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,iBAC5B,GAAG,EAAE,KACnB,OAAO,CAAC,GAAG,CA6Cf,CAAC;AAcF,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,CAAC,EACpC,OAAO,CAAC,EAAE,EACV,UAAU,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EACjC,gBAAe,MAAW,KACzB,OAAO,CAAC,CAAC,EAAE,CAGb,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type ParallelHandle = {
|
|
2
|
+
kill: () => void;
|
|
3
|
+
result: Promise<any>;
|
|
4
|
+
commandText: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Start a cross-platform parallel process using `concurrently`.
|
|
8
|
+
* Accepts either a single string (e.g., 'next start') or an array of tokens (e.g., ['next', 'start']).
|
|
9
|
+
*/
|
|
10
|
+
export declare const runParallel: (proc?: string | string[]) => ParallelHandle | null;
|
|
11
|
+
//# sourceMappingURL=runParallel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runParallel.d.ts","sourceRoot":"","sources":["../../../src/utils/runParallel.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,GAAG,MAAM,EAAE,KACvB,cAAc,GAAG,IA2CnB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GetConfigurationOptions, type IntlayerConfig } from '@intlayer/config';
|
|
2
|
+
/** @ts-ignore remove error Module '"chokidar"' has no exported member 'ChokidarOptions'. */
|
|
3
|
+
import { type ChokidarOptions } from 'chokidar';
|
|
4
|
+
type WatchOptions = ChokidarOptions & {
|
|
5
|
+
configuration?: IntlayerConfig;
|
|
6
|
+
configOptions?: GetConfigurationOptions;
|
|
7
|
+
skipPrepare?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const watch: (options?: WatchOptions) => import("chokidar").FSWatcher;
|
|
10
|
+
export declare const buildAndWatchIntlayer: (options?: WatchOptions) => Promise<void>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=watcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watcher.d.ts","sourceRoot":"","sources":["../../src/watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,cAAc,EAGpB,MAAM,kBAAkB,CAAC;AAC1B,4FAA4F;AAC5F,OAAO,EAAE,KAAK,eAAe,EAA0B,MAAM,UAAU,CAAC;AASxE,KAAK,YAAY,GAAG,eAAe,GAAG;IACpC,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAGF,eAAO,MAAM,KAAK,GAAI,UAAU,YAAY,iCAsD3C,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAU,UAAU,YAAY,kBAgBjE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dictionary } from '@intlayer/core';
|
|
2
|
+
/**
|
|
3
|
+
* Updates a JavaScript/TypeScript file based on the provided JSON instructions.
|
|
4
|
+
* It targets a specific dictionary object within the file (identified by its 'key' property)
|
|
5
|
+
* and updates its 'content' entries. Currently, it focuses on modifying arguments
|
|
6
|
+
* of 't' (translation) function calls.
|
|
7
|
+
*/
|
|
8
|
+
export declare const transformJSFile: (fileContent: string, dictionary: Dictionary) => Promise<string>;
|
|
9
|
+
//# sourceMappingURL=transformJSFile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/transformJSFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAY,MAAM,gBAAgB,CAAC;AAogBtD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,aAAa,MAAM,EACnB,YAAY,UAAU,KACrB,OAAO,CAAC,MAAM,CA+chB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAMjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAsB3D,eAAO,MAAM,uBAAuB,GAClC,YAAY,UAAU,EACtB,SAAQ,cAAmC,EAC3C,sBAAsB,MAAM,KAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA8DpD,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { IntlayerConfig } from '@intlayer/config';
|
|
1
2
|
import { Dictionary } from '@intlayer/core';
|
|
2
3
|
/**
|
|
3
|
-
* Updates a JavaScript
|
|
4
|
+
* Updates a JavaScript/TypeScript file based on the provided JSON instructions.
|
|
4
5
|
* It targets a specific dictionary object within the file (identified by its 'key' property)
|
|
5
6
|
* and updates its 'content' entries. Currently, it focuses on modifying arguments
|
|
6
7
|
* of 't' (translation) function calls.
|
|
7
8
|
*/
|
|
8
|
-
export declare const writeJSFile: (filePath: string, dictionary: Dictionary) => Promise<void>;
|
|
9
|
+
export declare const writeJSFile: (filePath: string, dictionary: Dictionary, configuration?: IntlayerConfig) => Promise<void>;
|
|
9
10
|
//# sourceMappingURL=writeJSFile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"writeJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAQ5C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,YAAY,UAAU,EACtB,gBAAe,cAAmC,KACjD,OAAO,CAAC,IAAI,CAiDd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/chokidar",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
|
|
6
6
|
"keywords": [
|
|
@@ -57,34 +57,28 @@
|
|
|
57
57
|
"./package.json"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@babel/generator": "^7.27.5",
|
|
61
|
-
"@babel/parser": "^7.27.5",
|
|
62
|
-
"@babel/traverse": "^7.27.4",
|
|
63
|
-
"@babel/types": "^7.27.6",
|
|
64
60
|
"chokidar": "^3.6.0",
|
|
61
|
+
"concurrently": "^9.2.1",
|
|
65
62
|
"crypto-js": "^4.2.0",
|
|
66
63
|
"deep-equal": "^2.2.3",
|
|
67
64
|
"deepmerge": "^4.3.1",
|
|
68
65
|
"fast-glob": "^3.3.3",
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"@intlayer/
|
|
72
|
-
"@intlayer/config": "6.0
|
|
73
|
-
"@intlayer/
|
|
74
|
-
"@intlayer/
|
|
75
|
-
"@intlayer/dictionaries-entry": "6.0
|
|
76
|
-
"@intlayer/
|
|
66
|
+
"simple-git": "^3.28.0",
|
|
67
|
+
"ts-morph": "^27.0.0",
|
|
68
|
+
"@intlayer/api": "6.1.0",
|
|
69
|
+
"@intlayer/config": "6.1.0",
|
|
70
|
+
"@intlayer/core": "6.1.0",
|
|
71
|
+
"@intlayer/dictionaries-entry": "6.1.0",
|
|
72
|
+
"@intlayer/unmerged-dictionaries-entry": "6.1.0",
|
|
73
|
+
"@intlayer/remote-dictionaries-entry": "6.1.0"
|
|
77
74
|
},
|
|
78
75
|
"devDependencies": {
|
|
79
|
-
"@changesets/cli": "2.29.
|
|
80
|
-
"@types/babel__generator": "^7.27.0",
|
|
81
|
-
"@types/babel__traverse": "^7.20.7",
|
|
76
|
+
"@changesets/cli": "2.29.7",
|
|
82
77
|
"@types/crypto-js": "^4.2.2",
|
|
83
78
|
"@types/deep-equal": "^1.0.4",
|
|
84
|
-
"@types/node": "^24.2
|
|
85
|
-
"@typescript-eslint/parser": "^8.
|
|
86
|
-
"
|
|
87
|
-
"eslint": "^9.34.0",
|
|
79
|
+
"@types/node": "^24.5.2",
|
|
80
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
81
|
+
"eslint": "^9.36.0",
|
|
88
82
|
"prettier": "^3.6.2",
|
|
89
83
|
"rimraf": "^6.0.1",
|
|
90
84
|
"tsc-alias": "^1.8.16",
|
|
@@ -99,13 +93,13 @@
|
|
|
99
93
|
"peerDependencies": {
|
|
100
94
|
"fast-glob": "^3.3.3",
|
|
101
95
|
"react": ">=16.0.0",
|
|
102
|
-
"@intlayer/api": "6.0
|
|
103
|
-
"@intlayer/
|
|
104
|
-
"@intlayer/
|
|
105
|
-
"@intlayer/
|
|
106
|
-
"@intlayer/dictionaries-entry": "6.0
|
|
107
|
-
"@intlayer/remote-dictionaries-entry": "6.0
|
|
108
|
-
"intlayer": "6.0
|
|
96
|
+
"@intlayer/api": "6.1.0",
|
|
97
|
+
"@intlayer/dictionaries-entry": "6.1.0",
|
|
98
|
+
"@intlayer/config": "6.1.0",
|
|
99
|
+
"@intlayer/core": "6.1.0",
|
|
100
|
+
"@intlayer/unmerged-dictionaries-entry": "6.1.0",
|
|
101
|
+
"@intlayer/remote-dictionaries-entry": "6.1.0",
|
|
102
|
+
"intlayer": "6.1.0"
|
|
109
103
|
},
|
|
110
104
|
"engines": {
|
|
111
105
|
"node": ">=14.18"
|
|
@@ -124,6 +118,7 @@
|
|
|
124
118
|
"lint:fix": "eslint . --cache --fix",
|
|
125
119
|
"prettier": "prettier . --check",
|
|
126
120
|
"prettier:fix": "prettier --write src/**/*",
|
|
121
|
+
"prepublish": "cp -f ../../../README.md ./README.md",
|
|
127
122
|
"test": "vitest run",
|
|
128
123
|
"test:watch": "vitest"
|
|
129
124
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
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 chokidar_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(chokidar_exports);
|
|
18
|
-
__reExport(chokidar_exports, require('./watcher.cjs'), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require('./watcher.cjs')
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/chokidar/index.ts"],"sourcesContent":["export * from './watcher';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,6BAAc,sBAAd;","names":[]}
|