app-builder-lib 26.15.2 → 27.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Framework.d.ts +40 -0
- package/dist/Framework.d.ts.map +1 -0
- package/dist/Framework.js +4 -0
- package/dist/Framework.js.map +1 -0
- package/dist/appInfo.d.ts +32 -0
- package/dist/appInfo.d.ts.map +1 -0
- package/dist/appInfo.js +145 -0
- package/dist/appInfo.js.map +1 -0
- package/dist/asar/asar.d.ts +39 -0
- package/dist/asar/asar.d.ts.map +1 -0
- package/dist/asar/asar.js +155 -0
- package/dist/asar/asar.js.map +1 -0
- package/dist/asar/asarFileChecker.d.ts +3 -0
- package/dist/asar/asarFileChecker.d.ts.map +1 -0
- package/dist/asar/asarFileChecker.js +22 -0
- package/dist/asar/asarFileChecker.js.map +1 -0
- package/dist/asar/asarUtil.d.ts +2 -0
- package/dist/asar/asarUtil.d.ts.map +1 -0
- package/dist/asar/asarUtil.js +278 -0
- package/dist/asar/asarUtil.js.map +1 -0
- package/dist/asar/integrity.d.ts +16 -0
- package/dist/asar/integrity.d.ts.map +1 -0
- package/dist/asar/integrity.js +59 -0
- package/dist/asar/integrity.js.map +1 -0
- package/dist/asar/unpackDetector.d.ts +2 -0
- package/dist/asar/unpackDetector.d.ts.map +1 -0
- package/dist/asar/unpackDetector.js +39 -0
- package/dist/asar/unpackDetector.js.map +1 -0
- package/dist/codeSign/certInfo.d.ts +55 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -0
- package/dist/codeSign/certInfo.js +459 -0
- package/dist/codeSign/certInfo.js.map +1 -0
- package/dist/codeSign/codesign.d.ts +4 -0
- package/dist/codeSign/codesign.d.ts.map +1 -0
- package/dist/codeSign/codesign.js +32 -0
- package/dist/codeSign/codesign.js.map +1 -0
- package/dist/codeSign/mac/macCodeSign.d.ts +29 -0
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -0
- package/dist/codeSign/mac/macCodeSign.js +273 -0
- package/dist/codeSign/mac/macCodeSign.js.map +1 -0
- package/dist/codeSign/signManager.d.ts +14 -0
- package/dist/codeSign/signManager.d.ts.map +1 -0
- package/dist/codeSign/signManager.js +2 -0
- package/dist/codeSign/signManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts +8 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.js +34 -0
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -0
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +18 -0
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -0
- package/dist/codeSign/win/windowsSignAzureManager.js +68 -0
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -0
- package/dist/codeSign/win/windowsSignToolManager.d.ts +59 -0
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -0
- package/dist/codeSign/win/windowsSignToolManager.js +364 -0
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -0
- package/dist/configuration.d.ts +1010 -0
- package/dist/configuration.d.ts.map +1 -0
- package/dist/configuration.js +2 -0
- package/dist/configuration.js.map +1 -0
- package/dist/core.d.ts +61 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/core.js +61 -0
- package/dist/core.js.map +1 -0
- package/dist/electron/ElectronFramework.d.ts +17 -0
- package/dist/electron/ElectronFramework.d.ts.map +1 -0
- package/dist/electron/ElectronFramework.js +236 -0
- package/dist/electron/ElectronFramework.js.map +1 -0
- package/dist/electron/electronVersion.d.ts +7 -0
- package/dist/electron/electronVersion.d.ts.map +1 -0
- package/dist/electron/electronVersion.js +119 -0
- package/dist/electron/electronVersion.js.map +1 -0
- package/dist/electron/injectFFMPEG.d.ts +12 -0
- package/dist/electron/injectFFMPEG.d.ts.map +1 -0
- package/dist/electron/injectFFMPEG.js +53 -0
- package/dist/electron/injectFFMPEG.js.map +1 -0
- package/dist/electron/mac/electronMac.d.ts +2 -0
- package/dist/electron/mac/electronMac.d.ts.map +1 -0
- package/dist/electron/mac/electronMac.js +254 -0
- package/dist/electron/mac/electronMac.js.map +1 -0
- package/dist/electron/search-module.d.ts +24 -0
- package/dist/electron/search-module.d.ts.map +1 -0
- package/dist/electron/search-module.js +68 -0
- package/dist/electron/search-module.js.map +1 -0
- package/dist/electron/win/electronWin.d.ts +2 -0
- package/dist/electron/win/electronWin.d.ts.map +1 -0
- package/dist/electron/win/electronWin.js +36 -0
- package/dist/electron/win/electronWin.js.map +1 -0
- package/dist/errorMessages.d.ts +2 -0
- package/dist/errorMessages.d.ts.map +1 -0
- package/dist/errorMessages.js +8 -0
- package/dist/errorMessages.js.map +1 -0
- package/dist/fileMatcher.d.ts +31 -0
- package/dist/fileMatcher.d.ts.map +1 -0
- package/dist/fileMatcher.js +277 -0
- package/dist/fileMatcher.js.map +1 -0
- package/dist/fileTransformer.d.ts +2 -0
- package/dist/fileTransformer.d.ts.map +1 -0
- package/dist/fileTransformer.js +82 -0
- package/dist/fileTransformer.js.map +1 -0
- package/dist/forge-maker.d.ts +6 -0
- package/dist/forge-maker.d.ts.map +1 -0
- package/dist/forge-maker.js +20 -0
- package/dist/forge-maker.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/indexInternal.d.ts +46 -0
- package/dist/indexInternal.d.ts.map +1 -0
- package/dist/indexInternal.js +39 -0
- package/dist/indexInternal.js.map +1 -0
- package/dist/linuxPackager.d.ts +13 -0
- package/dist/linuxPackager.d.ts.map +1 -0
- package/dist/linuxPackager.js +75 -0
- package/dist/linuxPackager.js.map +1 -0
- package/dist/macPackager.d.ts +50 -0
- package/dist/macPackager.d.ts.map +1 -0
- package/dist/macPackager.js +442 -0
- package/dist/macPackager.js.map +1 -0
- package/dist/node-module-collector/bunNodeModulesCollector.d.ts +11 -0
- package/dist/node-module-collector/bunNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/bunNodeModulesCollector.js +14 -0
- package/dist/node-module-collector/bunNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/hoist.d.ts +124 -0
- package/dist/node-module-collector/hoist.d.ts.map +1 -0
- package/dist/node-module-collector/hoist.js +880 -0
- package/dist/node-module-collector/hoist.js.map +1 -0
- package/dist/node-module-collector/index.d.ts +21 -0
- package/dist/node-module-collector/index.d.ts.map +1 -0
- package/dist/node-module-collector/index.js +124 -0
- package/dist/node-module-collector/index.js.map +1 -0
- package/dist/node-module-collector/moduleManager.d.ts +94 -0
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -0
- package/dist/node-module-collector/moduleManager.js +314 -0
- package/dist/node-module-collector/moduleManager.js.map +1 -0
- package/dist/node-module-collector/nodeModulesCollector.d.ts +138 -0
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/nodeModulesCollector.js +421 -0
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/npmNodeModulesCollector.d.ts +15 -0
- package/dist/node-module-collector/npmNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/npmNodeModulesCollector.js +75 -0
- package/dist/node-module-collector/npmNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/packageManager.d.ts +18 -0
- package/dist/node-module-collector/packageManager.d.ts.map +1 -0
- package/dist/node-module-collector/packageManager.js +137 -0
- package/dist/node-module-collector/packageManager.js.map +1 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +45 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +184 -0
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.d.ts +19 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.js +118 -0
- package/dist/node-module-collector/traversalNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/types.d.ts +53 -0
- package/dist/node-module-collector/types.d.ts.map +1 -0
- package/dist/node-module-collector/types.js +2 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.d.ts +16 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.js +87 -0
- package/dist/node-module-collector/yarnBerryNodeModulesCollector.js.map +1 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.d.ts +11 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.d.ts.map +1 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.js +18 -0
- package/dist/node-module-collector/yarnNodeModulesCollector.js.map +1 -0
- package/dist/options/AppXOptions.d.ts +106 -0
- package/dist/options/AppXOptions.d.ts.map +1 -0
- package/dist/options/AppXOptions.js +2 -0
- package/dist/options/AppXOptions.js.map +1 -0
- package/dist/options/CommonWindowsInstallerConfiguration.d.ts +48 -0
- package/dist/options/CommonWindowsInstallerConfiguration.d.ts.map +1 -0
- package/dist/options/CommonWindowsInstallerConfiguration.js +47 -0
- package/dist/options/CommonWindowsInstallerConfiguration.js.map +1 -0
- package/dist/options/FileAssociation.d.ts +46 -0
- package/dist/options/FileAssociation.d.ts.map +1 -0
- package/dist/options/FileAssociation.js +2 -0
- package/dist/options/MsiOptions.d.ts +27 -0
- package/dist/options/MsiOptions.d.ts.map +1 -0
- package/dist/options/MsiOptions.js +2 -0
- package/dist/options/MsiOptions.js.map +1 -0
- package/dist/options/MsiWrappedOptions.d.ts +27 -0
- package/dist/options/MsiWrappedOptions.d.ts.map +1 -0
- package/dist/options/MsiWrappedOptions.js +2 -0
- package/dist/options/MsiWrappedOptions.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +261 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.js +2 -0
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -0
- package/dist/options/SnapOptions.d.ts +480 -0
- package/dist/options/SnapOptions.d.ts.map +1 -0
- package/dist/options/SnapOptions.js +2 -0
- package/dist/options/SnapOptions.js.map +1 -0
- package/dist/options/SquirrelWindowsOptions.d.ts +47 -0
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -0
- package/dist/options/SquirrelWindowsOptions.js +2 -0
- package/dist/options/SquirrelWindowsOptions.js.map +1 -0
- package/dist/options/linuxOptions.d.ts +289 -0
- package/dist/options/linuxOptions.d.ts.map +1 -0
- package/dist/options/linuxOptions.js +2 -0
- package/dist/options/linuxOptions.js.map +1 -0
- package/dist/options/macOptions.d.ts +390 -0
- package/dist/options/macOptions.d.ts.map +1 -0
- package/dist/options/macOptions.js +2 -0
- package/dist/options/macOptions.js.map +1 -0
- package/dist/options/metadata.d.ts +54 -0
- package/dist/options/metadata.d.ts.map +1 -0
- package/dist/options/metadata.js +2 -0
- package/dist/options/metadata.js.map +1 -0
- package/dist/options/pkgOptions.d.ts +137 -0
- package/dist/options/pkgOptions.d.ts.map +1 -0
- package/dist/options/pkgOptions.js +2 -0
- package/dist/options/pkgOptions.js.map +1 -0
- package/dist/options/winOptions.d.ts +166 -0
- package/dist/options/winOptions.d.ts.map +1 -0
- package/dist/options/winOptions.js +2 -0
- package/dist/options/winOptions.js.map +1 -0
- package/dist/packager.d.ts +100 -0
- package/dist/packager.d.ts.map +1 -0
- package/dist/packager.js +491 -0
- package/dist/packager.js.map +1 -0
- package/dist/packagerApi.d.ts +32 -0
- package/dist/packagerApi.d.ts.map +1 -0
- package/dist/packagerApi.js +2 -0
- package/dist/packagerApi.js.map +1 -0
- package/dist/platformPackager.d.ts +132 -0
- package/dist/platformPackager.d.ts.map +1 -0
- package/dist/platformPackager.js +761 -0
- package/dist/platformPackager.js.map +1 -0
- package/dist/presets/rectCra.d.ts +2 -0
- package/dist/presets/rectCra.d.ts.map +1 -0
- package/dist/presets/rectCra.js +19 -0
- package/dist/presets/rectCra.js.map +1 -0
- package/dist/publish/PublishManager.d.ts +33 -0
- package/dist/publish/PublishManager.d.ts.map +1 -0
- package/dist/publish/PublishManager.js +470 -0
- package/dist/publish/PublishManager.js.map +1 -0
- package/dist/publish/updateInfoBuilder.d.ts +15 -0
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -0
- package/dist/publish/updateInfoBuilder.js +221 -0
- package/dist/publish/updateInfoBuilder.js.map +1 -0
- package/dist/targets/ArchiveTarget.d.ts +12 -0
- package/dist/targets/ArchiveTarget.d.ts.map +1 -0
- package/dist/targets/ArchiveTarget.js +93 -0
- package/dist/targets/ArchiveTarget.js.map +1 -0
- package/dist/targets/archive.d.ts +27 -0
- package/dist/targets/archive.d.ts.map +1 -0
- package/dist/targets/archive.js +174 -0
- package/dist/targets/archive.js.map +1 -0
- package/dist/targets/blockmap/blockmap.d.ts +17 -0
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -0
- package/dist/targets/blockmap/blockmap.js +150 -0
- package/dist/targets/blockmap/blockmap.js.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +16 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.js +73 -0
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -0
- package/dist/targets/linux/FlatpakTarget.d.ts +21 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -0
- package/dist/targets/linux/FlatpakTarget.js +156 -0
- package/dist/targets/linux/FlatpakTarget.js.map +1 -0
- package/dist/targets/linux/FpmTarget.d.ts +23 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -0
- package/dist/targets/linux/FpmTarget.js +365 -0
- package/dist/targets/linux/FpmTarget.js.map +1 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts +24 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -0
- package/dist/targets/linux/LinuxTargetHelper.js +332 -0
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +16 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -0
- package/dist/targets/linux/appimage/AppImageTarget.js +141 -0
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts +57 -0
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -0
- package/dist/targets/linux/appimage/appImageUtil.js +317 -0
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts +4 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -0
- package/dist/targets/linux/appimage/appLauncher.js +91 -0
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts +37 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.js +96 -0
- package/dist/targets/linux/snap/SnapTarget.js.map +1 -0
- package/dist/targets/linux/snap/core24.d.ts +53 -0
- package/dist/targets/linux/snap/core24.d.ts.map +1 -0
- package/dist/targets/linux/snap/core24.js +444 -0
- package/dist/targets/linux/snap/core24.js.map +1 -0
- package/dist/targets/linux/snap/coreCustom.d.ts +29 -0
- package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -0
- package/dist/targets/linux/snap/coreCustom.js +60 -0
- package/dist/targets/linux/snap/coreCustom.js.map +1 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts +46 -0
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -0
- package/dist/targets/linux/snap/coreLegacy.js +402 -0
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts +40 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.js +414 -0
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -0
- package/dist/targets/mac/MacTargetHelper.d.ts +30 -0
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -0
- package/dist/targets/mac/MacTargetHelper.js +267 -0
- package/dist/targets/mac/MacTargetHelper.js.map +1 -0
- package/dist/targets/mac/pkg.d.ts +31 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -0
- package/dist/targets/mac/pkg.js +271 -0
- package/dist/targets/mac/pkg.js.map +1 -0
- package/dist/targets/targetFactory.d.ts +13 -0
- package/dist/targets/targetFactory.d.ts.map +1 -0
- package/dist/targets/targetFactory.js +94 -0
- package/dist/targets/targetFactory.js.map +1 -0
- package/dist/targets/targetUtil.d.ts +16 -0
- package/dist/targets/targetUtil.d.ts.map +1 -0
- package/dist/targets/targetUtil.js +40 -0
- package/dist/targets/targetUtil.js.map +1 -0
- package/dist/targets/win/AppxCapabilities.d.ts +9 -0
- package/dist/targets/win/AppxCapabilities.d.ts.map +1 -0
- package/dist/targets/win/AppxCapabilities.js +254 -0
- package/dist/targets/win/AppxCapabilities.js.map +1 -0
- package/dist/targets/win/AppxTarget.d.ts +18 -0
- package/dist/targets/win/AppxTarget.d.ts.map +1 -0
- package/dist/targets/win/AppxTarget.js +398 -0
- package/dist/targets/win/AppxTarget.js.map +1 -0
- package/dist/targets/win/MsiTarget.d.ts +29 -0
- package/dist/targets/win/MsiTarget.d.ts.map +1 -0
- package/dist/targets/win/MsiTarget.js +268 -0
- package/dist/targets/win/MsiTarget.js.map +1 -0
- package/dist/targets/win/MsiWrappedTarget.d.ts +20 -0
- package/dist/targets/win/MsiWrappedTarget.d.ts.map +1 -0
- package/dist/targets/win/MsiWrappedTarget.js +77 -0
- package/dist/targets/win/MsiWrappedTarget.js.map +1 -0
- package/dist/targets/win/nsis/Commands.d.ts +10 -0
- package/dist/targets/win/nsis/Commands.d.ts.map +1 -0
- package/dist/targets/win/nsis/Commands.js +2 -0
- package/dist/targets/win/nsis/Commands.js.map +1 -0
- package/dist/targets/win/nsis/Defines.d.ts +81 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -0
- package/dist/targets/win/nsis/Defines.js +2 -0
- package/dist/targets/win/nsis/Defines.js.map +1 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts +43 -0
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -0
- package/dist/targets/win/nsis/NsisTarget.js +726 -0
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -0
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts +14 -0
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -0
- package/dist/targets/win/nsis/WebInstallerTarget.js +43 -0
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -0
- package/dist/targets/win/nsis/nsisLang.d.ts +11 -0
- package/dist/targets/win/nsis/nsisLang.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisLang.js +94 -0
- package/dist/targets/win/nsis/nsisLang.js.map +1 -0
- package/dist/targets/win/nsis/nsisLicense.d.ts +5 -0
- package/dist/targets/win/nsis/nsisLicense.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisLicense.js +73 -0
- package/dist/targets/win/nsis/nsisLicense.js.map +1 -0
- package/dist/targets/win/nsis/nsisOptions.d.ts +275 -0
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisOptions.js +2 -0
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts +13 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.js +59 -0
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -0
- package/dist/targets/win/nsis/nsisUtil.d.ts +26 -0
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisUtil.js +218 -0
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -0
- package/dist/targets/win/nsis/nsisValidation.d.ts +19 -0
- package/dist/targets/win/nsis/nsisValidation.d.ts.map +1 -0
- package/dist/targets/win/nsis/nsisValidation.js +49 -0
- package/dist/targets/win/nsis/nsisValidation.js.map +1 -0
- package/dist/toolsets/7zip.d.ts +9 -0
- package/dist/toolsets/7zip.d.ts.map +1 -0
- package/dist/toolsets/7zip.js +80 -0
- package/dist/toolsets/7zip.js.map +1 -0
- package/dist/toolsets/appimage.d.ts +20 -0
- package/dist/toolsets/appimage.d.ts.map +1 -0
- package/dist/toolsets/appimage.js +67 -0
- package/dist/toolsets/appimage.js.map +1 -0
- package/dist/toolsets/custom.d.ts +5 -0
- package/dist/toolsets/custom.d.ts.map +1 -0
- package/dist/toolsets/custom.js +200 -0
- package/dist/toolsets/custom.js.map +1 -0
- package/dist/toolsets/fpm.d.ts +3 -0
- package/dist/toolsets/fpm.d.ts.map +1 -0
- package/dist/toolsets/fpm.js +49 -0
- package/dist/toolsets/fpm.js.map +1 -0
- package/dist/toolsets/icons.d.ts +12 -0
- package/dist/toolsets/icons.d.ts.map +1 -0
- package/dist/toolsets/icons.js +36 -0
- package/dist/toolsets/icons.js.map +1 -0
- package/dist/toolsets/linuxToolsMac.d.ts +8 -0
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -0
- package/dist/toolsets/linuxToolsMac.js +31 -0
- package/dist/toolsets/linuxToolsMac.js.map +1 -0
- package/dist/toolsets/nsis.d.ts +13 -0
- package/dist/toolsets/nsis.d.ts.map +1 -0
- package/dist/toolsets/nsis.js +100 -0
- package/dist/toolsets/nsis.js.map +1 -0
- package/dist/toolsets/winCodeSign.d.ts +42 -0
- package/dist/toolsets/winCodeSign.d.ts.map +1 -0
- package/dist/toolsets/winCodeSign.js +142 -0
- package/dist/toolsets/winCodeSign.js.map +1 -0
- package/dist/toolsets/wine.d.ts +6 -0
- package/dist/toolsets/wine.d.ts.map +1 -0
- package/dist/toolsets/wine.js +79 -0
- package/dist/toolsets/wine.js.map +1 -0
- package/dist/util/AppFileWalker.d.ts +14 -0
- package/dist/util/AppFileWalker.d.ts.map +1 -0
- package/dist/util/AppFileWalker.js +69 -0
- package/dist/util/AppFileWalker.js.map +1 -0
- package/dist/util/NodeModuleCopyHelper.d.ts +2 -0
- package/dist/util/NodeModuleCopyHelper.d.ts.map +1 -0
- package/dist/util/NodeModuleCopyHelper.js +160 -0
- package/dist/util/NodeModuleCopyHelper.js.map +1 -0
- package/dist/util/appFileCopier.d.ts +17 -0
- package/dist/util/appFileCopier.d.ts.map +1 -0
- package/dist/util/appFileCopier.js +190 -0
- package/dist/util/appFileCopier.js.map +1 -0
- package/dist/util/asyncEventEmitter.d.ts +34 -0
- package/dist/util/asyncEventEmitter.d.ts.map +1 -0
- package/dist/util/asyncEventEmitter.js +56 -0
- package/dist/util/asyncEventEmitter.js.map +1 -0
- package/dist/util/bundledTool.d.ts +8 -0
- package/dist/util/bundledTool.d.ts.map +1 -0
- package/dist/util/bundledTool.js +16 -0
- package/dist/util/bundledTool.js.map +1 -0
- package/dist/util/cacheManager.d.ts +19 -0
- package/dist/util/cacheManager.d.ts.map +1 -0
- package/dist/util/cacheManager.js +65 -0
- package/dist/util/cacheManager.js.map +1 -0
- package/dist/util/cacheState.d.ts +29 -0
- package/dist/util/cacheState.d.ts.map +1 -0
- package/dist/util/cacheState.js +134 -0
- package/dist/util/cacheState.js.map +1 -0
- package/dist/util/config/config.d.ts +13 -0
- package/dist/util/config/config.d.ts.map +1 -0
- package/dist/util/config/config.js +236 -0
- package/dist/util/config/config.js.map +1 -0
- package/dist/util/config/load.d.ts +20 -0
- package/dist/util/config/load.d.ts.map +1 -0
- package/dist/util/config/load.js +122 -0
- package/dist/util/config/load.js.map +1 -0
- package/dist/util/config/schemaValidator.d.ts +8 -0
- package/dist/util/config/schemaValidator.d.ts.map +1 -0
- package/dist/util/config/schemaValidator.js +161 -0
- package/dist/util/config/schemaValidator.js.map +1 -0
- package/dist/util/dynamicImport.d.ts +2 -0
- package/dist/util/dynamicImport.d.ts.map +1 -0
- package/dist/util/dynamicImport.js +9 -0
- package/dist/util/dynamicImport.js.map +1 -0
- package/dist/util/electronGet.d.ts +68 -0
- package/dist/util/electronGet.d.ts.map +1 -0
- package/dist/util/electronGet.js +560 -0
- package/dist/util/electronGet.js.map +1 -0
- package/dist/util/filter.d.ts +2 -0
- package/dist/util/filter.d.ts.map +1 -0
- package/dist/util/filter.js +64 -0
- package/dist/util/filter.js.map +1 -0
- package/dist/util/flags.d.ts +16 -0
- package/dist/util/flags.d.ts.map +1 -0
- package/dist/util/flags.js +53 -0
- package/dist/util/flags.js.map +1 -0
- package/dist/util/hash.d.ts +2 -0
- package/dist/util/hash.d.ts.map +1 -0
- package/dist/util/hash.js +16 -0
- package/dist/util/hash.js.map +1 -0
- package/dist/util/iconConverter.d.ts +29 -0
- package/dist/util/iconConverter.d.ts.map +1 -0
- package/dist/util/iconConverter.js +255 -0
- package/dist/util/iconConverter.js.map +1 -0
- package/dist/util/langs.d.ts +190 -0
- package/dist/util/langs.d.ts.map +1 -0
- package/dist/util/langs.js +432 -0
- package/dist/util/langs.js.map +1 -0
- package/dist/util/license.d.ts +17 -0
- package/dist/util/license.d.ts.map +1 -0
- package/dist/util/license.js +42 -0
- package/dist/util/license.js.map +1 -0
- package/dist/util/mac/macosIconComposer.d.ts +11 -0
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -0
- package/dist/util/mac/macosIconComposer.js +99 -0
- package/dist/util/mac/macosIconComposer.js.map +1 -0
- package/dist/util/mac/macosVersion.d.ts +4 -0
- package/dist/util/mac/macosVersion.d.ts.map +1 -0
- package/dist/util/mac/macosVersion.js +31 -0
- package/dist/util/mac/macosVersion.js.map +1 -0
- package/dist/util/mac/plist.d.ts +8 -0
- package/dist/util/mac/plist.d.ts.map +1 -0
- package/dist/util/mac/plist.js +27 -0
- package/dist/util/mac/plist.js.map +1 -0
- package/dist/util/macroExpander.d.ts +4 -0
- package/dist/util/macroExpander.d.ts.map +1 -0
- package/dist/util/macroExpander.js +61 -0
- package/dist/util/macroExpander.js.map +1 -0
- package/dist/util/normalizePackageData.d.ts +2 -0
- package/dist/util/normalizePackageData.d.ts.map +1 -0
- package/dist/util/normalizePackageData.js +323 -0
- package/dist/util/normalizePackageData.js.map +1 -0
- package/dist/util/packageMetadata.d.ts +2 -0
- package/dist/util/packageMetadata.d.ts.map +1 -0
- package/dist/util/packageMetadata.js +118 -0
- package/dist/util/packageMetadata.js.map +1 -0
- package/dist/util/pathManager.d.ts +4 -0
- package/dist/util/pathManager.d.ts.map +1 -0
- package/dist/util/pathManager.js +17 -0
- package/dist/util/pathManager.js.map +1 -0
- package/dist/util/rebuild.d.ts +3 -0
- package/dist/util/rebuild.d.ts.map +1 -0
- package/dist/util/rebuild.js +54 -0
- package/dist/util/rebuild.js.map +1 -0
- package/dist/util/repositoryInfo.d.ts +4 -0
- package/dist/util/repositoryInfo.d.ts.map +1 -0
- package/dist/util/repositoryInfo.js +76 -0
- package/dist/util/repositoryInfo.js.map +1 -0
- package/dist/util/resolve.d.ts +3 -0
- package/dist/util/resolve.d.ts.map +1 -0
- package/dist/util/resolve.js +56 -0
- package/dist/util/resolve.js.map +1 -0
- package/dist/util/timer.d.ts +12 -0
- package/dist/util/timer.d.ts.map +1 -0
- package/dist/util/timer.js +23 -0
- package/dist/util/timer.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -0
- package/dist/util/toolsetLock.js +20 -0
- package/dist/util/toolsetLock.js.map +1 -0
- package/dist/util/win/resEdit.d.ts +11 -0
- package/dist/util/win/resEdit.d.ts.map +1 -0
- package/dist/util/win/resEdit.js +46 -0
- package/dist/util/win/resEdit.js.map +1 -0
- package/dist/util/yarn.d.ts +23 -0
- package/dist/util/yarn.d.ts.map +1 -0
- package/dist/util/yarn.js +153 -0
- package/dist/util/yarn.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +2 -0
- package/dist/version.js.map +1 -0
- package/dist/vm/MonoVm.d.ts +9 -0
- package/dist/vm/MonoVm.d.ts.map +1 -0
- package/dist/vm/MonoVm.js +16 -0
- package/dist/vm/MonoVm.js.map +1 -0
- package/dist/vm/ParallelsVm.d.ts +24 -0
- package/dist/vm/ParallelsVm.d.ts.map +1 -0
- package/dist/vm/ParallelsVm.js +107 -0
- package/dist/vm/ParallelsVm.js.map +1 -0
- package/dist/vm/PwshVm.d.ts +7 -0
- package/dist/vm/PwshVm.d.ts.map +1 -0
- package/dist/vm/PwshVm.js +21 -0
- package/dist/vm/PwshVm.js.map +1 -0
- package/dist/vm/WineVm.d.ts +14 -0
- package/dist/vm/WineVm.d.ts.map +1 -0
- package/dist/vm/WineVm.js +35 -0
- package/dist/vm/WineVm.js.map +1 -0
- package/dist/vm/vm.d.ts +15 -0
- package/dist/vm/vm.d.ts.map +1 -0
- package/dist/vm/vm.js +81 -0
- package/dist/vm/vm.js.map +1 -0
- package/dist/winPackager.d.ts +30 -0
- package/dist/winPackager.d.ts.map +1 -0
- package/dist/winPackager.js +270 -0
- package/dist/winPackager.js.map +1 -0
- package/helpers/package.json +6 -0
- package/helpers/remote-rebuild.js +2 -4
- package/package.json +30 -33
- package/scheme.json +379 -721
- package/out/Framework.d.ts +0 -36
- package/out/Framework.js +0 -7
- package/out/Framework.js.map +0 -1
- package/out/ProtonFramework.d.ts +0 -10
- package/out/ProtonFramework.js +0 -94
- package/out/ProtonFramework.js.map +0 -1
- package/out/appInfo.d.ts +0 -31
- package/out/appInfo.js +0 -152
- package/out/appInfo.js.map +0 -1
- package/out/asar/asar.d.ts +0 -38
- package/out/asar/asar.js +0 -163
- package/out/asar/asar.js.map +0 -1
- package/out/asar/asarFileChecker.d.ts +0 -2
- package/out/asar/asarFileChecker.js +0 -25
- package/out/asar/asarFileChecker.js.map +0 -1
- package/out/asar/asarUtil.d.ts +0 -1
- package/out/asar/asarUtil.js +0 -285
- package/out/asar/asarUtil.js.map +0 -1
- package/out/asar/integrity.d.ts +0 -15
- package/out/asar/integrity.js +0 -62
- package/out/asar/integrity.js.map +0 -1
- package/out/asar/unpackDetector.d.ts +0 -1
- package/out/asar/unpackDetector.js +0 -43
- package/out/asar/unpackDetector.js.map +0 -1
- package/out/binDownload.d.ts +0 -5
- package/out/binDownload.js +0 -104
- package/out/binDownload.js.map +0 -1
- package/out/codeSign/certInfo.d.ts +0 -54
- package/out/codeSign/certInfo.js +0 -466
- package/out/codeSign/certInfo.js.map +0 -1
- package/out/codeSign/codesign.d.ts +0 -3
- package/out/codeSign/codesign.js +0 -33
- package/out/codeSign/codesign.js.map +0 -1
- package/out/codeSign/macCodeSign.d.ts +0 -28
- package/out/codeSign/macCodeSign.js +0 -284
- package/out/codeSign/macCodeSign.js.map +0 -1
- package/out/codeSign/signManager.d.ts +0 -13
- package/out/codeSign/signManager.js +0 -3
- package/out/codeSign/signManager.js.map +0 -1
- package/out/codeSign/windowsCodeSign.d.ts +0 -7
- package/out/codeSign/windowsCodeSign.js +0 -38
- package/out/codeSign/windowsCodeSign.js.map +0 -1
- package/out/codeSign/windowsSignAzureManager.d.ts +0 -17
- package/out/codeSign/windowsSignAzureManager.js +0 -73
- package/out/codeSign/windowsSignAzureManager.js.map +0 -1
- package/out/codeSign/windowsSignToolManager.d.ts +0 -58
- package/out/codeSign/windowsSignToolManager.js +0 -376
- package/out/codeSign/windowsSignToolManager.js.map +0 -1
- package/out/configuration.d.ts +0 -532
- package/out/configuration.js +0 -3
- package/out/configuration.js.map +0 -1
- package/out/core.d.ts +0 -60
- package/out/core.js +0 -66
- package/out/core.js.map +0 -1
- package/out/electron/ElectronFramework.d.ts +0 -16
- package/out/electron/ElectronFramework.js +0 -242
- package/out/electron/ElectronFramework.js.map +0 -1
- package/out/electron/electronMac.d.ts +0 -1
- package/out/electron/electronMac.js +0 -262
- package/out/electron/electronMac.js.map +0 -1
- package/out/electron/electronVersion.d.ts +0 -6
- package/out/electron/electronVersion.js +0 -125
- package/out/electron/electronVersion.js.map +0 -1
- package/out/electron/electronWin.d.ts +0 -1
- package/out/electron/electronWin.js +0 -38
- package/out/electron/electronWin.js.map +0 -1
- package/out/electron/injectFFMPEG.d.ts +0 -11
- package/out/electron/injectFFMPEG.js +0 -57
- package/out/electron/injectFFMPEG.js.map +0 -1
- package/out/electron/search-module.d.ts +0 -23
- package/out/electron/search-module.js +0 -73
- package/out/electron/search-module.js.map +0 -1
- package/out/errorMessages.d.ts +0 -1
- package/out/errorMessages.js +0 -11
- package/out/errorMessages.js.map +0 -1
- package/out/fileMatcher.d.ts +0 -29
- package/out/fileMatcher.js +0 -292
- package/out/fileMatcher.js.map +0 -1
- package/out/fileTransformer.d.ts +0 -1
- package/out/fileTransformer.js +0 -107
- package/out/fileTransformer.js.map +0 -1
- package/out/forge-maker.d.ts +0 -5
- package/out/forge-maker.js +0 -23
- package/out/forge-maker.js.map +0 -1
- package/out/frameworks/LibUiFramework.d.ts +0 -47
- package/out/frameworks/LibUiFramework.js +0 -197
- package/out/frameworks/LibUiFramework.js.map +0 -1
- package/out/index.d.ts +0 -39
- package/out/index.js +0 -99
- package/out/index.js.map +0 -1
- package/out/linuxPackager.d.ts +0 -12
- package/out/linuxPackager.js +0 -77
- package/out/linuxPackager.js.map +0 -1
- package/out/mac/MacTargetHelper.d.ts +0 -29
- package/out/mac/MacTargetHelper.js +0 -273
- package/out/mac/MacTargetHelper.js.map +0 -1
- package/out/macPackager.d.ts +0 -49
- package/out/macPackager.js +0 -445
- package/out/macPackager.js.map +0 -1
- package/out/node-module-collector/bunNodeModulesCollector.d.ts +0 -10
- package/out/node-module-collector/bunNodeModulesCollector.js +0 -18
- package/out/node-module-collector/bunNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/hoist.d.ts +0 -123
- package/out/node-module-collector/hoist.js +0 -884
- package/out/node-module-collector/hoist.js.map +0 -1
- package/out/node-module-collector/index.d.ts +0 -18
- package/out/node-module-collector/index.js +0 -130
- package/out/node-module-collector/index.js.map +0 -1
- package/out/node-module-collector/moduleManager.d.ts +0 -93
- package/out/node-module-collector/moduleManager.js +0 -321
- package/out/node-module-collector/moduleManager.js.map +0 -1
- package/out/node-module-collector/nodeModulesCollector.d.ts +0 -137
- package/out/node-module-collector/nodeModulesCollector.js +0 -428
- package/out/node-module-collector/nodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/npmNodeModulesCollector.d.ts +0 -14
- package/out/node-module-collector/npmNodeModulesCollector.js +0 -80
- package/out/node-module-collector/npmNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/packageManager.d.ts +0 -17
- package/out/node-module-collector/packageManager.js +0 -144
- package/out/node-module-collector/packageManager.js.map +0 -1
- package/out/node-module-collector/pnpmNodeModulesCollector.d.ts +0 -44
- package/out/node-module-collector/pnpmNodeModulesCollector.js +0 -191
- package/out/node-module-collector/pnpmNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/traversalNodeModulesCollector.d.ts +0 -18
- package/out/node-module-collector/traversalNodeModulesCollector.js +0 -122
- package/out/node-module-collector/traversalNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/types.d.ts +0 -52
- package/out/node-module-collector/types.js +0 -3
- package/out/node-module-collector/yarnBerryNodeModulesCollector.d.ts +0 -15
- package/out/node-module-collector/yarnBerryNodeModulesCollector.js +0 -93
- package/out/node-module-collector/yarnBerryNodeModulesCollector.js.map +0 -1
- package/out/node-module-collector/yarnNodeModulesCollector.d.ts +0 -10
- package/out/node-module-collector/yarnNodeModulesCollector.js +0 -22
- package/out/node-module-collector/yarnNodeModulesCollector.js.map +0 -1
- package/out/options/AppXOptions.d.ts +0 -105
- package/out/options/AppXOptions.js +0 -3
- package/out/options/AppXOptions.js.map +0 -1
- package/out/options/CommonWindowsInstallerConfiguration.d.ts +0 -47
- package/out/options/CommonWindowsInstallerConfiguration.js +0 -51
- package/out/options/CommonWindowsInstallerConfiguration.js.map +0 -1
- package/out/options/FileAssociation.d.ts +0 -45
- package/out/options/FileAssociation.js +0 -3
- package/out/options/MsiOptions.d.ts +0 -26
- package/out/options/MsiOptions.js +0 -3
- package/out/options/MsiOptions.js.map +0 -1
- package/out/options/MsiWrappedOptions.d.ts +0 -26
- package/out/options/MsiWrappedOptions.js +0 -3
- package/out/options/MsiWrappedOptions.js.map +0 -1
- package/out/options/PlatformSpecificBuildOptions.d.ts +0 -238
- package/out/options/PlatformSpecificBuildOptions.js +0 -3
- package/out/options/PlatformSpecificBuildOptions.js.map +0 -1
- package/out/options/SnapOptions.d.ts +0 -500
- package/out/options/SnapOptions.js +0 -3
- package/out/options/SnapOptions.js.map +0 -1
- package/out/options/SquirrelWindowsOptions.d.ts +0 -46
- package/out/options/SquirrelWindowsOptions.js +0 -3
- package/out/options/SquirrelWindowsOptions.js.map +0 -1
- package/out/options/linuxOptions.d.ts +0 -287
- package/out/options/linuxOptions.js +0 -3
- package/out/options/linuxOptions.js.map +0 -1
- package/out/options/macOptions.d.ts +0 -388
- package/out/options/macOptions.js +0 -3
- package/out/options/macOptions.js.map +0 -1
- package/out/options/metadata.d.ts +0 -53
- package/out/options/metadata.js +0 -3
- package/out/options/metadata.js.map +0 -1
- package/out/options/pkgOptions.d.ts +0 -136
- package/out/options/pkgOptions.js +0 -3
- package/out/options/pkgOptions.js.map +0 -1
- package/out/options/winOptions.d.ts +0 -164
- package/out/options/winOptions.js +0 -3
- package/out/options/winOptions.js.map +0 -1
- package/out/packager.d.ts +0 -99
- package/out/packager.js +0 -515
- package/out/packager.js.map +0 -1
- package/out/packagerApi.d.ts +0 -31
- package/out/packagerApi.js +0 -3
- package/out/packagerApi.js.map +0 -1
- package/out/platformPackager.d.ts +0 -101
- package/out/platformPackager.js +0 -714
- package/out/platformPackager.js.map +0 -1
- package/out/presets/rectCra.d.ts +0 -1
- package/out/presets/rectCra.js +0 -22
- package/out/presets/rectCra.js.map +0 -1
- package/out/publish/PublishManager.d.ts +0 -30
- package/out/publish/PublishManager.js +0 -497
- package/out/publish/PublishManager.js.map +0 -1
- package/out/publish/updateInfoBuilder.d.ts +0 -14
- package/out/publish/updateInfoBuilder.js +0 -226
- package/out/publish/updateInfoBuilder.js.map +0 -1
- package/out/targets/AppxCapabilities.d.ts +0 -8
- package/out/targets/AppxCapabilities.js +0 -258
- package/out/targets/AppxCapabilities.js.map +0 -1
- package/out/targets/AppxTarget.d.ts +0 -17
- package/out/targets/AppxTarget.js +0 -403
- package/out/targets/AppxTarget.js.map +0 -1
- package/out/targets/ArchiveTarget.d.ts +0 -11
- package/out/targets/ArchiveTarget.js +0 -88
- package/out/targets/ArchiveTarget.js.map +0 -1
- package/out/targets/FlatpakTarget.d.ts +0 -20
- package/out/targets/FlatpakTarget.js +0 -159
- package/out/targets/FlatpakTarget.js.map +0 -1
- package/out/targets/FpmTarget.d.ts +0 -22
- package/out/targets/FpmTarget.js +0 -372
- package/out/targets/FpmTarget.js.map +0 -1
- package/out/targets/LinuxTargetHelper.d.ts +0 -23
- package/out/targets/LinuxTargetHelper.js +0 -346
- package/out/targets/LinuxTargetHelper.js.map +0 -1
- package/out/targets/MsiTarget.d.ts +0 -28
- package/out/targets/MsiTarget.js +0 -268
- package/out/targets/MsiTarget.js.map +0 -1
- package/out/targets/MsiWrappedTarget.d.ts +0 -19
- package/out/targets/MsiWrappedTarget.js +0 -80
- package/out/targets/MsiWrappedTarget.js.map +0 -1
- package/out/targets/appimage/AppImageTarget.d.ts +0 -15
- package/out/targets/appimage/AppImageTarget.js +0 -147
- package/out/targets/appimage/AppImageTarget.js.map +0 -1
- package/out/targets/appimage/appImageUtil.d.ts +0 -56
- package/out/targets/appimage/appImageUtil.js +0 -323
- package/out/targets/appimage/appImageUtil.js.map +0 -1
- package/out/targets/appimage/appLauncher.d.ts +0 -3
- package/out/targets/appimage/appLauncher.js +0 -95
- package/out/targets/appimage/appLauncher.js.map +0 -1
- package/out/targets/archive.d.ts +0 -26
- package/out/targets/archive.js +0 -178
- package/out/targets/archive.js.map +0 -1
- package/out/targets/blockmap/blockmap.d.ts +0 -16
- package/out/targets/blockmap/blockmap.js +0 -153
- package/out/targets/blockmap/blockmap.js.map +0 -1
- package/out/targets/differentialUpdateInfoBuilder.d.ts +0 -15
- package/out/targets/differentialUpdateInfoBuilder.js +0 -80
- package/out/targets/differentialUpdateInfoBuilder.js.map +0 -1
- package/out/targets/nsis/Commands.d.ts +0 -9
- package/out/targets/nsis/Commands.js +0 -3
- package/out/targets/nsis/Commands.js.map +0 -1
- package/out/targets/nsis/Defines.d.ts +0 -80
- package/out/targets/nsis/Defines.js +0 -3
- package/out/targets/nsis/Defines.js.map +0 -1
- package/out/targets/nsis/NsisTarget.d.ts +0 -37
- package/out/targets/nsis/NsisTarget.js +0 -729
- package/out/targets/nsis/NsisTarget.js.map +0 -1
- package/out/targets/nsis/WebInstallerTarget.d.ts +0 -13
- package/out/targets/nsis/WebInstallerTarget.js +0 -47
- package/out/targets/nsis/WebInstallerTarget.js.map +0 -1
- package/out/targets/nsis/nsisLang.d.ts +0 -10
- package/out/targets/nsis/nsisLang.js +0 -100
- package/out/targets/nsis/nsisLang.js.map +0 -1
- package/out/targets/nsis/nsisLicense.d.ts +0 -4
- package/out/targets/nsis/nsisLicense.js +0 -77
- package/out/targets/nsis/nsisLicense.js.map +0 -1
- package/out/targets/nsis/nsisOptions.d.ts +0 -274
- package/out/targets/nsis/nsisOptions.js +0 -3
- package/out/targets/nsis/nsisOptions.js.map +0 -1
- package/out/targets/nsis/nsisScriptGenerator.d.ts +0 -12
- package/out/targets/nsis/nsisScriptGenerator.js +0 -64
- package/out/targets/nsis/nsisScriptGenerator.js.map +0 -1
- package/out/targets/nsis/nsisUtil.d.ts +0 -25
- package/out/targets/nsis/nsisUtil.js +0 -225
- package/out/targets/nsis/nsisUtil.js.map +0 -1
- package/out/targets/nsis/nsisValidation.d.ts +0 -18
- package/out/targets/nsis/nsisValidation.js +0 -53
- package/out/targets/nsis/nsisValidation.js.map +0 -1
- package/out/targets/pkg.d.ts +0 -30
- package/out/targets/pkg.js +0 -279
- package/out/targets/pkg.js.map +0 -1
- package/out/targets/snap/SnapTarget.d.ts +0 -36
- package/out/targets/snap/SnapTarget.js +0 -105
- package/out/targets/snap/SnapTarget.js.map +0 -1
- package/out/targets/snap/core24.d.ts +0 -52
- package/out/targets/snap/core24.js +0 -449
- package/out/targets/snap/core24.js.map +0 -1
- package/out/targets/snap/coreCustom.d.ts +0 -28
- package/out/targets/snap/coreCustom.js +0 -63
- package/out/targets/snap/coreCustom.js.map +0 -1
- package/out/targets/snap/coreLegacy.d.ts +0 -43
- package/out/targets/snap/coreLegacy.js +0 -416
- package/out/targets/snap/coreLegacy.js.map +0 -1
- package/out/targets/snap/snapcraftBuilder.d.ts +0 -39
- package/out/targets/snap/snapcraftBuilder.js +0 -419
- package/out/targets/snap/snapcraftBuilder.js.map +0 -1
- package/out/targets/targetFactory.d.ts +0 -12
- package/out/targets/targetFactory.js +0 -101
- package/out/targets/targetFactory.js.map +0 -1
- package/out/targets/targetUtil.d.ts +0 -14
- package/out/targets/targetUtil.js +0 -47
- package/out/targets/targetUtil.js.map +0 -1
- package/out/toolsets/7zip.d.ts +0 -2
- package/out/toolsets/7zip.js +0 -72
- package/out/toolsets/7zip.js.map +0 -1
- package/out/toolsets/icons.d.ts +0 -8
- package/out/toolsets/icons.js +0 -37
- package/out/toolsets/icons.js.map +0 -1
- package/out/toolsets/linux.d.ts +0 -26
- package/out/toolsets/linux.js +0 -146
- package/out/toolsets/linux.js.map +0 -1
- package/out/toolsets/windows.d.ts +0 -61
- package/out/toolsets/windows.js +0 -259
- package/out/toolsets/windows.js.map +0 -1
- package/out/toolsets/wine.d.ts +0 -5
- package/out/toolsets/wine.js +0 -100
- package/out/toolsets/wine.js.map +0 -1
- package/out/util/AppFileWalker.d.ts +0 -13
- package/out/util/AppFileWalker.js +0 -74
- package/out/util/AppFileWalker.js.map +0 -1
- package/out/util/NodeModuleCopyHelper.d.ts +0 -1
- package/out/util/NodeModuleCopyHelper.js +0 -165
- package/out/util/NodeModuleCopyHelper.js.map +0 -1
- package/out/util/appFileCopier.d.ts +0 -16
- package/out/util/appFileCopier.js +0 -251
- package/out/util/appFileCopier.js.map +0 -1
- package/out/util/asyncEventEmitter.d.ts +0 -33
- package/out/util/asyncEventEmitter.js +0 -63
- package/out/util/asyncEventEmitter.js.map +0 -1
- package/out/util/bundledTool.d.ts +0 -7
- package/out/util/bundledTool.js +0 -20
- package/out/util/bundledTool.js.map +0 -1
- package/out/util/cacheManager.d.ts +0 -18
- package/out/util/cacheManager.js +0 -70
- package/out/util/cacheManager.js.map +0 -1
- package/out/util/cacheState.d.ts +0 -28
- package/out/util/cacheState.js +0 -143
- package/out/util/cacheState.js.map +0 -1
- package/out/util/config/config.d.ts +0 -12
- package/out/util/config/config.js +0 -256
- package/out/util/config/config.js.map +0 -1
- package/out/util/config/load.d.ts +0 -19
- package/out/util/config/load.js +0 -129
- package/out/util/config/load.js.map +0 -1
- package/out/util/config/schemaValidator.d.ts +0 -7
- package/out/util/config/schemaValidator.js +0 -154
- package/out/util/config/schemaValidator.js.map +0 -1
- package/out/util/dynamicImport.d.ts +0 -1
- package/out/util/dynamicImport.js +0 -12
- package/out/util/dynamicImport.js.map +0 -1
- package/out/util/electronGet.d.ts +0 -61
- package/out/util/electronGet.js +0 -464
- package/out/util/electronGet.js.map +0 -1
- package/out/util/envPath.d.ts +0 -2
- package/out/util/envPath.js +0 -28
- package/out/util/envPath.js.map +0 -1
- package/out/util/filter.d.ts +0 -1
- package/out/util/filter.js +0 -68
- package/out/util/filter.js.map +0 -1
- package/out/util/flags.d.ts +0 -3
- package/out/util/flags.js +0 -16
- package/out/util/flags.js.map +0 -1
- package/out/util/hash.d.ts +0 -1
- package/out/util/hash.js +0 -19
- package/out/util/hash.js.map +0 -1
- package/out/util/iconConverter.d.ts +0 -25
- package/out/util/iconConverter.js +0 -260
- package/out/util/iconConverter.js.map +0 -1
- package/out/util/langs.d.ts +0 -189
- package/out/util/langs.js +0 -436
- package/out/util/langs.js.map +0 -1
- package/out/util/license.d.ts +0 -16
- package/out/util/license.js +0 -47
- package/out/util/license.js.map +0 -1
- package/out/util/macosIconComposer.d.ts +0 -10
- package/out/util/macosIconComposer.js +0 -102
- package/out/util/macosIconComposer.js.map +0 -1
- package/out/util/macosVersion.d.ts +0 -3
- package/out/util/macosVersion.js +0 -36
- package/out/util/macosVersion.js.map +0 -1
- package/out/util/macroExpander.d.ts +0 -3
- package/out/util/macroExpander.js +0 -64
- package/out/util/macroExpander.js.map +0 -1
- package/out/util/normalizePackageData.d.ts +0 -1
- package/out/util/normalizePackageData.js +0 -328
- package/out/util/normalizePackageData.js.map +0 -1
- package/out/util/packageDependencies.d.ts +0 -6
- package/out/util/packageDependencies.js +0 -3
- package/out/util/packageDependencies.js.map +0 -1
- package/out/util/packageMetadata.d.ts +0 -1
- package/out/util/packageMetadata.js +0 -124
- package/out/util/packageMetadata.js.map +0 -1
- package/out/util/pathManager.d.ts +0 -3
- package/out/util/pathManager.js +0 -23
- package/out/util/pathManager.js.map +0 -1
- package/out/util/plist.d.ts +0 -7
- package/out/util/plist.js +0 -31
- package/out/util/plist.js.map +0 -1
- package/out/util/rebuild.d.ts +0 -2
- package/out/util/rebuild.js +0 -60
- package/out/util/rebuild.js.map +0 -1
- package/out/util/repositoryInfo.d.ts +0 -3
- package/out/util/repositoryInfo.js +0 -79
- package/out/util/repositoryInfo.js.map +0 -1
- package/out/util/resEdit.d.ts +0 -10
- package/out/util/resEdit.js +0 -49
- package/out/util/resEdit.js.map +0 -1
- package/out/util/resolve.d.ts +0 -2
- package/out/util/resolve.js +0 -59
- package/out/util/resolve.js.map +0 -1
- package/out/util/timer.d.ts +0 -11
- package/out/util/timer.js +0 -28
- package/out/util/timer.js.map +0 -1
- package/out/util/toolsetLock.d.ts +0 -1
- package/out/util/toolsetLock.js +0 -23
- package/out/util/toolsetLock.js.map +0 -1
- package/out/util/yarn.d.ts +0 -22
- package/out/util/yarn.js +0 -160
- package/out/util/yarn.js.map +0 -1
- package/out/version.d.ts +0 -1
- package/out/version.js +0 -5
- package/out/version.js.map +0 -1
- package/out/vm/MonoVm.d.ts +0 -8
- package/out/vm/MonoVm.js +0 -20
- package/out/vm/MonoVm.js.map +0 -1
- package/out/vm/ParallelsVm.d.ts +0 -23
- package/out/vm/ParallelsVm.js +0 -102
- package/out/vm/ParallelsVm.js.map +0 -1
- package/out/vm/PwshVm.d.ts +0 -6
- package/out/vm/PwshVm.js +0 -25
- package/out/vm/PwshVm.js.map +0 -1
- package/out/vm/WineVm.d.ts +0 -12
- package/out/vm/WineVm.js +0 -38
- package/out/vm/WineVm.js.map +0 -1
- package/out/vm/vm.d.ts +0 -14
- package/out/vm/vm.js +0 -88
- package/out/vm/vm.js.map +0 -1
- package/out/winPackager.d.ts +0 -29
- package/out/winPackager.js +0 -271
- package/out/winPackager.js.map +0 -1
- /package/{out → dist}/node-module-collector/types.js.map +0 -0
- /package/{out → dist}/options/FileAssociation.js.map +0 -0
- /package/helpers/{dynamic-import.js → dynamic-import.cjs} +0 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { InvalidConfigurationError, log, safeStringifyJson, statOrNull } from "builder-util";
|
|
3
|
+
const _requireResolve = createRequire(import.meta.url).resolve;
|
|
4
|
+
import { deepAssign } from "builder-util-runtime";
|
|
5
|
+
import { Lazy } from "lazy-val";
|
|
6
|
+
import * as path from "path";
|
|
7
|
+
import { reactCra } from "../../presets/rectCra.js";
|
|
8
|
+
import { PACKAGE_VERSION } from "../../version.js";
|
|
9
|
+
import { getConfig as _getConfig, loadParentConfig, orNullIfFileNotExist } from "./load.js";
|
|
10
|
+
import { validateSchema } from "./schemaValidator.js";
|
|
11
|
+
import _fsExtra from "fs-extra";
|
|
12
|
+
const { readJson } = _fsExtra;
|
|
13
|
+
// https://github.com/electron-userland/electron-builder/issues/1847
|
|
14
|
+
function mergePublish(config, configFromOptions) {
|
|
15
|
+
// if config from disk doesn't have publish (or object), no need to handle, it will be simply merged by deepAssign
|
|
16
|
+
const publish = Array.isArray(config.publish) ? configFromOptions.publish : null;
|
|
17
|
+
if (publish != null) {
|
|
18
|
+
delete configFromOptions.publish;
|
|
19
|
+
}
|
|
20
|
+
deepAssign(config, configFromOptions);
|
|
21
|
+
if (publish == null) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const listOnDisk = config.publish;
|
|
25
|
+
if (listOnDisk.length === 0) {
|
|
26
|
+
config.publish = publish;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// apply to first
|
|
30
|
+
deepAssign(listOnDisk[0], publish);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export async function getConfig(projectDir, configPath, configFromOptions, packageMetadata = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, "package.json"))))) {
|
|
34
|
+
const configRequest = { packageKey: "build", configFilename: "electron-builder", projectDir, packageMetadata };
|
|
35
|
+
const configAndEffectiveFile = await _getConfig(configRequest, configPath);
|
|
36
|
+
const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result;
|
|
37
|
+
if (configFromOptions != null) {
|
|
38
|
+
mergePublish(config, configFromOptions);
|
|
39
|
+
}
|
|
40
|
+
if (configAndEffectiveFile != null) {
|
|
41
|
+
log.info({ file: configAndEffectiveFile.configFile == null ? 'package.json ("build" field)' : configAndEffectiveFile.configFile }, "loaded configuration");
|
|
42
|
+
}
|
|
43
|
+
if (config.extends == null && config.extends !== null) {
|
|
44
|
+
const metadata = (await packageMetadata.value) || {};
|
|
45
|
+
const devDependencies = metadata.devDependencies;
|
|
46
|
+
const dependencies = metadata.dependencies;
|
|
47
|
+
if ((dependencies != null && "react-scripts" in dependencies) || (devDependencies != null && "react-scripts" in devDependencies)) {
|
|
48
|
+
config.extends = "react-cra";
|
|
49
|
+
}
|
|
50
|
+
else if (devDependencies != null && "electron-webpack" in devDependencies) {
|
|
51
|
+
let file = "electron-webpack/out/electron-builder.js";
|
|
52
|
+
try {
|
|
53
|
+
file = _requireResolve(file);
|
|
54
|
+
}
|
|
55
|
+
catch (_ignore) {
|
|
56
|
+
file = _requireResolve("electron-webpack/electron-builder.yml");
|
|
57
|
+
}
|
|
58
|
+
config.extends = `file:${file}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const parentConfigs = await loadParentConfigsRecursively(config.extends, async (configExtend) => {
|
|
62
|
+
if (configExtend === "react-cra") {
|
|
63
|
+
const result = await reactCra(projectDir);
|
|
64
|
+
log.info({ preset: configExtend }, "loaded parent configuration");
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const { configFile, result } = await loadParentConfig(configRequest, configExtend);
|
|
69
|
+
log.info({ file: configFile }, "loaded parent configuration");
|
|
70
|
+
return result;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return doMergeConfigs([...parentConfigs, config]);
|
|
74
|
+
}
|
|
75
|
+
function asArray(value) {
|
|
76
|
+
return Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
|
|
77
|
+
}
|
|
78
|
+
async function loadParentConfigsRecursively(configExtends, loader) {
|
|
79
|
+
const configs = [];
|
|
80
|
+
for (const configExtend of asArray(configExtends)) {
|
|
81
|
+
const result = await loader(configExtend);
|
|
82
|
+
const parentConfigs = await loadParentConfigsRecursively(result.extends, loader);
|
|
83
|
+
configs.push(...parentConfigs, result);
|
|
84
|
+
}
|
|
85
|
+
return configs;
|
|
86
|
+
}
|
|
87
|
+
// normalize for easy merge
|
|
88
|
+
function normalizeFiles(configuration, name) {
|
|
89
|
+
let value = configuration[name];
|
|
90
|
+
if (value == null) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!Array.isArray(value)) {
|
|
94
|
+
value = [value];
|
|
95
|
+
}
|
|
96
|
+
itemLoop: for (let i = 0; i < value.length; i++) {
|
|
97
|
+
let item = value[i];
|
|
98
|
+
if (typeof item === "string") {
|
|
99
|
+
// merge with previous if possible
|
|
100
|
+
if (i !== 0) {
|
|
101
|
+
let prevItemIndex = i - 1;
|
|
102
|
+
let prevItem;
|
|
103
|
+
do {
|
|
104
|
+
prevItem = value[prevItemIndex--];
|
|
105
|
+
} while (prevItem == null);
|
|
106
|
+
if (prevItem.from == null && prevItem.to == null) {
|
|
107
|
+
if (prevItem.filter == null) {
|
|
108
|
+
prevItem.filter = [item];
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
;
|
|
112
|
+
prevItem.filter.push(item);
|
|
113
|
+
}
|
|
114
|
+
value[i] = null;
|
|
115
|
+
continue itemLoop;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
item = {
|
|
119
|
+
filter: [item],
|
|
120
|
+
};
|
|
121
|
+
value[i] = item;
|
|
122
|
+
}
|
|
123
|
+
else if (Array.isArray(item)) {
|
|
124
|
+
throw new Error(`${name} configuration is invalid, nested array not expected for index ${i}: ${item}`);
|
|
125
|
+
}
|
|
126
|
+
// make sure that merge logic is not complex - unify different presentations
|
|
127
|
+
if (item.from === ".") {
|
|
128
|
+
item.from = undefined;
|
|
129
|
+
}
|
|
130
|
+
if (item.to === ".") {
|
|
131
|
+
item.to = undefined;
|
|
132
|
+
}
|
|
133
|
+
if (item.filter != null && typeof item.filter === "string") {
|
|
134
|
+
item.filter = [item.filter];
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
configuration[name] = value.filter(it => it != null);
|
|
138
|
+
}
|
|
139
|
+
function isSimilarFileSet(value, other) {
|
|
140
|
+
return value.from === other.from && value.to === other.to;
|
|
141
|
+
}
|
|
142
|
+
function mergeFilters(value, other) {
|
|
143
|
+
return asArray(value).concat(asArray(other));
|
|
144
|
+
}
|
|
145
|
+
function mergeFileSets(lists) {
|
|
146
|
+
const result = [];
|
|
147
|
+
for (const list of lists) {
|
|
148
|
+
for (const item of list) {
|
|
149
|
+
const existingItem = result.find(i => isSimilarFileSet(i, item));
|
|
150
|
+
if (existingItem) {
|
|
151
|
+
existingItem.filter = mergeFilters(item.filter, existingItem.filter);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
result.push(item);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* `doMergeConfigs` takes configs in the order you would pass them to
|
|
162
|
+
* Object.assign as sources.
|
|
163
|
+
*/
|
|
164
|
+
export function doMergeConfigs(configs) {
|
|
165
|
+
for (const config of configs) {
|
|
166
|
+
normalizeFiles(config, "files");
|
|
167
|
+
normalizeFiles(config, "extraFiles");
|
|
168
|
+
normalizeFiles(config, "extraResources");
|
|
169
|
+
}
|
|
170
|
+
const result = deepAssign(getDefaultConfig(), ...configs);
|
|
171
|
+
// `deepAssign` prioritises latter configs, while `mergeFilesSets` prioritises
|
|
172
|
+
// former configs, so we have to reverse the order, because latter configs
|
|
173
|
+
// must have higher priority.
|
|
174
|
+
configs = configs.slice().reverse();
|
|
175
|
+
result.files = mergeFileSets(configs.map(config => (config.files ?? [])));
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
function getDefaultConfig() {
|
|
179
|
+
return {
|
|
180
|
+
directories: {
|
|
181
|
+
output: "dist",
|
|
182
|
+
buildResources: "build",
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const schemeDataPromise = new Lazy(() => readJson(path.join(import.meta.dirname, "..", "..", "..", "scheme.json")));
|
|
187
|
+
export async function validateConfiguration(config, debugLogger) {
|
|
188
|
+
validateSchema(await schemeDataPromise.value, config, {
|
|
189
|
+
name: `electron-builder ${PACKAGE_VERSION}`,
|
|
190
|
+
postFormatter: (formattedError, error) => {
|
|
191
|
+
if (debugLogger.isEnabled) {
|
|
192
|
+
debugLogger.add("invalidConfig", safeStringifyJson(error));
|
|
193
|
+
}
|
|
194
|
+
const site = "https://www.electron.build";
|
|
195
|
+
let url = `${site}/configuration`;
|
|
196
|
+
const targets = new Set(["mac", "dmg", "pkg", "mas", "win", "nsis", "appx", "linux", "appimage", "snap"]);
|
|
197
|
+
const firstSegment = (error.instancePath ?? "").split("/").filter(Boolean)[0]?.toLowerCase();
|
|
198
|
+
if (firstSegment != null && targets.has(firstSegment)) {
|
|
199
|
+
url = `${site}/${firstSegment}`;
|
|
200
|
+
}
|
|
201
|
+
return `${formattedError}\n How to fix:
|
|
202
|
+
1. Open ${url}
|
|
203
|
+
2. Search the option name on the page (or type in into Search to find across the docs).
|
|
204
|
+
* Not found? The option was deprecated or not exists (check spelling).
|
|
205
|
+
* Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
|
|
206
|
+
`;
|
|
207
|
+
},
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const DEFAULT_APP_DIR_NAMES = ["app", "www"];
|
|
211
|
+
export async function computeDefaultAppDirectory(projectDir, userAppDir) {
|
|
212
|
+
if (userAppDir != null) {
|
|
213
|
+
const absolutePath = path.resolve(projectDir, userAppDir);
|
|
214
|
+
const stat = await statOrNull(absolutePath);
|
|
215
|
+
if (stat == null) {
|
|
216
|
+
throw new InvalidConfigurationError(`Application directory ${userAppDir} doesn't exist`);
|
|
217
|
+
}
|
|
218
|
+
else if (!stat.isDirectory()) {
|
|
219
|
+
throw new InvalidConfigurationError(`Application directory ${userAppDir} is not a directory`);
|
|
220
|
+
}
|
|
221
|
+
else if (projectDir === absolutePath) {
|
|
222
|
+
log.warn({ appDirectory: userAppDir }, `Specified application directory equals to project dir — superfluous or wrong configuration`);
|
|
223
|
+
}
|
|
224
|
+
return absolutePath;
|
|
225
|
+
}
|
|
226
|
+
for (const dir of DEFAULT_APP_DIR_NAMES) {
|
|
227
|
+
const absolutePath = path.join(projectDir, dir);
|
|
228
|
+
const packageJson = path.join(absolutePath, "package.json");
|
|
229
|
+
const stat = await statOrNull(packageJson);
|
|
230
|
+
if (stat != null && stat.isFile()) {
|
|
231
|
+
return absolutePath;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return projectDir;
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AAM,IAAI,yBAAyB,CAAC,yBAAyB,UAAU,qBAAqB,CAAC,CAAA;QAC/F,CAAC;aAAM,IAAI,UAAU,KAAK,YAAY,EAAE,CAAC;YACvC,GAAG,CAAC,IAAI,CAAC,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,4FAA4F,CAAC,CAAA;QACtI,CAAC;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACxC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,CAAA;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,cAAc,CAAC,CAAA;QAC3D,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,WAAW,CAAC,CAAA;QAC1C,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;YAClC,OAAO,YAAY,CAAA;QACrB,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAA;AACnB,CAAC","sourcesContent":["import { createRequire } from \"node:module\"\nimport { DebugLogger, InvalidConfigurationError, log, safeStringifyJson, statOrNull } from \"builder-util\"\n\nconst _requireResolve = createRequire(import.meta.url).resolve\nimport { deepAssign, Nullish } from \"builder-util-runtime\"\n\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Configuration } from \"../../configuration.js\"\nimport { FileSet } from \"../../options/PlatformSpecificBuildOptions.js\"\nimport { reactCra } from \"../../presets/rectCra.js\"\nimport { PACKAGE_VERSION } from \"../../version.js\"\nimport { getConfig as _getConfig, loadParentConfig, orNullIfFileNotExist, ReadConfigRequest } from \"./load.js\"\nimport { validateSchema } from \"./schemaValidator.js\"\nimport _fsExtra from \"fs-extra\"\nconst { readJson } = _fsExtra\n\n// https://github.com/electron-userland/electron-builder/issues/1847\nfunction mergePublish(config: Configuration, configFromOptions: Configuration) {\n // if config from disk doesn't have publish (or object), no need to handle, it will be simply merged by deepAssign\n const publish = Array.isArray(config.publish) ? configFromOptions.publish : null\n if (publish != null) {\n delete (configFromOptions as any).publish\n }\n\n deepAssign(config, configFromOptions)\n\n if (publish == null) {\n return\n }\n\n const listOnDisk = config.publish as Array<any>\n if (listOnDisk.length === 0) {\n config.publish = publish\n } else {\n // apply to first\n deepAssign(listOnDisk[0], publish)\n }\n}\n\nexport async function getConfig(\n projectDir: string,\n configPath: string | null,\n configFromOptions: Configuration | Nullish,\n packageMetadata: Lazy<Record<string, any> | null> = new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))\n): Promise<Configuration> {\n const configRequest: ReadConfigRequest = { packageKey: \"build\", configFilename: \"electron-builder\", projectDir, packageMetadata }\n const configAndEffectiveFile = await _getConfig<Configuration>(configRequest, configPath)\n const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result\n if (configFromOptions != null) {\n mergePublish(config, configFromOptions)\n }\n\n if (configAndEffectiveFile != null) {\n log.info({ file: configAndEffectiveFile.configFile == null ? 'package.json (\"build\" field)' : configAndEffectiveFile.configFile }, \"loaded configuration\")\n }\n\n if (config.extends == null && config.extends !== null) {\n const metadata = (await packageMetadata.value) || {}\n const devDependencies = metadata.devDependencies\n const dependencies = metadata.dependencies\n if ((dependencies != null && \"react-scripts\" in dependencies) || (devDependencies != null && \"react-scripts\" in devDependencies)) {\n config.extends = \"react-cra\"\n } else if (devDependencies != null && \"electron-webpack\" in devDependencies) {\n let file = \"electron-webpack/out/electron-builder.js\"\n try {\n file = _requireResolve(file)\n } catch (_ignore) {\n file = _requireResolve(\"electron-webpack/electron-builder.yml\")\n }\n config.extends = `file:${file}`\n }\n }\n\n const parentConfigs = await loadParentConfigsRecursively(config.extends, async configExtend => {\n if (configExtend === \"react-cra\") {\n const result = await reactCra(projectDir)\n log.info({ preset: configExtend }, \"loaded parent configuration\")\n return result\n } else {\n const { configFile, result } = await loadParentConfig<Configuration>(configRequest, configExtend)\n log.info({ file: configFile }, \"loaded parent configuration\")\n return result\n }\n })\n\n return doMergeConfigs([...parentConfigs, config])\n}\n\nfunction asArray(value: string[] | string | Nullish): string[] {\n return Array.isArray(value) ? value : typeof value === \"string\" ? [value] : []\n}\n\nasync function loadParentConfigsRecursively(configExtends: Configuration[\"extends\"], loader: (configExtend: string) => Promise<Configuration>): Promise<Configuration[]> {\n const configs = []\n\n for (const configExtend of asArray(configExtends)) {\n const result = await loader(configExtend)\n const parentConfigs = await loadParentConfigsRecursively(result.extends, loader)\n configs.push(...parentConfigs, result)\n }\n\n return configs\n}\n\n// normalize for easy merge\nfunction normalizeFiles(configuration: Configuration, name: \"files\" | \"extraFiles\" | \"extraResources\") {\n let value = configuration[name]\n if (value == null) {\n return\n }\n\n if (!Array.isArray(value)) {\n value = [value]\n }\n\n itemLoop: for (let i = 0; i < value.length; i++) {\n let item = value[i]\n if (typeof item === \"string\") {\n // merge with previous if possible\n if (i !== 0) {\n let prevItemIndex = i - 1\n let prevItem: FileSet\n do {\n prevItem = value[prevItemIndex--] as FileSet\n } while (prevItem == null)\n\n if (prevItem.from == null && prevItem.to == null) {\n if (prevItem.filter == null) {\n prevItem.filter = [item]\n } else {\n ;(prevItem.filter as Array<string>).push(item)\n }\n value[i] = null as any\n continue itemLoop\n }\n }\n\n item = {\n filter: [item],\n }\n value[i] = item\n } else if (Array.isArray(item)) {\n throw new Error(`${name} configuration is invalid, nested array not expected for index ${i}: ${item}`)\n }\n\n // make sure that merge logic is not complex - unify different presentations\n if (item.from === \".\") {\n item.from = undefined\n }\n\n if (item.to === \".\") {\n item.to = undefined\n }\n\n if (item.filter != null && typeof item.filter === \"string\") {\n item.filter = [item.filter]\n }\n }\n\n configuration[name] = value.filter(it => it != null)\n}\n\nfunction isSimilarFileSet(value: FileSet, other: FileSet): boolean {\n return value.from === other.from && value.to === other.to\n}\n\ntype Filter = FileSet[\"filter\"]\n\nfunction mergeFilters(value: Filter, other: Filter): string[] {\n return asArray(value).concat(asArray(other))\n}\n\nfunction mergeFileSets(lists: FileSet[][]): FileSet[] {\n const result: FileSet[] = []\n\n for (const list of lists) {\n for (const item of list) {\n const existingItem = result.find(i => isSimilarFileSet(i, item))\n if (existingItem) {\n existingItem.filter = mergeFilters(item.filter, existingItem.filter)\n } else {\n result.push(item)\n }\n }\n }\n\n return result\n}\n\n/**\n * `doMergeConfigs` takes configs in the order you would pass them to\n * Object.assign as sources.\n */\nexport function doMergeConfigs(configs: Configuration[]): Configuration {\n for (const config of configs) {\n normalizeFiles(config, \"files\")\n normalizeFiles(config, \"extraFiles\")\n normalizeFiles(config, \"extraResources\")\n }\n\n const result = deepAssign(getDefaultConfig(), ...configs)\n\n // `deepAssign` prioritises latter configs, while `mergeFilesSets` prioritises\n // former configs, so we have to reverse the order, because latter configs\n // must have higher priority.\n configs = configs.slice().reverse()\n\n result.files = mergeFileSets(configs.map(config => (config.files ?? []) as FileSet[]))\n return result\n}\n\nfunction getDefaultConfig(): Configuration {\n return {\n directories: {\n output: \"dist\",\n buildResources: \"build\",\n },\n }\n}\n\nconst schemeDataPromise = new Lazy(() => readJson(path.join(import.meta.dirname, \"..\", \"..\", \"..\", \"scheme.json\")))\n\nexport async function validateConfiguration(config: Configuration, debugLogger: DebugLogger) {\n validateSchema(await schemeDataPromise.value, config, {\n name: `electron-builder ${PACKAGE_VERSION}`,\n postFormatter: (formattedError, error): string => {\n if (debugLogger.isEnabled) {\n debugLogger.add(\"invalidConfig\", safeStringifyJson(error))\n }\n\n const site = \"https://www.electron.build\"\n let url = `${site}/configuration`\n const targets = new Set([\"mac\", \"dmg\", \"pkg\", \"mas\", \"win\", \"nsis\", \"appx\", \"linux\", \"appimage\", \"snap\"])\n const firstSegment = (error.instancePath ?? \"\").split(\"/\").filter(Boolean)[0]?.toLowerCase()\n if (firstSegment != null && targets.has(firstSegment)) {\n url = `${site}/${firstSegment}`\n }\n\n return `${formattedError}\\n How to fix:\n 1. Open ${url}\n 2. Search the option name on the page (or type in into Search to find across the docs).\n * Not found? The option was deprecated or not exists (check spelling).\n * Found? Check that the option in the appropriate place. e.g. \"title\" only in the \"dmg\", not in the root.\n`\n },\n })\n}\n\nconst DEFAULT_APP_DIR_NAMES = [\"app\", \"www\"]\n\nexport async function computeDefaultAppDirectory(projectDir: string, userAppDir: string | Nullish): Promise<string> {\n if (userAppDir != null) {\n const absolutePath = path.resolve(projectDir, userAppDir)\n const stat = await statOrNull(absolutePath)\n if (stat == null) {\n throw new InvalidConfigurationError(`Application directory ${userAppDir} doesn't exist`)\n } else if (!stat.isDirectory()) {\n throw new InvalidConfigurationError(`Application directory ${userAppDir} is not a directory`)\n } else if (projectDir === absolutePath) {\n log.warn({ appDirectory: userAppDir }, `Specified application directory equals to project dir — superfluous or wrong configuration`)\n }\n return absolutePath\n }\n\n for (const dir of DEFAULT_APP_DIR_NAMES) {\n const absolutePath = path.join(projectDir, dir)\n const packageJson = path.join(absolutePath, \"package.json\")\n const stat = await statOrNull(packageJson)\n if (stat != null && stat.isFile()) {\n return absolutePath\n }\n }\n return projectDir\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DotenvParseInput } from "dotenv-expand";
|
|
2
|
+
import { Lazy } from "lazy-val";
|
|
3
|
+
export interface ReadConfigResult<T> {
|
|
4
|
+
readonly result: T;
|
|
5
|
+
readonly configFile: string | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function findAndReadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
|
8
|
+
export declare function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>;
|
|
9
|
+
export declare function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T>;
|
|
10
|
+
export interface ReadConfigRequest {
|
|
11
|
+
packageKey: string;
|
|
12
|
+
configFilename: string;
|
|
13
|
+
projectDir: string;
|
|
14
|
+
packageMetadata: Lazy<Record<string, any> | null> | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function loadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
|
17
|
+
export declare function getConfig<T>(request: ReadConfigRequest, configPath?: string | null): Promise<ReadConfigResult<T> | null>;
|
|
18
|
+
export declare function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<ReadConfigResult<T>>;
|
|
19
|
+
export declare function loadEnv(envFile: string): Promise<DotenvParseInput | null>;
|
|
20
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../src/util/config/load.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAU,MAAM,eAAe,CAAA;AAIxD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAM/B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClB,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CACnC;AAiCD,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAU1G;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAE9E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOrF;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,cAAc,EAAE,MAAM,CAAA;IAEtB,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAA;CACzD;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CASnG;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAMxH;AAED,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CA0BhH;AAED,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,oCAgB5C"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { log } from "builder-util";
|
|
3
|
+
const require = createRequire(import.meta.url);
|
|
4
|
+
import { parse as parseEnv } from "dotenv";
|
|
5
|
+
import { expand } from "dotenv-expand";
|
|
6
|
+
import { promises as fs } from "fs";
|
|
7
|
+
import { createJiti } from "jiti";
|
|
8
|
+
import { load } from "js-yaml";
|
|
9
|
+
import * as path from "path";
|
|
10
|
+
import { resolveModule } from "../resolve.js";
|
|
11
|
+
const jiti = createJiti(import.meta.filename);
|
|
12
|
+
async function readConfig(configFile, request) {
|
|
13
|
+
const data = await fs.readFile(configFile, "utf8");
|
|
14
|
+
let result;
|
|
15
|
+
if (configFile.endsWith(".json5") || configFile.endsWith(".json")) {
|
|
16
|
+
result = require("json5").parse(data);
|
|
17
|
+
}
|
|
18
|
+
else if (configFile.endsWith(".js") || configFile.endsWith(".cjs") || configFile.endsWith(".mjs")) {
|
|
19
|
+
const json = await orNullIfFileNotExist(fs.readFile(path.join(process.cwd(), "package.json"), "utf8"));
|
|
20
|
+
const moduleType = json === null ? null : JSON.parse(json).type;
|
|
21
|
+
result = await resolveModule(moduleType, configFile);
|
|
22
|
+
if (result.default != null) {
|
|
23
|
+
result = result.default;
|
|
24
|
+
}
|
|
25
|
+
if (typeof result === "function") {
|
|
26
|
+
result = result(request);
|
|
27
|
+
}
|
|
28
|
+
result = await Promise.resolve(result);
|
|
29
|
+
}
|
|
30
|
+
else if (configFile.endsWith(".ts")) {
|
|
31
|
+
result = await jiti.import(configFile, { default: true });
|
|
32
|
+
if (typeof result === "function") {
|
|
33
|
+
result = result(request);
|
|
34
|
+
}
|
|
35
|
+
result = await Promise.resolve(result);
|
|
36
|
+
}
|
|
37
|
+
else if (configFile.endsWith(".toml")) {
|
|
38
|
+
result = require("toml").parse(data);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
result = load(data);
|
|
42
|
+
}
|
|
43
|
+
return { result, configFile };
|
|
44
|
+
}
|
|
45
|
+
export async function findAndReadConfig(request) {
|
|
46
|
+
const prefix = request.configFilename;
|
|
47
|
+
for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`, `${prefix}.cjs`, `${prefix}.ts`]) {
|
|
48
|
+
const data = await orNullIfFileNotExist(readConfig(path.join(request.projectDir, configFile), request));
|
|
49
|
+
if (data != null) {
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
export function orNullIfFileNotExist(promise) {
|
|
56
|
+
return orIfFileNotExist(promise, null);
|
|
57
|
+
}
|
|
58
|
+
export function orIfFileNotExist(promise, fallbackValue) {
|
|
59
|
+
return promise.catch(e => {
|
|
60
|
+
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
|
61
|
+
return fallbackValue;
|
|
62
|
+
}
|
|
63
|
+
throw e;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
export async function loadConfig(request) {
|
|
67
|
+
let packageMetadata = request.packageMetadata == null ? null : await request.packageMetadata.value;
|
|
68
|
+
if (packageMetadata == null) {
|
|
69
|
+
const json = await orNullIfFileNotExist(fs.readFile(path.join(request.projectDir, "package.json"), "utf8"));
|
|
70
|
+
packageMetadata = json == null ? null : JSON.parse(json);
|
|
71
|
+
}
|
|
72
|
+
const data = packageMetadata == null ? null : packageMetadata[request.packageKey];
|
|
73
|
+
return data == null ? findAndReadConfig(request) : { result: data, configFile: null };
|
|
74
|
+
}
|
|
75
|
+
export function getConfig(request, configPath) {
|
|
76
|
+
if (configPath == null) {
|
|
77
|
+
return loadConfig(request);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return readConfig(path.resolve(request.projectDir, configPath), request);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export async function loadParentConfig(request, spec) {
|
|
84
|
+
let isFileSpec;
|
|
85
|
+
if (spec.startsWith("file:")) {
|
|
86
|
+
spec = spec.substring("file:".length);
|
|
87
|
+
isFileSpec = true;
|
|
88
|
+
}
|
|
89
|
+
let parentConfig = await orNullIfFileNotExist(readConfig(path.resolve(request.projectDir, spec), request));
|
|
90
|
+
if (parentConfig == null && isFileSpec !== true) {
|
|
91
|
+
let resolved = null;
|
|
92
|
+
try {
|
|
93
|
+
resolved = require.resolve(spec);
|
|
94
|
+
}
|
|
95
|
+
catch (_e) {
|
|
96
|
+
// ignore
|
|
97
|
+
}
|
|
98
|
+
if (resolved != null) {
|
|
99
|
+
parentConfig = await readConfig(resolved, request);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (parentConfig == null) {
|
|
103
|
+
throw new Error(`Cannot find parent config file: ${spec}`);
|
|
104
|
+
}
|
|
105
|
+
return parentConfig;
|
|
106
|
+
}
|
|
107
|
+
export async function loadEnv(envFile) {
|
|
108
|
+
const data = await orNullIfFileNotExist(fs.readFile(envFile, "utf8"));
|
|
109
|
+
if (data == null) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
const parsed = parseEnv(data);
|
|
113
|
+
log.info({ envFile }, "injecting environment");
|
|
114
|
+
Object.entries(parsed).forEach(([key, value]) => {
|
|
115
|
+
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
|
|
116
|
+
process.env[key] = value;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
expand({ parsed });
|
|
120
|
+
return parsed;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../src/util/config/load.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAElC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,OAAO,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAoB,MAAM,EAAE,MAAM,eAAe,CAAA;AACxD,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,IAAI,CAAA;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAO7C,KAAK,UAAU,UAAU,CAAI,UAAkB,EAAE,OAA0B;IACzE,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAA;IAClD,IAAI,MAAW,CAAA;IACf,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClE,MAAM,GAAG,OAAO,CAA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AA;IAC9C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QAC9C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YAC5D,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QAC1B,CAAC;IACH,CAAC,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAClB,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import { createRequire } from \"node:module\"\nimport { log } from \"builder-util\"\n\nconst require = createRequire(import.meta.url)\nimport { parse as parseEnv } from \"dotenv\"\nimport { DotenvParseInput, expand } from \"dotenv-expand\"\nimport { promises as fs } from \"fs\"\nimport { createJiti } from \"jiti\"\nimport { load } from \"js-yaml\"\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { resolveModule } from \"../resolve.js\"\n\nconst jiti = createJiti(import.meta.filename)\n\nexport interface ReadConfigResult<T> {\n readonly result: T\n readonly configFile: string | null\n}\n\nasync function readConfig<T>(configFile: string, request: ReadConfigRequest): Promise<ReadConfigResult<T>> {\n const data = await fs.readFile(configFile, \"utf8\")\n let result: any\n if (configFile.endsWith(\".json5\") || configFile.endsWith(\".json\")) {\n result = require(\"json5\").parse(data)\n } else if (configFile.endsWith(\".js\") || configFile.endsWith(\".cjs\") || configFile.endsWith(\".mjs\")) {\n const json = await orNullIfFileNotExist(fs.readFile(path.join(process.cwd(), \"package.json\"), \"utf8\"))\n const moduleType = json === null ? null : JSON.parse(json).type\n result = await resolveModule(moduleType, configFile)\n if (result.default != null) {\n result = result.default\n }\n if (typeof result === \"function\") {\n result = result(request)\n }\n result = await Promise.resolve(result)\n } else if (configFile.endsWith(\".ts\")) {\n result = await jiti.import(configFile, { default: true })\n\n if (typeof result === \"function\") {\n result = result(request)\n }\n result = await Promise.resolve(result)\n } else if (configFile.endsWith(\".toml\")) {\n result = require(\"toml\").parse(data)\n } else {\n result = load(data)\n }\n return { result, configFile }\n}\n\nexport async function findAndReadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null> {\n const prefix = request.configFilename\n for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`, `${prefix}.cjs`, `${prefix}.ts`]) {\n const data = await orNullIfFileNotExist(readConfig<T>(path.join(request.projectDir, configFile), request))\n if (data != null) {\n return data\n }\n }\n\n return null\n}\n\nexport function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null> {\n return orIfFileNotExist(promise, null)\n}\n\nexport function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T> {\n return promise.catch(e => {\n if (e.code === \"ENOENT\" || e.code === \"ENOTDIR\") {\n return fallbackValue\n }\n throw e\n })\n}\n\nexport interface ReadConfigRequest {\n packageKey: string\n configFilename: string\n\n projectDir: string\n packageMetadata: Lazy<Record<string, any> | null> | null\n}\n\nexport async function loadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null> {\n let packageMetadata = request.packageMetadata == null ? null : await request.packageMetadata.value\n if (packageMetadata == null) {\n const json = await orNullIfFileNotExist(fs.readFile(path.join(request.projectDir, \"package.json\"), \"utf8\"))\n packageMetadata = json == null ? null : JSON.parse(json)\n }\n\n const data: T = packageMetadata == null ? null : packageMetadata[request.packageKey]\n return data == null ? findAndReadConfig<T>(request) : { result: data, configFile: null }\n}\n\nexport function getConfig<T>(request: ReadConfigRequest, configPath?: string | null): Promise<ReadConfigResult<T> | null> {\n if (configPath == null) {\n return loadConfig<T>(request)\n } else {\n return readConfig<T>(path.resolve(request.projectDir, configPath), request)\n }\n}\n\nexport async function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<ReadConfigResult<T>> {\n let isFileSpec: boolean | undefined\n if (spec.startsWith(\"file:\")) {\n spec = spec.substring(\"file:\".length)\n isFileSpec = true\n }\n\n let parentConfig = await orNullIfFileNotExist(readConfig<T>(path.resolve(request.projectDir, spec), request))\n if (parentConfig == null && isFileSpec !== true) {\n let resolved: string | null = null\n try {\n resolved = require.resolve(spec)\n } catch (_e) {\n // ignore\n }\n\n if (resolved != null) {\n parentConfig = await readConfig<T>(resolved, request)\n }\n }\n\n if (parentConfig == null) {\n throw new Error(`Cannot find parent config file: ${spec}`)\n }\n\n return parentConfig\n}\n\nexport async function loadEnv(envFile: string) {\n const data = await orNullIfFileNotExist(fs.readFile(envFile, \"utf8\"))\n if (data == null) {\n return null\n }\n\n const parsed = parseEnv<DotenvParseInput>(data)\n\n log.info({ envFile }, \"injecting environment\")\n Object.entries(parsed).forEach(([key, value]) => {\n if (!Object.prototype.hasOwnProperty.call(process.env, key)) {\n process.env[key] = value\n }\n })\n expand({ parsed })\n return parsed\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ErrorObject } from "ajv";
|
|
2
|
+
export type PostFormatter = (formattedError: string, error: ErrorObject) => string;
|
|
3
|
+
export interface ValidationConfig {
|
|
4
|
+
name?: string;
|
|
5
|
+
postFormatter?: PostFormatter;
|
|
6
|
+
}
|
|
7
|
+
export declare function validateSchema(schema: unknown, data: unknown, config?: ValidationConfig): void;
|
|
8
|
+
//# sourceMappingURL=schemaValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemaValidator.d.ts","sourceRoot":"","sources":["../../../src/util/config/schemaValidator.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,WAAW,EAAoB,MAAM,KAAK,CAAA;AAExD,MAAM,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,KAAK,MAAM,CAAA;AAElF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAaD,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,GAAE,gBAAqB,GAAG,IAAI,CA8BlG"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import Ajv from "ajv";
|
|
2
|
+
const ajv = new Ajv({
|
|
3
|
+
allErrors: true,
|
|
4
|
+
verbose: true,
|
|
5
|
+
coerceTypes: true,
|
|
6
|
+
strict: false,
|
|
7
|
+
});
|
|
8
|
+
// Cache the compiled validator for the canonical scheme.json so it is only
|
|
9
|
+
// compiled once per process lifetime.
|
|
10
|
+
let _cachedValidate;
|
|
11
|
+
export function validateSchema(schema, data, config = {}) {
|
|
12
|
+
if (_cachedValidate == null || _cachedValidate.schema !== schema) {
|
|
13
|
+
_cachedValidate = ajv.compile(schema);
|
|
14
|
+
}
|
|
15
|
+
const validate = _cachedValidate;
|
|
16
|
+
if (validate(data)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const errors = validate.errors ?? [];
|
|
20
|
+
const baseDataPath = "configuration";
|
|
21
|
+
const name = config.name ?? "Object";
|
|
22
|
+
const relevant = filterRelevantErrors(errors);
|
|
23
|
+
const formatted = relevant.map(error => {
|
|
24
|
+
let msg = formatError(error, baseDataPath);
|
|
25
|
+
if (config.postFormatter != null) {
|
|
26
|
+
msg = config.postFormatter(msg, error);
|
|
27
|
+
}
|
|
28
|
+
return ` - ${indentNewlines(msg, " ")}`;
|
|
29
|
+
});
|
|
30
|
+
const header = `Invalid configuration object. ${name} has been initialized using a configuration object that does not match the API schema.`;
|
|
31
|
+
const guidance = [
|
|
32
|
+
`Please check the documentation to ensure that your configuration matches the expected schema: https://www.electron.build/configuration`,
|
|
33
|
+
`If you recently upgraded electron-builder to v27, please run \`electron-builder migrate-schema\` to automatically update your configuration.`,
|
|
34
|
+
`Check the release notes for breaking changes: https://www.electron.build/docs/migration/v26-to-v27`,
|
|
35
|
+
];
|
|
36
|
+
throw new Error(`${header}\n${formatted.join("\n")}\n${guidance.join("\n")}`);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Filters the flat list of ajv errors to the most actionable subset.
|
|
40
|
+
* Composite keywords (anyOf/oneOf/if) are suppressed when more specific
|
|
41
|
+
* errors exist at the same or deeper paths. When all errors share the
|
|
42
|
+
* same instancePath and a composite parent for that path exists, the
|
|
43
|
+
* parent is kept instead so the user sees a single "should be one of"
|
|
44
|
+
* message rather than every failed branch listed separately.
|
|
45
|
+
*/
|
|
46
|
+
function filterRelevantErrors(errors) {
|
|
47
|
+
const compositeKeywords = new Set(["anyOf", "oneOf", "if"]);
|
|
48
|
+
const specific = errors.filter(e => !compositeKeywords.has(e.keyword));
|
|
49
|
+
if (specific.length === 0) {
|
|
50
|
+
return errors.filter(e => compositeKeywords.has(e.keyword));
|
|
51
|
+
}
|
|
52
|
+
// Group specific errors by instancePath
|
|
53
|
+
const byPath = new Map();
|
|
54
|
+
for (const e of specific) {
|
|
55
|
+
const list = byPath.get(e.instancePath);
|
|
56
|
+
if (list != null) {
|
|
57
|
+
list.push(e);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
byPath.set(e.instancePath, [e]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const result = [];
|
|
64
|
+
for (const [path, group] of byPath) {
|
|
65
|
+
if (group.length > 1) {
|
|
66
|
+
// additionalProperties errors are the most actionable ("has unknown
|
|
67
|
+
// property X") — prefer them over anyOf-parent collapse or type noise.
|
|
68
|
+
const additionalProps = group.filter(e => e.keyword === "additionalProperties");
|
|
69
|
+
if (additionalProps.length > 0) {
|
|
70
|
+
result.push(...additionalProps);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
// For other multi-error groups, prefer the anyOf parent (one concise
|
|
74
|
+
// "should be one of these" message).
|
|
75
|
+
const parent = errors.find(e => e.instancePath === path && compositeKeywords.has(e.keyword));
|
|
76
|
+
if (parent != null) {
|
|
77
|
+
result.push(parent);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
result.push(...group);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
/** Decodes a single RFC 6901 JSON Pointer segment (`~1` → `/`, `~0` → `~`). */
|
|
86
|
+
function decodePointerSegment(segment) {
|
|
87
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
88
|
+
}
|
|
89
|
+
function instancePathToLabel(instancePath, baseDataPath) {
|
|
90
|
+
if (!instancePath) {
|
|
91
|
+
return baseDataPath;
|
|
92
|
+
}
|
|
93
|
+
const segments = instancePath.split("/").filter(Boolean).map(decodePointerSegment);
|
|
94
|
+
return [baseDataPath, ...segments].join(".");
|
|
95
|
+
}
|
|
96
|
+
function formatError(error, baseDataPath) {
|
|
97
|
+
const label = instancePathToLabel(error.instancePath, baseDataPath);
|
|
98
|
+
const params = error.params;
|
|
99
|
+
const parentSchema = error.parentSchema;
|
|
100
|
+
switch (error.keyword) {
|
|
101
|
+
case "additionalProperties":
|
|
102
|
+
return `${label} has an unknown property '${params.additionalProperty}'`;
|
|
103
|
+
case "required": {
|
|
104
|
+
const missingProp = String(params.missingProperty).replace(/^\./, "");
|
|
105
|
+
return `${label} misses the property '${missingProp}'`;
|
|
106
|
+
}
|
|
107
|
+
case "type": {
|
|
108
|
+
const type = params.type;
|
|
109
|
+
if (Array.isArray(type)) {
|
|
110
|
+
const typeList = type.join(" | ");
|
|
111
|
+
const desc = descriptionSuffix(parentSchema);
|
|
112
|
+
return `${label} should be:\n${typeList}${desc}`;
|
|
113
|
+
}
|
|
114
|
+
return `${label} should be a ${type}`;
|
|
115
|
+
}
|
|
116
|
+
case "enum": {
|
|
117
|
+
const enumVals = parentSchema?.enum ?? [];
|
|
118
|
+
if (enumVals.length === 1) {
|
|
119
|
+
return `${label} should be ${JSON.stringify(enumVals[0])}`;
|
|
120
|
+
}
|
|
121
|
+
return `${label} should be one of these:\n${enumVals.map(v => JSON.stringify(v)).join(" | ")}`;
|
|
122
|
+
}
|
|
123
|
+
case "anyOf":
|
|
124
|
+
case "oneOf": {
|
|
125
|
+
const schemaText = formatSchemaType(parentSchema);
|
|
126
|
+
return `${label} should be one of these:\n${schemaText}`;
|
|
127
|
+
}
|
|
128
|
+
default:
|
|
129
|
+
return `${label} ${error.message}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function descriptionSuffix(schema) {
|
|
133
|
+
return typeof schema?.description === "string" ? `\n-> ${schema.description}` : "";
|
|
134
|
+
}
|
|
135
|
+
function formatSchemaType(schema) {
|
|
136
|
+
if (schema == null) {
|
|
137
|
+
return "";
|
|
138
|
+
}
|
|
139
|
+
if (Array.isArray(schema.type)) {
|
|
140
|
+
return schema.type.join(" | ");
|
|
141
|
+
}
|
|
142
|
+
if (typeof schema.type === "string") {
|
|
143
|
+
return schema.type;
|
|
144
|
+
}
|
|
145
|
+
if (Array.isArray(schema.anyOf)) {
|
|
146
|
+
return schema.anyOf
|
|
147
|
+
.map(s => {
|
|
148
|
+
if (Array.isArray(s.type)) {
|
|
149
|
+
return s.type.join(" | ");
|
|
150
|
+
}
|
|
151
|
+
return typeof s.type === "string" ? s.type : "";
|
|
152
|
+
})
|
|
153
|
+
.filter(Boolean)
|
|
154
|
+
.join(" | ");
|
|
155
|
+
}
|
|
156
|
+
return JSON.stringify(schema);
|
|
157
|
+
}
|
|
158
|
+
function indentNewlines(str, prefix) {
|
|
159
|
+
return str.replace(/\n(?!$)/g, `\n${prefix}`);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=schemaValidator.js.map
|