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,332 @@
|
|
|
1
|
+
import { asArray, exists, InvalidConfigurationError, isEmptyOrSpaces, log } from "builder-util";
|
|
2
|
+
import { deepAssign } from "builder-util-runtime";
|
|
3
|
+
import { Lazy } from "lazy-val";
|
|
4
|
+
import { join } from "path";
|
|
5
|
+
import * as semver from "semver";
|
|
6
|
+
import { SnapCore24 } from "./snap/core24.js";
|
|
7
|
+
import { SnapCoreCustom } from "./snap/coreCustom.js";
|
|
8
|
+
import { SnapCoreLegacy } from "./snap/coreLegacy.js";
|
|
9
|
+
import _fsExtra from "fs-extra";
|
|
10
|
+
const { outputFile } = _fsExtra;
|
|
11
|
+
/**
|
|
12
|
+
* Escape a string value for use in a freedesktop .desktop file string field
|
|
13
|
+
* (Name, Comment, StartupWMClass, etc.).
|
|
14
|
+
*
|
|
15
|
+
* The freedesktop Desktop Entry Specification requires that the following
|
|
16
|
+
* characters be escaped in string / localestring values:
|
|
17
|
+
* \n → \\n (newline — would inject new key=value lines otherwise)
|
|
18
|
+
* \r → \\r
|
|
19
|
+
* \t → \\t
|
|
20
|
+
* \\ → \\\\
|
|
21
|
+
*
|
|
22
|
+
* Without escaping, a productName or description containing a literal newline
|
|
23
|
+
* can inject arbitrary key=value pairs into the generated .desktop file,
|
|
24
|
+
* potentially overriding the Exec key.
|
|
25
|
+
*
|
|
26
|
+
* @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#value-types
|
|
27
|
+
*/
|
|
28
|
+
function desktopStringEscape(value) {
|
|
29
|
+
return value.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Characters that require an Exec argument to be double-quoted per the
|
|
33
|
+
* freedesktop Desktop Entry Specification. Plain alphanumeric args and
|
|
34
|
+
* field codes must NOT be wrapped in quotes.
|
|
35
|
+
*
|
|
36
|
+
* @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
|
|
37
|
+
*/
|
|
38
|
+
const EXEC_RESERVED_RE = /[\s"'`\\<>~|&;$*?#()]/;
|
|
39
|
+
/**
|
|
40
|
+
* Quote a single argument for use in a .desktop file Exec key.
|
|
41
|
+
*
|
|
42
|
+
* Field codes (`%f`, `%u`, `%F`, `%U`, etc.) MUST be left unquoted — the
|
|
43
|
+
* desktop launcher only expands them in unquoted token positions. Wrapping
|
|
44
|
+
* them in `"…"` causes the launcher to treat them as literal strings, which
|
|
45
|
+
* breaks file-association / drag-and-drop functionality.
|
|
46
|
+
*
|
|
47
|
+
* For all other arguments, double-quoting is used when the argument contains
|
|
48
|
+
* any character that would be misinterpreted by the launcher without quoting
|
|
49
|
+
* (spaces, shell metacharacters, etc.). Safe plain-word args are passed
|
|
50
|
+
* through unchanged to keep the Exec line readable.
|
|
51
|
+
*
|
|
52
|
+
* @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
|
|
53
|
+
*/
|
|
54
|
+
function desktopExecArgEscape(arg) {
|
|
55
|
+
// Field codes (%f, %u, %F, %U, %i, %c, %k, …) must never be quoted.
|
|
56
|
+
if (/^%[a-zA-Z]$/.test(arg)) {
|
|
57
|
+
return arg;
|
|
58
|
+
}
|
|
59
|
+
// Only quote when the arg actually contains characters that need it.
|
|
60
|
+
if (EXEC_RESERVED_RE.test(arg)) {
|
|
61
|
+
return `"${arg.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
62
|
+
}
|
|
63
|
+
return arg;
|
|
64
|
+
}
|
|
65
|
+
function mapLinuxCompressionToSnap(level) {
|
|
66
|
+
if (level === "store") {
|
|
67
|
+
return "lzo";
|
|
68
|
+
}
|
|
69
|
+
if (level === "maximum") {
|
|
70
|
+
return "xz";
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
export const installPrefix = "/opt";
|
|
75
|
+
export class LinuxTargetHelper {
|
|
76
|
+
constructor(packager) {
|
|
77
|
+
this.packager = packager;
|
|
78
|
+
this.iconPromise = new Lazy(() => this.computeDesktopIcons());
|
|
79
|
+
this.mimeTypeFilesPromise = new Lazy(() => this.computeMimeTypeFiles());
|
|
80
|
+
this.maxIconPath = null;
|
|
81
|
+
}
|
|
82
|
+
get icons() {
|
|
83
|
+
return this.iconPromise.value;
|
|
84
|
+
}
|
|
85
|
+
get mimeTypeFiles() {
|
|
86
|
+
return this.mimeTypeFilesPromise.value;
|
|
87
|
+
}
|
|
88
|
+
getSnapCore() {
|
|
89
|
+
const { snapcraft } = this.packager.config;
|
|
90
|
+
// Merge linux-level options (category, description, mimeTypes, etc.) as the base so they
|
|
91
|
+
// propagate into the generated snapcraft.yaml and .desktop file without requiring users to
|
|
92
|
+
// duplicate them under core24/core18/etc. Per-core options always win for conflicts.
|
|
93
|
+
// linux.compression is a CompressionLevel ("store"/"normal"/"maximum"); snap compression is an
|
|
94
|
+
// algorithm ("xz"/"lzo"). Map the level to the nearest algorithm; per-core options override.
|
|
95
|
+
const { compression: linuxCompression, ...linuxOptions } = this.packager.platformOptions;
|
|
96
|
+
const snapLinuxOptions = { ...linuxOptions, compression: mapLinuxCompressionToSnap(linuxCompression) };
|
|
97
|
+
if (snapcraft != null) {
|
|
98
|
+
const core = snapcraft.base;
|
|
99
|
+
const options = snapcraft[core] || {};
|
|
100
|
+
switch (core) {
|
|
101
|
+
case "core18":
|
|
102
|
+
case "core20":
|
|
103
|
+
case "core22":
|
|
104
|
+
if (!this.isElectronVersionGreaterOrEqualThan("4.0.0")) {
|
|
105
|
+
if (!this.isElectronVersionGreaterOrEqualThan("2.0.0-beta.1")) {
|
|
106
|
+
throw new InvalidConfigurationError("Electron 2 and higher is required to build Snap with core18/core20/core22");
|
|
107
|
+
}
|
|
108
|
+
log.warn(null, "electron 4 and higher is highly recommended for Snap with core18/core20/core22");
|
|
109
|
+
}
|
|
110
|
+
return new SnapCoreLegacy(this.packager, this, deepAssign({ base: core }, snapLinuxOptions, options));
|
|
111
|
+
case "core24":
|
|
112
|
+
if (!this.isElectronVersionGreaterOrEqualThan("28.0.0")) {
|
|
113
|
+
if (!this.isElectronVersionGreaterOrEqualThan("25.0.0")) {
|
|
114
|
+
throw new InvalidConfigurationError("Electron 25 and higher is required to build Snap with core24");
|
|
115
|
+
}
|
|
116
|
+
log.warn(null, "electron 28 and higher is highly recommended for Snap with core24");
|
|
117
|
+
}
|
|
118
|
+
return new SnapCore24(this.packager, this, deepAssign({}, snapLinuxOptions, options));
|
|
119
|
+
case "custom":
|
|
120
|
+
// Pass-through: do not inject linux options into user-supplied yaml
|
|
121
|
+
return new SnapCoreCustom(this.packager, this, snapcraft.custom || {});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return new SnapCoreLegacy(this.packager, this, deepAssign({ base: "core20" }, snapLinuxOptions, {}));
|
|
125
|
+
}
|
|
126
|
+
isElectronVersionGreaterOrEqualThan(version, fallback) {
|
|
127
|
+
const electronVersion = this.packager.config.electronVersion;
|
|
128
|
+
if (!electronVersion) {
|
|
129
|
+
return fallback ? semver.gte(fallback, version) : true;
|
|
130
|
+
}
|
|
131
|
+
return semver.gte(electronVersion, version);
|
|
132
|
+
}
|
|
133
|
+
async computeMimeTypeFiles() {
|
|
134
|
+
const items = [];
|
|
135
|
+
for (const fileAssociation of this.packager.fileAssociations) {
|
|
136
|
+
if (!fileAssociation.mimeType) {
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
const data = `<mime-type type="${fileAssociation.mimeType}">
|
|
140
|
+
<glob pattern="*.${fileAssociation.ext}"/>
|
|
141
|
+
${fileAssociation.description ? `<comment>${fileAssociation.description}</comment>` : ""}
|
|
142
|
+
<icon name="x-office-document" />
|
|
143
|
+
</mime-type>`;
|
|
144
|
+
items.push(data);
|
|
145
|
+
}
|
|
146
|
+
if (items.length === 0) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
const file = await this.packager.getTempFile(".xml");
|
|
150
|
+
await outputFile(file, '<?xml version="1.0" encoding="utf-8"?>\n<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">\n' + items.join("\n") + "\n</mime-info>");
|
|
151
|
+
return file;
|
|
152
|
+
}
|
|
153
|
+
// must be name without spaces and other special characters, but not product name used
|
|
154
|
+
async computeDesktopIcons() {
|
|
155
|
+
const packager = this.packager;
|
|
156
|
+
const { config } = packager;
|
|
157
|
+
const platformOptions = packager.platformOptions;
|
|
158
|
+
const sources = [platformOptions.icon, config.mac?.icon ?? config.icon].filter(str => !!str);
|
|
159
|
+
// If no explicit sources are defined, fallback to buildResources directory, then default framework icon
|
|
160
|
+
let fallbackSources = [...asArray(packager.getDefaultFrameworkIcon())];
|
|
161
|
+
const buildResources = config.directories?.buildResources;
|
|
162
|
+
if (buildResources && (await exists(join(buildResources, "icons")))) {
|
|
163
|
+
fallbackSources = [buildResources, ...fallbackSources];
|
|
164
|
+
}
|
|
165
|
+
// need to put here and not as default because need to resolve image size
|
|
166
|
+
const result = await packager.resolveIcon(sources, fallbackSources, "set");
|
|
167
|
+
this.maxIconPath = result[result.length - 1].file;
|
|
168
|
+
// Ignore .icon files for linux (they are exclusive for macOS)
|
|
169
|
+
return result.filter(icon => !icon.file.endsWith(".icon"));
|
|
170
|
+
}
|
|
171
|
+
getDescription(options) {
|
|
172
|
+
return options.description || this.packager.appInfo.description;
|
|
173
|
+
}
|
|
174
|
+
getSanitizedVersion(target) {
|
|
175
|
+
const { appInfo: { version }, } = this.packager;
|
|
176
|
+
switch (target) {
|
|
177
|
+
case "pacman":
|
|
178
|
+
return version.replace(/-/g, "_");
|
|
179
|
+
case "rpm":
|
|
180
|
+
case "deb":
|
|
181
|
+
return version.replace(/-/g, "~");
|
|
182
|
+
default:
|
|
183
|
+
return version;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async writeDesktopEntry(targetSpecificOptions, exec, destination, extra) {
|
|
187
|
+
const data = await this.computeDesktopEntry(targetSpecificOptions, exec, extra);
|
|
188
|
+
const file = destination || (await this.packager.getTempFile(`${this.packager.appInfo.productFilename}.desktop`));
|
|
189
|
+
await outputFile(file, data);
|
|
190
|
+
return file;
|
|
191
|
+
}
|
|
192
|
+
getDesktopFileName(fallback = this.packager.executableName) {
|
|
193
|
+
if (!this.packager.platformOptions.syncDesktopName) {
|
|
194
|
+
return fallback;
|
|
195
|
+
}
|
|
196
|
+
const trimmedDesktopName = this.packager.metadata.desktopName?.trim();
|
|
197
|
+
if (isEmptyOrSpaces(trimmedDesktopName)) {
|
|
198
|
+
return fallback;
|
|
199
|
+
}
|
|
200
|
+
const basename = trimmedDesktopName.replace(/\.desktop$/, "");
|
|
201
|
+
// Guard against path traversal: desktopName flows into filesystem paths
|
|
202
|
+
// (snap/gui/<name>.desktop, /usr/share/applications/<name>.desktop, etc.).
|
|
203
|
+
if (/[/\\]/.test(basename) || [...basename].some(c => c.charCodeAt(0) === 0)) {
|
|
204
|
+
throw new InvalidConfigurationError(`desktopName "${trimmedDesktopName}" produces an invalid .desktop filename — remove any path separators or NUL characters`);
|
|
205
|
+
}
|
|
206
|
+
return basename;
|
|
207
|
+
}
|
|
208
|
+
computeDesktopEntry(targetSpecificOptions, exec, extra) {
|
|
209
|
+
if (exec != null && exec.length === 0) {
|
|
210
|
+
throw new Error("Specified exec is empty");
|
|
211
|
+
}
|
|
212
|
+
// https://github.com/electron-userland/electron-builder/issues/3418
|
|
213
|
+
if (targetSpecificOptions.desktop?.entry?.Exec) {
|
|
214
|
+
throw new Error("Please specify executable name as linux.executableName instead of linux.desktop.Exec");
|
|
215
|
+
}
|
|
216
|
+
const packager = this.packager;
|
|
217
|
+
const appInfo = packager.appInfo;
|
|
218
|
+
const executableArgs = targetSpecificOptions.executableArgs;
|
|
219
|
+
if (exec == null) {
|
|
220
|
+
exec = `${installPrefix}/${appInfo.sanitizedProductName}/${packager.executableName}`;
|
|
221
|
+
if (!/^[/0-9A-Za-z._-]+$/.test(exec)) {
|
|
222
|
+
exec = `"${exec}"`;
|
|
223
|
+
}
|
|
224
|
+
if (executableArgs) {
|
|
225
|
+
exec += " ";
|
|
226
|
+
// Each arg is double-quoted per the freedesktop Exec key spec so that
|
|
227
|
+
// spaces, $, ;, & and other reserved characters are not misinterpreted.
|
|
228
|
+
exec += executableArgs.map(desktopExecArgEscape).join(" ");
|
|
229
|
+
}
|
|
230
|
+
// https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables
|
|
231
|
+
const execCodes = ["%f", "%u", "%F", "%U"];
|
|
232
|
+
if (executableArgs == null || executableArgs.findIndex(arg => execCodes.includes(arg)) === -1) {
|
|
233
|
+
exec += " %U";
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// https://github.com/electron-userland/electron-builder/issues/9103
|
|
237
|
+
// Electron derives app_id from desktopName in package.json; StartupWMClass must match.
|
|
238
|
+
// https://github.com/electron/electron/blob/9a7b73b5334f1d72c08e2d5e94106706ed751186/lib/browser/init.ts#L128-L133
|
|
239
|
+
const trimmedDesktopName = packager.metadata.desktopName?.trim();
|
|
240
|
+
if (isEmptyOrSpaces(trimmedDesktopName)) {
|
|
241
|
+
log.warn({
|
|
242
|
+
reason: "desktopName is not set in package.json",
|
|
243
|
+
docs: "https://www.electron.build/linux#window-association-desktopname--syncdesktopname",
|
|
244
|
+
}, "electron uses desktopName as app_id / WM_CLASS for window association. Without it desktop environments may not link running windows to this .desktop entry. Set desktopName in package.json and linux.syncDesktopName: true to fix.");
|
|
245
|
+
}
|
|
246
|
+
const wmClass = !isEmptyOrSpaces(trimmedDesktopName) ? trimmedDesktopName.replace(/\.desktop$/, "") : appInfo.productName;
|
|
247
|
+
const desktopMeta = deepAssign({
|
|
248
|
+
// String values are escaped per the freedesktop spec (\\, \n, \r, \t)
|
|
249
|
+
// so that a product name containing a newline cannot inject new key=value
|
|
250
|
+
// pairs into the .desktop file (e.g. overriding the Exec key).
|
|
251
|
+
Name: desktopStringEscape(appInfo.productName),
|
|
252
|
+
Exec: exec,
|
|
253
|
+
Terminal: "false",
|
|
254
|
+
Type: "Application",
|
|
255
|
+
Icon: packager.executableName,
|
|
256
|
+
// https://askubuntu.com/questions/367396/what-represent-the-startupwmclass-field-of-a-desktop-file
|
|
257
|
+
// Set to desktopName (minus .desktop suffix) when provided, so it matches Electron's
|
|
258
|
+
// app_id and desktop environments can associate running windows with this entry.
|
|
259
|
+
// Falls back to productName for apps that don't set desktopName.
|
|
260
|
+
// to get WM_CLASS of running window: xprop WM_CLASS
|
|
261
|
+
// StartupWMClass doesn't work for unicode
|
|
262
|
+
// https://github.com/electron/electron/blob/2-0-x/atom/browser/native_window_views.cc#L226
|
|
263
|
+
StartupWMClass: desktopStringEscape(wmClass),
|
|
264
|
+
}, extra, targetSpecificOptions.desktop?.entry ?? {});
|
|
265
|
+
const description = this.getDescription(targetSpecificOptions);
|
|
266
|
+
if (!isEmptyOrSpaces(description)) {
|
|
267
|
+
desktopMeta.Comment = desktopStringEscape(description);
|
|
268
|
+
}
|
|
269
|
+
const mimeTypes = asArray(targetSpecificOptions.mimeTypes);
|
|
270
|
+
for (const fileAssociation of packager.fileAssociations) {
|
|
271
|
+
if (fileAssociation.mimeType != null) {
|
|
272
|
+
mimeTypes.push(fileAssociation.mimeType);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
for (const protocol of asArray(packager.config.protocols).concat(asArray(packager.platformOptions.protocols))) {
|
|
276
|
+
for (const scheme of asArray(protocol.schemes)) {
|
|
277
|
+
mimeTypes.push(`x-scheme-handler/${scheme}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (mimeTypes.length !== 0) {
|
|
281
|
+
desktopMeta.MimeType = mimeTypes.join(";") + ";";
|
|
282
|
+
}
|
|
283
|
+
let category = targetSpecificOptions.category;
|
|
284
|
+
if (isEmptyOrSpaces(category)) {
|
|
285
|
+
const macCategory = (packager.config.mac || {}).category;
|
|
286
|
+
if (macCategory != null) {
|
|
287
|
+
category = macToLinuxCategory[macCategory];
|
|
288
|
+
}
|
|
289
|
+
if (category == null) {
|
|
290
|
+
// https://github.com/develar/onshape-desktop-shell/issues/48
|
|
291
|
+
if (macCategory != null) {
|
|
292
|
+
log.warn({ macCategory }, "cannot map macOS category to Linux. If possible mapping is known for you, please file issue to add it.");
|
|
293
|
+
}
|
|
294
|
+
log.warn({
|
|
295
|
+
reason: "linux.category is not set and cannot map from macOS",
|
|
296
|
+
docs: "https://www.electron.build/linux",
|
|
297
|
+
}, 'application Linux category is set to default "Utility"');
|
|
298
|
+
category = "Utility";
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
desktopMeta.Categories = `${category}${category.endsWith(";") ? "" : ";"}`;
|
|
302
|
+
let data = `[Desktop Entry]`;
|
|
303
|
+
for (const name of Object.keys(desktopMeta)) {
|
|
304
|
+
data += `\n${name}=${desktopMeta[name]}`;
|
|
305
|
+
}
|
|
306
|
+
data += "\n";
|
|
307
|
+
const desktopActions = targetSpecificOptions.desktop?.desktopActions ?? {};
|
|
308
|
+
for (const [actionName, config] of Object.entries(desktopActions)) {
|
|
309
|
+
if (!Object.keys(config ?? {}).length) {
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
data += `\n[Desktop Action ${actionName}]`;
|
|
313
|
+
for (const [key, value] of Object.entries(config ?? {})) {
|
|
314
|
+
data += `\n${key}=${value}`;
|
|
315
|
+
}
|
|
316
|
+
data += "\n";
|
|
317
|
+
}
|
|
318
|
+
return Promise.resolve(data);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const macToLinuxCategory = {
|
|
322
|
+
"public.app-category.graphics-design": "Graphics",
|
|
323
|
+
"public.app-category.developer-tools": "Development",
|
|
324
|
+
"public.app-category.education": "Education",
|
|
325
|
+
"public.app-category.games": "Game",
|
|
326
|
+
"public.app-category.video": "Video;AudioVideo",
|
|
327
|
+
"public.app-category.utilities": "Utility",
|
|
328
|
+
"public.app-category.social-networking": "Network;Chat",
|
|
329
|
+
"public.app-category.finance": "Office;Finance",
|
|
330
|
+
"public.app-category.music": "Audio;AudioVideo",
|
|
331
|
+
};
|
|
332
|
+
//# sourceMappingURL=LinuxTargetHelper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinuxTargetHelper.js","sourceRoot":"","sources":["../../../src/targets/linux/LinuxTargetHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,yBAAyB,EAAE,eAAe,EAAE,GAAG,EAAE,MAAM,cAAc,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAKhC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO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,EAAE,MAAM;IACnC,2BAA2B,EAAE,kBAAkB;IAC/C,+BAA+B,EAAE,SAAS;IAC1C,uCAAuC,EAAE,cAAc;IACvD,6BAA6B,EAAE,gBAAgB;IAC/C,2BAA2B,EAAE,kBAAkB;CAChD,CAAA","sourcesContent":["import { asArray, exists, InvalidConfigurationError, isEmptyOrSpaces, log } from \"builder-util\"\nimport { deepAssign } from \"builder-util-runtime\"\n\nimport { Lazy } from \"lazy-val\"\nimport { join } from \"path\"\nimport * as semver from \"semver\"\nimport { CompressionLevel } from \"../../core.js\"\nimport { LinuxPackager } from \"../../linuxPackager.js\"\nimport { CommonLinuxOptions } from \"../../options/linuxOptions.js\"\nimport { SnapCore } from \"./snap/SnapTarget.js\"\nimport { SnapCore24 } from \"./snap/core24.js\"\nimport { SnapCoreCustom } from \"./snap/coreCustom.js\"\nimport { SnapCoreLegacy } from \"./snap/coreLegacy.js\"\nimport { IconInfo } from \"../../util/iconConverter.js\"\nimport _fsExtra from \"fs-extra\"\nconst { outputFile } = _fsExtra\n\n/**\n * Escape a string value for use in a freedesktop .desktop file string field\n * (Name, Comment, StartupWMClass, etc.).\n *\n * The freedesktop Desktop Entry Specification requires that the following\n * characters be escaped in string / localestring values:\n * \\n → \\\\n (newline — would inject new key=value lines otherwise)\n * \\r → \\\\r\n * \\t → \\\\t\n * \\\\ → \\\\\\\\\n *\n * Without escaping, a productName or description containing a literal newline\n * can inject arbitrary key=value pairs into the generated .desktop file,\n * potentially overriding the Exec key.\n *\n * @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#value-types\n */\nfunction desktopStringEscape(value: string): string {\n return value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\n/g, \"\\\\n\").replace(/\\r/g, \"\\\\r\").replace(/\\t/g, \"\\\\t\")\n}\n\n/**\n * Characters that require an Exec argument to be double-quoted per the\n * freedesktop Desktop Entry Specification. Plain alphanumeric args and\n * field codes must NOT be wrapped in quotes.\n *\n * @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables\n */\nconst EXEC_RESERVED_RE = /[\\s\"'`\\\\<>~|&;$*?#()]/\n\n/**\n * Quote a single argument for use in a .desktop file Exec key.\n *\n * Field codes (`%f`, `%u`, `%F`, `%U`, etc.) MUST be left unquoted — the\n * desktop launcher only expands them in unquoted token positions. Wrapping\n * them in `\"…\"` causes the launcher to treat them as literal strings, which\n * breaks file-association / drag-and-drop functionality.\n *\n * For all other arguments, double-quoting is used when the argument contains\n * any character that would be misinterpreted by the launcher without quoting\n * (spaces, shell metacharacters, etc.). Safe plain-word args are passed\n * through unchanged to keep the Exec line readable.\n *\n * @see https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables\n */\nfunction desktopExecArgEscape(arg: string): string {\n // Field codes (%f, %u, %F, %U, %i, %c, %k, …) must never be quoted.\n if (/^%[a-zA-Z]$/.test(arg)) {\n return arg\n }\n // Only quote when the arg actually contains characters that need it.\n if (EXEC_RESERVED_RE.test(arg)) {\n return `\"${arg.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"')}\"`\n }\n return arg\n}\n\nfunction mapLinuxCompressionToSnap(level: CompressionLevel | null | undefined): \"xz\" | \"lzo\" | undefined {\n if (level === \"store\") {\n return \"lzo\"\n }\n if (level === \"maximum\") {\n return \"xz\"\n }\n return undefined\n}\n\nexport const installPrefix = \"/opt\"\n\nexport class LinuxTargetHelper {\n private readonly iconPromise = new Lazy(() => this.computeDesktopIcons())\n\n private readonly mimeTypeFilesPromise = new Lazy(() => this.computeMimeTypeFiles())\n\n maxIconPath: string | null = null\n\n constructor(private packager: LinuxPackager) {}\n\n get icons(): Promise<Array<IconInfo>> {\n return this.iconPromise.value\n }\n\n get mimeTypeFiles(): Promise<string | null> {\n return this.mimeTypeFilesPromise.value\n }\n\n getSnapCore(): SnapCore<any> {\n const { snapcraft } = this.packager.config\n\n // Merge linux-level options (category, description, mimeTypes, etc.) as the base so they\n // propagate into the generated snapcraft.yaml and .desktop file without requiring users to\n // duplicate them under core24/core18/etc. Per-core options always win for conflicts.\n // linux.compression is a CompressionLevel (\"store\"/\"normal\"/\"maximum\"); snap compression is an\n // algorithm (\"xz\"/\"lzo\"). Map the level to the nearest algorithm; per-core options override.\n const { compression: linuxCompression, ...linuxOptions } = this.packager.platformOptions\n const snapLinuxOptions = { ...linuxOptions, compression: mapLinuxCompressionToSnap(linuxCompression) }\n\n if (snapcraft != null) {\n const core = snapcraft.base\n const options = snapcraft[core] || {}\n switch (core) {\n case \"core18\":\n case \"core20\":\n case \"core22\":\n if (!this.isElectronVersionGreaterOrEqualThan(\"4.0.0\")) {\n if (!this.isElectronVersionGreaterOrEqualThan(\"2.0.0-beta.1\")) {\n throw new InvalidConfigurationError(\"Electron 2 and higher is required to build Snap with core18/core20/core22\")\n }\n log.warn(null, \"electron 4 and higher is highly recommended for Snap with core18/core20/core22\")\n }\n return new SnapCoreLegacy(this.packager, this, deepAssign({ base: core }, snapLinuxOptions, options))\n case \"core24\":\n if (!this.isElectronVersionGreaterOrEqualThan(\"28.0.0\")) {\n if (!this.isElectronVersionGreaterOrEqualThan(\"25.0.0\")) {\n throw new InvalidConfigurationError(\"Electron 25 and higher is required to build Snap with core24\")\n }\n log.warn(null, \"electron 28 and higher is highly recommended for Snap with core24\")\n }\n return new SnapCore24(this.packager, this, deepAssign({}, snapLinuxOptions, options))\n case \"custom\":\n // Pass-through: do not inject linux options into user-supplied yaml\n return new SnapCoreCustom(this.packager, this, snapcraft.custom || {})\n }\n }\n return new SnapCoreLegacy(this.packager, this, deepAssign({ base: \"core20\" as const }, snapLinuxOptions, {}))\n }\n\n isElectronVersionGreaterOrEqualThan(version: string, fallback?: string): boolean {\n const electronVersion = this.packager.config.electronVersion\n if (!electronVersion) {\n return fallback ? semver.gte(fallback, version) : true\n }\n return semver.gte(electronVersion, version)\n }\n\n private async computeMimeTypeFiles(): Promise<string | null> {\n const items: Array<string> = []\n for (const fileAssociation of this.packager.fileAssociations) {\n if (!fileAssociation.mimeType) {\n continue\n }\n\n const data = `<mime-type type=\"${fileAssociation.mimeType}\">\n <glob pattern=\"*.${fileAssociation.ext}\"/>\n ${fileAssociation.description ? `<comment>${fileAssociation.description}</comment>` : \"\"}\n <icon name=\"x-office-document\" />\n</mime-type>`\n items.push(data)\n }\n\n if (items.length === 0) {\n return null\n }\n\n const file = await this.packager.getTempFile(\".xml\")\n await outputFile(\n file,\n '<?xml version=\"1.0\" encoding=\"utf-8\"?>\\n<mime-info xmlns=\"http://www.freedesktop.org/standards/shared-mime-info\">\\n' + items.join(\"\\n\") + \"\\n</mime-info>\"\n )\n return file\n }\n\n // must be name without spaces and other special characters, but not product name used\n private async computeDesktopIcons(): Promise<Array<IconInfo>> {\n const packager = this.packager\n const { config } = packager\n const platformOptions = packager.platformOptions\n\n const sources = [platformOptions.icon, config.mac?.icon ?? config.icon].filter(str => !!str) as string[]\n\n // If no explicit sources are defined, fallback to buildResources directory, then default framework icon\n let fallbackSources = [...asArray(packager.getDefaultFrameworkIcon())]\n const buildResources = config.directories?.buildResources\n if (buildResources && (await exists(join(buildResources, \"icons\")))) {\n fallbackSources = [buildResources, ...fallbackSources]\n }\n\n // need to put here and not as default because need to resolve image size\n const result = await packager.resolveIcon(sources, fallbackSources, \"set\")\n this.maxIconPath = result[result.length - 1].file\n\n // Ignore .icon files for linux (they are exclusive for macOS)\n return result.filter(icon => !icon.file.endsWith(\".icon\"))\n }\n\n getDescription(options: CommonLinuxOptions) {\n return options.description || this.packager.appInfo.description\n }\n\n getSanitizedVersion(target: string) {\n const {\n appInfo: { version },\n } = this.packager\n switch (target) {\n case \"pacman\":\n return version.replace(/-/g, \"_\")\n case \"rpm\":\n case \"deb\":\n return version.replace(/-/g, \"~\")\n default:\n return version\n }\n }\n\n async writeDesktopEntry(targetSpecificOptions: CommonLinuxOptions, exec?: string, destination?: string | null, extra?: Record<string, string>): Promise<string> {\n const data = await this.computeDesktopEntry(targetSpecificOptions, exec, extra)\n const file = destination || (await this.packager.getTempFile(`${this.packager.appInfo.productFilename}.desktop`))\n await outputFile(file, data)\n return file\n }\n\n getDesktopFileName(fallback: string = this.packager.executableName): string {\n if (!this.packager.platformOptions.syncDesktopName) {\n return fallback\n }\n const trimmedDesktopName = this.packager.metadata.desktopName?.trim()\n if (isEmptyOrSpaces(trimmedDesktopName)) {\n return fallback\n }\n const basename = trimmedDesktopName.replace(/\\.desktop$/, \"\")\n // Guard against path traversal: desktopName flows into filesystem paths\n // (snap/gui/<name>.desktop, /usr/share/applications/<name>.desktop, etc.).\n if (/[/\\\\]/.test(basename) || [...basename].some(c => c.charCodeAt(0) === 0)) {\n throw new InvalidConfigurationError(`desktopName \"${trimmedDesktopName}\" produces an invalid .desktop filename — remove any path separators or NUL characters`)\n }\n return basename\n }\n\n computeDesktopEntry(targetSpecificOptions: CommonLinuxOptions, exec?: string, extra?: Record<string, string>): Promise<string> {\n if (exec != null && exec.length === 0) {\n throw new Error(\"Specified exec is empty\")\n }\n // https://github.com/electron-userland/electron-builder/issues/3418\n if (targetSpecificOptions.desktop?.entry?.Exec) {\n throw new Error(\"Please specify executable name as linux.executableName instead of linux.desktop.Exec\")\n }\n\n const packager = this.packager\n const appInfo = packager.appInfo\n\n const executableArgs = targetSpecificOptions.executableArgs\n if (exec == null) {\n exec = `${installPrefix}/${appInfo.sanitizedProductName}/${packager.executableName}`\n if (!/^[/0-9A-Za-z._-]+$/.test(exec)) {\n exec = `\"${exec}\"`\n }\n if (executableArgs) {\n exec += \" \"\n // Each arg is double-quoted per the freedesktop Exec key spec so that\n // spaces, $, ;, & and other reserved characters are not misinterpreted.\n exec += executableArgs.map(desktopExecArgEscape).join(\" \")\n }\n // https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#exec-variables\n const execCodes = [\"%f\", \"%u\", \"%F\", \"%U\"]\n if (executableArgs == null || executableArgs.findIndex(arg => execCodes.includes(arg)) === -1) {\n exec += \" %U\"\n }\n }\n\n // https://github.com/electron-userland/electron-builder/issues/9103\n // Electron derives app_id from desktopName in package.json; StartupWMClass must match.\n // https://github.com/electron/electron/blob/9a7b73b5334f1d72c08e2d5e94106706ed751186/lib/browser/init.ts#L128-L133\n const trimmedDesktopName = packager.metadata.desktopName?.trim()\n if (isEmptyOrSpaces(trimmedDesktopName)) {\n log.warn(\n {\n reason: \"desktopName is not set in package.json\",\n docs: \"https://www.electron.build/linux#window-association-desktopname--syncdesktopname\",\n },\n \"electron uses desktopName as app_id / WM_CLASS for window association. Without it desktop environments may not link running windows to this .desktop entry. Set desktopName in package.json and linux.syncDesktopName: true to fix.\"\n )\n }\n const wmClass = !isEmptyOrSpaces(trimmedDesktopName) ? trimmedDesktopName.replace(/\\.desktop$/, \"\") : appInfo.productName\n\n const desktopMeta = deepAssign<any>(\n {\n // String values are escaped per the freedesktop spec (\\\\, \\n, \\r, \\t)\n // so that a product name containing a newline cannot inject new key=value\n // pairs into the .desktop file (e.g. overriding the Exec key).\n Name: desktopStringEscape(appInfo.productName),\n Exec: exec,\n Terminal: \"false\",\n Type: \"Application\",\n Icon: packager.executableName,\n // https://askubuntu.com/questions/367396/what-represent-the-startupwmclass-field-of-a-desktop-file\n // Set to desktopName (minus .desktop suffix) when provided, so it matches Electron's\n // app_id and desktop environments can associate running windows with this entry.\n // Falls back to productName for apps that don't set desktopName.\n // to get WM_CLASS of running window: xprop WM_CLASS\n // StartupWMClass doesn't work for unicode\n // https://github.com/electron/electron/blob/2-0-x/atom/browser/native_window_views.cc#L226\n StartupWMClass: desktopStringEscape(wmClass),\n },\n extra,\n targetSpecificOptions.desktop?.entry ?? {}\n )\n\n const description = this.getDescription(targetSpecificOptions)\n if (!isEmptyOrSpaces(description)) {\n desktopMeta.Comment = desktopStringEscape(description)\n }\n\n const mimeTypes: Array<string> = asArray(targetSpecificOptions.mimeTypes)\n for (const fileAssociation of packager.fileAssociations) {\n if (fileAssociation.mimeType != null) {\n mimeTypes.push(fileAssociation.mimeType)\n }\n }\n\n for (const protocol of asArray(packager.config.protocols).concat(asArray(packager.platformOptions.protocols))) {\n for (const scheme of asArray(protocol.schemes)) {\n mimeTypes.push(`x-scheme-handler/${scheme}`)\n }\n }\n\n if (mimeTypes.length !== 0) {\n desktopMeta.MimeType = mimeTypes.join(\";\") + \";\"\n }\n\n let category = targetSpecificOptions.category\n if (isEmptyOrSpaces(category)) {\n const macCategory = (packager.config.mac || {}).category\n if (macCategory != null) {\n category = macToLinuxCategory[macCategory]\n }\n\n if (category == null) {\n // https://github.com/develar/onshape-desktop-shell/issues/48\n if (macCategory != null) {\n log.warn({ macCategory }, \"cannot map macOS category to Linux. If possible mapping is known for you, please file issue to add it.\")\n }\n log.warn(\n {\n reason: \"linux.category is not set and cannot map from macOS\",\n docs: \"https://www.electron.build/linux\",\n },\n 'application Linux category is set to default \"Utility\"'\n )\n category = \"Utility\"\n }\n }\n desktopMeta.Categories = `${category}${category.endsWith(\";\") ? \"\" : \";\"}`\n\n let data = `[Desktop Entry]`\n for (const name of Object.keys(desktopMeta)) {\n data += `\\n${name}=${desktopMeta[name]}`\n }\n data += \"\\n\"\n const desktopActions = targetSpecificOptions.desktop?.desktopActions ?? {}\n for (const [actionName, config] of Object.entries(desktopActions)) {\n if (!Object.keys(config ?? {}).length) {\n continue\n }\n data += `\\n[Desktop Action ${actionName}]`\n for (const [key, value] of Object.entries(config ?? {})) {\n data += `\\n${key}=${value}`\n }\n data += \"\\n\"\n }\n return Promise.resolve(data)\n }\n}\n\nconst macToLinuxCategory: any = {\n \"public.app-category.graphics-design\": \"Graphics\",\n \"public.app-category.developer-tools\": \"Development\",\n \"public.app-category.education\": \"Education\",\n \"public.app-category.games\": \"Game\",\n \"public.app-category.video\": \"Video;AudioVideo\",\n \"public.app-category.utilities\": \"Utility\",\n \"public.app-category.social-networking\": \"Network;Chat\",\n \"public.app-category.finance\": \"Office;Finance\",\n \"public.app-category.music\": \"Audio;AudioVideo\",\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Arch } from "builder-util";
|
|
2
|
+
import { Target } from "../../../core.js";
|
|
3
|
+
import { LinuxPackager } from "../../../linuxPackager.js";
|
|
4
|
+
import { AppImageOptions } from "../../../options/linuxOptions.js";
|
|
5
|
+
import { LinuxTargetHelper } from "../LinuxTargetHelper.js";
|
|
6
|
+
export declare const APP_RUN_ENTRYPOINT = "AppRun";
|
|
7
|
+
export default class AppImageTarget extends Target {
|
|
8
|
+
private readonly packager;
|
|
9
|
+
private readonly helper;
|
|
10
|
+
readonly outDir: string;
|
|
11
|
+
readonly options: AppImageOptions;
|
|
12
|
+
private readonly desktopEntry;
|
|
13
|
+
constructor(_ignored: string, packager: LinuxPackager, helper: LinuxTargetHelper, outDir: string);
|
|
14
|
+
build(appOutDir: string, arch: Arch): Promise<any>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AppImageTarget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppImageTarget.d.ts","sourceRoot":"","sources":["../../../../src/targets/linux/appimage/AppImageTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAwB,MAAM,cAAc,CAAA;AAIzD,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAGlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAS3D,eAAO,MAAM,kBAAkB,WAAW,CAAA;AAE1C,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,MAAM;IAO9C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM;IARzB,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAgE;IAEjG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;gBAGzC,QAAQ,EAAE,MAAM,EACC,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,iBAAiB,EACjC,MAAM,EAAE,MAAM;IAenB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;CA4HzD"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { log, serializeToYaml } from "builder-util";
|
|
2
|
+
import { Lazy } from "lazy-val";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import { Target } from "../../../core.js";
|
|
5
|
+
import { getAppUpdatePublishConfiguration } from "../../../publish/PublishManager.js";
|
|
6
|
+
import { getNotLocalizedLicenseFile } from "../../../util/license.js";
|
|
7
|
+
import { createStageDir } from "../../targetUtil.js";
|
|
8
|
+
import { buildLegacyFuse2AppImage, buildStaticRuntimeAppImage } from "./appImageUtil.js";
|
|
9
|
+
import _fsExtra from "fs-extra";
|
|
10
|
+
const { outputFile } = _fsExtra;
|
|
11
|
+
// https://unix.stackexchange.com/questions/375191/append-to-sub-directory-inside-squashfs-file
|
|
12
|
+
export const APP_RUN_ENTRYPOINT = "AppRun";
|
|
13
|
+
export default class AppImageTarget extends Target {
|
|
14
|
+
constructor(_ignored, packager, helper, outDir) {
|
|
15
|
+
super("appImage");
|
|
16
|
+
this.packager = packager;
|
|
17
|
+
this.helper = helper;
|
|
18
|
+
this.outDir = outDir;
|
|
19
|
+
this.options = this.packager.getOptionsForTarget(this.name);
|
|
20
|
+
this.desktopEntry = new Lazy(() => {
|
|
21
|
+
const appimageTool = packager.config.toolsets?.appimage;
|
|
22
|
+
const defaultArgs = appimageTool == null || appimageTool === "0.0.0" ? ["--no-sandbox"] : [];
|
|
23
|
+
const args = this.options.executableArgs ?? defaultArgs;
|
|
24
|
+
const exec = [APP_RUN_ENTRYPOINT, ...args, "%U"].join(" ");
|
|
25
|
+
return helper.computeDesktopEntry(this.options, exec, {
|
|
26
|
+
"X-AppImage-Version": `${packager.appInfo.buildVersion}`,
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async build(appOutDir, arch) {
|
|
31
|
+
const packager = this.packager;
|
|
32
|
+
const options = this.options;
|
|
33
|
+
// https://github.com/electron-userland/electron-builder/issues/775
|
|
34
|
+
// https://github.com/electron-userland/electron-builder/issues/1726
|
|
35
|
+
const artifactName = packager.expandArtifactNamePattern(options, "AppImage", arch);
|
|
36
|
+
const artifactPath = path.join(this.outDir, artifactName);
|
|
37
|
+
await packager.emitArtifactBuildStarted({
|
|
38
|
+
targetPresentableName: "AppImage",
|
|
39
|
+
file: artifactPath,
|
|
40
|
+
arch,
|
|
41
|
+
});
|
|
42
|
+
// Parallelize independent async operations
|
|
43
|
+
const [publishConfig, stageDir, desktopEntry, icons, license] = await Promise.all([
|
|
44
|
+
getAppUpdatePublishConfiguration(packager, options, arch, false),
|
|
45
|
+
createStageDir(this, packager, arch),
|
|
46
|
+
this.desktopEntry.value,
|
|
47
|
+
this.helper.icons,
|
|
48
|
+
getNotLocalizedLicenseFile(options.license, this.packager, ["txt", "html"]),
|
|
49
|
+
]);
|
|
50
|
+
if (publishConfig != null) {
|
|
51
|
+
await outputFile(path.join(packager.getResourcesDir(appOutDir), "app-update.yml"), serializeToYaml(publishConfig));
|
|
52
|
+
}
|
|
53
|
+
// Validated once here; throws InvalidConfigurationError for path traversal / NUL.
|
|
54
|
+
const desktopBaseName = this.helper.getDesktopFileName();
|
|
55
|
+
if (this.packager.packagerOptions.effectiveOptionComputed != null &&
|
|
56
|
+
(await this.packager.packagerOptions.effectiveOptionComputed({ desktop: desktopEntry, desktopFileName: `${desktopBaseName}.desktop` }))) {
|
|
57
|
+
await stageDir.cleanup();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
let updateInfo;
|
|
61
|
+
try {
|
|
62
|
+
const appimageTool = this.packager.config.toolsets?.appimage;
|
|
63
|
+
if (appimageTool === "0.0.0") {
|
|
64
|
+
updateInfo = await buildLegacyFuse2AppImage({
|
|
65
|
+
appDir: appOutDir,
|
|
66
|
+
stageDir: stageDir.dir,
|
|
67
|
+
arch,
|
|
68
|
+
output: artifactPath,
|
|
69
|
+
options: {
|
|
70
|
+
productName: packager.appInfo.productName,
|
|
71
|
+
productFilename: packager.appInfo.productFilename,
|
|
72
|
+
executableName: packager.executableName,
|
|
73
|
+
license,
|
|
74
|
+
desktopEntry,
|
|
75
|
+
icons,
|
|
76
|
+
fileAssociations: packager.fileAssociations,
|
|
77
|
+
desktopBaseName,
|
|
78
|
+
compression: (() => {
|
|
79
|
+
const c = options.compression;
|
|
80
|
+
if (c === "xz" || c === "gzip") {
|
|
81
|
+
return c;
|
|
82
|
+
}
|
|
83
|
+
if (packager.compression === "maximum") {
|
|
84
|
+
return "xz";
|
|
85
|
+
}
|
|
86
|
+
return undefined; // normal/store/unset/zstd → mksquashfs defaults to gzip
|
|
87
|
+
})(),
|
|
88
|
+
},
|
|
89
|
+
}, packager.buildResourcesDir);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
updateInfo = await buildStaticRuntimeAppImage(appimageTool, {
|
|
93
|
+
appDir: appOutDir,
|
|
94
|
+
stageDir: stageDir.dir,
|
|
95
|
+
arch,
|
|
96
|
+
output: artifactPath,
|
|
97
|
+
options: {
|
|
98
|
+
productName: packager.appInfo.productName,
|
|
99
|
+
productFilename: packager.appInfo.productFilename,
|
|
100
|
+
executableName: packager.executableName,
|
|
101
|
+
license,
|
|
102
|
+
desktopEntry,
|
|
103
|
+
icons,
|
|
104
|
+
fileAssociations: packager.fileAssociations,
|
|
105
|
+
desktopBaseName,
|
|
106
|
+
compression: (() => {
|
|
107
|
+
const c = options.compression;
|
|
108
|
+
if (c === "gzip" || c === "zstd") {
|
|
109
|
+
return c;
|
|
110
|
+
}
|
|
111
|
+
if (c === "xz") {
|
|
112
|
+
return "zstd"; // nearest equivalent; static runtime does not support xz
|
|
113
|
+
}
|
|
114
|
+
if (packager.compression === "store") {
|
|
115
|
+
return "gzip";
|
|
116
|
+
}
|
|
117
|
+
return "zstd"; // maximum/normal/unset → zstd for static runtime
|
|
118
|
+
})(),
|
|
119
|
+
},
|
|
120
|
+
}, packager.buildResourcesDir);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
catch (error) {
|
|
124
|
+
log.error({ error: error.message }, "failed to build AppImage");
|
|
125
|
+
throw error;
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
await stageDir.cleanup().catch(() => { });
|
|
129
|
+
}
|
|
130
|
+
await packager.emitArtifactBuildCompleted({
|
|
131
|
+
file: artifactPath,
|
|
132
|
+
safeArtifactName: packager.computeSafeArtifactName(artifactName, "AppImage", arch, false),
|
|
133
|
+
target: this,
|
|
134
|
+
arch,
|
|
135
|
+
packager,
|
|
136
|
+
isWriteUpdateInfo: true,
|
|
137
|
+
updateInfo,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=AppImageTarget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppImageTarget.js","sourceRoot":"","sources":["../../../../src/targets/linux/appimage/AppImageTarget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,GAAG,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGzC,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAA;AACrF,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAExF,OAAO,QAAQ,MAAM,UAAU,CAAA;AAC/B,MAAM,EAAE,UAAU,EAAE,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AK,CAAC;YACzF,MAAM,EAAE,IAAI;YACZ,IAAI;YACJ,QAAQ;YACR,iBAAiB,EAAE,IAAI;YACvB,UAAU;SACX,CAAC,CAAA;IACJ,CAAC;CACF","sourcesContent":["import { Arch, log, serializeToYaml } from \"builder-util\"\n\nimport { Lazy } from \"lazy-val\"\nimport * as path from \"path\"\nimport { Target } from \"../../../core.js\"\nimport { LinuxPackager } from \"../../../linuxPackager.js\"\nimport { AppImageOptions } from \"../../../options/linuxOptions.js\"\nimport { getAppUpdatePublishConfiguration } from \"../../../publish/PublishManager.js\"\nimport { getNotLocalizedLicenseFile } from \"../../../util/license.js\"\nimport { LinuxTargetHelper } from \"../LinuxTargetHelper.js\"\nimport { createStageDir } from \"../../targetUtil.js\"\nimport { buildLegacyFuse2AppImage, buildStaticRuntimeAppImage } from \"./appImageUtil.js\"\nimport { BlockMapDataHolder } from \"builder-util-runtime\"\nimport _fsExtra from \"fs-extra\"\nconst { outputFile } = _fsExtra\n\n// https://unix.stackexchange.com/questions/375191/append-to-sub-directory-inside-squashfs-file\n\nexport const APP_RUN_ENTRYPOINT = \"AppRun\"\n\nexport default class AppImageTarget extends Target {\n readonly options: AppImageOptions = this.packager.getOptionsForTarget<AppImageOptions>(this.name)\n\n private readonly desktopEntry: Lazy<string>\n\n constructor(\n _ignored: string,\n private readonly packager: LinuxPackager,\n private readonly helper: LinuxTargetHelper,\n readonly outDir: string\n ) {\n super(\"appImage\")\n\n this.desktopEntry = new Lazy<string>(() => {\n const appimageTool = packager.config.toolsets?.appimage\n const defaultArgs = appimageTool == null || appimageTool === \"0.0.0\" ? [\"--no-sandbox\"] : []\n const args = this.options.executableArgs ?? defaultArgs\n const exec = [APP_RUN_ENTRYPOINT, ...args, \"%U\"].join(\" \")\n return helper.computeDesktopEntry(this.options, exec, {\n \"X-AppImage-Version\": `${packager.appInfo.buildVersion}`,\n })\n })\n }\n\n async build(appOutDir: string, arch: Arch): Promise<any> {\n const packager = this.packager\n\n const options = this.options\n // https://github.com/electron-userland/electron-builder/issues/775\n // https://github.com/electron-userland/electron-builder/issues/1726\n const artifactName = packager.expandArtifactNamePattern(options, \"AppImage\", arch)\n const artifactPath = path.join(this.outDir, artifactName)\n\n await packager.emitArtifactBuildStarted({\n targetPresentableName: \"AppImage\",\n file: artifactPath,\n arch,\n })\n\n // Parallelize independent async operations\n const [publishConfig, stageDir, desktopEntry, icons, license] = await Promise.all([\n getAppUpdatePublishConfiguration(packager, options, arch, false),\n createStageDir(this, packager, arch),\n this.desktopEntry.value,\n this.helper.icons,\n getNotLocalizedLicenseFile(options.license, this.packager, [\"txt\", \"html\"]),\n ])\n\n if (publishConfig != null) {\n await outputFile(path.join(packager.getResourcesDir(appOutDir), \"app-update.yml\"), serializeToYaml(publishConfig))\n }\n\n // Validated once here; throws InvalidConfigurationError for path traversal / NUL.\n const desktopBaseName = this.helper.getDesktopFileName()\n\n if (\n this.packager.packagerOptions.effectiveOptionComputed != null &&\n (await this.packager.packagerOptions.effectiveOptionComputed({ desktop: desktopEntry, desktopFileName: `${desktopBaseName}.desktop` }))\n ) {\n await stageDir.cleanup()\n return\n }\n\n let updateInfo: BlockMapDataHolder\n try {\n const appimageTool = this.packager.config.toolsets?.appimage\n if (appimageTool === \"0.0.0\") {\n updateInfo = await buildLegacyFuse2AppImage(\n {\n appDir: appOutDir,\n stageDir: stageDir.dir,\n arch,\n output: artifactPath,\n options: {\n productName: packager.appInfo.productName,\n productFilename: packager.appInfo.productFilename,\n executableName: packager.executableName,\n license,\n desktopEntry,\n icons,\n fileAssociations: packager.fileAssociations,\n desktopBaseName,\n compression: (() => {\n const c = options.compression\n if (c === \"xz\" || c === \"gzip\") {\n return c\n }\n if (packager.compression === \"maximum\") {\n return \"xz\"\n }\n return undefined // normal/store/unset/zstd → mksquashfs defaults to gzip\n })(),\n },\n },\n packager.buildResourcesDir\n )\n } else {\n updateInfo = await buildStaticRuntimeAppImage(\n appimageTool,\n {\n appDir: appOutDir,\n stageDir: stageDir.dir,\n arch,\n output: artifactPath,\n options: {\n productName: packager.appInfo.productName,\n productFilename: packager.appInfo.productFilename,\n executableName: packager.executableName,\n license,\n desktopEntry,\n icons,\n fileAssociations: packager.fileAssociations,\n desktopBaseName,\n compression: (() => {\n const c = options.compression\n if (c === \"gzip\" || c === \"zstd\") {\n return c\n }\n if (c === \"xz\") {\n return \"zstd\" // nearest equivalent; static runtime does not support xz\n }\n if (packager.compression === \"store\") {\n return \"gzip\"\n }\n return \"zstd\" // maximum/normal/unset → zstd for static runtime\n })(),\n },\n },\n packager.buildResourcesDir\n )\n }\n } catch (error: any) {\n log.error({ error: error.message }, \"failed to build AppImage\")\n throw error\n } finally {\n await stageDir.cleanup().catch(() => {})\n }\n\n await packager.emitArtifactBuildCompleted({\n file: artifactPath,\n safeArtifactName: packager.computeSafeArtifactName(artifactName, \"AppImage\", arch, false),\n target: this,\n arch,\n packager,\n isWriteUpdateInfo: true,\n updateInfo,\n })\n }\n}\n"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Arch } from "builder-util";
|
|
2
|
+
import { FileAssociation } from "../../../options/FileAssociation.js";
|
|
3
|
+
import { BlockMapDataHolder } from "builder-util-runtime";
|
|
4
|
+
import { ToolsetConfig } from "../../../configuration.js";
|
|
5
|
+
import { IconInfo } from "../../../util/iconConverter.js";
|
|
6
|
+
interface Options {
|
|
7
|
+
productName: string;
|
|
8
|
+
productFilename: string;
|
|
9
|
+
executableName: string;
|
|
10
|
+
desktopEntry: string;
|
|
11
|
+
icons: IconInfo[];
|
|
12
|
+
license?: string | null;
|
|
13
|
+
fileAssociations: FileAssociation[];
|
|
14
|
+
/**
|
|
15
|
+
* The compression type available for static runtime is limited as it's only compiled with support for gzip and zstd.
|
|
16
|
+
* "xz" is only valid for the legacy FUSE2 (0.0.0) toolset.
|
|
17
|
+
*
|
|
18
|
+
* [stderr] Squashfs image uses lzo compression, this version supports only zlib, zstd.
|
|
19
|
+
* Failed to open squashfs image
|
|
20
|
+
* Failed to extract AppImage
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
compression?: "gzip" | "zstd" | "xz";
|
|
24
|
+
/** Pre-computed desktop basename (already validated). When absent, falls back to `executableName`. */
|
|
25
|
+
desktopBaseName?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AppImageBuilderOptions {
|
|
28
|
+
appDir: string;
|
|
29
|
+
stageDir: string;
|
|
30
|
+
arch: Arch;
|
|
31
|
+
output: string;
|
|
32
|
+
options: Options;
|
|
33
|
+
}
|
|
34
|
+
export declare function buildStaticRuntimeAppImage(appimageToolVersion: ToolsetConfig["appimage"], opts: AppImageBuilderOptions, resourcesDir: string): Promise<BlockMapDataHolder>;
|
|
35
|
+
export declare function buildLegacyFuse2AppImage(opts: AppImageBuilderOptions, resourcesDir: string): Promise<BlockMapDataHolder>;
|
|
36
|
+
/**
|
|
37
|
+
* Validates that critical path fields (executable name, product filename, license filename)
|
|
38
|
+
* contain only characters that are safe for use in filesystem paths and embedded bash strings.
|
|
39
|
+
* Allowed: Unicode letters, digits, dots, underscores, hyphens, and spaces.
|
|
40
|
+
*/
|
|
41
|
+
export declare function validateCriticalPathString(str: string, fieldName: string): void;
|
|
42
|
+
export type AppRunScriptBase = {
|
|
43
|
+
ExecutableName: string;
|
|
44
|
+
DesktopFileName: string;
|
|
45
|
+
ProductFilename: string;
|
|
46
|
+
ProductName: string;
|
|
47
|
+
ResourceName: string;
|
|
48
|
+
MimeTypeFile?: string;
|
|
49
|
+
};
|
|
50
|
+
export type AppRunScriptWithEula = AppRunScriptBase & {
|
|
51
|
+
EulaFile: string;
|
|
52
|
+
IsHtmlEula: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type AppRunScript = AppRunScriptBase | AppRunScriptWithEula;
|
|
55
|
+
export declare function generateAppRunScript(config: AppRunScript): string;
|
|
56
|
+
export {};
|
|
57
|
+
//# sourceMappingURL=appImageUtil.d.ts.map
|