@intlayer/chokidar 8.1.2 → 8.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/installSkills/skills/angular.md +3 -0
- package/dist/assets/installSkills/skills/astro.md +3 -0
- package/dist/assets/installSkills/skills/cli.md +7 -4
- package/dist/assets/installSkills/skills/config.md +3 -0
- package/dist/assets/installSkills/skills/content.md +3 -0
- package/dist/assets/installSkills/skills/next_js.md +3 -0
- package/dist/assets/installSkills/skills/preact.md +3 -2
- package/dist/assets/installSkills/skills/react.md +3 -0
- package/dist/assets/installSkills/skills/solid.md +3 -0
- package/dist/assets/installSkills/skills/svelte.md +3 -0
- package/dist/assets/installSkills/skills/usage.md +2 -0
- package/dist/assets/installSkills/skills/vue.md +3 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +1 -29
- package/dist/cjs/_virtual/_utils_asset.cjs +2 -98
- package/dist/cjs/build.cjs +1 -51
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +1 -53
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/index.cjs +1 -6
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +1 -26
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +4 -78
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +4 -62
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -46
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +1 -50
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +1 -59
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/cleanOutputDir.cjs +1 -30
- package/dist/cjs/cleanOutputDir.cjs.map +1 -1
- package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -96
- package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
- package/dist/cjs/cli.cjs +1 -21
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -70
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +7 -41
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +1 -24
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +1 -24
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +1 -23
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/index.cjs +1 -16
- package/dist/cjs/createType/createModuleAugmentation.cjs +9 -110
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/createType/createType.cjs +1 -29
- package/dist/cjs/createType/createType.cjs.map +1 -1
- package/dist/cjs/createType/index.cjs +1 -8
- package/dist/cjs/fetchDistantDictionaries.cjs +1 -50
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs +1 -49
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/formatDictionary.cjs +1 -49
- package/dist/cjs/formatDictionary.cjs.map +1 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +1 -39
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +1 -34
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileChange.cjs +1 -49
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileMoved.cjs +1 -24
- package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -37
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -131
- package/dist/cjs/init/index.cjs +1 -242
- package/dist/cjs/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs +1 -164
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
- package/dist/cjs/init/utils/fileSystem.cjs +1 -30
- package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
- package/dist/cjs/init/utils/index.cjs +1 -13
- package/dist/cjs/init/utils/jsonParser.cjs +3 -42
- package/dist/cjs/init/utils/jsonParser.cjs.map +1 -1
- package/dist/cjs/init/utils/tsConfig.cjs +1 -18
- package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
- package/dist/cjs/initConfig/index.cjs +1 -38
- package/dist/cjs/initConfig/index.cjs.map +1 -1
- package/dist/cjs/installSkills/index.cjs +1 -172
- package/dist/cjs/installSkills/index.cjs.map +1 -1
- package/dist/cjs/listDictionariesPath.cjs +1 -41
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +5 -95
- package/dist/cjs/listGitFiles.cjs.map +1 -1
- package/dist/cjs/listProjects.cjs +1 -47
- package/dist/cjs/listProjects.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -66
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/index.cjs +1 -12
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -72
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -125
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -28
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +1 -61
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +3 -135
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +1 -95
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs +1 -30
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +1 -12
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
- package/dist/cjs/transformFiles/extractDictionaryKey.cjs +1 -16
- package/dist/cjs/transformFiles/extractDictionaryKey.cjs.map +1 -1
- package/dist/cjs/transformFiles/index.cjs +1 -10
- package/dist/cjs/transformFiles/transformFiles.cjs +1 -251
- package/dist/cjs/transformFiles/transformFiles.cjs.map +1 -1
- package/dist/cjs/utils/autoDecorateContent.cjs +1 -87
- package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
- package/dist/cjs/utils/buildFilesList.cjs +1 -50
- package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
- package/dist/cjs/utils/chunkJSON.cjs +1 -336
- package/dist/cjs/utils/chunkJSON.cjs.map +1 -1
- package/dist/cjs/utils/formatter.cjs +1 -16
- package/dist/cjs/utils/formatter.cjs.map +1 -1
- package/dist/cjs/utils/getChunk.cjs +1 -34
- package/dist/cjs/utils/getChunk.cjs.map +1 -1
- package/dist/cjs/utils/getComponentTransformPattern.cjs +1 -48
- package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
- package/dist/cjs/utils/getFileHash.cjs +1 -12
- package/dist/cjs/utils/getFileHash.cjs.map +1 -1
- package/dist/cjs/utils/getFormatFromExtension.cjs +1 -31
- package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -46
- package/dist/cjs/utils/pLimit.cjs +1 -128
- package/dist/cjs/utils/pLimit.cjs.map +1 -1
- package/dist/cjs/utils/parallelize.cjs +1 -11
- package/dist/cjs/utils/parallelize.cjs.map +1 -1
- package/dist/cjs/utils/parallelizeGlobal.cjs +1 -29
- package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -1
- package/dist/cjs/utils/reduceObjectFormat.cjs +1 -31
- package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -1
- package/dist/cjs/utils/resolveObjectPromises.cjs +1 -21
- package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -1
- package/dist/cjs/utils/runOnce.cjs +1 -95
- package/dist/cjs/utils/runOnce.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/bin.cjs +1 -54
- package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/bootstrap.cjs +1 -24
- package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/index.cjs +1 -110
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/pidTree.cjs +1 -145
- package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/ps.cjs +1 -49
- package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/runTask.cjs +1 -154
- package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnPosix.cjs +1 -59
- package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnWin32.cjs +1 -43
- package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/wmic.cjs +1 -52
- package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
- package/dist/cjs/utils/sortAlphabetically.cjs +1 -7
- package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -1
- package/dist/cjs/utils/splitTextByLine.cjs +1 -11
- package/dist/cjs/utils/splitTextByLine.cjs.map +1 -1
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +1 -60
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -1
- package/dist/cjs/watcher.cjs +1 -95
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeConfiguration/index.cjs +1 -34
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +1 -28
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs +1 -31
- package/dist/cjs/writeContentDeclaration/detectFormatCommand.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/index.cjs +1 -12
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +1 -93
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +2 -1775
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +1 -77
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -123
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +1 -71
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/cjs/writeFileIfChanged.cjs +1 -12
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
- package/dist/cjs/writeJsonIfChanged.cjs +1 -17
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -1
- package/dist/esm/_virtual/_rolldown/runtime.mjs +1 -8
- package/dist/esm/_virtual/_utils_asset.mjs +2 -97
- package/dist/esm/build.mjs +1 -24
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +1 -51
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/index.mjs +1 -4
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +1 -24
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +4 -75
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +4 -59
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -44
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +1 -48
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +1 -56
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
- package/dist/esm/cleanOutputDir.mjs +1 -28
- package/dist/esm/cleanOutputDir.mjs.map +1 -1
- package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -93
- package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
- package/dist/esm/cli.mjs +1 -8
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -68
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +7 -39
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +1 -21
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +1 -21
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +1 -20
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/index.mjs +1 -9
- package/dist/esm/createType/createModuleAugmentation.mjs +9 -106
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/createType/createType.mjs +1 -26
- package/dist/esm/createType/createType.mjs.map +1 -1
- package/dist/esm/createType/index.mjs +1 -4
- package/dist/esm/fetchDistantDictionaries.mjs +1 -48
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs +1 -46
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/formatDictionary.mjs +1 -44
- package/dist/esm/formatDictionary.mjs.map +1 -1
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +1 -37
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +1 -32
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileChange.mjs +1 -47
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileMoved.mjs +1 -22
- package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -35
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -57
- package/dist/esm/init/index.mjs +1 -240
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/configManipulation.mjs +1 -161
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
- package/dist/esm/init/utils/fileSystem.mjs +1 -26
- package/dist/esm/init/utils/fileSystem.mjs.map +1 -1
- package/dist/esm/init/utils/index.mjs +1 -6
- package/dist/esm/init/utils/jsonParser.mjs +3 -40
- package/dist/esm/init/utils/jsonParser.mjs.map +1 -1
- package/dist/esm/init/utils/tsConfig.mjs +1 -16
- package/dist/esm/init/utils/tsConfig.mjs.map +1 -1
- package/dist/esm/initConfig/index.mjs +1 -36
- package/dist/esm/initConfig/index.mjs.map +1 -1
- package/dist/esm/installSkills/index.mjs +1 -167
- package/dist/esm/installSkills/index.mjs.map +1 -1
- package/dist/esm/listDictionariesPath.mjs +1 -37
- package/dist/esm/listDictionariesPath.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +5 -90
- package/dist/esm/listGitFiles.mjs.map +1 -1
- package/dist/esm/listProjects.mjs +1 -43
- package/dist/esm/listProjects.mjs.map +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -65
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
- package/dist/esm/loadDictionaries/index.mjs +1 -6
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -69
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -123
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -26
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +1 -58
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/log.mjs +3 -132
- package/dist/esm/loadDictionaries/log.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +1 -92
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/applyMask.mjs +1 -28
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +1 -10
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
- package/dist/esm/transformFiles/extractDictionaryKey.mjs +1 -14
- package/dist/esm/transformFiles/extractDictionaryKey.mjs.map +1 -1
- package/dist/esm/transformFiles/index.mjs +1 -4
- package/dist/esm/transformFiles/transformFiles.mjs +1 -244
- package/dist/esm/transformFiles/transformFiles.mjs.map +1 -1
- package/dist/esm/utils/autoDecorateContent.mjs +1 -85
- package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
- package/dist/esm/utils/buildFilesList.mjs +1 -47
- package/dist/esm/utils/buildFilesList.mjs.map +1 -1
- package/dist/esm/utils/chunkJSON.mjs +1 -333
- package/dist/esm/utils/chunkJSON.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +1 -12
- package/dist/esm/utils/formatter.mjs.map +1 -1
- package/dist/esm/utils/getChunk.mjs +1 -33
- package/dist/esm/utils/getChunk.mjs.map +1 -1
- package/dist/esm/utils/getComponentTransformPattern.mjs +1 -44
- package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
- package/dist/esm/utils/getFileHash.mjs +1 -9
- package/dist/esm/utils/getFileHash.mjs.map +1 -1
- package/dist/esm/utils/getFormatFromExtension.mjs +1 -28
- package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -20
- package/dist/esm/utils/pLimit.mjs +1 -125
- package/dist/esm/utils/pLimit.mjs.map +1 -1
- package/dist/esm/utils/parallelize.mjs +1 -10
- package/dist/esm/utils/parallelize.mjs.map +1 -1
- package/dist/esm/utils/parallelizeGlobal.mjs +1 -26
- package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -1
- package/dist/esm/utils/reduceObjectFormat.mjs +1 -29
- package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -1
- package/dist/esm/utils/resolveObjectPromises.mjs +1 -19
- package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -1
- package/dist/esm/utils/runOnce.mjs +1 -92
- package/dist/esm/utils/runOnce.mjs.map +1 -1
- package/dist/esm/utils/runParallel/bin.mjs +1 -52
- package/dist/esm/utils/runParallel/bin.mjs.map +1 -1
- package/dist/esm/utils/runParallel/bootstrap.mjs +1 -22
- package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -1
- package/dist/esm/utils/runParallel/index.mjs +1 -108
- package/dist/esm/utils/runParallel/index.mjs.map +1 -1
- package/dist/esm/utils/runParallel/pidTree.mjs +1 -142
- package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -1
- package/dist/esm/utils/runParallel/ps.mjs +1 -46
- package/dist/esm/utils/runParallel/ps.mjs.map +1 -1
- package/dist/esm/utils/runParallel/runTask.mjs +1 -152
- package/dist/esm/utils/runParallel/runTask.mjs.map +1 -1
- package/dist/esm/utils/runParallel/spawnPosix.mjs +1 -57
- package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -1
- package/dist/esm/utils/runParallel/spawnWin32.mjs +1 -41
- package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -1
- package/dist/esm/utils/runParallel/wmic.mjs +1 -49
- package/dist/esm/utils/runParallel/wmic.mjs.map +1 -1
- package/dist/esm/utils/sortAlphabetically.mjs +1 -5
- package/dist/esm/utils/sortAlphabetically.mjs.map +1 -1
- package/dist/esm/utils/splitTextByLine.mjs +1 -9
- package/dist/esm/utils/splitTextByLine.mjs.map +1 -1
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs +1 -58
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -1
- package/dist/esm/watcher.mjs +1 -92
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeConfiguration/index.mjs +1 -31
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +1 -26
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs +1 -29
- package/dist/esm/writeContentDeclaration/detectFormatCommand.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/index.mjs +1 -7
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +1 -91
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +2 -1773
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +1 -75
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -121
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +1 -69
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/esm/writeFileIfChanged.mjs +1 -10
- package/dist/esm/writeFileIfChanged.mjs.map +1 -1
- package/dist/esm/writeJsonIfChanged.mjs +1 -16
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -1
- package/dist/types/build.d.ts +3 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/index.d.ts +16 -24
- package/dist/types/initConfig/index.d.ts +1 -1
- package/dist/types/initConfig/index.d.ts.map +1 -1
- package/dist/types/listGitFiles.d.ts.map +1 -1
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts.map +1 -1
- package/dist/types/transformFiles/transformFiles.d.ts +1 -1
- package/dist/types/transformFiles/transformFiles.d.ts.map +1 -1
- package/dist/types/utils/formatter.d.ts +1 -1
- package/dist/types/watcher.d.ts +1 -1
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
- package/package.json +10 -15
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1,21 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_init_index = require('./init/index.cjs');
|
|
3
|
-
const require_installSkills_index = require('./installSkills/index.cjs');
|
|
4
|
-
const require_listGitFiles = require('./listGitFiles.cjs');
|
|
5
|
-
const require_listProjects = require('./listProjects.cjs');
|
|
6
|
-
const require_transformFiles_extractDictionaryKey = require('./transformFiles/extractDictionaryKey.cjs');
|
|
7
|
-
const require_transformFiles_transformFiles = require('./transformFiles/transformFiles.cjs');
|
|
8
|
-
|
|
9
|
-
exports.ATTRIBUTES_TO_EXTRACT = require_transformFiles_transformFiles.ATTRIBUTES_TO_EXTRACT;
|
|
10
|
-
exports.SKILLS = require_installSkills_index.SKILLS;
|
|
11
|
-
exports.SKILLS_METADATA = require_installSkills_index.SKILLS_METADATA;
|
|
12
|
-
exports.extractDictionaryKey = require_transformFiles_extractDictionaryKey.extractDictionaryKey;
|
|
13
|
-
exports.extractIntlayer = require_transformFiles_transformFiles.extractIntlayer;
|
|
14
|
-
exports.generateKey = require_transformFiles_transformFiles.generateKey;
|
|
15
|
-
exports.initIntlayer = require_init_index.initIntlayer;
|
|
16
|
-
exports.installSkills = require_installSkills_index.installSkills;
|
|
17
|
-
exports.listGitFiles = require_listGitFiles.listGitFiles;
|
|
18
|
-
exports.listGitLines = require_listGitFiles.listGitLines;
|
|
19
|
-
exports.listProjects = require_listProjects.listProjects;
|
|
20
|
-
exports.shouldExtract = require_transformFiles_transformFiles.shouldExtract;
|
|
21
|
-
exports.transformFiles = require_transformFiles_transformFiles.transformFiles;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./init/index.cjs`),t=require(`./installSkills/index.cjs`),n=require(`./listGitFiles.cjs`),r=require(`./listProjects.cjs`),i=require(`./transformFiles/extractDictionaryKey.cjs`),a=require(`./transformFiles/transformFiles.cjs`);exports.ATTRIBUTES_TO_EXTRACT=a.ATTRIBUTES_TO_EXTRACT,exports.SKILLS=t.SKILLS,exports.SKILLS_METADATA=t.SKILLS_METADATA,exports.extractDictionaryKey=i.extractDictionaryKey,exports.extractIntlayer=a.extractIntlayer,exports.generateKey=a.generateKey,exports.initIntlayer=e.initIntlayer,exports.installSkills=t.installSkills,exports.listGitFiles=n.listGitFiles,exports.listGitLines=n.listGitLines,exports.listProjects=r.listProjects,exports.shouldExtract=a.shouldExtract,exports.transformFiles=a.transformFiles;
|
|
@@ -1,71 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_utils_parallelize = require('../utils/parallelize.cjs');
|
|
4
|
-
const require_writeFileIfChanged = require('../writeFileIfChanged.cjs');
|
|
5
|
-
const require_createDictionaryEntryPoint_generateDictionaryListContent = require('./generateDictionaryListContent.cjs');
|
|
6
|
-
const require_createDictionaryEntryPoint_getBuiltDictionariesPath = require('./getBuiltDictionariesPath.cjs');
|
|
7
|
-
const require_createDictionaryEntryPoint_getBuiltDynamicDictionariesPath = require('./getBuiltDynamicDictionariesPath.cjs');
|
|
8
|
-
const require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath = require('./getBuiltFetchDictionariesPath.cjs');
|
|
9
|
-
const require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath = require('./getBuiltRemoteDictionariesPath.cjs');
|
|
10
|
-
const require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath = require('./getBuiltUnmergedDictionariesPath.cjs');
|
|
11
|
-
let _intlayer_config = require("@intlayer/config");
|
|
12
|
-
let node_fs_promises = require("node:fs/promises");
|
|
13
|
-
let node_path = require("node:path");
|
|
14
|
-
|
|
15
|
-
//#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts
|
|
16
|
-
const writeDictionaryFiles = async (paths, fileName, importType, functionName, format, configuration = (0, _intlayer_config.getConfiguration)()) => {
|
|
17
|
-
const content = require_createDictionaryEntryPoint_generateDictionaryListContent.generateDictionaryListContent(await paths, functionName, importType, format, configuration);
|
|
18
|
-
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
19
|
-
const { mainDir } = configuration.system;
|
|
20
|
-
await require_writeFileIfChanged.writeFileIfChanged((0, node_path.resolve)(mainDir, `${fileName}.${extension}`), content);
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* This function generates a list of dictionaries in the main directory
|
|
24
|
-
*/
|
|
25
|
-
const createDictionaryEntryPoint = async (configuration = (0, _intlayer_config.getConfiguration)(), options = {}) => {
|
|
26
|
-
const { formats, excludeKeys = [] } = options;
|
|
27
|
-
const outputFormats = formats ?? configuration.build.outputFormat;
|
|
28
|
-
const { mainDir } = configuration.system;
|
|
29
|
-
await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
30
|
-
await require_utils_parallelize.parallelize([
|
|
31
|
-
...outputFormats.map((format) => ({
|
|
32
|
-
paths: require_createDictionaryEntryPoint_getBuiltDictionariesPath.getBuiltDictionariesPath(configuration, excludeKeys),
|
|
33
|
-
importType: "json",
|
|
34
|
-
functionName: "getDictionaries",
|
|
35
|
-
fileName: "dictionaries",
|
|
36
|
-
format
|
|
37
|
-
})),
|
|
38
|
-
...outputFormats.map((format) => ({
|
|
39
|
-
paths: require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath.getBuiltUnmergedDictionariesPath(configuration, excludeKeys),
|
|
40
|
-
importType: "json",
|
|
41
|
-
functionName: "getUnmergedDictionaries",
|
|
42
|
-
fileName: "unmerged_dictionaries",
|
|
43
|
-
format
|
|
44
|
-
})),
|
|
45
|
-
...outputFormats.map((format) => ({
|
|
46
|
-
paths: require_createDictionaryEntryPoint_getBuiltDynamicDictionariesPath.getBuiltDynamicDictionariesPath(configuration, format, excludeKeys),
|
|
47
|
-
importType: "javascript",
|
|
48
|
-
functionName: "getDynamicDictionaries",
|
|
49
|
-
fileName: "dynamic_dictionaries",
|
|
50
|
-
format
|
|
51
|
-
})),
|
|
52
|
-
...outputFormats.map((format) => ({
|
|
53
|
-
paths: require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath.getBuiltFetchDictionariesPath(configuration, format, excludeKeys),
|
|
54
|
-
importType: "javascript",
|
|
55
|
-
functionName: "getFetchDictionaries",
|
|
56
|
-
fileName: "fetch_dictionaries",
|
|
57
|
-
format
|
|
58
|
-
})),
|
|
59
|
-
...outputFormats.map((format) => ({
|
|
60
|
-
paths: require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath.getBuiltRemoteDictionariesPath(configuration, excludeKeys),
|
|
61
|
-
importType: "json",
|
|
62
|
-
functionName: "getRemoteDictionaries",
|
|
63
|
-
fileName: "remote_dictionaries",
|
|
64
|
-
format
|
|
65
|
-
}))
|
|
66
|
-
], async ({ paths, fileName, format, functionName, importType }) => writeDictionaryFiles(paths, fileName, importType, functionName, format, configuration));
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
|
-
exports.createDictionaryEntryPoint = createDictionaryEntryPoint;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`./generateDictionaryListContent.cjs`),r=require(`./getBuiltDictionariesPath.cjs`),i=require(`./getBuiltDynamicDictionariesPath.cjs`),a=require(`./getBuiltFetchDictionariesPath.cjs`),o=require(`./getBuiltRemoteDictionariesPath.cjs`),s=require(`./getBuiltUnmergedDictionariesPath.cjs`);let c=require(`@intlayer/config/node`),l=require(`node:fs/promises`),u=require(`node:path`);const d=async(e,r,i,a,o,s=(0,c.getConfiguration)())=>{let l=n.generateDictionaryListContent(await e,a,i,o,s),d=o===`cjs`?`cjs`:`mjs`,{mainDir:f}=s.system;await t.writeFileIfChanged((0,u.resolve)(f,`${r}.${d}`),l)},f=async(t=(0,c.getConfiguration)(),n={})=>{let{formats:u,excludeKeys:f=[]}=n,p=u??t.build.outputFormat,{mainDir:m}=t.system;await(0,l.mkdir)(m,{recursive:!0}),await e.parallelize([...p.map(e=>({paths:r.getBuiltDictionariesPath(t,f),importType:`json`,functionName:`getDictionaries`,fileName:`dictionaries`,format:e})),...p.map(e=>({paths:s.getBuiltUnmergedDictionariesPath(t,f),importType:`json`,functionName:`getUnmergedDictionaries`,fileName:`unmerged_dictionaries`,format:e})),...p.map(e=>({paths:i.getBuiltDynamicDictionariesPath(t,e,f),importType:`javascript`,functionName:`getDynamicDictionaries`,fileName:`dynamic_dictionaries`,format:e})),...p.map(e=>({paths:a.getBuiltFetchDictionariesPath(t,e,f),importType:`javascript`,functionName:`getFetchDictionaries`,fileName:`fetch_dictionaries`,format:e})),...p.map(e=>({paths:o.getBuiltRemoteDictionariesPath(t,f),importType:`json`,functionName:`getRemoteDictionaries`,fileName:`remote_dictionaries`,format:e}))],async({paths:e,fileName:n,format:r,functionName:i,importType:a})=>d(e,n,a,i,r,t))};exports.createDictionaryEntryPoint=f;
|
|
71
2
|
//# sourceMappingURL=createDictionaryEntryPoint.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createDictionaryEntryPoint.cjs","names":["generateDictionaryListContent","writeFileIfChanged","parallelize","getBuiltDictionariesPath","getBuiltUnmergedDictionariesPath","getBuiltDynamicDictionariesPath","getBuiltFetchDictionariesPath","getBuiltRemoteDictionariesPath"],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.system;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\nexport type CreateDictionaryEntryPointOptions = {\n formats?: ('cjs' | 'esm')[];\n excludeKeys?: string[];\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n options: CreateDictionaryEntryPointOptions = {}\n) => {\n const { formats, excludeKeys = [] } = options;\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.system;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"createDictionaryEntryPoint.cjs","names":["generateDictionaryListContent","writeFileIfChanged","parallelize","getBuiltDictionariesPath","getBuiltUnmergedDictionariesPath","getBuiltDynamicDictionariesPath","getBuiltFetchDictionariesPath","getBuiltRemoteDictionariesPath"],"sources":["../../../src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { generateDictionaryListContent } from './generateDictionaryListContent';\nimport { getBuiltDictionariesPath } from './getBuiltDictionariesPath';\nimport { getBuiltDynamicDictionariesPath } from './getBuiltDynamicDictionariesPath';\nimport { getBuiltFetchDictionariesPath } from './getBuiltFetchDictionariesPath';\nimport { getBuiltRemoteDictionariesPath } from './getBuiltRemoteDictionariesPath';\nimport { getBuiltUnmergedDictionariesPath } from './getBuiltUnmergedDictionariesPath';\n\nconst writeDictionaryFiles = async (\n paths: Promise<string[]>,\n fileName: string,\n importType: 'json' | 'javascript',\n functionName: string,\n format: 'cjs' | 'esm',\n configuration = getConfiguration()\n) => {\n const content = generateDictionaryListContent(\n await paths,\n functionName,\n importType,\n format,\n configuration\n );\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const { mainDir } = configuration.system;\n\n await writeFileIfChanged(\n resolve(mainDir, `${fileName}.${extension}`),\n content\n );\n};\n\nexport type CreateDictionaryEntryPointOptions = {\n formats?: ('cjs' | 'esm')[];\n excludeKeys?: string[];\n};\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const createDictionaryEntryPoint = async (\n configuration = getConfiguration(),\n options: CreateDictionaryEntryPointOptions = {}\n) => {\n const { formats, excludeKeys = [] } = options;\n const outputFormats = formats ?? configuration.build.outputFormat;\n const { mainDir } = configuration.system;\n\n await mkdir(mainDir, { recursive: true });\n\n const writeOperations = [\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getDictionaries',\n fileName: 'dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltUnmergedDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getUnmergedDictionaries',\n fileName: 'unmerged_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltDynamicDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getDynamicDictionaries',\n fileName: 'dynamic_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltFetchDictionariesPath(\n configuration,\n format,\n excludeKeys\n ),\n importType: 'javascript',\n functionName: 'getFetchDictionaries',\n fileName: 'fetch_dictionaries' as const,\n format,\n }) as const\n ),\n ...outputFormats.map(\n (format) =>\n ({\n paths: getBuiltRemoteDictionariesPath(configuration, excludeKeys),\n importType: 'json',\n functionName: 'getRemoteDictionaries',\n fileName: 'remote_dictionaries' as const,\n format,\n }) as const\n ),\n ];\n\n await parallelize(\n writeOperations,\n async ({ paths, fileName, format, functionName, importType }) =>\n writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":"skBAYA,MAAM,EAAuB,MAC3B,EACA,EACA,EACA,EACA,EACA,GAAA,EAAA,EAAA,mBAAkC,GAC/B,CACH,IAAM,EAAUA,EAAAA,8BACd,MAAM,EACN,EACA,EACA,EACA,EACD,CACK,EAAY,IAAW,MAAQ,MAAQ,MAEvC,CAAE,WAAY,EAAc,OAElC,MAAMC,EAAAA,oBAAAA,EAAAA,EAAAA,SACI,EAAS,GAAG,EAAS,GAAG,IAAY,CAC5C,EACD,EAWU,EAA6B,MACxC,GAAA,EAAA,EAAA,mBAAkC,CAClC,EAA6C,EAAE,GAC5C,CACH,GAAM,CAAE,UAAS,cAAc,EAAE,EAAK,EAChC,EAAgB,GAAW,EAAc,MAAM,aAC/C,CAAE,WAAY,EAAc,OAElC,MAAA,EAAA,EAAA,OAAY,EAAS,CAAE,UAAW,GAAM,CAAC,CA+DzC,MAAMC,EAAAA,YA7DkB,CACtB,GAAG,EAAc,IACd,IACE,CACC,MAAOC,EAAAA,yBAAyB,EAAe,EAAY,CAC3D,WAAY,OACZ,aAAc,kBACd,SAAU,eACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAOC,EAAAA,iCAAiC,EAAe,EAAY,CACnE,WAAY,OACZ,aAAc,0BACd,SAAU,wBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAOC,EAAAA,gCACL,EACA,EACA,EACD,CACD,WAAY,aACZ,aAAc,yBACd,SAAU,uBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAOC,EAAAA,8BACL,EACA,EACA,EACD,CACD,WAAY,aACZ,aAAc,uBACd,SAAU,qBACV,SACD,EACJ,CACD,GAAG,EAAc,IACd,IACE,CACC,MAAOC,EAAAA,+BAA+B,EAAe,EAAY,CACjE,WAAY,OACZ,aAAc,wBACd,SAAU,sBACV,SACD,EACJ,CACF,CAIC,MAAO,CAAE,QAAO,WAAU,SAAQ,eAAc,gBAC9C,EACE,EACA,EACA,EACA,EACA,EACA,EACD,CACJ"}
|
|
@@ -1,42 +1,8 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* This function generates the content of the dictionary list file
|
|
10
|
-
*/
|
|
11
|
-
const generateDictionaryListContent = (dictionaries, functionName, importType, format = "esm", configuration = (0, _intlayer_config.getConfiguration)()) => {
|
|
12
|
-
const { mainDir } = configuration.system;
|
|
13
|
-
let content = "";
|
|
14
|
-
const dictionariesRef = dictionaries.map((dictionaryPath) => ({
|
|
15
|
-
relativePath: (0, _intlayer_config.normalizePath)((0, node_path.relative)(mainDir, dictionaryPath)),
|
|
16
|
-
id: (0, node_path.basename)(dictionaryPath, (0, node_path.extname)(dictionaryPath)),
|
|
17
|
-
hash: `_${require_utils_getFileHash.getFileHash(dictionaryPath)}`
|
|
18
|
-
}));
|
|
19
|
-
dictionariesRef.forEach((dictionary) => {
|
|
20
|
-
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === "json" ? " with { type: 'json' }" : ""};\n`;
|
|
21
|
-
if (format === "cjs") content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\n`;
|
|
22
|
-
});
|
|
23
|
-
content += "\n";
|
|
24
|
-
const formattedDictionaryMap = dictionariesRef.map((dictionary) => ` "${dictionary.id}": ${dictionary.hash}`).join(",\n");
|
|
25
|
-
content += `const dictionaries = {\n${formattedDictionaryMap}\n};\n`;
|
|
26
|
-
content += `const ${functionName} = () => dictionaries;\n`;
|
|
27
|
-
if (format === "esm") {
|
|
28
|
-
content += `\n`;
|
|
29
|
-
content += `export { ${functionName} };\n`;
|
|
30
|
-
content += `export default dictionaries;\n`;
|
|
31
|
-
}
|
|
32
|
-
if (format === "cjs") {
|
|
33
|
-
content += `\n`;
|
|
34
|
-
content += `module.exports.${functionName} = ${functionName};\n`;
|
|
35
|
-
content += `module.exports = dictionaries;\n`;
|
|
36
|
-
}
|
|
37
|
-
return content;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.generateDictionaryListContent = generateDictionaryListContent;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/getFileHash.cjs`);let t=require(`@intlayer/config/node`),n=require(`node:path`),r=require(`@intlayer/config/utils`);const i=(i,a,o,s=`esm`,c=(0,t.getConfiguration)())=>{let{mainDir:l}=c.system,u=``,d=i.map(t=>({relativePath:(0,r.normalizePath)((0,n.relative)(l,t)),id:(0,n.basename)(t,(0,n.extname)(t)),hash:`_${e.getFileHash(t)}`}));d.forEach(e=>{s===`esm`&&(u+=`import ${e.hash} from '${e.relativePath}'${o===`json`?` with { type: 'json' }`:``};\n`),s===`cjs`&&(u+=`const ${e.hash} = require('${e.relativePath}');\n`)}),u+=`
|
|
2
|
+
`;let f=d.map(e=>` "${e.id}": ${e.hash}`).join(`,
|
|
3
|
+
`);return u+=`const dictionaries = {\n${f}\n};\n`,u+=`const ${a} = () => dictionaries;\n`,s===`esm`&&(u+=`
|
|
4
|
+
`,u+=`export { ${a} };\n`,u+=`export default dictionaries;
|
|
5
|
+
`),s===`cjs`&&(u+=`
|
|
6
|
+
`,u+=`module.exports.${a} = ${a};\n`,u+=`module.exports = dictionaries;
|
|
7
|
+
`),u};exports.generateDictionaryListContent=i;
|
|
42
8
|
//# sourceMappingURL=generateDictionaryListContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDictionaryListContent.cjs","names":["getFileHash"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.cjs","names":["getFileHash"],"sources":["../../../src/createDictionaryEntryPoint/generateDictionaryListContent.ts"],"sourcesContent":["import { basename, extname, relative } from 'node:path';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { normalizePath } from '@intlayer/config/utils';\nimport { getFileHash } from '../utils/getFileHash';\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryListContent = (\n dictionaries: string[],\n functionName: string,\n importType: 'json' | 'javascript',\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { mainDir } = configuration.system;\n\n let content = '';\n\n const dictionariesRef = dictionaries.map((dictionaryPath) => ({\n relativePath: normalizePath(relative(mainDir, dictionaryPath)),\n id: basename(dictionaryPath, extname(dictionaryPath)), // Get the base name as the dictionary id\n hash: `_${getFileHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\n // Import all dictionaries\n dictionariesRef.forEach((dictionary) => {\n if (format === 'esm')\n content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === 'json' ? \" with { type: 'json' }\" : ''};\\n`;\n if (format === 'cjs')\n content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\\n`;\n });\n\n content += '\\n';\n\n // Format Dictionary Map\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": ${dictionary.hash}`)\n .join(',\\n');\n\n content += `const dictionaries = {\\n${formattedDictionaryMap}\\n};\\n`;\n content += `const ${functionName} = () => dictionaries;\\n`;\n\n if (format === 'esm') {\n content += `\\n`;\n content += `export { ${functionName} };\\n`;\n content += `export default dictionaries;\\n`;\n }\n\n if (format === 'cjs') {\n content += `\\n`;\n content += `module.exports.${functionName} = ${functionName};\\n`;\n content += `module.exports = dictionaries;\\n`;\n }\n\n return content;\n};\n"],"mappings":"8PAQA,MAAa,GACX,EACA,EACA,EACA,EAAwB,MACxB,GAAA,EAAA,EAAA,mBAAkC,GACvB,CACX,GAAM,CAAE,WAAY,EAAc,OAE9B,EAAU,GAER,EAAkB,EAAa,IAAK,IAAoB,CAC5D,cAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,UAAqC,EAAS,EAAe,CAAC,CAC9D,IAAA,EAAA,EAAA,UAAa,GAAA,EAAA,EAAA,SAAwB,EAAe,CAAC,CACrD,KAAM,IAAIA,EAAAA,YAAY,EAAe,GACtC,EAAE,CAGH,EAAgB,QAAS,GAAe,CAClC,IAAW,QACb,GAAW,UAAU,EAAW,KAAK,SAAS,EAAW,aAAa,GAAG,IAAe,OAAS,yBAA2B,GAAG,MAC7H,IAAW,QACb,GAAW,SAAS,EAAW,KAAK,cAAc,EAAW,aAAa,SAC5E,CAEF,GAAW;EAGX,IAAM,EAAiC,EACpC,IAAK,GAAe,MAAM,EAAW,GAAG,KAAK,EAAW,OAAO,CAC/D,KAAK;EAAM,CAiBd,MAfA,IAAW,2BAA2B,EAAuB,QAC7D,GAAW,SAAS,EAAa,0BAE7B,IAAW,QACb,GAAW;EACX,GAAW,YAAY,EAAa,OACpC,GAAW;GAGT,IAAW,QACb,GAAW;EACX,GAAW,kBAAkB,EAAa,KAAK,EAAa,KAC5D,GAAW;GAGN"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
|
-
let fast_glob = require("fast-glob");
|
|
7
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
-
|
|
9
|
-
//#region src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts
|
|
10
|
-
/**
|
|
11
|
-
* This function generates a list of dictionaries in the main directory
|
|
12
|
-
*/
|
|
13
|
-
const getBuiltDictionariesPath = async (configuration, excludeKeys = []) => {
|
|
14
|
-
const { dictionariesDir, mainDir } = configuration.system;
|
|
15
|
-
if (!(0, node_fs.existsSync)(mainDir)) (0, node_fs.mkdirSync)(mainDir, { recursive: true });
|
|
16
|
-
return (await (0, fast_glob.default)(`${(0, _intlayer_config.normalizePath)(dictionariesDir)}/**/*.json`)).filter((path) => {
|
|
17
|
-
const key = (0, node_path.basename)(path, ".json");
|
|
18
|
-
return !excludeKeys.includes(key);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.getBuiltDictionariesPath = getBuiltDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`node:fs`),i=require(`fast-glob`);i=e.__toESM(i);const a=async(e,a=[])=>{let{dictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),(await(0,i.default)(`${(0,n.normalizePath)(o)}/**/*.json`)).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltDictionariesPath=a;
|
|
24
2
|
//# sourceMappingURL=getBuiltDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { dictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { dictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"kPASA,MAAa,EAA2B,MACtC,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,kBAAiB,WAAY,EAAc,OAWnD,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAgB,CAAC,YACnC,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
|
-
let fast_glob = require("fast-glob");
|
|
7
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
-
|
|
9
|
-
//#region src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts
|
|
10
|
-
/**
|
|
11
|
-
* This function generates a list of dictionaries in the main directory
|
|
12
|
-
*/
|
|
13
|
-
const getBuiltDynamicDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
|
|
14
|
-
const { dynamicDictionariesDir, mainDir } = configuration.system;
|
|
15
|
-
if (!(0, node_fs.existsSync)(mainDir)) (0, node_fs.mkdirSync)(mainDir, { recursive: true });
|
|
16
|
-
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
17
|
-
return (await (0, fast_glob.default)(`${(0, _intlayer_config.normalizePath)(dynamicDictionariesDir)}/**/*.${extension}`)).filter((path) => {
|
|
18
|
-
const key = (0, node_path.basename)(path, `.${extension}`);
|
|
19
|
-
return !excludeKeys.includes(key);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.getBuiltDynamicDictionariesPath = getBuiltDynamicDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`node:fs`),i=require(`fast-glob`);i=e.__toESM(i);const a=async(e,a=`esm`,o=[])=>{let{dynamicDictionariesDir:s,mainDir:c}=e.system;(0,r.existsSync)(c)||(0,r.mkdirSync)(c,{recursive:!0});let l=a===`cjs`?`cjs`:`mjs`;return(await(0,i.default)(`${(0,n.normalizePath)(s)}/**/*.${l}`)).filter(e=>{let n=(0,t.basename)(e,`.${l}`);return!o.includes(n)})};exports.getBuiltDynamicDictionariesPath=a;
|
|
25
2
|
//# sourceMappingURL=getBuiltDynamicDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltDynamicDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltDynamicDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"kPASA,MAAa,EAAkC,MAC7C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,yBAAwB,WAAY,EAAc,QAGtD,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAuB,CAAC,QAAQ,IAClD,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
|
-
let fast_glob = require("fast-glob");
|
|
7
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
-
|
|
9
|
-
//#region src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts
|
|
10
|
-
/**
|
|
11
|
-
* This function generates a list of dictionaries in the main directory
|
|
12
|
-
*/
|
|
13
|
-
const getBuiltFetchDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
|
|
14
|
-
const { fetchDictionariesDir, mainDir } = configuration.system;
|
|
15
|
-
if (!(0, node_fs.existsSync)(mainDir)) (0, node_fs.mkdirSync)(mainDir, { recursive: true });
|
|
16
|
-
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
17
|
-
return (await (0, fast_glob.default)(`${(0, _intlayer_config.normalizePath)(fetchDictionariesDir)}/**/*.${extension}`)).filter((path) => {
|
|
18
|
-
const key = (0, node_path.basename)(path, `.${extension}`);
|
|
19
|
-
return !excludeKeys.includes(key);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
//#endregion
|
|
24
|
-
exports.getBuiltFetchDictionariesPath = getBuiltFetchDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`node:fs`),i=require(`fast-glob`);i=e.__toESM(i);const a=async(e,a=`esm`,o=[])=>{let{fetchDictionariesDir:s,mainDir:c}=e.system;(0,r.existsSync)(c)||(0,r.mkdirSync)(c,{recursive:!0});let l=a===`cjs`?`cjs`:`mjs`;return(await(0,i.default)(`${(0,n.normalizePath)(s)}/**/*.${l}`)).filter(e=>{let n=(0,t.basename)(e,`.${l}`);return!o.includes(n)})};exports.getBuiltFetchDictionariesPath=a;
|
|
25
2
|
//# sourceMappingURL=getBuiltFetchDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltFetchDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltFetchDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"kPASA,MAAa,EAAgC,MAC3C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,uBAAsB,WAAY,EAAc,QAGpD,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAqB,CAAC,QAAQ,IAChD,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
|
-
let fast_glob = require("fast-glob");
|
|
7
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
-
|
|
9
|
-
//#region src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts
|
|
10
|
-
/**
|
|
11
|
-
* This function generates a list of dictionaries in the main directory
|
|
12
|
-
*/
|
|
13
|
-
const getBuiltRemoteDictionariesPath = async (configuration, excludeKeys = []) => {
|
|
14
|
-
const { remoteDictionariesDir, mainDir } = configuration.system;
|
|
15
|
-
if (!(0, node_fs.existsSync)(mainDir)) (0, node_fs.mkdirSync)(mainDir, { recursive: true });
|
|
16
|
-
return fast_glob.default.sync(`${(0, _intlayer_config.normalizePath)(remoteDictionariesDir)}/**/*.json`).filter((path) => {
|
|
17
|
-
const key = (0, node_path.basename)(path, ".json");
|
|
18
|
-
return !excludeKeys.includes(key);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.getBuiltRemoteDictionariesPath = getBuiltRemoteDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`node:fs`),i=require(`fast-glob`);i=e.__toESM(i);const a=async(e,a=[])=>{let{remoteDictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),i.default.sync(`${(0,n.normalizePath)(o)}/**/*.json`).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltRemoteDictionariesPath=a;
|
|
24
2
|
//# sourceMappingURL=getBuiltRemoteDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltRemoteDictionariesPath.cjs","names":["fg"],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltRemoteDictionariesPath.cjs","names":["fg"],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"kPASA,MAAa,EAAiC,MAC5C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,wBAAuB,WAAY,EAAc,OAWzD,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGNA,EAAAA,QAAG,KACpC,IAAA,EAAA,EAAA,eAAiB,EAAsB,CAAC,YACzC,CAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,24 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _intlayer_config = require("@intlayer/config");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
let node_fs = require("node:fs");
|
|
6
|
-
let fast_glob = require("fast-glob");
|
|
7
|
-
fast_glob = require_runtime.__toESM(fast_glob);
|
|
8
|
-
|
|
9
|
-
//#region src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts
|
|
10
|
-
/**
|
|
11
|
-
* This function generates a list of dictionaries in the main directory
|
|
12
|
-
*/
|
|
13
|
-
const getBuiltUnmergedDictionariesPath = async (configuration, excludeKeys = []) => {
|
|
14
|
-
const { unmergedDictionariesDir, mainDir } = configuration.system;
|
|
15
|
-
if (!(0, node_fs.existsSync)(mainDir)) (0, node_fs.mkdirSync)(mainDir, { recursive: true });
|
|
16
|
-
return (await (0, fast_glob.default)(`${(0, _intlayer_config.normalizePath)(unmergedDictionariesDir)}/**/*.json`)).filter((path) => {
|
|
17
|
-
const key = (0, node_path.basename)(path, ".json");
|
|
18
|
-
return !excludeKeys.includes(key);
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
exports.getBuiltUnmergedDictionariesPath = getBuiltUnmergedDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/utils`),r=require(`node:fs`),i=require(`fast-glob`);i=e.__toESM(i);const a=async(e,a=[])=>{let{unmergedDictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),(await(0,i.default)(`${(0,n.normalizePath)(o)}/**/*.json`)).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltUnmergedDictionariesPath=a;
|
|
24
2
|
//# sourceMappingURL=getBuiltUnmergedDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltUnmergedDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltUnmergedDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"kPASA,MAAa,EAAmC,MAC9C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,0BAAyB,WAAY,EAAc,OAW3D,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAwB,CAAC,YAC3C,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
const require_createDictionaryEntryPoint_generateDictionaryListContent = require('./generateDictionaryListContent.cjs');
|
|
3
|
-
const require_createDictionaryEntryPoint_getBuiltDictionariesPath = require('./getBuiltDictionariesPath.cjs');
|
|
4
|
-
const require_createDictionaryEntryPoint_getBuiltDynamicDictionariesPath = require('./getBuiltDynamicDictionariesPath.cjs');
|
|
5
|
-
const require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath = require('./getBuiltFetchDictionariesPath.cjs');
|
|
6
|
-
const require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath = require('./getBuiltRemoteDictionariesPath.cjs');
|
|
7
|
-
const require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath = require('./getBuiltUnmergedDictionariesPath.cjs');
|
|
8
|
-
const require_createDictionaryEntryPoint_createDictionaryEntryPoint = require('./createDictionaryEntryPoint.cjs');
|
|
9
|
-
|
|
10
|
-
exports.createDictionaryEntryPoint = require_createDictionaryEntryPoint_createDictionaryEntryPoint.createDictionaryEntryPoint;
|
|
11
|
-
exports.generateDictionaryListContent = require_createDictionaryEntryPoint_generateDictionaryListContent.generateDictionaryListContent;
|
|
12
|
-
exports.getBuiltDictionariesPath = require_createDictionaryEntryPoint_getBuiltDictionariesPath.getBuiltDictionariesPath;
|
|
13
|
-
exports.getBuiltDynamicDictionariesPath = require_createDictionaryEntryPoint_getBuiltDynamicDictionariesPath.getBuiltDynamicDictionariesPath;
|
|
14
|
-
exports.getBuiltFetchDictionariesPath = require_createDictionaryEntryPoint_getBuiltFetchDictionariesPath.getBuiltFetchDictionariesPath;
|
|
15
|
-
exports.getBuiltRemoteDictionariesPath = require_createDictionaryEntryPoint_getBuiltRemoteDictionariesPath.getBuiltRemoteDictionariesPath;
|
|
16
|
-
exports.getBuiltUnmergedDictionariesPath = require_createDictionaryEntryPoint_getBuiltUnmergedDictionariesPath.getBuiltUnmergedDictionariesPath;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./generateDictionaryListContent.cjs`),t=require(`./getBuiltDictionariesPath.cjs`),n=require(`./getBuiltDynamicDictionariesPath.cjs`),r=require(`./getBuiltFetchDictionariesPath.cjs`),i=require(`./getBuiltRemoteDictionariesPath.cjs`),a=require(`./getBuiltUnmergedDictionariesPath.cjs`),o=require(`./createDictionaryEntryPoint.cjs`);exports.createDictionaryEntryPoint=o.createDictionaryEntryPoint,exports.generateDictionaryListContent=e.generateDictionaryListContent,exports.getBuiltDictionariesPath=t.getBuiltDictionariesPath,exports.getBuiltDynamicDictionariesPath=n.getBuiltDynamicDictionariesPath,exports.getBuiltFetchDictionariesPath=r.getBuiltFetchDictionariesPath,exports.getBuiltRemoteDictionariesPath=i.getBuiltRemoteDictionariesPath,exports.getBuiltUnmergedDictionariesPath=a.getBuiltUnmergedDictionariesPath;
|
|
@@ -1,111 +1,10 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let zod_to_ts = require("zod-to-ts");
|
|
11
|
-
|
|
12
|
-
//#region src/createType/createModuleAugmentation.ts
|
|
13
|
-
const getTypeName = (key) => `${(0, _intlayer_config.kebabCaseToCamelCase)(key)}Content`;
|
|
14
|
-
/** Returns lines like: [Locales.FRENCH]: 1; */
|
|
15
|
-
const formatLocales = (locales) => locales.map((locale) => ` "${locale}": 1;`).join("\n");
|
|
16
|
-
const zodToTsString = (schema) => {
|
|
17
|
-
if (!schema) return "any";
|
|
18
|
-
const def = schema._def ?? schema.def ?? schema;
|
|
19
|
-
switch (def.typeName ?? def.type) {
|
|
20
|
-
case "ZodString":
|
|
21
|
-
case "string": return "string";
|
|
22
|
-
case "ZodNumber":
|
|
23
|
-
case "number": return "number";
|
|
24
|
-
case "ZodBoolean":
|
|
25
|
-
case "boolean": return "boolean";
|
|
26
|
-
case "ZodNull":
|
|
27
|
-
case "null": return "null";
|
|
28
|
-
case "ZodUndefined":
|
|
29
|
-
case "undefined": return "undefined";
|
|
30
|
-
case "ZodArray":
|
|
31
|
-
case "array": return `${zodToTsString(def.type ?? def.element)}[]`;
|
|
32
|
-
case "ZodObject":
|
|
33
|
-
case "object": {
|
|
34
|
-
const shape = typeof def.shape === "function" ? def.shape() : def.shape;
|
|
35
|
-
if (!shape) return "Record<string, any>";
|
|
36
|
-
return `{\n${Object.entries(shape).map(([k, v]) => ` "${k}": ${zodToTsString(v)};`).join("\n")}\n }`;
|
|
37
|
-
}
|
|
38
|
-
case "ZodOptional":
|
|
39
|
-
case "optional": return `${zodToTsString(def.innerType ?? def.wrapped)} | undefined`;
|
|
40
|
-
case "ZodNullable":
|
|
41
|
-
case "nullable": return `${zodToTsString(def.innerType ?? def.wrapped)} | null`;
|
|
42
|
-
case "ZodUnion":
|
|
43
|
-
case "union": return (def.options ?? []).map(zodToTsString).join(" | ");
|
|
44
|
-
case "ZodIntersection":
|
|
45
|
-
case "intersection": return `${zodToTsString(def.left)} & ${zodToTsString(def.right)}`;
|
|
46
|
-
case "ZodEnum":
|
|
47
|
-
case "enum": return (def.values ?? []).map((v) => `"${v}"`).join(" | ");
|
|
48
|
-
case "ZodLiteral":
|
|
49
|
-
case "literal": {
|
|
50
|
-
const value = def.value;
|
|
51
|
-
return typeof value === "string" ? `"${value}"` : String(value);
|
|
52
|
-
}
|
|
53
|
-
default: return "any";
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
/** Generate the content of the module augmentation file */
|
|
57
|
-
const generateTypeIndexContent = (typeFiles, configuration) => {
|
|
58
|
-
const { internationalization, system } = configuration;
|
|
59
|
-
const { moduleAugmentationDir } = system;
|
|
60
|
-
const { locales, requiredLocales, strictMode } = internationalization;
|
|
61
|
-
let fileContent = "import \"intlayer\";\n";
|
|
62
|
-
const dictionariesRef = typeFiles.map((dictionaryPath) => ({
|
|
63
|
-
relativePath: `./${(0, node_path.relative)(moduleAugmentationDir, dictionaryPath)}`,
|
|
64
|
-
id: (0, node_path.basename)(dictionaryPath, (0, node_path.extname)(dictionaryPath)),
|
|
65
|
-
hash: `_${require_utils_getFileHash.getFileHash(dictionaryPath)}`
|
|
66
|
-
}));
|
|
67
|
-
for (const dictionary of dictionariesRef) fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\n`;
|
|
68
|
-
fileContent += "\n";
|
|
69
|
-
const formattedDictionaryMap = dictionariesRef.map((dictionary) => ` "${dictionary.id}": typeof ${dictionary.hash};`).join("\n");
|
|
70
|
-
const declared = locales;
|
|
71
|
-
const requiredSanitized = requiredLocales?.length ? requiredLocales.filter((requiredLocales) => declared.includes(requiredLocales)) : declared;
|
|
72
|
-
const formattedDeclaredLocales = formatLocales(declared);
|
|
73
|
-
const formattedRequiredLocales = formatLocales(requiredSanitized);
|
|
74
|
-
const schemas = configuration.schemas ?? {};
|
|
75
|
-
const formattedSchemas = Object.entries(schemas).map(([key, schema]) => {
|
|
76
|
-
let typeStr = "any";
|
|
77
|
-
if (schema) try {
|
|
78
|
-
const { node } = (0, zod_to_ts.zodToTs)(schema, key);
|
|
79
|
-
if (node.kind !== 133) typeStr = (0, zod_to_ts.printNode)(node);
|
|
80
|
-
else typeStr = zodToTsString(schema);
|
|
81
|
-
} catch (_e) {
|
|
82
|
-
typeStr = zodToTsString(schema);
|
|
83
|
-
}
|
|
84
|
-
return ` "${key}": ${typeStr};`;
|
|
85
|
-
}).join("\n");
|
|
86
|
-
const strictKey = strictMode === "strict" ? "strict" : strictMode === "inclusive" ? "inclusive" : "loose";
|
|
87
|
-
/**
|
|
88
|
-
* Module augmentation that ONLY adds keys to registries.
|
|
89
|
-
* No types/aliases redefined here—avoids merge conflicts.
|
|
90
|
-
*/
|
|
91
|
-
fileContent += `declare module 'intlayer' {\n`;
|
|
92
|
-
fileContent += ` interface __DictionaryRegistry {\n${formattedDictionaryMap}\n }\n\n`;
|
|
93
|
-
fileContent += ` interface __DeclaredLocalesRegistry {\n${formattedDeclaredLocales}\n }\n\n`;
|
|
94
|
-
fileContent += ` interface __RequiredLocalesRegistry {\n${formattedRequiredLocales}\n }\n\n`;
|
|
95
|
-
fileContent += ` interface __SchemaRegistry {\n${formattedSchemas}\n }\n\n`;
|
|
96
|
-
fileContent += ` interface __StrictModeRegistry { mode: '${strictKey}' }\n`;
|
|
97
|
-
fileContent += `}\n`;
|
|
98
|
-
return fileContent;
|
|
99
|
-
};
|
|
100
|
-
/** Generate the index file merging all the types */
|
|
101
|
-
const createModuleAugmentation = async (configuration) => {
|
|
102
|
-
const { moduleAugmentationDir, typesDir } = configuration.system;
|
|
103
|
-
await (0, node_fs_promises.mkdir)(moduleAugmentationDir, { recursive: true });
|
|
104
|
-
const tsContent = generateTypeIndexContent(await (0, fast_glob.default)((0, _intlayer_config.normalizePath)(`${typesDir}/*.ts`), { ignore: ["**/*.d.ts"] }), configuration);
|
|
105
|
-
await require_writeFileIfChanged.writeFileIfChanged((0, node_path.join)(moduleAugmentationDir, "intlayer.d.ts"), tsContent);
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
//#endregion
|
|
109
|
-
exports.createModuleAugmentation = createModuleAugmentation;
|
|
110
|
-
exports.getTypeName = getTypeName;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`../utils/getFileHash.cjs`);let r=require(`node:fs/promises`),i=require(`node:path`),a=require(`@intlayer/config/utils`),o=require(`fast-glob`);o=e.__toESM(o);let s=require(`zod-to-ts`);const c=e=>`${(0,a.kebabCaseToCamelCase)(e)}Content`,l=e=>e.map(e=>` "${e}": 1;`).join(`
|
|
2
|
+
`),u=e=>{if(!e)return`any`;let t=e._def??e.def??e;switch(t.typeName??t.type){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodNull`:case`null`:return`null`;case`ZodUndefined`:case`undefined`:return`undefined`;case`ZodArray`:case`array`:return`${u(t.type??t.element)}[]`;case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{\n${Object.entries(e).map(([e,t])=>` "${e}": ${u(t)};`).join(`
|
|
3
|
+
`)}\n }`:`Record<string, any>`}case`ZodOptional`:case`optional`:return`${u(t.innerType??t.wrapped)} | undefined`;case`ZodNullable`:case`nullable`:return`${u(t.innerType??t.wrapped)} | null`;case`ZodUnion`:case`union`:return(t.options??[]).map(u).join(` | `);case`ZodIntersection`:case`intersection`:return`${u(t.left)} & ${u(t.right)}`;case`ZodEnum`:case`enum`:return(t.values??[]).map(e=>`"${e}"`).join(` | `);case`ZodLiteral`:case`literal`:{let e=t.value;return typeof e==`string`?`"${e}"`:String(e)}default:return`any`}},d=(e,t)=>{let{internationalization:r,system:a}=t,{moduleAugmentationDir:o}=a,{locales:c,requiredLocales:d,strictMode:f}=r,p=`import "intlayer";
|
|
4
|
+
`,m=e.map(e=>({relativePath:`./${(0,i.relative)(o,e)}`,id:(0,i.basename)(e,(0,i.extname)(e)),hash:`_${n.getFileHash(e)}`}));for(let e of m)p+=`import ${e.hash} from '${e.relativePath}';\n`;p+=`
|
|
5
|
+
`;let h=m.map(e=>` "${e.id}": typeof ${e.hash};`).join(`
|
|
6
|
+
`),g=c,_=d?.length?d.filter(e=>g.includes(e)):g,v=l(g),y=l(_),b=t.schemas??{},x=Object.entries(b).map(([e,t])=>{let n=`any`;if(t)try{let{node:r}=(0,s.zodToTs)(t,e);n=r.kind===133?u(t):(0,s.printNode)(r)}catch{n=u(t)}return` "${e}": ${n};`}).join(`
|
|
7
|
+
`),S=f===`strict`?`strict`:f===`inclusive`?`inclusive`:`loose`;return p+=`declare module 'intlayer' {
|
|
8
|
+
`,p+=` interface __DictionaryRegistry {\n${h}\n }\n\n`,p+=` interface __DeclaredLocalesRegistry {\n${v}\n }\n\n`,p+=` interface __RequiredLocalesRegistry {\n${y}\n }\n\n`,p+=` interface __SchemaRegistry {\n${x}\n }\n\n`,p+=` interface __StrictModeRegistry { mode: '${S}' }\n`,p+=`}
|
|
9
|
+
`,p},f=async e=>{let{moduleAugmentationDir:n,typesDir:s}=e.system;await(0,r.mkdir)(n,{recursive:!0});let c=d(await(0,o.default)((0,a.normalizePath)(`${s}/*.ts`),{ignore:[`**/*.d.ts`]}),e);await t.writeFileIfChanged((0,i.join)(n,`intlayer.d.ts`),c)};exports.createModuleAugmentation=f,exports.getTypeName=c;
|
|
111
10
|
//# sourceMappingURL=createModuleAugmentation.cjs.map
|