app-builder-lib 27.0.0-alpha.1 → 27.0.0-alpha.11
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 +2 -0
- package/dist/Framework.d.ts.map +1 -1
- package/dist/Framework.js.map +1 -1
- package/dist/appInfo.d.ts +1 -1
- package/dist/appInfo.d.ts.map +1 -1
- package/dist/appInfo.js +3 -3
- package/dist/appInfo.js.map +1 -1
- package/dist/asar/asar.js.map +1 -1
- package/dist/asar/asarAlign.d.ts +35 -0
- package/dist/asar/asarAlign.d.ts.map +1 -0
- package/dist/asar/asarAlign.js +149 -0
- package/dist/asar/asarAlign.js.map +1 -0
- package/dist/asar/asarFileChecker.d.ts +4 -2
- package/dist/asar/asarFileChecker.d.ts.map +1 -1
- package/dist/asar/asarFileChecker.js +2 -3
- package/dist/asar/asarFileChecker.js.map +1 -1
- package/dist/asar/asarUtil.d.ts +15 -1
- package/dist/asar/asarUtil.d.ts.map +1 -1
- package/dist/asar/asarUtil.js +132 -72
- package/dist/asar/asarUtil.js.map +1 -1
- package/dist/codeSign/certInfo.d.ts +14 -0
- package/dist/codeSign/certInfo.d.ts.map +1 -1
- package/dist/codeSign/certInfo.js +49 -0
- package/dist/codeSign/certInfo.js.map +1 -1
- package/dist/codeSign/mac/macCodeSign.d.ts +3 -3
- package/dist/codeSign/mac/macCodeSign.d.ts.map +1 -1
- package/dist/codeSign/mac/macCodeSign.js +50 -25
- package/dist/codeSign/mac/macCodeSign.js.map +1 -1
- package/dist/codeSign/signResult.d.ts +26 -0
- package/dist/codeSign/signResult.d.ts.map +1 -0
- package/dist/codeSign/signResult.js +12 -0
- package/dist/codeSign/signResult.js.map +1 -0
- package/dist/codeSign/win/hsmSignManager.d.ts +10 -0
- package/dist/codeSign/win/hsmSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/hsmSignManager.js +50 -0
- package/dist/codeSign/win/hsmSignManager.js.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts +14 -0
- package/dist/codeSign/win/pkcs11SignManager.d.ts.map +1 -0
- package/dist/codeSign/win/pkcs11SignManager.js +82 -0
- package/dist/codeSign/win/pkcs11SignManager.js.map +1 -0
- package/dist/codeSign/win/signManager.d.ts +17 -0
- package/dist/codeSign/win/signManager.d.ts.map +1 -0
- package/dist/codeSign/win/signManager.js +19 -0
- package/dist/codeSign/win/signManager.js.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts +95 -0
- package/dist/codeSign/win/signtoolBaseSignManager.d.ts.map +1 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js +507 -0
- package/dist/codeSign/win/signtoolBaseSignManager.js.map +1 -0
- package/dist/codeSign/win/windowsCodeSign.d.ts +2 -1
- package/dist/codeSign/win/windowsCodeSign.d.ts.map +1 -1
- package/dist/codeSign/win/windowsCodeSign.js +22 -8
- package/dist/codeSign/win/windowsCodeSign.js.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.d.ts +11 -4
- package/dist/codeSign/win/windowsSignAzureManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignAzureManager.js +142 -37
- package/dist/codeSign/win/windowsSignAzureManager.js.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.d.ts +1 -58
- package/dist/codeSign/win/windowsSignToolManager.d.ts.map +1 -1
- package/dist/codeSign/win/windowsSignToolManager.js +3 -363
- package/dist/codeSign/win/windowsSignToolManager.js.map +1 -1
- package/dist/configuration.d.ts +233 -166
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +11 -1
- package/dist/configuration.js.map +1 -1
- package/dist/core.d.ts +14 -0
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +11 -0
- package/dist/core.js.map +1 -1
- package/dist/electron/ElectronFramework.d.ts +3 -3
- package/dist/electron/ElectronFramework.d.ts.map +1 -1
- package/dist/electron/ElectronFramework.js +60 -61
- package/dist/electron/ElectronFramework.js.map +1 -1
- package/dist/electron/electronArchSupport.d.ts +12 -0
- package/dist/electron/electronArchSupport.d.ts.map +1 -0
- package/dist/electron/electronArchSupport.js +58 -0
- package/dist/electron/electronArchSupport.js.map +1 -0
- package/dist/electron/electronVersion.d.ts.map +1 -1
- package/dist/electron/electronVersion.js +1 -11
- package/dist/electron/electronVersion.js.map +1 -1
- package/dist/electron/injectFFMPEG.js +2 -2
- package/dist/electron/injectFFMPEG.js.map +1 -1
- package/dist/electron/mac/electronMac.js +24 -35
- package/dist/electron/mac/electronMac.js.map +1 -1
- package/dist/electron/mac/electronMacUtils.d.ts +24 -0
- package/dist/electron/mac/electronMacUtils.d.ts.map +1 -0
- package/dist/electron/mac/electronMacUtils.js +42 -0
- package/dist/electron/mac/electronMacUtils.js.map +1 -0
- package/dist/electron/win/electronWin.js +2 -2
- package/dist/electron/win/electronWin.js.map +1 -1
- package/dist/fileMatcher.d.ts +55 -3
- package/dist/fileMatcher.d.ts.map +1 -1
- package/dist/fileMatcher.js +274 -28
- package/dist/fileMatcher.js.map +1 -1
- package/dist/index.d.ts +13 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/dist/indexInternal.d.ts +20 -8
- package/dist/indexInternal.d.ts.map +1 -1
- package/dist/indexInternal.js +19 -7
- package/dist/indexInternal.js.map +1 -1
- package/dist/linuxPackager.d.ts.map +1 -1
- package/dist/linuxPackager.js +19 -1
- package/dist/linuxPackager.js.map +1 -1
- package/dist/macPackager.d.ts +31 -14
- package/dist/macPackager.d.ts.map +1 -1
- package/dist/macPackager.js +236 -147
- package/dist/macPackager.js.map +1 -1
- package/dist/node-module-collector/index.d.ts.map +1 -1
- package/dist/node-module-collector/index.js +47 -16
- package/dist/node-module-collector/index.js.map +1 -1
- package/dist/node-module-collector/moduleManager.d.ts +11 -2
- package/dist/node-module-collector/moduleManager.d.ts.map +1 -1
- package/dist/node-module-collector/moduleManager.js +34 -14
- package/dist/node-module-collector/moduleManager.js.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.d.ts +47 -26
- package/dist/node-module-collector/nodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/nodeModulesCollector.js +157 -142
- package/dist/node-module-collector/nodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/packageManager.js +1 -1
- package/dist/node-module-collector/packageManager.js.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts +90 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.d.ts.map +1 -1
- package/dist/node-module-collector/pnpmNodeModulesCollector.js +325 -25
- package/dist/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
- package/dist/node-module-collector/types.d.ts +4 -0
- package/dist/node-module-collector/types.d.ts.map +1 -1
- package/dist/node-module-collector/types.js.map +1 -1
- package/dist/options/FuseOptionsV1.d.ts +137 -0
- package/dist/options/FuseOptionsV1.d.ts.map +1 -0
- package/dist/options/FuseOptionsV1.js +2 -0
- package/dist/options/FuseOptionsV1.js.map +1 -0
- package/dist/options/MsixOptions.d.ts +126 -0
- package/dist/options/MsixOptions.d.ts.map +1 -0
- package/dist/options/MsixOptions.js +2 -0
- package/dist/options/MsixOptions.js.map +1 -0
- package/dist/options/PlatformSpecificBuildOptions.d.ts +147 -12
- package/dist/options/PlatformSpecificBuildOptions.d.ts.map +1 -1
- package/dist/options/PlatformSpecificBuildOptions.js.map +1 -1
- package/dist/options/SnapOptions.d.ts +59 -32
- package/dist/options/SnapOptions.d.ts.map +1 -1
- package/dist/options/SnapOptions.js.map +1 -1
- package/dist/options/SquirrelWindowsOptions.d.ts +0 -5
- package/dist/options/SquirrelWindowsOptions.d.ts.map +1 -1
- package/dist/options/SquirrelWindowsOptions.js.map +1 -1
- package/dist/options/linuxOptions.d.ts +61 -30
- package/dist/options/linuxOptions.d.ts.map +1 -1
- package/dist/options/linuxOptions.js.map +1 -1
- package/dist/options/macOptions.d.ts +113 -131
- package/dist/options/macOptions.d.ts.map +1 -1
- package/dist/options/macOptions.js.map +1 -1
- package/dist/options/pkgOptions.d.ts +1 -1
- package/dist/options/pkgOptions.js.map +1 -1
- package/dist/options/winOptions.d.ts +282 -70
- package/dist/options/winOptions.d.ts.map +1 -1
- package/dist/options/winOptions.js +12 -1
- package/dist/options/winOptions.js.map +1 -1
- package/dist/packager.d.ts +6 -1
- package/dist/packager.d.ts.map +1 -1
- package/dist/packager.js +123 -40
- package/dist/packager.js.map +1 -1
- package/dist/packagerApi.d.ts +10 -1
- package/dist/packagerApi.d.ts.map +1 -1
- package/dist/packagerApi.js.map +1 -1
- package/dist/platformPackager.d.ts +55 -4
- package/dist/platformPackager.d.ts.map +1 -1
- package/dist/platformPackager.js +160 -22
- package/dist/platformPackager.js.map +1 -1
- package/dist/presets/rectCra.js +3 -1
- package/dist/presets/rectCra.js.map +1 -1
- package/dist/publish/PublishManager.d.ts +40 -2
- package/dist/publish/PublishManager.d.ts.map +1 -1
- package/dist/publish/PublishManager.js +365 -23
- package/dist/publish/PublishManager.js.map +1 -1
- package/dist/publish/updateInfoBuilder.d.ts +1 -1
- package/dist/publish/updateInfoBuilder.d.ts.map +1 -1
- package/dist/publish/updateInfoBuilder.js +108 -32
- package/dist/publish/updateInfoBuilder.js.map +1 -1
- package/dist/targets/ArchiveTarget.d.ts +1 -0
- package/dist/targets/ArchiveTarget.d.ts.map +1 -1
- package/dist/targets/ArchiveTarget.js +13 -4
- package/dist/targets/ArchiveTarget.js.map +1 -1
- package/dist/targets/archive.d.ts +39 -2
- package/dist/targets/archive.d.ts.map +1 -1
- package/dist/targets/archive.js +114 -30
- package/dist/targets/archive.js.map +1 -1
- package/dist/targets/blockmap/blockmap.d.ts +44 -3
- package/dist/targets/blockmap/blockmap.d.ts.map +1 -1
- package/dist/targets/blockmap/blockmap.js +142 -15
- package/dist/targets/blockmap/blockmap.js.map +1 -1
- package/dist/targets/blockmap/verbatimRange.d.ts +44 -0
- package/dist/targets/blockmap/verbatimRange.d.ts.map +1 -0
- package/dist/targets/blockmap/verbatimRange.js +117 -0
- package/dist/targets/blockmap/verbatimRange.js.map +1 -0
- package/dist/targets/differentialUpdateInfoBuilder.d.ts +28 -2
- package/dist/targets/differentialUpdateInfoBuilder.d.ts.map +1 -1
- package/dist/targets/differentialUpdateInfoBuilder.js +75 -6
- package/dist/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/dist/targets/linux/FlatpakTarget.d.ts +17 -0
- package/dist/targets/linux/FlatpakTarget.d.ts.map +1 -1
- package/dist/targets/linux/FlatpakTarget.js +245 -45
- package/dist/targets/linux/FlatpakTarget.js.map +1 -1
- package/dist/targets/linux/FpmTarget.d.ts +14 -0
- package/dist/targets/linux/FpmTarget.d.ts.map +1 -1
- package/dist/targets/linux/FpmTarget.js +92 -12
- package/dist/targets/linux/FpmTarget.js.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.d.ts +13 -0
- package/dist/targets/linux/LinuxTargetHelper.d.ts.map +1 -1
- package/dist/targets/linux/LinuxTargetHelper.js +81 -61
- package/dist/targets/linux/LinuxTargetHelper.js.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.d.ts +2 -0
- package/dist/targets/linux/appimage/AppImageTarget.d.ts.map +1 -1
- package/dist/targets/linux/appimage/AppImageTarget.js +20 -15
- package/dist/targets/linux/appimage/AppImageTarget.js.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.d.ts +8 -2
- package/dist/targets/linux/appimage/appImageUtil.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appImageUtil.js +16 -9
- package/dist/targets/linux/appimage/appImageUtil.js.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.d.ts +6 -0
- package/dist/targets/linux/appimage/appLauncher.d.ts.map +1 -1
- package/dist/targets/linux/appimage/appLauncher.js +18 -20
- package/dist/targets/linux/appimage/appLauncher.js.map +1 -1
- package/dist/targets/linux/flatpakBundle.d.ts +43 -0
- package/dist/targets/linux/flatpakBundle.d.ts.map +1 -0
- package/dist/targets/linux/flatpakBundle.js +210 -0
- package/dist/targets/linux/flatpakBundle.js.map +1 -0
- package/dist/targets/linux/launcherScript.d.ts +32 -0
- package/dist/targets/linux/launcherScript.d.ts.map +1 -0
- package/dist/targets/linux/launcherScript.js +24 -0
- package/dist/targets/linux/launcherScript.js.map +1 -0
- package/dist/targets/linux/snap/SnapTarget.d.ts +1 -1
- package/dist/targets/linux/snap/SnapTarget.d.ts.map +1 -1
- package/dist/targets/linux/snap/SnapTarget.js +23 -1
- package/dist/targets/linux/snap/SnapTarget.js.map +1 -1
- package/dist/targets/linux/snap/core24.d.ts +13 -2
- package/dist/targets/linux/snap/core24.d.ts.map +1 -1
- package/dist/targets/linux/snap/core24.js +107 -95
- package/dist/targets/linux/snap/core24.js.map +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts +1 -1
- package/dist/targets/linux/snap/coreCustom.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreCustom.js +2 -2
- package/dist/targets/linux/snap/coreCustom.js.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.d.ts +10 -3
- package/dist/targets/linux/snap/coreLegacy.d.ts.map +1 -1
- package/dist/targets/linux/snap/coreLegacy.js +37 -18
- package/dist/targets/linux/snap/coreLegacy.js.map +1 -1
- package/dist/targets/linux/snap/snapCommand.d.ts +13 -0
- package/dist/targets/linux/snap/snapCommand.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapCommand.js +21 -0
- package/dist/targets/linux/snap/snapCommand.js.map +1 -0
- package/dist/targets/linux/snap/snapPlugs.d.ts +76 -0
- package/dist/targets/linux/snap/snapPlugs.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapPlugs.js +242 -0
- package/dist/targets/linux/snap/snapPlugs.js.map +1 -0
- package/dist/targets/linux/snap/snapcraft.d.ts +190 -0
- package/dist/targets/linux/snap/snapcraft.d.ts.map +1 -0
- package/dist/targets/linux/snap/snapcraft.js +11 -0
- package/dist/targets/linux/snap/snapcraft.js.map +1 -0
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts +7 -1
- package/dist/targets/linux/snap/snapcraftBuilder.d.ts.map +1 -1
- package/dist/targets/linux/snap/snapcraftBuilder.js +57 -20
- package/dist/targets/linux/snap/snapcraftBuilder.js.map +1 -1
- package/dist/targets/mac/MacTargetHelper.d.ts +146 -14
- package/dist/targets/mac/MacTargetHelper.d.ts.map +1 -1
- package/dist/targets/mac/MacTargetHelper.js +485 -91
- package/dist/targets/mac/MacTargetHelper.js.map +1 -1
- package/dist/targets/mac/pkg.d.ts +16 -0
- package/dist/targets/mac/pkg.d.ts.map +1 -1
- package/dist/targets/mac/pkg.js +31 -5
- package/dist/targets/mac/pkg.js.map +1 -1
- package/dist/targets/targetFactory.d.ts +7 -0
- package/dist/targets/targetFactory.d.ts.map +1 -1
- package/dist/targets/targetFactory.js +28 -0
- package/dist/targets/targetFactory.js.map +1 -1
- package/dist/targets/win/AppxTarget.d.ts +1 -2
- package/dist/targets/win/AppxTarget.d.ts.map +1 -1
- package/dist/targets/win/AppxTarget.js +37 -314
- package/dist/targets/win/AppxTarget.js.map +1 -1
- package/dist/targets/win/MsiTarget.d.ts.map +1 -1
- package/dist/targets/win/MsiTarget.js +13 -13
- package/dist/targets/win/MsiTarget.js.map +1 -1
- package/dist/targets/win/MsixTarget.d.ts +22 -0
- package/dist/targets/win/MsixTarget.d.ts.map +1 -0
- package/dist/targets/win/MsixTarget.js +214 -0
- package/dist/targets/win/MsixTarget.js.map +1 -0
- package/dist/targets/win/nsis/Defines.d.ts +4 -0
- package/dist/targets/win/nsis/Defines.d.ts.map +1 -1
- package/dist/targets/win/nsis/Defines.js.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.d.ts +64 -3
- package/dist/targets/win/nsis/NsisTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/NsisTarget.js +277 -113
- package/dist/targets/win/nsis/NsisTarget.js.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.d.ts.map +1 -1
- package/dist/targets/win/nsis/WebInstallerTarget.js +23 -12
- package/dist/targets/win/nsis/WebInstallerTarget.js.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.d.ts +58 -48
- package/dist/targets/win/nsis/nsisOptions.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisOptions.js.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisScriptGenerator.js +4 -3
- package/dist/targets/win/nsis/nsisScriptGenerator.js.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.d.ts +17 -2
- package/dist/targets/win/nsis/nsisUtil.d.ts.map +1 -1
- package/dist/targets/win/nsis/nsisUtil.js +148 -41
- package/dist/targets/win/nsis/nsisUtil.js.map +1 -1
- package/dist/targets/win/nsis/progId.d.ts +21 -0
- package/dist/targets/win/nsis/progId.d.ts.map +1 -0
- package/dist/targets/win/nsis/progId.js +60 -0
- package/dist/targets/win/nsis/progId.js.map +1 -0
- package/dist/targets/win/winAppUtil.d.ts +115 -0
- package/dist/targets/win/winAppUtil.d.ts.map +1 -0
- package/dist/targets/win/winAppUtil.js +409 -0
- package/dist/targets/win/winAppUtil.js.map +1 -0
- package/dist/toolsets/7zip.d.ts +32 -0
- package/dist/toolsets/7zip.d.ts.map +1 -1
- package/dist/toolsets/7zip.js +39 -11
- package/dist/toolsets/7zip.js.map +1 -1
- package/dist/toolsets/appimage.d.ts +3 -3
- package/dist/toolsets/appimage.d.ts.map +1 -1
- package/dist/toolsets/appimage.js +24 -21
- package/dist/toolsets/appimage.js.map +1 -1
- package/dist/toolsets/custom.d.ts +2 -3
- package/dist/toolsets/custom.d.ts.map +1 -1
- package/dist/toolsets/custom.js +67 -149
- package/dist/toolsets/custom.js.map +1 -1
- package/dist/toolsets/fpm.d.ts.map +1 -1
- package/dist/toolsets/fpm.js +11 -5
- package/dist/toolsets/fpm.js.map +1 -1
- package/dist/toolsets/icons.d.ts.map +1 -1
- package/dist/toolsets/icons.js +17 -3
- package/dist/toolsets/icons.js.map +1 -1
- package/dist/toolsets/linuxToolsMac.d.ts.map +1 -1
- package/dist/toolsets/linuxToolsMac.js +17 -4
- package/dist/toolsets/linuxToolsMac.js.map +1 -1
- package/dist/toolsets/nsis.d.ts +5 -0
- package/dist/toolsets/nsis.d.ts.map +1 -1
- package/dist/toolsets/nsis.js +20 -4
- package/dist/toolsets/nsis.js.map +1 -1
- package/dist/toolsets/version.d.ts +12 -0
- package/dist/toolsets/version.d.ts.map +1 -0
- package/dist/toolsets/version.js +13 -0
- package/dist/toolsets/version.js.map +1 -0
- package/dist/toolsets/winCodeSign.d.ts +56 -3
- package/dist/toolsets/winCodeSign.d.ts.map +1 -1
- package/dist/toolsets/winCodeSign.js +125 -42
- package/dist/toolsets/winCodeSign.js.map +1 -1
- package/dist/toolsets/wine.d.ts +2 -1
- package/dist/toolsets/wine.d.ts.map +1 -1
- package/dist/toolsets/wine.js +31 -15
- package/dist/toolsets/wine.js.map +1 -1
- package/dist/util/AppFileWalker.js +9 -1
- package/dist/util/AppFileWalker.js.map +1 -1
- package/dist/util/NodeModuleCopyHelper.js +14 -6
- package/dist/util/NodeModuleCopyHelper.js.map +1 -1
- package/dist/util/appFileCopier.d.ts +67 -2
- package/dist/util/appFileCopier.d.ts.map +1 -1
- package/dist/util/appFileCopier.js +244 -32
- package/dist/util/appFileCopier.js.map +1 -1
- package/dist/util/archCompatibility.d.ts +42 -0
- package/dist/util/archCompatibility.d.ts.map +1 -0
- package/dist/util/archCompatibility.js +202 -0
- package/dist/util/archCompatibility.js.map +1 -0
- package/dist/util/checksum.d.ts +36 -0
- package/dist/util/checksum.d.ts.map +1 -0
- package/dist/util/checksum.js +48 -0
- package/dist/util/checksum.js.map +1 -0
- package/dist/util/config/config.d.ts +2 -1
- package/dist/util/config/config.d.ts.map +1 -1
- package/dist/util/config/config.js +42 -20
- package/dist/util/config/config.js.map +1 -1
- package/dist/util/config/fileOptions.d.ts +30 -0
- package/dist/util/config/fileOptions.d.ts.map +1 -0
- package/dist/util/config/fileOptions.js +120 -0
- package/dist/util/config/fileOptions.js.map +1 -0
- package/dist/util/config/legacyConfigGuard.d.ts +7 -0
- package/dist/util/config/legacyConfigGuard.d.ts.map +1 -0
- package/dist/util/config/legacyConfigGuard.js +214 -0
- package/dist/util/config/legacyConfigGuard.js.map +1 -0
- package/dist/util/config/legacyOptions.d.ts +86 -0
- package/dist/util/config/legacyOptions.d.ts.map +1 -0
- package/dist/util/config/legacyOptions.js +413 -0
- package/dist/util/config/legacyOptions.js.map +1 -0
- package/dist/util/config/load.d.ts +2 -2
- package/dist/util/config/load.d.ts.map +1 -1
- package/dist/util/config/load.js +3 -12
- package/dist/util/config/load.js.map +1 -1
- package/dist/util/config/schemaValidator.d.ts.map +1 -1
- package/dist/util/config/schemaValidator.js +26 -3
- package/dist/util/config/schemaValidator.js.map +1 -1
- package/dist/util/electronGet.d.ts +43 -32
- package/dist/util/electronGet.d.ts.map +1 -1
- package/dist/util/electronGet.js +390 -137
- package/dist/util/electronGet.js.map +1 -1
- package/dist/util/flags.d.ts +5 -5
- package/dist/util/flags.d.ts.map +1 -1
- package/dist/util/flags.js +124 -16
- package/dist/util/flags.js.map +1 -1
- package/dist/util/hash.d.ts +1 -1
- package/dist/util/hash.d.ts.map +1 -1
- package/dist/util/hash.js +1 -15
- package/dist/util/hash.js.map +1 -1
- package/dist/util/installOrRebuild.d.ts +44 -0
- package/dist/util/installOrRebuild.d.ts.map +1 -0
- package/dist/util/installOrRebuild.js +276 -0
- package/dist/util/installOrRebuild.js.map +1 -0
- package/dist/util/langs.d.ts.map +1 -1
- package/dist/util/langs.js +1 -0
- package/dist/util/langs.js.map +1 -1
- package/dist/util/license.d.ts.map +1 -1
- package/dist/util/license.js +4 -1
- package/dist/util/license.js.map +1 -1
- package/dist/util/mac/macosIconComposer.d.ts +2 -1
- package/dist/util/mac/macosIconComposer.d.ts.map +1 -1
- package/dist/util/mac/macosIconComposer.js +40 -58
- package/dist/util/mac/macosIconComposer.js.map +1 -1
- package/dist/util/mac/macosVersion.d.ts +0 -1
- package/dist/util/mac/macosVersion.d.ts.map +1 -1
- package/dist/util/mac/macosVersion.js +0 -3
- package/dist/util/mac/macosVersion.js.map +1 -1
- package/dist/util/mac/plist.d.ts +1 -1
- package/dist/util/mac/plist.d.ts.map +1 -1
- package/dist/util/mac/plist.js +5 -0
- package/dist/util/mac/plist.js.map +1 -1
- package/dist/util/nativeBinaryVerifier.d.ts +40 -0
- package/dist/util/nativeBinaryVerifier.d.ts.map +1 -0
- package/dist/util/nativeBinaryVerifier.js +381 -0
- package/dist/util/nativeBinaryVerifier.js.map +1 -0
- package/dist/util/packageMetadata.js +57 -31
- package/dist/util/packageMetadata.js.map +1 -1
- package/dist/util/removedEnvVars.d.ts +25 -0
- package/dist/util/removedEnvVars.d.ts.map +1 -0
- package/dist/util/removedEnvVars.js +54 -0
- package/dist/util/removedEnvVars.js.map +1 -0
- package/dist/util/repositoryInfo.js +6 -3
- package/dist/util/repositoryInfo.js.map +1 -1
- package/dist/util/resolve.js +1 -1
- package/dist/util/resolve.js.map +1 -1
- package/dist/util/streamSpawnToFile.d.ts +47 -0
- package/dist/util/streamSpawnToFile.d.ts.map +1 -0
- package/dist/util/streamSpawnToFile.js +110 -0
- package/dist/util/streamSpawnToFile.js.map +1 -0
- package/dist/util/toolsetLock.d.ts +2 -0
- package/dist/util/toolsetLock.d.ts.map +1 -1
- package/dist/util/toolsetLock.js +31 -5
- package/dist/util/toolsetLock.js.map +1 -1
- package/dist/util/trustedSourceRoots.d.ts +59 -0
- package/dist/util/trustedSourceRoots.d.ts.map +1 -0
- package/dist/util/trustedSourceRoots.js +127 -0
- package/dist/util/trustedSourceRoots.js.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/vm/ParallelsVm.d.ts.map +1 -1
- package/dist/vm/ParallelsVm.js +29 -3
- package/dist/vm/ParallelsVm.js.map +1 -1
- package/dist/vm/vm.d.ts +2 -0
- package/dist/vm/vm.d.ts.map +1 -1
- package/dist/vm/vm.js +29 -6
- package/dist/vm/vm.js.map +1 -1
- package/dist/winPackager.d.ts +6 -5
- package/dist/winPackager.d.ts.map +1 -1
- package/dist/winPackager.js +45 -39
- package/dist/winPackager.js.map +1 -1
- package/package.json +20 -20
- package/scheme.json +2112 -1495
- package/templates/appx/appxmanifest.xml +2 -3
- package/templates/entitlements.mac.adhoc.plist +15 -0
- package/templates/entitlements.mac.plist +9 -6
- package/templates/msix/appxmanifest.xml +45 -0
- package/templates/nsis/assistedMessages.yml +17 -0
- package/templates/nsis/common.nsh +2 -2
- package/templates/nsis/include/allowOnlyOneInstallerInstance.nsh +96 -13
- package/templates/nsis/include/extractAppPackage.nsh +5 -2
- package/templates/nsis/include/installUtil.nsh +2 -2
- package/templates/nsis/include/installer.nsh +94 -53
- package/templates/nsis/include/webPackage.nsh +52 -27
- package/templates/nsis/installSection.nsh +29 -0
- package/templates/nsis/installer.nsi +1 -1
- package/templates/nsis/messages.yml +5 -0
- package/templates/nsis/multiUserUi.nsh +1 -1
- package/dist/codeSign/signManager.d.ts +0 -14
- package/dist/codeSign/signManager.d.ts.map +0 -1
- package/dist/codeSign/signManager.js +0 -2
- package/dist/codeSign/signManager.js.map +0 -1
- package/dist/util/yarn.d.ts +0 -23
- package/dist/util/yarn.d.ts.map +0 -1
- package/dist/util/yarn.js +0 -153
- package/dist/util/yarn.js.map +0 -1
|
@@ -7,6 +7,8 @@ import * as path from "path";
|
|
|
7
7
|
import { reactCra } from "../../presets/rectCra.js";
|
|
8
8
|
import { PACKAGE_VERSION } from "../../version.js";
|
|
9
9
|
import { getConfig as _getConfig, loadParentConfig, orNullIfFileNotExist } from "./load.js";
|
|
10
|
+
import { forwardFlatFileOptionReads, isPlainObject, normalizeFileOptions } from "./fileOptions.js";
|
|
11
|
+
import { checkLegacyConfiguration } from "./legacyConfigGuard.js";
|
|
10
12
|
import { validateSchema } from "./schemaValidator.js";
|
|
11
13
|
import _fsExtra from "fs-extra";
|
|
12
14
|
const { readJson } = _fsExtra;
|
|
@@ -30,12 +32,17 @@ function mergePublish(config, configFromOptions) {
|
|
|
30
32
|
deepAssign(listOnDisk[0], publish);
|
|
31
33
|
}
|
|
32
34
|
}
|
|
33
|
-
export
|
|
35
|
+
export function createProjectMetadataLazy(projectDir) {
|
|
36
|
+
return new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, "package.json"))));
|
|
37
|
+
}
|
|
38
|
+
export async function getConfig(projectDir, configPath, configFromOptions, packageMetadata = createProjectMetadataLazy(projectDir)) {
|
|
34
39
|
const configRequest = { packageKey: "build", configFilename: "electron-builder", projectDir, packageMetadata };
|
|
35
40
|
const configAndEffectiveFile = await _getConfig(configRequest, configPath);
|
|
36
|
-
|
|
41
|
+
// Before merging: a CLI `-c.files` must be added to a `fileOptions.files` from the config file, not conflict with it.
|
|
42
|
+
// Both are normalized copies, so the caller's `configFromOptions` (the `config` passed to `build()`) is not rewritten.
|
|
43
|
+
const config = normalizeFileOptions(configAndEffectiveFile == null ? {} : configAndEffectiveFile.result);
|
|
37
44
|
if (configFromOptions != null) {
|
|
38
|
-
mergePublish(config, configFromOptions);
|
|
45
|
+
mergePublish(config, normalizeFileOptions(configFromOptions));
|
|
39
46
|
}
|
|
40
47
|
if (configAndEffectiveFile != null) {
|
|
41
48
|
log.info({ file: configAndEffectiveFile.configFile == null ? 'package.json ("build" field)' : configAndEffectiveFile.configFile }, "loaded configuration");
|
|
@@ -85,14 +92,13 @@ async function loadParentConfigsRecursively(configExtends, loader) {
|
|
|
85
92
|
return configs;
|
|
86
93
|
}
|
|
87
94
|
// normalize for easy merge
|
|
88
|
-
function normalizeFiles(
|
|
89
|
-
let value =
|
|
95
|
+
function normalizeFiles(fileOptions, name) {
|
|
96
|
+
let value = fileOptions[name];
|
|
90
97
|
if (value == null) {
|
|
91
98
|
return;
|
|
92
99
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
100
|
+
// copies, here and for every FileSet below: the list can be the caller's own (programmatic `config`)
|
|
101
|
+
value = Array.isArray(value) ? value.slice() : [value];
|
|
96
102
|
itemLoop: for (let i = 0; i < value.length; i++) {
|
|
97
103
|
let item = value[i];
|
|
98
104
|
if (typeof item === "string") {
|
|
@@ -121,7 +127,14 @@ function normalizeFiles(configuration, name) {
|
|
|
121
127
|
value[i] = item;
|
|
122
128
|
}
|
|
123
129
|
else if (Array.isArray(item)) {
|
|
124
|
-
throw new
|
|
130
|
+
throw new InvalidConfigurationError(`fileOptions.${name} configuration is invalid, nested array not expected for index ${i}: ${item}`);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
item = { ...item };
|
|
134
|
+
if (item.filter != null) {
|
|
135
|
+
item.filter = asArray(item.filter).slice();
|
|
136
|
+
}
|
|
137
|
+
value[i] = item;
|
|
125
138
|
}
|
|
126
139
|
// make sure that merge logic is not complex - unify different presentations
|
|
127
140
|
if (item.from === ".") {
|
|
@@ -130,11 +143,8 @@ function normalizeFiles(configuration, name) {
|
|
|
130
143
|
if (item.to === ".") {
|
|
131
144
|
item.to = undefined;
|
|
132
145
|
}
|
|
133
|
-
if (item.filter != null && typeof item.filter === "string") {
|
|
134
|
-
item.filter = [item.filter];
|
|
135
|
-
}
|
|
136
146
|
}
|
|
137
|
-
|
|
147
|
+
fileOptions[name] = value.filter(it => it != null);
|
|
138
148
|
}
|
|
139
149
|
function isSimilarFileSet(value, other) {
|
|
140
150
|
return value.from === other.from && value.to === other.to;
|
|
@@ -161,18 +171,27 @@ function mergeFileSets(lists) {
|
|
|
161
171
|
* `doMergeConfigs` takes configs in the order you would pass them to
|
|
162
172
|
* Object.assign as sources.
|
|
163
173
|
*/
|
|
164
|
-
export function doMergeConfigs(
|
|
174
|
+
export function doMergeConfigs(inputConfigs) {
|
|
175
|
+
// Copies (root, platform sections and their `fileOptions`): `normalizeFiles`, `deepAssign` and
|
|
176
|
+
// `forwardFlatFileOptionReads` write into them, and they can be the caller's own objects.
|
|
177
|
+
const configs = inputConfigs.map(it => normalizeFileOptions(it));
|
|
165
178
|
for (const config of configs) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
179
|
+
// A non-object `fileOptions` is left as is for `checkLegacyConfiguration` to report.
|
|
180
|
+
if (isPlainObject(config.fileOptions)) {
|
|
181
|
+
normalizeFiles(config.fileOptions, "files");
|
|
182
|
+
normalizeFiles(config.fileOptions, "extraFiles");
|
|
183
|
+
normalizeFiles(config.fileOptions, "extraResources");
|
|
184
|
+
}
|
|
169
185
|
}
|
|
170
|
-
const result = deepAssign(getDefaultConfig(), ...configs);
|
|
171
186
|
// `deepAssign` prioritises latter configs, while `mergeFilesSets` prioritises
|
|
172
187
|
// former configs, so we have to reverse the order, because latter configs
|
|
173
188
|
// must have higher priority.
|
|
174
|
-
|
|
175
|
-
result
|
|
189
|
+
const fileLists = configs.map(config => (config.fileOptions?.files ?? [])).reverse();
|
|
190
|
+
const result = deepAssign(getDefaultConfig(), ...configs);
|
|
191
|
+
if (result.fileOptions == null || isPlainObject(result.fileOptions)) {
|
|
192
|
+
result.fileOptions = { ...result.fileOptions, files: mergeFileSets(fileLists) };
|
|
193
|
+
}
|
|
194
|
+
forwardFlatFileOptionReads(result);
|
|
176
195
|
return result;
|
|
177
196
|
}
|
|
178
197
|
function getDefaultConfig() {
|
|
@@ -185,6 +204,9 @@ function getDefaultConfig() {
|
|
|
185
204
|
}
|
|
186
205
|
const schemeDataPromise = new Lazy(() => readJson(path.join(import.meta.dirname, "..", "..", "..", "scheme.json")));
|
|
187
206
|
export async function validateConfiguration(config, debugLogger) {
|
|
207
|
+
// Runs first so a v26 option produces a targeted "moved to X" message instead of ajv's generic
|
|
208
|
+
// "has an unknown property" — see util/config/legacyConfigGuard.ts.
|
|
209
|
+
checkLegacyConfiguration(config);
|
|
188
210
|
validateSchema(await schemeDataPromise.value, config, {
|
|
189
211
|
name: `electron-builder ${PACKAGE_VERSION}`,
|
|
190
212
|
postFormatter: (formattedError, error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js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AC,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"]}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/util/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAe,yBAAyB,EAAE,GAAG,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzG,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAW,MAAM,sBAAsB,CAAA;AAE1D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAG5B,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,gBAAgB,EA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;IAC/F,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;QACzD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,CAAA;QAC3C,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,UAAU,gBAAgB,CAAC,CAAA;QAC1F,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YAC/B,MAAM,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, FilesBuildOptions } 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 { forwardFlatFileOptionReads, isPlainObject, normalizeFileOptions } from \"./fileOptions.js\"\nimport { checkLegacyConfiguration } from \"./legacyConfigGuard.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 function createProjectMetadataLazy(projectDir: string): Lazy<Record<string, any> | null> {\n return new Lazy(() => orNullIfFileNotExist(readJson(path.join(projectDir, \"package.json\"))))\n}\n\nexport async function getConfig(\n projectDir: string,\n configPath: string | null,\n configFromOptions: Configuration | Nullish,\n packageMetadata: Lazy<Record<string, any> | null> = createProjectMetadataLazy(projectDir)\n): Promise<Configuration> {\n const configRequest: ReadConfigRequest = { packageKey: \"build\", configFilename: \"electron-builder\", projectDir, packageMetadata }\n const configAndEffectiveFile = await _getConfig<Configuration>(configRequest, configPath)\n // Before merging: a CLI `-c.files` must be added to a `fileOptions.files` from the config file, not conflict with it.\n // Both are normalized copies, so the caller's `configFromOptions` (the `config` passed to `build()`) is not rewritten.\n const config = normalizeFileOptions<Configuration>(configAndEffectiveFile == null ? {} : configAndEffectiveFile.result)\n if (configFromOptions != null) {\n mergePublish(config, normalizeFileOptions(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(fileOptions: FilesBuildOptions, name: \"files\" | \"extraFiles\" | \"extraResources\") {\n let value = fileOptions[name]\n if (value == null) {\n return\n }\n\n // copies, here and for every FileSet below: the list can be the caller's own (programmatic `config`)\n value = Array.isArray(value) ? value.slice() : [value]\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 InvalidConfigurationError(`fileOptions.${name} configuration is invalid, nested array not expected for index ${i}: ${item}`)\n } else {\n item = { ...item }\n if (item.filter != null) {\n item.filter = asArray(item.filter).slice()\n }\n value[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\n fileOptions[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(inputConfigs: Configuration[]): Configuration {\n // Copies (root, platform sections and their `fileOptions`): `normalizeFiles`, `deepAssign` and\n // `forwardFlatFileOptionReads` write into them, and they can be the caller's own objects.\n const configs = inputConfigs.map(it => normalizeFileOptions(it))\n for (const config of configs) {\n // A non-object `fileOptions` is left as is for `checkLegacyConfiguration` to report.\n if (isPlainObject(config.fileOptions)) {\n normalizeFiles(config.fileOptions, \"files\")\n normalizeFiles(config.fileOptions, \"extraFiles\")\n normalizeFiles(config.fileOptions, \"extraResources\")\n }\n }\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 const fileLists = configs.map(config => (config.fileOptions?.files ?? []) as FileSet[]).reverse()\n\n const result = deepAssign(getDefaultConfig(), ...configs)\n if (result.fileOptions == null || isPlainObject(result.fileOptions)) {\n result.fileOptions = { ...result.fileOptions, files: mergeFileSets(fileLists) }\n }\n forwardFlatFileOptionReads(result)\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 // Runs first so a v26 option produces a targeted \"moved to X\" message instead of ajv's generic\n // \"has an unknown property\" — see util/config/legacyConfigGuard.ts.\n checkLegacyConfiguration(config)\n\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,30 @@
|
|
|
1
|
+
export declare function isPlainObject(value: unknown): value is Record<string, any>;
|
|
2
|
+
/**
|
|
3
|
+
* Whether `holder` sets the flat `key` itself. Only an own data property counts: the read-forwarding accessors that
|
|
4
|
+
* {@link forwardFlatFileOptionReads} installs must not be mistaken for a flat key (nor be read, which would warn).
|
|
5
|
+
*/
|
|
6
|
+
export declare function hasFlatFileOption(holder: Record<string, any>, key: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Returns `config` with flat `files` / `extraResources` / `extraFiles` keys moved into `fileOptions`, at the root
|
|
9
|
+
* and on every platform key, so that schema validation and everything after config loading see only `fileOptions`.
|
|
10
|
+
*
|
|
11
|
+
* The root, each platform section and their `fileOptions` are shallow copies, never the caller's objects: those can be
|
|
12
|
+
* the `config` passed to `build()`, and the merge and {@link forwardFlatFileOptionReads} write into what is returned.
|
|
13
|
+
*
|
|
14
|
+
* Flat keys are applied as their `fileOptions` counterparts and log one warning per process. When a flat key and its `fileOptions`
|
|
15
|
+
* counterpart are both set on the same object, the nested value wins and the flat one is dropped with a warning.
|
|
16
|
+
* A `fileOptions` that is not an object is left alone (flat keys included) for `checkLegacyConfiguration` to report.
|
|
17
|
+
*/
|
|
18
|
+
export declare function normalizeFileOptions<T extends Record<string, any>>(config: T): T;
|
|
19
|
+
/**
|
|
20
|
+
* Defines `files` / `extraResources` / `extraFiles` on a normalized configuration (root and platform sections, which
|
|
21
|
+
* {@link normalizeFileOptions} made copies of, so a caller's own objects are never decorated) as
|
|
22
|
+
* non-enumerable accessors, so that code reading a flat key (a hook reading `context.packager.config.files`, a
|
|
23
|
+
* `build()` caller reading `buildResult.configuration.extraResources`) gets the `fileOptions` value, with a once-per-key warning.
|
|
24
|
+
*
|
|
25
|
+
* Non-enumerable, so JSON serialization (the effective config), `deepAssign`, spreads and schema validation never see them.
|
|
26
|
+
* Writes throw: a value assigned once file matchers are computed would be silently ignored for the platforms
|
|
27
|
+
* already packed, so the caller is pointed at `fileOptions` instead.
|
|
28
|
+
*/
|
|
29
|
+
export declare function forwardFlatFileOptionReads(config: Record<string, any>): void;
|
|
30
|
+
//# sourceMappingURL=fileOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileOptions.d.ts","sourceRoot":"","sources":["../../../src/util/config/fileOptions.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAE1E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAGnF;AAkBD;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAmBhF;AAoCD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAwB5E"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { InvalidConfigurationError, log } from "builder-util";
|
|
2
|
+
import { ALL_PLATFORM_KEYS, BREAKING_CHANGES_URL, FILE_OPTION_KEYS, FILE_OPTIONS_ANCHOR } from "./legacyOptions.js";
|
|
3
|
+
const FILE_OPTIONS_URL = `${BREAKING_CHANGES_URL}#${FILE_OPTIONS_ANCHOR}`;
|
|
4
|
+
export function isPlainObject(value) {
|
|
5
|
+
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Whether `holder` sets the flat `key` itself. Only an own data property counts: the read-forwarding accessors that
|
|
9
|
+
* {@link forwardFlatFileOptionReads} installs must not be mistaken for a flat key (nor be read, which would warn).
|
|
10
|
+
*/
|
|
11
|
+
export function hasFlatFileOption(holder, key) {
|
|
12
|
+
const descriptor = Object.getOwnPropertyDescriptor(holder, key);
|
|
13
|
+
return descriptor != null && "value" in descriptor && descriptor.value !== undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Calls `fn` for the configuration root and each platform section that is an object. */
|
|
16
|
+
function forEachFileOptionsHolder(config, fn) {
|
|
17
|
+
fn(config, "");
|
|
18
|
+
for (const platform of ALL_PLATFORM_KEYS) {
|
|
19
|
+
if (isPlainObject(config[platform])) {
|
|
20
|
+
fn(config[platform], `${platform}.`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** `mac.files` → `mac.fileOptions.files` */
|
|
25
|
+
function nestedPath(flatPath) {
|
|
26
|
+
const dot = flatPath.lastIndexOf(".");
|
|
27
|
+
return dot === -1 ? `fileOptions.${flatPath}` : `${flatPath.substring(0, dot)}.fileOptions.${flatPath.substring(dot + 1)}`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns `config` with flat `files` / `extraResources` / `extraFiles` keys moved into `fileOptions`, at the root
|
|
31
|
+
* and on every platform key, so that schema validation and everything after config loading see only `fileOptions`.
|
|
32
|
+
*
|
|
33
|
+
* The root, each platform section and their `fileOptions` are shallow copies, never the caller's objects: those can be
|
|
34
|
+
* the `config` passed to `build()`, and the merge and {@link forwardFlatFileOptionReads} write into what is returned.
|
|
35
|
+
*
|
|
36
|
+
* Flat keys are applied as their `fileOptions` counterparts and log one warning per process. When a flat key and its `fileOptions`
|
|
37
|
+
* counterpart are both set on the same object, the nested value wins and the flat one is dropped with a warning.
|
|
38
|
+
* A `fileOptions` that is not an object is left alone (flat keys included) for `checkLegacyConfiguration` to report.
|
|
39
|
+
*/
|
|
40
|
+
export function normalizeFileOptions(config) {
|
|
41
|
+
const moved = [];
|
|
42
|
+
const result = copyHolder(config, "", moved);
|
|
43
|
+
for (const platform of ALL_PLATFORM_KEYS) {
|
|
44
|
+
if (isPlainObject(result[platform])) {
|
|
45
|
+
result[platform] = copyHolder(result[platform], `${platform}.`, moved);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (moved.length > 0) {
|
|
49
|
+
log
|
|
50
|
+
.once("flat-file-options")
|
|
51
|
+
.warn(`\`files\`, \`extraResources\` and \`extraFiles\` belong under \`fileOptions\`. Found [${moved.join(", ")}] outside it; ` +
|
|
52
|
+
`they are applied as ${moved.map(it => `\`${nestedPath(it)}\``).join(", ")}. ` +
|
|
53
|
+
`Run \`electron-builder migrate-schema\` to update the configuration. ${FILE_OPTIONS_URL}`);
|
|
54
|
+
}
|
|
55
|
+
return result;
|
|
56
|
+
}
|
|
57
|
+
/** A shallow copy of `holder` (and of its `fileOptions`) with its flat keys moved into `fileOptions`. */
|
|
58
|
+
function copyHolder(holder, prefix, moved) {
|
|
59
|
+
// only enumerable properties: the read-forwarding accessors of an already loaded configuration are not copied
|
|
60
|
+
const copy = { ...holder };
|
|
61
|
+
const existing = copy.fileOptions;
|
|
62
|
+
if (isPlainObject(existing)) {
|
|
63
|
+
copy.fileOptions = { ...existing };
|
|
64
|
+
}
|
|
65
|
+
const present = FILE_OPTION_KEYS.filter(key => hasFlatFileOption(copy, key));
|
|
66
|
+
if (present.length === 0 || (existing != null && !isPlainObject(existing))) {
|
|
67
|
+
return copy;
|
|
68
|
+
}
|
|
69
|
+
const fileOptions = copy.fileOptions ?? {};
|
|
70
|
+
for (const key of present) {
|
|
71
|
+
const flatPath = `${prefix}${key}`;
|
|
72
|
+
if (fileOptions[key] === undefined) {
|
|
73
|
+
fileOptions[key] = copy[key];
|
|
74
|
+
moved.push(flatPath);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
log
|
|
78
|
+
.once(`file-options-conflict:${flatPath}`)
|
|
79
|
+
.warn(`\`${flatPath}\` and \`${nestedPath(flatPath)}\` are both set. \`${nestedPath(flatPath)}\` is used and \`${flatPath}\` is ignored. ` +
|
|
80
|
+
`Remove \`${flatPath}\`, moving any patterns you still need into \`${nestedPath(flatPath)}\`. ${FILE_OPTIONS_URL}`);
|
|
81
|
+
}
|
|
82
|
+
delete copy[key];
|
|
83
|
+
}
|
|
84
|
+
copy.fileOptions = fileOptions;
|
|
85
|
+
return copy;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Defines `files` / `extraResources` / `extraFiles` on a normalized configuration (root and platform sections, which
|
|
89
|
+
* {@link normalizeFileOptions} made copies of, so a caller's own objects are never decorated) as
|
|
90
|
+
* non-enumerable accessors, so that code reading a flat key (a hook reading `context.packager.config.files`, a
|
|
91
|
+
* `build()` caller reading `buildResult.configuration.extraResources`) gets the `fileOptions` value, with a once-per-key warning.
|
|
92
|
+
*
|
|
93
|
+
* Non-enumerable, so JSON serialization (the effective config), `deepAssign`, spreads and schema validation never see them.
|
|
94
|
+
* Writes throw: a value assigned once file matchers are computed would be silently ignored for the platforms
|
|
95
|
+
* already packed, so the caller is pointed at `fileOptions` instead.
|
|
96
|
+
*/
|
|
97
|
+
export function forwardFlatFileOptionReads(config) {
|
|
98
|
+
forEachFileOptionsHolder(config, (holder, prefix) => {
|
|
99
|
+
for (const key of FILE_OPTION_KEYS) {
|
|
100
|
+
if (Object.prototype.hasOwnProperty.call(holder, key)) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const flatPath = `config.${prefix}${key}`;
|
|
104
|
+
const nested = `config.${nestedPath(prefix + key)}`;
|
|
105
|
+
Object.defineProperty(holder, key, {
|
|
106
|
+
enumerable: false,
|
|
107
|
+
configurable: true,
|
|
108
|
+
get() {
|
|
109
|
+
log.once(`flat-file-options-read:${flatPath}`).warn(`\`${flatPath}\` is not a configuration property; read \`${nested}\`. ${FILE_OPTIONS_URL}`);
|
|
110
|
+
const fileOptions = holder.fileOptions;
|
|
111
|
+
return isPlainObject(fileOptions) ? fileOptions[key] : undefined;
|
|
112
|
+
},
|
|
113
|
+
set() {
|
|
114
|
+
throw new InvalidConfigurationError(`\`${flatPath}\` is not a configuration property and cannot be assigned; set \`${nested}\` instead, before the files are copied (e.g. in a \`beforePack\` hook). ${FILE_OPTIONS_URL}`);
|
|
115
|
+
},
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=fileOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileOptions.js","sourceRoot":"","sources":["../../../src/util/config/fileOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAEnH,MAAM,gBAAgB,GAAG,GAAG,oBAAoB,IAAI,mBAAmB,EAAE,CAAA;AAEzE,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,K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Ac,CAAC,MAAM,EAAE,GAAG,EAAE;gBACjC,UAAU,EAAE,KAAK;gBACjB,YAAY,EAAE,IAAI;gBAClB,GAAG;oBACD,GAAG,CAAC,IAAI,CAAC,0BAA0B,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,QAAQ,8CAA8C,MAAM,OAAO,gBAAgB,EAAE,CAAC,CAAA;oBAC/I,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAA;oBACtC,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;gBAClE,CAAC;gBACD,GAAG;oBACD,MAAM,IAAI,yBAAyB,CACjC,KAAK,QAAQ,oEAAoE,MAAM,4EAA4E,gBAAgB,EAAE,CACtL,CAAA;gBACH,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { InvalidConfigurationError, log } from \"builder-util\"\nimport { ALL_PLATFORM_KEYS, BREAKING_CHANGES_URL, FILE_OPTION_KEYS, FILE_OPTIONS_ANCHOR } from \"./legacyOptions.js\"\n\nconst FILE_OPTIONS_URL = `${BREAKING_CHANGES_URL}#${FILE_OPTIONS_ANCHOR}`\n\nexport function isPlainObject(value: unknown): value is Record<string, any> {\n return value != null && typeof value === \"object\" && !Array.isArray(value)\n}\n\n/**\n * Whether `holder` sets the flat `key` itself. Only an own data property counts: the read-forwarding accessors that\n * {@link forwardFlatFileOptionReads} installs must not be mistaken for a flat key (nor be read, which would warn).\n */\nexport function hasFlatFileOption(holder: Record<string, any>, key: string): boolean {\n const descriptor = Object.getOwnPropertyDescriptor(holder, key)\n return descriptor != null && \"value\" in descriptor && descriptor.value !== undefined\n}\n\n/** Calls `fn` for the configuration root and each platform section that is an object. */\nfunction forEachFileOptionsHolder(config: Record<string, any>, fn: (holder: Record<string, any>, prefix: string) => void): void {\n fn(config, \"\")\n for (const platform of ALL_PLATFORM_KEYS) {\n if (isPlainObject(config[platform])) {\n fn(config[platform], `${platform}.`)\n }\n }\n}\n\n/** `mac.files` → `mac.fileOptions.files` */\nfunction nestedPath(flatPath: string): string {\n const dot = flatPath.lastIndexOf(\".\")\n return dot === -1 ? `fileOptions.${flatPath}` : `${flatPath.substring(0, dot)}.fileOptions.${flatPath.substring(dot + 1)}`\n}\n\n/**\n * Returns `config` with flat `files` / `extraResources` / `extraFiles` keys moved into `fileOptions`, at the root\n * and on every platform key, so that schema validation and everything after config loading see only `fileOptions`.\n *\n * The root, each platform section and their `fileOptions` are shallow copies, never the caller's objects: those can be\n * the `config` passed to `build()`, and the merge and {@link forwardFlatFileOptionReads} write into what is returned.\n *\n * Flat keys are applied as their `fileOptions` counterparts and log one warning per process. When a flat key and its `fileOptions`\n * counterpart are both set on the same object, the nested value wins and the flat one is dropped with a warning.\n * A `fileOptions` that is not an object is left alone (flat keys included) for `checkLegacyConfiguration` to report.\n */\nexport function normalizeFileOptions<T extends Record<string, any>>(config: T): T {\n const moved: string[] = []\n const result = copyHolder(config, \"\", moved)\n for (const platform of ALL_PLATFORM_KEYS) {\n if (isPlainObject(result[platform])) {\n result[platform] = copyHolder(result[platform], `${platform}.`, moved)\n }\n }\n\n if (moved.length > 0) {\n log\n .once(\"flat-file-options\")\n .warn(\n `\\`files\\`, \\`extraResources\\` and \\`extraFiles\\` belong under \\`fileOptions\\`. Found [${moved.join(\", \")}] outside it; ` +\n `they are applied as ${moved.map(it => `\\`${nestedPath(it)}\\``).join(\", \")}. ` +\n `Run \\`electron-builder migrate-schema\\` to update the configuration. ${FILE_OPTIONS_URL}`\n )\n }\n return result as T\n}\n\n/** A shallow copy of `holder` (and of its `fileOptions`) with its flat keys moved into `fileOptions`. */\nfunction copyHolder(holder: Record<string, any>, prefix: string, moved: string[]): Record<string, any> {\n // only enumerable properties: the read-forwarding accessors of an already loaded configuration are not copied\n const copy: Record<string, any> = { ...holder }\n const existing = copy.fileOptions\n if (isPlainObject(existing)) {\n copy.fileOptions = { ...existing }\n }\n\n const present = FILE_OPTION_KEYS.filter(key => hasFlatFileOption(copy, key))\n if (present.length === 0 || (existing != null && !isPlainObject(existing))) {\n return copy\n }\n\n const fileOptions: Record<string, any> = copy.fileOptions ?? {}\n for (const key of present) {\n const flatPath = `${prefix}${key}`\n if (fileOptions[key] === undefined) {\n fileOptions[key] = copy[key]\n moved.push(flatPath)\n } else {\n log\n .once(`file-options-conflict:${flatPath}`)\n .warn(\n `\\`${flatPath}\\` and \\`${nestedPath(flatPath)}\\` are both set. \\`${nestedPath(flatPath)}\\` is used and \\`${flatPath}\\` is ignored. ` +\n `Remove \\`${flatPath}\\`, moving any patterns you still need into \\`${nestedPath(flatPath)}\\`. ${FILE_OPTIONS_URL}`\n )\n }\n delete copy[key]\n }\n copy.fileOptions = fileOptions\n return copy\n}\n\n/**\n * Defines `files` / `extraResources` / `extraFiles` on a normalized configuration (root and platform sections, which\n * {@link normalizeFileOptions} made copies of, so a caller's own objects are never decorated) as\n * non-enumerable accessors, so that code reading a flat key (a hook reading `context.packager.config.files`, a\n * `build()` caller reading `buildResult.configuration.extraResources`) gets the `fileOptions` value, with a once-per-key warning.\n *\n * Non-enumerable, so JSON serialization (the effective config), `deepAssign`, spreads and schema validation never see them.\n * Writes throw: a value assigned once file matchers are computed would be silently ignored for the platforms\n * already packed, so the caller is pointed at `fileOptions` instead.\n */\nexport function forwardFlatFileOptionReads(config: Record<string, any>): void {\n forEachFileOptionsHolder(config, (holder, prefix) => {\n for (const key of FILE_OPTION_KEYS) {\n if (Object.prototype.hasOwnProperty.call(holder, key)) {\n continue\n }\n const flatPath = `config.${prefix}${key}`\n const nested = `config.${nestedPath(prefix + key)}`\n Object.defineProperty(holder, key, {\n enumerable: false,\n configurable: true,\n get() {\n log.once(`flat-file-options-read:${flatPath}`).warn(`\\`${flatPath}\\` is not a configuration property; read \\`${nested}\\`. ${FILE_OPTIONS_URL}`)\n const fileOptions = holder.fileOptions\n return isPlainObject(fileOptions) ? fileOptions[key] : undefined\n },\n set() {\n throw new InvalidConfigurationError(\n `\\`${flatPath}\\` is not a configuration property and cannot be assigned; set \\`${nested}\\` instead, before the files are copied (e.g. in a \\`beforePack\\` hook). ${FILE_OPTIONS_URL}`\n )\n },\n })\n }\n })\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Configuration } from "../../configuration.js";
|
|
2
|
+
/**
|
|
3
|
+
* Throws a single aggregated {@link InvalidConfigurationError} naming every v26 option found, and
|
|
4
|
+
* warns about the ones that are merely discouraged. Runs before schema validation.
|
|
5
|
+
*/
|
|
6
|
+
export declare function checkLegacyConfiguration(config: Configuration): void;
|
|
7
|
+
//# sourceMappingURL=legacyConfigGuard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legacyConfigGuard.d.ts","sourceRoot":"","sources":["../../../src/util/config/legacyConfigGuard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAkNtD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CA2BpE"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { InvalidConfigurationError, log } from "builder-util";
|
|
2
|
+
import { hasFlatFileOption, isPlainObject } from "./fileOptions.js";
|
|
3
|
+
import { ALL_PLATFORM_KEYS, BREAKING_CHANGES_URL, FILE_OPTION_KEYS, FILE_OPTIONS_ANCHOR, formatLegacyOptionMessage, RESOLVED_LEGACY_CONFIG_OPTIONS } from "./legacyOptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* Build-time guard for configurations still written against v26.
|
|
6
|
+
*
|
|
7
|
+
* Almost every removed key is already rejected by `scheme.json` (`additionalProperties: false`), but
|
|
8
|
+
* ajv can only say "has an unknown property 'identity'" — it cannot say the option moved to
|
|
9
|
+
* `mac.sign.identity`. This pass runs *before* schema validation so the targeted message wins, and it
|
|
10
|
+
* aggregates every legacy key into a single error: a config with a dozen moved mac options should
|
|
11
|
+
* not take a dozen build attempts to fix.
|
|
12
|
+
*
|
|
13
|
+
* Nothing here rejects a value a valid v27 config can contain — every guarded path is covered by a
|
|
14
|
+
* test asserting the v27 schema rejects it too.
|
|
15
|
+
*/
|
|
16
|
+
const PLATFORMS_WITH_PUBLISH = ["mac", "win", "linux"];
|
|
17
|
+
/** v26 `snap` options that belong under the base-named sub-key in v27, not directly on `snapcraft`. */
|
|
18
|
+
const SNAPCRAFT_BASE_LEVEL_KEYS = new Set([
|
|
19
|
+
"confinement",
|
|
20
|
+
"grade",
|
|
21
|
+
"stagePackages",
|
|
22
|
+
"buildPackages",
|
|
23
|
+
"plugs",
|
|
24
|
+
"slots",
|
|
25
|
+
"after",
|
|
26
|
+
"environment",
|
|
27
|
+
"hooks",
|
|
28
|
+
"layout",
|
|
29
|
+
"appPartStage",
|
|
30
|
+
"assumes",
|
|
31
|
+
"autoStart",
|
|
32
|
+
"summary",
|
|
33
|
+
"title",
|
|
34
|
+
"compression",
|
|
35
|
+
"allowNativeWayland",
|
|
36
|
+
"useTemplateApp",
|
|
37
|
+
]);
|
|
38
|
+
const SNAPCRAFT_BASES = ["core18", "core20", "core22", "core24", "custom"];
|
|
39
|
+
function docLink(anchor) {
|
|
40
|
+
return ` ${BREAKING_CHANGES_URL}#${anchor}`;
|
|
41
|
+
}
|
|
42
|
+
/** Resolves `path` against `config`, returning the holding object or null when any segment is missing. */
|
|
43
|
+
function resolveParent(config, path) {
|
|
44
|
+
let node = config;
|
|
45
|
+
for (const segment of path) {
|
|
46
|
+
const next = node[segment];
|
|
47
|
+
if (!isPlainObject(next)) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
node = next;
|
|
51
|
+
}
|
|
52
|
+
return node;
|
|
53
|
+
}
|
|
54
|
+
/** Collects the legacy keys present anywhere in the config, using the shared mapping table. */
|
|
55
|
+
function collectLegacyKeys(config, errors, warnings) {
|
|
56
|
+
for (const option of RESOLVED_LEGACY_CONFIG_OPTIONS) {
|
|
57
|
+
const parent = resolveParent(config, option.parentPath);
|
|
58
|
+
if (parent == null || !(option.key in parent)) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const message = formatLegacyOptionMessage(option);
|
|
62
|
+
if (option.severity === "error") {
|
|
63
|
+
errors.push(message);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
warnings.push(message);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* `mac.sign` is a single union in v27, so a custom signer and an options bag can no longer coexist.
|
|
72
|
+
* The sibling fields are already reported by `collectLegacyKeys`; this adds the union explanation so
|
|
73
|
+
* the user knows the two forms are mutually exclusive rather than assuming a mechanical move works.
|
|
74
|
+
*/
|
|
75
|
+
function checkMacCustomSigner(config, errors) {
|
|
76
|
+
for (const platform of ["mac", "mas", "masDev"]) {
|
|
77
|
+
const platformConfig = config[platform];
|
|
78
|
+
if (!isPlainObject(platformConfig)) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const sign = platformConfig.sign;
|
|
82
|
+
if (typeof sign !== "string" && typeof sign !== "function") {
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
const legacySiblings = RESOLVED_LEGACY_CONFIG_OPTIONS.filter(o => o.parentPath.length === 1 && o.parentPath[0] === platform && o.key in platformConfig).map(o => o.key);
|
|
86
|
+
if (legacySiblings.length === 0) {
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
errors.push(`\`${platform}.sign\` is a custom signing function or module path, and \`${platform}\` also sets [${legacySiblings.join(", ")}].\n` +
|
|
90
|
+
` In v27 \`${platform}.sign\` is a single union — a custom signer cannot carry signing options alongside it.\n` +
|
|
91
|
+
` Either keep the custom signer and read those options inside it, or drop it and use an ElectronSignOptions object.\n` +
|
|
92
|
+
docLink("macos-signing-macsign"));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* `win.sign` is a discriminated union in v27. Without `type`, ajv reports one
|
|
97
|
+
* "unknown property" error per union branch and never mentions the missing discriminator.
|
|
98
|
+
*/
|
|
99
|
+
function checkWinSignDiscriminator(config, errors) {
|
|
100
|
+
const sign = config.win?.sign;
|
|
101
|
+
if (!isPlainObject(sign) || "type" in sign) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
errors.push("`win.sign` is missing its `type` discriminator.\n" +
|
|
105
|
+
' v27 types `win.sign` as a union: `type: "signtool" | "hsm" | "pkcs11" | "azure"`.\n' +
|
|
106
|
+
' A config migrated from `win.signtoolOptions` needs `type: "signtool"`; one from `win.azureSignOptions` needs `type: "azure"`.\n' +
|
|
107
|
+
docLink("windows-signing-winsign"));
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `snapcraft.base` is required, but because `snapcraft` is `anyOf[SnapcraftOptions, null]` the ajv
|
|
111
|
+
* output collapses to "configuration.snapcraft should be one of these: null" — which reads as an
|
|
112
|
+
* instruction to null out the config.
|
|
113
|
+
*/
|
|
114
|
+
function checkSnapcraftShape(config, errors) {
|
|
115
|
+
const snapcraft = config.snapcraft;
|
|
116
|
+
if (!isPlainObject(snapcraft)) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (!("base" in snapcraft)) {
|
|
120
|
+
errors.push("`snapcraft` is missing the required `base` field.\n" +
|
|
121
|
+
` Set it to one of ${SNAPCRAFT_BASES.map(b => `"${b}"`).join(" | ")} and nest that base's options under a matching sub-key, ` +
|
|
122
|
+
'e.g. `{ "snapcraft": { "base": "core22", "core22": { … } } }`.\n' +
|
|
123
|
+
docLink("snap-snapcraft"));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const flatKeys = Object.keys(snapcraft).filter(k => SNAPCRAFT_BASE_LEVEL_KEYS.has(k));
|
|
127
|
+
if (flatKeys.length > 0) {
|
|
128
|
+
errors.push(`\`snapcraft\` sets [${flatKeys.join(", ")}] directly, but in v27 those belong under the base-named sub-key.\n` +
|
|
129
|
+
` Move them under \`snapcraft.${snapcraft.base}\`, e.g. \`{ "snapcraft": { "base": "${snapcraft.base}", "${snapcraft.base}": { "${flatKeys[0]}": … } } }\`.\n` +
|
|
130
|
+
docLink("snap-snapcraft"));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* `vPrefixedTagName` was removed from GitHub publish options only — GitLab still supports it, so the
|
|
135
|
+
* check has to discriminate on `provider` rather than on the key name.
|
|
136
|
+
*/
|
|
137
|
+
function checkPublishEntries(config, errors) {
|
|
138
|
+
const check = (value, label) => {
|
|
139
|
+
if (value == null) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
for (const entry of Array.isArray(value) ? value : [value]) {
|
|
143
|
+
if (!isPlainObject(entry) || entry.provider !== "github" || !("vPrefixedTagName" in entry)) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
const suggested = entry.vPrefixedTagName === false ? '""' : '"v"';
|
|
147
|
+
errors.push(`\`${label}.vPrefixedTagName\` was removed from the GitHub publish options in v27.\n` +
|
|
148
|
+
` Use \`tagNamePrefix: ${suggested}\` instead (it defaults to "v", so you can drop the key entirely to keep the default).\n` +
|
|
149
|
+
" This applies to GitHub only — GitLab's `vPrefixedTagName` is unchanged.\n" +
|
|
150
|
+
" Run `electron-builder migrate-schema` to update your configuration automatically.\n" +
|
|
151
|
+
docLink("githuboptions-gitlaboptions-vprefixedtagname"));
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
check(config.publish, "publish");
|
|
155
|
+
for (const platform of PLATFORMS_WITH_PUBLISH) {
|
|
156
|
+
check(config[platform]?.publish, `${platform}.publish`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* `fileOptions` is an object holding the `files` / `extraResources` / `extraFiles` lists. Writing the `files` list itself
|
|
161
|
+
* there (`"fileOptions": ["dist/**"]`) is an easy mistake when moving a `files` key into it by hand, and ajv only reports
|
|
162
|
+
* that `fileOptions` "should be object". `normalizeFileOptions` leaves the flat keys next to such a value in place, so
|
|
163
|
+
* they are named here too.
|
|
164
|
+
*/
|
|
165
|
+
function checkFileOptionsShape(config, errors) {
|
|
166
|
+
const check = (holder, prefix) => {
|
|
167
|
+
const value = holder.fileOptions;
|
|
168
|
+
if (value == null || isPlainObject(value)) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
const flatKeys = FILE_OPTION_KEYS.filter(key => hasFlatFileOption(holder, key)).map(key => `${prefix}${key}`);
|
|
172
|
+
const files = Array.isArray(value) || typeof value === "string" ? JSON.stringify(value) : '["**/*"]';
|
|
173
|
+
errors.push(`\`${prefix}fileOptions\` must be an object holding \`files\`, \`extraResources\` and/or \`extraFiles\`, not ${Array.isArray(value) ? "an array" : `a ${typeof value}`}` +
|
|
174
|
+
(flatKeys.length > 0 ? ` (the configuration also sets [${flatKeys.join(", ")}], which belong inside it)` : "") +
|
|
175
|
+
".\n" +
|
|
176
|
+
` e.g. \`${prefix}fileOptions: { files: ${files} }\`.\n` +
|
|
177
|
+
" Run `electron-builder migrate-schema` (with `--config <path>` if your config file has another name) to move flat `files` / `extraResources` / `extraFiles` keys into it automatically.\n" +
|
|
178
|
+
docLink(FILE_OPTIONS_ANCHOR));
|
|
179
|
+
};
|
|
180
|
+
check(config, "");
|
|
181
|
+
for (const platform of ALL_PLATFORM_KEYS) {
|
|
182
|
+
if (isPlainObject(config[platform])) {
|
|
183
|
+
check(config[platform], `${platform}.`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Throws a single aggregated {@link InvalidConfigurationError} naming every v26 option found, and
|
|
189
|
+
* warns about the ones that are merely discouraged. Runs before schema validation.
|
|
190
|
+
*/
|
|
191
|
+
export function checkLegacyConfiguration(config) {
|
|
192
|
+
const raw = config;
|
|
193
|
+
const errors = [];
|
|
194
|
+
const warnings = [];
|
|
195
|
+
collectLegacyKeys(raw, errors, warnings);
|
|
196
|
+
checkMacCustomSigner(raw, errors);
|
|
197
|
+
checkWinSignDiscriminator(raw, errors);
|
|
198
|
+
checkSnapcraftShape(raw, errors);
|
|
199
|
+
checkPublishEntries(raw, errors);
|
|
200
|
+
checkFileOptionsShape(raw, errors);
|
|
201
|
+
for (const warning of warnings) {
|
|
202
|
+
log.warn(warning);
|
|
203
|
+
}
|
|
204
|
+
if (errors.length === 0) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const header = errors.length === 1
|
|
208
|
+
? "Your configuration uses an option that was removed in electron-builder v27:"
|
|
209
|
+
: `Your configuration uses ${errors.length} options that were removed in electron-builder v27:`;
|
|
210
|
+
const message = [header, "", ...errors.map(e => `• ${e}`), "", `Full list of breaking changes: ${BREAKING_CHANGES_URL}`].join("\n");
|
|
211
|
+
log.error(null, "invalid configuration");
|
|
212
|
+
throw new InvalidConfigurationError(message);
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=legacyConfigGuard.js.map
|