@intlayer/engine 9.0.0-canary.12
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 +330 -0
- package/dist/assets/initConfig/templates/cjs.txt +140 -0
- package/dist/assets/initConfig/templates/json.txt +98 -0
- package/dist/assets/initConfig/templates/mjs.txt +140 -0
- package/dist/assets/initConfig/templates/ts.txt +139 -0
- package/dist/assets/installSkills/LICENCE.md +201 -0
- package/dist/assets/installSkills/skills/angular.md +159 -0
- package/dist/assets/installSkills/skills/astro.md +40 -0
- package/dist/assets/installSkills/skills/cli.md +68 -0
- package/dist/assets/installSkills/skills/compiler.md +32 -0
- package/dist/assets/installSkills/skills/config.md +63 -0
- package/dist/assets/installSkills/skills/content.md +377 -0
- package/dist/assets/installSkills/skills/next-js.md +130 -0
- package/dist/assets/installSkills/skills/preact.md +83 -0
- package/dist/assets/installSkills/skills/react.md +105 -0
- package/dist/assets/installSkills/skills/remote-content.md +31 -0
- package/dist/assets/installSkills/skills/solid.md +90 -0
- package/dist/assets/installSkills/skills/svelte.md +84 -0
- package/dist/assets/installSkills/skills/usage.md +44 -0
- package/dist/assets/installSkills/skills/vue.md +56 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/cjs/_virtual/_utils_asset.cjs +98 -0
- package/dist/cjs/build.cjs +60 -0
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +80 -0
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/index.cjs +6 -0
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs +27 -0
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +206 -0
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +59 -0
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +49 -0
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +51 -0
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -0
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs +62 -0
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -0
- package/dist/cjs/cleanOutputDir.cjs +31 -0
- package/dist/cjs/cleanOutputDir.cjs.map +1 -0
- package/dist/cjs/cleanRemovedContentDeclaration.cjs +97 -0
- package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -0
- package/dist/cjs/cli.cjs +48 -0
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +71 -0
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +43 -0
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +25 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +26 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +26 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +25 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +25 -0
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
- package/dist/cjs/createDictionaryEntryPoint/index.cjs +16 -0
- package/dist/cjs/createType/createModuleAugmentation.cjs +126 -0
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -0
- package/dist/cjs/createType/createType.cjs +30 -0
- package/dist/cjs/createType/createType.cjs.map +1 -0
- package/dist/cjs/createType/index.cjs +8 -0
- package/dist/cjs/detectFormatCommand.cjs +33 -0
- package/dist/cjs/detectFormatCommand.cjs.map +1 -0
- package/dist/cjs/docReview/alignBlocks.cjs +79 -0
- package/dist/cjs/docReview/alignBlocks.cjs.map +1 -0
- package/dist/cjs/docReview/computeSimilarity.cjs +42 -0
- package/dist/cjs/docReview/computeSimilarity.cjs.map +1 -0
- package/dist/cjs/docReview/fingerprintBlock.cjs +35 -0
- package/dist/cjs/docReview/fingerprintBlock.cjs.map +1 -0
- package/dist/cjs/docReview/index.cjs +25 -0
- package/dist/cjs/docReview/mapChangedLinesToBlocks.cjs +27 -0
- package/dist/cjs/docReview/mapChangedLinesToBlocks.cjs.map +1 -0
- package/dist/cjs/docReview/normalizeBlock.cjs +34 -0
- package/dist/cjs/docReview/normalizeBlock.cjs.map +1 -0
- package/dist/cjs/docReview/pipeline.cjs +144 -0
- package/dist/cjs/docReview/pipeline.cjs.map +1 -0
- package/dist/cjs/docReview/planActions.cjs +58 -0
- package/dist/cjs/docReview/planActions.cjs.map +1 -0
- package/dist/cjs/docReview/rebuildDocument.cjs +65 -0
- package/dist/cjs/docReview/rebuildDocument.cjs.map +1 -0
- package/dist/cjs/docReview/reviewReport.cjs +200 -0
- package/dist/cjs/docReview/reviewReport.cjs.map +1 -0
- package/dist/cjs/docReview/segmentDocument.cjs +134 -0
- package/dist/cjs/docReview/segmentDocument.cjs.map +1 -0
- package/dist/cjs/docReview/types.cjs +0 -0
- package/dist/cjs/fetchDistantDictionaries.cjs +53 -0
- package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -0
- package/dist/cjs/filterInvalidDictionaries.cjs +57 -0
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -0
- package/dist/cjs/formatDictionary.cjs +60 -0
- package/dist/cjs/formatDictionary.cjs.map +1 -0
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +83 -0
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -0
- package/dist/cjs/getContentDeclarationFileTemplate/index.cjs +4 -0
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +35 -0
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -0
- package/dist/cjs/handleContentDeclarationFileChange.cjs +56 -0
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -0
- package/dist/cjs/handleContentDeclarationFileMoved.cjs +25 -0
- package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -0
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +38 -0
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -0
- package/dist/cjs/init/cms.cjs +140 -0
- package/dist/cjs/init/cms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/index.cjs +27 -0
- package/dist/cjs/init/frameworkSetup/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs +56 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/detect.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs +107 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs +163 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/restructure.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs +122 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/templates.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs +196 -0
- package/dist/cjs/init/frameworkSetup/nextAppRouter/transforms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs +31 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/detect.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs +76 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/index.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs +116 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/restructure.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs +106 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/templates.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs +141 -0
- package/dist/cjs/init/frameworkSetup/tanstackStart/transforms.cjs.map +1 -0
- package/dist/cjs/init/frameworkSetup/types.cjs +0 -0
- package/dist/cjs/init/index.cjs +521 -0
- package/dist/cjs/init/index.cjs.map +1 -0
- package/dist/cjs/init/utils/astImports.cjs +56 -0
- package/dist/cjs/init/utils/astImports.cjs.map +1 -0
- package/dist/cjs/init/utils/configManipulation.cjs +516 -0
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -0
- package/dist/cjs/init/utils/fileSystem.cjs +231 -0
- package/dist/cjs/init/utils/fileSystem.cjs.map +1 -0
- package/dist/cjs/init/utils/githubActions.cjs +159 -0
- package/dist/cjs/init/utils/githubActions.cjs.map +1 -0
- package/dist/cjs/init/utils/index.cjs +51 -0
- package/dist/cjs/init/utils/jsonParser.cjs +43 -0
- package/dist/cjs/init/utils/jsonParser.cjs.map +1 -0
- package/dist/cjs/init/utils/nextCompilerBabel.cjs +119 -0
- package/dist/cjs/init/utils/nextCompilerBabel.cjs.map +1 -0
- package/dist/cjs/init/utils/packageManager.cjs +303 -0
- package/dist/cjs/init/utils/packageManager.cjs.map +1 -0
- package/dist/cjs/init/utils/tsConfig.cjs +19 -0
- package/dist/cjs/init/utils/tsConfig.cjs.map +1 -0
- package/dist/cjs/initConfig/index.cjs +49 -0
- package/dist/cjs/initConfig/index.cjs.map +1 -0
- package/dist/cjs/installLSP.cjs +58 -0
- package/dist/cjs/installLSP.cjs.map +1 -0
- package/dist/cjs/installMCP/installMCP.cjs +51 -0
- package/dist/cjs/installMCP/installMCP.cjs.map +1 -0
- package/dist/cjs/installSkills/index.cjs +307 -0
- package/dist/cjs/installSkills/index.cjs.map +1 -0
- package/dist/cjs/listDictionariesPath.cjs +43 -0
- package/dist/cjs/listDictionariesPath.cjs.map +1 -0
- package/dist/cjs/listGitFiles.cjs +105 -0
- package/dist/cjs/listGitFiles.cjs.map +1 -0
- package/dist/cjs/listProjects.cjs +48 -0
- package/dist/cjs/listProjects.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +56 -0
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/index.cjs +14 -0
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +133 -0
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +128 -0
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +28 -0
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs +45 -0
- package/dist/cjs/loadDictionaries/loadMarkdownContentDeclaration.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs +63 -0
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/loadYamlContentDeclaration.cjs +27 -0
- package/dist/cjs/loadDictionaries/loadYamlContentDeclaration.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/log.cjs +138 -0
- package/dist/cjs/loadDictionaries/log.cjs.map +1 -0
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +64 -0
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -0
- package/dist/cjs/logConfigDetails.cjs +40 -0
- package/dist/cjs/logConfigDetails.cjs.map +1 -0
- package/dist/cjs/prepareIntlayer.cjs +104 -0
- package/dist/cjs/prepareIntlayer.cjs.map +1 -0
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs +31 -0
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -0
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +13 -0
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -0
- package/dist/cjs/scan/analyzeBundleContent.cjs +182 -0
- package/dist/cjs/scan/analyzeBundleContent.cjs.map +1 -0
- package/dist/cjs/scan/calculateScore.cjs +65 -0
- package/dist/cjs/scan/calculateScore.cjs.map +1 -0
- package/dist/cjs/scan/checks.cjs +274 -0
- package/dist/cjs/scan/checks.cjs.map +1 -0
- package/dist/cjs/scan/index.cjs +31 -0
- package/dist/cjs/scan/parseHtml.cjs +127 -0
- package/dist/cjs/scan/parseHtml.cjs.map +1 -0
- package/dist/cjs/scan/scanWebsite.cjs +205 -0
- package/dist/cjs/scan/scanWebsite.cjs.map +1 -0
- package/dist/cjs/scan/types.cjs +0 -0
- package/dist/cjs/utils/autoDecorateContent.cjs +90 -0
- package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -0
- package/dist/cjs/utils/buildComponentFilesList.cjs +94 -0
- package/dist/cjs/utils/buildComponentFilesList.cjs.map +1 -0
- package/dist/cjs/utils/buildFilesList.cjs +84 -0
- package/dist/cjs/utils/buildFilesList.cjs.map +1 -0
- package/dist/cjs/utils/chunkJSON.cjs +337 -0
- package/dist/cjs/utils/chunkJSON.cjs.map +1 -0
- package/dist/cjs/utils/formatter.cjs +18 -0
- package/dist/cjs/utils/formatter.cjs.map +1 -0
- package/dist/cjs/utils/getChunk.cjs +35 -0
- package/dist/cjs/utils/getChunk.cjs.map +1 -0
- package/dist/cjs/utils/getContentExtension.cjs +30 -0
- package/dist/cjs/utils/getContentExtension.cjs.map +1 -0
- package/dist/cjs/utils/getFormatFromExtension.cjs +41 -0
- package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -0
- package/dist/cjs/utils/getPathHash.cjs +22 -0
- package/dist/cjs/utils/getPathHash.cjs.map +1 -0
- package/dist/cjs/utils/index.cjs +50 -0
- package/dist/cjs/utils/mergeChunks.cjs +29 -0
- package/dist/cjs/utils/mergeChunks.cjs.map +1 -0
- package/dist/cjs/utils/pLimit.cjs +134 -0
- package/dist/cjs/utils/pLimit.cjs.map +1 -0
- package/dist/cjs/utils/parallelize.cjs +12 -0
- package/dist/cjs/utils/parallelize.cjs.map +1 -0
- package/dist/cjs/utils/parallelizeGlobal.cjs +30 -0
- package/dist/cjs/utils/parallelizeGlobal.cjs.map +1 -0
- package/dist/cjs/utils/readDictionariesFromDisk.cjs +25 -0
- package/dist/cjs/utils/readDictionariesFromDisk.cjs.map +1 -0
- package/dist/cjs/utils/reduceObjectFormat.cjs +70 -0
- package/dist/cjs/utils/reduceObjectFormat.cjs.map +1 -0
- package/dist/cjs/utils/resolveObjectPromises.cjs +22 -0
- package/dist/cjs/utils/resolveObjectPromises.cjs.map +1 -0
- package/dist/cjs/utils/resolveRelativePath.cjs +22 -0
- package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -0
- package/dist/cjs/utils/runOnce.cjs +96 -0
- package/dist/cjs/utils/runOnce.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/bin.cjs +55 -0
- package/dist/cjs/utils/runParallel/bin.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/bootstrap.cjs +25 -0
- package/dist/cjs/utils/runParallel/bootstrap.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/index.cjs +102 -0
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/pidTree.cjs +146 -0
- package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/ps.cjs +50 -0
- package/dist/cjs/utils/runParallel/ps.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/runTask.cjs +155 -0
- package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/spawnPosix.cjs +49 -0
- package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/spawnWin32.cjs +44 -0
- package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -0
- package/dist/cjs/utils/runParallel/wmic.cjs +53 -0
- package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -0
- package/dist/cjs/utils/sortAlphabetically.cjs +8 -0
- package/dist/cjs/utils/sortAlphabetically.cjs.map +1 -0
- package/dist/cjs/utils/splitTextByLine.cjs +12 -0
- package/dist/cjs/utils/splitTextByLine.cjs.map +1 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs +66 -0
- package/dist/cjs/utils/verifyIdenticObjectFormat.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +230 -0
- package/dist/cjs/watcher.cjs.map +1 -0
- package/dist/cjs/writeConfiguration/generateConfigurationContent.cjs +35 -0
- package/dist/cjs/writeConfiguration/generateConfigurationContent.cjs.map +1 -0
- package/dist/cjs/writeConfiguration/index.cjs +25 -0
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs +29 -0
- package/dist/cjs/writeContentDeclaration/detectExportedComponentName.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/dictionaryStatus.cjs +0 -0
- package/dist/cjs/writeContentDeclaration/index.cjs +10 -0
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +95 -0
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +417 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +128 -0
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +164 -0
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +93 -0
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs +66 -0
- package/dist/cjs/writeContentDeclaration/writeMarkdownFile.cjs.map +1 -0
- package/dist/cjs/writeContentDeclaration/writeYamlFile.cjs +44 -0
- package/dist/cjs/writeContentDeclaration/writeYamlFile.cjs.map +1 -0
- package/dist/cjs/writeFileIfChanged.cjs +51 -0
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -0
- package/dist/cjs/writeJsonIfChanged.cjs +18 -0
- package/dist/cjs/writeJsonIfChanged.cjs.map +1 -0
- package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
- package/dist/esm/_virtual/_utils_asset.mjs +97 -0
- package/dist/esm/build.mjs +26 -0
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +78 -0
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/index.mjs +4 -0
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs +25 -0
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +201 -0
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +56 -0
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +47 -0
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +49 -0
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -0
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs +59 -0
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -0
- package/dist/esm/cleanOutputDir.mjs +29 -0
- package/dist/esm/cleanOutputDir.mjs.map +1 -0
- package/dist/esm/cleanRemovedContentDeclaration.mjs +94 -0
- package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -0
- package/dist/esm/cli.mjs +20 -0
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +69 -0
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +41 -0
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +22 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +23 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +23 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +22 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +22 -0
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
- package/dist/esm/createDictionaryEntryPoint/index.mjs +9 -0
- package/dist/esm/createType/createModuleAugmentation.mjs +122 -0
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -0
- package/dist/esm/createType/createType.mjs +27 -0
- package/dist/esm/createType/createType.mjs.map +1 -0
- package/dist/esm/createType/index.mjs +4 -0
- package/dist/esm/detectFormatCommand.mjs +31 -0
- package/dist/esm/detectFormatCommand.mjs.map +1 -0
- package/dist/esm/docReview/alignBlocks.mjs +78 -0
- package/dist/esm/docReview/alignBlocks.mjs.map +1 -0
- package/dist/esm/docReview/computeSimilarity.mjs +39 -0
- package/dist/esm/docReview/computeSimilarity.mjs.map +1 -0
- package/dist/esm/docReview/fingerprintBlock.mjs +32 -0
- package/dist/esm/docReview/fingerprintBlock.mjs.map +1 -0
- package/dist/esm/docReview/index.mjs +12 -0
- package/dist/esm/docReview/mapChangedLinesToBlocks.mjs +25 -0
- package/dist/esm/docReview/mapChangedLinesToBlocks.mjs.map +1 -0
- package/dist/esm/docReview/normalizeBlock.mjs +32 -0
- package/dist/esm/docReview/normalizeBlock.mjs.map +1 -0
- package/dist/esm/docReview/pipeline.mjs +142 -0
- package/dist/esm/docReview/pipeline.mjs.map +1 -0
- package/dist/esm/docReview/planActions.mjs +56 -0
- package/dist/esm/docReview/planActions.mjs.map +1 -0
- package/dist/esm/docReview/rebuildDocument.mjs +62 -0
- package/dist/esm/docReview/rebuildDocument.mjs.map +1 -0
- package/dist/esm/docReview/reviewReport.mjs +196 -0
- package/dist/esm/docReview/reviewReport.mjs.map +1 -0
- package/dist/esm/docReview/segmentDocument.mjs +131 -0
- package/dist/esm/docReview/segmentDocument.mjs.map +1 -0
- package/dist/esm/docReview/types.mjs +0 -0
- package/dist/esm/fetchDistantDictionaries.mjs +51 -0
- package/dist/esm/fetchDistantDictionaries.mjs.map +1 -0
- package/dist/esm/filterInvalidDictionaries.mjs +53 -0
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -0
- package/dist/esm/formatDictionary.mjs +55 -0
- package/dist/esm/formatDictionary.mjs.map +1 -0
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +81 -0
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -0
- package/dist/esm/getContentDeclarationFileTemplate/index.mjs +3 -0
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +33 -0
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -0
- package/dist/esm/handleContentDeclarationFileChange.mjs +54 -0
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -0
- package/dist/esm/handleContentDeclarationFileMoved.mjs +23 -0
- package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -0
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +36 -0
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -0
- package/dist/esm/init/cms.mjs +131 -0
- package/dist/esm/init/cms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/index.mjs +26 -0
- package/dist/esm/init/frameworkSetup/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs +52 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/detect.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs +104 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs +157 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/restructure.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs +113 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/templates.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs +193 -0
- package/dist/esm/init/frameworkSetup/nextAppRouter/transforms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs +28 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/detect.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs +73 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/index.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs +108 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/restructure.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs +102 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/templates.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs +139 -0
- package/dist/esm/init/frameworkSetup/tanstackStart/transforms.mjs.map +1 -0
- package/dist/esm/init/frameworkSetup/types.mjs +0 -0
- package/dist/esm/init/index.mjs +518 -0
- package/dist/esm/init/index.mjs.map +1 -0
- package/dist/esm/init/utils/astImports.mjs +51 -0
- package/dist/esm/init/utils/astImports.mjs.map +1 -0
- package/dist/esm/init/utils/configManipulation.mjs +499 -0
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -0
- package/dist/esm/init/utils/fileSystem.mjs +222 -0
- package/dist/esm/init/utils/fileSystem.mjs.map +1 -0
- package/dist/esm/init/utils/githubActions.mjs +155 -0
- package/dist/esm/init/utils/githubActions.mjs.map +1 -0
- package/dist/esm/init/utils/index.mjs +10 -0
- package/dist/esm/init/utils/jsonParser.mjs +41 -0
- package/dist/esm/init/utils/jsonParser.mjs.map +1 -0
- package/dist/esm/init/utils/nextCompilerBabel.mjs +115 -0
- package/dist/esm/init/utils/nextCompilerBabel.mjs.map +1 -0
- package/dist/esm/init/utils/packageManager.mjs +294 -0
- package/dist/esm/init/utils/packageManager.mjs.map +1 -0
- package/dist/esm/init/utils/tsConfig.mjs +17 -0
- package/dist/esm/init/utils/tsConfig.mjs.map +1 -0
- package/dist/esm/initConfig/index.mjs +47 -0
- package/dist/esm/initConfig/index.mjs.map +1 -0
- package/dist/esm/installLSP.mjs +55 -0
- package/dist/esm/installLSP.mjs.map +1 -0
- package/dist/esm/installMCP/installMCP.mjs +47 -0
- package/dist/esm/installMCP/installMCP.mjs.map +1 -0
- package/dist/esm/installSkills/index.mjs +299 -0
- package/dist/esm/installSkills/index.mjs.map +1 -0
- package/dist/esm/listDictionariesPath.mjs +39 -0
- package/dist/esm/listDictionariesPath.mjs.map +1 -0
- package/dist/esm/listGitFiles.mjs +101 -0
- package/dist/esm/listGitFiles.mjs.map +1 -0
- package/dist/esm/listProjects.mjs +44 -0
- package/dist/esm/listProjects.mjs.map +1 -0
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +54 -0
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -0
- package/dist/esm/loadDictionaries/index.mjs +6 -0
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +128 -0
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +125 -0
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +26 -0
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs +43 -0
- package/dist/esm/loadDictionaries/loadMarkdownContentDeclaration.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs +60 -0
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -0
- package/dist/esm/loadDictionaries/loadYamlContentDeclaration.mjs +25 -0
- package/dist/esm/loadDictionaries/loadYamlContentDeclaration.mjs.map +1 -0
- package/dist/esm/loadDictionaries/log.mjs +135 -0
- package/dist/esm/loadDictionaries/log.mjs.map +1 -0
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +62 -0
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -0
- package/dist/esm/logConfigDetails.mjs +37 -0
- package/dist/esm/logConfigDetails.mjs.map +1 -0
- package/dist/esm/prepareIntlayer.mjs +100 -0
- package/dist/esm/prepareIntlayer.mjs.map +1 -0
- package/dist/esm/reduceDictionaryContent/applyMask.mjs +29 -0
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -0
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +11 -0
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -0
- package/dist/esm/scan/analyzeBundleContent.mjs +180 -0
- package/dist/esm/scan/analyzeBundleContent.mjs.map +1 -0
- package/dist/esm/scan/calculateScore.mjs +61 -0
- package/dist/esm/scan/calculateScore.mjs.map +1 -0
- package/dist/esm/scan/checks.mjs +265 -0
- package/dist/esm/scan/checks.mjs.map +1 -0
- package/dist/esm/scan/index.mjs +7 -0
- package/dist/esm/scan/parseHtml.mjs +115 -0
- package/dist/esm/scan/parseHtml.mjs.map +1 -0
- package/dist/esm/scan/scanWebsite.mjs +203 -0
- package/dist/esm/scan/scanWebsite.mjs.map +1 -0
- package/dist/esm/scan/types.mjs +0 -0
- package/dist/esm/utils/autoDecorateContent.mjs +87 -0
- package/dist/esm/utils/autoDecorateContent.mjs.map +1 -0
- package/dist/esm/utils/buildComponentFilesList.mjs +91 -0
- package/dist/esm/utils/buildComponentFilesList.mjs.map +1 -0
- package/dist/esm/utils/buildFilesList.mjs +80 -0
- package/dist/esm/utils/buildFilesList.mjs.map +1 -0
- package/dist/esm/utils/chunkJSON.mjs +334 -0
- package/dist/esm/utils/chunkJSON.mjs.map +1 -0
- package/dist/esm/utils/formatter.mjs +14 -0
- package/dist/esm/utils/formatter.mjs.map +1 -0
- package/dist/esm/utils/getChunk.mjs +34 -0
- package/dist/esm/utils/getChunk.mjs.map +1 -0
- package/dist/esm/utils/getContentExtension.mjs +28 -0
- package/dist/esm/utils/getContentExtension.mjs.map +1 -0
- package/dist/esm/utils/getFormatFromExtension.mjs +38 -0
- package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -0
- package/dist/esm/utils/getPathHash.mjs +20 -0
- package/dist/esm/utils/getPathHash.mjs.map +1 -0
- package/dist/esm/utils/index.mjs +22 -0
- package/dist/esm/utils/mergeChunks.mjs +27 -0
- package/dist/esm/utils/mergeChunks.mjs.map +1 -0
- package/dist/esm/utils/pLimit.mjs +131 -0
- package/dist/esm/utils/pLimit.mjs.map +1 -0
- package/dist/esm/utils/parallelize.mjs +11 -0
- package/dist/esm/utils/parallelize.mjs.map +1 -0
- package/dist/esm/utils/parallelizeGlobal.mjs +27 -0
- package/dist/esm/utils/parallelizeGlobal.mjs.map +1 -0
- package/dist/esm/utils/readDictionariesFromDisk.mjs +23 -0
- package/dist/esm/utils/readDictionariesFromDisk.mjs.map +1 -0
- package/dist/esm/utils/reduceObjectFormat.mjs +67 -0
- package/dist/esm/utils/reduceObjectFormat.mjs.map +1 -0
- package/dist/esm/utils/resolveObjectPromises.mjs +20 -0
- package/dist/esm/utils/resolveObjectPromises.mjs.map +1 -0
- package/dist/esm/utils/resolveRelativePath.mjs +20 -0
- package/dist/esm/utils/resolveRelativePath.mjs.map +1 -0
- package/dist/esm/utils/runOnce.mjs +93 -0
- package/dist/esm/utils/runOnce.mjs.map +1 -0
- package/dist/esm/utils/runParallel/bin.mjs +53 -0
- package/dist/esm/utils/runParallel/bin.mjs.map +1 -0
- package/dist/esm/utils/runParallel/bootstrap.mjs +23 -0
- package/dist/esm/utils/runParallel/bootstrap.mjs.map +1 -0
- package/dist/esm/utils/runParallel/index.mjs +100 -0
- package/dist/esm/utils/runParallel/index.mjs.map +1 -0
- package/dist/esm/utils/runParallel/pidTree.mjs +143 -0
- package/dist/esm/utils/runParallel/pidTree.mjs.map +1 -0
- package/dist/esm/utils/runParallel/ps.mjs +47 -0
- package/dist/esm/utils/runParallel/ps.mjs.map +1 -0
- package/dist/esm/utils/runParallel/runTask.mjs +153 -0
- package/dist/esm/utils/runParallel/runTask.mjs.map +1 -0
- package/dist/esm/utils/runParallel/spawnPosix.mjs +47 -0
- package/dist/esm/utils/runParallel/spawnPosix.mjs.map +1 -0
- package/dist/esm/utils/runParallel/spawnWin32.mjs +42 -0
- package/dist/esm/utils/runParallel/spawnWin32.mjs.map +1 -0
- package/dist/esm/utils/runParallel/wmic.mjs +50 -0
- package/dist/esm/utils/runParallel/wmic.mjs.map +1 -0
- package/dist/esm/utils/sortAlphabetically.mjs +6 -0
- package/dist/esm/utils/sortAlphabetically.mjs.map +1 -0
- package/dist/esm/utils/splitTextByLine.mjs +10 -0
- package/dist/esm/utils/splitTextByLine.mjs.map +1 -0
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs +64 -0
- package/dist/esm/utils/verifyIdenticObjectFormat.mjs.map +1 -0
- package/dist/esm/watcher.mjs +226 -0
- package/dist/esm/watcher.mjs.map +1 -0
- package/dist/esm/writeConfiguration/generateConfigurationContent.mjs +33 -0
- package/dist/esm/writeConfiguration/generateConfigurationContent.mjs.map +1 -0
- package/dist/esm/writeConfiguration/index.mjs +22 -0
- package/dist/esm/writeConfiguration/index.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs +27 -0
- package/dist/esm/writeContentDeclaration/detectExportedComponentName.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/dictionaryStatus.mjs +0 -0
- package/dist/esm/writeContentDeclaration/index.mjs +6 -0
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +92 -0
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +412 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +125 -0
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +162 -0
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +91 -0
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs +64 -0
- package/dist/esm/writeContentDeclaration/writeMarkdownFile.mjs.map +1 -0
- package/dist/esm/writeContentDeclaration/writeYamlFile.mjs +42 -0
- package/dist/esm/writeContentDeclaration/writeYamlFile.mjs.map +1 -0
- package/dist/esm/writeFileIfChanged.mjs +49 -0
- package/dist/esm/writeFileIfChanged.mjs.map +1 -0
- package/dist/esm/writeJsonIfChanged.mjs +17 -0
- package/dist/esm/writeJsonIfChanged.mjs.map +1 -0
- package/dist/types/build.d.ts +26 -0
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +25 -0
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/index.d.ts +3 -0
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +11 -0
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +77 -0
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +25 -0
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +40 -0
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +29 -0
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -0
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +34 -0
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -0
- package/dist/types/cleanOutputDir.d.ts +7 -0
- package/dist/types/cleanOutputDir.d.ts.map +1 -0
- package/dist/types/cleanRemovedContentDeclaration.d.ts +11 -0
- package/dist/types/cleanRemovedContentDeclaration.d.ts.map +1 -0
- package/dist/types/cli.d.ts +21 -0
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +14 -0
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +10 -0
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
- package/dist/types/createDictionaryEntryPoint/index.d.ts +8 -0
- package/dist/types/createType/createModuleAugmentation.d.ts +9 -0
- package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -0
- package/dist/types/createType/createType.d.ts +12 -0
- package/dist/types/createType/createType.d.ts.map +1 -0
- package/dist/types/createType/index.d.ts +3 -0
- package/dist/types/detectFormatCommand.d.ts +7 -0
- package/dist/types/detectFormatCommand.d.ts.map +1 -0
- package/dist/types/docReview/alignBlocks.d.ts +18 -0
- package/dist/types/docReview/alignBlocks.d.ts.map +1 -0
- package/dist/types/docReview/computeSimilarity.d.ts +22 -0
- package/dist/types/docReview/computeSimilarity.d.ts.map +1 -0
- package/dist/types/docReview/fingerprintBlock.d.ts +18 -0
- package/dist/types/docReview/fingerprintBlock.d.ts.map +1 -0
- package/dist/types/docReview/index.d.ts +12 -0
- package/dist/types/docReview/mapChangedLinesToBlocks.d.ts +15 -0
- package/dist/types/docReview/mapChangedLinesToBlocks.d.ts.map +1 -0
- package/dist/types/docReview/normalizeBlock.d.ts +18 -0
- package/dist/types/docReview/normalizeBlock.d.ts.map +1 -0
- package/dist/types/docReview/pipeline.d.ts +46 -0
- package/dist/types/docReview/pipeline.d.ts.map +1 -0
- package/dist/types/docReview/planActions.d.ts +18 -0
- package/dist/types/docReview/planActions.d.ts.map +1 -0
- package/dist/types/docReview/rebuildDocument.d.ts +46 -0
- package/dist/types/docReview/rebuildDocument.d.ts.map +1 -0
- package/dist/types/docReview/reviewReport.d.ts +82 -0
- package/dist/types/docReview/reviewReport.d.ts.map +1 -0
- package/dist/types/docReview/segmentDocument.d.ts +40 -0
- package/dist/types/docReview/segmentDocument.d.ts.map +1 -0
- package/dist/types/docReview/types.d.ts +73 -0
- package/dist/types/docReview/types.d.ts.map +1 -0
- package/dist/types/fetchDistantDictionaries.d.ts +16 -0
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -0
- package/dist/types/filterInvalidDictionaries.d.ts +12 -0
- package/dist/types/filterInvalidDictionaries.d.ts.map +1 -0
- package/dist/types/formatDictionary.d.ts +62 -0
- package/dist/types/formatDictionary.d.ts.map +1 -0
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +7 -0
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
- package/dist/types/getContentDeclarationFileTemplate/index.d.ts +2 -0
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts +7 -0
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts.map +1 -0
- package/dist/types/handleContentDeclarationFileChange.d.ts +7 -0
- package/dist/types/handleContentDeclarationFileChange.d.ts.map +1 -0
- package/dist/types/handleContentDeclarationFileMoved.d.ts +7 -0
- package/dist/types/handleContentDeclarationFileMoved.d.ts.map +1 -0
- package/dist/types/handleUnlinkedContentDeclarationFile.d.ts +7 -0
- package/dist/types/handleUnlinkedContentDeclarationFile.d.ts.map +1 -0
- package/dist/types/init/cms.d.ts +51 -0
- package/dist/types/init/cms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/index.d.ts +13 -0
- package/dist/types/init/frameworkSetup/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts +25 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/detect.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts +12 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts +56 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/restructure.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts +26 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/templates.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts +23 -0
- package/dist/types/init/frameworkSetup/nextAppRouter/transforms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts +19 -0
- package/dist/types/init/frameworkSetup/tanstackStart/detect.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts +13 -0
- package/dist/types/init/frameworkSetup/tanstackStart/index.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts +68 -0
- package/dist/types/init/frameworkSetup/tanstackStart/restructure.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts +22 -0
- package/dist/types/init/frameworkSetup/tanstackStart/templates.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts +17 -0
- package/dist/types/init/frameworkSetup/tanstackStart/transforms.d.ts.map +1 -0
- package/dist/types/init/frameworkSetup/types.d.ts +43 -0
- package/dist/types/init/frameworkSetup/types.d.ts.map +1 -0
- package/dist/types/init/index.d.ts +46 -0
- package/dist/types/init/index.d.ts.map +1 -0
- package/dist/types/init/utils/astImports.d.ts +29 -0
- package/dist/types/init/utils/astImports.d.ts.map +1 -0
- package/dist/types/init/utils/configManipulation.d.ts +99 -0
- package/dist/types/init/utils/configManipulation.d.ts.map +1 -0
- package/dist/types/init/utils/fileSystem.d.ts +111 -0
- package/dist/types/init/utils/fileSystem.d.ts.map +1 -0
- package/dist/types/init/utils/githubActions.d.ts +19 -0
- package/dist/types/init/utils/githubActions.d.ts.map +1 -0
- package/dist/types/init/utils/index.d.ts +9 -0
- package/dist/types/init/utils/jsonParser.d.ts +8 -0
- package/dist/types/init/utils/jsonParser.d.ts.map +1 -0
- package/dist/types/init/utils/nextCompilerBabel.d.ts +53 -0
- package/dist/types/init/utils/nextCompilerBabel.d.ts.map +1 -0
- package/dist/types/init/utils/packageManager.d.ts +149 -0
- package/dist/types/init/utils/packageManager.d.ts.map +1 -0
- package/dist/types/init/utils/tsConfig.d.ts +8 -0
- package/dist/types/init/utils/tsConfig.d.ts.map +1 -0
- package/dist/types/initConfig/index.d.ts +10 -0
- package/dist/types/initConfig/index.d.ts.map +1 -0
- package/dist/types/installLSP.d.ts +12 -0
- package/dist/types/installLSP.d.ts.map +1 -0
- package/dist/types/installMCP/installMCP.d.ts +11 -0
- package/dist/types/installMCP/installMCP.d.ts.map +1 -0
- package/dist/types/installSkills/index.d.ts +42 -0
- package/dist/types/installSkills/index.d.ts.map +1 -0
- package/dist/types/listDictionariesPath.d.ts +17 -0
- package/dist/types/listDictionariesPath.d.ts.map +1 -0
- package/dist/types/listGitFiles.d.ts +27 -0
- package/dist/types/listGitFiles.d.ts.map +1 -0
- package/dist/types/listProjects.d.ts +26 -0
- package/dist/types/listProjects.d.ts.map +1 -0
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts +7 -0
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts.map +1 -0
- package/dist/types/loadDictionaries/index.d.ts +5 -0
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +15 -0
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +23 -0
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +8 -0
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts +7 -0
- package/dist/types/loadDictionaries/loadMarkdownContentDeclaration.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +15 -0
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -0
- package/dist/types/loadDictionaries/loadYamlContentDeclaration.d.ts +7 -0
- package/dist/types/loadDictionaries/loadYamlContentDeclaration.d.ts.map +1 -0
- package/dist/types/loadDictionaries/log.d.ts +36 -0
- package/dist/types/loadDictionaries/log.d.ts.map +1 -0
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts +7 -0
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts.map +1 -0
- package/dist/types/logConfigDetails.d.ts +7 -0
- package/dist/types/logConfigDetails.d.ts.map +1 -0
- package/dist/types/prepareIntlayer.d.ts +15 -0
- package/dist/types/prepareIntlayer.d.ts.map +1 -0
- package/dist/types/reduceDictionaryContent/applyMask.d.ts +7 -0
- package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -0
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +7 -0
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -0
- package/dist/types/scan/analyzeBundleContent.d.ts +16 -0
- package/dist/types/scan/analyzeBundleContent.d.ts.map +1 -0
- package/dist/types/scan/calculateScore.d.ts +65 -0
- package/dist/types/scan/calculateScore.d.ts.map +1 -0
- package/dist/types/scan/checks.d.ts +38 -0
- package/dist/types/scan/checks.d.ts.map +1 -0
- package/dist/types/scan/index.d.ts +7 -0
- package/dist/types/scan/parseHtml.d.ts +54 -0
- package/dist/types/scan/parseHtml.d.ts.map +1 -0
- package/dist/types/scan/scanWebsite.d.ts +18 -0
- package/dist/types/scan/scanWebsite.d.ts.map +1 -0
- package/dist/types/scan/types.d.ts +76 -0
- package/dist/types/scan/types.d.ts.map +1 -0
- package/dist/types/utils/autoDecorateContent.d.ts +13 -0
- package/dist/types/utils/autoDecorateContent.d.ts.map +1 -0
- package/dist/types/utils/buildComponentFilesList.d.ts +28 -0
- package/dist/types/utils/buildComponentFilesList.d.ts.map +1 -0
- package/dist/types/utils/buildFilesList.d.ts +62 -0
- package/dist/types/utils/buildFilesList.d.ts.map +1 -0
- package/dist/types/utils/chunkJSON.d.ts +56 -0
- package/dist/types/utils/chunkJSON.d.ts.map +1 -0
- package/dist/types/utils/formatter.d.ts +9 -0
- package/dist/types/utils/formatter.d.ts.map +1 -0
- package/dist/types/utils/getChunk.d.ts +11 -0
- package/dist/types/utils/getChunk.d.ts.map +1 -0
- package/dist/types/utils/getContentExtension.d.ts +15 -0
- package/dist/types/utils/getContentExtension.d.ts.map +1 -0
- package/dist/types/utils/getFormatFromExtension.d.ts +8 -0
- package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -0
- package/dist/types/utils/getPathHash.d.ts +8 -0
- package/dist/types/utils/getPathHash.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +21 -0
- package/dist/types/utils/mergeChunks.d.ts +5 -0
- package/dist/types/utils/mergeChunks.d.ts.map +1 -0
- package/dist/types/utils/pLimit.d.ts +16 -0
- package/dist/types/utils/pLimit.d.ts.map +1 -0
- package/dist/types/utils/parallelize.d.ts +5 -0
- package/dist/types/utils/parallelize.d.ts.map +1 -0
- package/dist/types/utils/parallelizeGlobal.d.ts +20 -0
- package/dist/types/utils/parallelizeGlobal.d.ts.map +1 -0
- package/dist/types/utils/readDictionariesFromDisk.d.ts +9 -0
- package/dist/types/utils/readDictionariesFromDisk.d.ts.map +1 -0
- package/dist/types/utils/reduceObjectFormat.d.ts +30 -0
- package/dist/types/utils/reduceObjectFormat.d.ts.map +1 -0
- package/dist/types/utils/resolveObjectPromises.d.ts +9 -0
- package/dist/types/utils/resolveObjectPromises.d.ts.map +1 -0
- package/dist/types/utils/resolveRelativePath.d.ts +5 -0
- package/dist/types/utils/resolveRelativePath.d.ts.map +1 -0
- package/dist/types/utils/runOnce.d.ts +45 -0
- package/dist/types/utils/runOnce.d.ts.map +1 -0
- package/dist/types/utils/runParallel/bin.d.ts +15 -0
- package/dist/types/utils/runParallel/bin.d.ts.map +1 -0
- package/dist/types/utils/runParallel/bootstrap.d.ts +5 -0
- package/dist/types/utils/runParallel/bootstrap.d.ts.map +1 -0
- package/dist/types/utils/runParallel/index.d.ts +14 -0
- package/dist/types/utils/runParallel/index.d.ts.map +1 -0
- package/dist/types/utils/runParallel/pidTree.d.ts +24 -0
- package/dist/types/utils/runParallel/pidTree.d.ts.map +1 -0
- package/dist/types/utils/runParallel/ps.d.ts +11 -0
- package/dist/types/utils/runParallel/ps.d.ts.map +1 -0
- package/dist/types/utils/runParallel/runTask.d.ts +26 -0
- package/dist/types/utils/runParallel/runTask.d.ts.map +1 -0
- package/dist/types/utils/runParallel/spawnPosix.d.ts +20 -0
- package/dist/types/utils/runParallel/spawnPosix.d.ts.map +1 -0
- package/dist/types/utils/runParallel/spawnWin32.d.ts +20 -0
- package/dist/types/utils/runParallel/spawnWin32.d.ts.map +1 -0
- package/dist/types/utils/runParallel/wmic.d.ts +11 -0
- package/dist/types/utils/runParallel/wmic.d.ts.map +1 -0
- package/dist/types/utils/sortAlphabetically.d.ts +5 -0
- package/dist/types/utils/sortAlphabetically.d.ts.map +1 -0
- package/dist/types/utils/splitTextByLine.d.ts +5 -0
- package/dist/types/utils/splitTextByLine.d.ts.map +1 -0
- package/dist/types/utils/verifyIdenticObjectFormat.d.ts +23 -0
- package/dist/types/utils/verifyIdenticObjectFormat.d.ts.map +1 -0
- package/dist/types/watcher.d.ts +17 -0
- package/dist/types/watcher.d.ts.map +1 -0
- package/dist/types/writeConfiguration/generateConfigurationContent.d.ts +7 -0
- package/dist/types/writeConfiguration/generateConfigurationContent.d.ts.map +1 -0
- package/dist/types/writeConfiguration/index.d.ts +8 -0
- package/dist/types/writeConfiguration/index.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +12 -0
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +5 -0
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/index.d.ts +6 -0
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts +14 -0
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts +11 -0
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/transformJSONFile.d.ts +7 -0
- package/dist/types/writeContentDeclaration/transformJSONFile.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +19 -0
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +14 -0
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeMarkdownFile.d.ts +8 -0
- package/dist/types/writeContentDeclaration/writeMarkdownFile.d.ts.map +1 -0
- package/dist/types/writeContentDeclaration/writeYamlFile.d.ts +8 -0
- package/dist/types/writeContentDeclaration/writeYamlFile.d.ts.map +1 -0
- package/dist/types/writeFileIfChanged.d.ts +11 -0
- package/dist/types/writeFileIfChanged.d.ts.map +1 -0
- package/dist/types/writeJsonIfChanged.d.ts +9 -0
- package/dist/types/writeJsonIfChanged.d.ts.map +1 -0
- package/package.json +159 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_utils_parallelize = require('../utils/parallelize.cjs');
|
|
4
|
+
const require_writeJsonIfChanged = require('../writeJsonIfChanged.cjs');
|
|
5
|
+
const require_filterInvalidDictionaries = require('../filterInvalidDictionaries.cjs');
|
|
6
|
+
const require_buildIntlayerDictionary_writeUnmergedDictionary = require('./writeUnmergedDictionary.cjs');
|
|
7
|
+
const require_loadDictionaries_loadRemoteDictionaries = require('../loadDictionaries/loadRemoteDictionaries.cjs');
|
|
8
|
+
let node_fs_promises = require("node:fs/promises");
|
|
9
|
+
let node_path = require("node:path");
|
|
10
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
11
|
+
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
12
|
+
|
|
13
|
+
//#region src/buildIntlayerDictionary/writeRemoteDictionary.ts
|
|
14
|
+
/**
|
|
15
|
+
* Write the localized dictionaries to the dictionariesDir
|
|
16
|
+
* @param mergedDictionaries - The merged dictionaries
|
|
17
|
+
* @param configuration - The configuration
|
|
18
|
+
* @returns The final dictionaries
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
|
|
23
|
+
* const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
|
|
24
|
+
* console.log(finalDictionaries);
|
|
25
|
+
*
|
|
26
|
+
* // .intlayer/fetch_dictionaries/home.json
|
|
27
|
+
* // { key: 'home', content: { ... } },
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
const writeRemoteDictionary = async (remoteDictionaries, configuration) => {
|
|
31
|
+
const { remoteDictionariesDir } = configuration.system;
|
|
32
|
+
await (0, node_fs_promises.mkdir)((0, node_path.resolve)(remoteDictionariesDir), { recursive: true });
|
|
33
|
+
const groupedDictionaries = require_buildIntlayerDictionary_writeUnmergedDictionary.groupDictionariesByKey(require_filterInvalidDictionaries.filterInvalidDictionaries(remoteDictionaries, configuration));
|
|
34
|
+
const results = await require_utils_parallelize.parallelize(Object.entries(groupedDictionaries), async ([key, dictionaries]) => {
|
|
35
|
+
if (key === "undefined") return;
|
|
36
|
+
const orderedDictionaries = (0, _intlayer_core_dictionaryManipulator.orderDictionaries)(require_loadDictionaries_loadRemoteDictionaries.formatDistantDictionaries(dictionaries));
|
|
37
|
+
const unmergedFilePath = (0, node_path.resolve)(remoteDictionariesDir, `${key}.json`);
|
|
38
|
+
await require_writeJsonIfChanged.writeJsonIfChanged(unmergedFilePath, orderedDictionaries).catch((err) => {
|
|
39
|
+
console.error(`${_intlayer_config_logger.x} Error creating unmerged ${(0, _intlayer_config_logger.colorizePath)(unmergedFilePath)}:`, err);
|
|
40
|
+
});
|
|
41
|
+
return [key, {
|
|
42
|
+
dictionaryPath: unmergedFilePath,
|
|
43
|
+
dictionaries
|
|
44
|
+
}];
|
|
45
|
+
});
|
|
46
|
+
return Object.fromEntries(results.filter(Boolean));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.writeRemoteDictionary = writeRemoteDictionary;
|
|
51
|
+
//# sourceMappingURL=writeRemoteDictionary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeRemoteDictionary.cjs","names":["groupDictionariesByKey","filterInvalidDictionaries","parallelize","formatDistantDictionaries","writeJsonIfChanged","x"],"sources":["../../../src/buildIntlayerDictionary/writeRemoteDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { colorizePath, x } from '@intlayer/config/logger';\nimport { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { filterInvalidDictionaries } from '../filterInvalidDictionaries';\nimport { formatDistantDictionaries } from '../loadDictionaries';\nimport { parallelize } from '../utils/parallelize';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\nimport {\n groupDictionariesByKey,\n type UnmergedDictionaryResult,\n} from './writeUnmergedDictionary';\n\nexport type RemoteDictionaryResult = {\n dictionaryPath: string;\n dictionaries: Dictionary[];\n};\n\nexport type RemoteDictionaryOutput = Record<string, RemoteDictionaryResult>;\n\n/**\n * Write the localized dictionaries to the dictionariesDir\n * @param mergedDictionaries - The merged dictionaries\n * @param configuration - The configuration\n * @returns The final dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);\n * console.log(finalDictionaries);\n *\n * // .intlayer/fetch_dictionaries/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeRemoteDictionary = async (\n remoteDictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Promise<RemoteDictionaryOutput> => {\n const { remoteDictionariesDir } = configuration.system;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(remoteDictionariesDir), { recursive: true });\n\n const filteredDictionaries = filterInvalidDictionaries(\n remoteDictionaries,\n configuration\n );\n\n // Group dictionaries by key and write to unmergedDictionariesDir\n const groupedDictionaries = groupDictionariesByKey(filteredDictionaries);\n\n // Merge dictionaries with the same key and write to dictionariesDir\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionaries]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n UnmergedDictionaryResult,\n ];\n }\n\n const formattedDictionaries = formatDistantDictionaries(dictionaries);\n\n const orderedDictionaries = orderDictionaries(formattedDictionaries);\n\n const outputFileName = `${key}.json`;\n const unmergedFilePath = resolve(remoteDictionariesDir, outputFileName);\n\n // Write the grouped dictionaries\n await writeJsonIfChanged(unmergedFilePath, orderedDictionaries).catch(\n (err) => {\n console.error(\n `${x} Error creating unmerged ${colorizePath(unmergedFilePath)}:`,\n err\n );\n }\n );\n\n return [\n key,\n {\n dictionaryPath: unmergedFilePath,\n dictionaries,\n } as UnmergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<\n readonly [string, UnmergedDictionaryResult]\n >\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAa,wBAAwB,OACnC,oBACA,kBACoC;CACpC,MAAM,EAAE,0BAA0B,cAAc;AAGhD,0DAAoB,sBAAsB,EAAE,EAAE,WAAW,MAAM,CAAC;CAQhE,MAAM,sBAAsBA,+EANCC,4DAC3B,oBACA,cAIqE,CAAC;CAGxE,MAAM,UAAU,MAAMC,sCACpB,OAAO,QAAQ,oBAAoB,EACnC,OAAO,CAAC,KAAK,kBAAkB;AAC7B,MAAI,QAAQ,YACV;EAQF,MAAM,kFAFwBC,0EAA0B,aAEW,CAAC;EAGpE,MAAM,0CAA2B,uBAAuB,GAD9B,IAAI,OACyC;AAGvE,QAAMC,8CAAmB,kBAAkB,oBAAoB,CAAC,OAC7D,QAAQ;AACP,WAAQ,MACN,GAAGC,0BAAE,qEAAwC,iBAAiB,CAAC,IAC/D,IACD;IAEJ;AAED,SAAO,CACL,KACA;GACE,gBAAgB;GAChB;GACD,CACF;GAEJ;AAED,QAAO,OAAO,YACZ,QAAQ,OAAO,QAAQ,CAGxB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_utils_parallelize = require('../utils/parallelize.cjs');
|
|
4
|
+
const require_writeJsonIfChanged = require('../writeJsonIfChanged.cjs');
|
|
5
|
+
const require_filterInvalidDictionaries = require('../filterInvalidDictionaries.cjs');
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
9
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
10
|
+
let _intlayer_core_dictionaryManipulator = require("@intlayer/core/dictionaryManipulator");
|
|
11
|
+
|
|
12
|
+
//#region src/buildIntlayerDictionary/writeUnmergedDictionary.ts
|
|
13
|
+
const groupDictionariesByKey = (dictionaries) => dictionaries.reduce((acc, dictionary) => {
|
|
14
|
+
const key = dictionary.key;
|
|
15
|
+
if (!acc[key]) acc[key] = [];
|
|
16
|
+
acc[key].push(dictionary);
|
|
17
|
+
return acc;
|
|
18
|
+
}, {});
|
|
19
|
+
/**
|
|
20
|
+
* Write the unmerged dictionaries to the unmergedDictionariesDir
|
|
21
|
+
* @param dictionaries - The dictionaries to write
|
|
22
|
+
* @param configuration - The configuration
|
|
23
|
+
* @returns The grouped dictionaries
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
|
|
28
|
+
* console.log(unmergedDictionaries);
|
|
29
|
+
*
|
|
30
|
+
* // .intlayer/unmerged_dictionaries/home.json
|
|
31
|
+
* // {
|
|
32
|
+
* // [
|
|
33
|
+
* // { key: 'home', content: { ... } },
|
|
34
|
+
* // { key: 'home', content: { ... } },
|
|
35
|
+
* // ],
|
|
36
|
+
* // }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
const writeUnmergedDictionaries = async (dictionaries, configuration, env) => {
|
|
40
|
+
const { unmergedDictionariesDir } = configuration.system;
|
|
41
|
+
await (0, node_fs_promises.mkdir)((0, node_path.resolve)(unmergedDictionariesDir), { recursive: true });
|
|
42
|
+
const groupedDictionaries = groupDictionariesByKey(require_filterInvalidDictionaries.filterInvalidDictionaries(dictionaries, configuration, { checkSchema: true }));
|
|
43
|
+
const results = await require_utils_parallelize.parallelize(Object.entries(groupedDictionaries), async ([key, dictionaries]) => {
|
|
44
|
+
if (key === "undefined") return;
|
|
45
|
+
const orderedDictionaries = (0, _intlayer_core_dictionaryManipulator.orderDictionaries)(dictionaries);
|
|
46
|
+
const unmergedFilePath = (0, node_path.resolve)(unmergedDictionariesDir, `${key}.json`);
|
|
47
|
+
(0, _intlayer_config_utils.assertPathWithin)(unmergedFilePath, unmergedDictionariesDir);
|
|
48
|
+
if (configuration.editor.enabled || env === "dev") await require_writeJsonIfChanged.writeJsonIfChanged(unmergedFilePath, orderedDictionaries).catch((err) => {
|
|
49
|
+
console.error(`${_intlayer_config_logger.x} Error creating unmerged ${(0, _intlayer_config_logger.colorizePath)(unmergedFilePath)}:`, err);
|
|
50
|
+
});
|
|
51
|
+
return [key, {
|
|
52
|
+
dictionaryPath: unmergedFilePath,
|
|
53
|
+
dictionaries
|
|
54
|
+
}];
|
|
55
|
+
});
|
|
56
|
+
return Object.fromEntries(results.filter(Boolean));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//#endregion
|
|
60
|
+
exports.groupDictionariesByKey = groupDictionariesByKey;
|
|
61
|
+
exports.writeUnmergedDictionaries = writeUnmergedDictionaries;
|
|
62
|
+
//# sourceMappingURL=writeUnmergedDictionary.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writeUnmergedDictionary.cjs","names":["filterInvalidDictionaries","parallelize","writeJsonIfChanged","x"],"sources":["../../../src/buildIntlayerDictionary/writeUnmergedDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { colorizePath, x } from '@intlayer/config/logger';\nimport { assertPathWithin } from '@intlayer/config/utils';\nimport { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary, DictionaryKey } from '@intlayer/types/dictionary';\nimport { filterInvalidDictionaries } from '../filterInvalidDictionaries';\nimport { parallelize } from '../utils/parallelize';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\n\nexport const groupDictionariesByKey = (\n dictionaries: Dictionary[]\n): Record<string, Dictionary[]> =>\n dictionaries.reduce(\n (acc, dictionary) => {\n const key = dictionary.key;\n if (!acc[key]) {\n acc[key] = [];\n }\n acc[key].push(dictionary);\n return acc;\n },\n {} as Record<string, Dictionary[]>\n );\n\nexport type UnmergedDictionaryResult = {\n dictionaryPath: string;\n dictionaries: Dictionary[];\n};\n\nexport type UnmergedDictionaryOutput = Record<\n DictionaryKey,\n UnmergedDictionaryResult\n>;\n\n/**\n * Write the unmerged dictionaries to the unmergedDictionariesDir\n * @param dictionaries - The dictionaries to write\n * @param configuration - The configuration\n * @returns The grouped dictionaries\n *\n * @example\n * ```ts\n * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);\n * console.log(unmergedDictionaries);\n *\n * // .intlayer/unmerged_dictionaries/home.json\n * // {\n * // [\n * // { key: 'home', content: { ... } },\n * // { key: 'home', content: { ... } },\n * // ],\n * // }\n * ```\n */\nexport const writeUnmergedDictionaries = async (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig,\n env: 'prod' | 'dev'\n): Promise<UnmergedDictionaryOutput> => {\n const { unmergedDictionariesDir } = configuration.system;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(unmergedDictionariesDir), { recursive: true });\n\n const filteredDictionaries = filterInvalidDictionaries(\n dictionaries,\n configuration,\n { checkSchema: true }\n );\n\n // Group dictionaries by key and write to unmergedDictionariesDir\n const groupedDictionaries = groupDictionariesByKey(filteredDictionaries);\n\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionaries]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n UnmergedDictionaryResult,\n ];\n }\n\n const orderedDictionaries = orderDictionaries(dictionaries);\n\n const outputFileName = `${key}.json`;\n const unmergedFilePath = resolve(unmergedDictionariesDir, outputFileName);\n\n assertPathWithin(unmergedFilePath, unmergedDictionariesDir);\n\n // Write the grouped dictionaries in disk if the editor is enabled\n // To make work the visual editor on the server\n // No need them if the editor is disabled\n // But in local env (env: 'dev') we write them for the vscode extension\n if (configuration.editor.enabled || env === 'dev') {\n await writeJsonIfChanged(unmergedFilePath, orderedDictionaries).catch(\n (err) => {\n console.error(\n `${x} Error creating unmerged ${colorizePath(unmergedFilePath)}:`,\n err\n );\n }\n );\n }\n\n return [\n key,\n {\n dictionaryPath: unmergedFilePath,\n dictionaries: dictionaries,\n } as UnmergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<\n readonly [string, UnmergedDictionaryResult]\n >\n );\n};\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,0BACX,iBAEA,aAAa,QACV,KAAK,eAAe;CACnB,MAAM,MAAM,WAAW;AACvB,KAAI,CAAC,IAAI,KACP,KAAI,OAAO,EAAE;AAEf,KAAI,KAAK,KAAK,WAAW;AACzB,QAAO;GAET,EAAE,CACH;;;;;;;;;;;;;;;;;;;;;AAgCH,MAAa,4BAA4B,OACvC,cACA,eACA,QACsC;CACtC,MAAM,EAAE,4BAA4B,cAAc;AAGlD,0DAAoB,wBAAwB,EAAE,EAAE,WAAW,MAAM,CAAC;CASlE,MAAM,sBAAsB,uBAPCA,4DAC3B,cACA,eACA,EAAE,aAAa,MAAM,CAIgD,CAAC;CAExE,MAAM,UAAU,MAAMC,sCACpB,OAAO,QAAQ,oBAAoB,EACnC,OAAO,CAAC,KAAK,kBAAkB;AAC7B,MAAI,QAAQ,YACV;EAMF,MAAM,kFAAwC,aAAa;EAG3D,MAAM,0CAA2B,yBAAyB,GADhC,IAAI,OAC2C;AAEzE,+CAAiB,kBAAkB,wBAAwB;AAM3D,MAAI,cAAc,OAAO,WAAW,QAAQ,MAC1C,OAAMC,8CAAmB,kBAAkB,oBAAoB,CAAC,OAC7D,QAAQ;AACP,WAAQ,MACN,GAAGC,0BAAE,qEAAwC,iBAAiB,CAAC,IAC/D,IACD;IAEJ;AAGH,SAAO,CACL,KACA;GACE,gBAAgB;GACF;GACf,CACF;GAEJ;AAED,QAAO,OAAO,YACZ,QAAQ,OAAO,QAAQ,CAGxB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
5
|
+
let node_fs = require("node:fs");
|
|
6
|
+
|
|
7
|
+
//#region src/cleanOutputDir.ts
|
|
8
|
+
const cleanOutputDir = async (configuration) => {
|
|
9
|
+
const { dictionariesDir, unmergedDictionariesDir, dynamicDictionariesDir, remoteDictionariesDir, fetchDictionariesDir, mainDir, typesDir, configDir, cacheDir } = configuration.system;
|
|
10
|
+
const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration);
|
|
11
|
+
const directoriesToClean = [
|
|
12
|
+
dictionariesDir,
|
|
13
|
+
unmergedDictionariesDir,
|
|
14
|
+
dynamicDictionariesDir,
|
|
15
|
+
remoteDictionariesDir,
|
|
16
|
+
fetchDictionariesDir,
|
|
17
|
+
mainDir,
|
|
18
|
+
typesDir,
|
|
19
|
+
configDir,
|
|
20
|
+
cacheDir
|
|
21
|
+
];
|
|
22
|
+
await Promise.all(directoriesToClean.filter((dir) => (0, node_fs.existsSync)(dir)).map((dir) => (0, node_fs_promises.rm)(dir, {
|
|
23
|
+
recursive: true,
|
|
24
|
+
force: true
|
|
25
|
+
})));
|
|
26
|
+
appLogger("Output directory cleaned", { isVerbose: true });
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
exports.cleanOutputDir = cleanOutputDir;
|
|
31
|
+
//# sourceMappingURL=cleanOutputDir.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanOutputDir.cjs","names":[],"sources":["../../src/cleanOutputDir.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { rm } from 'node:fs/promises';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const cleanOutputDir = async (configuration: IntlayerConfig) => {\n const {\n dictionariesDir,\n unmergedDictionariesDir,\n dynamicDictionariesDir,\n remoteDictionariesDir,\n fetchDictionariesDir,\n mainDir,\n typesDir,\n configDir,\n cacheDir,\n } = configuration.system;\n\n const appLogger = getAppLogger(configuration);\n\n const directoriesToClean: string[] = [\n dictionariesDir, // Merged dictionaries\n unmergedDictionariesDir, // Unmerged dictionaries\n dynamicDictionariesDir, // Dynamic dictionaries\n remoteDictionariesDir, // Remote dictionaries\n fetchDictionariesDir, // Fetch dictionaries\n mainDir, // Main files\n typesDir, // Types\n configDir, // Configuration\n cacheDir, // Cache\n ];\n\n // Execute all deletions in parallel\n await Promise.all(\n directoriesToClean\n .filter((dir) => existsSync(dir))\n .map((dir) => rm(dir, { recursive: true, force: true }))\n );\n\n appLogger('Output directory cleaned', {\n isVerbose: true,\n });\n};\n"],"mappings":";;;;;;;AAKA,MAAa,iBAAiB,OAAO,kBAAkC;CACrE,MAAM,EACJ,iBACA,yBACA,wBACA,uBACA,sBACA,SACA,UACA,WACA,aACE,cAAc;CAElB,MAAM,sDAAyB,cAAc;CAE7C,MAAM,qBAA+B;EACnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;AAGD,OAAM,QAAQ,IACZ,mBACG,QAAQ,gCAAmB,IAAI,CAAC,CAChC,KAAK,iCAAW,KAAK;EAAE,WAAW;EAAM,OAAO;EAAM,CAAC,CAAC,CAC3D;AAED,WAAU,4BAA4B,EACpC,WAAW,MACZ,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_createDictionaryEntryPoint_createDictionaryEntryPoint = require('./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs');
|
|
4
|
+
const require_utils_readDictionariesFromDisk = require('./utils/readDictionariesFromDisk.cjs');
|
|
5
|
+
const require_writeJsonIfChanged = require('./writeJsonIfChanged.cjs');
|
|
6
|
+
let node_fs_promises = require("node:fs/promises");
|
|
7
|
+
let node_path = require("node:path");
|
|
8
|
+
let _intlayer_config_client = require("@intlayer/config/client");
|
|
9
|
+
let _intlayer_config_logger = require("@intlayer/config/logger");
|
|
10
|
+
let fast_glob = require("fast-glob");
|
|
11
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
12
|
+
|
|
13
|
+
//#region src/cleanRemovedContentDeclaration.ts
|
|
14
|
+
const cleanRemovedContentDeclaration = async (filePath, keysToKeep, configuration) => {
|
|
15
|
+
const appLogger = (0, _intlayer_config_logger.getAppLogger)(configuration);
|
|
16
|
+
const unmergedDictionaries = require_utils_readDictionariesFromDisk.readDictionariesFromDisk(configuration.system.unmergedDictionariesDir);
|
|
17
|
+
const baseDir = configuration.system.baseDir;
|
|
18
|
+
const relativeFilePath = (0, node_path.relative)(baseDir, filePath);
|
|
19
|
+
const uniqueUnmergedDictionaries = Object.values(unmergedDictionaries).flat().filter((dictionary) => dictionary.filePath === relativeFilePath && !keysToKeep.includes(dictionary.key)).filter((dictionary, index, self) => index === self.findIndex((t) => t.key === dictionary.key));
|
|
20
|
+
const changedDictionariesLocalIds = [];
|
|
21
|
+
const filesToRemove = [];
|
|
22
|
+
const excludeKeys = [];
|
|
23
|
+
await Promise.all(uniqueUnmergedDictionaries.map(async (dictionary) => {
|
|
24
|
+
const unmergedFilePath = (0, node_path.normalize)((0, node_path.join)(configuration.system.unmergedDictionariesDir, `${dictionary.key}.json`));
|
|
25
|
+
try {
|
|
26
|
+
const jsonContent = await (0, node_fs_promises.readFile)(unmergedFilePath, "utf8");
|
|
27
|
+
const parsedContent = JSON.parse(jsonContent);
|
|
28
|
+
if (parsedContent.length === 1) {
|
|
29
|
+
if (parsedContent[0].filePath === relativeFilePath) {
|
|
30
|
+
appLogger(`Removing outdated dictionary ${(0, _intlayer_config_logger.colorizeKey)(dictionary.key)}`, { isVerbose: true });
|
|
31
|
+
filesToRemove.push(unmergedFilePath);
|
|
32
|
+
excludeKeys.push(dictionary.key);
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
await require_writeJsonIfChanged.writeJsonIfChanged(unmergedFilePath, parsedContent.filter((content) => content.filePath !== relativeFilePath));
|
|
36
|
+
changedDictionariesLocalIds.push(dictionary.localId);
|
|
37
|
+
}
|
|
38
|
+
} catch (error) {
|
|
39
|
+
if (error.code === "ENOENT") {
|
|
40
|
+
if (!excludeKeys.includes(dictionary.key)) excludeKeys.push(dictionary.key);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}));
|
|
44
|
+
const dictionaries = require_utils_readDictionariesFromDisk.readDictionariesFromDisk(configuration.system.dictionariesDir);
|
|
45
|
+
const uniqueMergedDictionaries = (Object.values(dictionaries)?.filter((dictionary) => !keysToKeep.includes(dictionary.key) && dictionary.localIds?.length === 1 && dictionary.localIds[0].endsWith(`::local::${relativeFilePath}`))).filter((dictionary, index, self) => index === self.findIndex((t) => t.key === dictionary.key));
|
|
46
|
+
await Promise.all(uniqueMergedDictionaries.map(async (dictionary) => {
|
|
47
|
+
const mergedFilePath = (0, node_path.normalize)((0, node_path.join)(configuration.system.dictionariesDir, `${dictionary.key}.json`));
|
|
48
|
+
try {
|
|
49
|
+
const fileContent = await (0, node_fs_promises.readFile)(mergedFilePath, "utf8");
|
|
50
|
+
const parsedContent = JSON.parse(fileContent);
|
|
51
|
+
if (parsedContent.localIds?.length === 1) {
|
|
52
|
+
if (parsedContent.localIds[0].endsWith(`::local::${relativeFilePath}`)) {
|
|
53
|
+
appLogger(`Removing outdated unmerged dictionary ${(0, _intlayer_config_logger.colorizeKey)(dictionary.key)}`, { isVerbose: true });
|
|
54
|
+
filesToRemove.push(mergedFilePath);
|
|
55
|
+
const typesFilePath = (0, node_path.normalize)((0, node_path.join)(configuration.system.typesDir, `${dictionary.key}.ts`));
|
|
56
|
+
filesToRemove.push(typesFilePath);
|
|
57
|
+
const dynamicFiles = await (0, fast_glob.default)((0, _intlayer_config_client.normalizePath)((0, node_path.join)(configuration.system.dynamicDictionariesDir, `${dictionary.key}.*`)), { absolute: true });
|
|
58
|
+
filesToRemove.push(...dynamicFiles);
|
|
59
|
+
if (!excludeKeys.includes(dictionary.key)) excludeKeys.push(dictionary.key);
|
|
60
|
+
}
|
|
61
|
+
} else {
|
|
62
|
+
const localIds = parsedContent.localIds?.filter((localeId) => !localeId.endsWith(`::local::${relativeFilePath}`));
|
|
63
|
+
await require_writeJsonIfChanged.writeJsonIfChanged(mergedFilePath, {
|
|
64
|
+
...parsedContent,
|
|
65
|
+
localIds
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (error.code === "ENOENT") {
|
|
70
|
+
if (!excludeKeys.includes(dictionary.key)) excludeKeys.push(dictionary.key);
|
|
71
|
+
const typesFilePath = (0, node_path.normalize)((0, node_path.join)(configuration.system.typesDir, `${dictionary.key}.ts`));
|
|
72
|
+
filesToRemove.push(typesFilePath);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
if (filesToRemove.length > 0 || excludeKeys.length > 0) {
|
|
77
|
+
await require_createDictionaryEntryPoint_createDictionaryEntryPoint.createDictionaryEntryPoint(configuration, { excludeKeys });
|
|
78
|
+
if (filesToRemove.length > 0) setTimeout(async () => await Promise.all(filesToRemove.map(async (path) => {
|
|
79
|
+
const relativePath = (0, node_path.relative)(baseDir, path);
|
|
80
|
+
try {
|
|
81
|
+
await (0, node_fs_promises.rm)(path, { force: true });
|
|
82
|
+
appLogger(`Deleted artifact: ${(0, _intlayer_config_logger.colorizePath)(relativePath)}`, { isVerbose: true });
|
|
83
|
+
} catch {
|
|
84
|
+
appLogger(`Error while removing file ${(0, _intlayer_config_logger.colorizePath)(relativePath)}`, { isVerbose: true });
|
|
85
|
+
}
|
|
86
|
+
})), 3e3);
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
changedDictionariesLocalIds,
|
|
90
|
+
excludeKeys,
|
|
91
|
+
hasRebuilt: filesToRemove.length > 0 || excludeKeys.length > 0
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.cleanRemovedContentDeclaration = cleanRemovedContentDeclaration;
|
|
97
|
+
//# sourceMappingURL=cleanRemovedContentDeclaration.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cleanRemovedContentDeclaration.cjs","names":["readDictionariesFromDisk","writeJsonIfChanged","createDictionaryEntryPoint"],"sources":["../../src/cleanRemovedContentDeclaration.ts"],"sourcesContent":["import { readFile, rm } from 'node:fs/promises';\nimport { join, normalize, relative } from 'node:path';\nimport { normalizePath } from '@intlayer/config/client';\nimport {\n colorizeKey,\n colorizePath,\n getAppLogger,\n} from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport fg from 'fast-glob';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint';\nimport { readDictionariesFromDisk } from './utils/readDictionariesFromDisk';\nimport { writeJsonIfChanged } from './writeJsonIfChanged';\n\nexport const cleanRemovedContentDeclaration = async (\n filePath: string,\n keysToKeep: string[],\n configuration: IntlayerConfig\n): Promise<{\n changedDictionariesLocalIds: string[];\n excludeKeys: string[];\n hasRebuilt: boolean;\n}> => {\n const appLogger = getAppLogger(configuration);\n\n const unmergedDictionaries = readDictionariesFromDisk<\n Record<string, Dictionary[]>\n >(configuration.system.unmergedDictionariesDir);\n\n const baseDir = configuration.system.baseDir;\n\n const relativeFilePath = relative(baseDir, filePath);\n const flatUnmergedDictionaries = Object.values(unmergedDictionaries).flat();\n\n const filteredUnmergedDictionaries = flatUnmergedDictionaries.filter(\n (dictionary) =>\n dictionary.filePath === relativeFilePath &&\n !keysToKeep.includes(dictionary.key)\n );\n\n // Deduplicate dictionaries by key\n const uniqueUnmergedDictionaries = filteredUnmergedDictionaries.filter(\n (dictionary, index, self) =>\n index === self.findIndex((t) => t.key === dictionary.key)\n );\n\n const changedDictionariesLocalIds: string[] = [];\n const filesToRemove: string[] = [];\n const excludeKeys: string[] = [];\n\n // Identify Unmerged Dictionaries to remove or clean\n await Promise.all(\n uniqueUnmergedDictionaries.map(async (dictionary) => {\n const unmergedFilePath = normalize(\n join(\n configuration.system.unmergedDictionariesDir,\n `${dictionary.key}.json`\n )\n );\n\n try {\n const jsonContent = await readFile(unmergedFilePath, 'utf8');\n const parsedContent = JSON.parse(jsonContent);\n\n if (parsedContent.length === 1) {\n if (parsedContent[0].filePath === relativeFilePath) {\n appLogger(\n `Removing outdated dictionary ${colorizeKey(dictionary.key)}`,\n { isVerbose: true }\n );\n filesToRemove.push(unmergedFilePath);\n excludeKeys.push(dictionary.key);\n }\n } else {\n const filteredContent = parsedContent.filter(\n (content: any) => content.filePath !== relativeFilePath\n );\n await writeJsonIfChanged(unmergedFilePath, filteredContent);\n changedDictionariesLocalIds.push(dictionary.localId!);\n }\n } catch (error: any) {\n if (error.code === 'ENOENT') {\n if (!excludeKeys.includes(dictionary.key)) {\n excludeKeys.push(dictionary.key);\n }\n }\n }\n })\n );\n\n const dictionaries = readDictionariesFromDisk<Record<string, Dictionary>>(\n configuration.system.dictionariesDir\n );\n const flatDictionaries = Object.values(dictionaries) as Dictionary[];\n\n const filteredMergedDictionaries = flatDictionaries?.filter(\n (dictionary) =>\n !keysToKeep.includes(dictionary.key) &&\n dictionary.localIds?.length === 1 &&\n (dictionary.localIds[0] as string).endsWith(\n `::local::${relativeFilePath}`\n )\n );\n\n const uniqueMergedDictionaries = filteredMergedDictionaries.filter(\n (dictionary, index, self) =>\n index === self.findIndex((t) => t.key === dictionary.key)\n );\n\n // Identify Merged Dictionaries, Types, and Dynamic Dictionaries to remove\n await Promise.all(\n uniqueMergedDictionaries.map(async (dictionary) => {\n const mergedFilePath = normalize(\n join(configuration.system.dictionariesDir, `${dictionary.key}.json`)\n );\n\n try {\n const fileContent = await readFile(mergedFilePath, 'utf8');\n const parsedContent = JSON.parse(fileContent) as Dictionary;\n\n if (parsedContent.localIds?.length === 1) {\n if (\n parsedContent.localIds[0].endsWith(`::local::${relativeFilePath}`)\n ) {\n appLogger(\n `Removing outdated unmerged dictionary ${colorizeKey(dictionary.key)}`,\n { isVerbose: true }\n );\n\n // Mark JSON for removal\n filesToRemove.push(mergedFilePath);\n\n // Mark TS Types for removal\n const typesFilePath = normalize(\n join(configuration.system.typesDir, `${dictionary.key}.ts`)\n );\n filesToRemove.push(typesFilePath);\n\n // Mark Dynamic Dictionaries for removal\n // We use glob to catch the loader files (.cjs, .mjs) AND the split locale files (.en.json, etc.)\n const dynamicFilesGlob = join(\n configuration.system.dynamicDictionariesDir,\n `${dictionary.key}.*`\n );\n const dynamicFiles = await fg(normalizePath(dynamicFilesGlob), {\n absolute: true,\n });\n filesToRemove.push(...dynamicFiles);\n\n if (!excludeKeys.includes(dictionary.key)) {\n excludeKeys.push(dictionary.key);\n }\n }\n } else {\n const localIds = parsedContent.localIds?.filter(\n (localeId) => !localeId.endsWith(`::local::${relativeFilePath}`)\n ) as string[];\n const newContent = { ...parsedContent, localIds };\n await writeJsonIfChanged(mergedFilePath, newContent);\n }\n } catch (error: any) {\n if (error.code === 'ENOENT') {\n if (!excludeKeys.includes(dictionary.key)) {\n excludeKeys.push(dictionary.key);\n }\n const typesFilePath = normalize(\n join(configuration.system.typesDir, `${dictionary.key}.ts`)\n );\n filesToRemove.push(typesFilePath);\n }\n }\n })\n );\n\n // Execute Cleanup\n if (filesToRemove.length > 0 || excludeKeys.length > 0) {\n // Update entry points (indexes) first so the app doesn't import dead files\n await createDictionaryEntryPoint(configuration, { excludeKeys });\n\n // Remove the files synchronously (awaited) immediately after.\n if (filesToRemove.length > 0) {\n setTimeout(\n async () =>\n await Promise.all(\n filesToRemove.map(async (path) => {\n const relativePath = relative(baseDir, path);\n try {\n await rm(path, { force: true });\n\n appLogger(`Deleted artifact: ${colorizePath(relativePath)}`, {\n isVerbose: true,\n });\n } catch {\n appLogger(\n `Error while removing file ${colorizePath(relativePath)}`,\n {\n isVerbose: true,\n }\n );\n }\n })\n ),\n 3000\n );\n }\n }\n\n return {\n changedDictionariesLocalIds,\n excludeKeys,\n hasRebuilt: filesToRemove.length > 0 || excludeKeys.length > 0,\n };\n};\n"],"mappings":";;;;;;;;;;;;;AAeA,MAAa,iCAAiC,OAC5C,UACA,YACA,kBAKI;CACJ,MAAM,sDAAyB,cAAc;CAE7C,MAAM,uBAAuBA,gEAE3B,cAAc,OAAO,wBAAwB;CAE/C,MAAM,UAAU,cAAc,OAAO;CAErC,MAAM,2CAA4B,SAAS,SAAS;CAUpD,MAAM,6BAT2B,OAAO,OAAO,qBAAqB,CAAC,MAER,CAAC,QAC3D,eACC,WAAW,aAAa,oBACxB,CAAC,WAAW,SAAS,WAAW,IAAI,CAIuB,CAAC,QAC7D,YAAY,OAAO,SAClB,UAAU,KAAK,WAAW,MAAM,EAAE,QAAQ,WAAW,IAAI,CAC5D;CAED,MAAM,8BAAwC,EAAE;CAChD,MAAM,gBAA0B,EAAE;CAClC,MAAM,cAAwB,EAAE;AAGhC,OAAM,QAAQ,IACZ,2BAA2B,IAAI,OAAO,eAAe;EACnD,MAAM,gEAEF,cAAc,OAAO,yBACrB,GAAG,WAAW,IAAI,OACnB,CACF;AAED,MAAI;GACF,MAAM,cAAc,qCAAe,kBAAkB,OAAO;GAC5D,MAAM,gBAAgB,KAAK,MAAM,YAAY;AAE7C,OAAI,cAAc,WAAW,GAC3B;QAAI,cAAc,GAAG,aAAa,kBAAkB;AAClD,eACE,yEAA4C,WAAW,IAAI,IAC3D,EAAE,WAAW,MAAM,CACpB;AACD,mBAAc,KAAK,iBAAiB;AACpC,iBAAY,KAAK,WAAW,IAAI;;UAE7B;AAIL,UAAMC,8CAAmB,kBAHD,cAAc,QACnC,YAAiB,QAAQ,aAAa,iBAEiB,CAAC;AAC3D,gCAA4B,KAAK,WAAW,QAAS;;WAEhD,OAAY;AACnB,OAAI,MAAM,SAAS,UACjB;QAAI,CAAC,YAAY,SAAS,WAAW,IAAI,CACvC,aAAY,KAAK,WAAW,IAAI;;;GAItC,CACH;CAED,MAAM,eAAeD,gEACnB,cAAc,OAAO,gBACtB;CAYD,MAAM,4BAXmB,OAAO,OAAO,aAEY,EAAE,QAClD,eACC,CAAC,WAAW,SAAS,WAAW,IAAI,IACpC,WAAW,UAAU,WAAW,KAC/B,WAAW,SAAS,GAAc,SACjC,YAAY,mBACb,CACJ,EAE2D,QACzD,YAAY,OAAO,SAClB,UAAU,KAAK,WAAW,MAAM,EAAE,QAAQ,WAAW,IAAI,CAC5D;AAGD,OAAM,QAAQ,IACZ,yBAAyB,IAAI,OAAO,eAAe;EACjD,MAAM,8DACC,cAAc,OAAO,iBAAiB,GAAG,WAAW,IAAI,OAAO,CACrE;AAED,MAAI;GACF,MAAM,cAAc,qCAAe,gBAAgB,OAAO;GAC1D,MAAM,gBAAgB,KAAK,MAAM,YAAY;AAE7C,OAAI,cAAc,UAAU,WAAW,GACrC;QACE,cAAc,SAAS,GAAG,SAAS,YAAY,mBAAmB,EAClE;AACA,eACE,kFAAqD,WAAW,IAAI,IACpE,EAAE,WAAW,MAAM,CACpB;AAGD,mBAAc,KAAK,eAAe;KAGlC,MAAM,6DACC,cAAc,OAAO,UAAU,GAAG,WAAW,IAAI,KAAK,CAC5D;AACD,mBAAc,KAAK,cAAc;KAQjC,MAAM,eAAe,4FAHnB,cAAc,OAAO,wBACrB,GAAG,WAAW,IAAI,IAEwC,CAAC,EAAE,EAC7D,UAAU,MACX,CAAC;AACF,mBAAc,KAAK,GAAG,aAAa;AAEnC,SAAI,CAAC,YAAY,SAAS,WAAW,IAAI,CACvC,aAAY,KAAK,WAAW,IAAI;;UAG/B;IACL,MAAM,WAAW,cAAc,UAAU,QACtC,aAAa,CAAC,SAAS,SAAS,YAAY,mBAAmB,CACjE;AAED,UAAMC,8CAAmB,gBAAgB;KADpB,GAAG;KAAe;KACY,CAAC;;WAE/C,OAAY;AACnB,OAAI,MAAM,SAAS,UAAU;AAC3B,QAAI,CAAC,YAAY,SAAS,WAAW,IAAI,CACvC,aAAY,KAAK,WAAW,IAAI;IAElC,MAAM,6DACC,cAAc,OAAO,UAAU,GAAG,WAAW,IAAI,KAAK,CAC5D;AACD,kBAAc,KAAK,cAAc;;;GAGrC,CACH;AAGD,KAAI,cAAc,SAAS,KAAK,YAAY,SAAS,GAAG;AAEtD,QAAMC,yFAA2B,eAAe,EAAE,aAAa,CAAC;AAGhE,MAAI,cAAc,SAAS,EACzB,YACE,YACE,MAAM,QAAQ,IACZ,cAAc,IAAI,OAAO,SAAS;GAChC,MAAM,uCAAwB,SAAS,KAAK;AAC5C,OAAI;AACF,mCAAS,MAAM,EAAE,OAAO,MAAM,CAAC;AAE/B,cAAU,+DAAkC,aAAa,IAAI,EAC3D,WAAW,MACZ,CAAC;WACI;AACN,cACE,uEAA0C,aAAa,IACvD,EACE,WAAW,MACZ,CACF;;IAEH,CACH,EACH,IACD;;AAIL,QAAO;EACL;EACA;EACA,YAAY,cAAc,SAAS,KAAK,YAAY,SAAS;EAC9D"}
|
package/dist/cjs/cli.cjs
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_listProjects = require('./listProjects.cjs');
|
|
3
|
+
const require_installLSP = require('./installLSP.cjs');
|
|
4
|
+
const require_listDictionariesPath = require('./listDictionariesPath.cjs');
|
|
5
|
+
const require_prepareIntlayer = require('./prepareIntlayer.cjs');
|
|
6
|
+
const require_writeContentDeclaration_detectExportedComponentName = require('./writeContentDeclaration/detectExportedComponentName.cjs');
|
|
7
|
+
const require_writeContentDeclaration_transformJSFile = require('./writeContentDeclaration/transformJSFile.cjs');
|
|
8
|
+
const require_detectFormatCommand = require('./detectFormatCommand.cjs');
|
|
9
|
+
const require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate = require('./getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs');
|
|
10
|
+
const require_writeContentDeclaration_writeJSFile = require('./writeContentDeclaration/writeJSFile.cjs');
|
|
11
|
+
const require_writeContentDeclaration_writeContentDeclaration = require('./writeContentDeclaration/writeContentDeclaration.cjs');
|
|
12
|
+
const require_init_cms = require('./init/cms.cjs');
|
|
13
|
+
const require_init_utils_packageManager = require('./init/utils/packageManager.cjs');
|
|
14
|
+
const require_init_utils_nextCompilerBabel = require('./init/utils/nextCompilerBabel.cjs');
|
|
15
|
+
const require_init_index = require('./init/index.cjs');
|
|
16
|
+
const require_installSkills_index = require('./installSkills/index.cjs');
|
|
17
|
+
const require_installMCP_installMCP = require('./installMCP/installMCP.cjs');
|
|
18
|
+
const require_listGitFiles = require('./listGitFiles.cjs');
|
|
19
|
+
const require_logConfigDetails = require('./logConfigDetails.cjs');
|
|
20
|
+
|
|
21
|
+
exports.NEXT_INTLAYER_BABEL_CONFIG_CONTENT = require_init_utils_nextCompilerBabel.NEXT_INTLAYER_BABEL_CONFIG_CONTENT;
|
|
22
|
+
exports.PLATFORMS = require_installSkills_index.PLATFORMS;
|
|
23
|
+
exports.PLATFORMS_METADATA = require_installSkills_index.PLATFORMS_METADATA;
|
|
24
|
+
exports.SKILLS = require_installSkills_index.SKILLS;
|
|
25
|
+
exports.SKILLS_METADATA = require_installSkills_index.SKILLS_METADATA;
|
|
26
|
+
exports.detectExportedComponentName = require_writeContentDeclaration_detectExportedComponentName.detectExportedComponentName;
|
|
27
|
+
exports.detectFormatCommand = require_detectFormatCommand.detectFormatCommand;
|
|
28
|
+
exports.detectPackageManager = require_init_utils_packageManager.detectPackageManager;
|
|
29
|
+
exports.enableEditorInConfig = require_init_cms.enableEditorInConfig;
|
|
30
|
+
exports.getContentDeclarationFileTemplate = require_getContentDeclarationFileTemplate_getContentDeclarationFileTemplate.getContentDeclarationFileTemplate;
|
|
31
|
+
exports.getInitialSkills = require_installSkills_index.getInitialSkills;
|
|
32
|
+
exports.initIntlayer = require_init_index.initIntlayer;
|
|
33
|
+
exports.installLSP = require_installLSP.installLSP;
|
|
34
|
+
exports.installMCP = require_installMCP_installMCP.installMCP;
|
|
35
|
+
exports.installPackages = require_init_utils_packageManager.installPackages;
|
|
36
|
+
exports.installSkills = require_installSkills_index.installSkills;
|
|
37
|
+
exports.listDictionaries = require_listDictionariesPath.listDictionaries;
|
|
38
|
+
exports.listDictionariesWithStats = require_listDictionariesPath.listDictionariesWithStats;
|
|
39
|
+
exports.listGitFiles = require_listGitFiles.listGitFiles;
|
|
40
|
+
exports.listGitLines = require_listGitFiles.listGitLines;
|
|
41
|
+
exports.listProjects = require_listProjects.listProjects;
|
|
42
|
+
exports.logConfigDetails = require_logConfigDetails.logConfigDetails;
|
|
43
|
+
exports.prepareIntlayer = require_prepareIntlayer.prepareIntlayer;
|
|
44
|
+
exports.setupCmsCredentials = require_init_cms.setupCmsCredentials;
|
|
45
|
+
exports.transformJSFile = require_writeContentDeclaration_transformJSFile.transformJSFile;
|
|
46
|
+
exports.writeCmsCredentialsToEnv = require_init_cms.writeCmsCredentialsToEnv;
|
|
47
|
+
exports.writeContentDeclaration = require_writeContentDeclaration_writeContentDeclaration.writeContentDeclaration;
|
|
48
|
+
exports.writeJSFile = require_writeContentDeclaration_writeJSFile.writeJSFile;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
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 node_fs_promises = require("node:fs/promises");
|
|
12
|
+
let node_path = require("node:path");
|
|
13
|
+
let _intlayer_config_node = require("@intlayer/config/node");
|
|
14
|
+
|
|
15
|
+
//#region src/createDictionaryEntryPoint/createDictionaryEntryPoint.ts
|
|
16
|
+
const writeDictionaryFiles = async (paths, fileName, importType, functionName, format, configuration = (0, _intlayer_config_node.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_node.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 }) => await writeDictionaryFiles(paths, fileName, importType, functionName, format, configuration));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
exports.createDictionaryEntryPoint = createDictionaryEntryPoint;
|
|
71
|
+
//# sourceMappingURL=createDictionaryEntryPoint.cjs.map
|
|
@@ -0,0 +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/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 resolvedPath = await paths;\n\n const content = generateDictionaryListContent(\n resolvedPath,\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 await writeDictionaryFiles(\n paths,\n fileName,\n importType,\n functionName,\n format,\n configuration\n )\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAYA,MAAM,uBAAuB,OAC3B,OACA,UACA,YACA,cACA,QACA,6DAAkC,KAC/B;CAGH,MAAM,UAAUA,+FACd,MAHyB,OAIzB,cACA,YACA,QACA,cACD;CACD,MAAM,YAAY,WAAW,QAAQ,QAAQ;CAE7C,MAAM,EAAE,YAAY,cAAc;AAElC,OAAMC,qEACI,SAAS,GAAG,SAAS,GAAG,YAAY,EAC5C,QACD;;;;;AAWH,MAAa,6BAA6B,OACxC,6DAAkC,EAClC,UAA6C,EAAE,KAC5C;CACH,MAAM,EAAE,SAAS,cAAc,EAAE,KAAK;CACtC,MAAM,gBAAgB,WAAW,cAAc,MAAM;CACrD,MAAM,EAAE,YAAY,cAAc;AAElC,mCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;AA+DzC,OAAMC,sCACJ;EA7DA,GAAG,cAAc,KACd,YACE;GACC,OAAOC,qFAAyB,eAAe,YAAY;GAC3D,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,qGAAiC,eAAe,YAAY;GACnE,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,mGACL,eACA,QACA,YACD;GACD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,+FACL,eACA,QACA,YACD;GACD,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EACD,GAAG,cAAc,KACd,YACE;GACC,OAAOC,iGAA+B,eAAe,YAAY;GACjE,YAAY;GACZ,cAAc;GACd,UAAU;GACV;GACD,EACJ;EAIc,EACf,OAAO,EAAE,OAAO,UAAU,QAAQ,cAAc,iBAC9C,MAAM,qBACJ,OACA,UACA,YACA,cACA,QACA,cACD,CACJ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_utils_getPathHash = require('../utils/getPathHash.cjs');
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
let _intlayer_config_node = require("@intlayer/config/node");
|
|
6
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
7
|
+
|
|
8
|
+
//#region src/createDictionaryEntryPoint/generateDictionaryListContent.ts
|
|
9
|
+
/**
|
|
10
|
+
* This function generates the content of the dictionary list file
|
|
11
|
+
*/
|
|
12
|
+
const generateDictionaryListContent = (dictionaries, functionName, importType, format = "esm", configuration = (0, _intlayer_config_node.getConfiguration)()) => {
|
|
13
|
+
const { mainDir } = configuration.system;
|
|
14
|
+
let content = "";
|
|
15
|
+
const dictionariesRef = dictionaries.map((dictionaryPath) => ({
|
|
16
|
+
relativePath: (0, _intlayer_config_utils.normalizePath)((0, node_path.relative)(mainDir, dictionaryPath)),
|
|
17
|
+
id: (0, node_path.basename)(dictionaryPath, (0, node_path.extname)(dictionaryPath)),
|
|
18
|
+
hash: `_${require_utils_getPathHash.getPathHash(dictionaryPath)}`
|
|
19
|
+
}));
|
|
20
|
+
dictionariesRef.forEach((dictionary) => {
|
|
21
|
+
if (format === "esm") content += `import ${dictionary.hash} from '${dictionary.relativePath}'${importType === "json" ? " with { type: 'json' }" : ""};\n`;
|
|
22
|
+
if (format === "cjs") content += `const ${dictionary.hash} = require('${dictionary.relativePath}');\n`;
|
|
23
|
+
});
|
|
24
|
+
content += "\n";
|
|
25
|
+
const formattedDictionaryMap = dictionariesRef.map((dictionary) => ` "${dictionary.id}": ${dictionary.hash}`).join(",\n");
|
|
26
|
+
content += `const dictionaries = {\n${formattedDictionaryMap}\n};\n`;
|
|
27
|
+
content += `const ${functionName} = () => dictionaries;\n`;
|
|
28
|
+
if (format === "esm") {
|
|
29
|
+
content += `\n`;
|
|
30
|
+
content += `export { ${functionName} };\n`;
|
|
31
|
+
content += `export default dictionaries;\n`;
|
|
32
|
+
}
|
|
33
|
+
if (format === "cjs") {
|
|
34
|
+
content += `\n`;
|
|
35
|
+
content += `module.exports.${functionName} = ${functionName};\n`;
|
|
36
|
+
content += `module.exports = dictionaries;\n`;
|
|
37
|
+
}
|
|
38
|
+
return content;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
exports.generateDictionaryListContent = generateDictionaryListContent;
|
|
43
|
+
//# sourceMappingURL=generateDictionaryListContent.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateDictionaryListContent.cjs","names":["getPathHash"],"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 { getPathHash } from '../utils/getPathHash';\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: `_${getPathHash(dictionaryPath)}`, // Get the hash of the dictionary to avoid conflicts\n }));\n\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":";;;;;;;;;;;AAQA,MAAa,iCACX,cACA,cACA,YACA,SAAwB,OACxB,6DAAkC,KACvB;CACX,MAAM,EAAE,YAAY,cAAc;CAElC,IAAI,UAAU;CAEd,MAAM,kBAAkB,aAAa,KAAK,oBAAoB;EAC5D,gFAAqC,SAAS,eAAe,CAAC;EAC9D,4BAAa,uCAAwB,eAAe,CAAC;EACrD,MAAM,IAAIA,sCAAY,eAAe;EACtC,EAAE;AAEH,iBAAgB,SAAS,eAAe;AACtC,MAAI,WAAW,MACb,YAAW,UAAU,WAAW,KAAK,SAAS,WAAW,aAAa,GAAG,eAAe,SAAS,2BAA2B,GAAG;AACjI,MAAI,WAAW,MACb,YAAW,SAAS,WAAW,KAAK,cAAc,WAAW,aAAa;GAC5E;AAEF,YAAW;CAGX,MAAM,yBAAiC,gBACpC,KAAK,eAAe,MAAM,WAAW,GAAG,KAAK,WAAW,OAAO,CAC/D,KAAK,MAAM;AAEd,YAAW,2BAA2B,uBAAuB;AAC7D,YAAW,SAAS,aAAa;AAEjC,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,YAAY,aAAa;AACpC,aAAW;;AAGb,KAAI,WAAW,OAAO;AACpB,aAAW;AACX,aAAW,kBAAkB,aAAa,KAAK,aAAa;AAC5D,aAAW;;AAGb,QAAO"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
let fast_glob = require("fast-glob");
|
|
6
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
7
|
+
let node_fs = require("node:fs");
|
|
8
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
9
|
+
|
|
10
|
+
//#region src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts
|
|
11
|
+
/**
|
|
12
|
+
* This function generates a list of dictionaries in the main directory
|
|
13
|
+
*/
|
|
14
|
+
const getBuiltDictionariesPath = async (configuration, excludeKeys = []) => {
|
|
15
|
+
const { dictionariesDir, mainDir } = configuration.system;
|
|
16
|
+
if (!(0, node_fs.existsSync)(mainDir)) await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
17
|
+
return (await (0, fast_glob.default)(`${(0, _intlayer_config_utils.normalizePath)(dictionariesDir)}/**/*.json`)).filter((path) => {
|
|
18
|
+
const key = (0, node_path.basename)(path, ".json");
|
|
19
|
+
return !excludeKeys.includes(key);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getBuiltDictionariesPath = getBuiltDictionariesPath;
|
|
25
|
+
//# sourceMappingURL=getBuiltDictionariesPath.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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 await mkdir(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":";;;;;;;;;;;;;AAUA,MAAa,2BAA2B,OACtC,eACA,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,iBAAiB,YAAY,cAAc;AAGnD,KAAI,yBAAY,QAAQ,CACtB,mCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;AAO3C,SAAO,6BAHL,6CAAiB,gBAAgB,CAAC,YACnC,EAEuB,QAAQ,SAAS;EACvC,MAAM,8BAAe,MAAM,QAAQ;AACnC,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
let fast_glob = require("fast-glob");
|
|
6
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
7
|
+
let node_fs = require("node:fs");
|
|
8
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
9
|
+
|
|
10
|
+
//#region src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts
|
|
11
|
+
/**
|
|
12
|
+
* This function generates a list of dictionaries in the main directory
|
|
13
|
+
*/
|
|
14
|
+
const getBuiltDynamicDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
|
|
15
|
+
const { dynamicDictionariesDir, mainDir } = configuration.system;
|
|
16
|
+
if (!(0, node_fs.existsSync)(mainDir)) await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
17
|
+
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
18
|
+
return (await (0, fast_glob.default)(`${(0, _intlayer_config_utils.normalizePath)(dynamicDictionariesDir)}/*.${extension}`)).filter((path) => {
|
|
19
|
+
const key = (0, node_path.basename)(path, `.${extension}`);
|
|
20
|
+
return !excludeKeys.includes(key);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.getBuiltDynamicDictionariesPath = getBuiltDynamicDictionariesPath;
|
|
26
|
+
//# sourceMappingURL=getBuiltDynamicDictionariesPath.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltDynamicDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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 await mkdir(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":";;;;;;;;;;;;;AAUA,MAAa,kCAAkC,OAC7C,eACA,SAAwB,OACxB,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,wBAAwB,YAAY,cAAc;AAG1D,KAAI,yBAAY,QAAQ,CACtB,mCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;CAG3C,MAAM,YAAY,WAAW,QAAQ,QAAQ;AAM7C,SAAO,6BAHL,6CAAiB,uBAAuB,CAAC,KAAK,YAC/C,EAEuB,QAAQ,SAAS;EACvC,MAAM,8BAAe,MAAM,IAAI,YAAY;AAC3C,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
let fast_glob = require("fast-glob");
|
|
6
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
7
|
+
let node_fs = require("node:fs");
|
|
8
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
9
|
+
|
|
10
|
+
//#region src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts
|
|
11
|
+
/**
|
|
12
|
+
* This function generates a list of dictionaries in the main directory
|
|
13
|
+
*/
|
|
14
|
+
const getBuiltFetchDictionariesPath = async (configuration, format = "esm", excludeKeys = []) => {
|
|
15
|
+
const { fetchDictionariesDir, mainDir } = configuration.system;
|
|
16
|
+
if (!(0, node_fs.existsSync)(mainDir)) await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
17
|
+
const extension = format === "cjs" ? "cjs" : "mjs";
|
|
18
|
+
return (await (0, fast_glob.default)(`${(0, _intlayer_config_utils.normalizePath)(fetchDictionariesDir)}/*.${extension}`)).filter((path) => {
|
|
19
|
+
const key = (0, node_path.basename)(path, `.${extension}`);
|
|
20
|
+
return !excludeKeys.includes(key);
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.getBuiltFetchDictionariesPath = getBuiltFetchDictionariesPath;
|
|
26
|
+
//# sourceMappingURL=getBuiltFetchDictionariesPath.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBuiltFetchDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync } from 'node:fs';\nimport { mkdir } from 'node:fs/promises';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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 await mkdir(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":";;;;;;;;;;;;;AAUA,MAAa,gCAAgC,OAC3C,eACA,SAAwB,OACxB,cAAwB,EAAE,KACvB;CACH,MAAM,EAAE,sBAAsB,YAAY,cAAc;AAGxD,KAAI,yBAAY,QAAQ,CACtB,mCAAY,SAAS,EAAE,WAAW,MAAM,CAAC;CAG3C,MAAM,YAAY,WAAW,QAAQ,QAAQ;AAM7C,SAAO,6BAHL,6CAAiB,qBAAqB,CAAC,KAAK,YAC7C,EAEuB,QAAQ,SAAS;EACvC,MAAM,8BAAe,MAAM,IAAI,YAAY;AAC3C,SAAO,CAAC,YAAY,SAAS,IAAI;GACjC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
let node_fs_promises = require("node:fs/promises");
|
|
4
|
+
let node_path = require("node:path");
|
|
5
|
+
let fast_glob = require("fast-glob");
|
|
6
|
+
fast_glob = require_runtime.__toESM(fast_glob);
|
|
7
|
+
let node_fs = require("node:fs");
|
|
8
|
+
let _intlayer_config_utils = require("@intlayer/config/utils");
|
|
9
|
+
|
|
10
|
+
//#region src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts
|
|
11
|
+
/**
|
|
12
|
+
* This function generates a list of dictionaries in the main directory
|
|
13
|
+
*/
|
|
14
|
+
const getBuiltRemoteDictionariesPath = async (configuration, excludeKeys = []) => {
|
|
15
|
+
const { remoteDictionariesDir, mainDir } = configuration.system;
|
|
16
|
+
if (!(0, node_fs.existsSync)(mainDir)) await (0, node_fs_promises.mkdir)(mainDir, { recursive: true });
|
|
17
|
+
return fast_glob.default.sync(`${(0, _intlayer_config_utils.normalizePath)(remoteDictionariesDir)}/**/*.json`).filter((path) => {
|
|
18
|
+
const key = (0, node_path.basename)(path, ".json");
|
|
19
|
+
return !excludeKeys.includes(key);
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
exports.getBuiltRemoteDictionariesPath = getBuiltRemoteDictionariesPath;
|
|
25
|
+
//# sourceMappingURL=getBuiltRemoteDictionariesPath.cjs.map
|