@intlayer/chokidar 8.2.4 → 8.3.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/build.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/buildIntlayerDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +4 -4
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +2 -2
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeMergedDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeRemoteDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/cleanOutputDir.cjs.map +1 -1
- package/dist/cjs/cleanRemovedContentDeclaration.cjs +1 -1
- package/dist/cjs/cleanRemovedContentDeclaration.cjs.map +1 -1
- package/dist/cjs/cli.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/createDictionaryEntryPoint.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs.map +1 -1
- package/dist/cjs/createType/createModuleAugmentation.cjs +2 -2
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/createType/createType.cjs.map +1 -1
- package/dist/cjs/detectFormatCommand.cjs +1 -1
- package/dist/cjs/detectFormatCommand.cjs.map +1 -1
- package/dist/cjs/fetchDistantDictionaries.cjs +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/formatDictionary.cjs.map +1 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +7 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs +1 -1
- package/dist/cjs/handleAdditionalContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileChange.cjs +1 -1
- package/dist/cjs/handleContentDeclarationFileChange.cjs.map +1 -1
- package/dist/cjs/handleContentDeclarationFileMoved.cjs +1 -1
- package/dist/cjs/handleContentDeclarationFileMoved.cjs.map +1 -1
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs +1 -1
- package/dist/cjs/handleUnlinkedContentDeclarationFile.cjs.map +1 -1
- package/dist/cjs/init/index.cjs +1 -1
- package/dist/cjs/initConfig/index.cjs +1 -1
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +3 -3
- package/dist/cjs/listProjects.cjs +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/index.cjs +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +2 -2
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs +1 -1
- package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs +1 -1
- package/dist/cjs/loadDictionaries/loadLocalDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs +1 -1
- package/dist/cjs/loadDictionaries/logTypeScriptErrors.cjs.map +1 -1
- package/dist/cjs/logConfigDetails.cjs +2 -1
- package/dist/cjs/logConfigDetails.cjs.map +1 -1
- package/dist/cjs/prepareIntlayer.cjs +1 -1
- package/dist/cjs/prepareIntlayer.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -1
- package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -1
- package/dist/cjs/utils/autoDecorateContent.cjs +1 -1
- package/dist/cjs/utils/autoDecorateContent.cjs.map +1 -1
- package/dist/cjs/utils/buildFilesList.cjs +1 -1
- package/dist/cjs/utils/buildFilesList.cjs.map +1 -1
- package/dist/cjs/utils/formatter.cjs +1 -1
- package/dist/cjs/utils/formatter.cjs.map +1 -1
- package/dist/cjs/utils/getComponentTransformPattern.cjs +1 -1
- package/dist/cjs/utils/getComponentTransformPattern.cjs.map +1 -1
- package/dist/cjs/utils/getContentExtension.cjs +2 -0
- package/dist/cjs/utils/getContentExtension.cjs.map +1 -0
- package/dist/cjs/utils/getFormatFromExtension.cjs +1 -1
- package/dist/cjs/utils/getFormatFromExtension.cjs.map +1 -1
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/resolveRelativePath.cjs +2 -0
- package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -0
- package/dist/cjs/watcher.cjs +1 -1
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeConfiguration/index.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs +1 -1
- package/dist/cjs/writeContentDeclaration/processContentDeclarationContent.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +3 -1
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +2 -1
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +1 -1
- package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +1 -1
- package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -1
- package/dist/esm/build.mjs +1 -1
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs +1 -1
- package/dist/esm/buildIntlayerDictionary/buildIntlayerDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/processContentDeclaration.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs +4 -4
- package/dist/esm/buildIntlayerDictionary/writeDynamicDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeFetchDictionary.mjs +2 -2
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs +1 -1
- package/dist/esm/buildIntlayerDictionary/writeMergedDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs +1 -1
- package/dist/esm/buildIntlayerDictionary/writeRemoteDictionary.mjs.map +1 -1
- package/dist/esm/buildIntlayerDictionary/writeUnmergedDictionary.mjs.map +1 -1
- package/dist/esm/cleanOutputDir.mjs.map +1 -1
- package/dist/esm/cleanRemovedContentDeclaration.mjs +1 -1
- package/dist/esm/cleanRemovedContentDeclaration.mjs.map +1 -1
- package/dist/esm/cli.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/createDictionaryEntryPoint.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/generateDictionaryListContent.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.mjs.map +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs +1 -1
- package/dist/esm/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.mjs.map +1 -1
- package/dist/esm/createType/createModuleAugmentation.mjs +2 -2
- package/dist/esm/createType/createModuleAugmentation.mjs.map +1 -1
- package/dist/esm/createType/createType.mjs.map +1 -1
- package/dist/esm/detectFormatCommand.mjs +1 -1
- package/dist/esm/detectFormatCommand.mjs.map +1 -1
- package/dist/esm/fetchDistantDictionaries.mjs +1 -1
- package/dist/esm/filterInvalidDictionaries.mjs.map +1 -1
- package/dist/esm/formatDictionary.mjs.map +1 -1
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +7 -1
- package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs +1 -1
- package/dist/esm/handleAdditionalContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileChange.mjs +1 -1
- package/dist/esm/handleContentDeclarationFileChange.mjs.map +1 -1
- package/dist/esm/handleContentDeclarationFileMoved.mjs +1 -1
- package/dist/esm/handleContentDeclarationFileMoved.mjs.map +1 -1
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs +1 -1
- package/dist/esm/handleUnlinkedContentDeclarationFile.mjs.map +1 -1
- package/dist/esm/init/index.mjs +1 -1
- package/dist/esm/initConfig/index.mjs +1 -1
- package/dist/esm/listDictionariesPath.mjs.map +1 -1
- package/dist/esm/listGitFiles.mjs +4 -4
- package/dist/esm/listProjects.mjs +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
- package/dist/esm/loadDictionaries/index.mjs +1 -1
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs +2 -2
- package/dist/esm/loadDictionaries/loadContentDeclaration.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs +1 -1
- package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs +1 -1
- package/dist/esm/loadDictionaries/loadLocalDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/loadRemoteDictionaries.mjs.map +1 -1
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs +1 -1
- package/dist/esm/loadDictionaries/logTypeScriptErrors.mjs.map +1 -1
- package/dist/esm/logConfigDetails.mjs +2 -1
- package/dist/esm/logConfigDetails.mjs.map +1 -1
- package/dist/esm/prepareIntlayer.mjs +1 -1
- package/dist/esm/prepareIntlayer.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -1
- package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -1
- package/dist/esm/utils/autoDecorateContent.mjs +1 -1
- package/dist/esm/utils/autoDecorateContent.mjs.map +1 -1
- package/dist/esm/utils/buildFilesList.mjs +1 -1
- package/dist/esm/utils/buildFilesList.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +1 -1
- package/dist/esm/utils/formatter.mjs.map +1 -1
- package/dist/esm/utils/getComponentTransformPattern.mjs +1 -1
- package/dist/esm/utils/getComponentTransformPattern.mjs.map +1 -1
- package/dist/esm/utils/getContentExtension.mjs +2 -0
- package/dist/esm/utils/getContentExtension.mjs.map +1 -0
- package/dist/esm/utils/getFormatFromExtension.mjs +1 -1
- package/dist/esm/utils/getFormatFromExtension.mjs.map +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils/resolveRelativePath.mjs +2 -0
- package/dist/esm/utils/resolveRelativePath.mjs.map +1 -0
- package/dist/esm/watcher.mjs +1 -1
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs +1 -1
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +3 -1
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs +2 -1
- package/dist/esm/writeContentDeclaration/transformJSONFile.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +1 -1
- package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs +1 -1
- package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -1
- package/dist/types/build.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +2 -1
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +5 -4
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +2 -1
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +1 -1
- package/dist/types/cleanOutputDir.d.ts +1 -1
- package/dist/types/cleanRemovedContentDeclaration.d.ts +1 -1
- package/dist/types/cleanRemovedContentDeclaration.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +1 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +1 -1
- package/dist/types/createType/createModuleAugmentation.d.ts +1 -1
- package/dist/types/createType/createModuleAugmentation.d.ts.map +1 -1
- package/dist/types/createType/createType.d.ts +2 -1
- package/dist/types/createType/createType.d.ts.map +1 -1
- package/dist/types/detectFormatCommand.d.ts +1 -1
- package/dist/types/filterInvalidDictionaries.d.ts +2 -1
- package/dist/types/filterInvalidDictionaries.d.ts.map +1 -1
- package/dist/types/formatDictionary.d.ts +21 -20
- package/dist/types/formatDictionary.d.ts.map +1 -1
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +1 -1
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -1
- package/dist/types/handleAdditionalContentDeclarationFile.d.ts +1 -1
- package/dist/types/handleContentDeclarationFileChange.d.ts +1 -1
- package/dist/types/handleContentDeclarationFileMoved.d.ts +1 -1
- package/dist/types/handleUnlinkedContentDeclarationFile.d.ts +1 -1
- package/dist/types/listDictionariesPath.d.ts +1 -1
- package/dist/types/loadDictionaries/getIntlayerBundle.d.ts +1 -1
- package/dist/types/loadDictionaries/index.d.ts +2 -2
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +5 -2
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +2 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +2 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +3 -3
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +1 -1
- package/dist/types/loadDictionaries/logTypeScriptErrors.d.ts +1 -1
- package/dist/types/logConfigDetails.d.ts.map +1 -1
- package/dist/types/prepareIntlayer.d.ts +1 -1
- package/dist/types/reduceDictionaryContent/applyMask.d.ts +1 -1
- package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +1 -1
- package/dist/types/utils/buildFilesList.d.ts.map +1 -1
- package/dist/types/utils/formatter.d.ts +1 -1
- package/dist/types/utils/formatter.d.ts.map +1 -1
- package/dist/types/utils/getComponentTransformPattern.d.ts +1 -1
- package/dist/types/utils/getComponentTransformPattern.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/utils/getFormatFromExtension.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/resolveRelativePath.d.ts +5 -0
- package/dist/types/utils/resolveRelativePath.d.ts.map +1 -0
- package/dist/types/watcher.d.ts +1 -1
- package/dist/types/writeConfiguration/index.d.ts +1 -1
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts +1 -1
- package/dist/types/writeContentDeclaration/processContentDeclarationContent.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts +3 -2
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/transformJSONFile.d.ts +2 -2
- package/dist/types/writeContentDeclaration/transformJSONFile.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +4 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +3 -2
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -1
- package/package.json +21 -20
- package/dist/assets/getContentDeclarationFileTemplate/cjsTemplate.txt +0 -10
- package/dist/assets/getContentDeclarationFileTemplate/esmTemplate.txt +0 -10
- package/dist/assets/getContentDeclarationFileTemplate/jsonTemplate.txt +0 -6
- package/dist/assets/getContentDeclarationFileTemplate/tsTemplate.txt +0 -9
package/dist/cjs/build.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./createDictionaryEntryPoint/generateDictionaryListContent.cjs`),t=require(`./createDictionaryEntryPoint/getBuiltDictionariesPath.cjs`),n=require(`./createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.cjs`),r=require(`./createDictionaryEntryPoint/getBuiltFetchDictionariesPath.cjs`),i=require(`./createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.cjs`),a=require(`./createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.cjs`),o=require(`./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs`),s=require(`./buildIntlayerDictionary/buildIntlayerDictionary.cjs`),c=require(`./createType/createModuleAugmentation.cjs`),l=require(`./createType/createType.cjs`),u=require(`./buildIntlayerDictionary/processContentDeclaration.cjs`),d=require(`./loadDictionaries/loadContentDeclaration.cjs`),f=require(`./loadDictionaries/loadLocalDictionaries.cjs`),p=require(`./formatDictionary.cjs`),m=require(`./loadDictionaries/loadRemoteDictionaries.cjs`),h=require(`./loadDictionaries/loadDictionaries.cjs`),g=require(`./cleanOutputDir.cjs`),_=require(`./writeConfiguration/index.cjs`),v=require(`./prepareIntlayer.cjs`),y=require(`./writeContentDeclaration/detectExportedComponentName.cjs`),b=require(`./writeContentDeclaration/transformJSFile.cjs`),x=require(`./writeContentDeclaration/writeJSFile.cjs`),S=require(`./writeContentDeclaration/writeContentDeclaration.cjs`);exports.buildDictionary=s.buildDictionary,exports.cleanOutputDir=g.cleanOutputDir,exports.createDictionaryEntryPoint=o.createDictionaryEntryPoint,exports.createModuleAugmentation=c.createModuleAugmentation,exports.createTypes=l.createTypes,exports.detectExportedComponentName=y.detectExportedComponentName,exports.ensureIntlayerBundle=d.ensureIntlayerBundle,exports.formatDictionaries=p.formatDictionaries,exports.formatDictionariesOutput=p.formatDictionariesOutput,exports.formatDictionary=p.formatDictionary,exports.formatDictionaryOutput=p.formatDictionaryOutput,exports.formatDistantDictionaries=m.formatDistantDictionaries,exports.formatLocalDictionaries=d.formatLocalDictionaries,exports.generateDictionaryListContent=e.generateDictionaryListContent,exports.generateTypeScriptType=l.generateTypeScriptType,exports.getBuiltDictionariesPath=t.getBuiltDictionariesPath,exports.getBuiltDynamicDictionariesPath=n.getBuiltDynamicDictionariesPath,exports.getBuiltFetchDictionariesPath=r.getBuiltFetchDictionariesPath,exports.getBuiltRemoteDictionariesPath=i.getBuiltRemoteDictionariesPath,exports.getBuiltUnmergedDictionariesPath=a.getBuiltUnmergedDictionariesPath,exports.getTypeName=c.getTypeName,exports.isCachedConfigurationUpToDate=_.isCachedConfigurationUpToDate,exports.loadContentDeclaration=d.loadContentDeclaration,exports.loadContentDeclarations=d.loadContentDeclarations,exports.loadDictionaries=h.loadDictionaries,exports.loadLocalDictionaries=f.loadLocalDictionaries,exports.loadRemoteDictionaries=m.loadRemoteDictionaries,exports.prepareIntlayer=v.prepareIntlayer,exports.processContentDeclaration=u.processContentDeclaration,exports.transformJSFile=b.transformJSFile,exports.writeConfiguration=_.writeConfiguration,exports.writeContentDeclaration=S.writeContentDeclaration,exports.writeJSFile=x.writeJSFile;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./writeDynamicDictionary.cjs`),t=require(`./writeFetchDictionary.cjs`),n=require(`./writeMergedDictionary.cjs`),r=require(`./writeUnmergedDictionary.cjs`);let i=require(`@intlayer/config/client`),a=require(`@intlayer/
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`./writeDynamicDictionary.cjs`),t=require(`./writeFetchDictionary.cjs`),n=require(`./writeMergedDictionary.cjs`),r=require(`./writeUnmergedDictionary.cjs`);let i=require(`@intlayer/config/client`),a=require(`@intlayer/unmerged-dictionaries-entry`),o=require(`@intlayer/config/node`);const s=async(s,c=(0,o.getConfiguration)(),l=[`cjs`,`esm`],u=!0)=>{let d=c?.build?.importMode??c?.dictionary?.importMode??i.DefaultValues.Dictionary.IMPORT_MODE,f=[...s];if(u){let e=(0,a.getUnmergedDictionaries)(c);for(let t of s){let n=e[t.key];if(n?.length>0){let e=n.filter(e=>e.localId!==t.localId);f.push(...e)}}}let p=await r.writeUnmergedDictionaries(f,c),m=await n.writeMergedDictionaries(p,c),h={},g=new Set;for(let[e,t]of Object.entries(m)){let n=t.dictionary.importMode??d;(n===`dynamic`||n===`fetch`)&&(h[e]=t),n===`fetch`&&g.add(e)}let _=null;Object.keys(h).length>0&&(_=await e.writeDynamicDictionary(h,c,l));let v=null;if(_&&g.size>0){let e={};for(let t of g)_[t]&&(e[t]=_[t]);Object.keys(e).length>0&&(v=await t.writeFetchDictionary(e,c,l))}return{unmergedDictionaries:p,mergedDictionaries:m,dynamicDictionaries:_,fetchDictionaries:v}};exports.buildDictionary=s;
|
|
2
2
|
//# sourceMappingURL=buildIntlayerDictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildIntlayerDictionary.cjs","names":["DefaultValues","writeUnmergedDictionaries","writeMergedDictionaries","writeDynamicDictionary","writeFetchDictionary"],"sources":["../../../src/buildIntlayerDictionary/buildIntlayerDictionary.ts"],"sourcesContent":["import { DefaultValues } from '@intlayer/config/client';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { Dictionary } from '@intlayer/types';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\nimport {\n type LocalizedDictionaryOutput,\n writeDynamicDictionary,\n} from './writeDynamicDictionary';\nimport { writeFetchDictionary } from './writeFetchDictionary';\nimport { writeMergedDictionaries } from './writeMergedDictionary';\nimport { writeUnmergedDictionaries } from './writeUnmergedDictionary';\n\n/**\n * This function transpile the bundled code to to make dictionaries as JSON files\n */\nexport const buildDictionary = async (\n localDictionariesEntries: Dictionary[],\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm'],\n importOtherDictionaries = true\n) => {\n const importMode =\n configuration
|
|
1
|
+
{"version":3,"file":"buildIntlayerDictionary.cjs","names":["DefaultValues","writeUnmergedDictionaries","writeMergedDictionaries","writeDynamicDictionary","writeFetchDictionary"],"sources":["../../../src/buildIntlayerDictionary/buildIntlayerDictionary.ts"],"sourcesContent":["import { DefaultValues } from '@intlayer/config/client';\nimport { getConfiguration } from '@intlayer/config/node';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\nimport {\n type LocalizedDictionaryOutput,\n writeDynamicDictionary,\n} from './writeDynamicDictionary';\nimport { writeFetchDictionary } from './writeFetchDictionary';\nimport { writeMergedDictionaries } from './writeMergedDictionary';\nimport { writeUnmergedDictionaries } from './writeUnmergedDictionary';\n\n/**\n * This function transpile the bundled code to to make dictionaries as JSON files\n */\nexport const buildDictionary = async (\n localDictionariesEntries: Dictionary[],\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm'],\n importOtherDictionaries = true\n) => {\n const importMode =\n configuration?.build?.importMode ??\n configuration?.dictionary?.importMode ??\n DefaultValues.Dictionary.IMPORT_MODE;\n\n const unmergedDictionariesToUpdate: Dictionary[] = [\n ...localDictionariesEntries,\n ];\n\n if (importOtherDictionaries) {\n const prevUnmergedDictionaries: Record<string, Dictionary[]> =\n getUnmergedDictionaries(configuration);\n\n // Reinsert other dictionaries with the same key to avoid merging errors\n for (const dictionaryToWrite of localDictionariesEntries) {\n const allPrebuiltUnmergedDictionaries =\n prevUnmergedDictionaries[dictionaryToWrite.key];\n\n if (allPrebuiltUnmergedDictionaries?.length > 0) {\n // Do not add the same dictionary again by filtering out the one with the same localId\n const otherUnmergedDictionaries =\n allPrebuiltUnmergedDictionaries.filter(\n (unmergedDictionary) =>\n unmergedDictionary.localId !== dictionaryToWrite.localId\n );\n\n unmergedDictionariesToUpdate.push(...otherUnmergedDictionaries);\n }\n }\n }\n\n const unmergedDictionaries = await writeUnmergedDictionaries(\n unmergedDictionariesToUpdate,\n configuration\n );\n\n const mergedDictionaries = await writeMergedDictionaries(\n unmergedDictionaries,\n configuration\n );\n\n const dictionariesToBuildDynamic: typeof mergedDictionaries = {};\n const keysToBuildFetch = new Set<string>();\n\n for (const [key, mergedResult] of Object.entries(mergedDictionaries)) {\n const dictionary = mergedResult.dictionary;\n const mode = dictionary.importMode ?? importMode;\n\n if (mode === 'dynamic' || mode === 'fetch') {\n dictionariesToBuildDynamic[key] = mergedResult;\n }\n\n if (mode === 'fetch') {\n keysToBuildFetch.add(key);\n }\n }\n\n let dynamicDictionaries: LocalizedDictionaryOutput | null = null;\n\n if (Object.keys(dictionariesToBuildDynamic).length > 0) {\n dynamicDictionaries = await writeDynamicDictionary(\n dictionariesToBuildDynamic,\n configuration,\n formats\n );\n }\n\n let fetchDictionaries: LocalizedDictionaryOutput | null = null;\n\n if (dynamicDictionaries && keysToBuildFetch.size > 0) {\n const dictionariesToBuildFetch: LocalizedDictionaryOutput = {};\n\n for (const key of keysToBuildFetch) {\n if (dynamicDictionaries[key]) {\n dictionariesToBuildFetch[key] = dynamicDictionaries[key];\n }\n }\n\n if (Object.keys(dictionariesToBuildFetch).length > 0) {\n fetchDictionaries = await writeFetchDictionary(\n dictionariesToBuildFetch,\n configuration,\n formats\n );\n }\n }\n\n return {\n unmergedDictionaries,\n mergedDictionaries,\n dynamicDictionaries,\n fetchDictionaries,\n };\n};\n"],"mappings":"2ZAeA,MAAa,EAAkB,MAC7B,EACA,GAAA,EAAA,EAAA,mBAAkC,CAClC,EAA6B,CAAC,MAAO,MAAM,CAC3C,EAA0B,KACvB,CACH,IAAM,EACJ,GAAe,OAAO,YACtB,GAAe,YAAY,YAC3BA,EAAAA,cAAc,WAAW,YAErB,EAA6C,CACjD,GAAG,EACJ,CAED,GAAI,EAAyB,CAC3B,IAAM,GAAA,EAAA,EAAA,yBACoB,EAAc,CAGxC,IAAK,IAAM,KAAqB,EAA0B,CACxD,IAAM,EACJ,EAAyB,EAAkB,KAE7C,GAAI,GAAiC,OAAS,EAAG,CAE/C,IAAM,EACJ,EAAgC,OAC7B,GACC,EAAmB,UAAY,EAAkB,QACpD,CAEH,EAA6B,KAAK,GAAG,EAA0B,GAKrE,IAAM,EAAuB,MAAMC,EAAAA,0BACjC,EACA,EACD,CAEK,EAAqB,MAAMC,EAAAA,wBAC/B,EACA,EACD,CAEK,EAAwD,EAAE,CAC1D,EAAmB,IAAI,IAE7B,IAAK,GAAM,CAAC,EAAK,KAAiB,OAAO,QAAQ,EAAmB,CAAE,CAEpE,IAAM,EADa,EAAa,WACR,YAAc,GAElC,IAAS,WAAa,IAAS,WACjC,EAA2B,GAAO,GAGhC,IAAS,SACX,EAAiB,IAAI,EAAI,CAI7B,IAAI,EAAwD,KAExD,OAAO,KAAK,EAA2B,CAAC,OAAS,IACnD,EAAsB,MAAMC,EAAAA,uBAC1B,EACA,EACA,EACD,EAGH,IAAI,EAAsD,KAE1D,GAAI,GAAuB,EAAiB,KAAO,EAAG,CACpD,IAAM,EAAsD,EAAE,CAE9D,IAAK,IAAM,KAAO,EACZ,EAAoB,KACtB,EAAyB,GAAO,EAAoB,IAIpD,OAAO,KAAK,EAAyB,CAAC,OAAS,IACjD,EAAoB,MAAMC,EAAAA,qBACxB,EACA,EACA,EACD,EAIL,MAAO,CACL,uBACA,qBACA,sBACA,oBACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processContentDeclaration.cjs","names":["resolveObjectPromises","autoDecorateContent"],"sources":["../../../src/buildIntlayerDictionary/processContentDeclaration.ts"],"sourcesContent":["import { logger } from '@intlayer/config/logger';\nimport type { Dictionary
|
|
1
|
+
{"version":3,"file":"processContentDeclaration.cjs","names":["resolveObjectPromises","autoDecorateContent"],"sources":["../../../src/buildIntlayerDictionary/processContentDeclaration.ts"],"sourcesContent":["import { logger } from '@intlayer/config/logger';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { autoDecorateContent } from '../utils/autoDecorateContent';\nimport { resolveObjectPromises } from '../utils/resolveObjectPromises';\n\n/**\n * Function to load, process the module and return the Intlayer Dictionary from the module file\n */\nexport const processContentDeclaration = async (\n contentDeclaration: Dictionary,\n configuration: IntlayerConfig\n): Promise<Dictionary | undefined> => {\n try {\n const resolvedContent = (await resolveObjectPromises(\n contentDeclaration.content\n )) as Dictionary['content'];\n\n const isAutoDecorateContentEnabled =\n contentDeclaration.contentAutoTransformation ??\n configuration.dictionary?.contentAutoTransformation ??\n false;\n\n const decoratedContent = isAutoDecorateContentEnabled\n ? autoDecorateContent(resolvedContent, isAutoDecorateContentEnabled)\n : resolvedContent;\n\n return {\n ...contentDeclaration,\n content: decoratedContent,\n } as Dictionary;\n } catch (error) {\n logger(error, {\n level: 'error',\n });\n }\n};\n"],"mappings":"6PASA,MAAa,EAA4B,MACvC,EACA,IACoC,CACpC,GAAI,CACF,IAAM,EAAmB,MAAMA,EAAAA,sBAC7B,EAAmB,QACpB,CAEK,EACJ,EAAmB,2BACnB,EAAc,YAAY,2BAC1B,GAEI,EAAmB,EACrBC,EAAAA,oBAAoB,EAAiB,EAA6B,CAClE,EAEJ,MAAO,CACL,GAAG,EACH,QAAS,EACV,OACM,EAAO,EACd,EAAA,EAAA,QAAO,EAAO,CACZ,MAAO,QACR,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`../writeJsonIfChanged.cjs`);let r=require(
|
|
2
|
-
`);return
|
|
3
|
-
`),t===`cjs`&&(
|
|
4
|
-
`),
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`../writeJsonIfChanged.cjs`);let r=require(`node:fs/promises`),i=require(`node:path`),a=require(`@intlayer/config/logger`),o=require(`@intlayer/config/node`),s=require(`@intlayer/config/utils`),c=require(`@intlayer/core/plugins`);const l=(e,t=`esm`,n=(0,o.getConfiguration)())=>{let{dynamicDictionariesDir:r}=n.system,a=``,c=Object.entries(e).filter(e=>!!e[1]).sort(([e],[t])=>String(e).localeCompare(String(t))).map(([e,n])=>{let a=(0,s.normalizePath)((0,i.relative)(r,n.dictionaryPath));return t===`esm`?` '${e}': () => import('./${a}', { assert: { type: 'json' }}).then(mod => mod.default)`:` '${e}': () => Promise.resolve(require('./${a}'))`}).join(`,
|
|
2
|
+
`);return a+=`const content = {\n${c}\n};\n`,t===`esm`&&(a+=`export default content;
|
|
3
|
+
`),t===`cjs`&&(a+=`module.exports = content;
|
|
4
|
+
`),a},u=async(s,u=(0,o.getConfiguration)(),d=[`cjs`,`esm`])=>{let{locales:f,defaultLocale:p}=u.internationalization,{dynamicDictionariesDir:m}=u.system;await(0,r.mkdir)((0,i.resolve)(m),{recursive:!0});let h={};return await e.parallelize(Object.entries(s).sort(([e],[t])=>String(e).localeCompare(String(t))),async([r,o])=>{if(r===`undefined`)return;let s={};await e.parallelize(f,async e=>{let t=(0,c.getPerLocaleDictionary)(o.dictionary,e,p),a=`${r}.${e}.json`,l=(0,i.resolve)(m,a);await n.writeJsonIfChanged(l,t).catch(e=>{console.error(`Error creating localized ${a}:`,e)}),s[e]={dictionaryPath:l,dictionary:t}}),h[r]=s,await e.parallelize(d,async e=>{let n=e===`cjs`?`cjs`:`mjs`,o=l(s,e,u);await t.writeFileIfChanged((0,i.resolve)(m,`${r}.${n}`),o).catch(e=>{console.error(`Error creating dynamic ${(0,a.colorizePath)((0,i.resolve)(m,`${r}.${n}`))}:`,e)})})}),h};exports.generateDictionaryEntryPoint=l,exports.writeDynamicDictionary=u;
|
|
5
5
|
//# sourceMappingURL=writeDynamicDictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeDynamicDictionary.cjs","names":["parallelize","writeJsonIfChanged","writeFileIfChanged"],"sources":["../../../src/buildIntlayerDictionary/writeDynamicDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport { colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { normalizePath } from '@intlayer/config/utils';\nimport { getPerLocaleDictionary } from '@intlayer/core/plugins';\nimport type { Dictionary
|
|
1
|
+
{"version":3,"file":"writeDynamicDictionary.cjs","names":["parallelize","writeJsonIfChanged","writeFileIfChanged"],"sources":["../../../src/buildIntlayerDictionary/writeDynamicDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { relative, resolve } from 'node:path';\nimport { colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { normalizePath } from '@intlayer/config/utils';\nimport { getPerLocaleDictionary } from '@intlayer/core/plugins';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport { parallelize } from '../utils/parallelize';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\nimport type { MergedDictionaryOutput } from './writeMergedDictionary';\n\nexport type DictionaryResult = {\n dictionaryPath: string;\n dictionary: Dictionary;\n};\n\nexport type LocalizedDictionaryResult = Partial<\n Record<Locale, DictionaryResult>\n>;\n\nexport type LocalizedDictionaryOutput = Record<\n string,\n LocalizedDictionaryResult\n>;\n\n/**\n * This function generates the content of the dictionary list file\n */\nexport const generateDictionaryEntryPoint = (\n localizedDictionariesPathsRecord: LocalizedDictionaryResult,\n format: 'cjs' | 'esm' = 'esm',\n configuration = getConfiguration()\n): string => {\n const { dynamicDictionariesDir } = configuration.system;\n\n let content = '';\n\n // Format Dictionary Map - map locales to functions\n const formattedDictionaryMap: string = Object.entries(\n localizedDictionariesPathsRecord\n )\n // The following filter/sort preserve determinism of the generated map\n // when files are built in parallel or across different Node versions.\n .filter((entry): entry is [string, DictionaryResult] => Boolean(entry[1]))\n .sort(([a], [b]) => String(a).localeCompare(String(b)))\n .map(([locale, dictionary]) => {\n const relativePath = normalizePath(\n relative(dynamicDictionariesDir, dictionary.dictionaryPath)\n );\n\n if (format === 'esm') {\n return ` '${locale}': () => import('./${relativePath}', { assert: { type: 'json' }}).then(mod => mod.default)`;\n }\n\n return ` '${locale}': () => Promise.resolve(require('./${relativePath}'))`;\n })\n .join(',\\n');\n\n content += `const content = {\\n${formattedDictionaryMap}\\n};\\n`;\n\n if (format === 'esm') content += `export default content;\\n`;\n if (format === 'cjs') content += `module.exports = content;\\n`;\n\n return content;\n};\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/dynamic_dictionaries/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeDynamicDictionary = async (\n mergedDictionaries: MergedDictionaryOutput,\n configuration = getConfiguration(),\n formats: ('cjs' | 'esm')[] = ['cjs', 'esm']\n): Promise<LocalizedDictionaryOutput> => {\n const { locales, defaultLocale } = configuration.internationalization;\n const { dynamicDictionariesDir } = configuration.system;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dynamicDictionariesDir), { recursive: true });\n\n const resultDictionariesPaths: LocalizedDictionaryOutput = {};\n\n // Merge dictionaries with the same key and write to dictionariesDir\n await parallelize(\n Object.entries(mergedDictionaries).sort(([a], [b]) =>\n String(a).localeCompare(String(b))\n ),\n async ([key, dictionaryEntry]) => {\n if (key === 'undefined') return;\n\n const localizedDictionariesPathsRecord: LocalizedDictionaryResult = {};\n\n await parallelize(locales, async (locale) => {\n const localizedDictionary = getPerLocaleDictionary(\n dictionaryEntry.dictionary,\n locale,\n defaultLocale\n );\n\n const outputFileName = `${key}.${locale}.json`;\n const resultFilePath = resolve(dynamicDictionariesDir, outputFileName);\n\n // Write the localized dictionary\n await writeJsonIfChanged(resultFilePath, localizedDictionary).catch(\n (err) => {\n console.error(`Error creating localized ${outputFileName}:`, err);\n }\n );\n\n localizedDictionariesPathsRecord[locale] = {\n dictionaryPath: resultFilePath,\n dictionary: localizedDictionary,\n };\n });\n\n resultDictionariesPaths[key] = localizedDictionariesPathsRecord;\n\n await parallelize(formats, async (format) => {\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n const content = generateDictionaryEntryPoint(\n localizedDictionariesPathsRecord,\n format,\n configuration\n );\n\n await writeFileIfChanged(\n resolve(dynamicDictionariesDir, `${key}.${extension}`),\n content\n ).catch((err) => {\n console.error(\n `Error creating dynamic ${colorizePath(resolve(dynamicDictionariesDir, `${key}.${extension}`))}:`,\n err\n );\n });\n });\n }\n );\n\n return resultDictionariesPaths;\n};\n"],"mappings":"mbA8BA,MAAa,GACX,EACA,EAAwB,MACxB,GAAA,EAAA,EAAA,mBAAkC,GACvB,CACX,GAAM,CAAE,0BAA2B,EAAc,OAE7C,EAAU,GAGR,EAAiC,OAAO,QAC5C,EACD,CAGE,OAAQ,GAA+C,EAAQ,EAAM,GAAI,CACzE,MAAM,CAAC,GAAI,CAAC,KAAO,OAAO,EAAE,CAAC,cAAc,OAAO,EAAE,CAAC,CAAC,CACtD,KAAK,CAAC,EAAQ,KAAgB,CAC7B,IAAM,GAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,UACK,EAAwB,EAAW,eAAe,CAC5D,CAMD,OAJI,IAAW,MACN,MAAM,EAAO,qBAAqB,EAAa,0DAGjD,MAAM,EAAO,sCAAsC,EAAa,MACvE,CACD,KAAK;EAAM,CAOd,MALA,IAAW,sBAAsB,EAAuB,QAEpD,IAAW,QAAO,GAAW;GAC7B,IAAW,QAAO,GAAW;GAE1B,GAmBI,EAAyB,MACpC,EACA,GAAA,EAAA,EAAA,mBAAkC,CAClC,EAA6B,CAAC,MAAO,MAAM,GACJ,CACvC,GAAM,CAAE,UAAS,iBAAkB,EAAc,qBAC3C,CAAE,0BAA2B,EAAc,OAGjD,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAuB,CAAE,CAAE,UAAW,GAAM,CAAC,CAEjE,IAAM,EAAqD,EAAE,CA0D7D,OAvDA,MAAMA,EAAAA,YACJ,OAAO,QAAQ,EAAmB,CAAC,MAAM,CAAC,GAAI,CAAC,KAC7C,OAAO,EAAE,CAAC,cAAc,OAAO,EAAE,CAAC,CACnC,CACD,MAAO,CAAC,EAAK,KAAqB,CAChC,GAAI,IAAQ,YAAa,OAEzB,IAAM,EAA8D,EAAE,CAEtE,MAAMA,EAAAA,YAAY,EAAS,KAAO,IAAW,CAC3C,IAAM,GAAA,EAAA,EAAA,wBACJ,EAAgB,WAChB,EACA,EACD,CAEK,EAAiB,GAAG,EAAI,GAAG,EAAO,OAClC,GAAA,EAAA,EAAA,SAAyB,EAAwB,EAAe,CAGtE,MAAMC,EAAAA,mBAAmB,EAAgB,EAAoB,CAAC,MAC3D,GAAQ,CACP,QAAQ,MAAM,4BAA4B,EAAe,GAAI,EAAI,EAEpE,CAED,EAAiC,GAAU,CACzC,eAAgB,EAChB,WAAY,EACb,EACD,CAEF,EAAwB,GAAO,EAE/B,MAAMD,EAAAA,YAAY,EAAS,KAAO,IAAW,CAC3C,IAAM,EAAY,IAAW,MAAQ,MAAQ,MACvC,EAAU,EACd,EACA,EACA,EACD,CAED,MAAME,EAAAA,oBAAAA,EAAAA,EAAAA,SACI,EAAwB,GAAG,EAAI,GAAG,IAAY,CACtD,EACD,CAAC,MAAO,GAAQ,CACf,QAAQ,MACN,2BAAA,EAAA,EAAA,eAAA,EAAA,EAAA,SAA+C,EAAwB,GAAG,EAAI,GAAG,IAAY,CAAC,CAAC,GAC/F,EACD,EACD,EACF,EAEL,CAEM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`);let n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`);let n=require(`node:fs/promises`),r=require(`node:path`),i=require(`@intlayer/config/logger`),a=require(`@intlayer/config/node`),o=require(`@intlayer/config/utils`);const s=(e,t=`esm`,n=(0,a.getConfiguration)())=>{let{fetchDictionariesDir:i}=n.system,{liveSyncURL:s}=n.editor,c=``,l=Object.entries(e).map(([e,n])=>{let a=(0,o.normalizePath)((0,r.relative)(i,n.dictionaryPath));return t===`esm`?` '${e}': () => (async () => { try {return await fetch('${s}/dictionaries/${n.dictionary.key}/${e}').then(res => res.json())} catch (_error) {return await import('./${a}', { assert: { type: 'json' }}).then(mod => mod.default)}})()`:` '${e}': () => (async () => { try {return await fetch('${s}/dictionaries/${n.dictionary.key}/${e}').then(res => res.json())} catch (_error) {return Promise.resolve(require('./${a}'))}})()`}).join(`,
|
|
2
2
|
`);return c+=`const content = {\n${l}\n};\n`,t===`esm`&&(c+=`export default content;
|
|
3
3
|
`),t===`cjs`&&(c+=`module.exports = content;
|
|
4
|
-
`),c},c=async(o,c=(0,
|
|
4
|
+
`),c},c=async(o,c=(0,a.getConfiguration)(),l=[`cjs`,`esm`])=>{let{fetchDictionariesDir:u}=c.system;return await(0,n.mkdir)((0,r.resolve)(u),{recursive:!0}),await e.parallelize(Object.entries(o),async([n,a])=>{n!==`undefined`&&await e.parallelize(l,async e=>{let o=e===`cjs`?`cjs`:`mjs`,l=s(a,e,c);await t.writeFileIfChanged((0,r.resolve)(u,`${n}.${o}`),l).catch(e=>{console.error(`Error creating fetch ${(0,i.colorizePath)((0,r.resolve)(u,`${n}.${o}`))}:`,e)})})}),{}};exports.generateDictionaryEntryPoint=s,exports.writeFetchDictionary=c;
|
|
5
5
|
//# sourceMappingURL=writeFetchDictionary.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeJsonIfChanged.cjs`);let n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeJsonIfChanged.cjs`);let n=require(`node:fs/promises`),r=require(`node:path`),i=require(`@intlayer/config/logger`),a=require(`@intlayer/config/node`),o=require(`@intlayer/core/dictionaryManipulator`);const s=async(s,c=(0,a.getConfiguration)())=>{let{dictionariesDir:l}=c.system;await(0,n.mkdir)((0,r.resolve)(l),{recursive:!0});let u=await e.parallelize(Object.entries(s),async([e,n])=>{if(e===`undefined`)return;let a=(0,o.mergeDictionaries)((0,o.normalizeDictionaries)(n.dictionaries,c)),s=(0,r.resolve)(l,`${e}.json`);return await t.writeJsonIfChanged(s,a).catch(e=>{console.error(`Error creating merged ${(0,i.colorizePath)(s)}:`,e)}),[e,{dictionaryPath:s,dictionary:a}]});return Object.fromEntries(u.filter(Boolean))};exports.writeMergedDictionaries=s;
|
|
2
2
|
//# sourceMappingURL=writeMergedDictionary.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeMergedDictionary.cjs","names":["parallelize","writeJsonIfChanged"],"sources":["../../../src/buildIntlayerDictionary/writeMergedDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n mergeDictionaries,\n normalizeDictionaries,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types';\nimport { parallelize } from '../utils/parallelize';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\nimport type { UnmergedDictionaryOutput } from './writeUnmergedDictionary';\n\nexport type MergedDictionaryResult = {\n dictionaryPath: string;\n dictionary: Dictionary;\n};\n\nexport type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;\n\n/**\n * Write the merged dictionaries to the dictionariesDir\n * @param groupedDictionaries - The grouped dictionaries\n * @param configuration - The configuration\n * @returns The merged 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/dictionary/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeMergedDictionaries = async (\n groupedDictionaries: UnmergedDictionaryOutput,\n configuration = getConfiguration()\n): Promise<MergedDictionaryOutput> => {\n const { dictionariesDir } = configuration.system;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionariesEntry]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n MergedDictionaryResult,\n ];\n }\n\n const normalizedDictionaries = normalizeDictionaries(\n dictionariesEntry.dictionaries,\n configuration\n );\n\n const mergedDictionary = mergeDictionaries(normalizedDictionaries);\n\n const outputFileName = `${key}.json`;\n const resultFilePath = resolve(dictionariesDir, outputFileName);\n\n // Write the merged dictionary\n await writeJsonIfChanged(resultFilePath, mergedDictionary).catch(\n (err) => {\n console.error(\n `Error creating merged ${colorizePath(resultFilePath)}:`,\n err\n );\n }\n );\n\n return [\n key,\n {\n dictionaryPath: resultFilePath,\n dictionary: mergedDictionary,\n } as MergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<readonly [string, MergedDictionaryResult]>\n );\n};\n"],"mappings":"sXAoCA,MAAa,EAA0B,MACrC,EACA,GAAA,EAAA,EAAA,mBAAkC,GACE,CACpC,GAAM,CAAE,mBAAoB,EAAc,OAG1C,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAgB,CAAE,CAAE,UAAW,GAAM,CAAC,CAE1D,IAAM,EAAU,MAAMA,EAAAA,YACpB,OAAO,QAAQ,EAAoB,CACnC,MAAO,CAAC,EAAK,KAAuB,CAClC,GAAI,IAAQ,YACV,OAWF,IAAM,GAAA,EAAA,EAAA,oBAAA,EAAA,EAAA,uBAJJ,EAAkB,aAClB,EACD,CAEiE,CAG5D,GAAA,EAAA,EAAA,SAAyB,EADR,GAAG,EAAI,OACiC,CAY/D,OATA,MAAMC,EAAAA,mBAAmB,EAAgB,EAAiB,CAAC,MACxD,GAAQ,CACP,QAAQ,MACN,0BAAA,EAAA,EAAA,cAAsC,EAAe,CAAC,GACtD,EACD,EAEJ,CAEM,CACL,EACA,CACE,eAAgB,EAChB,WAAY,EACb,CACF,EAEJ,CAED,OAAO,OAAO,YACZ,EAAQ,OAAO,QAAQ,CACxB"}
|
|
1
|
+
{"version":3,"file":"writeMergedDictionary.cjs","names":["parallelize","writeJsonIfChanged"],"sources":["../../../src/buildIntlayerDictionary/writeMergedDictionary.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { colorizePath } from '@intlayer/config/logger';\nimport { getConfiguration } from '@intlayer/config/node';\nimport {\n mergeDictionaries,\n normalizeDictionaries,\n} from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { parallelize } from '../utils/parallelize';\nimport { writeJsonIfChanged } from '../writeJsonIfChanged';\nimport type { UnmergedDictionaryOutput } from './writeUnmergedDictionary';\n\nexport type MergedDictionaryResult = {\n dictionaryPath: string;\n dictionary: Dictionary;\n};\n\nexport type MergedDictionaryOutput = Record<string, MergedDictionaryResult>;\n\n/**\n * Write the merged dictionaries to the dictionariesDir\n * @param groupedDictionaries - The grouped dictionaries\n * @param configuration - The configuration\n * @returns The merged 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/dictionary/home.json\n * // { key: 'home', content: { ... } },\n * ```\n */\nexport const writeMergedDictionaries = async (\n groupedDictionaries: UnmergedDictionaryOutput,\n configuration = getConfiguration()\n): Promise<MergedDictionaryOutput> => {\n const { dictionariesDir } = configuration.system;\n\n // Create the dictionaries folder if it doesn't exist\n await mkdir(resolve(dictionariesDir), { recursive: true });\n\n const results = await parallelize(\n Object.entries(groupedDictionaries),\n async ([key, dictionariesEntry]) => {\n if (key === 'undefined') {\n return undefined as unknown as readonly [\n string,\n MergedDictionaryResult,\n ];\n }\n\n const normalizedDictionaries = normalizeDictionaries(\n dictionariesEntry.dictionaries,\n configuration\n );\n\n const mergedDictionary = mergeDictionaries(normalizedDictionaries);\n\n const outputFileName = `${key}.json`;\n const resultFilePath = resolve(dictionariesDir, outputFileName);\n\n // Write the merged dictionary\n await writeJsonIfChanged(resultFilePath, mergedDictionary).catch(\n (err) => {\n console.error(\n `Error creating merged ${colorizePath(resultFilePath)}:`,\n err\n );\n }\n );\n\n return [\n key,\n {\n dictionaryPath: resultFilePath,\n dictionary: mergedDictionary,\n } as MergedDictionaryResult,\n ] as const;\n }\n );\n\n return Object.fromEntries(\n results.filter(Boolean) as Array<readonly [string, MergedDictionaryResult]>\n );\n};\n"],"mappings":"sXAoCA,MAAa,EAA0B,MACrC,EACA,GAAA,EAAA,EAAA,mBAAkC,GACE,CACpC,GAAM,CAAE,mBAAoB,EAAc,OAG1C,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAgB,CAAE,CAAE,UAAW,GAAM,CAAC,CAE1D,IAAM,EAAU,MAAMA,EAAAA,YACpB,OAAO,QAAQ,EAAoB,CACnC,MAAO,CAAC,EAAK,KAAuB,CAClC,GAAI,IAAQ,YACV,OAWF,IAAM,GAAA,EAAA,EAAA,oBAAA,EAAA,EAAA,uBAJJ,EAAkB,aAClB,EACD,CAEiE,CAG5D,GAAA,EAAA,EAAA,SAAyB,EADR,GAAG,EAAI,OACiC,CAY/D,OATA,MAAMC,EAAAA,mBAAmB,EAAgB,EAAiB,CAAC,MACxD,GAAQ,CACP,QAAQ,MACN,0BAAA,EAAA,EAAA,cAAsC,EAAe,CAAC,GACtD,EACD,EAEJ,CAEM,CACL,EACA,CACE,eAAgB,EAChB,WAAY,EACb,CACF,EAEJ,CAED,OAAO,OAAO,YACZ,EAAQ,OAAO,QAAQ,CACxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeJsonIfChanged.cjs`),n=require(`../filterInvalidDictionaries.cjs`),r=require(`./writeUnmergedDictionary.cjs`),i=require(`../loadDictionaries/loadRemoteDictionaries.cjs`);let a=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeJsonIfChanged.cjs`),n=require(`../filterInvalidDictionaries.cjs`),r=require(`./writeUnmergedDictionary.cjs`),i=require(`../loadDictionaries/loadRemoteDictionaries.cjs`);let a=require(`node:fs/promises`),o=require(`node:path`),s=require(`@intlayer/config/logger`),c=require(`@intlayer/config/node`),l=require(`@intlayer/core/dictionaryManipulator`);const u=async(u,d=(0,c.getConfiguration)())=>{let{remoteDictionariesDir:f}=d.system;await(0,a.mkdir)((0,o.resolve)(f),{recursive:!0});let p=r.groupDictionariesByKey(n.filterInvalidDictionaries(u,d)),m=await e.parallelize(Object.entries(p),async([e,n])=>{if(e===`undefined`)return;let r=(0,l.orderDictionaries)(i.formatDistantDictionaries(n),d),a=(0,o.resolve)(f,`${e}.json`);return await t.writeJsonIfChanged(a,r).catch(e=>{console.error(`${s.x} Error creating unmerged ${(0,s.colorizePath)(a)}:`,e)}),[e,{dictionaryPath:a,dictionaries:n}]});return Object.fromEntries(m.filter(Boolean))};exports.writeRemoteDictionary=u;
|
|
2
2
|
//# sourceMappingURL=writeRemoteDictionary.cjs.map
|
|
@@ -1 +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 { getConfiguration } from '@intlayer/config/node';\nimport { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary } from '@intlayer/types';\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 = getConfiguration()\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(\n formattedDictionaries,\n configuration\n );\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":"2gBAsCA,MAAa,EAAwB,MACnC,EACA,GAAA,EAAA,EAAA,mBAAkC,GACE,CACpC,GAAM,CAAE,yBAA0B,EAAc,OAGhD,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAsB,CAAE,CAAE,UAAW,GAAM,CAAC,CAQhE,IAAM,EAAsBA,EAAAA,uBANCC,EAAAA,0BAC3B,EACA,EACD,CAGuE,CAGlE,EAAU,MAAMC,EAAAA,YACpB,OAAO,QAAQ,EAAoB,CACnC,MAAO,CAAC,EAAK,KAAkB,CAC7B,GAAI,IAAQ,YACV,OAQF,IAAM,GAAA,EAAA,EAAA,mBAFwBC,EAAAA,0BAA0B,EAAa,CAInE,EACD,CAGK,GAAA,EAAA,EAAA,SAA2B,EADV,GAAG,EAAI,OACyC,CAYvE,OATA,MAAMC,EAAAA,mBAAmB,EAAkB,EAAoB,CAAC,MAC7D,GAAQ,CACP,QAAQ,MACN,GAAGC,EAAAA,EAAE,4BAAA,EAAA,EAAA,cAAwC,EAAiB,CAAC,GAC/D,EACD,EAEJ,CAEM,CACL,EACA,CACE,eAAgB,EAChB,eACD,CACF,EAEJ,CAED,OAAO,OAAO,YACZ,EAAQ,OAAO,QAAQ,CAGxB"}
|
|
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 { getConfiguration } from '@intlayer/config/node';\nimport { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\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 = getConfiguration()\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(\n formattedDictionaries,\n configuration\n );\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":"2gBAsCA,MAAa,EAAwB,MACnC,EACA,GAAA,EAAA,EAAA,mBAAkC,GACE,CACpC,GAAM,CAAE,yBAA0B,EAAc,OAGhD,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAsB,CAAE,CAAE,UAAW,GAAM,CAAC,CAQhE,IAAM,EAAsBA,EAAAA,uBANCC,EAAAA,0BAC3B,EACA,EACD,CAGuE,CAGlE,EAAU,MAAMC,EAAAA,YACpB,OAAO,QAAQ,EAAoB,CACnC,MAAO,CAAC,EAAK,KAAkB,CAC7B,GAAI,IAAQ,YACV,OAQF,IAAM,GAAA,EAAA,EAAA,mBAFwBC,EAAAA,0BAA0B,EAAa,CAInE,EACD,CAGK,GAAA,EAAA,EAAA,SAA2B,EADV,GAAG,EAAI,OACyC,CAYvE,OATA,MAAMC,EAAAA,mBAAmB,EAAkB,EAAoB,CAAC,MAC7D,GAAQ,CACP,QAAQ,MACN,GAAGC,EAAAA,EAAE,4BAAA,EAAA,EAAA,cAAwC,EAAiB,CAAC,GAC/D,EACD,EAEJ,CAEM,CACL,EACA,CACE,eAAgB,EAChB,eACD,CACF,EAEJ,CAED,OAAO,OAAO,YACZ,EAAQ,OAAO,QAAQ,CAGxB"}
|
|
@@ -1 +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 { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\nimport type {
|
|
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 { orderDictionaries } from '@intlayer/core/dictionaryManipulator';\nimport type { Dictionary, DictionaryKey } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\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): 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(\n dictionaries,\n configuration\n );\n\n const outputFileName = `${key}.json`;\n const unmergedFilePath = resolve(unmergedDictionariesDir, outputFileName);\n\n // Write the grouped dictionaries in disk if the editor is enabled\n // No need them if the editor is disabled\n if (configuration.editor.enabled) {\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":"iYAUA,MAAa,EACX,GAEA,EAAa,QACV,EAAK,IAAe,CACnB,IAAM,EAAM,EAAW,IAKvB,OAJK,EAAI,KACP,EAAI,GAAO,EAAE,EAEf,EAAI,GAAK,KAAK,EAAW,CAClB,GAET,EAAE,CACH,CAgCU,EAA4B,MACvC,EACA,IACsC,CACtC,GAAM,CAAE,2BAA4B,EAAc,OAGlD,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAwB,CAAE,CAAE,UAAW,GAAM,CAAC,CASlE,IAAM,EAAsB,EAPCA,EAAAA,0BAC3B,EACA,EACA,CAAE,YAAa,GAAM,CACtB,CAGuE,CAElE,EAAU,MAAMC,EAAAA,YACpB,OAAO,QAAQ,EAAoB,CACnC,MAAO,CAAC,EAAK,KAAkB,CAC7B,GAAI,IAAQ,YACV,OAMF,IAAM,GAAA,EAAA,EAAA,mBACJ,EACA,EACD,CAGK,GAAA,EAAA,EAAA,SAA2B,EADV,GAAG,EAAI,OAC2C,CAezE,OAXI,EAAc,OAAO,SACvB,MAAMC,EAAAA,mBAAmB,EAAkB,EAAoB,CAAC,MAC7D,GAAQ,CACP,QAAQ,MACN,GAAGC,EAAAA,EAAE,4BAAA,EAAA,EAAA,cAAwC,EAAiB,CAAC,GAC/D,EACD,EAEJ,CAGI,CACL,EACA,CACE,eAAgB,EACF,eACf,CACF,EAEJ,CAED,OAAO,OAAO,YACZ,EAAQ,OAAO,QAAQ,CAGxB"}
|
|
@@ -1 +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';\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":"2MAKA,MAAa,EAAiB,KAAO,IAAkC,CACrE,GAAM,CACJ,kBACA,0BACA,yBACA,wBACA,uBACA,UACA,WACA,YACA,YACE,EAAc,OAEZ,GAAA,EAAA,EAAA,cAAyB,EAAc,CAEvC,EAA+B,CACnC,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACD,CAGD,MAAM,QAAQ,IACZ,EACG,OAAQ,IAAA,EAAA,EAAA,YAAmB,EAAI,CAAC,CAChC,IAAK,IAAA,EAAA,EAAA,IAAW,EAAK,CAAE,UAAW,GAAM,MAAO,GAAM,CAAC,CAAC,CAC3D,CAED,EAAU,2BAA4B,CACpC,UAAW,GACZ,CAAC"}
|
|
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":"2MAKA,MAAa,EAAiB,KAAO,IAAkC,CACrE,GAAM,CACJ,kBACA,0BACA,yBACA,wBACA,uBACA,UACA,WACA,YACA,YACE,EAAc,OAEZ,GAAA,EAAA,EAAA,cAAyB,EAAc,CAEvC,EAA+B,CACnC,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACD,CAGD,MAAM,QAAQ,IACZ,EACG,OAAQ,IAAA,EAAA,EAAA,YAAmB,EAAI,CAAC,CAChC,IAAK,IAAA,EAAA,EAAA,IAAW,EAAK,CAAE,UAAW,GAAM,MAAO,GAAM,CAAC,CAAC,CAC3D,CAED,EAAU,2BAA4B,CACpC,UAAW,GACZ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`),t=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./_virtual/_rolldown/runtime.cjs`),t=require(`./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs`),n=require(`./writeJsonIfChanged.cjs`);let r=require(`node:fs/promises`),i=require(`node:path`),a=require(`@intlayer/config/client`),o=require(`@intlayer/config/logger`),s=require(`@intlayer/dictionaries-entry`),c=require(`@intlayer/unmerged-dictionaries-entry`),l=require(`fast-glob`);l=e.__toESM(l);const u=async(e,u,d)=>{let f=(0,o.getAppLogger)(d),p=(0,c.getUnmergedDictionaries)(d),m=d.system.baseDir,h=(0,i.relative)(m,e),g=Object.values(p).flat().filter(e=>e.filePath===h&&!u.includes(e.key)).filter((e,t,n)=>t===n.findIndex(t=>t.key===e.key)),_=[],v=[],y=[];await Promise.all(g.map(async e=>{let t=(0,i.normalize)((0,i.join)(d.system.unmergedDictionariesDir,`${e.key}.json`));try{let i=await(0,r.readFile)(t,`utf8`),a=JSON.parse(i);a.length===1?a[0].filePath===h&&(f(`Removing outdated dictionary ${(0,o.colorizeKey)(e.key)}`,{isVerbose:!0}),v.push(t),y.push(e.key)):(await n.writeJsonIfChanged(t,a.filter(e=>e.filePath!==h)),_.push(e.localId))}catch(t){t.code===`ENOENT`&&(y.includes(e.key)||y.push(e.key))}}));let b=(0,s.getDictionaries)(d),x=(Object.values(b)?.filter(e=>!u.includes(e.key)&&e.localIds?.length===1&&e.localIds[0].endsWith(`::local::${h}`))).filter((e,t,n)=>t===n.findIndex(t=>t.key===e.key));return await Promise.all(x.map(async e=>{let t=(0,i.normalize)((0,i.join)(d.system.dictionariesDir,`${e.key}.json`));try{let s=await(0,r.readFile)(t,`utf8`),c=JSON.parse(s);if(c.localIds?.length===1){if(c.localIds[0].endsWith(`::local::${h}`)){f(`Removing outdated unmerged dictionary ${(0,o.colorizeKey)(e.key)}`,{isVerbose:!0}),v.push(t);let n=(0,i.normalize)((0,i.join)(d.system.typesDir,`${e.key}.ts`));v.push(n);let r=await(0,l.default)((0,a.normalizePath)((0,i.join)(d.system.dynamicDictionariesDir,`${e.key}.*`)),{absolute:!0});v.push(...r),y.includes(e.key)||y.push(e.key)}}else{let e=c.localIds?.filter(e=>!e.endsWith(`::local::${h}`));await n.writeJsonIfChanged(t,{...c,localIds:e})}}catch(t){if(t.code===`ENOENT`){y.includes(e.key)||y.push(e.key);let t=(0,i.normalize)((0,i.join)(d.system.typesDir,`${e.key}.ts`));v.push(t)}}})),(v.length>0||y.length>0)&&(await t.createDictionaryEntryPoint(d,{excludeKeys:y}),v.length>0&&await Promise.all(v.map(async e=>{let t=(0,i.relative)(m,e);try{await(0,r.rm)(e,{force:!0}),f(`Deleted artifact: ${(0,o.colorizePath)(t)}`,{isVerbose:!0})}catch{f(`Error while removing file ${(0,o.colorizePath)(t)}`,{isVerbose:!0})}}))),{changedDictionariesLocalIds:_,excludeKeys:y,hasRebuilt:v.length>0||y.length>0}};exports.cleanRemovedContentDeclaration=u;
|
|
2
2
|
//# sourceMappingURL=cleanRemovedContentDeclaration.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanRemovedContentDeclaration.cjs","names":["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 { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { Dictionary, IntlayerConfig } from '@intlayer/types';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\nimport fg from 'fast-glob';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint';\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 = getUnmergedDictionaries(configuration);\n\n const baseDir = configuration.content.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 = getDictionaries(configuration);\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 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 }\n }\n\n return {\n changedDictionariesLocalIds,\n excludeKeys,\n hasRebuilt: filesToRemove.length > 0 || excludeKeys.length > 0,\n };\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"cleanRemovedContentDeclaration.cjs","names":["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 { getDictionaries } from '@intlayer/dictionaries-entry';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { getUnmergedDictionaries } from '@intlayer/unmerged-dictionaries-entry';\nimport fg from 'fast-glob';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint';\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 = getUnmergedDictionaries(configuration);\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 = getDictionaries(configuration);\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 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 }\n }\n\n return {\n changedDictionariesLocalIds,\n excludeKeys,\n hasRebuilt: filesToRemove.length > 0 || excludeKeys.length > 0,\n };\n};\n"],"mappings":"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"}
|
package/dist/cjs/cli.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./listProjects.cjs`),t=require(`./listDictionariesPath.cjs`),n=require(`./writeContentDeclaration/detectExportedComponentName.cjs`),r=require(`./writeContentDeclaration/transformJSFile.cjs`),i=require(`./detectFormatCommand.cjs`),a=require(`./getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs`),o=require(`./writeContentDeclaration/writeJSFile.cjs`),s=require(`./writeContentDeclaration/writeContentDeclaration.cjs`),c=require(`./init/index.cjs`),l=require(`./installSkills/index.cjs`),u=require(`./installMCP/installMCP.cjs`),d=require(`./listGitFiles.cjs`),f=require(`./logConfigDetails.cjs`);exports.PLATFORMS=l.PLATFORMS,exports.PLATFORMS_METADATA=l.PLATFORMS_METADATA,exports.SKILLS=l.SKILLS,exports.SKILLS_METADATA=l.SKILLS_METADATA,exports.detectExportedComponentName=n.detectExportedComponentName,exports.detectFormatCommand=i.detectFormatCommand,exports.getContentDeclarationFileTemplate=a.getContentDeclarationFileTemplate,exports.getInitialSkills=l.getInitialSkills,exports.initIntlayer=c.initIntlayer,exports.installMCP=u.installMCP,exports.installSkills=l.installSkills,exports.listDictionaries=t.listDictionaries,exports.listDictionariesWithStats=t.listDictionariesWithStats,exports.listGitFiles=d.listGitFiles,exports.listGitLines=d.listGitLines,exports.listProjects=e.listProjects,exports.logConfigDetails=f.logConfigDetails,exports.transformJSFile=r.transformJSFile,exports.writeContentDeclaration=s.writeContentDeclaration,exports.writeJSFile=o.writeJSFile;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`./generateDictionaryListContent.cjs`),r=require(`./getBuiltDictionariesPath.cjs`),i=require(`./getBuiltDynamicDictionariesPath.cjs`),a=require(`./getBuiltFetchDictionariesPath.cjs`),o=require(`./getBuiltRemoteDictionariesPath.cjs`),s=require(`./getBuiltUnmergedDictionariesPath.cjs`);let c=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/parallelize.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`./generateDictionaryListContent.cjs`),r=require(`./getBuiltDictionariesPath.cjs`),i=require(`./getBuiltDynamicDictionariesPath.cjs`),a=require(`./getBuiltFetchDictionariesPath.cjs`),o=require(`./getBuiltRemoteDictionariesPath.cjs`),s=require(`./getBuiltUnmergedDictionariesPath.cjs`);let c=require(`node:fs/promises`),l=require(`node:path`),u=require(`@intlayer/config/node`);const d=async(e,r,i,a,o,s=(0,u.getConfiguration)())=>{let c=n.generateDictionaryListContent(await e,a,i,o,s),d=o===`cjs`?`cjs`:`mjs`,{mainDir:f}=s.system;await t.writeFileIfChanged((0,l.resolve)(f,`${r}.${d}`),c)},f=async(t=(0,u.getConfiguration)(),n={})=>{let{formats:l,excludeKeys:f=[]}=n,p=l??t.build.outputFormat,{mainDir:m}=t.system;await(0,c.mkdir)(m,{recursive:!0}),await e.parallelize([...p.map(e=>({paths:r.getBuiltDictionariesPath(t,f),importType:`json`,functionName:`getDictionaries`,fileName:`dictionaries`,format:e})),...p.map(e=>({paths:s.getBuiltUnmergedDictionariesPath(t,f),importType:`json`,functionName:`getUnmergedDictionaries`,fileName:`unmerged_dictionaries`,format:e})),...p.map(e=>({paths:i.getBuiltDynamicDictionariesPath(t,e,f),importType:`javascript`,functionName:`getDynamicDictionaries`,fileName:`dynamic_dictionaries`,format:e})),...p.map(e=>({paths:a.getBuiltFetchDictionariesPath(t,e,f),importType:`javascript`,functionName:`getFetchDictionaries`,fileName:`fetch_dictionaries`,format:e})),...p.map(e=>({paths:o.getBuiltRemoteDictionariesPath(t,f),importType:`json`,functionName:`getRemoteDictionaries`,fileName:`remote_dictionaries`,format:e}))],async({paths:e,fileName:n,format:r,functionName:i,importType:a})=>d(e,n,a,i,r,t))};exports.createDictionaryEntryPoint=f;
|
|
2
2
|
//# sourceMappingURL=createDictionaryEntryPoint.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/getPathHash.cjs`);let t=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../_virtual/_rolldown/runtime.cjs`);const e=require(`../utils/getPathHash.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/node`),r=require(`@intlayer/config/utils`);const i=(i,a,o,s=`esm`,c=(0,n.getConfiguration)())=>{let{mainDir:l}=c.system,u=``,d=i.map(n=>({relativePath:(0,r.normalizePath)((0,t.relative)(l,n)),id:(0,t.basename)(n,(0,t.extname)(n)),hash:`_${e.getPathHash(n)}`}));d.forEach(e=>{s===`esm`&&(u+=`import ${e.hash} from '${e.relativePath}'${o===`json`?` with { type: 'json' }`:``};\n`),s===`cjs`&&(u+=`const ${e.hash} = require('${e.relativePath}');\n`)}),u+=`
|
|
2
2
|
`;let f=d.map(e=>` "${e.id}": ${e.hash}`).join(`,
|
|
3
3
|
`);return u+=`const dictionaries = {\n${f}\n};\n`,u+=`const ${a} = () => dictionaries;\n`,s===`esm`&&(u+=`
|
|
4
4
|
`,u+=`export { ${a} };\n`,u+=`export default dictionaries;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.__toESM(n);let r=require(`node:fs`),i=require(`@intlayer/config/utils`);const a=async(e,a=[])=>{let{dictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),(await(0,n.default)(`${(0,i.normalizePath)(o)}/**/*.json`)).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltDictionariesPath=a;
|
|
2
2
|
//# sourceMappingURL=getBuiltDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { dictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/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 mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"sPASA,MAAa,EAA2B,MACtC,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,kBAAiB,WAAY,EAAc,OAWnD,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAgB,CAAC,YACnC,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.__toESM(n);let r=require(`node:fs`),i=require(`@intlayer/config/utils`);const a=async(e,a=`esm`,o=[])=>{let{dynamicDictionariesDir:s,mainDir:c}=e.system;(0,r.existsSync)(c)||(0,r.mkdirSync)(c,{recursive:!0});let l=a===`cjs`?`cjs`:`mjs`;return(await(0,n.default)(`${(0,i.normalizePath)(s)}/**/*.${l}`)).filter(e=>{let n=(0,t.basename)(e,`.${l}`);return!o.includes(n)})};exports.getBuiltDynamicDictionariesPath=a;
|
|
2
2
|
//# sourceMappingURL=getBuiltDynamicDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltDynamicDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltDynamicDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { dynamicDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltDynamicDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/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 mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(dynamicDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"sPASA,MAAa,EAAkC,MAC7C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,yBAAwB,WAAY,EAAc,QAGtD,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAuB,CAAC,QAAQ,IAClD,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.__toESM(n);let r=require(`node:fs`),i=require(`@intlayer/config/utils`);const a=async(e,a=`esm`,o=[])=>{let{fetchDictionariesDir:s,mainDir:c}=e.system;(0,r.existsSync)(c)||(0,r.mkdirSync)(c,{recursive:!0});let l=a===`cjs`?`cjs`:`mjs`;return(await(0,n.default)(`${(0,i.normalizePath)(s)}/**/*.${l}`)).filter(e=>{let n=(0,t.basename)(e,`.${l}`);return!o.includes(n)})};exports.getBuiltFetchDictionariesPath=a;
|
|
2
2
|
//# sourceMappingURL=getBuiltFetchDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltFetchDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltFetchDictionariesPath = async (\n configuration: IntlayerConfig,\n format: 'cjs' | 'esm' = 'esm',\n excludeKeys: string[] = []\n) => {\n const { fetchDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltFetchDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/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 mkdirSync(mainDir, { recursive: true });\n }\n\n const extension = format === 'cjs' ? 'cjs' : 'mjs';\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(fetchDictionariesDir)}/**/*.${extension}`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, `.${extension}`);\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"sPASA,MAAa,EAAgC,MAC3C,EACA,EAAwB,MACxB,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,uBAAsB,WAAY,EAAc,QAGpD,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGzC,IAAM,EAAY,IAAW,MAAQ,MAAQ,MAM7C,OAJmC,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAqB,CAAC,QAAQ,IAChD,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,IAAI,IAAY,CAC3C,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.__toESM(n);let r=require(`node:fs`),i=require(`@intlayer/config/utils`);const a=async(e,a=[])=>{let{remoteDictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),n.default.sync(`${(0,i.normalizePath)(o)}/**/*.json`).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltRemoteDictionariesPath=a;
|
|
2
2
|
//# sourceMappingURL=getBuiltRemoteDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltRemoteDictionariesPath.cjs","names":["fg"],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltRemoteDictionariesPath.cjs","names":["fg"],"sources":["../../../src/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltRemoteDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { remoteDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = fg.sync(\n `${normalizePath(remoteDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"sPASA,MAAa,EAAiC,MAC5C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,wBAAuB,WAAY,EAAc,OAWzD,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,CAGNA,EAAAA,QAAG,KACpC,IAAA,EAAA,EAAA,eAAiB,EAAsB,CAAC,YACzC,CAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.__toESM(n);let r=require(`node:fs`),i=require(`@intlayer/config/utils`);const a=async(e,a=[])=>{let{unmergedDictionariesDir:o,mainDir:s}=e.system;return(0,r.existsSync)(s)||(0,r.mkdirSync)(s,{recursive:!0}),(await(0,n.default)(`${(0,i.normalizePath)(o)}/**/*.json`)).filter(e=>{let n=(0,t.basename)(e,`.json`);return!a.includes(n)})};exports.getBuiltUnmergedDictionariesPath=a;
|
|
2
2
|
//# sourceMappingURL=getBuiltUnmergedDictionariesPath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBuiltUnmergedDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBuiltUnmergedDictionariesPath.cjs","names":[],"sources":["../../../src/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.ts"],"sourcesContent":["import { existsSync, mkdirSync } from 'node:fs';\nimport { basename } from 'node:path';\nimport { normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * This function generates a list of dictionaries in the main directory\n */\nexport const getBuiltUnmergedDictionariesPath = async (\n configuration: IntlayerConfig,\n excludeKeys: string[] = []\n) => {\n const { unmergedDictionariesDir, mainDir } = configuration.system;\n\n // Create main directory if it doesn't exist\n if (!existsSync(mainDir)) {\n mkdirSync(mainDir, { recursive: true });\n }\n\n const dictionariesPath: string[] = await fg(\n `${normalizePath(unmergedDictionariesDir)}/**/*.json`\n );\n\n return dictionariesPath.filter((path) => {\n const key = basename(path, '.json');\n return !excludeKeys.includes(key);\n });\n};\n"],"mappings":"sPASA,MAAa,EAAmC,MAC9C,EACA,EAAwB,EAAE,GACvB,CACH,GAAM,CAAE,0BAAyB,WAAY,EAAc,OAW3D,OARI,EAAA,EAAA,YAAY,EAAQ,GACtB,EAAA,EAAA,WAAU,EAAS,CAAE,UAAW,GAAM,CAAC,EAGN,MAAA,EAAA,EAAA,SACjC,IAAA,EAAA,EAAA,eAAiB,EAAwB,CAAC,YAC3C,EAEuB,OAAQ,GAAS,CACvC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAM,QAAQ,CACnC,MAAO,CAAC,EAAY,SAAS,EAAI,EACjC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`../utils/getPathHash.cjs`);let r=require(`node:fs/promises`),i=require(`node:path`),a=require(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../_virtual/_rolldown/runtime.cjs`),t=require(`../writeFileIfChanged.cjs`),n=require(`../utils/getPathHash.cjs`);let r=require(`node:fs/promises`),i=require(`node:path`),a=require(`fast-glob`);a=e.__toESM(a);let o=require(`@intlayer/config/utils`),s=require(`zod-to-ts`);const c=e=>`${(0,o.kebabCaseToCamelCase)(e)}Content`,l=e=>e.map(e=>` "${e}": 1;`).join(`
|
|
2
2
|
`),u=e=>{if(!e)return`any`;let t=e._def??e.def??e;switch(t.typeName??t.type){case`ZodString`:case`string`:return`string`;case`ZodNumber`:case`number`:return`number`;case`ZodBoolean`:case`boolean`:return`boolean`;case`ZodNull`:case`null`:return`null`;case`ZodUndefined`:case`undefined`:return`undefined`;case`ZodArray`:case`array`:return`${u(t.type??t.element)}[]`;case`ZodObject`:case`object`:{let e=typeof t.shape==`function`?t.shape():t.shape;return e?`{\n${Object.entries(e).map(([e,t])=>` "${e}": ${u(t)};`).join(`
|
|
3
3
|
`)}\n }`:`Record<string, any>`}case`ZodOptional`:case`optional`:return`${u(t.innerType??t.wrapped)} | undefined`;case`ZodNullable`:case`nullable`:return`${u(t.innerType??t.wrapped)} | null`;case`ZodUnion`:case`union`:return(t.options??[]).map(u).join(` | `);case`ZodIntersection`:case`intersection`:return`${u(t.left)} & ${u(t.right)}`;case`ZodEnum`:case`enum`:return(t.values??[]).map(e=>`"${e}"`).join(` | `);case`ZodLiteral`:case`literal`:{let e=t.value;return typeof e==`string`?`"${e}"`:String(e)}default:return`any`}},d=(e,t)=>{let{internationalization:r,system:a}=t,{moduleAugmentationDir:o}=a,{locales:c,requiredLocales:d,strictMode:f}=r,p=`import "intlayer";
|
|
4
4
|
`,m=e.map(e=>({relativePath:`./${(0,i.relative)(o,e)}`,id:(0,i.basename)(e,(0,i.extname)(e)),hash:`_${n.getPathHash(e)}`}));for(let e of m)p+=`import ${e.hash} from '${e.relativePath}';\n`;p+=`
|
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=requi
|
|
|
6
6
|
`),g=c,_=d?.length?d.filter(e=>g.includes(e)):g,v=l(g),y=l(_),b=t.schemas??{},x=Object.entries(b).map(([e,t])=>{let n=`any`;if(t)try{let{node:e}=(0,s.zodToTs)(t,{auxiliaryTypeStore:(0,s.createAuxiliaryTypeStore)()});n=e.kind===133?u(t):(0,s.printNode)(e)}catch{n=u(t)}return` "${e}": ${n};`}).join(`
|
|
7
7
|
`),S=f===`strict`?`strict`:f===`inclusive`?`inclusive`:`loose`;return p+=`declare module 'intlayer' {
|
|
8
8
|
`,p+=` interface __DictionaryRegistry {\n${h}\n }\n\n`,p+=` interface __DeclaredLocalesRegistry {\n${v}\n }\n\n`,p+=` interface __RequiredLocalesRegistry {\n${y}\n }\n\n`,p+=` interface __SchemaRegistry {\n${x}\n }\n\n`,p+=` interface __StrictModeRegistry { mode: '${S}' }\n`,p+=`}
|
|
9
|
-
`,p},f=async e=>{let{moduleAugmentationDir:n,typesDir:s}=e.system;await(0,r.mkdir)(n,{recursive:!0});let c=d(await(0,
|
|
9
|
+
`,p},f=async e=>{let{moduleAugmentationDir:n,typesDir:s}=e.system;await(0,r.mkdir)(n,{recursive:!0});let c=d(await(0,a.default)((0,o.normalizePath)(`${s}/*.ts`),{ignore:[`**/*.d.ts`]}),e);await t.writeFileIfChanged((0,i.join)(n,`intlayer.d.ts`),c)};exports.createModuleAugmentation=f,exports.getTypeName=c;
|
|
10
10
|
//# sourceMappingURL=createModuleAugmentation.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createModuleAugmentation.cjs","names":["getPathHash","writeFileIfChanged"],"sources":["../../../src/createType/createModuleAugmentation.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { basename, extname, join, relative } from 'node:path';\nimport { kebabCaseToCamelCase, normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig
|
|
1
|
+
{"version":3,"file":"createModuleAugmentation.cjs","names":["getPathHash","writeFileIfChanged"],"sources":["../../../src/createType/createModuleAugmentation.ts"],"sourcesContent":["import { mkdir } from 'node:fs/promises';\nimport { basename, extname, join, relative } from 'node:path';\nimport { kebabCaseToCamelCase, normalizePath } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport fg from 'fast-glob';\nimport { createAuxiliaryTypeStore, printNode, zodToTs } from 'zod-to-ts';\nimport { getPathHash } from '../utils';\nimport { writeFileIfChanged } from '../writeFileIfChanged';\n\nexport const getTypeName = (key: string): string =>\n `${kebabCaseToCamelCase(key)}Content`;\n\n/** Returns lines like: [Locales.FRENCH]: 1; */\nconst formatLocales = (locales: Locale[]) =>\n locales.map((locale) => ` \"${locale}\": 1;`).join('\\n');\n\nconst zodToTsString = (schema: any): string => {\n if (!schema) return 'any';\n\n // Support both real Zod objects (_def) and serialized versions (def or nested)\n const def = schema._def ?? schema.def ?? schema;\n\n // Handle serialized type names (sometimes 'type' instead of 'typeName')\n const typeName = def.typeName ?? def.type;\n\n switch (typeName) {\n case 'ZodString':\n case 'string':\n return 'string';\n case 'ZodNumber':\n case 'number':\n return 'number';\n case 'ZodBoolean':\n case 'boolean':\n return 'boolean';\n case 'ZodNull':\n case 'null':\n return 'null';\n case 'ZodUndefined':\n case 'undefined':\n return 'undefined';\n case 'ZodArray':\n case 'array':\n return `${zodToTsString(def.type ?? def.element)}[]`;\n case 'ZodObject':\n case 'object': {\n const shape = typeof def.shape === 'function' ? def.shape() : def.shape;\n if (!shape) return 'Record<string, any>';\n\n const entries = Object.entries(shape)\n .map(([k, v]) => ` \"${k}\": ${zodToTsString(v)};`)\n .join('\\n');\n return `{\\n${entries}\\n }`;\n }\n case 'ZodOptional':\n case 'optional':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | undefined`;\n case 'ZodNullable':\n case 'nullable':\n return `${zodToTsString(def.innerType ?? def.wrapped)} | null`;\n case 'ZodUnion':\n case 'union': {\n const options = def.options ?? [];\n return options.map(zodToTsString).join(' | ');\n }\n case 'ZodIntersection':\n case 'intersection':\n return `${zodToTsString(def.left)} & ${zodToTsString(def.right)}`;\n case 'ZodEnum':\n case 'enum': {\n const values = def.values ?? [];\n return values.map((v: string) => `\"${v}\"`).join(' | ');\n }\n case 'ZodLiteral':\n case 'literal': {\n const value = def.value;\n return typeof value === 'string' ? `\"${value}\"` : String(value);\n }\n default:\n return 'any';\n }\n};\n\n/** Generate the content of the module augmentation file */\nconst generateTypeIndexContent = (\n typeFiles: string[],\n configuration: IntlayerConfig\n): string => {\n const { internationalization, system } = configuration;\n const { moduleAugmentationDir } = system;\n const { locales, requiredLocales, strictMode } = internationalization;\n\n let fileContent = 'import \"intlayer\";\\n';\n\n // Build dictionary refs\n const dictionariesRef = typeFiles.map((dictionaryPath) => ({\n relativePath: `./${relative(moduleAugmentationDir, dictionaryPath)}`,\n id: basename(dictionaryPath, extname(dictionaryPath)),\n hash: `_${getPathHash(dictionaryPath)}`,\n }));\n\n // Import all dictionaries\n for (const dictionary of dictionariesRef) {\n fileContent += `import ${dictionary.hash} from '${dictionary.relativePath}';\\n`;\n }\n fileContent += '\\n';\n\n // Dictionary map entries (id: typeof <hash>)\n const formattedDictionaryMap: string = dictionariesRef\n .map((dictionary) => ` \"${dictionary.id}\": typeof ${dictionary.hash};`)\n .join('\\n');\n\n // Ensure required ⊆ declared; if empty, default required = declared\n const declared = locales;\n const requiredSanitized = requiredLocales?.length\n ? requiredLocales.filter((requiredLocales) =>\n declared.includes(requiredLocales)\n )\n : declared;\n\n const formattedDeclaredLocales = formatLocales(declared);\n const formattedRequiredLocales = formatLocales(requiredSanitized);\n\n // Build schema registry\n const schemas = configuration.schemas ?? {};\n const formattedSchemas = Object.entries(schemas)\n .map(([key, schema]) => {\n let typeStr = 'any';\n\n if (schema) {\n try {\n const { node } = zodToTs(schema, {\n auxiliaryTypeStore: createAuxiliaryTypeStore(),\n });\n // 133 is the kind for AnyKeyword in TypeScript\n if ((node as any).kind !== 133) {\n typeStr = printNode(node);\n } else {\n // Fallback to custom string generator if zodToTs returns any\n typeStr = zodToTsString(schema);\n }\n } catch (_e) {\n // Fallback to custom string generator\n typeStr = zodToTsString(schema);\n }\n }\n return ` \"${key}\": ${typeStr};`;\n })\n .join('\\n');\n\n // Choose strict mode registry key\n const strictKey =\n strictMode === 'strict'\n ? 'strict'\n : strictMode === 'inclusive'\n ? 'inclusive'\n : 'loose';\n\n /**\n * Module augmentation that ONLY adds keys to registries.\n * No types/aliases redefined here—avoids merge conflicts.\n */\n fileContent += `declare module 'intlayer' {\\n`;\n // Dictionaries registry\n fileContent += ` interface __DictionaryRegistry {\\n${formattedDictionaryMap}\\n }\\n\\n`;\n // Locales registries\n fileContent += ` interface __DeclaredLocalesRegistry {\\n${formattedDeclaredLocales}\\n }\\n\\n`;\n fileContent += ` interface __RequiredLocalesRegistry {\\n${formattedRequiredLocales}\\n }\\n\\n`;\n // Schema registry\n fileContent += ` interface __SchemaRegistry {\\n${formattedSchemas}\\n }\\n\\n`;\n // Resolved strict mode (narrow the literal at build time)\n fileContent += ` interface __StrictModeRegistry { mode: '${strictKey}' }\\n`;\n fileContent += `}\\n`;\n\n return fileContent;\n};\n\n/** Generate the index file merging all the types */\nexport const createModuleAugmentation = async (\n configuration: IntlayerConfig\n) => {\n const { moduleAugmentationDir, typesDir } = configuration.system;\n\n await mkdir(moduleAugmentationDir, { recursive: true });\n\n const dictionariesTypesDefinitions: string[] = await fg(\n normalizePath(`${typesDir}/*.ts`),\n { ignore: ['**/*.d.ts'] }\n );\n\n const tsContent = generateTypeIndexContent(\n dictionariesTypesDefinitions,\n configuration\n );\n\n const tsFilePath = join(moduleAugmentationDir, 'intlayer.d.ts');\n await writeFileIfChanged(tsFilePath, tsContent);\n};\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createType.cjs","names":["parallelize"],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary
|
|
1
|
+
{"version":3,"file":"createType.cjs","names":["parallelize"],"sources":["../../../src/createType/createType.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { parallelize } from '../utils/parallelize';\n\nexport const generateTypeScriptType = (dictionary: Dictionary) => {\n const jsonString = JSON.stringify(dictionary, null, 2);\n\n return `/* eslint-disable */\\nexport default ${jsonString} as const;\\n`;\n};\n/**\n * This function generates a TypeScript type definition from a JSON object\n */\nexport const createTypes = async (\n dictionaries: Dictionary[],\n configuration: IntlayerConfig\n): Promise<string[]> => {\n const { system } = configuration;\n const { typesDir } = system;\n\n // Create type folders if they don't exist\n await mkdir(typesDir, { recursive: true });\n\n const results = await parallelize(\n dictionaries,\n async (dictionary): Promise<string | undefined> => {\n if (!dictionary.key) {\n return undefined;\n }\n\n const typeDefinition: string = generateTypeScriptType(dictionary);\n\n const outputPath: string = resolve(typesDir, `${dictionary.key}.ts`);\n\n await writeFile(outputPath, typeDefinition);\n\n return outputPath;\n }\n );\n\n return results.filter(Boolean) as string[];\n};\n"],"mappings":"qNAMA,MAAa,EAA0B,GAG9B,wCAFY,KAAK,UAAU,EAAY,KAAM,EAAE,CAEI,cAK/C,EAAc,MACzB,EACA,IACsB,CACtB,GAAM,CAAE,UAAW,EACb,CAAE,YAAa,EAsBrB,OAnBA,MAAA,EAAA,EAAA,OAAY,EAAU,CAAE,UAAW,GAAM,CAAC,EAE1B,MAAMA,EAAAA,YACpB,EACA,KAAO,IAA4C,CACjD,GAAI,CAAC,EAAW,IACd,OAGF,IAAM,EAAyB,EAAuB,EAAW,CAE3D,GAAA,EAAA,EAAA,SAA6B,EAAU,GAAG,EAAW,IAAI,KAAK,CAIpE,OAFA,MAAA,EAAA,EAAA,WAAgB,EAAY,EAAe,CAEpC,GAEV,EAEc,OAAO,QAAQ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/config/utils`),t=null;const n=(n,r)=>{let{
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./_virtual/_rolldown/runtime.cjs`);let e=require(`@intlayer/config/utils`),t=null;const n=(n,r)=>{let{baseDir:i}=n.system,{formatCommand:a}=n.content,o=r??(0,e.getProjectRequire)(i);if(a)return a;if(t!==null)return t;try{return o.resolve(`prettier`),t=`prettier --write "{{file}}" --log-level silent`,t}catch{}try{return o.resolve(`biome`),t=`biome format "{{file}}" --write --log-level none`,t}catch{}try{return o.resolve(`eslint`),t=`eslint --fix "{{file}}" --quiet || node -e "process.exit(0)"`,t}catch{}t=void 0};exports.detectFormatCommand=n;
|
|
2
2
|
//# sourceMappingURL=detectFormatCommand.cjs.map
|