app-builder-lib 23.6.0 → 24.0.0-alpha.2
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/out/ProtonFramework.js +4 -4
- package/out/ProtonFramework.js.map +1 -1
- package/out/appInfo.js +21 -9
- package/out/appInfo.js.map +1 -1
- package/out/asar/asar.d.ts +1 -0
- package/out/asar/asar.js +10 -10
- package/out/asar/asar.js.map +1 -1
- package/out/asar/asarFileChecker.js +2 -2
- package/out/asar/asarFileChecker.js.map +1 -1
- package/out/asar/asarUtil.js +13 -13
- package/out/asar/asarUtil.js.map +1 -1
- package/out/asar/integrity.js +9 -9
- package/out/asar/integrity.js.map +1 -1
- package/out/asar/unpackDetector.js +6 -6
- package/out/asar/unpackDetector.js.map +1 -1
- package/out/binDownload.js +2 -2
- package/out/binDownload.js.map +1 -1
- package/out/codeSign/codesign.js +4 -4
- package/out/codeSign/codesign.js.map +1 -1
- package/out/codeSign/macCodeSign.js +24 -24
- package/out/codeSign/macCodeSign.js.map +1 -1
- package/out/codeSign/windowsCodeSign.js +7 -7
- package/out/codeSign/windowsCodeSign.js.map +1 -1
- package/out/core.js +1 -1
- package/out/core.js.map +1 -1
- package/out/electron/ElectronFramework.js +17 -17
- package/out/electron/ElectronFramework.js.map +1 -1
- package/out/electron/electronMac.js +16 -16
- package/out/electron/electronMac.js.map +1 -1
- package/out/electron/electronVersion.js +5 -5
- package/out/electron/electronVersion.js.map +1 -1
- package/out/fileMatcher.js +11 -11
- package/out/fileMatcher.js.map +1 -1
- package/out/fileTransformer.js +5 -5
- package/out/fileTransformer.js.map +1 -1
- package/out/forge-maker.js +1 -1
- package/out/forge-maker.js.map +1 -1
- package/out/frameworks/LibUiFramework.js +10 -10
- package/out/frameworks/LibUiFramework.js.map +1 -1
- package/out/index.js +3 -3
- package/out/index.js.map +1 -1
- package/out/linuxPackager.js +2 -2
- package/out/linuxPackager.js.map +1 -1
- package/out/macPackager.js +26 -26
- package/out/macPackager.js.map +1 -1
- package/out/options/CommonWindowsInstallerConfiguration.js +3 -3
- package/out/options/CommonWindowsInstallerConfiguration.js.map +1 -1
- package/out/options/macOptions.d.ts +1 -1
- package/out/options/macOptions.js.map +1 -1
- package/out/packager.js +34 -34
- package/out/packager.js.map +1 -1
- package/out/platformPackager.js +39 -39
- package/out/platformPackager.js.map +1 -1
- package/out/presets/rectCra.js +1 -1
- package/out/presets/rectCra.js.map +1 -1
- package/out/publish/BitbucketPublisher.js +5 -5
- package/out/publish/BitbucketPublisher.js.map +1 -1
- package/out/publish/KeygenPublisher.js +7 -7
- package/out/publish/KeygenPublisher.js.map +1 -1
- package/out/publish/PublishManager.d.ts +0 -1
- package/out/publish/PublishManager.js +24 -24
- package/out/publish/PublishManager.js.map +1 -1
- package/out/publish/SnapStorePublisher.js +1 -1
- package/out/publish/SnapStorePublisher.js.map +1 -1
- package/out/publish/s3/BaseS3Publisher.js +3 -3
- package/out/publish/s3/BaseS3Publisher.js.map +1 -1
- package/out/publish/s3/s3Publisher.js +1 -1
- package/out/publish/s3/s3Publisher.js.map +1 -1
- package/out/publish/s3/spacesPublisher.js +2 -2
- package/out/publish/s3/spacesPublisher.js.map +1 -1
- package/out/publish/updateInfoBuilder.js +9 -9
- package/out/publish/updateInfoBuilder.js.map +1 -1
- package/out/remoteBuilder/ProjectInfoManager.js +1 -1
- package/out/remoteBuilder/ProjectInfoManager.js.map +1 -1
- package/out/remoteBuilder/RemoteBuilder.js +3 -3
- package/out/remoteBuilder/RemoteBuilder.js.map +1 -1
- package/out/remoteBuilder/builder-cli.js +3 -3
- package/out/remoteBuilder/builder-cli.js.map +1 -1
- package/out/targets/AppImageTarget.js +6 -6
- package/out/targets/AppImageTarget.js.map +1 -1
- package/out/targets/AppxTarget.js +19 -19
- package/out/targets/AppxTarget.js.map +1 -1
- package/out/targets/ArchiveTarget.js +7 -7
- package/out/targets/ArchiveTarget.js.map +1 -1
- package/out/targets/FlatpakTarget.js +8 -8
- package/out/targets/FlatpakTarget.js.map +1 -1
- package/out/targets/LinuxTargetHelper.js +9 -9
- package/out/targets/LinuxTargetHelper.js.map +1 -1
- package/out/targets/MsiTarget.js +11 -11
- package/out/targets/MsiTarget.js.map +1 -1
- package/out/targets/archive.js +9 -9
- package/out/targets/archive.js.map +1 -1
- package/out/targets/differentialUpdateInfoBuilder.js +2 -2
- package/out/targets/differentialUpdateInfoBuilder.js.map +1 -1
- package/out/targets/fpm.js +17 -17
- package/out/targets/fpm.js.map +1 -1
- package/out/targets/nsis/NsisTarget.js +37 -37
- package/out/targets/nsis/NsisTarget.js.map +1 -1
- package/out/targets/nsis/WebInstallerTarget.js +2 -2
- package/out/targets/nsis/WebInstallerTarget.js.map +1 -1
- package/out/targets/nsis/nsisLang.js +5 -5
- package/out/targets/nsis/nsisLang.js.map +1 -1
- package/out/targets/nsis/nsisLicense.js +2 -2
- package/out/targets/nsis/nsisLicense.js.map +1 -1
- package/out/targets/nsis/nsisUtil.js +5 -5
- package/out/targets/nsis/nsisUtil.js.map +1 -1
- package/out/targets/pkg.js +17 -17
- package/out/targets/pkg.js.map +1 -1
- package/out/targets/snap.js +19 -11
- package/out/targets/snap.js.map +1 -1
- package/out/targets/targetFactory.js +4 -4
- package/out/targets/targetFactory.js.map +1 -1
- package/out/targets/tools.js +1 -1
- package/out/targets/tools.js.map +1 -1
- package/out/util/AppFileWalker.js +2 -2
- package/out/util/AppFileWalker.js.map +1 -1
- package/out/util/NodeModuleCopyHelper.js +3 -3
- package/out/util/NodeModuleCopyHelper.js.map +1 -1
- package/out/util/appBuilder.js +2 -2
- package/out/util/appBuilder.js.map +1 -1
- package/out/util/appFileCopier.d.ts +1 -0
- package/out/util/appFileCopier.js +9 -9
- package/out/util/appFileCopier.js.map +1 -1
- package/out/util/cacheManager.js +5 -5
- package/out/util/cacheManager.js.map +1 -1
- package/out/util/config.js +10 -10
- package/out/util/config.js.map +1 -1
- package/out/util/flags.js +2 -2
- package/out/util/flags.js.map +1 -1
- package/out/util/hash.js +2 -2
- package/out/util/hash.js.map +1 -1
- package/out/util/license.js +1 -1
- package/out/util/license.js.map +1 -1
- package/out/util/macosVersion.js +3 -3
- package/out/util/macosVersion.js.map +1 -1
- package/out/util/normalizePackageData.js +4 -4
- package/out/util/normalizePackageData.js.map +1 -1
- package/out/util/packageDependencies.js +1 -1
- package/out/util/packageDependencies.js.map +1 -1
- package/out/util/packageMetadata.js +6 -6
- package/out/util/packageMetadata.js.map +1 -1
- package/out/util/repositoryInfo.js +2 -2
- package/out/util/repositoryInfo.js.map +1 -1
- package/out/util/yarn.d.ts +1 -1
- package/out/util/yarn.js +27 -38
- package/out/util/yarn.js.map +1 -1
- package/out/version.d.ts +1 -1
- package/out/version.js +1 -1
- package/out/version.js.map +1 -1
- package/out/vm/MonoVm.js +2 -2
- package/out/vm/MonoVm.js.map +1 -1
- package/out/vm/ParallelsVm.js +6 -6
- package/out/vm/ParallelsVm.js.map +1 -1
- package/out/vm/WineVm.js +1 -1
- package/out/vm/WineVm.js.map +1 -1
- package/out/vm/vm.js +2 -2
- package/out/vm/vm.js.map +1 -1
- package/out/winPackager.js +25 -25
- package/out/winPackager.js.map +1 -1
- package/out/wine.js +2 -2
- package/out/wine.js.map +1 -1
- package/package.json +8 -7
- package/scheme.json +2 -2
package/out/util/yarn.js
CHANGED
|
@@ -5,30 +5,32 @@ const builder_util_1 = require("builder-util");
|
|
|
5
5
|
const fs_extra_1 = require("fs-extra");
|
|
6
6
|
const os_1 = require("os");
|
|
7
7
|
const path = require("path");
|
|
8
|
-
const
|
|
8
|
+
const electronVersion_1 = require("../electron/electronVersion");
|
|
9
|
+
const electronRebuild = require("electron-rebuild");
|
|
10
|
+
const searchModule = require("electron-rebuild/lib/src/search-module");
|
|
9
11
|
async function installOrRebuild(config, appDir, options, forceInstall = false) {
|
|
10
|
-
const effectiveOptions = {
|
|
11
|
-
buildFromSource: config.buildDependenciesFromSource === true,
|
|
12
|
-
additionalArgs: builder_util_1.asArray(config.npmArgs),
|
|
13
|
-
...options,
|
|
14
|
-
};
|
|
15
12
|
let isDependenciesInstalled = false;
|
|
16
13
|
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
|
|
17
|
-
if (await fs_extra_1.pathExists(path.join(appDir, fileOrDir))) {
|
|
14
|
+
if (await (0, fs_extra_1.pathExists)(path.join(appDir, fileOrDir))) {
|
|
18
15
|
isDependenciesInstalled = true;
|
|
19
16
|
break;
|
|
20
17
|
}
|
|
21
18
|
}
|
|
22
19
|
if (forceInstall || !isDependenciesInstalled) {
|
|
20
|
+
const effectiveOptions = {
|
|
21
|
+
buildFromSource: config.buildDependenciesFromSource === true,
|
|
22
|
+
additionalArgs: (0, builder_util_1.asArray)(config.npmArgs),
|
|
23
|
+
...options,
|
|
24
|
+
};
|
|
23
25
|
await installDependencies(appDir, effectiveOptions);
|
|
24
26
|
}
|
|
25
27
|
else {
|
|
26
|
-
await rebuild(appDir,
|
|
28
|
+
await rebuild(appDir, config.buildDependenciesFromSource === true, options.arch);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
exports.installOrRebuild = installOrRebuild;
|
|
30
32
|
function getElectronGypCacheDir() {
|
|
31
|
-
return path.join(os_1.homedir(), ".electron-gyp");
|
|
33
|
+
return path.join((0, os_1.homedir)(), ".electron-gyp");
|
|
32
34
|
}
|
|
33
35
|
function getGypEnv(frameworkInfo, platform, arch, buildFromSource) {
|
|
34
36
|
const npmConfigArch = arch === "armv7l" ? "arm" : arch;
|
|
@@ -97,28 +99,13 @@ function installDependencies(appDir, options) {
|
|
|
97
99
|
if (additionalArgs != null) {
|
|
98
100
|
execArgs.push(...additionalArgs);
|
|
99
101
|
}
|
|
100
|
-
return builder_util_1.spawn(execPath, execArgs, {
|
|
102
|
+
return (0, builder_util_1.spawn)(execPath, execArgs, {
|
|
101
103
|
cwd: appDir,
|
|
102
104
|
env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
|
-
async function nodeGypRebuild(
|
|
106
|
-
|
|
107
|
-
// this script must be used only for electron
|
|
108
|
-
const nodeGyp = `node-gyp${process.platform === "win32" ? ".cmd" : ""}`;
|
|
109
|
-
const args = ["rebuild"];
|
|
110
|
-
// headers of old Electron versions do not have a valid config.gypi file
|
|
111
|
-
// and --force-process-config must be passed to node-gyp >= 8.4.0 to
|
|
112
|
-
// correctly build modules for them.
|
|
113
|
-
// see also https://github.com/nodejs/node-gyp/pull/2497
|
|
114
|
-
const [major, minor] = frameworkInfo.version
|
|
115
|
-
.split(".")
|
|
116
|
-
.slice(0, 2)
|
|
117
|
-
.map(n => parseInt(n, 10));
|
|
118
|
-
if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {
|
|
119
|
-
args.push("--force-process-config");
|
|
120
|
-
}
|
|
121
|
-
await builder_util_1.spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) });
|
|
107
|
+
async function nodeGypRebuild(arch) {
|
|
108
|
+
return rebuild(process.cwd(), false, arch);
|
|
122
109
|
}
|
|
123
110
|
exports.nodeGypRebuild = nodeGypRebuild;
|
|
124
111
|
function getPackageToolPath() {
|
|
@@ -134,18 +121,20 @@ function isRunningYarn(execPath) {
|
|
|
134
121
|
return process.env.FORCE_YARN === "true" || (execPath != null && path.basename(execPath).startsWith("yarn")) || (userAgent != null && /\byarn\b/.test(userAgent));
|
|
135
122
|
}
|
|
136
123
|
/** @internal */
|
|
137
|
-
async function rebuild(appDir,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
arch
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
124
|
+
async function rebuild(appDir, buildFromSource, arch = process.arch) {
|
|
125
|
+
builder_util_1.log.info({ appDir, arch }, "executing electron-rebuild");
|
|
126
|
+
const options = {
|
|
127
|
+
buildPath: appDir,
|
|
128
|
+
electronVersion: await (0, electronVersion_1.getElectronVersion)(appDir),
|
|
129
|
+
arch,
|
|
130
|
+
force: true,
|
|
131
|
+
debug: builder_util_1.log.isDebugEnabled,
|
|
132
|
+
projectRootPath: await searchModule.getProjectRootPath(appDir),
|
|
146
133
|
};
|
|
147
|
-
|
|
148
|
-
|
|
134
|
+
if (buildFromSource) {
|
|
135
|
+
options.prebuildTagPrefix = "totally-not-a-real-prefix-to-force-rebuild";
|
|
136
|
+
}
|
|
137
|
+
return electronRebuild.rebuild(options);
|
|
149
138
|
}
|
|
150
139
|
exports.rebuild = rebuild;
|
|
151
140
|
//# sourceMappingURL=yarn.js.map
|
package/out/util/yarn.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAE5B,6CAA4D;AAGrD,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAAuB,EAAE,YAAY,GAAG,KAAK;IACzH,MAAM,gBAAgB,GAAG;QACvB,eAAe,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI;QAC5D,cAAc,EAAE,sBAAO,CAAC,MAAM,CAAC,OAAO,CAAC;QACvC,GAAG,OAAO;KACX,CAAA;IACD,IAAI,uBAAuB,GAAG,KAAK,CAAA;IAEnC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE;QACnD,IAAI,MAAM,qBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE;YAClD,uBAAuB,GAAG,IAAI,CAAA;YAE9B,MAAK;SACN;KACF;IAED,IAAI,YAAY,IAAI,CAAC,uBAAuB,EAAE;QAC5C,MAAM,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;KACpD;SAAM;QACL,MAAM,OAAO,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;KACxC;AACH,CAAC;AArB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AC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;QAC5D,eAAe,EAAE,OAAO,CAAC,eAAe,KAAK,IAAI;KAClD,CAAA;IAED,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,eAAe,KAAK,IAAI,CAAC,CAAA;IAC1H,MAAM,0CAA6B,CAAC,CAAC,sBAAsB,CAAC,EAAE,aAAa,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,CAAA;AACpG,CAAC;AAbD,0BAaC","sourcesContent":["import { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { executeAppBuilderAndWriteJson } from \"./appBuilder\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n const effectiveOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n let isDependenciesInstalled = false\n\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n await installDependencies(appDir, effectiveOptions)\n } else {\n await rebuild(appDir, effectiveOptions)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nfunction checkYarnBerry() {\n const npmUserAgent = process.env[\"npm_config_user_agent\"] || \"\"\n const regex = /yarn\\/(\\d+)\\./gm\n\n const yarnVersionMatch = regex.exec(npmUserAgent)\n const yarnMajorVersion = Number(yarnVersionMatch?.[1] ?? 0)\n return yarnMajorVersion >= 2\n}\n\nfunction installDependencies(appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({ platform, arch, appDir }, `installing production dependencies`)\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const execArgs = [\"install\"]\n const isYarnBerry = checkYarnBerry()\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n execArgs.push(\"--production\")\n }\n\n if (!isRunningYarn(execPath)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n if (execPath == null) {\n execPath = getPackageToolPath()\n } else if (!isYarnBerry) {\n execArgs.unshift(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n return spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n}\n\nexport async function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo) {\n log.info({ platform, arch }, \"executing node-gyp rebuild\")\n // this script must be used only for electron\n const nodeGyp = `node-gyp${process.platform === \"win32\" ? \".cmd\" : \"\"}`\n const args = [\"rebuild\"]\n // headers of old Electron versions do not have a valid config.gypi file\n // and --force-process-config must be passed to node-gyp >= 8.4.0 to\n // correctly build modules for them.\n // see also https://github.com/nodejs/node-gyp/pull/2497\n const [major, minor] = frameworkInfo.version\n .split(\".\")\n .slice(0, 2)\n .map(n => parseInt(n, 10))\n if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {\n args.push(\"--force-process-config\")\n }\n await spawn(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, true) })\n}\n\nfunction getPackageToolPath() {\n if (process.env.FORCE_YARN === \"true\") {\n return process.platform === \"win32\" ? \"yarn.cmd\" : \"yarn\"\n } else {\n return process.platform === \"win32\" ? \"npm.cmd\" : \"npm\"\n }\n}\n\nfunction isRunningYarn(execPath: string | null | undefined) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || (execPath != null && path.basename(execPath).startsWith(\"yarn\")) || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps?: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(appDir: string, options: RebuildOptions) {\n const configuration: any = {\n dependencies: await options.productionDeps!.value,\n nodeExecPath: process.execPath,\n platform: options.platform || process.platform,\n arch: options.arch || process.arch,\n additionalArgs: options.additionalArgs,\n execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,\n buildFromSource: options.buildFromSource === true,\n }\n\n const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true)\n await executeAppBuilderAndWriteJson([\"rebuild-node-modules\"], configuration, { env, cwd: appDir })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"yarn.js","sourceRoot":"","sources":["../../src/util/yarn.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,uCAAqC;AAErC,2BAA4B;AAC5B,6BAA4B;AAG5B,iEAAgE;AAChE,oDAAmD;AACnD,uEAAsE;AAE/D,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAc,EAAE,OAAuB,EAAE,YAAY,GAAG,KAAK;IACzH,IAAI,uBAAuB,GAAG,KAAK,CAAA;IACnC,KAAK,MAAM,SAAS,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,EAAE;QACnD,IAAI,MAAM,IAAA,qBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE;YAClD,uBAAuB,GAAG,IAAI,CAAA;YAC9B,MAAK;SACN;KACF;IAED,IAAI,YAAY,IAAI,CAAC,uBAAuB,EAAE;QAC5C,MAAM,gBAAgB,GAAmB;YACvC,eAAe,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI;YAC5D,cAAc,EAAE,IAAA,sBAAO,EAAC,MAAM,CAAC,OAAO,CAAC;YACvC,GAAG,OAAO;SACX,CAAA;QACD,MAAM,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;KACpD;SAAM;QACL,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,2BAA2B,KAAK,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;KACjF;AACH,CAAC;AAnBD,4CAmBC;AAOD,SAAS,sBAAsB;IAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,IAAA,YAAO,GAAE,EAAE,eAAe,CAAC,CAAA;AAC9C,CAAC;AAED,SAAgB,SAAS,CAAC,aAAmC,EAAE,QAAyB,EAAE,IAAY,EAAE,eAAwB;IAC9H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D,MAAM,OAAO,GAAmC;QAC9C,SAAS,EAAE,MAAM;QACjB,eAAe,EAAE,MAAM,IAAA,oCAAkB,EAAC,MAAM,CAAC;QACjD,IAAI;QACJ,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,kBAAG,CAAC,cAAc;QACzB,eAAe,EAAE,MAAM,YAAY,CAAC,kBAAkB,CAAC,MAAM,CAAC;KAC/D,CAAA;IACD,IAAI,eAAe,EAAE;QACnB,OAAO,CAAC,iBAAiB,GAAG,4CAA4C,CAAA;KACzE;IACD,OAAO,eAAe,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;AACzC,CAAC;AAdD,0BAcC","sourcesContent":["import { asArray, log, spawn } from \"builder-util\"\nimport { pathExists } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { Configuration } from \"../configuration\"\nimport { NodeModuleDirInfo } from \"./packageDependencies\"\nimport { getElectronVersion } from \"../electron/electronVersion\"\nimport * as electronRebuild from \"electron-rebuild\"\nimport * as searchModule from \"electron-rebuild/lib/src/search-module\"\n\nexport async function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall = false) {\n let isDependenciesInstalled = false\n for (const fileOrDir of [\"node_modules\", \".pnp.js\"]) {\n if (await pathExists(path.join(appDir, fileOrDir))) {\n isDependenciesInstalled = true\n break\n }\n }\n\n if (forceInstall || !isDependenciesInstalled) {\n const effectiveOptions: RebuildOptions = {\n buildFromSource: config.buildDependenciesFromSource === true,\n additionalArgs: asArray(config.npmArgs),\n ...options,\n }\n await installDependencies(appDir, effectiveOptions)\n } else {\n await rebuild(appDir, config.buildDependenciesFromSource === true, options.arch)\n }\n}\n\nexport interface DesktopFrameworkInfo {\n version: string\n useCustomDist: boolean\n}\n\nfunction getElectronGypCacheDir() {\n return path.join(homedir(), \".electron-gyp\")\n}\n\nexport function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean) {\n const npmConfigArch = arch === \"armv7l\" ? \"arm\" : arch\n const common: any = {\n ...process.env,\n npm_config_arch: npmConfigArch,\n npm_config_target_arch: npmConfigArch,\n npm_config_platform: platform,\n npm_config_build_from_source: buildFromSource,\n // required for node-pre-gyp\n npm_config_target_platform: platform,\n npm_config_update_binary: true,\n npm_config_fallback_to_build: true,\n }\n\n if (platform !== process.platform) {\n common.npm_config_force = \"true\"\n }\n if (platform === \"win32\" || platform === \"darwin\") {\n common.npm_config_target_libc = \"unknown\"\n }\n\n if (!frameworkInfo.useCustomDist) {\n return common\n }\n\n // https://github.com/nodejs/node-gyp/issues/21\n return {\n ...common,\n npm_config_disturl: \"https://electronjs.org/headers\",\n npm_config_target: frameworkInfo.version,\n npm_config_runtime: \"electron\",\n npm_config_devdir: getElectronGypCacheDir(),\n }\n}\n\nfunction checkYarnBerry() {\n const npmUserAgent = process.env[\"npm_config_user_agent\"] || \"\"\n const regex = /yarn\\/(\\d+)\\./gm\n\n const yarnVersionMatch = regex.exec(npmUserAgent)\n const yarnMajorVersion = Number(yarnVersionMatch?.[1] ?? 0)\n return yarnMajorVersion >= 2\n}\n\nfunction installDependencies(appDir: string, options: RebuildOptions): Promise<any> {\n const platform = options.platform || process.platform\n const arch = options.arch || process.arch\n const additionalArgs = options.additionalArgs\n\n log.info({ platform, arch, appDir }, `installing production dependencies`)\n let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS\n const execArgs = [\"install\"]\n const isYarnBerry = checkYarnBerry()\n if (!isYarnBerry) {\n if (process.env.NPM_NO_BIN_LINKS === \"true\") {\n execArgs.push(\"--no-bin-links\")\n }\n execArgs.push(\"--production\")\n }\n\n if (!isRunningYarn(execPath)) {\n execArgs.push(\"--prefer-offline\")\n }\n\n if (execPath == null) {\n execPath = getPackageToolPath()\n } else if (!isYarnBerry) {\n execArgs.unshift(execPath)\n execPath = process.env.npm_node_execpath || process.env.NODE_EXE || \"node\"\n }\n\n if (additionalArgs != null) {\n execArgs.push(...additionalArgs)\n }\n return spawn(execPath, execArgs, {\n cwd: appDir,\n env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),\n })\n}\n\nexport async function nodeGypRebuild(arch: string) {\n return rebuild(process.cwd(), false, arch)\n}\n\nfunction getPackageToolPath() {\n if (process.env.FORCE_YARN === \"true\") {\n return process.platform === \"win32\" ? \"yarn.cmd\" : \"yarn\"\n } else {\n return process.platform === \"win32\" ? \"npm.cmd\" : \"npm\"\n }\n}\n\nfunction isRunningYarn(execPath: string | null | undefined) {\n const userAgent = process.env.npm_config_user_agent\n return process.env.FORCE_YARN === \"true\" || (execPath != null && path.basename(execPath).startsWith(\"yarn\")) || (userAgent != null && /\\byarn\\b/.test(userAgent))\n}\n\nexport interface RebuildOptions {\n frameworkInfo: DesktopFrameworkInfo\n productionDeps?: Lazy<Array<NodeModuleDirInfo>>\n\n platform?: NodeJS.Platform\n arch?: string\n\n buildFromSource?: boolean\n\n additionalArgs?: Array<string> | null\n}\n\n/** @internal */\nexport async function rebuild(appDir: string, buildFromSource: boolean, arch = process.arch) {\n log.info({ appDir, arch }, \"executing electron-rebuild\")\n const options: electronRebuild.RebuildOptions = {\n buildPath: appDir,\n electronVersion: await getElectronVersion(appDir),\n arch,\n force: true,\n debug: log.isDebugEnabled,\n projectRootPath: await searchModule.getProjectRootPath(appDir),\n }\n if (buildFromSource) {\n options.prebuildTagPrefix = \"totally-not-a-real-prefix-to-force-rebuild\"\n }\n return electronRebuild.rebuild(options)\n}\n"]}
|
package/out/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "
|
|
1
|
+
export declare const PACKAGE_VERSION = "24.0.0-alpha.2";
|
package/out/version.js
CHANGED
package/out/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,gBAAgB,CAAA","sourcesContent":["export const PACKAGE_VERSION = \"24.0.0-alpha.2\"\n"]}
|
package/out/vm/MonoVm.js
CHANGED
|
@@ -8,12 +8,12 @@ class MonoVmManager extends vm_1.VmManager {
|
|
|
8
8
|
super();
|
|
9
9
|
}
|
|
10
10
|
exec(file, args, options, isLogOutIfDebug = true) {
|
|
11
|
-
return builder_util_1.exec("mono", [file].concat(args), {
|
|
11
|
+
return (0, builder_util_1.exec)("mono", [file].concat(args), {
|
|
12
12
|
...options,
|
|
13
13
|
}, isLogOutIfDebug);
|
|
14
14
|
}
|
|
15
15
|
spawn(file, args, options, extraOptions) {
|
|
16
|
-
return builder_util_1.spawn("mono", [file].concat(args), options, extraOptions);
|
|
16
|
+
return (0, builder_util_1.spawn)("mono", [file].concat(args), options, extraOptions);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
exports.MonoVmManager = MonoVmManager;
|
package/out/vm/MonoVm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonoVm.js","sourceRoot":"","sources":["../../src/vm/MonoVm.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,6BAAgC;AAEhC,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,mBAAI,
|
|
1
|
+
{"version":3,"file":"MonoVm.js","sourceRoot":"","sources":["../../src/vm/MonoVm.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,6BAAgC;AAEhC,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,mBAAI,EACT,MAAM,EACN,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EACnB;YACE,GAAG,OAAO;SACX,EACD,eAAe,CAChB,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,OAAO,IAAA,oBAAK,EAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAClE,CAAC;CACF;AAnBD,sCAmBC","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { exec, ExtraSpawnOptions, spawn } from \"builder-util\"\nimport { VmManager } from \"./vm\"\n\nexport class MonoVmManager extends VmManager {\n constructor() {\n super()\n }\n\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return exec(\n \"mono\",\n [file].concat(args),\n {\n ...options,\n },\n isLogOutIfDebug\n )\n }\n\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n return spawn(\"mono\", [file].concat(args), options, extraOptions)\n }\n}\n"]}
|
package/out/vm/ParallelsVm.js
CHANGED
|
@@ -7,7 +7,7 @@ const vm_1 = require("./vm");
|
|
|
7
7
|
/** @internal */
|
|
8
8
|
async function parseVmList(debugLogger) {
|
|
9
9
|
// do not log output if debug - it is huge, logged using debugLogger
|
|
10
|
-
let rawList = await builder_util_1.exec("prlctl", ["list", "-i", "-s", "name"], undefined, false);
|
|
10
|
+
let rawList = await (0, builder_util_1.exec)("prlctl", ["list", "-i", "-s", "name"], undefined, false);
|
|
11
11
|
debugLogger.add("parallels.list", rawList);
|
|
12
12
|
rawList = rawList.substring(rawList.indexOf("ID:"));
|
|
13
13
|
// let match: Array<string> | null
|
|
@@ -53,11 +53,11 @@ class ParallelsVmManager extends vm_1.VmManager {
|
|
|
53
53
|
async exec(file, args, options) {
|
|
54
54
|
await this.ensureThatVmStarted();
|
|
55
55
|
// it is important to use "--current-user" to execute command under logged in user - to access certs.
|
|
56
|
-
return await builder_util_1.exec("prlctl", ["exec", this.vm.id, "--current-user", file.startsWith("/") ? macPathToParallelsWindows(file) : file].concat(args), options).catch(error => this.handleExecuteError(error));
|
|
56
|
+
return await (0, builder_util_1.exec)("prlctl", ["exec", this.vm.id, "--current-user", file.startsWith("/") ? macPathToParallelsWindows(file) : file].concat(args), options).catch(error => this.handleExecuteError(error));
|
|
57
57
|
}
|
|
58
58
|
async spawn(file, args, options, extraOptions) {
|
|
59
59
|
await this.ensureThatVmStarted();
|
|
60
|
-
return await builder_util_1.spawn("prlctl", ["exec", this.vm.id, file].concat(args), options, extraOptions).catch(error => this.handleExecuteError(error));
|
|
60
|
+
return await (0, builder_util_1.spawn)("prlctl", ["exec", this.vm.id, file].concat(args), options, extraOptions).catch(error => this.handleExecuteError(error));
|
|
61
61
|
}
|
|
62
62
|
async doStartVm() {
|
|
63
63
|
const vmId = this.vm.id;
|
|
@@ -71,14 +71,14 @@ class ParallelsVmManager extends vm_1.VmManager {
|
|
|
71
71
|
require("async-exit-hook")((callback) => {
|
|
72
72
|
const stopArgs = ["suspend", vmId];
|
|
73
73
|
if (callback == null) {
|
|
74
|
-
child_process_1.execFileSync("prlctl", stopArgs);
|
|
74
|
+
(0, child_process_1.execFileSync)("prlctl", stopArgs);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
|
-
builder_util_1.exec("prlctl", stopArgs).then(callback).catch(callback);
|
|
77
|
+
(0, builder_util_1.exec)("prlctl", stopArgs).then(callback).catch(callback);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
|
-
await builder_util_1.exec("prlctl", ["start", vmId]);
|
|
81
|
+
await (0, builder_util_1.exec)("prlctl", ["start", vmId]);
|
|
82
82
|
}
|
|
83
83
|
ensureThatVmStarted() {
|
|
84
84
|
let startPromise = this.startPromise;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ParallelsVm.js","sourceRoot":"","sources":["../../src/vm/ParallelsVm.ts"],"names":[],"mappings":";;;AAAA,+CAA+E;AAC/E,iDAA2E;AAC3E,6BAAgC;AAEhC,gBAAgB;AACT,KAAK,UAAU,WAAW,CAAC,WAAwB;IACxD,oEAAoE;IACpE,IAAI,OAAO,GAAG,MAAM,mBAAI,
|
|
1
|
+
{"version":3,"file":"ParallelsVm.js","sourceRoot":"","sources":["../../src/vm/ParallelsVm.ts"],"names":[],"mappings":";;;AAAA,+CAA+E;AAC/E,iDAA2E;AAC3E,6BAAgC;AAEhC,gBAAgB;AACT,KAAK,UAAU,WAAW,CAAC,WAAwB;IACxD,oEAAoE;IACpE,IAAI,OAAO,GAAG,MAAM,IAAA,mBAAI,EAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;IAClF,WAAW,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAE1C,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IAEnD,kCAAkC;IAClC,MAAM,MAAM,GAAuB,EAAE,CAAA;IACrC,KAAK,MAAM,IAAI,IAAI,OAAO;SACvB,KAAK,CAAC,MAAM,CAAC;SACb,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE;QAC9B,MAAM,EAAE,GAAQ,EAAE,CAAA;QAClB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACnC,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YAC3C,IAAI,IAAI,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oBACL,IAAA,mBAAI,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;iBACxD;YACH,CAAC,CAAC,CAAA;SACH;QACD,MAAM,IAAA,mBAAI,EAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAA;IACvC,CAAC;IAEO,mBAAmB;QACzB,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACpC,IAAI,YAAY,IAAI,IAAI,EAAE;YACxB,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;YAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;SACjC;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,iHAAiH;QACjH,OAAO,yBAAyB,CAAC,IAAI,CAAC,CAAA;IACxC,CAAC;CACF;AAxED,gDAwEC;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAA;KACZ;IACD,OAAO,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACtD,CAAC;AALD,8DAKC","sourcesContent":["import { exec, spawn, DebugLogger, ExtraSpawnOptions, log } from \"builder-util\"\nimport { SpawnOptions, execFileSync, ExecFileOptions } from \"child_process\"\nimport { VmManager } from \"./vm\"\n\n/** @internal */\nexport async function parseVmList(debugLogger: DebugLogger) {\n // do not log output if debug - it is huge, logged using debugLogger\n let rawList = await exec(\"prlctl\", [\"list\", \"-i\", \"-s\", \"name\"], undefined, false)\n debugLogger.add(\"parallels.list\", rawList)\n\n rawList = rawList.substring(rawList.indexOf(\"ID:\"))\n\n // let match: Array<string> | null\n const result: Array<ParallelsVm> = []\n for (const info of rawList\n .split(\"\\n\\n\")\n .map(it => it.trim())\n .filter(it => it.length > 0)) {\n const vm: any = {}\n for (const line of info.split(\"\\n\")) {\n const meta = /^([^:(\"]+): (.*)$/.exec(line)\n if (meta == null) {\n continue\n }\n\n const key = meta[1].toLowerCase()\n if (key === \"id\" || key === \"os\" || key === \"name\" || key === \"state\" || key === \"name\") {\n vm[key] = meta[2].trim()\n }\n }\n result.push(vm)\n }\n return result\n}\n\n/** @internal */\nexport class ParallelsVmManager extends VmManager {\n private startPromise: Promise<any>\n\n private isExitHookAdded = false\n\n constructor(private readonly vm: ParallelsVm) {\n super()\n\n this.startPromise = this.doStartVm()\n }\n\n get pathSep(): string {\n return \"/\"\n }\n\n private handleExecuteError(error: Error): any {\n if (error.message.includes(\"Unable to open new session in this virtual machine\")) {\n throw new Error(`Please ensure that your are logged in \"${this.vm.name}\" parallels virtual machine. In the future please do not stop VM, but suspend.\\n\\n${error.message}`)\n }\n\n log.warn(\"ensure that 'Share folders' is set to 'All Disks', see https://goo.gl/E6XphP\")\n throw error\n }\n\n async exec(file: string, args: Array<string>, options?: ExecFileOptions): Promise<string> {\n await this.ensureThatVmStarted()\n // it is important to use \"--current-user\" to execute command under logged in user - to access certs.\n return await exec(\"prlctl\", [\"exec\", this.vm.id, \"--current-user\", file.startsWith(\"/\") ? macPathToParallelsWindows(file) : file].concat(args), options).catch(error =>\n this.handleExecuteError(error)\n )\n }\n\n async spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n await this.ensureThatVmStarted()\n return await spawn(\"prlctl\", [\"exec\", this.vm.id, file].concat(args), options, extraOptions).catch(error => this.handleExecuteError(error))\n }\n\n private async doStartVm() {\n const vmId = this.vm.id\n const state = this.vm.state\n if (state === \"running\") {\n return\n }\n\n if (!this.isExitHookAdded) {\n this.isExitHookAdded = true\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n require(\"async-exit-hook\")((callback: (() => void) | null) => {\n const stopArgs = [\"suspend\", vmId]\n if (callback == null) {\n execFileSync(\"prlctl\", stopArgs)\n } else {\n exec(\"prlctl\", stopArgs).then(callback).catch(callback)\n }\n })\n }\n await exec(\"prlctl\", [\"start\", vmId])\n }\n\n private ensureThatVmStarted() {\n let startPromise = this.startPromise\n if (startPromise == null) {\n startPromise = this.doStartVm()\n this.startPromise = startPromise\n }\n return startPromise\n }\n\n toVmFile(file: string): string {\n // https://stackoverflow.com/questions/4742992/cannot-access-network-drive-in-powershell-running-as-administrator\n return macPathToParallelsWindows(file)\n }\n}\n\nexport function macPathToParallelsWindows(file: string) {\n if (file.startsWith(\"C:\\\\\")) {\n return file\n }\n return \"\\\\\\\\Mac\\\\Host\\\\\" + file.replace(/\\//g, \"\\\\\")\n}\n\nexport interface ParallelsVm {\n id: string\n name: string\n os: \"win-10\" | \"win-11\" | \"ubuntu\" | \"elementary\"\n state: \"running\" | \"suspended\" | \"stopped\"\n}\n"]}
|
package/out/vm/WineVm.js
CHANGED
|
@@ -10,7 +10,7 @@ class WineVmManager extends vm_1.VmManager {
|
|
|
10
10
|
}
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
12
|
exec(file, args, options, isLogOutIfDebug = true) {
|
|
13
|
-
return wine_1.execWine(file, null, args, options);
|
|
13
|
+
return (0, wine_1.execWine)(file, null, args, options);
|
|
14
14
|
}
|
|
15
15
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
16
|
spawn(file, args, options, extraOptions) {
|
package/out/vm/WineVm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WineVm.js","sourceRoot":"","sources":["../../src/vm/WineVm.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,6BAAgC;AAChC,6BAA4B;AAE5B,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,eAAQ,
|
|
1
|
+
{"version":3,"file":"WineVm.js","sourceRoot":"","sources":["../../src/vm/WineVm.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,6BAAgC;AAChC,6BAA4B;AAE5B,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,eAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACpC,CAAC;CACF;AAlBD,sCAkBC","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { ExtraSpawnOptions } from \"builder-util\"\nimport { execWine } from \"../wine\"\nimport { VmManager } from \"./vm\"\nimport * as path from \"path\"\n\nexport class WineVmManager extends VmManager {\n constructor() {\n super()\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return execWine(file, null, args, options)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n throw new Error(\"Unsupported\")\n }\n\n toVmFile(file: string): string {\n return path.win32.join(\"Z:\", file)\n }\n}\n"]}
|
package/out/vm/vm.js
CHANGED
|
@@ -8,10 +8,10 @@ class VmManager {
|
|
|
8
8
|
return path.sep;
|
|
9
9
|
}
|
|
10
10
|
exec(file, args, options, isLogOutIfDebug = true) {
|
|
11
|
-
return builder_util_1.exec(file, args, options, isLogOutIfDebug);
|
|
11
|
+
return (0, builder_util_1.exec)(file, args, options, isLogOutIfDebug);
|
|
12
12
|
}
|
|
13
13
|
spawn(file, args, options, extraOptions) {
|
|
14
|
-
return builder_util_1.spawn(file, args, options, extraOptions);
|
|
14
|
+
return (0, builder_util_1.spawn)(file, args, options, extraOptions);
|
|
15
15
|
}
|
|
16
16
|
toVmFile(file) {
|
|
17
17
|
return file;
|
package/out/vm/vm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;AAAA,+CAAqG;AAErG,6BAA4B;AAE5B,MAAa,SAAS;IACpB,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,mBAAI,
|
|
1
|
+
{"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;AAAA,+CAAqG;AAErG,6BAA4B;AAE5B,MAAa,SAAS;IACpB,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,mBAAI,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAA;IACnD,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,OAAO,IAAA,oBAAK,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IACjD,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAhBD,8BAgBC;AAEM,KAAK,UAAU,YAAY,CAAC,WAAwB;IACzD,MAAM,iBAAiB,GAAG,2CAAa,eAAe,EAAC,CAAA;IACvD,MAAM,MAAM,GAAG,CAAC,MAAM,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACpH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,MAAM,IAAI,wCAAyB,CAAC,iFAAiF,CAAC,CAAA;KACvH;IAED,iCAAiC;IACjC,OAAO,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACxJ,CAAC;AATD,oCASC","sourcesContent":["import { DebugLogger, exec, ExtraSpawnOptions, InvalidConfigurationError, spawn } from \"builder-util\"\nimport { ExecFileOptions, SpawnOptions } from \"child_process\"\nimport * as path from \"path\"\n\nexport class VmManager {\n get pathSep(): string {\n return path.sep\n }\n\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return exec(file, args, options, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n return spawn(file, args, options, extraOptions)\n }\n\n toVmFile(file: string): string {\n return file\n }\n}\n\nexport async function getWindowsVm(debugLogger: DebugLogger): Promise<VmManager> {\n const parallelsVmModule = await import(\"./ParallelsVm\")\n const vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => [\"win-10\", \"win-11\"].includes(it.os))\n if (vmList.length === 0) {\n throw new InvalidConfigurationError(\"Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)\")\n }\n\n // prefer running or suspended vm\n return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === \"running\") || vmList.find(it => it.state === \"suspended\") || vmList[0])\n}\n"]}
|
package/out/winPackager.js
CHANGED
|
@@ -30,8 +30,8 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
30
30
|
const platformSpecificBuildOptions = this.platformSpecificBuildOptions;
|
|
31
31
|
if (platformSpecificBuildOptions.certificateSubjectName != null || platformSpecificBuildOptions.certificateSha1 != null) {
|
|
32
32
|
return this.vm.value
|
|
33
|
-
.then(vm => windowsCodeSign_1.getCertificateFromStoreInfo(platformSpecificBuildOptions, vm))
|
|
34
|
-
.catch(e => {
|
|
33
|
+
.then(vm => (0, windowsCodeSign_1.getCertificateFromStoreInfo)(platformSpecificBuildOptions, vm))
|
|
34
|
+
.catch((e) => {
|
|
35
35
|
// https://github.com/electron-userland/electron-builder/pull/2397
|
|
36
36
|
if (platformSpecificBuildOptions.sign == null) {
|
|
37
37
|
throw e;
|
|
@@ -54,9 +54,9 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
54
54
|
if (cscLink == null) {
|
|
55
55
|
return Promise.resolve(null);
|
|
56
56
|
}
|
|
57
|
-
return (codesign_1.importCertificate(cscLink, this.info.tempDirManager, this.projectDir)
|
|
57
|
+
return ((0, codesign_1.importCertificate)(cscLink, this.info.tempDirManager, this.projectDir)
|
|
58
58
|
// before then
|
|
59
|
-
.catch(e => {
|
|
59
|
+
.catch((e) => {
|
|
60
60
|
if (e instanceof builder_util_1.InvalidConfigurationError) {
|
|
61
61
|
throw new builder_util_1.InvalidConfigurationError(`Env WIN_CSC_LINK is not correct, cannot resolve: ${e.message}`);
|
|
62
62
|
}
|
|
@@ -72,14 +72,14 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
72
72
|
}));
|
|
73
73
|
});
|
|
74
74
|
this._iconPath = new lazy_val_1.Lazy(() => this.getOrConvertIcon("ico"));
|
|
75
|
-
this.vm = new lazy_val_1.Lazy(() => (process.platform === "win32" ? Promise.resolve(new vm_1.VmManager()) : vm_1.getWindowsVm(this.debugLogger)));
|
|
75
|
+
this.vm = new lazy_val_1.Lazy(() => (process.platform === "win32" ? Promise.resolve(new vm_1.VmManager()) : (0, vm_1.getWindowsVm)(this.debugLogger)));
|
|
76
76
|
this.computedPublisherName = new lazy_val_1.Lazy(async () => {
|
|
77
77
|
const publisherName = this.platformSpecificBuildOptions.publisherName;
|
|
78
78
|
if (publisherName === null) {
|
|
79
79
|
return null;
|
|
80
80
|
}
|
|
81
81
|
else if (publisherName != null) {
|
|
82
|
-
return builder_util_1.asArray(publisherName);
|
|
82
|
+
return (0, builder_util_1.asArray)(publisherName);
|
|
83
83
|
}
|
|
84
84
|
const certInfo = await this.lazyCertInfo.value;
|
|
85
85
|
return certInfo == null ? null : [certInfo.commonName];
|
|
@@ -92,7 +92,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
92
92
|
if ("subject" in cscInfo) {
|
|
93
93
|
const bloodyMicrosoftSubjectDn = cscInfo.subject;
|
|
94
94
|
return {
|
|
95
|
-
commonName: builder_util_runtime_1.parseDn(bloodyMicrosoftSubjectDn).get("CN"),
|
|
95
|
+
commonName: (0, builder_util_runtime_1.parseDn)(bloodyMicrosoftSubjectDn).get("CN"),
|
|
96
96
|
bloodyMicrosoftSubjectDn,
|
|
97
97
|
};
|
|
98
98
|
}
|
|
@@ -100,7 +100,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
100
100
|
if (cscFile == null) {
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
|
-
return await windowsCodeSign_1.getCertInfo(cscFile, cscInfo.password || "");
|
|
103
|
+
return await (0, windowsCodeSign_1.getCertInfo)(cscFile, cscInfo.password || "");
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
get isForceCodeSigningVerification() {
|
|
@@ -110,7 +110,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
110
110
|
return ["nsis"];
|
|
111
111
|
}
|
|
112
112
|
doGetCscPassword() {
|
|
113
|
-
return platformPackager_1.chooseNotNull(platformPackager_1.chooseNotNull(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword());
|
|
113
|
+
return (0, platformPackager_1.chooseNotNull)((0, platformPackager_1.chooseNotNull)(this.platformSpecificBuildOptions.certificatePassword, process.env.WIN_CSC_KEY_PASSWORD), super.doGetCscPassword());
|
|
114
114
|
}
|
|
115
115
|
createTargets(targets, mapper) {
|
|
116
116
|
let copyElevateHelper;
|
|
@@ -156,7 +156,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
156
156
|
return null;
|
|
157
157
|
}
|
|
158
158
|
})();
|
|
159
|
-
mapper(name, outDir => (targetClass === null ? targetFactory_1.createCommonTarget(name, outDir, this) : new targetClass(this, outDir, name)));
|
|
159
|
+
mapper(name, outDir => (targetClass === null ? (0, targetFactory_1.createCommonTarget)(name, outDir, this) : new targetClass(this, outDir, name)));
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
@@ -173,7 +173,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
173
173
|
const cscInfo = await this.cscInfo.value;
|
|
174
174
|
if (cscInfo == null) {
|
|
175
175
|
if (this.platformSpecificBuildOptions.sign != null) {
|
|
176
|
-
await windowsCodeSign_1.sign(signOptions, this);
|
|
176
|
+
await (0, windowsCodeSign_1.sign)(signOptions, this);
|
|
177
177
|
}
|
|
178
178
|
else if (this.forceCodeSigning) {
|
|
179
179
|
throw new builder_util_1.InvalidConfigurationError(`App is not signed and "forceCodeSigning" is set to true, please ensure that code signing configuration is correct, please see https://electron.build/code-signing`);
|
|
@@ -210,7 +210,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
210
210
|
async doSign(options) {
|
|
211
211
|
for (let i = 0; i < 3; i++) {
|
|
212
212
|
try {
|
|
213
|
-
await windowsCodeSign_1.sign(options, this);
|
|
213
|
+
await (0, windowsCodeSign_1.sign)(options, this);
|
|
214
214
|
break;
|
|
215
215
|
}
|
|
216
216
|
catch (e) {
|
|
@@ -249,15 +249,15 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
249
249
|
if (requestedExecutionLevel != null && requestedExecutionLevel !== "asInvoker") {
|
|
250
250
|
args.push("--set-requested-execution-level", requestedExecutionLevel);
|
|
251
251
|
}
|
|
252
|
-
builder_util_1.use(appInfo.companyName, it => args.push("--set-version-string", "CompanyName", it));
|
|
253
|
-
builder_util_1.use(this.platformSpecificBuildOptions.legalTrademarks, it => args.push("--set-version-string", "LegalTrademarks", it));
|
|
252
|
+
(0, builder_util_1.use)(appInfo.companyName, it => args.push("--set-version-string", "CompanyName", it));
|
|
253
|
+
(0, builder_util_1.use)(this.platformSpecificBuildOptions.legalTrademarks, it => args.push("--set-version-string", "LegalTrademarks", it));
|
|
254
254
|
const iconPath = await this.getIconPath();
|
|
255
|
-
builder_util_1.use(iconPath, it => {
|
|
255
|
+
(0, builder_util_1.use)(iconPath, it => {
|
|
256
256
|
files.push(it);
|
|
257
257
|
args.push("--set-icon", it);
|
|
258
258
|
});
|
|
259
259
|
const config = this.config;
|
|
260
|
-
const cscInfoForCacheDigest = !flags_1.isBuildCacheEnabled() || isCI || config.electronDist != null ? null : await this.cscInfo.value;
|
|
260
|
+
const cscInfoForCacheDigest = !(0, flags_1.isBuildCacheEnabled)() || isCI || config.electronDist != null ? null : await this.cscInfo.value;
|
|
261
261
|
let buildCacheManager = null;
|
|
262
262
|
// resources editing doesn't change executable for the same input and executed quickly - no need to complicate
|
|
263
263
|
if (cscInfoForCacheDigest != null) {
|
|
@@ -265,28 +265,28 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
265
265
|
if (cscFile != null) {
|
|
266
266
|
files.push(cscFile);
|
|
267
267
|
}
|
|
268
|
-
const timer = timer_1.time("executable cache");
|
|
269
|
-
const hash = crypto_1.createHash("sha512");
|
|
268
|
+
const timer = (0, timer_1.time)("executable cache");
|
|
269
|
+
const hash = (0, crypto_1.createHash)("sha512");
|
|
270
270
|
hash.update(config.electronVersion || "no electronVersion");
|
|
271
271
|
hash.update(JSON.stringify(this.platformSpecificBuildOptions));
|
|
272
272
|
hash.update(JSON.stringify(args));
|
|
273
273
|
hash.update(this.platformSpecificBuildOptions.certificateSha1 || "no certificateSha1");
|
|
274
274
|
hash.update(this.platformSpecificBuildOptions.certificateSubjectName || "no subjectName");
|
|
275
275
|
buildCacheManager = new cacheManager_1.BuildCacheManager(outDir, file, arch);
|
|
276
|
-
if (await buildCacheManager.copyIfValid(await cacheManager_1.digest(hash, files))) {
|
|
276
|
+
if (await buildCacheManager.copyIfValid(await (0, cacheManager_1.digest)(hash, files))) {
|
|
277
277
|
timer.end();
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
timer.end();
|
|
281
281
|
}
|
|
282
|
-
const timer = timer_1.time("wine&sign");
|
|
282
|
+
const timer = (0, timer_1.time)("wine&sign");
|
|
283
283
|
// rcedit crashed of executed using wine, resourcehacker works
|
|
284
284
|
if (process.platform === "win32" || process.platform === "darwin") {
|
|
285
|
-
await builder_util_1.executeAppBuilder(["rcedit", "--args", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */);
|
|
285
|
+
await (0, builder_util_1.executeAppBuilder)(["rcedit", "--args", JSON.stringify(args)], undefined /* child-process */, {}, 3 /* retry three times */);
|
|
286
286
|
}
|
|
287
287
|
else if (this.info.framework.name === "electron") {
|
|
288
|
-
const vendorPath = await windowsCodeSign_1.getSignVendorPath();
|
|
289
|
-
await wine_1.execWine(path.join(vendorPath, "rcedit-ia32.exe"), path.join(vendorPath, "rcedit-x64.exe"), args);
|
|
288
|
+
const vendorPath = await (0, windowsCodeSign_1.getSignVendorPath)();
|
|
289
|
+
await (0, wine_1.execWine)(path.join(vendorPath, "rcedit-ia32.exe"), path.join(vendorPath, "rcedit-x64.exe"), args);
|
|
290
290
|
}
|
|
291
291
|
await this.sign(file);
|
|
292
292
|
timer.end();
|
|
@@ -316,7 +316,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
316
316
|
if (this.platformSpecificBuildOptions.signAndEditExecutable === false) {
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
await bluebird_lst_1.default.map(promises_1.readdir(packContext.appOutDir), (file) => {
|
|
319
|
+
await bluebird_lst_1.default.map((0, promises_1.readdir)(packContext.appOutDir), (file) => {
|
|
320
320
|
if (file === exeFileName) {
|
|
321
321
|
return this.signAndEditResources(path.join(packContext.appOutDir, exeFileName), packContext.arch, packContext.outDir, path.basename(exeFileName, ".exe"), this.platformSpecificBuildOptions.requestedExecutionLevel);
|
|
322
322
|
}
|
|
@@ -330,7 +330,7 @@ class WinPackager extends platformPackager_1.PlatformPackager {
|
|
|
330
330
|
}
|
|
331
331
|
const signPromise = (filepath) => {
|
|
332
332
|
const outDir = path.join(packContext.appOutDir, ...filepath);
|
|
333
|
-
return fs_1.walk(outDir, (file, stat) => stat.isDirectory() || file.endsWith(".exe") || (this.isSignDlls() && file.endsWith(".dll")));
|
|
333
|
+
return (0, fs_1.walk)(outDir, (file, stat) => stat.isDirectory() || file.endsWith(".exe") || (this.isSignDlls() && file.endsWith(".dll")));
|
|
334
334
|
};
|
|
335
335
|
const filesToSign = await Promise.all([signPromise(["resources", "app.asar.unpacked"]), signPromise(["swiftshader"])]);
|
|
336
336
|
await bluebird_lst_1.default.map(filesToSign.flat(1), file => this.sign(file), { concurrency: 4 });
|