@intlayer/chokidar 8.4.0 → 8.4.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/_utils_asset-SJVy1xMD.cjs +2 -0
- 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 +1 -1
- package/dist/cjs/buildIntlayerDictionary/processContentDeclaration.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeDynamicDictionary.cjs.map +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeFetchDictionary.cjs.map +1 -1
- 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 +1 -1
- package/dist/cjs/buildIntlayerDictionary/writeUnmergedDictionary.cjs.map +1 -1
- package/dist/cjs/{_virtual/_rolldown/runtime.cjs → chunk-Bmb41Sf3.cjs} +1 -1
- package/dist/cjs/cleanOutputDir.cjs +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/createDictionaryEntryPoint.cjs.map +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs +1 -1
- package/dist/cjs/createDictionaryEntryPoint/generateDictionaryListContent.cjs.map +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 +1 -1
- package/dist/cjs/createType/createModuleAugmentation.cjs.map +1 -1
- package/dist/cjs/createType/createType.cjs +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/fetchDistantDictionaries.cjs.map +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs +1 -1
- package/dist/cjs/filterInvalidDictionaries.cjs.map +1 -1
- package/dist/cjs/formatDictionary.cjs +1 -1
- package/dist/cjs/formatDictionary.cjs.map +1 -1
- package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +1 -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/init/index.cjs.map +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs +1 -1
- package/dist/cjs/init/utils/configManipulation.cjs.map +1 -1
- package/dist/cjs/init/utils/fileSystem.cjs +1 -1
- package/dist/cjs/init/utils/fileSystem.cjs.map +1 -1
- package/dist/cjs/init/utils/tsConfig.cjs +1 -1
- package/dist/cjs/init/utils/tsConfig.cjs.map +1 -1
- package/dist/cjs/initConfig/index.cjs +1 -1
- package/dist/cjs/initConfig/index.cjs.map +1 -1
- package/dist/cjs/installMCP/installMCP.cjs +1 -1
- package/dist/cjs/installMCP/installMCP.cjs.map +1 -1
- package/dist/cjs/installSkills/index.cjs +1 -1
- package/dist/cjs/installSkills/index.cjs.map +1 -1
- package/dist/cjs/listDictionariesPath.cjs +1 -1
- package/dist/cjs/listDictionariesPath.cjs.map +1 -1
- package/dist/cjs/listGitFiles.cjs +1 -1
- package/dist/cjs/listGitFiles.cjs.map +1 -1
- package/dist/cjs/listProjects.cjs +1 -1
- package/dist/cjs/listProjects.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs +1 -1
- package/dist/cjs/loadDictionaries/getIntlayerBundle.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/loadContentDeclaration.cjs +1 -1
- 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 +1 -1
- package/dist/cjs/loadDictionaries/loadRemoteDictionaries.cjs.map +1 -1
- package/dist/cjs/loadDictionaries/log.cjs +1 -1
- package/dist/cjs/loadDictionaries/log.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 +1 -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/reduceDictionaryContent.cjs +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/buildComponentFilesList.cjs +1 -1
- package/dist/cjs/utils/buildComponentFilesList.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/getPathHash.cjs +1 -1
- package/dist/cjs/utils/getPathHash.cjs.map +1 -1
- package/dist/cjs/utils/resolveRelativePath.cjs +1 -1
- package/dist/cjs/utils/resolveRelativePath.cjs.map +1 -1
- package/dist/cjs/utils/runOnce.cjs +1 -1
- package/dist/cjs/utils/runOnce.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/bin.cjs +1 -1
- package/dist/cjs/utils/runParallel/bin.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/index.cjs +1 -1
- package/dist/cjs/utils/runParallel/index.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/pidTree.cjs +1 -1
- package/dist/cjs/utils/runParallel/pidTree.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/ps.cjs +1 -1
- package/dist/cjs/utils/runParallel/ps.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/runTask.cjs +1 -1
- package/dist/cjs/utils/runParallel/runTask.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnPosix.cjs +1 -1
- package/dist/cjs/utils/runParallel/spawnPosix.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/spawnWin32.cjs +1 -1
- package/dist/cjs/utils/runParallel/spawnWin32.cjs.map +1 -1
- package/dist/cjs/utils/runParallel/wmic.cjs +1 -1
- package/dist/cjs/utils/runParallel/wmic.cjs.map +1 -1
- package/dist/cjs/watcher.cjs +1 -1
- package/dist/cjs/watcher.cjs.map +1 -1
- package/dist/cjs/writeConfiguration/index.cjs +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 +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/cjs/writeContentDeclaration/transformJSONFile.cjs +1 -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/cjs/writeFileIfChanged.cjs +1 -1
- package/dist/cjs/writeFileIfChanged.cjs.map +1 -1
- package/dist/esm/{_virtual/_utils_asset.mjs → _utils_asset-4w8dPH9r.mjs} +1 -1
- package/dist/esm/build.mjs +1 -1
- package/dist/esm/{_virtual/_rolldown/runtime.mjs → chunk-DDgYwkfe.mjs} +1 -1
- package/dist/esm/cli.mjs +1 -1
- package/dist/esm/init/index.mjs +1 -1
- package/dist/esm/init/index.mjs.map +1 -1
- package/dist/esm/init/utils/configManipulation.mjs +1 -1
- package/dist/esm/init/utils/configManipulation.mjs.map +1 -1
- package/dist/esm/initConfig/index.mjs +1 -1
- package/dist/esm/initConfig/index.mjs.map +1 -1
- package/dist/esm/installMCP/installMCP.mjs +1 -1
- package/dist/esm/installMCP/installMCP.mjs.map +1 -1
- package/dist/esm/installSkills/index.mjs +1 -1
- package/dist/esm/installSkills/index.mjs.map +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs +1 -1
- package/dist/esm/loadDictionaries/getIntlayerBundle.mjs.map +1 -1
- package/dist/esm/utils/formatter.mjs +1 -1
- package/dist/esm/utils/formatter.mjs.map +1 -1
- package/dist/esm/watcher.mjs +1 -1
- package/dist/esm/watcher.mjs.map +1 -1
- package/dist/esm/writeConfiguration/index.mjs +1 -1
- package/dist/esm/writeConfiguration/index.mjs.map +1 -1
- package/dist/esm/writeContentDeclaration/processContentDeclarationContent.mjs.map +1 -1
- package/dist/types/build.d.ts +20 -20
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +2 -24
- package/dist/types/buildIntlayerDictionary/index.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts +2 -11
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts +2 -36
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +1 -1
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts.map +1 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -30
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts +2 -34
- package/dist/types/buildIntlayerDictionary-BGj5jDFy.d.ts +24 -0
- package/dist/types/buildIntlayerDictionary-BGj5jDFy.d.ts.map +1 -0
- package/dist/types/cli.d.ts +6 -6
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -14
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts +2 -10
- package/dist/types/createDictionaryEntryPoint/index.d.ts +7 -7
- package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts +14 -0
- package/dist/types/createDictionaryEntryPoint-Bc5lHSiY.d.ts.map +1 -0
- package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts +9 -0
- package/dist/types/createModuleAugmentation-D1eIVnjg.d.ts.map +1 -0
- package/dist/types/createType/createModuleAugmentation.d.ts +2 -9
- package/dist/types/createType/createType.d.ts +2 -12
- package/dist/types/createType/index.d.ts +2 -2
- package/dist/types/createType--rDwdg2t.d.ts +12 -0
- package/dist/types/createType--rDwdg2t.d.ts.map +1 -0
- package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts +12 -0
- package/dist/types/detectExportedComponentName-DVXsp_FG.d.ts.map +1 -0
- package/dist/types/dictionaryStatus-DPVO37qe.d.ts +5 -0
- package/dist/types/dictionaryStatus-DPVO37qe.d.ts.map +1 -0
- package/dist/types/fetchDistantDictionaries.d.ts +1 -1
- package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
- package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts +10 -0
- package/dist/types/generateDictionaryListContent-DAtHG6SR.d.ts.map +1 -0
- package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts +10 -0
- package/dist/types/getBuiltDictionariesPath-C4it65a1.d.ts.map +1 -0
- package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts +10 -0
- package/dist/types/getBuiltDynamicDictionariesPath-Cj9EWnjT.d.ts.map +1 -0
- package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts +10 -0
- package/dist/types/getBuiltFetchDictionariesPath-1JleRhT3.d.ts.map +1 -0
- package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts +10 -0
- package/dist/types/getBuiltRemoteDictionariesPath-DHOmqNCr.d.ts.map +1 -0
- package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts +10 -0
- package/dist/types/getBuiltUnmergedDictionariesPath-GUmmLxTB.d.ts.map +1 -0
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +2 -7
- package/dist/types/getContentDeclarationFileTemplate/index.d.ts +1 -1
- package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts +7 -0
- package/dist/types/getContentDeclarationFileTemplate-Dz3rnFy9.d.ts.map +1 -0
- package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts +8 -0
- package/dist/types/getFormatFromExtension-SdXYWfPx.d.ts.map +1 -0
- package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts +12 -0
- package/dist/types/loadContentDeclaration-CBMS4vkA.d.ts.map +1 -0
- package/dist/types/loadDictionaries/index.d.ts +4 -4
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts +2 -12
- package/dist/types/loadDictionaries/loadDictionaries.d.ts +2 -23
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts +2 -8
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +2 -15
- package/dist/types/loadDictionaries/log.d.ts +1 -1
- package/dist/types/loadDictionaries-BIqHwtYE.d.ts +23 -0
- package/dist/types/loadDictionaries-BIqHwtYE.d.ts.map +1 -0
- package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts +8 -0
- package/dist/types/loadLocalDictionaries-CNmVaw0c.d.ts.map +1 -0
- package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts +15 -0
- package/dist/types/loadRemoteDictionaries-MoITTb7W.d.ts.map +1 -0
- package/dist/types/processContentDeclaration-CAvrHaIT.d.ts +11 -0
- package/dist/types/processContentDeclaration-CAvrHaIT.d.ts.map +1 -0
- package/dist/types/transformJSFile-Cg0LkeLb.d.ts +11 -0
- package/dist/types/transformJSFile-Cg0LkeLb.d.ts.map +1 -0
- package/dist/types/utils/getFormatFromExtension.d.ts +2 -8
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/writeConfiguration/index.d.ts.map +1 -1
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts +2 -12
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts +2 -5
- package/dist/types/writeContentDeclaration/index.d.ts +5 -5
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts +2 -11
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts +2 -19
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts +2 -14
- package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts +19 -0
- package/dist/types/writeContentDeclaration-XdGxj0KP.d.ts.map +1 -0
- package/dist/types/writeDynamicDictionary-DE3SJg-g.d.ts +36 -0
- package/dist/types/writeDynamicDictionary-DE3SJg-g.d.ts.map +1 -0
- package/dist/types/writeJSFile-kK95jzg_.d.ts +14 -0
- package/dist/types/writeJSFile-kK95jzg_.d.ts.map +1 -0
- package/dist/types/writeMergedDictionary-C4EvgXbL.d.ts +30 -0
- package/dist/types/writeMergedDictionary-C4EvgXbL.d.ts.map +1 -0
- package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts +34 -0
- package/dist/types/writeUnmergedDictionary-Cxx51isz.d.ts.map +1 -0
- package/package.json +8 -8
- package/dist/cjs/_virtual/_utils_asset.cjs +0 -2
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts.map +0 -1
- package/dist/types/buildIntlayerDictionary/processContentDeclaration.d.ts.map +0 -1
- package/dist/types/buildIntlayerDictionary/writeDynamicDictionary.d.ts.map +0 -1
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts.map +0 -1
- package/dist/types/buildIntlayerDictionary/writeUnmergedDictionary.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDictionariesPath.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltDynamicDictionariesPath.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltFetchDictionariesPath.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltRemoteDictionariesPath.d.ts.map +0 -1
- package/dist/types/createDictionaryEntryPoint/getBuiltUnmergedDictionariesPath.d.ts.map +0 -1
- package/dist/types/createType/createModuleAugmentation.d.ts.map +0 -1
- package/dist/types/createType/createType.d.ts.map +0 -1
- package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +0 -1
- package/dist/types/loadDictionaries/loadContentDeclaration.d.ts.map +0 -1
- package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +0 -1
- package/dist/types/loadDictionaries/loadLocalDictionaries.d.ts.map +0 -1
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts.map +0 -1
- package/dist/types/utils/getFormatFromExtension.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/detectExportedComponentName.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/dictionaryStatus.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/transformJSFile.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +0 -1
- package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadRemoteDictionaries.cjs","names":["sortAlphabetically","fetchDistantDictionaries"],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getRemoteDictionaries } from '@intlayer/remote-dictionaries-entry';\nimport type { Dictionary, DictionaryId, DictionaryKey } from '@intlayer/types/dictionary';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\nimport type { DictionariesStatus } from '../loadDictionaries/loadDictionaries';\nimport { sortAlphabetically } from '../utils/sortAlphabetically';\n\nexport const formatDistantDictionaries = (\n dictionaries: (DictionaryAPI | Dictionary)[]\n): Dictionary[] =>\n dictionaries.map((dict) => ({\n ...dict,\n localId: `${dict.key}::remote::${dict.id}`,\n location: 'remote' as const,\n }));\n\nexport const loadRemoteDictionaries = async (\n configuration = getConfiguration(),\n onStatusUpdate?: (status: DictionariesStatus[]) => void,\n options?: {\n onStartRemoteCheck?: () => void;\n onStopRemoteCheck?: () => void;\n onError?: (error: Error) => void;\n }\n): Promise<Dictionary[]> => {\n const { editor } = configuration;\n const remoteDictionariesRecord = getRemoteDictionaries(configuration);\n\n const hasRemoteDictionaries = Boolean(editor.clientId && editor.clientSecret);\n\n if (!hasRemoteDictionaries) return [];\n\n try {\n options?.onStartRemoteCheck?.();\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n const distantDictionaryUpdateTimeStamp: Record<\n DictionaryId,\n { key: DictionaryKey; updatedAt: number }\n > | null = getDictionariesKeysResult.data;\n\n if (!distantDictionaryUpdateTimeStamp) {\n throw new Error('No distant dictionaries found');\n }\n\n const dictionariesIdToFetch = Object.entries(\n distantDictionaryUpdateTimeStamp\n ).filter(([dictionaryId, data]) => {\n // If remote doesn't provide updatedAt, fetch to be safe\n if (!data.updatedAt) return true;\n\n // If no local cache exists, fetch\n const local: Dictionary | undefined = remoteDictionariesRecord[\n data.key\n ]?.find((dictionary) => dictionary.id === dictionaryId);\n if (!local) return true;\n\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // If local timestamp missing or older than remote, fetch\n if (typeof localUpdatedAt !== 'number') return true;\n\n return data.updatedAt > localUpdatedAt;\n });\n\n const flatRemoteDictionariesRecord: DictionaryAPI[] = Object.values(\n remoteDictionariesRecord\n ).flat();\n\n const cachedDictionaries: Dictionary[] =\n flatRemoteDictionariesRecord.filter((dictionary) => {\n const remoteUpdatedAt =\n distantDictionaryUpdateTimeStamp[dictionary.id!].updatedAt;\n\n const localUpdatedAtRaw = dictionary.updatedAt;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // Consider as cached/imported when local exists and is up-to-date or newer\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n });\n\n // Report cached as already imported\n if (cachedDictionaries.length > 0) {\n onStatusUpdate?.(\n cachedDictionaries.map((dictionary) => ({\n dictionaryKey: dictionary.key,\n type: 'remote',\n status: 'imported',\n }))\n );\n }\n\n const orderedDistantDictionaryKeys = dictionariesIdToFetch\n .map(([, data]) => data.key)\n .sort(sortAlphabetically);\n\n // Report pending for keys to be fetched so totals are visible immediately\n if (orderedDistantDictionaryKeys.length > 0) {\n onStatusUpdate?.(\n orderedDistantDictionaryKeys.map((key) => ({\n dictionaryKey: key,\n type: 'remote',\n status: 'pending',\n }))\n );\n }\n\n const distantDictionariesData = await fetchDistantDictionaries(\n {\n dictionaryKeys: orderedDistantDictionaryKeys,\n },\n onStatusUpdate\n );\n\n const distantDictionaries: Dictionary[] = formatDistantDictionaries(\n distantDictionariesData\n );\n\n return [...cachedDictionaries, ...distantDictionaries];\n } catch (error) {\n options?.onError?.(error as Error);\n return [];\n } finally {\n options?.onStopRemoteCheck?.();\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadRemoteDictionaries.cjs","names":["sortAlphabetically","fetchDistantDictionaries"],"sources":["../../../src/loadDictionaries/loadRemoteDictionaries.ts"],"sourcesContent":["import { getIntlayerAPIProxy } from '@intlayer/api';\n// @ts-ignore @intlayer/backend is not build yet\nimport type { DictionaryAPI } from '@intlayer/backend';\nimport { getConfiguration } from '@intlayer/config/node';\nimport { getRemoteDictionaries } from '@intlayer/remote-dictionaries-entry';\nimport type { Dictionary, DictionaryId, DictionaryKey } from '@intlayer/types/dictionary';\nimport { fetchDistantDictionaries } from '../fetchDistantDictionaries';\nimport type { DictionariesStatus } from '../loadDictionaries/loadDictionaries';\nimport { sortAlphabetically } from '../utils/sortAlphabetically';\n\nexport const formatDistantDictionaries = (\n dictionaries: (DictionaryAPI | Dictionary)[]\n): Dictionary[] =>\n dictionaries.map((dict) => ({\n ...dict,\n localId: `${dict.key}::remote::${dict.id}`,\n location: 'remote' as const,\n }));\n\nexport const loadRemoteDictionaries = async (\n configuration = getConfiguration(),\n onStatusUpdate?: (status: DictionariesStatus[]) => void,\n options?: {\n onStartRemoteCheck?: () => void;\n onStopRemoteCheck?: () => void;\n onError?: (error: Error) => void;\n }\n): Promise<Dictionary[]> => {\n const { editor } = configuration;\n const remoteDictionariesRecord = getRemoteDictionaries(configuration);\n\n const hasRemoteDictionaries = Boolean(editor.clientId && editor.clientSecret);\n\n if (!hasRemoteDictionaries) return [];\n\n try {\n options?.onStartRemoteCheck?.();\n\n const intlayerAPI = getIntlayerAPIProxy(undefined, configuration);\n\n // Get the list of dictionary keys\n const getDictionariesKeysResult =\n await intlayerAPI.dictionary.getDictionariesUpdateTimestamp();\n\n const distantDictionaryUpdateTimeStamp: Record<\n DictionaryId,\n { key: DictionaryKey; updatedAt: number }\n > | null = getDictionariesKeysResult.data;\n\n if (!distantDictionaryUpdateTimeStamp) {\n throw new Error('No distant dictionaries found');\n }\n\n const dictionariesIdToFetch = Object.entries(\n distantDictionaryUpdateTimeStamp\n ).filter(([dictionaryId, data]) => {\n // If remote doesn't provide updatedAt, fetch to be safe\n if (!data.updatedAt) return true;\n\n // If no local cache exists, fetch\n const local: Dictionary | undefined = remoteDictionariesRecord[\n data.key\n ]?.find((dictionary) => dictionary.id === dictionaryId);\n if (!local) return true;\n\n const localUpdatedAtRaw = (local as any)?.updatedAt as\n | number\n | string\n | undefined;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // If local timestamp missing or older than remote, fetch\n if (typeof localUpdatedAt !== 'number') return true;\n\n return data.updatedAt > localUpdatedAt;\n });\n\n const flatRemoteDictionariesRecord: DictionaryAPI[] = Object.values(\n remoteDictionariesRecord\n ).flat();\n\n const cachedDictionaries: Dictionary[] =\n flatRemoteDictionariesRecord.filter((dictionary) => {\n const remoteUpdatedAt =\n distantDictionaryUpdateTimeStamp[dictionary.id!].updatedAt;\n\n const localUpdatedAtRaw = dictionary.updatedAt;\n\n const localUpdatedAt =\n typeof localUpdatedAtRaw === 'number'\n ? localUpdatedAtRaw\n : localUpdatedAtRaw\n ? new Date(localUpdatedAtRaw).getTime()\n : undefined;\n\n // Consider as cached/imported when local exists and is up-to-date or newer\n return (\n typeof localUpdatedAt === 'number' &&\n typeof remoteUpdatedAt === 'number' &&\n localUpdatedAt >= remoteUpdatedAt\n );\n });\n\n // Report cached as already imported\n if (cachedDictionaries.length > 0) {\n onStatusUpdate?.(\n cachedDictionaries.map((dictionary) => ({\n dictionaryKey: dictionary.key,\n type: 'remote',\n status: 'imported',\n }))\n );\n }\n\n const orderedDistantDictionaryKeys = dictionariesIdToFetch\n .map(([, data]) => data.key)\n .sort(sortAlphabetically);\n\n // Report pending for keys to be fetched so totals are visible immediately\n if (orderedDistantDictionaryKeys.length > 0) {\n onStatusUpdate?.(\n orderedDistantDictionaryKeys.map((key) => ({\n dictionaryKey: key,\n type: 'remote',\n status: 'pending',\n }))\n );\n }\n\n const distantDictionariesData = await fetchDistantDictionaries(\n {\n dictionaryKeys: orderedDistantDictionaryKeys,\n },\n onStatusUpdate\n );\n\n const distantDictionaries: Dictionary[] = formatDistantDictionaries(\n distantDictionariesData\n );\n\n return [...cachedDictionaries, ...distantDictionaries];\n } catch (error) {\n options?.onError?.(error as Error);\n return [];\n } finally {\n options?.onStopRemoteCheck?.();\n }\n};\n"],"mappings":"uTAUA,MAAa,EACX,GAEA,EAAa,IAAK,IAAU,CAC1B,GAAG,EACH,QAAS,GAAG,EAAK,IAAI,YAAY,EAAK,KACtC,SAAU,SACX,EAAE,CAEQ,EAAyB,MACpC,GAAA,EAAA,EAAA,mBAAkC,CAClC,EACA,IAK0B,CAC1B,GAAM,CAAE,UAAW,EACb,GAAA,EAAA,EAAA,uBAAiD,EAAc,CAIrE,GAAI,EAFkC,EAAO,UAAY,EAAO,cAEpC,MAAO,EAAE,CAErC,GAAI,CACF,GAAS,sBAAsB,CAQ/B,IAAM,GAFJ,MAAA,EAAA,EAAA,qBAJsC,IAAA,GAAW,EAAc,CAI7C,WAAW,gCAAgC,EAK1B,KAErC,GAAI,CAAC,EACH,MAAU,MAAM,gCAAgC,CAGlD,IAAM,EAAwB,OAAO,QACnC,EACD,CAAC,QAAQ,CAAC,EAAc,KAAU,CAEjC,GAAI,CAAC,EAAK,UAAW,MAAO,GAG5B,IAAM,EAAgC,EACpC,EAAK,MACJ,KAAM,GAAe,EAAW,KAAO,EAAa,CACvD,GAAI,CAAC,EAAO,MAAO,GAEnB,IAAM,EAAqB,GAAe,UAKpC,EACJ,OAAO,GAAsB,SACzB,EACA,EACE,IAAI,KAAK,EAAkB,CAAC,SAAS,CACrC,IAAA,GAKR,OAFI,OAAO,GAAmB,SAEvB,EAAK,UAAY,EAFuB,IAG/C,CAMI,EAJgD,OAAO,OAC3D,EACD,CAAC,MAAM,CAGuB,OAAQ,GAAe,CAClD,IAAM,EACJ,EAAiC,EAAW,IAAK,UAE7C,EAAoB,EAAW,UAE/B,EACJ,OAAO,GAAsB,SACzB,EACA,EACE,IAAI,KAAK,EAAkB,CAAC,SAAS,CACrC,IAAA,GAGR,OACE,OAAO,GAAmB,UAC1B,OAAO,GAAoB,UAC3B,GAAkB,GAEpB,CAGA,EAAmB,OAAS,GAC9B,IACE,EAAmB,IAAK,IAAgB,CACtC,cAAe,EAAW,IAC1B,KAAM,SACN,OAAQ,WACT,EAAE,CACJ,CAGH,IAAM,EAA+B,EAClC,KAAK,EAAG,KAAU,EAAK,IAAI,CAC3B,KAAKA,EAAAA,mBAAmB,CAGvB,EAA6B,OAAS,GACxC,IACE,EAA6B,IAAK,IAAS,CACzC,cAAe,EACf,KAAM,SACN,OAAQ,UACT,EAAE,CACJ,CAUH,IAAM,EAAoC,EAPV,MAAMC,EAAAA,yBACpC,CACE,eAAgB,EACjB,CACD,EACD,CAIA,CAED,MAAO,CAAC,GAAG,EAAoB,GAAG,EAAoB,OAC/C,EAAO,CAEd,OADA,GAAS,UAAU,EAAe,CAC3B,EAAE,QACD,CACR,GAAS,qBAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`@intlayer/config/logger`),n=require(`@intlayer/config/utils`),r=require(`@intlayer/config/built`);r=e.t(r);var i=class{statuses=[];spinnerTimer=null;spinnerIndex=0;renderedLines=0;spinnerFrames=t.spinnerFrames;isFinished=!1;prefix;lastRenderedState=``;remoteCheckInProgress=!1;expectRemote=!1;remoteError;pluginTotal=0;pluginDone=0;pluginError;constructor(){this.prefix=(0,t.getPrefix)(r.default?.log?.prefix)??``}setExpectRemote(e){this.expectRemote=e}startRemoteCheck(){this.isFinished||(this.remoteCheckInProgress=!0,this.startSpinner(),this.render())}stopRemoteCheck(){this.remoteCheckInProgress=!1}update(e){if(this.isFinished)return;for(let t of e){let e=this.statuses.findIndex(e=>e.dictionaryKey===t.dictionaryKey&&e.type===t.type);e>=0?this.statuses[e]=t:this.statuses.push(t)}let{remoteTotal:t}=this.computeProgress();this.expectRemote&&!this.remoteCheckInProgress&&t===0||(this.startSpinner(),this.render())}finish(){this.isFinished=!0,this.stopSpinner(),this.render()}startSpinner(){this.spinnerTimer||this.isFinished||(this.spinnerTimer=setInterval(()=>{this.spinnerIndex=(this.spinnerIndex+1)%this.spinnerFrames.length,this.render()},100))}stopSpinner(){this.spinnerTimer&&=(clearInterval(this.spinnerTimer),null)}setRemoteError=e=>{this.remoteError=(0,n.extractErrorMessage)(e),this.stopRemoteCheck(),this.render()};setPluginTotal(e){this.isFinished||(this.pluginTotal=e,e>0&&this.startSpinner(),this.render())}setPluginDone(e){this.isFinished||(this.pluginDone=e,this.render())}setPluginError(e){this.isFinished||(this.pluginError=(0,n.extractErrorMessage)(e),this.render())}render(){let{localTotal:e,localDone:n,remoteTotal:r,remoteDone:i,pluginTotal:a,pluginDone:o}=this.computeProgress(),s=this.spinnerFrames[this.spinnerIndex],c=(0,t.colorize)(s,t.ANSIColors.BLUE),l=[],u=n===e,d=i===r,f=o===a;this.expectRemote&&this.remoteCheckInProgress&&r===0||(u?l.push(`${this.prefix} ${t.v} Local content: ${(0,t.colorize)(`${n}`,t.ANSIColors.GREEN)}${(0,t.colorize)(`/${e}`,t.ANSIColors.GREY)}`):l.push(`${this.prefix} ${c} Local content: ${(0,t.colorize)(`${n}`,t.ANSIColors.BLUE)}${(0,t.colorize)(`/${e}`,t.ANSIColors.GREY)}`)),(r>0||this.remoteCheckInProgress||this.remoteError)&&(this.remoteError?l.push(`${this.prefix} ${t.x} Remote content: ${(0,t.colorize)(this.remoteError,t.ANSIColors.RED)}`):r===0?l.push(`${this.prefix} ${c} Remote content: ${(0,t.colorize)(`Check server`,t.ANSIColors.BLUE)}`):d?l.push(`${this.prefix} ${t.v} Remote content: ${(0,t.colorize)(`${i}`,t.ANSIColors.GREEN)}${(0,t.colorize)(`/${r}`,t.ANSIColors.GREY)}`):l.push(`${this.prefix} ${c} Remote content: ${(0,t.colorize)(`${i}`,t.ANSIColors.BLUE)}${(0,t.colorize)(`/${r}`,t.ANSIColors.GREY)}`)),(a>0||this.pluginError)&&(this.pluginError?l.push(`${this.prefix} ${t.x} Plugin content: ${(0,t.colorize)(this.pluginError,t.ANSIColors.RED)}`):f?l.push(`${this.prefix} ${t.v} Plugin content: ${(0,t.colorize)(`${o}`,t.ANSIColors.GREEN)}${(0,t.colorize)(`/${a}`,t.ANSIColors.GREY)}`):l.push(`${this.prefix} ${c} Plugin content: ${(0,t.colorize)(`${o}`,t.ANSIColors.BLUE)}${(0,t.colorize)(`/${a}`,t.ANSIColors.GREY)}`));let p=l.join(`
|
|
2
2
|
`);if(p===this.lastRenderedState)return;this.lastRenderedState=p,this.renderedLines>0&&process.stdout.write(`\x1b[${this.renderedLines}F`);let m=Math.max(this.renderedLines,l.length);for(let e=0;e<m;e++){process.stdout.write(`\x1B[2K`);let t=l[e];t!==void 0&&process.stdout.write(t),process.stdout.write(`
|
|
3
3
|
`)}this.renderedLines=l.length}computeProgress(){let e=new Set(this.statuses.filter(e=>e.type===`local`).map(e=>e.dictionaryKey)),t=new Set(this.statuses.filter(e=>e.type===`local`&&(e.status===`built`||e.status===`error`)).map(e=>e.dictionaryKey)),n=new Set(this.statuses.filter(e=>e.type===`remote`).map(e=>e.dictionaryKey)),r=new Set(this.statuses.filter(e=>e.type===`remote`&&(e.status===`fetched`||e.status===`imported`||e.status===`error`)).map(e=>e.dictionaryKey));return{localTotal:e.size,localDone:t.size,remoteTotal:n.size,remoteDone:r.size,pluginTotal:this.pluginTotal,pluginDone:this.pluginDone}}};exports.DictionariesLogger=i;
|
|
4
4
|
//# sourceMappingURL=log.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.cjs","names":["spinnerFrames","configuration","ANSIColors","v","x"],"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {\n ANSIColors,\n colorize,\n getPrefix,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config/logger';\nimport { extractErrorMessage } from '@intlayer/config/utils';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n private pluginTotal = 0;\n private pluginDone = 0;\n private pluginError: string | undefined;\n\n constructor() {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n setPluginTotal(total: number) {\n if (this.isFinished) return;\n this.pluginTotal = total;\n if (total > 0) {\n this.startSpinner();\n }\n this.render();\n }\n\n setPluginDone(done: number) {\n if (this.isFinished) return;\n this.pluginDone = done;\n this.render();\n }\n\n setPluginError(error?: Error) {\n if (this.isFinished) return;\n this.pluginError = extractErrorMessage(error);\n this.render();\n }\n\n private render() {\n const {\n localTotal,\n localDone,\n remoteTotal,\n remoteDone,\n pluginTotal,\n pluginDone,\n } = this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n const isPluginDone = pluginDone === pluginTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Plugin line: show error or progress counts\n if (pluginTotal > 0 || this.pluginError) {\n if (this.pluginError) {\n lines.push(\n `${this.prefix} ${x} Plugin content: ${colorize(\n this.pluginError,\n ANSIColors.RED\n )}`\n );\n } else if (isPluginDone) {\n lines.push(\n `${this.prefix} ${v} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.GREEN)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.BLUE)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n pluginTotal: this.pluginTotal,\n pluginDone: this.pluginDone,\n } as const;\n }\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"log.cjs","names":["spinnerFrames","configuration","ANSIColors","v","x"],"sources":["../../../src/loadDictionaries/log.ts"],"sourcesContent":["import configuration from '@intlayer/config/built';\nimport {\n ANSIColors,\n colorize,\n getPrefix,\n spinnerFrames,\n v,\n x,\n} from '@intlayer/config/logger';\nimport { extractErrorMessage } from '@intlayer/config/utils';\nimport type { DictionariesStatus } from './loadDictionaries';\n\nexport class DictionariesLogger {\n private statuses: DictionariesStatus[] = [];\n private spinnerTimer: NodeJS.Timeout | null = null;\n private spinnerIndex = 0;\n private renderedLines = 0;\n private readonly spinnerFrames = spinnerFrames;\n private isFinished = false;\n private readonly prefix: string;\n private lastRenderedState: string = '';\n private remoteCheckInProgress = false;\n private expectRemote = false;\n private remoteError: string | undefined;\n private pluginTotal = 0;\n private pluginDone = 0;\n private pluginError: string | undefined;\n\n constructor() {\n this.prefix = getPrefix(configuration?.log?.prefix) ?? '';\n }\n\n setExpectRemote(expect: boolean) {\n this.expectRemote = expect;\n }\n\n startRemoteCheck() {\n if (this.isFinished) return;\n this.remoteCheckInProgress = true;\n this.startSpinner();\n this.render();\n }\n\n stopRemoteCheck() {\n this.remoteCheckInProgress = false;\n }\n\n update(newStatuses: DictionariesStatus[]) {\n if (this.isFinished) return;\n for (const status of newStatuses) {\n const index = this.statuses.findIndex(\n (s) =>\n s.dictionaryKey === status.dictionaryKey && s.type === status.type\n );\n if (index >= 0) {\n this.statuses[index] = status;\n } else {\n this.statuses.push(status);\n }\n }\n\n // If we expect remote fetch later, avoid rendering a local-only line first\n const { remoteTotal } = this.computeProgress();\n if (this.expectRemote && !this.remoteCheckInProgress && remoteTotal === 0) {\n // Do not start spinner or render yet; wait until remote check starts\n return;\n }\n\n this.startSpinner();\n this.render();\n }\n\n finish() {\n this.isFinished = true;\n this.stopSpinner();\n // Render final state and keep it visible\n this.render();\n }\n\n private startSpinner() {\n if (this.spinnerTimer || this.isFinished) return;\n this.spinnerTimer = setInterval(() => {\n this.spinnerIndex = (this.spinnerIndex + 1) % this.spinnerFrames.length;\n this.render();\n }, 100);\n }\n\n private stopSpinner() {\n if (!this.spinnerTimer) return;\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n }\n\n public setRemoteError = (error?: Error) => {\n this.remoteError = extractErrorMessage(error);\n // Avoid rendering a transient remote-only line while the remote check flag is still true\n // Ensure local + remote are rendered together after a failure\n this.stopRemoteCheck();\n this.render();\n };\n\n setPluginTotal(total: number) {\n if (this.isFinished) return;\n this.pluginTotal = total;\n if (total > 0) {\n this.startSpinner();\n }\n this.render();\n }\n\n setPluginDone(done: number) {\n if (this.isFinished) return;\n this.pluginDone = done;\n this.render();\n }\n\n setPluginError(error?: Error) {\n if (this.isFinished) return;\n this.pluginError = extractErrorMessage(error);\n this.render();\n }\n\n private render() {\n const {\n localTotal,\n localDone,\n remoteTotal,\n remoteDone,\n pluginTotal,\n pluginDone,\n } = this.computeProgress();\n\n const frame = this.spinnerFrames[this.spinnerIndex];\n const clock = colorize(frame, ANSIColors.BLUE);\n const lines: string[] = [];\n\n const isLocalDone = localDone === localTotal;\n const isRemoteDone = remoteDone === remoteTotal;\n const isPluginDone = pluginDone === pluginTotal;\n\n const suppressLocalWhileCheckingRemote =\n this.expectRemote && this.remoteCheckInProgress && remoteTotal === 0;\n\n if (!suppressLocalWhileCheckingRemote) {\n if (isLocalDone) {\n lines.push(\n `${this.prefix} ${v} Local content: ${colorize(`${localDone}`, ANSIColors.GREEN)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Local content: ${colorize(`${localDone}`, ANSIColors.BLUE)}${colorize(`/${localTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Single remote line: show error, check, or progress counts\n if (remoteTotal > 0 || this.remoteCheckInProgress || this.remoteError) {\n if (this.remoteError) {\n lines.push(\n `${this.prefix} ${x} Remote content: ${colorize(\n this.remoteError,\n ANSIColors.RED\n )}`\n );\n } else if (remoteTotal === 0) {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize('Check server', ANSIColors.BLUE)}`\n );\n } else if (isRemoteDone) {\n lines.push(\n `${this.prefix} ${v} Remote content: ${colorize(`${remoteDone}`, ANSIColors.GREEN)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Remote content: ${colorize(`${remoteDone}`, ANSIColors.BLUE)}${colorize(`/${remoteTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Plugin line: show error or progress counts\n if (pluginTotal > 0 || this.pluginError) {\n if (this.pluginError) {\n lines.push(\n `${this.prefix} ${x} Plugin content: ${colorize(\n this.pluginError,\n ANSIColors.RED\n )}`\n );\n } else if (isPluginDone) {\n lines.push(\n `${this.prefix} ${v} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.GREEN)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n } else {\n lines.push(\n `${this.prefix} ${clock} Plugin content: ${colorize(`${pluginDone}`, ANSIColors.BLUE)}${colorize(`/${pluginTotal}`, ANSIColors.GREY)}`\n );\n }\n }\n\n // Check if the state has changed to avoid duplicate rendering\n const currentState = lines.join('\\n');\n if (currentState === this.lastRenderedState) {\n return;\n }\n this.lastRenderedState = currentState;\n\n if (this.renderedLines > 0) {\n process.stdout.write(`\\x1b[${this.renderedLines}F`);\n }\n\n const totalLinesToClear = Math.max(this.renderedLines, lines.length);\n for (let i = 0; i < totalLinesToClear; i++) {\n process.stdout.write('\\x1b[2K');\n const line = lines[i];\n if (line !== undefined) {\n process.stdout.write(line);\n }\n process.stdout.write('\\n');\n }\n\n this.renderedLines = lines.length;\n }\n\n private computeProgress() {\n const localKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'local')\n .map((s) => s.dictionaryKey)\n );\n\n const localDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'local' && (s.status === 'built' || s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n const remoteKeys = new Set(\n this.statuses\n .filter((s) => s.type === 'remote')\n .map((s) => s.dictionaryKey)\n );\n\n const remoteDoneKeys = new Set(\n this.statuses\n .filter(\n (s) =>\n s.type === 'remote' &&\n (s.status === 'fetched' ||\n s.status === 'imported' ||\n s.status === 'error')\n )\n .map((s) => s.dictionaryKey)\n );\n\n return {\n localTotal: localKeys.size,\n localDone: localDoneKeys.size,\n remoteTotal: remoteKeys.size,\n remoteDone: remoteDoneKeys.size,\n pluginTotal: this.pluginTotal,\n pluginDone: this.pluginDone,\n } as const;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`node:path`),t=require(`@intlayer/config/logger`);const n=async(n,r)=>{let i=(0,t.getAppLogger)(r),a=n.filter(t=>{let n=(0,e.extname)(t);return[`.ts`,`.tsx`,`.js`,`.jsx`,`.cjs`,`.mjs`,`.json`].includes(n)});if(a.length===0)return;let o;try{o=(await import(`typescript`)).default||await import(`typescript`)}catch{return}let s=o.findConfigFile(r.system?.baseDir??process.cwd(),o.sys.fileExists,`tsconfig.json`),c={noEmit:!0,allowJs:!0,resolveJsonModule:!0};if(s){let t=o.sys.readFile(s);if(t){let n=o.parseConfigFileTextToJson(s,t);if(!n.error){let{incremental:t,tsBuildInfoFile:r,...i}=o.parseJsonConfigFileContent(n.config,o.sys,(0,e.dirname)(s)).options;c={...c,...i,noEmit:!0}}}}let l=o.createProgram(a,c);a.forEach(e=>{let t=l.getSourceFile(e);t&&o.getPreEmitDiagnostics(l,t).forEach(e=>{let t=o.flattenDiagnosticMessageText(e.messageText,`
|
|
2
2
|
`);if(e.file&&e.start!==void 0){let{line:n,character:r}=e.file.getLineAndCharacterOfPosition(e.start);i(`TS Error in ${e.file.fileName} (${n+1},${r+1}): ${t}`,{level:`warn`})}})})};exports.logTypeScriptErrors=n;
|
|
3
3
|
//# sourceMappingURL=logTypeScriptErrors.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logTypeScriptErrors.cjs","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"sourcesContent":["import { dirname, extname } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const logTypeScriptErrors = async (\n filePaths: string[],\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration);\n\n const filesToCheck = filePaths.filter((path) => {\n const ext = extname(path);\n\n return ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.json'].includes(\n ext\n );\n });\n\n if (filesToCheck.length === 0) return;\n\n let ts: typeof import('typescript');\n\n try {\n ts = (await import('typescript')).default || (await import('typescript'));\n } catch {\n // TypeScript not installed, skip type checking\n\n return;\n }\n\n const configFileName = ts.findConfigFile(\n configuration.system?.baseDir ?? process.cwd(),\n ts.sys.fileExists,\n 'tsconfig.json'\n );\n\n let compilerOptions: any = {\n noEmit: true,\n\n allowJs: true,\n\n resolveJsonModule: true,\n };\n\n if (configFileName) {\n const configFileText = ts.sys.readFile(configFileName);\n\n if (configFileText) {\n const configJson = ts.parseConfigFileTextToJson(\n configFileName,\n\n configFileText\n );\n\n if (!configJson.error) {\n const parsedConfig = ts.parseJsonConfigFileContent(\n configJson.config,\n\n ts.sys,\n\n dirname(configFileName)\n );\n\n const { incremental, tsBuildInfoFile, ...restOptions } =\n parsedConfig.options;\n\n compilerOptions = { ...compilerOptions, ...restOptions, noEmit: true };\n }\n }\n }\n\n const program = ts.createProgram(filesToCheck, compilerOptions);\n\n filesToCheck.forEach((filePath) => {\n const sourceFile = program.getSourceFile(filePath);\n\n if (!sourceFile) return;\n\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n\n diagnostics.forEach((diagnostic) => {\n const message = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n\n '\\n'\n );\n\n if (diagnostic.file && diagnostic.start !== undefined) {\n const { line, character } =\n diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n\n appLogger(\n `TS Error in ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`,\n\n { level: 'warn' }\n );\n }\n });\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logTypeScriptErrors.cjs","names":[],"sources":["../../../src/loadDictionaries/logTypeScriptErrors.ts"],"sourcesContent":["import { dirname, extname } from 'node:path';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport type { IntlayerConfig } from '@intlayer/types/config';\n\nexport const logTypeScriptErrors = async (\n filePaths: string[],\n configuration: IntlayerConfig\n) => {\n const appLogger = getAppLogger(configuration);\n\n const filesToCheck = filePaths.filter((path) => {\n const ext = extname(path);\n\n return ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.json'].includes(\n ext\n );\n });\n\n if (filesToCheck.length === 0) return;\n\n let ts: typeof import('typescript');\n\n try {\n ts = (await import('typescript')).default || (await import('typescript'));\n } catch {\n // TypeScript not installed, skip type checking\n\n return;\n }\n\n const configFileName = ts.findConfigFile(\n configuration.system?.baseDir ?? process.cwd(),\n ts.sys.fileExists,\n 'tsconfig.json'\n );\n\n let compilerOptions: any = {\n noEmit: true,\n\n allowJs: true,\n\n resolveJsonModule: true,\n };\n\n if (configFileName) {\n const configFileText = ts.sys.readFile(configFileName);\n\n if (configFileText) {\n const configJson = ts.parseConfigFileTextToJson(\n configFileName,\n\n configFileText\n );\n\n if (!configJson.error) {\n const parsedConfig = ts.parseJsonConfigFileContent(\n configJson.config,\n\n ts.sys,\n\n dirname(configFileName)\n );\n\n const { incremental, tsBuildInfoFile, ...restOptions } =\n parsedConfig.options;\n\n compilerOptions = { ...compilerOptions, ...restOptions, noEmit: true };\n }\n }\n }\n\n const program = ts.createProgram(filesToCheck, compilerOptions);\n\n filesToCheck.forEach((filePath) => {\n const sourceFile = program.getSourceFile(filePath);\n\n if (!sourceFile) return;\n\n const diagnostics = ts.getPreEmitDiagnostics(program, sourceFile);\n\n diagnostics.forEach((diagnostic) => {\n const message = ts.flattenDiagnosticMessageText(\n diagnostic.messageText,\n\n '\\n'\n );\n\n if (diagnostic.file && diagnostic.start !== undefined) {\n const { line, character } =\n diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n\n appLogger(\n `TS Error in ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`,\n\n { level: 'warn' }\n );\n }\n });\n });\n};\n"],"mappings":"oKAIA,MAAa,EAAsB,MACjC,EACA,IACG,CACH,IAAM,GAAA,EAAA,EAAA,cAAyB,EAAc,CAEvC,EAAe,EAAU,OAAQ,GAAS,CAC9C,IAAM,GAAA,EAAA,EAAA,SAAc,EAAK,CAEzB,MAAO,CAAC,MAAO,OAAQ,MAAO,OAAQ,OAAQ,OAAQ,QAAQ,CAAC,SAC7D,EACD,EACD,CAEF,GAAI,EAAa,SAAW,EAAG,OAE/B,IAAI,EAEJ,GAAI,CACF,GAAM,MAAM,OAAO,eAAe,SAAY,MAAM,OAAO,mBACrD,CAGN,OAGF,IAAM,EAAiB,EAAG,eACxB,EAAc,QAAQ,SAAW,QAAQ,KAAK,CAC9C,EAAG,IAAI,WACP,gBACD,CAEG,EAAuB,CACzB,OAAQ,GAER,QAAS,GAET,kBAAmB,GACpB,CAED,GAAI,EAAgB,CAClB,IAAM,EAAiB,EAAG,IAAI,SAAS,EAAe,CAEtD,GAAI,EAAgB,CAClB,IAAM,EAAa,EAAG,0BACpB,EAEA,EACD,CAED,GAAI,CAAC,EAAW,MAAO,CASrB,GAAM,CAAE,cAAa,kBAAiB,GAAG,GARpB,EAAG,2BACtB,EAAW,OAEX,EAAG,KAAA,EAAA,EAAA,SAEK,EAAe,CACxB,CAGc,QAEf,EAAkB,CAAE,GAAG,EAAiB,GAAG,EAAa,OAAQ,GAAM,GAK5E,IAAM,EAAU,EAAG,cAAc,EAAc,EAAgB,CAE/D,EAAa,QAAS,GAAa,CACjC,IAAM,EAAa,EAAQ,cAAc,EAAS,CAE7C,GAEe,EAAG,sBAAsB,EAAS,EAAW,CAErD,QAAS,GAAe,CAClC,IAAM,EAAU,EAAG,6BACjB,EAAW,YAEX;EACD,CAED,GAAI,EAAW,MAAQ,EAAW,QAAU,IAAA,GAAW,CACrD,GAAM,CAAE,OAAM,aACZ,EAAW,KAAK,8BAA8B,EAAW,MAAM,CAEjE,EACE,eAAe,EAAW,KAAK,SAAS,IAAI,EAAO,EAAE,GAAG,EAAY,EAAE,KAAK,IAE3E,CAAE,MAAO,OAAQ,CAClB,GAEH,EACF"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./utils/formatter.cjs`),t=require(`./utils/runOnce.cjs`);let n=require(`node:path`),r=require(`@intlayer/config/logger`),i=require(`@intlayer/config/node`),a=require(`@intlayer/config/env`);const o=o=>{let{configuration:s,customConfiguration:c,numCustomConfiguration:l,configurationFilePath:u}=(0,i.getConfigurationAndFilePath)(o),d=(0,r.getAppLogger)(s);t.runOnce((0,n.join)(s.system.baseDir,`.intlayer`,`cache`,`intlayer-config-locaded.lock`),()=>{if(l===0)d(`Configuration file not found, using default configuration.`,{isVerbose:!0});else{let t=s.system.baseDir,r=(0,n.relative)(t,u);if(l===1){let t=(0,a.getEnvFilePath)(o?.env,o?.envFile);d(`Configuration loaded ${e.formatPath(r)}${t?` - Env: ${e.formatPath(t)}`:``}`,{isVerbose:!0})}else d(`Multiple configuration files found, using ${e.formatPath(r)}.`,{isVerbose:!0})}if(c){let e=i.intlayerConfigSchema.safeParse(c);e.success||d(`${r.x} Invalid configuration:\n${e.error.issues.map(e=>`${(0,r.colorizePath)(` - ${e.path.join(`.`)}:`)} ${(0,r.colorize)(e.message,r.ANSIColors.GREY_DARK)}`).join(`
|
|
2
2
|
`)}`),c.build?.importMode&&d(`${(0,r.colorize)(`build.importMode`,r.ANSIColors.BLUE)} is deprecated, use ${(0,r.colorize)(`dictionary.importMode`,r.ANSIColors.BLUE)} instead`),c.compiler?.transformPattern&&d(`${(0,r.colorize)(`compiler.transformPattern`,r.ANSIColors.BLUE)} is deprecated, use ${(0,r.colorize)(`build.traversePattern`,r.ANSIColors.BLUE)} instead`),c.compiler?.excludePattern&&d(`${(0,r.colorize)(`compiler.excludePattern`,r.ANSIColors.BLUE)} is deprecated, use ${(0,r.colorize)(`build.traversePattern`,r.ANSIColors.BLUE)} instead`)}},{cacheTimeoutMs:1e3*60})};exports.logConfigDetails=o;
|
|
3
3
|
//# sourceMappingURL=logConfigDetails.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logConfigDetails.cjs","names":["formatPath","intlayerConfigSchema","x","ANSIColors"],"sources":["../../src/logConfigDetails.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport {\n ANSIColors,\n colorize,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfigurationAndFilePath,\n intlayerConfigSchema,\n} from '@intlayer/config/node';\nimport { formatPath, runOnce } from './utils';\n\nexport const logConfigDetails = (options?: GetConfigurationOptions) => {\n const {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n } = getConfigurationAndFilePath(options);\n const appLogger = getAppLogger(configuration);\n\n runOnce(\n join(\n configuration.system.baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-config-locaded.lock'\n ),\n () => {\n if (numCustomConfiguration === 0) {\n appLogger(\n 'Configuration file not found, using default configuration.',\n {\n isVerbose: true,\n }\n );\n } else {\n const baseDir = configuration.system.baseDir;\n const relativeOutputPath = relative(baseDir, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n const dotEnvFilePath = getEnvFilePath(options?.env, options?.envFile);\n\n appLogger(\n `Configuration loaded ${formatPath(relativeOutputPath)}${dotEnvFilePath ? ` - Env: ${formatPath(dotEnvFilePath)}` : ''}`,\n {\n isVerbose: true,\n }\n );\n } else {\n appLogger(\n `Multiple configuration files found, using ${formatPath(relativeOutputPath)}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n\n if (customConfiguration) {\n const validation = intlayerConfigSchema.safeParse(customConfiguration);\n\n if (!validation.success) {\n const errorMessages = validation.error.issues\n .map((error) => {\n const path = colorizePath(` - ${error.path.join('.')}:`);\n const message = colorize(error.message, ANSIColors.GREY_DARK);\n return `${path} ${message}`;\n })\n .join('\\n');\n const errorMessage = `${x} Invalid configuration:\\n${errorMessages}`;\n\n appLogger(errorMessage);\n }\n\n if (customConfiguration.build?.importMode) {\n appLogger(\n `${colorize('build.importMode', ANSIColors.BLUE)} is deprecated, use ${colorize('dictionary.importMode', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.transformPattern) {\n appLogger(\n `${colorize('compiler.transformPattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.excludePattern) {\n appLogger(\n `${colorize('compiler.excludePattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n }\n },\n {\n cacheTimeoutMs: 1000 * 60, // 1 minute\n }\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"logConfigDetails.cjs","names":["formatPath","intlayerConfigSchema","x","ANSIColors"],"sources":["../../src/logConfigDetails.ts"],"sourcesContent":["import { join, relative } from 'node:path';\nimport { getEnvFilePath } from '@intlayer/config/env';\nimport {\n ANSIColors,\n colorize,\n colorizePath,\n getAppLogger,\n x,\n} from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfigurationAndFilePath,\n intlayerConfigSchema,\n} from '@intlayer/config/node';\nimport { formatPath, runOnce } from './utils';\n\nexport const logConfigDetails = (options?: GetConfigurationOptions) => {\n const {\n configuration,\n customConfiguration,\n numCustomConfiguration,\n configurationFilePath,\n } = getConfigurationAndFilePath(options);\n const appLogger = getAppLogger(configuration);\n\n runOnce(\n join(\n configuration.system.baseDir,\n '.intlayer',\n 'cache',\n 'intlayer-config-locaded.lock'\n ),\n () => {\n if (numCustomConfiguration === 0) {\n appLogger(\n 'Configuration file not found, using default configuration.',\n {\n isVerbose: true,\n }\n );\n } else {\n const baseDir = configuration.system.baseDir;\n const relativeOutputPath = relative(baseDir, configurationFilePath!);\n\n if (numCustomConfiguration === 1) {\n const dotEnvFilePath = getEnvFilePath(options?.env, options?.envFile);\n\n appLogger(\n `Configuration loaded ${formatPath(relativeOutputPath)}${dotEnvFilePath ? ` - Env: ${formatPath(dotEnvFilePath)}` : ''}`,\n {\n isVerbose: true,\n }\n );\n } else {\n appLogger(\n `Multiple configuration files found, using ${formatPath(relativeOutputPath)}.`,\n {\n isVerbose: true,\n }\n );\n }\n }\n\n if (customConfiguration) {\n const validation = intlayerConfigSchema.safeParse(customConfiguration);\n\n if (!validation.success) {\n const errorMessages = validation.error.issues\n .map((error) => {\n const path = colorizePath(` - ${error.path.join('.')}:`);\n const message = colorize(error.message, ANSIColors.GREY_DARK);\n return `${path} ${message}`;\n })\n .join('\\n');\n const errorMessage = `${x} Invalid configuration:\\n${errorMessages}`;\n\n appLogger(errorMessage);\n }\n\n if (customConfiguration.build?.importMode) {\n appLogger(\n `${colorize('build.importMode', ANSIColors.BLUE)} is deprecated, use ${colorize('dictionary.importMode', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.transformPattern) {\n appLogger(\n `${colorize('compiler.transformPattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n if (customConfiguration.compiler?.excludePattern) {\n appLogger(\n `${colorize('compiler.excludePattern', ANSIColors.BLUE)} is deprecated, use ${colorize('build.traversePattern', ANSIColors.BLUE)} instead`\n );\n }\n }\n },\n {\n cacheTimeoutMs: 1000 * 60, // 1 minute\n }\n );\n};\n"],"mappings":"kTAgBA,MAAa,EAAoB,GAAsC,CACrE,GAAM,CACJ,gBACA,sBACA,yBACA,0BAAA,EAAA,EAAA,6BAC8B,EAAQ,CAClC,GAAA,EAAA,EAAA,cAAyB,EAAc,CAE7C,EAAA,SAAA,EAAA,EAAA,MAEI,EAAc,OAAO,QACrB,YACA,QACA,+BACD,KACK,CACJ,GAAI,IAA2B,EAC7B,EACE,6DACA,CACE,UAAW,GACZ,CACF,KACI,CACL,IAAM,EAAU,EAAc,OAAO,QAC/B,GAAA,EAAA,EAAA,UAA8B,EAAS,EAAuB,CAEpE,GAAI,IAA2B,EAAG,CAChC,IAAM,GAAA,EAAA,EAAA,gBAAgC,GAAS,IAAK,GAAS,QAAQ,CAErE,EACE,wBAAwBA,EAAAA,WAAW,EAAmB,GAAG,EAAiB,WAAWA,EAAAA,WAAW,EAAe,GAAK,KACpH,CACE,UAAW,GACZ,CACF,MAED,EACE,6CAA6CA,EAAAA,WAAW,EAAmB,CAAC,GAC5E,CACE,UAAW,GACZ,CACF,CAIL,GAAI,EAAqB,CACvB,IAAM,EAAaC,EAAAA,qBAAqB,UAAU,EAAoB,CAEjE,EAAW,SAUd,EAFqB,GAAGC,EAAAA,EAAE,2BAPJ,EAAW,MAAM,OACpC,IAAK,GAGG,IAAA,EAAA,EAAA,cAFmB,MAAM,EAAM,KAAK,KAAK,IAAI,CAAC,GAAG,CAEzC,IAAA,EAAA,EAAA,UADU,EAAM,QAASC,EAAAA,WAAW,UAAU,GAE7D,CACD,KAAK;EAAK,GAGU,CAGrB,EAAoB,OAAO,YAC7B,EACE,IAAA,EAAA,EAAA,UAAY,mBAAoBA,EAAAA,WAAW,KAAK,CAAC,uBAAA,EAAA,EAAA,UAA+B,wBAAyBA,EAAAA,WAAW,KAAK,CAAC,UAC3H,CAEC,EAAoB,UAAU,kBAChC,EACE,IAAA,EAAA,EAAA,UAAY,4BAA6BA,EAAAA,WAAW,KAAK,CAAC,uBAAA,EAAA,EAAA,UAA+B,wBAAyBA,EAAAA,WAAW,KAAK,CAAC,UACpI,CAEC,EAAoB,UAAU,gBAChC,EACE,IAAA,EAAA,EAAA,UAAY,0BAA2BA,EAAAA,WAAW,KAAK,CAAC,uBAAA,EAAA,EAAA,UAA+B,wBAAyBA,EAAAA,WAAW,KAAK,CAAC,UAClI,GAIP,CACE,eAAgB,IAAO,GACxB,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./createDictionaryEntryPoint/createDictionaryEntryPoint.cjs`),n=require(`./buildIntlayerDictionary/buildIntlayerDictionary.cjs`),r=require(`./utils/runOnce.cjs`),i=require(`./createType/createModuleAugmentation.cjs`),a=require(`./createType/createType.cjs`),o=require(`./listDictionariesPath.cjs`),s=require(`./loadDictionaries/loadDictionaries.cjs`),c=require(`./buildIntlayerDictionary/writeRemoteDictionary.cjs`),l=require(`./cleanOutputDir.cjs`),u=require(`./writeConfiguration/index.cjs`);let d=require(`node:fs/promises`),f=require(`node:path`),p=require(`@intlayer/config/logger`),m=require(`@intlayer/config/utils`),h=require(`@intlayer/config/package.json`);h=e.t(h);const g={clean:!1,env:`prod`,format:[`cjs`,`esm`],cacheTimeoutMs:1e3*60*60},_=async(e,_)=>{let v=(0,p.getAppLogger)(e),y=(0,f.join)(e.system.cacheDir,`intlayer-prepared.lock`),b=(0,m.cacheDisk)(e,[`intlayer-version`]),x=await b.get(),S=!!(x&&x===h.default.version),C=await u.isCachedConfigurationUpToDate(e),w=await o.listDictionariesWithStats(e),T=!1;try{let e=await(0,d.stat)(y);T=w.some(t=>t.stats.mtime.getTime()>e.mtime.getTime())}catch{}let E=(await Promise.all(e.plugins??[])).some(e=>!!e.loadDictionaries),{clean:D,format:O,forceRun:k,onIsCached:A,cacheTimeoutMs:j,env:M}={...g,forceRun:!S||!C||T||E,..._??{}};await r.runOnce(y,async()=>{(D||!S)&&await l.cleanOutputDir(e),await b.set(h.default.version);let r=Date.now();v([`Preparing Intlayer`,(0,p.colorize)(`(v${h.default.version})`,p.ANSIColors.GREY_DARK)]),await u.writeConfiguration(e);let o=Date.now();v([`Configuration written`,(0,p.colorize)(`(${o-r}ms)`,p.ANSIColors.GREY_DARK)],{isVerbose:!0});let d=await s.loadDictionaries(w.map(e=>e.path),e),f=Date.now();v([`Content loaded`,(0,p.colorize)([d.remoteDictionaries.length+d.pluginDictionaries.length>0?[`(Total: ${f-o}ms`,d.localDictionaries.length>0?` - Local: ${d.time.localDictionaries}ms`:``,d.remoteDictionaries.length>0?` - Remote: ${d.time.remoteDictionaries}ms`:``,d.pluginDictionaries.length>0?` - Plugin: ${d.time.pluginDictionaries}ms`:``,`)`].join(``):`(${f-o}ms)`].join(``),p.ANSIColors.GREY_DARK)],{isVerbose:!0});let m=await n.buildDictionary([...d.localDictionaries,...d.remoteDictionaries,...d.pluginDictionaries],e,{formats:O,importOtherDictionaries:!1,env:M});await c.writeRemoteDictionary(d.remoteDictionaries,e),await a.createTypes(Object.values(m?.mergedDictionaries??{}).map(e=>e.dictionary),e),await t.createDictionaryEntryPoint(e);let g=Date.now();v([`Dictionaries built`,(0,p.colorize)(`(${g-r}ms)`,p.ANSIColors.GREY_DARK)]),await i.createModuleAugmentation(e),v([`Module augmentation built`,(0,p.colorize)(`(${Date.now()-g}ms)`,p.ANSIColors.GREY_DARK)],{isVerbose:!0});for await(let t of e.plugins??[]){let{unmergedDictionaries:n,mergedDictionaries:r}=m;await t.afterBuild?.({dictionaries:{unmergedDictionaries:n,mergedDictionaries:r},configuration:e})}v([`Done`,(0,p.colorize)(`${Date.now()-r}ms`,p.ANSIColors.GREEN)],{level:`info`,isVerbose:!0})},{forceRun:k,onIsCached:A,cacheTimeoutMs:j})};exports.prepareIntlayer=_;
|
|
2
2
|
//# sourceMappingURL=prepareIntlayer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareIntlayer.cjs","names":["packageJson","isCachedConfigurationUpToDate","listDictionariesWithStats","runOnce","cleanOutputDir","ANSIColors","writeConfiguration","loadDictionaries","buildDictionary","writeRemoteDictionary","createTypes","createDictionaryEntryPoint","createModuleAugmentation"],"sources":["../../src/prepareIntlayer.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { ANSIColors, colorize, getAppLogger } from '@intlayer/config/logger';\nimport packageJson from '@intlayer/config/package.json' with { type: 'json' };\nimport { cacheDisk } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { writeRemoteDictionary } from './buildIntlayerDictionary/writeRemoteDictionary';\nimport { cleanOutputDir } from './cleanOutputDir';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { listDictionariesWithStats } from './listDictionariesPath';\nimport { loadDictionaries } from './loadDictionaries/loadDictionaries';\nimport { runOnce } from './utils/runOnce';\nimport {\n isCachedConfigurationUpToDate,\n writeConfiguration,\n} from './writeConfiguration';\n\ntype PrepareIntlayerOptions = {\n clean?: boolean;\n env?: 'prod' | 'dev';\n format?: ('cjs' | 'esm')[];\n forceRun?: boolean;\n cacheTimeoutMs?: number;\n onIsCached?: () => void | Promise<void>;\n};\n\nconst DEFAULT_PREPARE_INTLAYER_OPTIONS = {\n clean: false,\n env: 'prod',\n format: ['cjs', 'esm'],\n cacheTimeoutMs: 1000 * 60 * 60, // 1 hour\n} satisfies PrepareIntlayerOptions;\n\nexport const prepareIntlayer = async (\n configuration: IntlayerConfig,\n options?: PrepareIntlayerOptions\n) => {\n const appLogger = getAppLogger(configuration);\n\n const sentinelPath = join(\n configuration.system.cacheDir,\n 'intlayer-prepared.lock'\n );\n // Clean output dir if the intlayer version has changed\n const versionCache = cacheDisk(configuration, ['intlayer-version']);\n const intlayerCacheVersion = await versionCache.get();\n const isCorrectVersion = Boolean(\n intlayerCacheVersion && intlayerCacheVersion === packageJson.version\n );\n\n const isConfigSimilar = await isCachedConfigurationUpToDate(configuration);\n\n // Check if any dictionary has been changed to force a new rebuild\n const dictionariesWithStats = await listDictionariesWithStats(configuration);\n let isDictionaryChanged = false;\n try {\n // Try catch as sentinel file may not exist yet\n const sentinelStats = await stat(sentinelPath);\n isDictionaryChanged = dictionariesWithStats.some(\n (dictionary) =>\n dictionary.stats.mtime.getTime() > sentinelStats.mtime.getTime()\n );\n } catch {}\n\n const resolvedPlugins = await Promise.all(configuration.plugins ?? []);\n const hasPluginLoadDictionaries = resolvedPlugins.some((plugin) =>\n Boolean(plugin.loadDictionaries)\n ); // Disable cache if any plugin because it can have custom behavior\n\n const { clean, format, forceRun, onIsCached, cacheTimeoutMs, env } = {\n ...DEFAULT_PREPARE_INTLAYER_OPTIONS,\n forceRun:\n !isCorrectVersion ||\n !isConfigSimilar ||\n isDictionaryChanged ||\n hasPluginLoadDictionaries,\n ...(options ?? {}),\n };\n\n // Skip preparation if it has already been done recently\n await runOnce(\n sentinelPath,\n async () => {\n // comment because of issue with next and webpack\n // await checkVersionsConsistency(configuration);\n\n if (clean || !isCorrectVersion) {\n await cleanOutputDir(configuration);\n }\n\n await versionCache.set(packageJson.version);\n\n const preparationStartMs = Date.now();\n\n appLogger([\n 'Preparing Intlayer',\n colorize(`(v${packageJson.version})`, ANSIColors.GREY_DARK),\n ]);\n\n await writeConfiguration(configuration);\n\n const configurationWrittenTime = Date.now();\n\n appLogger(\n [\n 'Configuration written',\n colorize(\n `(${configurationWrittenTime - preparationStartMs}ms)`,\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n const contentDeclarationPaths = dictionariesWithStats.map(\n (dictionary) => dictionary.path\n );\n\n const dictionaries = await loadDictionaries(\n contentDeclarationPaths,\n configuration\n );\n\n const dictionariesLoadedTime = Date.now();\n\n appLogger(\n [\n 'Content loaded',\n colorize(\n [\n dictionaries.remoteDictionaries.length +\n dictionaries.pluginDictionaries.length >\n 0\n ? [\n `(Total: ${dictionariesLoadedTime - configurationWrittenTime}ms`,\n dictionaries.localDictionaries.length > 0\n ? ` - Local: ${dictionaries.time.localDictionaries}ms`\n : '',\n dictionaries.remoteDictionaries.length > 0\n ? ` - Remote: ${dictionaries.time.remoteDictionaries}ms`\n : '',\n dictionaries.pluginDictionaries.length > 0\n ? ` - Plugin: ${dictionaries.time.pluginDictionaries}ms`\n : '',\n `)`,\n ].join('')\n : `(${dictionariesLoadedTime - configurationWrittenTime}ms)`,\n ].join(''),\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n // Build local dictionaries\n const dictionariesOutput = await buildDictionary(\n [\n ...dictionaries.localDictionaries,\n ...dictionaries.remoteDictionaries,\n ...dictionaries.pluginDictionaries,\n ],\n configuration,\n { formats: format, importOtherDictionaries: false, env }\n );\n\n // Write remote dictionaries\n // Used as cache for next fetch\n await writeRemoteDictionary(\n dictionaries.remoteDictionaries,\n configuration\n );\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, configuration);\n\n await createDictionaryEntryPoint(configuration);\n\n const dictionariesBuiltTime = Date.now();\n\n appLogger([\n 'Dictionaries built',\n colorize(\n `(${dictionariesBuiltTime - preparationStartMs}ms)`,\n ANSIColors.GREY_DARK\n ),\n ]);\n\n await createModuleAugmentation(configuration);\n\n const moduleAugmentationBuiltTime = Date.now();\n\n appLogger(\n [\n 'Module augmentation built',\n colorize(\n `(${moduleAugmentationBuiltTime - dictionariesBuiltTime}ms)`,\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of configuration.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration,\n });\n }\n\n const preparationElapsedMs = Date.now() - preparationStartMs;\n appLogger(\n [`Done`, colorize(`${preparationElapsedMs}ms`, ANSIColors.GREEN)],\n {\n level: 'info',\n isVerbose: true,\n }\n );\n },\n {\n forceRun,\n onIsCached,\n cacheTimeoutMs,\n }\n );\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"prepareIntlayer.cjs","names":["packageJson","isCachedConfigurationUpToDate","listDictionariesWithStats","runOnce","cleanOutputDir","ANSIColors","writeConfiguration","loadDictionaries","buildDictionary","writeRemoteDictionary","createTypes","createDictionaryEntryPoint","createModuleAugmentation"],"sources":["../../src/prepareIntlayer.ts"],"sourcesContent":["import { stat } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { ANSIColors, colorize, getAppLogger } from '@intlayer/config/logger';\nimport packageJson from '@intlayer/config/package.json' with { type: 'json' };\nimport { cacheDisk } from '@intlayer/config/utils';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { buildDictionary } from './buildIntlayerDictionary/buildIntlayerDictionary';\nimport { writeRemoteDictionary } from './buildIntlayerDictionary/writeRemoteDictionary';\nimport { cleanOutputDir } from './cleanOutputDir';\nimport { createDictionaryEntryPoint } from './createDictionaryEntryPoint/createDictionaryEntryPoint';\nimport { createModuleAugmentation, createTypes } from './createType/index';\nimport { listDictionariesWithStats } from './listDictionariesPath';\nimport { loadDictionaries } from './loadDictionaries/loadDictionaries';\nimport { runOnce } from './utils/runOnce';\nimport {\n isCachedConfigurationUpToDate,\n writeConfiguration,\n} from './writeConfiguration';\n\ntype PrepareIntlayerOptions = {\n clean?: boolean;\n env?: 'prod' | 'dev';\n format?: ('cjs' | 'esm')[];\n forceRun?: boolean;\n cacheTimeoutMs?: number;\n onIsCached?: () => void | Promise<void>;\n};\n\nconst DEFAULT_PREPARE_INTLAYER_OPTIONS = {\n clean: false,\n env: 'prod',\n format: ['cjs', 'esm'],\n cacheTimeoutMs: 1000 * 60 * 60, // 1 hour\n} satisfies PrepareIntlayerOptions;\n\nexport const prepareIntlayer = async (\n configuration: IntlayerConfig,\n options?: PrepareIntlayerOptions\n) => {\n const appLogger = getAppLogger(configuration);\n\n const sentinelPath = join(\n configuration.system.cacheDir,\n 'intlayer-prepared.lock'\n );\n // Clean output dir if the intlayer version has changed\n const versionCache = cacheDisk(configuration, ['intlayer-version']);\n const intlayerCacheVersion = await versionCache.get();\n const isCorrectVersion = Boolean(\n intlayerCacheVersion && intlayerCacheVersion === packageJson.version\n );\n\n const isConfigSimilar = await isCachedConfigurationUpToDate(configuration);\n\n // Check if any dictionary has been changed to force a new rebuild\n const dictionariesWithStats = await listDictionariesWithStats(configuration);\n let isDictionaryChanged = false;\n try {\n // Try catch as sentinel file may not exist yet\n const sentinelStats = await stat(sentinelPath);\n isDictionaryChanged = dictionariesWithStats.some(\n (dictionary) =>\n dictionary.stats.mtime.getTime() > sentinelStats.mtime.getTime()\n );\n } catch {}\n\n const resolvedPlugins = await Promise.all(configuration.plugins ?? []);\n const hasPluginLoadDictionaries = resolvedPlugins.some((plugin) =>\n Boolean(plugin.loadDictionaries)\n ); // Disable cache if any plugin because it can have custom behavior\n\n const { clean, format, forceRun, onIsCached, cacheTimeoutMs, env } = {\n ...DEFAULT_PREPARE_INTLAYER_OPTIONS,\n forceRun:\n !isCorrectVersion ||\n !isConfigSimilar ||\n isDictionaryChanged ||\n hasPluginLoadDictionaries,\n ...(options ?? {}),\n };\n\n // Skip preparation if it has already been done recently\n await runOnce(\n sentinelPath,\n async () => {\n // comment because of issue with next and webpack\n // await checkVersionsConsistency(configuration);\n\n if (clean || !isCorrectVersion) {\n await cleanOutputDir(configuration);\n }\n\n await versionCache.set(packageJson.version);\n\n const preparationStartMs = Date.now();\n\n appLogger([\n 'Preparing Intlayer',\n colorize(`(v${packageJson.version})`, ANSIColors.GREY_DARK),\n ]);\n\n await writeConfiguration(configuration);\n\n const configurationWrittenTime = Date.now();\n\n appLogger(\n [\n 'Configuration written',\n colorize(\n `(${configurationWrittenTime - preparationStartMs}ms)`,\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n const contentDeclarationPaths = dictionariesWithStats.map(\n (dictionary) => dictionary.path\n );\n\n const dictionaries = await loadDictionaries(\n contentDeclarationPaths,\n configuration\n );\n\n const dictionariesLoadedTime = Date.now();\n\n appLogger(\n [\n 'Content loaded',\n colorize(\n [\n dictionaries.remoteDictionaries.length +\n dictionaries.pluginDictionaries.length >\n 0\n ? [\n `(Total: ${dictionariesLoadedTime - configurationWrittenTime}ms`,\n dictionaries.localDictionaries.length > 0\n ? ` - Local: ${dictionaries.time.localDictionaries}ms`\n : '',\n dictionaries.remoteDictionaries.length > 0\n ? ` - Remote: ${dictionaries.time.remoteDictionaries}ms`\n : '',\n dictionaries.pluginDictionaries.length > 0\n ? ` - Plugin: ${dictionaries.time.pluginDictionaries}ms`\n : '',\n `)`,\n ].join('')\n : `(${dictionariesLoadedTime - configurationWrittenTime}ms)`,\n ].join(''),\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n // Build local dictionaries\n const dictionariesOutput = await buildDictionary(\n [\n ...dictionaries.localDictionaries,\n ...dictionaries.remoteDictionaries,\n ...dictionaries.pluginDictionaries,\n ],\n configuration,\n { formats: format, importOtherDictionaries: false, env }\n );\n\n // Write remote dictionaries\n // Used as cache for next fetch\n await writeRemoteDictionary(\n dictionaries.remoteDictionaries,\n configuration\n );\n\n const dictionariesToBuild = Object.values(\n dictionariesOutput?.mergedDictionaries ?? {}\n ).map((dictionary) => dictionary.dictionary);\n\n await createTypes(dictionariesToBuild, configuration);\n\n await createDictionaryEntryPoint(configuration);\n\n const dictionariesBuiltTime = Date.now();\n\n appLogger([\n 'Dictionaries built',\n colorize(\n `(${dictionariesBuiltTime - preparationStartMs}ms)`,\n ANSIColors.GREY_DARK\n ),\n ]);\n\n await createModuleAugmentation(configuration);\n\n const moduleAugmentationBuiltTime = Date.now();\n\n appLogger(\n [\n 'Module augmentation built',\n colorize(\n `(${moduleAugmentationBuiltTime - dictionariesBuiltTime}ms)`,\n ANSIColors.GREY_DARK\n ),\n ],\n {\n isVerbose: true,\n }\n );\n\n // Plugin transformation\n // Allow plugins to post-process the final build output (e.g., write back ICU JSON)\n for await (const plugin of configuration.plugins ?? []) {\n const { unmergedDictionaries, mergedDictionaries } = dictionariesOutput;\n\n await plugin.afterBuild?.({\n dictionaries: {\n unmergedDictionaries,\n mergedDictionaries,\n },\n configuration,\n });\n }\n\n const preparationElapsedMs = Date.now() - preparationStartMs;\n appLogger(\n [`Done`, colorize(`${preparationElapsedMs}ms`, ANSIColors.GREEN)],\n {\n level: 'info',\n isVerbose: true,\n }\n );\n },\n {\n forceRun,\n onIsCached,\n cacheTimeoutMs,\n }\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);const e=require(`./applyMask.cjs`);let t=require(`@intlayer/core/plugins`);const n=(n,r)=>e.applyMask(n,(0,t.getMaskContent)(r));exports.reduceDictionaryContent=n;
|
|
2
2
|
//# sourceMappingURL=reduceDictionaryContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduceDictionaryContent.cjs","names":["applyMask"],"sources":["../../../src/reduceDictionaryContent/reduceDictionaryContent.ts"],"sourcesContent":["import { getMaskContent } from '@intlayer/core/plugins';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { applyMask } from './applyMask';\n\nexport const reduceDictionaryContent = (\n fullDictionary: Dictionary,\n partialDictionary: Dictionary\n) => {\n const mask = getMaskContent(partialDictionary);\n const result = applyMask(fullDictionary, mask);\n\n return result;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"reduceDictionaryContent.cjs","names":["applyMask"],"sources":["../../../src/reduceDictionaryContent/reduceDictionaryContent.ts"],"sourcesContent":["import { getMaskContent } from '@intlayer/core/plugins';\nimport type { Dictionary } from '@intlayer/types/dictionary';\nimport { applyMask } from './applyMask';\n\nexport const reduceDictionaryContent = (\n fullDictionary: Dictionary,\n partialDictionary: Dictionary\n) => {\n const mask = getMaskContent(partialDictionary);\n const result = applyMask(fullDictionary, mask);\n\n return result;\n};\n"],"mappings":"+KAIA,MAAa,GACX,EACA,IAGeA,EAAAA,UAAU,GAAA,EAAA,EAAA,gBADG,EAAkB,CACA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`@intlayer/core/markdown`),t=require(`@intlayer/core/transpiler`),n=require(`@intlayer/types/nodeType`);const r=e=>[/^\s*---/m,/^\s*#+\s/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/^\s*>\s/m,/\[.+\]\(.+\)/,/!\[.+\]\(.+\)/,/`{1,3}.+`{1,3}/,/\*\*.+\*\*/,/__.+__/,/<(https?:\/\/[^\s>]+)>/].some(t=>t.test(e)),i=e=>(0,t.getInsertionValues)(e).length>0,a=e=>/<[a-zA-Z][a-zA-Z0-9\-.]*(\s+[^>]*)?\/?>/.test(e)||/<\/[a-zA-Z][a-zA-Z0-9\-.]*\s*>/.test(e),o=[n.NodeType.HTML,n.NodeType.Markdown,n.NodeType.Insertion,n.NodeType.File,n.NodeType.ReactNode,n.NodeType.Text,n.NodeType.Number,n.NodeType.Boolean,n.NodeType.Null,n.NodeType.Unknown],s=(n,c=!0)=>{if(c===!1)return n;let{markdown:l=!0,html:u=!0,insertion:d=!0}=typeof c==`object`?c:{};if(typeof n==`string`)return l&&r(n)?{...(0,t.md)(n),metadata:(0,e.getMarkdownMetadata)(n)}:u&&a(n)?(0,t.html)(n):d&&i(n)?(0,t.insert)(n):n;if(Array.isArray(n))return n.map(e=>s(e,c));if(n&&typeof n==`object`){if(`nodeType`in n){let e=n.nodeType;return o.includes(e)?n:e in n?{...n,[e]:s(n[e],c)}:n}let e={};for(let t of Object.keys(n))e[t]=s(n[t],c);return e}return n};exports.autoDecorateContent=s;
|
|
2
2
|
//# sourceMappingURL=autoDecorateContent.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoDecorateContent.cjs","names":["NodeType"],"sources":["../../../src/utils/autoDecorateContent.ts"],"sourcesContent":["import { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport {\n getInsertionValues,\n html,\n insert,\n md,\n} from '@intlayer/core/transpiler';\nimport { NodeType } from '@intlayer/types/nodeType';\n\n/**\n * Check if a string is a markdown string\n */\nconst isMarkdown = (str: string): boolean => {\n // Check for common markdown indicators\n const patterns = [\n /^\\s*---/m, // Front Matter\n /^\\s*#+\\s/m, // Headers: # Title\n /^\\s*[-*+]\\s/m, // Unordered lists: - Item or * Item\n /^\\s*\\d+\\.\\s/m, // Ordered lists: 1. Item\n /^\\s*>\\s/m, // Blockquotes: > Quote\n /\\[.+\\]\\(.+\\)/, // Links: [text](url)\n /!\\[.+\\]\\(.+\\)/, // Images: \n /`{1,3}.+`{1,3}/, // Code blocks or inline code: `code` or ```code```\n /\\*\\*.+\\*\\*/, // Bold: **text**\n /__.+__/, // Bold: __text__\n /<(https?:\\/\\/[^\\s>]+)>/, // Autolinks: <http://...>\n ];\n\n return patterns.some((pattern) => pattern.test(str));\n};\n\n/**\n * Check if a string is an insertion string\n */\nconst isInsertion = (str: string): boolean =>\n getInsertionValues(str).length > 0;\n\n/**\n * Check if a string is an HTML/JSX string\n * Matches:\n * - <Tag>\n * - </Tag>\n * - <Tag />\n * - <Tag attribute=\"value\">\n * - <Component.SubComponent>\n */\nconst isHTML = (str: string): boolean => {\n // 1. Matches opening or self-closing tags: <Tag ... > or <Tag ... />\n // - Must start with < followed by a letter (to avoid math comparisons like a < b)\n // - Allows alphanumeric, hyphens, and dots (for Namespaced components) in tag name\n // - Allows attributes until the closing >\n const openTagRegex = /<[a-zA-Z][a-zA-Z0-9\\-.]*(\\s+[^>]*)?\\/?>/;\n\n // 2. Matches closing tags: </Tag>\n const closeTagRegex = /<\\/[a-zA-Z][a-zA-Z0-9\\-.]*\\s*>/;\n\n return openTagRegex.test(str) || closeTagRegex.test(str);\n};\n\nconst leafNodeTypes: string[] = [\n NodeType.HTML,\n NodeType.Markdown,\n NodeType.Insertion,\n NodeType.File,\n NodeType.ReactNode,\n NodeType.Text,\n NodeType.Number,\n NodeType.Boolean,\n NodeType.Null,\n NodeType.Unknown,\n];\n\ntype AutoTransformationOptions = {\n markdown?: boolean;\n html?: boolean;\n insertion?: boolean;\n};\n\n/**\n * Automatically decorate content strings with md() or insert() if they match\n */\nexport const autoDecorateContent = (\n content: any,\n options: boolean | AutoTransformationOptions = true\n): any => {\n if (options === false) {\n return content;\n }\n\n const {\n markdown = true,\n html: htmlOption = true,\n insertion = true,\n } = typeof options === 'object' ? options : {};\n\n if (typeof content === 'string') {\n if (markdown && isMarkdown(content)) {\n const markdownNode = md(content);\n\n return {\n ...markdownNode,\n metadata: getMarkdownMetadata(content),\n };\n }\n\n if (htmlOption && isHTML(content)) {\n return html(content);\n }\n\n if (insertion && isInsertion(content)) {\n return insert(content);\n }\n\n return content;\n }\n\n if (Array.isArray(content)) {\n return content.map((item) => autoDecorateContent(item, options));\n }\n\n if (content && typeof content === 'object') {\n // If it's already a decorated node (has nodeType)\n if ('nodeType' in content) {\n const nodeType = content.nodeType;\n\n // If it's a leaf node type, don't re-decorate its content\n if (leafNodeTypes.includes(nodeType)) {\n return content;\n }\n\n // If it's a container node type (like translation, enumeration, etc.), recurse into its content field\n if (nodeType in content) {\n return {\n ...content,\n [nodeType]: autoDecorateContent(content[nodeType], options),\n };\n }\n\n return content;\n }\n\n // Plain object, recurse into all keys\n const result: Record<string, any> = {};\n for (const key of Object.keys(content)) {\n result[key] = autoDecorateContent(content[key], options);\n }\n return result;\n }\n\n return content;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"autoDecorateContent.cjs","names":["NodeType"],"sources":["../../../src/utils/autoDecorateContent.ts"],"sourcesContent":["import { getMarkdownMetadata } from '@intlayer/core/markdown';\nimport {\n getInsertionValues,\n html,\n insert,\n md,\n} from '@intlayer/core/transpiler';\nimport { NodeType } from '@intlayer/types/nodeType';\n\n/**\n * Check if a string is a markdown string\n */\nconst isMarkdown = (str: string): boolean => {\n // Check for common markdown indicators\n const patterns = [\n /^\\s*---/m, // Front Matter\n /^\\s*#+\\s/m, // Headers: # Title\n /^\\s*[-*+]\\s/m, // Unordered lists: - Item or * Item\n /^\\s*\\d+\\.\\s/m, // Ordered lists: 1. Item\n /^\\s*>\\s/m, // Blockquotes: > Quote\n /\\[.+\\]\\(.+\\)/, // Links: [text](url)\n /!\\[.+\\]\\(.+\\)/, // Images: \n /`{1,3}.+`{1,3}/, // Code blocks or inline code: `code` or ```code```\n /\\*\\*.+\\*\\*/, // Bold: **text**\n /__.+__/, // Bold: __text__\n /<(https?:\\/\\/[^\\s>]+)>/, // Autolinks: <http://...>\n ];\n\n return patterns.some((pattern) => pattern.test(str));\n};\n\n/**\n * Check if a string is an insertion string\n */\nconst isInsertion = (str: string): boolean =>\n getInsertionValues(str).length > 0;\n\n/**\n * Check if a string is an HTML/JSX string\n * Matches:\n * - <Tag>\n * - </Tag>\n * - <Tag />\n * - <Tag attribute=\"value\">\n * - <Component.SubComponent>\n */\nconst isHTML = (str: string): boolean => {\n // 1. Matches opening or self-closing tags: <Tag ... > or <Tag ... />\n // - Must start with < followed by a letter (to avoid math comparisons like a < b)\n // - Allows alphanumeric, hyphens, and dots (for Namespaced components) in tag name\n // - Allows attributes until the closing >\n const openTagRegex = /<[a-zA-Z][a-zA-Z0-9\\-.]*(\\s+[^>]*)?\\/?>/;\n\n // 2. Matches closing tags: </Tag>\n const closeTagRegex = /<\\/[a-zA-Z][a-zA-Z0-9\\-.]*\\s*>/;\n\n return openTagRegex.test(str) || closeTagRegex.test(str);\n};\n\nconst leafNodeTypes: string[] = [\n NodeType.HTML,\n NodeType.Markdown,\n NodeType.Insertion,\n NodeType.File,\n NodeType.ReactNode,\n NodeType.Text,\n NodeType.Number,\n NodeType.Boolean,\n NodeType.Null,\n NodeType.Unknown,\n];\n\ntype AutoTransformationOptions = {\n markdown?: boolean;\n html?: boolean;\n insertion?: boolean;\n};\n\n/**\n * Automatically decorate content strings with md() or insert() if they match\n */\nexport const autoDecorateContent = (\n content: any,\n options: boolean | AutoTransformationOptions = true\n): any => {\n if (options === false) {\n return content;\n }\n\n const {\n markdown = true,\n html: htmlOption = true,\n insertion = true,\n } = typeof options === 'object' ? options : {};\n\n if (typeof content === 'string') {\n if (markdown && isMarkdown(content)) {\n const markdownNode = md(content);\n\n return {\n ...markdownNode,\n metadata: getMarkdownMetadata(content),\n };\n }\n\n if (htmlOption && isHTML(content)) {\n return html(content);\n }\n\n if (insertion && isInsertion(content)) {\n return insert(content);\n }\n\n return content;\n }\n\n if (Array.isArray(content)) {\n return content.map((item) => autoDecorateContent(item, options));\n }\n\n if (content && typeof content === 'object') {\n // If it's already a decorated node (has nodeType)\n if ('nodeType' in content) {\n const nodeType = content.nodeType;\n\n // If it's a leaf node type, don't re-decorate its content\n if (leafNodeTypes.includes(nodeType)) {\n return content;\n }\n\n // If it's a container node type (like translation, enumeration, etc.), recurse into its content field\n if (nodeType in content) {\n return {\n ...content,\n [nodeType]: autoDecorateContent(content[nodeType], options),\n };\n }\n\n return content;\n }\n\n // Plain object, recurse into all keys\n const result: Record<string, any> = {};\n for (const key of Object.keys(content)) {\n result[key] = autoDecorateContent(content[key], options);\n }\n return result;\n }\n\n return content;\n};\n"],"mappings":"0NAYA,MAAM,EAAc,GAED,CACf,WACA,YACA,eACA,eACA,WACA,eACA,gBACA,iBACA,aACA,SACA,yBACD,CAEe,KAAM,GAAY,EAAQ,KAAK,EAAI,CAAC,CAMhD,EAAe,IAAA,EAAA,EAAA,oBACA,EAAI,CAAC,OAAS,EAW7B,EAAU,GAKO,0CAKD,KAAK,EAAI,EAFP,iCAEyB,KAAK,EAAI,CAGpD,EAA0B,CAC9BA,EAAAA,SAAS,KACTA,EAAAA,SAAS,SACTA,EAAAA,SAAS,UACTA,EAAAA,SAAS,KACTA,EAAAA,SAAS,UACTA,EAAAA,SAAS,KACTA,EAAAA,SAAS,OACTA,EAAAA,SAAS,QACTA,EAAAA,SAAS,KACTA,EAAAA,SAAS,QACV,CAWY,GACX,EACA,EAA+C,KACvC,CACR,GAAI,IAAY,GACd,OAAO,EAGT,GAAM,CACJ,WAAW,GACX,KAAM,EAAa,GACnB,YAAY,IACV,OAAO,GAAY,SAAW,EAAU,EAAE,CAE9C,GAAI,OAAO,GAAY,SAkBrB,OAjBI,GAAY,EAAW,EAAQ,CAG1B,CACL,IAAA,EAAA,EAAA,IAHsB,EAAQ,CAI9B,UAAA,EAAA,EAAA,qBAA8B,EAAQ,CACvC,CAGC,GAAc,EAAO,EAAQ,EAC/B,EAAA,EAAA,MAAY,EAAQ,CAGlB,GAAa,EAAY,EAAQ,EACnC,EAAA,EAAA,QAAc,EAAQ,CAGjB,EAGT,GAAI,MAAM,QAAQ,EAAQ,CACxB,OAAO,EAAQ,IAAK,GAAS,EAAoB,EAAM,EAAQ,CAAC,CAGlE,GAAI,GAAW,OAAO,GAAY,SAAU,CAE1C,GAAI,aAAc,EAAS,CACzB,IAAM,EAAW,EAAQ,SAezB,OAZI,EAAc,SAAS,EAAS,CAC3B,EAIL,KAAY,EACP,CACL,GAAG,GACF,GAAW,EAAoB,EAAQ,GAAW,EAAQ,CAC5D,CAGI,EAIT,IAAM,EAA8B,EAAE,CACtC,IAAK,IAAM,KAAO,OAAO,KAAK,EAAQ,CACpC,EAAO,GAAO,EAAoB,EAAQ,GAAM,EAAQ,CAE1D,OAAO,EAGT,OAAO"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.t(n);const r=e=>Array.isArray(e)?e:[e],i=e=>{let n=Array.from(new Set(e.map(e=>(0,t.resolve)(e))));return n.sort((e,t)=>e.length-t.length),n.reduce((e,n)=>(e.some(e=>{let r=(0,t.relative)(e,n);return!r.startsWith(`..`)&&!(0,t.isAbsolute)(r)&&r!==``})||e.push(n),e),[])},a=(e,a)=>{let o=e.build.traversePattern,s=e.compiler.transformPattern,c=e.content.watchedFilesPattern,l=[...o,...r(s)].filter(e=>typeof e==`string`).filter(e=>!e.startsWith(`!`)).map(e=>(0,t.normalize)(e)),u=[...a??[],...c,...o.filter(e=>typeof e==`string`&&e.startsWith(`!`)).map(e=>e.slice(1))].filter(e=>typeof e==`string`).map(e=>(0,t.normalize)(e)),d=i([e.system.baseDir,...e.content.codeDir]).flatMap(e=>n.default.sync(l,{cwd:e,ignore:u,absolute:!0,dot:!0}));return Array.from(new Set(d))};exports.buildComponentFilesList=a;
|
|
2
2
|
//# sourceMappingURL=buildComponentFilesList.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildComponentFilesList.cjs","names":["fg"],"sources":["../../../src/utils/buildComponentFilesList.ts"],"sourcesContent":["import { isAbsolute, normalize, relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/**\n * Remove directories that are subdirectories of others in the list so files\n * are never scanned twice.\n * Example: ['/root', '/root/src'] → ['/root']\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n const uniqueDirs = Array.from(new Set(dirs.map((dir) => resolve(dir))));\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const rel = relative(parent, dir);\n\n return !rel.startsWith('..') && !isAbsolute(rel) && rel !== '';\n });\n if (!isNested) acc.push(dir);\n\n return acc;\n }, []);\n};\n\n/**\n * Builds a deduplicated list of absolute file paths matching the given patterns.\n *\n * Handles multiple root directories (deduplicates overlapping roots), exclude\n * patterns, negation patterns embedded in `transformPattern`, and optional\n * dot-file inclusion.\n *\n * @example\n * // Single root with excludes\n * const files = buildComponentFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // Multiple roots (e.g. baseDir + codeDir), dot files included\n * const files = buildComponentFilesList(config, ['**\\/node_modules\\/**']);\n */\nexport const buildComponentFilesList = (\n config: IntlayerConfig,\n excludePattern?: string[]\n): string[] => {\n const transformPattern = config.build.traversePattern;\n const compilerTransformPattern = config.compiler.transformPattern;\n const contentDeclarationPattern = config.content.watchedFilesPattern;\n\n const patterns = [\n ...transformPattern,\n ...normalizeToArray(compilerTransformPattern),\n ]\n .filter((pattern) => typeof pattern === 'string')\n .filter((pattern) => !pattern.startsWith('!'))\n .map((pattern) => normalize(pattern)); // Ensure it works with Windows\n\n const excludePatterns = [\n ...(excludePattern ?? []),\n ...contentDeclarationPattern,\n // Treat negation entries in transformPattern as additional excludes\n ...transformPattern\n .filter(\n (pattern) => typeof pattern === 'string' && pattern.startsWith('!')\n )\n .map((pattern) => pattern.slice(1)),\n ]\n .filter((pattern) => typeof pattern === 'string')\n .map((pattern) => normalize(pattern)); // Ensure it works with Windows\n\n const roots = getDistinctRootDirs([\n config.system.baseDir,\n ...config.content.codeDir,\n ]);\n\n const fileList = roots.flatMap((root) =>\n fg.sync(patterns, {\n cwd: root,\n ignore: excludePatterns,\n absolute: true,\n dot: true, // include dot files like .next / .intlayer\n })\n );\n\n return Array.from(new Set(fileList));\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildComponentFilesList.cjs","names":["fg"],"sources":["../../../src/utils/buildComponentFilesList.ts"],"sourcesContent":["import { isAbsolute, normalize, relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/**\n * Remove directories that are subdirectories of others in the list so files\n * are never scanned twice.\n * Example: ['/root', '/root/src'] → ['/root']\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n const uniqueDirs = Array.from(new Set(dirs.map((dir) => resolve(dir))));\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const rel = relative(parent, dir);\n\n return !rel.startsWith('..') && !isAbsolute(rel) && rel !== '';\n });\n if (!isNested) acc.push(dir);\n\n return acc;\n }, []);\n};\n\n/**\n * Builds a deduplicated list of absolute file paths matching the given patterns.\n *\n * Handles multiple root directories (deduplicates overlapping roots), exclude\n * patterns, negation patterns embedded in `transformPattern`, and optional\n * dot-file inclusion.\n *\n * @example\n * // Single root with excludes\n * const files = buildComponentFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // Multiple roots (e.g. baseDir + codeDir), dot files included\n * const files = buildComponentFilesList(config, ['**\\/node_modules\\/**']);\n */\nexport const buildComponentFilesList = (\n config: IntlayerConfig,\n excludePattern?: string[]\n): string[] => {\n const transformPattern = config.build.traversePattern;\n const compilerTransformPattern = config.compiler.transformPattern;\n const contentDeclarationPattern = config.content.watchedFilesPattern;\n\n const patterns = [\n ...transformPattern,\n ...normalizeToArray(compilerTransformPattern),\n ]\n .filter((pattern) => typeof pattern === 'string')\n .filter((pattern) => !pattern.startsWith('!'))\n .map((pattern) => normalize(pattern)); // Ensure it works with Windows\n\n const excludePatterns = [\n ...(excludePattern ?? []),\n ...contentDeclarationPattern,\n // Treat negation entries in transformPattern as additional excludes\n ...transformPattern\n .filter(\n (pattern) => typeof pattern === 'string' && pattern.startsWith('!')\n )\n .map((pattern) => pattern.slice(1)),\n ]\n .filter((pattern) => typeof pattern === 'string')\n .map((pattern) => normalize(pattern)); // Ensure it works with Windows\n\n const roots = getDistinctRootDirs([\n config.system.baseDir,\n ...config.content.codeDir,\n ]);\n\n const fileList = roots.flatMap((root) =>\n fg.sync(patterns, {\n cwd: root,\n ignore: excludePatterns,\n absolute: true,\n dot: true, // include dot files like .next / .intlayer\n })\n );\n\n return Array.from(new Set(fileList));\n};\n"],"mappings":"uKAOA,MAAM,EAAuB,GAC3B,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM,CAOlC,EAAuB,GAA6B,CACxD,IAAM,EAAa,MAAM,KAAK,IAAI,IAAI,EAAK,IAAK,IAAA,EAAA,EAAA,SAAgB,EAAI,CAAC,CAAC,CAAC,CAGvE,OAFA,EAAW,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,OAAO,CAEvC,EAAW,QAAQ,EAAe,KACtB,EAAI,KAAM,GAAW,CACpC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAQ,EAAI,CAEjC,MAAO,CAAC,EAAI,WAAW,KAAK,EAAI,EAAA,EAAA,EAAA,YAAY,EAAI,EAAI,IAAQ,IAC5D,EACa,EAAI,KAAK,EAAI,CAErB,GACN,EAAE,CAAC,EAsBK,GACX,EACA,IACa,CACb,IAAM,EAAmB,EAAO,MAAM,gBAChC,EAA2B,EAAO,SAAS,iBAC3C,EAA4B,EAAO,QAAQ,oBAE3C,EAAW,CACf,GAAG,EACH,GAAG,EAAiB,EAAyB,CAC9C,CACE,OAAQ,GAAY,OAAO,GAAY,SAAS,CAChD,OAAQ,GAAY,CAAC,EAAQ,WAAW,IAAI,CAAC,CAC7C,IAAK,IAAA,EAAA,EAAA,WAAsB,EAAQ,CAAC,CAEjC,EAAkB,CACtB,GAAI,GAAkB,EAAE,CACxB,GAAG,EAEH,GAAG,EACA,OACE,GAAY,OAAO,GAAY,UAAY,EAAQ,WAAW,IAAI,CACpE,CACA,IAAK,GAAY,EAAQ,MAAM,EAAE,CAAC,CACtC,CACE,OAAQ,GAAY,OAAO,GAAY,SAAS,CAChD,IAAK,IAAA,EAAA,EAAA,WAAsB,EAAQ,CAAC,CAOjC,EALQ,EAAoB,CAChC,EAAO,OAAO,QACd,GAAG,EAAO,QAAQ,QACnB,CAAC,CAEqB,QAAS,GAC9BA,EAAAA,QAAG,KAAK,EAAU,CAChB,IAAK,EACL,OAAQ,EACR,SAAU,GACV,IAAK,GACN,CAAC,CACH,CAED,OAAO,MAAM,KAAK,IAAI,IAAI,EAAS,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:path`),n=require(`fast-glob`);n=e.t(n);const r=e=>Array.isArray(e)?e:[e],i=e=>{let n=Array.from(new Set(e.map(e=>(0,t.resolve)(e))));return n.sort((e,t)=>e.length-t.length),n.reduce((e,n)=>(e.some(e=>{let r=(0,t.relative)(e,n);return!r.startsWith(`..`)&&!(0,t.isAbsolute)(r)&&r!==``})||e.push(n),e),[])},a=e=>{let{transformPattern:a,excludePattern:o=[],baseDir:s,dot:c=!1}=e,l=r(a).filter(e=>typeof e==`string`&&!e.startsWith(`!`)).map(t.normalize),u=[...r(o),...r(a).filter(e=>typeof e==`string`&&e.startsWith(`!`)).map(e=>e.slice(1))].filter(e=>typeof e==`string`).map(t.normalize),d=i(r(s));return Array.from(new Set(d.flatMap(e=>n.default.sync(l,{cwd:e,ignore:u,absolute:!0,dot:c}))))},o=e=>{let{build:{traversePattern:t},system:{baseDir:n},content:{codeDir:r,fileExtensions:i},compiler:{excludePattern:o}}=e;return a({transformPattern:t,excludePattern:[...i.map(e=>`**/*${e}`),...Array.isArray(o)?o:[o]].filter(e=>typeof e==`string`),baseDir:[n,...r],dot:!0})};exports.buildComponentFilesList=a,exports.buildComponentFilesListFromConfig=o;
|
|
2
2
|
//# sourceMappingURL=buildFilesList.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFilesList.cjs","names":["normalize","fg"],"sources":["../../../src/utils/buildFilesList.ts"],"sourcesContent":["import { isAbsolute, normalize, relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * Options for building the files list\n */\nexport type BuildComponentFilesListOptions = {\n /**\n * Glob patterns to match files\n */\n transformPattern: string | string[];\n /**\n * Glob patterns to exclude files\n */\n excludePattern?: string | string[];\n /**\n * Base directory (or directories) for file resolution.\n * When multiple directories are provided, subdirectories of others are\n * automatically deduplicated so files are never scanned twice.\n */\n baseDir: string | string[];\n /**\n * Whether to include dot-prefixed files and directories (default: false)\n */\n dot?: boolean;\n};\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/**\n * Remove directories that are subdirectories of others in the list so files\n * are never scanned twice.\n * Example: ['/root', '/root/src'] → ['/root']\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n const uniqueDirs = Array.from(new Set(dirs.map((dir) => resolve(dir))));\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const rel = relative(parent, dir);\n return !rel.startsWith('..') && !isAbsolute(rel) && rel !== '';\n });\n if (!isNested) acc.push(dir);\n return acc;\n }, []);\n};\n\n/**\n * Builds a deduplicated list of absolute file paths matching the given patterns.\n *\n * Handles multiple root directories (deduplicates overlapping roots), exclude\n * patterns, negation patterns embedded in `transformPattern`, and optional\n * dot-file inclusion.\n *\n * @example\n * // Single root with excludes\n * const files = buildComponentFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // Multiple roots (e.g. baseDir + codeDir), dot files included\n * const files = buildComponentFilesList({\n * transformPattern: config.build.traversePattern,\n * baseDir: [config.system.baseDir, ...config.content.codeDir],\n * dot: true,\n * });\n */\nexport const buildComponentFilesList = (\n config: BuildComponentFilesListOptions\n): string[] => {\n const {\n transformPattern,\n excludePattern = [],\n baseDir,\n dot = false,\n } = config;\n\n const patterns = normalizeToArray(transformPattern)\n .filter(\n (pattern): pattern is string =>\n typeof pattern === 'string' && !pattern.startsWith('!')\n )\n .map(normalize); // Ensure it works with Windows\n\n const excludePatterns = [\n ...normalizeToArray(excludePattern),\n // Treat negation entries in transformPattern as additional excludes\n ...normalizeToArray(transformPattern)\n .filter(\n (pattern): pattern is string =>\n typeof pattern === 'string' && pattern.startsWith('!')\n )\n .map((pattern) => pattern.slice(1)),\n ]\n .filter((pattern): pattern is string => typeof pattern === 'string')\n .map(normalize); // Ensure it works with Windows\n\n const roots = getDistinctRootDirs(normalizeToArray(baseDir));\n\n return Array.from(\n new Set(\n roots.flatMap((root) =>\n fg.sync(patterns, {\n cwd: root,\n ignore: excludePatterns,\n absolute: true,\n dot,\n })\n )\n )\n );\n};\n\n/**\n * Convenience wrapper that derives all file-list options directly from an\n * `IntlayerConfig` object.\n *\n * Scans `[baseDir, ...codeDir]` using `build.traversePattern`, excludes\n * content declaration file extensions and any `compiler.excludePattern`\n * entries defined in the configuration, and includes dot files.\n */\nexport const buildComponentFilesListFromConfig = (\n intlayerConfig: IntlayerConfig\n): string[] => {\n const {\n build: { traversePattern },\n system: { baseDir },\n content: { codeDir, fileExtensions },\n compiler: { excludePattern },\n } = intlayerConfig;\n\n const excludePatterns = [\n // Exclude content declaration files (e.g. **/*.content.ts)\n ...fileExtensions.map((ext) => `**/*${ext}`),\n ...(Array.isArray(excludePattern) ? excludePattern : [excludePattern]),\n ].filter((p): p is string => typeof p === 'string');\n\n return buildComponentFilesList({\n transformPattern: traversePattern,\n excludePattern: excludePatterns,\n baseDir: [baseDir, ...codeDir],\n dot: true,\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildFilesList.cjs","names":["normalize","fg"],"sources":["../../../src/utils/buildFilesList.ts"],"sourcesContent":["import { isAbsolute, normalize, relative, resolve } from 'node:path';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport fg from 'fast-glob';\n\n/**\n * Options for building the files list\n */\nexport type BuildComponentFilesListOptions = {\n /**\n * Glob patterns to match files\n */\n transformPattern: string | string[];\n /**\n * Glob patterns to exclude files\n */\n excludePattern?: string | string[];\n /**\n * Base directory (or directories) for file resolution.\n * When multiple directories are provided, subdirectories of others are\n * automatically deduplicated so files are never scanned twice.\n */\n baseDir: string | string[];\n /**\n * Whether to include dot-prefixed files and directories (default: false)\n */\n dot?: boolean;\n};\n\n/**\n * Normalizes a pattern value to an array\n */\nconst normalizeToArray = <T>(value: T | T[]): T[] =>\n Array.isArray(value) ? value : [value];\n\n/**\n * Remove directories that are subdirectories of others in the list so files\n * are never scanned twice.\n * Example: ['/root', '/root/src'] → ['/root']\n */\nconst getDistinctRootDirs = (dirs: string[]): string[] => {\n const uniqueDirs = Array.from(new Set(dirs.map((dir) => resolve(dir))));\n uniqueDirs.sort((a, b) => a.length - b.length);\n\n return uniqueDirs.reduce((acc: string[], dir) => {\n const isNested = acc.some((parent) => {\n const rel = relative(parent, dir);\n return !rel.startsWith('..') && !isAbsolute(rel) && rel !== '';\n });\n if (!isNested) acc.push(dir);\n return acc;\n }, []);\n};\n\n/**\n * Builds a deduplicated list of absolute file paths matching the given patterns.\n *\n * Handles multiple root directories (deduplicates overlapping roots), exclude\n * patterns, negation patterns embedded in `transformPattern`, and optional\n * dot-file inclusion.\n *\n * @example\n * // Single root with excludes\n * const files = buildComponentFilesList({\n * transformPattern: 'src/**\\/*.{ts,tsx}',\n * excludePattern: ['**\\/node_modules\\/**'],\n * baseDir: '/path/to/project',\n * });\n *\n * @example\n * // Multiple roots (e.g. baseDir + codeDir), dot files included\n * const files = buildComponentFilesList({\n * transformPattern: config.build.traversePattern,\n * baseDir: [config.system.baseDir, ...config.content.codeDir],\n * dot: true,\n * });\n */\nexport const buildComponentFilesList = (\n config: BuildComponentFilesListOptions\n): string[] => {\n const {\n transformPattern,\n excludePattern = [],\n baseDir,\n dot = false,\n } = config;\n\n const patterns = normalizeToArray(transformPattern)\n .filter(\n (pattern): pattern is string =>\n typeof pattern === 'string' && !pattern.startsWith('!')\n )\n .map(normalize); // Ensure it works with Windows\n\n const excludePatterns = [\n ...normalizeToArray(excludePattern),\n // Treat negation entries in transformPattern as additional excludes\n ...normalizeToArray(transformPattern)\n .filter(\n (pattern): pattern is string =>\n typeof pattern === 'string' && pattern.startsWith('!')\n )\n .map((pattern) => pattern.slice(1)),\n ]\n .filter((pattern): pattern is string => typeof pattern === 'string')\n .map(normalize); // Ensure it works with Windows\n\n const roots = getDistinctRootDirs(normalizeToArray(baseDir));\n\n return Array.from(\n new Set(\n roots.flatMap((root) =>\n fg.sync(patterns, {\n cwd: root,\n ignore: excludePatterns,\n absolute: true,\n dot,\n })\n )\n )\n );\n};\n\n/**\n * Convenience wrapper that derives all file-list options directly from an\n * `IntlayerConfig` object.\n *\n * Scans `[baseDir, ...codeDir]` using `build.traversePattern`, excludes\n * content declaration file extensions and any `compiler.excludePattern`\n * entries defined in the configuration, and includes dot files.\n */\nexport const buildComponentFilesListFromConfig = (\n intlayerConfig: IntlayerConfig\n): string[] => {\n const {\n build: { traversePattern },\n system: { baseDir },\n content: { codeDir, fileExtensions },\n compiler: { excludePattern },\n } = intlayerConfig;\n\n const excludePatterns = [\n // Exclude content declaration files (e.g. **/*.content.ts)\n ...fileExtensions.map((ext) => `**/*${ext}`),\n ...(Array.isArray(excludePattern) ? excludePattern : [excludePattern]),\n ].filter((p): p is string => typeof p === 'string');\n\n return buildComponentFilesList({\n transformPattern: traversePattern,\n excludePattern: excludePatterns,\n baseDir: [baseDir, ...codeDir],\n dot: true,\n });\n};\n"],"mappings":"uKA+BA,MAAM,EAAuB,GAC3B,MAAM,QAAQ,EAAM,CAAG,EAAQ,CAAC,EAAM,CAOlC,EAAuB,GAA6B,CACxD,IAAM,EAAa,MAAM,KAAK,IAAI,IAAI,EAAK,IAAK,IAAA,EAAA,EAAA,SAAgB,EAAI,CAAC,CAAC,CAAC,CAGvE,OAFA,EAAW,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,OAAO,CAEvC,EAAW,QAAQ,EAAe,KACtB,EAAI,KAAM,GAAW,CACpC,IAAM,GAAA,EAAA,EAAA,UAAe,EAAQ,EAAI,CACjC,MAAO,CAAC,EAAI,WAAW,KAAK,EAAI,EAAA,EAAA,EAAA,YAAY,EAAI,EAAI,IAAQ,IAC5D,EACa,EAAI,KAAK,EAAI,CACrB,GACN,EAAE,CAAC,EA0BK,EACX,GACa,CACb,GAAM,CACJ,mBACA,iBAAiB,EAAE,CACnB,UACA,MAAM,IACJ,EAEE,EAAW,EAAiB,EAAiB,CAChD,OACE,GACC,OAAO,GAAY,UAAY,CAAC,EAAQ,WAAW,IAAI,CAC1D,CACA,IAAIA,EAAAA,UAAU,CAEX,EAAkB,CACtB,GAAG,EAAiB,EAAe,CAEnC,GAAG,EAAiB,EAAiB,CAClC,OACE,GACC,OAAO,GAAY,UAAY,EAAQ,WAAW,IAAI,CACzD,CACA,IAAK,GAAY,EAAQ,MAAM,EAAE,CAAC,CACtC,CACE,OAAQ,GAA+B,OAAO,GAAY,SAAS,CACnE,IAAIA,EAAAA,UAAU,CAEX,EAAQ,EAAoB,EAAiB,EAAQ,CAAC,CAE5D,OAAO,MAAM,KACX,IAAI,IACF,EAAM,QAAS,GACbC,EAAAA,QAAG,KAAK,EAAU,CAChB,IAAK,EACL,OAAQ,EACR,SAAU,GACV,MACD,CAAC,CACH,CACF,CACF,EAWU,EACX,GACa,CACb,GAAM,CACJ,MAAO,CAAE,mBACT,OAAQ,CAAE,WACV,QAAS,CAAE,UAAS,kBACpB,SAAU,CAAE,mBACV,EAQJ,OAAO,EAAwB,CAC7B,iBAAkB,EAClB,eARsB,CAEtB,GAAG,EAAe,IAAK,GAAQ,OAAO,IAAM,CAC5C,GAAI,MAAM,QAAQ,EAAe,CAAG,EAAiB,CAAC,EAAe,CACtE,CAAC,OAAQ,GAAmB,OAAO,GAAM,SAAS,CAKjD,QAAS,CAAC,EAAS,GAAG,EAAQ,CAC9B,IAAK,GACN,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:path`),n=require(`@intlayer/config/logger`),r=require(`@intlayer/config/built`);r=e.t(r);let i=require(`@intlayer/core/localization`),a=require(`@intlayer/types/locales`);const o=(e,i)=>[e].flat().map(e=>e.startsWith(`/`)?(0,t.relative)(r.default.system.baseDir,e):e).map(e=>i===!1?e:(0,n.colorizePath)(e,i)).join(`, `),s=(e,t=n.ANSIColors.GREEN)=>[e].flat().map(e=>`${(0,i.getLocaleName)(e,a.ENGLISH)} (${e})`).map(e=>t===!1?e:(0,n.colorize)(e,t)).join(`, `);exports.formatLocale=s,exports.formatPath=o;
|
|
2
2
|
//# sourceMappingURL=formatter.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.cjs","names":["configuration","ANSIColors","
|
|
1
|
+
{"version":3,"file":"formatter.cjs","names":["configuration","ANSIColors","ENGLISH"],"sources":["../../../src/utils/formatter.ts"],"sourcesContent":["import { relative } from 'node:path';\nimport configuration from '@intlayer/config/built';\nimport { ANSIColors, colorize, colorizePath } from '@intlayer/config/logger';\nimport { getLocaleName } from '@intlayer/core/localization';\nimport { ENGLISH } from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\n\nexport const formatPath = (\n path: string | string[],\n color?: ANSIColors | false\n) =>\n [path]\n .flat()\n .map((path) =>\n path.startsWith('/') ? relative(configuration.system.baseDir, path) : path\n )\n .map((relativePath) =>\n color === false ? relativePath : colorizePath(relativePath, color)\n )\n .join(`, `);\n\nexport const formatLocale = (\n locale: LocalesValues | LocalesValues[],\n color: ANSIColors | false = ANSIColors.GREEN\n) =>\n [locale]\n .flat()\n .map((locale) => `${getLocaleName(locale, ENGLISH)} (${locale})`)\n .map((text) => (color === false ? text : colorize(text, color)))\n .join(`, `);\n"],"mappings":"2SAOA,MAAa,GACX,EACA,IAEA,CAAC,EAAK,CACH,MAAM,CACN,IAAK,GACJ,EAAK,WAAW,IAAI,EAAA,EAAA,EAAA,UAAYA,EAAAA,QAAc,OAAO,QAAS,EAAK,CAAG,EACvE,CACA,IAAK,GACJ,IAAU,GAAQ,GAAA,EAAA,EAAA,cAA4B,EAAc,EAAM,CACnE,CACA,KAAK,KAAK,CAEF,GACX,EACA,EAA4BC,EAAAA,WAAW,QAEvC,CAAC,EAAO,CACL,MAAM,CACN,IAAK,GAAW,IAAA,EAAA,EAAA,eAAiB,EAAQC,EAAAA,QAAQ,CAAC,IAAI,EAAO,GAAG,CAChE,IAAK,GAAU,IAAU,GAAQ,GAAA,EAAA,EAAA,UAAgB,EAAM,EAAM,CAAE,CAC/D,KAAK,KAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:crypto`);t=e.t(t);const n=e=>t.default.createHash(`sha3-256`).update(e).digest(`base64`).replace(/[^A-Z\d]/gi,``).substring(0,20);exports.getPathHash=n;
|
|
2
2
|
//# sourceMappingURL=getPathHash.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPathHash.cjs","names":["crypto"],"sources":["../../../src/utils/getPathHash.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nexport const getPathHash = (filePath: string) =>\n crypto\n .createHash('sha3-256')\n .update(filePath)\n .digest('base64')\n .replace(/[^A-Z\\d]/gi, '')\n .substring(0, 20);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"getPathHash.cjs","names":["crypto"],"sources":["../../../src/utils/getPathHash.ts"],"sourcesContent":["import crypto from 'node:crypto';\n\nexport const getPathHash = (filePath: string) =>\n crypto\n .createHash('sha3-256')\n .update(filePath)\n .digest('base64')\n .replace(/[^A-Z\\d]/gi, '')\n .substring(0, 20);\n"],"mappings":"kJAEA,MAAa,EAAe,GAC1BA,EAAAA,QACG,WAAW,WAAW,CACtB,OAAO,EAAS,CAChB,OAAO,SAAS,CAChB,QAAQ,aAAc,GAAG,CACzB,UAAU,EAAG,GAAG"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../chunk-Bmb41Sf3.cjs`);let e=require(`node:path`);const t=(t,n,r)=>{if((0,e.isAbsolute)(t)){let n=(0,e.normalize)(t),i=(0,e.normalize)(r);if(t.startsWith(`/`)&&!n.startsWith(i)){let n=(0,e.resolve)(r,t.substring(1));if(!t.startsWith(`/usr/`)&&!t.startsWith(`/etc/`)&&!t.startsWith(`/var/`)&&!t.startsWith(`/home/`)&&!t.startsWith(`/Users/`)&&!t.startsWith(`/tmp/`)&&!t.startsWith(`/private/`)&&!t.startsWith(`/opt/`))return n}return n}return t.startsWith(`./`)||t.startsWith(`../`)?(0,e.resolve)((0,e.dirname)(n),t):(0,e.resolve)(r,t)};exports.resolveRelativePath=t;
|
|
2
2
|
//# sourceMappingURL=resolveRelativePath.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRelativePath.cjs","names":[],"sources":["../../../src/utils/resolveRelativePath.ts"],"sourcesContent":["import { dirname, isAbsolute, normalize, resolve } from 'node:path';\n\nexport const resolveRelativePath = (\n path: string,\n sourcePath: string,\n baseDir: string\n) => {\n // Handle absolute paths\n if (isAbsolute(path)) {\n const normalizedResult = normalize(path);\n const normalizedBaseDir = normalize(baseDir);\n\n // Check if it's relative to baseDir (starts with /)\n // but not a system path (like /usr/local)\n if (\n path.startsWith('/') &&\n !normalizedResult.startsWith(normalizedBaseDir)\n ) {\n // Try to resolve it relative to baseDir first\n const relativeToBase = resolve(baseDir, path.substring(1));\n\n // If the path doesn't exist in common system directories, treat as relative to baseDir\n if (\n !path.startsWith('/usr/') &&\n !path.startsWith('/etc/') &&\n !path.startsWith('/var/') &&\n !path.startsWith('/home/') &&\n !path.startsWith('/Users/') &&\n !path.startsWith('/tmp/') &&\n !path.startsWith('/private/') &&\n !path.startsWith('/opt/')\n ) {\n return relativeToBase;\n }\n }\n\n // It's a true system absolute path\n return normalizedResult;\n }\n\n // Handle relative paths (starting with ./ or ../)\n if (path.startsWith('./') || path.startsWith('../')) {\n const fileDir = dirname(sourcePath);\n return resolve(fileDir, path);\n }\n\n // Default case: treat as relative to baseDir\n return resolve(baseDir, path);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolveRelativePath.cjs","names":[],"sources":["../../../src/utils/resolveRelativePath.ts"],"sourcesContent":["import { dirname, isAbsolute, normalize, resolve } from 'node:path';\n\nexport const resolveRelativePath = (\n path: string,\n sourcePath: string,\n baseDir: string\n) => {\n // Handle absolute paths\n if (isAbsolute(path)) {\n const normalizedResult = normalize(path);\n const normalizedBaseDir = normalize(baseDir);\n\n // Check if it's relative to baseDir (starts with /)\n // but not a system path (like /usr/local)\n if (\n path.startsWith('/') &&\n !normalizedResult.startsWith(normalizedBaseDir)\n ) {\n // Try to resolve it relative to baseDir first\n const relativeToBase = resolve(baseDir, path.substring(1));\n\n // If the path doesn't exist in common system directories, treat as relative to baseDir\n if (\n !path.startsWith('/usr/') &&\n !path.startsWith('/etc/') &&\n !path.startsWith('/var/') &&\n !path.startsWith('/home/') &&\n !path.startsWith('/Users/') &&\n !path.startsWith('/tmp/') &&\n !path.startsWith('/private/') &&\n !path.startsWith('/opt/')\n ) {\n return relativeToBase;\n }\n }\n\n // It's a true system absolute path\n return normalizedResult;\n }\n\n // Handle relative paths (starting with ./ or ../)\n if (path.startsWith('./') || path.startsWith('../')) {\n const fileDir = dirname(sourcePath);\n return resolve(fileDir, path);\n }\n\n // Default case: treat as relative to baseDir\n return resolve(baseDir, path);\n};\n"],"mappings":"+HAEA,MAAa,GACX,EACA,EACA,IACG,CAEH,IAAA,EAAA,EAAA,YAAe,EAAK,CAAE,CACpB,IAAM,GAAA,EAAA,EAAA,WAA6B,EAAK,CAClC,GAAA,EAAA,EAAA,WAA8B,EAAQ,CAI5C,GACE,EAAK,WAAW,IAAI,EACpB,CAAC,EAAiB,WAAW,EAAkB,CAC/C,CAEA,IAAM,GAAA,EAAA,EAAA,SAAyB,EAAS,EAAK,UAAU,EAAE,CAAC,CAG1D,GACE,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,SAAS,EAC1B,CAAC,EAAK,WAAW,UAAU,EAC3B,CAAC,EAAK,WAAW,QAAQ,EACzB,CAAC,EAAK,WAAW,YAAY,EAC7B,CAAC,EAAK,WAAW,QAAQ,CAEzB,OAAO,EAKX,OAAO,EAUT,OANI,EAAK,WAAW,KAAK,EAAI,EAAK,WAAW,MAAM,EAEjD,EAAA,EAAA,UAAA,EAAA,EAAA,SADwB,EAAW,CACX,EAAK,EAI/B,EAAA,EAAA,SAAe,EAAS,EAAK"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../chunk-Bmb41Sf3.cjs`);let t=require(`node:fs/promises`),n=require(`node:path`),r=require(`@intlayer/core/package.json`);r=e.t(r);const i={cacheTimeoutMs:60*1e3},a=async(e,i)=>{let a={version:r.default.version,timestamp:i};try{await(0,t.mkdir)((0,n.dirname)(e),{recursive:!0}),await(0,t.writeFile)(e,JSON.stringify(a),{flag:`wx`})}catch(r){if(r.code===`EEXIST`)return;if(r.code===`ENOENT`)try{await(0,t.mkdir)((0,n.dirname)(e),{recursive:!0}),await(0,t.writeFile)(e,JSON.stringify(a),{flag:`wx`});return}catch(e){if(e.code===`EEXIST`)return}throw r}},o=async(e,n,o)=>{let{onIsCached:s,cacheTimeoutMs:c,forceRun:l}={...i,...o??{}},u=Date.now();try{let n=u-(await(0,t.stat)(e)).mtime.getTime(),i=!!l||n>c;if(!i)try{let n=await(0,t.readFile)(e,`utf8`),a;try{a=JSON.parse(n).version}catch{a=void 0}(!a||a!==r.default.version)&&(i=!0)}catch{i=!0}if(i)try{await(0,t.unlink)(e)}catch{}else{await s?.();return}}catch(e){if(e.code!==`ENOENT`)throw e}await a(e,u);try{await n(),await a(e,u)}catch{try{await(0,t.unlink)(e)}catch{}}};exports.runOnce=o;
|
|
2
2
|
//# sourceMappingURL=runOnce.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runOnce.cjs","names":["packageJson"],"sources":["../../../src/utils/runOnce.ts"],"sourcesContent":["import { mkdir, readFile, stat, unlink, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport packageJson from '@intlayer/core/package.json' with { type: 'json' };\n\ntype RunOnceOptions = {\n /**\n * The function to execute when the sentinel is not found or is older than the cache timeout.\n */\n onIsCached?: () => void | Promise<void>;\n /**\n * The time window in milliseconds during which the sentinel is considered valid.\n *\n * @default 60000 = 1 minute\n */\n cacheTimeoutMs?: number;\n /**\n * If true, the callback will always run. If undefined, the callback will run only if the sentinel is older than the cache timeout.\n *\n * @default false\n */\n forceRun?: boolean;\n};\n\nconst DEFAULT_RUN_ONCE_OPTIONS = {\n cacheTimeoutMs: 60 * 1000, // 1 minute in milliseconds,\n} satisfies RunOnceOptions;\n\ntype SentinelData = {\n version: string;\n timestamp: number;\n};\n\nconst writeSentinelFile = async (\n sentinelFilePath: string,\n currentTimestamp: number\n) => {\n // O_EXCL ensures only the *first* process can create the file\n const data: SentinelData = {\n version: packageJson.version,\n timestamp: currentTimestamp,\n };\n\n try {\n // Ensure the directory exists before writing the file\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n } catch (err: any) {\n if (err.code === 'EEXIST') {\n // Another process already created it → we're done\n return;\n }\n // Optimization: If ENOENT occurs on write despite mkdir (race condition with external deletion), retry once.\n if (err.code === 'ENOENT') {\n try {\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n return;\n } catch (retryErr: any) {\n if (retryErr.code === 'EEXIST') return;\n }\n }\n throw err; // unexpected FS error\n }\n};\n\n/**\n * Ensures a callback function runs only once within a specified time window across multiple processes.\n * Uses a sentinel file to coordinate execution and prevent duplicate work.\n *\n * @param sentinelFilePath - Path to the sentinel file used for coordination\n * @param callback - The function to execute (should be async)\n * @param options - The options for the runOnce function\n *\n * @example\n * ```typescript\n * await runPrepareIntlayerOnce(\n * '/tmp/intlayer-sentinel',\n * async () => {\n * // Your initialization logic here\n * await prepareIntlayer();\n * },\n * 30 * 1000 // 30 seconds cache\n * );\n * ```\n *\n * @throws {Error} When there are unexpected filesystem errors\n */\nexport const runOnce = async (\n sentinelFilePath: string,\n callback: () => void | Promise<void>,\n options?: RunOnceOptions\n) => {\n const { onIsCached, cacheTimeoutMs, forceRun } = {\n ...DEFAULT_RUN_ONCE_OPTIONS,\n ...(options ?? {}),\n };\n const currentTimestamp = Date.now();\n\n try {\n // Check if sentinel file exists and get its stats\n const sentinelStats = await stat(sentinelFilePath);\n const sentinelAge = currentTimestamp - sentinelStats.mtime.getTime();\n\n // Determine if we should rebuild based on cache age, force flag, or version mismatch\n let shouldRebuild = Boolean(forceRun) || sentinelAge > cacheTimeoutMs!;\n\n if (!shouldRebuild) {\n try {\n const raw = await readFile(sentinelFilePath, 'utf8');\n let cachedVersion: string | undefined;\n try {\n const parsed = JSON.parse(raw) as Partial<SentinelData>;\n cachedVersion = parsed.version;\n } catch {\n // Legacy format (timestamp only). Force a rebuild once to write versioned sentinel.\n cachedVersion = undefined;\n }\n\n if (!cachedVersion || cachedVersion !== packageJson.version) {\n shouldRebuild = true;\n }\n } catch {\n // If we cannot read the file, err on the safe side and rebuild\n shouldRebuild = true;\n }\n }\n\n if (shouldRebuild) {\n try {\n await unlink(sentinelFilePath);\n } catch {}\n // Fall through to create new sentinel and rebuild\n } else {\n await onIsCached?.();\n // Sentinel is recent and versions match, no need to rebuild\n return;\n }\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n // File doesn't exist, continue to create it\n } else {\n throw err; // unexpected FS error\n }\n }\n\n // Write sentinel file before to block parallel processes\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n\n try {\n await callback();\n\n // Write sentinel file after to ensure the first one has not been removed with cleanOutputDir\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n } catch {\n try {\n await unlink(sentinelFilePath); // Remove sentinel file if an error occurs\n } catch {}\n }\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"runOnce.cjs","names":["packageJson"],"sources":["../../../src/utils/runOnce.ts"],"sourcesContent":["import { mkdir, readFile, stat, unlink, writeFile } from 'node:fs/promises';\nimport { dirname } from 'node:path';\nimport packageJson from '@intlayer/core/package.json' with { type: 'json' };\n\ntype RunOnceOptions = {\n /**\n * The function to execute when the sentinel is not found or is older than the cache timeout.\n */\n onIsCached?: () => void | Promise<void>;\n /**\n * The time window in milliseconds during which the sentinel is considered valid.\n *\n * @default 60000 = 1 minute\n */\n cacheTimeoutMs?: number;\n /**\n * If true, the callback will always run. If undefined, the callback will run only if the sentinel is older than the cache timeout.\n *\n * @default false\n */\n forceRun?: boolean;\n};\n\nconst DEFAULT_RUN_ONCE_OPTIONS = {\n cacheTimeoutMs: 60 * 1000, // 1 minute in milliseconds,\n} satisfies RunOnceOptions;\n\ntype SentinelData = {\n version: string;\n timestamp: number;\n};\n\nconst writeSentinelFile = async (\n sentinelFilePath: string,\n currentTimestamp: number\n) => {\n // O_EXCL ensures only the *first* process can create the file\n const data: SentinelData = {\n version: packageJson.version,\n timestamp: currentTimestamp,\n };\n\n try {\n // Ensure the directory exists before writing the file\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n } catch (err: any) {\n if (err.code === 'EEXIST') {\n // Another process already created it → we're done\n return;\n }\n // Optimization: If ENOENT occurs on write despite mkdir (race condition with external deletion), retry once.\n if (err.code === 'ENOENT') {\n try {\n await mkdir(dirname(sentinelFilePath), { recursive: true });\n await writeFile(sentinelFilePath, JSON.stringify(data), { flag: 'wx' });\n return;\n } catch (retryErr: any) {\n if (retryErr.code === 'EEXIST') return;\n }\n }\n throw err; // unexpected FS error\n }\n};\n\n/**\n * Ensures a callback function runs only once within a specified time window across multiple processes.\n * Uses a sentinel file to coordinate execution and prevent duplicate work.\n *\n * @param sentinelFilePath - Path to the sentinel file used for coordination\n * @param callback - The function to execute (should be async)\n * @param options - The options for the runOnce function\n *\n * @example\n * ```typescript\n * await runPrepareIntlayerOnce(\n * '/tmp/intlayer-sentinel',\n * async () => {\n * // Your initialization logic here\n * await prepareIntlayer();\n * },\n * 30 * 1000 // 30 seconds cache\n * );\n * ```\n *\n * @throws {Error} When there are unexpected filesystem errors\n */\nexport const runOnce = async (\n sentinelFilePath: string,\n callback: () => void | Promise<void>,\n options?: RunOnceOptions\n) => {\n const { onIsCached, cacheTimeoutMs, forceRun } = {\n ...DEFAULT_RUN_ONCE_OPTIONS,\n ...(options ?? {}),\n };\n const currentTimestamp = Date.now();\n\n try {\n // Check if sentinel file exists and get its stats\n const sentinelStats = await stat(sentinelFilePath);\n const sentinelAge = currentTimestamp - sentinelStats.mtime.getTime();\n\n // Determine if we should rebuild based on cache age, force flag, or version mismatch\n let shouldRebuild = Boolean(forceRun) || sentinelAge > cacheTimeoutMs!;\n\n if (!shouldRebuild) {\n try {\n const raw = await readFile(sentinelFilePath, 'utf8');\n let cachedVersion: string | undefined;\n try {\n const parsed = JSON.parse(raw) as Partial<SentinelData>;\n cachedVersion = parsed.version;\n } catch {\n // Legacy format (timestamp only). Force a rebuild once to write versioned sentinel.\n cachedVersion = undefined;\n }\n\n if (!cachedVersion || cachedVersion !== packageJson.version) {\n shouldRebuild = true;\n }\n } catch {\n // If we cannot read the file, err on the safe side and rebuild\n shouldRebuild = true;\n }\n }\n\n if (shouldRebuild) {\n try {\n await unlink(sentinelFilePath);\n } catch {}\n // Fall through to create new sentinel and rebuild\n } else {\n await onIsCached?.();\n // Sentinel is recent and versions match, no need to rebuild\n return;\n }\n } catch (err: any) {\n if (err.code === 'ENOENT') {\n // File doesn't exist, continue to create it\n } else {\n throw err; // unexpected FS error\n }\n }\n\n // Write sentinel file before to block parallel processes\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n\n try {\n await callback();\n\n // Write sentinel file after to ensure the first one has not been removed with cleanOutputDir\n // Added await here\n await writeSentinelFile(sentinelFilePath, currentTimestamp);\n } catch {\n try {\n await unlink(sentinelFilePath); // Remove sentinel file if an error occurs\n } catch {}\n }\n};\n"],"mappings":"uNAuBA,MAAM,EAA2B,CAC/B,eAAgB,GAAK,IACtB,CAOK,EAAoB,MACxB,EACA,IACG,CAEH,IAAM,EAAqB,CACzB,QAASA,EAAAA,QAAY,QACrB,UAAW,EACZ,CAED,GAAI,CAEF,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAiB,CAAE,CAAE,UAAW,GAAM,CAAC,CAE3D,MAAA,EAAA,EAAA,WAAgB,EAAkB,KAAK,UAAU,EAAK,CAAE,CAAE,KAAM,KAAM,CAAC,OAChE,EAAU,CACjB,GAAI,EAAI,OAAS,SAEf,OAGF,GAAI,EAAI,OAAS,SACf,GAAI,CACF,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,SAAoB,EAAiB,CAAE,CAAE,UAAW,GAAM,CAAC,CAC3D,MAAA,EAAA,EAAA,WAAgB,EAAkB,KAAK,UAAU,EAAK,CAAE,CAAE,KAAM,KAAM,CAAC,CACvE,aACO,EAAe,CACtB,GAAI,EAAS,OAAS,SAAU,OAGpC,MAAM,IA0BG,EAAU,MACrB,EACA,EACA,IACG,CACH,GAAM,CAAE,aAAY,iBAAgB,YAAa,CAC/C,GAAG,EACH,GAAI,GAAW,EAAE,CAClB,CACK,EAAmB,KAAK,KAAK,CAEnC,GAAI,CAGF,IAAM,EAAc,GADE,MAAA,EAAA,EAAA,MAAW,EAAiB,EACG,MAAM,SAAS,CAGhE,EAAgB,EAAQ,GAAa,EAAc,EAEvD,GAAI,CAAC,EACH,GAAI,CACF,IAAM,EAAM,MAAA,EAAA,EAAA,UAAe,EAAkB,OAAO,CAChD,EACJ,GAAI,CAEF,EADe,KAAK,MAAM,EAAI,CACP,aACjB,CAEN,EAAgB,IAAA,IAGd,CAAC,GAAiB,IAAkBA,EAAAA,QAAY,WAClD,EAAgB,SAEZ,CAEN,EAAgB,GAIpB,GAAI,EACF,GAAI,CACF,MAAA,EAAA,EAAA,QAAa,EAAiB,MACxB,MAEH,CACL,MAAM,KAAc,CAEpB,cAEK,EAAU,CACjB,GAAI,EAAI,OAAS,SAGf,MAAM,EAMV,MAAM,EAAkB,EAAkB,EAAiB,CAE3D,GAAI,CACF,MAAM,GAAU,CAIhB,MAAM,EAAkB,EAAkB,EAAiB,MACrD,CACN,GAAI,CACF,MAAA,EAAA,EAAA,QAAa,EAAiB,MACxB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);let e=require(`node:child_process`);const t=e=>{if(!e)return;let t=e.trim();return t=t.replace(/your \d+x\d+ screen size is bogus\. expect trouble/gi,``),t.trim()||void 0},n=(n,r,i,a)=>{let o,s;typeof i==`function`?(s=i,o=void 0):(s=a,o=i);let c=!1,l=(0,e.spawn)(n,r,o??{}),u=``,d=``;l.stdout&&l.stdout.on(`data`,e=>{u+=e.toString()}),l.stderr&&l.stderr.on(`data`,e=>{d+=e.toString()}),l.on(`error`,e=>{c||(c=!0,s(Error(String(e))))}),l.on(`close`,e=>{if(c)return;c=!0;let n=t(d);if(n)return s(Error(n));s(null,u,e??void 0)})};exports.run=n;
|
|
2
2
|
//# sourceMappingURL=bin.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.cjs","names":[],"sources":["../../../../src/utils/runParallel/bin.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\ntype BinCallback = (err: Error | null, stdout?: string, code?: number) => void;\n\nconst stripStderr = (stderr: string | undefined): string | undefined => {\n if (!stderr) return;\n let cleaned = stderr.trim();\n // Strip bogus screen size error.\n // See https://github.com/microsoft/vscode/issues/98590\n const regex = /your \\d+x\\d+ screen size is bogus\\. expect trouble/gi;\n cleaned = cleaned.replace(regex, '');\n\n return cleaned.trim() || undefined;\n};\n\n/**\n * Spawn a binary and read its stdout.\n * @param cmd The name of the binary to spawn.\n * @param args The arguments for the binary.\n * @param options Optional option for the spawn function.\n * @param done Callback function.\n */\nexport const run = (\n cmd: string,\n args: string[],\n options: SpawnOptions | BinCallback | undefined,\n done?: BinCallback\n): void => {\n let normalizedOptions: SpawnOptions | undefined;\n let normalizedDone: BinCallback;\n\n if (typeof options === 'function') {\n normalizedDone = options;\n normalizedOptions = undefined;\n } else {\n normalizedDone = done!;\n normalizedOptions = options;\n }\n\n let executed = false;\n const ch: ChildProcess = spawn(cmd, args, normalizedOptions ?? {});\n let stdout = '';\n let stderr = '';\n\n if (ch.stdout) {\n ch.stdout.on('data', (d: Buffer) => {\n stdout += d.toString();\n });\n }\n\n if (ch.stderr) {\n ch.stderr.on('data', (d: Buffer) => {\n stderr += d.toString();\n });\n }\n\n ch.on('error', (err: Error) => {\n if (executed) return;\n executed = true;\n normalizedDone(new Error(String(err)));\n });\n\n ch.on('close', (code: number | null) => {\n if (executed) return;\n executed = true;\n\n const cleanedStderr = stripStderr(stderr);\n if (cleanedStderr) {\n return normalizedDone(new Error(cleanedStderr));\n }\n\n normalizedDone(null, stdout, code ?? undefined);\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bin.cjs","names":[],"sources":["../../../../src/utils/runParallel/bin.ts"],"sourcesContent":["import type { ChildProcess } from 'node:child_process';\nimport { type SpawnOptions, spawn } from 'node:child_process';\n\ntype BinCallback = (err: Error | null, stdout?: string, code?: number) => void;\n\nconst stripStderr = (stderr: string | undefined): string | undefined => {\n if (!stderr) return;\n let cleaned = stderr.trim();\n // Strip bogus screen size error.\n // See https://github.com/microsoft/vscode/issues/98590\n const regex = /your \\d+x\\d+ screen size is bogus\\. expect trouble/gi;\n cleaned = cleaned.replace(regex, '');\n\n return cleaned.trim() || undefined;\n};\n\n/**\n * Spawn a binary and read its stdout.\n * @param cmd The name of the binary to spawn.\n * @param args The arguments for the binary.\n * @param options Optional option for the spawn function.\n * @param done Callback function.\n */\nexport const run = (\n cmd: string,\n args: string[],\n options: SpawnOptions | BinCallback | undefined,\n done?: BinCallback\n): void => {\n let normalizedOptions: SpawnOptions | undefined;\n let normalizedDone: BinCallback;\n\n if (typeof options === 'function') {\n normalizedDone = options;\n normalizedOptions = undefined;\n } else {\n normalizedDone = done!;\n normalizedOptions = options;\n }\n\n let executed = false;\n const ch: ChildProcess = spawn(cmd, args, normalizedOptions ?? {});\n let stdout = '';\n let stderr = '';\n\n if (ch.stdout) {\n ch.stdout.on('data', (d: Buffer) => {\n stdout += d.toString();\n });\n }\n\n if (ch.stderr) {\n ch.stderr.on('data', (d: Buffer) => {\n stderr += d.toString();\n });\n }\n\n ch.on('error', (err: Error) => {\n if (executed) return;\n executed = true;\n normalizedDone(new Error(String(err)));\n });\n\n ch.on('close', (code: number | null) => {\n if (executed) return;\n executed = true;\n\n const cleanedStderr = stripStderr(stderr);\n if (cleanedStderr) {\n return normalizedDone(new Error(cleanedStderr));\n }\n\n normalizedDone(null, stdout, code ?? undefined);\n });\n};\n"],"mappings":"2IAKA,MAAM,EAAe,GAAmD,CACtE,GAAI,CAAC,EAAQ,OACb,IAAI,EAAU,EAAO,MAAM,CAM3B,MAFA,GAAU,EAAQ,QADJ,uDACmB,GAAG,CAE7B,EAAQ,MAAM,EAAI,IAAA,IAUd,GACX,EACA,EACA,EACA,IACS,CACT,IAAI,EACA,EAEA,OAAO,GAAY,YACrB,EAAiB,EACjB,EAAoB,IAAA,KAEpB,EAAiB,EACjB,EAAoB,GAGtB,IAAI,EAAW,GACT,GAAA,EAAA,EAAA,OAAyB,EAAK,EAAM,GAAqB,EAAE,CAAC,CAC9D,EAAS,GACT,EAAS,GAET,EAAG,QACL,EAAG,OAAO,GAAG,OAAS,GAAc,CAClC,GAAU,EAAE,UAAU,EACtB,CAGA,EAAG,QACL,EAAG,OAAO,GAAG,OAAS,GAAc,CAClC,GAAU,EAAE,UAAU,EACtB,CAGJ,EAAG,GAAG,QAAU,GAAe,CACzB,IACJ,EAAW,GACX,EAAmB,MAAM,OAAO,EAAI,CAAC,CAAC,GACtC,CAEF,EAAG,GAAG,QAAU,GAAwB,CACtC,GAAI,EAAU,OACd,EAAW,GAEX,IAAM,EAAgB,EAAY,EAAO,CACzC,GAAI,EACF,OAAO,EAAmB,MAAM,EAAc,CAAC,CAGjD,EAAe,KAAM,EAAQ,GAAQ,IAAA,GAAU,EAC/C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`./spawnPosix.cjs`),t=require(`./spawnWin32.cjs`);let n=require(`node:path`);const r=r=>{if(!r||Array.isArray(r)&&r.length===0)throw Error(`Invalid command`);let i=Array.isArray(r)?r.join(` `):r,a=Array.isArray(r),o=a?r[0]:i,s=a?r.slice(1):[],c=(0,n.join)(process.cwd(),`node_modules`,`.bin`),l=Object.keys(process.env).find(e=>e.toLowerCase()===`path`)??`PATH`,u=[c,process.env[l]??``].filter(Boolean).join(n.delimiter),d={...process.env,[l]:u},f=process.platform===`win32`,p=f?t.spawnWin32:e.spawnPosix,m={cwd:process.cwd(),stdio:`inherit`,env:d,shell:f},h=a?s.length===0&&/\s/.test(o)?f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,o],m):p(process.env.SHELL??`/bin/sh`,[`-c`,o],m):p(o,s,m):f?p(process.env.ComSpec??`cmd.exe`,[`/d`,`/s`,`/c`,i],m):p(process.env.SHELL??`/bin/sh`,[`-c`,i],m),g=new Promise((e,t)=>{h.on(`error`,e=>{try{console.error(`[runParallel] Failed to start: ${e?.message??String(e)}`)}catch{}y(),t(e)}),h.on(`exit`,(n,r)=>{y(),n===0||new Set([129,130,131,143]).has(n??-1)||r&&[`SIGINT`,`SIGTERM`,`SIGQUIT`,`SIGHUP`].includes(r)?e():t(Object.assign(Error(`Parallel process failed`),{code:n,signal:r}))})}),_=()=>{try{h.kill(`SIGTERM`)}catch{}},v=[{event:`SIGINT`,handler:_},{event:`SIGTERM`,handler:_},{event:`SIGQUIT`,handler:_},{event:`SIGHUP`,handler:_}];v.forEach(({event:e,handler:t})=>{process.on(e,t)});let y=()=>{v.forEach(({event:e,handler:t})=>{process.off(e,t)})};return{kill:()=>{try{h.kill(`SIGTERM`)}catch{}},result:g,commandText:i}};exports.runParallel=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|