update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
2
electron/node_modules/electron-builder/cli.js
generated
vendored
2
electron/node_modules/electron-builder/cli.js
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// https://github.com/pnpm/pnpm/issues/1801
|
||||
require("./out/cli/cli")
|
||||
require("./out/cli/cli")
|
||||
|
|
|
|||
2
electron/node_modules/electron-builder/install-app-deps.js
generated
vendored
2
electron/node_modules/electron-builder/install-app-deps.js
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// https://github.com/pnpm/pnpm/issues/1801
|
||||
require("./out/cli/install-app-deps")
|
||||
require("./out/cli/install-app-deps")
|
||||
|
|
|
|||
2
electron/node_modules/electron-builder/out/builder.d.ts
generated
vendored
2
electron/node_modules/electron-builder/out/builder.d.ts
generated
vendored
|
|
@ -1,5 +1,5 @@
|
|||
import { Arch } from "builder-util";
|
||||
import { PackagerOptions, Platform } from "app-builder-lib";
|
||||
import { Arch } from "builder-util";
|
||||
import { PublishOptions } from "electron-publish";
|
||||
import * as yargs from "yargs";
|
||||
export declare function createYargs(): yargs.Argv<unknown>;
|
||||
|
|
|
|||
41
electron/node_modules/electron-builder/out/builder.js
generated
vendored
41
electron/node_modules/electron-builder/out/builder.js
generated
vendored
|
|
@ -1,16 +1,21 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.configureBuildCommand = exports.build = exports.createTargets = exports.coerceTypes = exports.normalizeOptions = exports.createYargs = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const chalk = require("chalk");
|
||||
exports.createYargs = createYargs;
|
||||
exports.normalizeOptions = normalizeOptions;
|
||||
exports.coerceTypes = coerceTypes;
|
||||
exports.createTargets = createTargets;
|
||||
exports.build = build;
|
||||
exports.configureBuildCommand = configureBuildCommand;
|
||||
const app_builder_lib_1 = require("app-builder-lib");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const chalk = require("chalk");
|
||||
const yargs = require("yargs");
|
||||
function createYargs() {
|
||||
return yargs.parserConfiguration({
|
||||
"camel-case-expansion": false,
|
||||
});
|
||||
}
|
||||
exports.createYargs = createYargs;
|
||||
/** @private */
|
||||
function normalizeOptions(args) {
|
||||
if (args.targets != null) {
|
||||
|
|
@ -35,7 +40,7 @@ function normalizeOptions(args) {
|
|||
if (args.universal) {
|
||||
result.push(builder_util_1.Arch.universal);
|
||||
}
|
||||
return result.length === 0 && currentIfNotSpecified ? [builder_util_1.archFromString(process.arch)] : result;
|
||||
return result.length === 0 && currentIfNotSpecified ? [(0, builder_util_1.archFromString)(process.arch)] : result;
|
||||
}
|
||||
let archToType = targets.get(platform);
|
||||
if (archToType == null) {
|
||||
|
|
@ -52,11 +57,11 @@ function normalizeOptions(args) {
|
|||
for (const type of types) {
|
||||
const suffixPos = type.lastIndexOf(":");
|
||||
if (suffixPos > 0) {
|
||||
builder_util_1.addValue(archToType, builder_util_1.archFromString(type.substring(suffixPos + 1)), type.substring(0, suffixPos));
|
||||
(0, builder_util_1.addValue)(archToType, (0, builder_util_1.archFromString)(type.substring(suffixPos + 1)), type.substring(0, suffixPos));
|
||||
}
|
||||
else {
|
||||
for (const arch of commonArch(true)) {
|
||||
builder_util_1.addValue(archToType, arch, type);
|
||||
(0, builder_util_1.addValue)(archToType, arch, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -105,7 +110,7 @@ function normalizeOptions(args) {
|
|||
const newConfig = {};
|
||||
for (const configItem of config) {
|
||||
if (typeof configItem === "object") {
|
||||
builder_util_1.deepAssign(newConfig, configItem);
|
||||
(0, builder_util_runtime_1.deepAssign)(newConfig, configItem);
|
||||
}
|
||||
else if (typeof configItem === "string") {
|
||||
newConfig.extends = configItem;
|
||||
|
|
@ -137,7 +142,6 @@ function normalizeOptions(args) {
|
|||
delete r.project;
|
||||
return result;
|
||||
}
|
||||
exports.normalizeOptions = normalizeOptions;
|
||||
function coerceValue(host, key) {
|
||||
const value = host[key];
|
||||
if (value === "true") {
|
||||
|
|
@ -163,11 +167,10 @@ function coerceTypes(host) {
|
|||
}
|
||||
return host;
|
||||
}
|
||||
exports.coerceTypes = coerceTypes;
|
||||
function createTargets(platforms, type, arch) {
|
||||
const targets = new Map();
|
||||
for (const platform of platforms) {
|
||||
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [builder_util_1.archFromString(arch == null ? process.arch : arch)];
|
||||
const archs = arch === "all" ? (platform === app_builder_lib_1.Platform.MAC ? [builder_util_1.Arch.x64, builder_util_1.Arch.arm64, builder_util_1.Arch.universal] : [builder_util_1.Arch.x64, builder_util_1.Arch.ia32]) : [(0, builder_util_1.archFromString)(arch == null ? process.arch : arch)];
|
||||
const archToType = new Map();
|
||||
targets.set(platform, archToType);
|
||||
for (const arch of archs) {
|
||||
|
|
@ -176,12 +179,10 @@ function createTargets(platforms, type, arch) {
|
|||
}
|
||||
return targets;
|
||||
}
|
||||
exports.createTargets = createTargets;
|
||||
function build(rawOptions) {
|
||||
const buildOptions = normalizeOptions(rawOptions || {});
|
||||
return app_builder_lib_1.build(buildOptions, new app_builder_lib_1.Packager(buildOptions));
|
||||
return (0, app_builder_lib_1.build)(buildOptions, new app_builder_lib_1.Packager(buildOptions));
|
||||
}
|
||||
exports.build = build;
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
|
@ -192,19 +193,19 @@ function configureBuildCommand(yargs) {
|
|||
.option("mac", {
|
||||
group: buildGroup,
|
||||
alias: ["m", "o", "macos"],
|
||||
description: `Build for macOS, accepts target list (see ${chalk.underline("https://goo.gl/5uHuzj")}).`,
|
||||
description: `Build for macOS, accepts target list (see ${chalk.underline("https://www.electron.build/mac")}).`,
|
||||
type: "array",
|
||||
})
|
||||
.option("linux", {
|
||||
group: buildGroup,
|
||||
alias: "l",
|
||||
description: `Build for Linux, accepts target list (see ${chalk.underline("https://goo.gl/4vwQad")})`,
|
||||
description: `Build for Linux, accepts target list (see ${chalk.underline("https://www.electron.build/linux")})`,
|
||||
type: "array",
|
||||
})
|
||||
.option("win", {
|
||||
group: buildGroup,
|
||||
alias: ["w", "windows"],
|
||||
description: `Build for Windows, accepts target list (see ${chalk.underline("https://goo.gl/jYsTEJ")})`,
|
||||
description: `Build for Windows, accepts target list (see ${chalk.underline("https://www.electron.build/win")})`,
|
||||
type: "array",
|
||||
})
|
||||
.option("x64", {
|
||||
|
|
@ -240,7 +241,7 @@ function configureBuildCommand(yargs) {
|
|||
.option("publish", {
|
||||
group: publishGroup,
|
||||
alias: "p",
|
||||
description: `Publish artifacts, see ${chalk.underline("https://goo.gl/tSFycD")}`,
|
||||
description: `Publish artifacts, see ${chalk.underline("https://www.electron.build/publish")}`,
|
||||
choices: ["onTag", "onTagOrDraft", "always", "never", undefined],
|
||||
})
|
||||
.option("prepackaged", {
|
||||
|
|
@ -256,7 +257,8 @@ function configureBuildCommand(yargs) {
|
|||
.option("config", {
|
||||
alias: ["c"],
|
||||
group: buildGroup,
|
||||
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`), see " + chalk.underline("https://goo.gl/YFRJOM"),
|
||||
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " +
|
||||
chalk.underline("https://www.electron.build/configuration"),
|
||||
})
|
||||
.group(["help", "version"], "Other:")
|
||||
.example("electron-builder -mwl", "build for macOS, Windows and Linux")
|
||||
|
|
@ -265,5 +267,4 @@ function configureBuildCommand(yargs) {
|
|||
.example("electron-builder -c.extraMetadata.foo=bar", "set package.json property `foo` to `bar`")
|
||||
.example("electron-builder --config.nsis.unicode=false", "configure unicode options for NSIS");
|
||||
}
|
||||
exports.configureBuildCommand = configureBuildCommand;
|
||||
//# sourceMappingURL=builder.js.map
|
||||
2
electron/node_modules/electron-builder/out/builder.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/builder.js.map
generated
vendored
File diff suppressed because one or more lines are too long
1
electron/node_modules/electron-builder/out/cli/clear-cache.d.ts
generated
vendored
Normal file
1
electron/node_modules/electron-builder/out/cli/clear-cache.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export declare function clearCache(): Promise<void>;
|
||||
46
electron/node_modules/electron-builder/out/cli/clear-cache.js
generated
vendored
Normal file
46
electron/node_modules/electron-builder/out/cli/clear-cache.js
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.clearCache = clearCache;
|
||||
const electronGet_1 = require("app-builder-lib/out/util/electronGet");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const promises_1 = require("fs/promises");
|
||||
const promises_2 = require("readline/promises");
|
||||
const path = require("path");
|
||||
async function clearCache() {
|
||||
const cacheDir = (0, electronGet_1.getCacheDirectory)({ isAvoidSystemOnWindows: false, allowEnvVarOverride: false });
|
||||
if (cacheDir === path.parse(cacheDir).root) {
|
||||
builder_util_1.log.error({ cacheDir }, "cache directory resolves to a filesystem root — aborting");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await (0, promises_1.access)(cacheDir, promises_1.constants.F_OK | promises_1.constants.W_OK);
|
||||
}
|
||||
catch (err) {
|
||||
if (err.code === "ENOENT") {
|
||||
builder_util_1.log.info({ cacheDir }, "cache directory does not exist, nothing to clear");
|
||||
}
|
||||
else if (err.code === "EACCES" || err.code === "EPERM") {
|
||||
builder_util_1.log.error({ cacheDir }, "cache directory is not writable");
|
||||
}
|
||||
else {
|
||||
throw err;
|
||||
}
|
||||
return;
|
||||
}
|
||||
const rl = (0, promises_2.createInterface)({ input: process.stdin, output: process.stdout });
|
||||
let answer;
|
||||
try {
|
||||
answer = await rl.question(`Clear cache at ${cacheDir}? [y/N] `);
|
||||
}
|
||||
finally {
|
||||
rl.close();
|
||||
}
|
||||
if (answer.trim().toLowerCase() !== "y" && answer.trim().toLowerCase() !== "yes") {
|
||||
builder_util_1.log.info(null, "aborted");
|
||||
return;
|
||||
}
|
||||
builder_util_1.log.info({ cacheDir }, "clearing cache");
|
||||
await (0, promises_1.rm)(cacheDir, { recursive: true });
|
||||
builder_util_1.log.info({ cacheDir }, "cache cleared");
|
||||
}
|
||||
//# sourceMappingURL=clear-cache.js.map
|
||||
1
electron/node_modules/electron-builder/out/cli/clear-cache.js.map
generated
vendored
Normal file
1
electron/node_modules/electron-builder/out/cli/clear-cache.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"clear-cache.js","sourceRoot":"","sources":["../../src/cli/clear-cache.ts"],"names":[],"mappings":";;AAMA,gCAoCC;AA1CD,sEAAwE;AACxE,+CAAkC;AAClC,0CAAmD;AACnD,gDAAmD;AACnD,6BAA4B;AAErB,KAAK,UAAU,UAAU;IAC9B,MAAM,QAAQ,GAAG,IAAA,+BAAiB,EAAC,EAAE,sBAAsB,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,CAAA;IAEjG,IAAI,QAAQ,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3C,kBAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,0DAA0D,CAAC,CAAA;QACnF,OAAM;IACR,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAA,iBAAM,EAAC,QAAQ,EAAE,oBAAS,CAAC,IAAI,GAAG,oBAAS,CAAC,IAAI,CAAC,CAAA;IACzD,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC1B,kBAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,kDAAkD,CAAC,CAAA;QAC5E,CAAC;aAAM,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YACzD,kBAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,EAAE,iCAAiC,CAAC,CAAA;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,GAAG,CAAA;QACX,CAAC;QACD,OAAM;IACR,CAAC;IAED,MAAM,EAAE,GAAG,IAAA,0BAAe,EAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAA;IAC5E,IAAI,MAAc,CAAA;IAClB,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,kBAAkB,QAAQ,UAAU,CAAC,CAAA;IAClE,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAA;IACZ,CAAC;IACD,IAAI,MAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,GAAG,IAAI,MAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,KAAK,EAAE,CAAC;QACnF,kBAAG,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;QACzB,OAAM;IACR,CAAC;IAED,kBAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,CAAC,CAAA;IACxC,MAAM,IAAA,aAAE,EAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACvC,kBAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,CAAC,CAAA;AACzC,CAAC","sourcesContent":["import { getCacheDirectory } from \"app-builder-lib/out/util/electronGet\"\nimport { log } from \"builder-util\"\nimport { access, constants, rm } from \"fs/promises\"\nimport { createInterface } from \"readline/promises\"\nimport * as path from \"path\"\n\nexport async function clearCache(): Promise<void> {\n const cacheDir = getCacheDirectory({ isAvoidSystemOnWindows: false, allowEnvVarOverride: false })\n\n if (cacheDir === path.parse(cacheDir).root) {\n log.error({ cacheDir }, \"cache directory resolves to a filesystem root — aborting\")\n return\n }\n\n try {\n await access(cacheDir, constants.F_OK | constants.W_OK)\n } catch (err: any) {\n if (err.code === \"ENOENT\") {\n log.info({ cacheDir }, \"cache directory does not exist, nothing to clear\")\n } else if (err.code === \"EACCES\" || err.code === \"EPERM\") {\n log.error({ cacheDir }, \"cache directory is not writable\")\n } else {\n throw err\n }\n return\n }\n\n const rl = createInterface({ input: process.stdin, output: process.stdout })\n let answer: string\n try {\n answer = await rl.question(`Clear cache at ${cacheDir}? [y/N] `)\n } finally {\n rl.close()\n }\n if (answer!.trim().toLowerCase() !== \"y\" && answer!.trim().toLowerCase() !== \"yes\") {\n log.info(null, \"aborted\")\n return\n }\n\n log.info({ cacheDir }, \"clearing cache\")\n await rm(cacheDir, { recursive: true })\n log.info({ cacheDir }, \"cache cleared\")\n}\n"]}
|
||||
2
electron/node_modules/electron-builder/out/cli/cli-util.d.ts
generated
vendored
Normal file
2
electron/node_modules/electron-builder/out/cli/cli-util.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export declare function checkIsOutdated(): Promise<void>;
|
||||
export declare function wrap(task: (args: any) => Promise<any>): (args: any) => Promise<any>;
|
||||
39
electron/node_modules/electron-builder/out/cli/cli-util.js
generated
vendored
Normal file
39
electron/node_modules/electron-builder/out/cli/cli-util.js
generated
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.checkIsOutdated = checkIsOutdated;
|
||||
exports.wrap = wrap;
|
||||
const load_1 = require("app-builder-lib/out/util/config/load");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const ci_info_1 = require("ci-info");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
async function checkIsOutdated() {
|
||||
if (ci_info_1.isCI || process.env.NO_UPDATE_NOTIFIER != null) {
|
||||
return;
|
||||
}
|
||||
const pkg = await (0, fs_extra_1.readJson)(path.join(__dirname, "..", "..", "package.json"));
|
||||
if (pkg.version === "0.0.0-semantic-release") {
|
||||
return;
|
||||
}
|
||||
const UpdateNotifier = require("simple-update-notifier");
|
||||
await UpdateNotifier({ pkg });
|
||||
}
|
||||
function wrap(task) {
|
||||
return (args) => {
|
||||
checkIsOutdated().catch((e) => builder_util_1.log.warn({ error: e }, "cannot check updates"));
|
||||
return (0, load_1.loadEnv)(path.join(process.cwd(), "electron-builder.env"))
|
||||
.then(() => task(args))
|
||||
.catch(error => {
|
||||
process.exitCode = 1;
|
||||
// https://github.com/electron-userland/electron-builder/issues/2940
|
||||
process.on("exit", () => (process.exitCode = 1));
|
||||
if (error instanceof builder_util_1.InvalidConfigurationError) {
|
||||
builder_util_1.log.error(null, error.message);
|
||||
}
|
||||
else if (!(error instanceof builder_util_1.ExecError) || !error.alreadyLogged) {
|
||||
builder_util_1.log.error({ failedTask: task.name, stackTrace: error.stack }, error.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=cli-util.js.map
|
||||
1
electron/node_modules/electron-builder/out/cli/cli-util.js.map
generated
vendored
Normal file
1
electron/node_modules/electron-builder/out/cli/cli-util.js.map
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"cli-util.js","sourceRoot":"","sources":["../../src/cli/cli-util.ts"],"names":[],"mappings":";;AAMA,0CAUC;AAED,oBAgBC;AAlCD,+DAA8D;AAC9D,+CAAwE;AACxE,qCAA8B;AAC9B,uCAAmC;AACnC,6BAA4B;AAErB,KAAK,UAAU,eAAe;IACnC,IAAI,cAAI,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;QACnD,OAAM;IACR,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAA;IAC5E,IAAI,GAAG,CAAC,OAAO,KAAK,wBAAwB,EAAE,CAAC;QAC7C,OAAM;IACR,CAAC;IACD,MAAM,cAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;IACxD,MAAM,cAAc,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,SAAgB,IAAI,CAAC,IAAiC;IACpD,OAAO,CAAC,IAAS,EAAE,EAAE;QACnB,eAAe,EAAE,CAAC,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,kBAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,sBAAsB,CAAC,CAAC,CAAA;QACnF,OAAO,IAAA,cAAO,EAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,sBAAsB,CAAC,CAAC;aAC7D,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aACtB,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAA;YACpB,oEAAoE;YACpE,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAA;YAChD,IAAI,KAAK,YAAY,wCAAyB,EAAE,CAAC;gBAC/C,kBAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAChC,CAAC;iBAAM,IAAI,CAAC,CAAC,KAAK,YAAY,wBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;gBACjE,kBAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;YAC9E,CAAC;QACH,CAAC,CAAC,CAAA;IACN,CAAC,CAAA;AACH,CAAC","sourcesContent":["import { loadEnv } from \"app-builder-lib/out/util/config/load\"\nimport { ExecError, InvalidConfigurationError, log } from \"builder-util\"\nimport { isCI } from \"ci-info\"\nimport { readJson } from \"fs-extra\"\nimport * as path from \"path\"\n\nexport async function checkIsOutdated(): Promise<void> {\n if (isCI || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\n const pkg = await readJson(path.join(__dirname, \"..\", \"..\", \"package.json\"))\n if (pkg.version === \"0.0.0-semantic-release\") {\n return\n }\n const UpdateNotifier = require(\"simple-update-notifier\")\n await UpdateNotifier({ pkg })\n}\n\nexport function wrap(task: (args: any) => Promise<any>) {\n return (args: any) => {\n checkIsOutdated().catch((e: any) => log.warn({ error: e }, \"cannot check updates\"))\n return loadEnv(path.join(process.cwd(), \"electron-builder.env\"))\n .then(() => task(args))\n .catch(error => {\n process.exitCode = 1\n // https://github.com/electron-userland/electron-builder/issues/2940\n process.on(\"exit\", () => (process.exitCode = 1))\n if (error instanceof InvalidConfigurationError) {\n log.error(null, error.message)\n } else if (!(error instanceof ExecError) || !error.alreadyLogged) {\n log.error({ failedTask: task.name, stackTrace: error.stack }, error.message)\n }\n })\n }\n}\n"]}
|
||||
58
electron/node_modules/electron-builder/out/cli/cli.js
generated
vendored
58
electron/node_modules/electron-builder/out/cli/cli.js
generated
vendored
|
|
@ -1,24 +1,22 @@
|
|||
#! /usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const builder_util_1 = require("builder-util");
|
||||
const chalk = require("chalk");
|
||||
const electronVersion_1 = require("app-builder-lib/out/electron/electronVersion");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const isCi = require("is-ci");
|
||||
const path = require("path");
|
||||
const read_config_file_1 = require("read-config-file");
|
||||
const util_1 = require("builder-util/out/util");
|
||||
const yarn_1 = require("app-builder-lib/out/util/yarn");
|
||||
const chalk = require("chalk");
|
||||
const builder_1 = require("../builder");
|
||||
const publish_1 = require("../publish");
|
||||
const clear_cache_1 = require("./clear-cache");
|
||||
const cli_util_1 = require("./cli-util");
|
||||
const create_self_signed_cert_1 = require("./create-self-signed-cert");
|
||||
const install_app_deps_1 = require("./install-app-deps");
|
||||
const start_1 = require("./start");
|
||||
const yarn_1 = require("app-builder-lib/out/util/yarn");
|
||||
// tslint:disable:no-unused-expression
|
||||
void builder_1.createYargs()
|
||||
.command(["build", "*"], "Build", builder_1.configureBuildCommand, wrap(builder_1.build))
|
||||
.command("install-app-deps", "Install app deps", install_app_deps_1.configureInstallAppDepsCommand, wrap(install_app_deps_1.installAppDeps))
|
||||
.command("node-gyp-rebuild", "Rebuild own native code", install_app_deps_1.configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))
|
||||
void (0, builder_1.createYargs)()
|
||||
.command(["build", "*"], "Build", builder_1.configureBuildCommand, (0, cli_util_1.wrap)(builder_1.build))
|
||||
.command("install-app-deps", "Install app deps", install_app_deps_1.configureInstallAppDepsCommand, (0, cli_util_1.wrap)(install_app_deps_1.installAppDeps))
|
||||
.command("node-gyp-rebuild", "Rebuild own native code", install_app_deps_1.configureInstallAppDepsCommand /* yes, args the same as for install app deps */, (0, cli_util_1.wrap)(rebuildAppNativeCode))
|
||||
.command("publish", "Publish a list of artifacts", publish_1.configurePublishCommand, (0, cli_util_1.wrap)(publish_1.publish))
|
||||
.command("create-self-signed-cert", "Create self-signed code signing cert for Windows apps", yargs => yargs
|
||||
.option("publisher", {
|
||||
alias: ["p"],
|
||||
|
|
@ -26,44 +24,16 @@ void builder_1.createYargs()
|
|||
requiresArg: true,
|
||||
description: "The publisher name",
|
||||
})
|
||||
.demandOption("publisher"), wrap(argv => create_self_signed_cert_1.createSelfSignedCert(argv.publisher)))
|
||||
.command("start", "Run application in a development mode using electron-webpack", yargs => yargs, wrap(() => start_1.start()))
|
||||
.demandOption("publisher"), (0, cli_util_1.wrap)(argv => (0, create_self_signed_cert_1.createSelfSignedCert)(argv.publisher)))
|
||||
.command("start", "Run application in a development mode using electron-webpack", yargs => yargs, (0, cli_util_1.wrap)(() => (0, start_1.start)()))
|
||||
.command("clear-cache", "Clear the electron-builder default cache directory", yargs => yargs, (0, cli_util_1.wrap)(() => (0, clear_cache_1.clearCache)()))
|
||||
.help()
|
||||
.epilog(`See ${chalk.underline("https://electron.build")} for more documentation.`)
|
||||
.strict()
|
||||
.recommendCommands().argv;
|
||||
function wrap(task) {
|
||||
return (args) => {
|
||||
checkIsOutdated().catch(e => builder_util_1.log.warn({ error: e }, "cannot check updates"));
|
||||
read_config_file_1.loadEnv(path.join(process.cwd(), "electron-builder.env"))
|
||||
.then(() => task(args))
|
||||
.catch(error => {
|
||||
process.exitCode = 1;
|
||||
// https://github.com/electron-userland/electron-builder/issues/2940
|
||||
process.on("exit", () => (process.exitCode = 1));
|
||||
if (error instanceof builder_util_1.InvalidConfigurationError) {
|
||||
builder_util_1.log.error(null, error.message);
|
||||
}
|
||||
else if (!(error instanceof util_1.ExecError) || !error.alreadyLogged) {
|
||||
builder_util_1.log.error({ failedTask: task.name, stackTrace: error.stack }, error.message);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
async function checkIsOutdated() {
|
||||
if (isCi || process.env.NO_UPDATE_NOTIFIER != null) {
|
||||
return;
|
||||
}
|
||||
const pkg = await fs_extra_1.readJson(path.join(__dirname, "..", "..", "package.json"));
|
||||
if (pkg.version === "0.0.0-semantic-release") {
|
||||
return;
|
||||
}
|
||||
const UpdateNotifier = require("simple-update-notifier");
|
||||
await UpdateNotifier({ pkg });
|
||||
}
|
||||
async function rebuildAppNativeCode(args) {
|
||||
const projectDir = process.cwd();
|
||||
// this script must be used only for electron
|
||||
return yarn_1.nodeGypRebuild(args.platform, args.arch, { version: await electronVersion_1.getElectronVersion(projectDir), useCustomDist: true });
|
||||
return (0, yarn_1.nodeGypRebuild)(args.platform, args.arch, { version: await (0, electronVersion_1.getElectronVersion)(projectDir), useCustomDist: true });
|
||||
}
|
||||
//# sourceMappingURL=cli.js.map
|
||||
2
electron/node_modules/electron-builder/out/cli/cli.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/cli/cli.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.d.ts
generated
vendored
2
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.d.ts
generated
vendored
|
|
@ -1 +1 @@
|
|||
export {};
|
||||
export declare function quoteString(s: string): string;
|
||||
|
|
|
|||
27
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.js
generated
vendored
27
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.js
generated
vendored
|
|
@ -1,38 +1,37 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createSelfSignedCert = void 0;
|
||||
const filename_1 = require("app-builder-lib/out/util/filename");
|
||||
exports.createSelfSignedCert = createSelfSignedCert;
|
||||
exports.quoteString = quoteString;
|
||||
const windows_1 = require("app-builder-lib/out/toolsets/windows");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const filename_1 = require("builder-util/out/filename");
|
||||
const chalk = require("chalk");
|
||||
const windowsCodeSign_1 = require("app-builder-lib/out/codeSign/windowsCodeSign");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
/** @internal */
|
||||
async function createSelfSignedCert(publisher) {
|
||||
const tmpDir = new builder_util_1.TmpDir("create-self-signed-cert");
|
||||
const targetDir = process.cwd();
|
||||
const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: "self-signed-cert-creator" }), filename_1.sanitizeFileName(publisher));
|
||||
const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: "self-signed-cert-creator" }), (0, filename_1.sanitizeFileName)(publisher));
|
||||
const cer = `${tempPrefix}.cer`;
|
||||
const pvk = `${tempPrefix}.pvk`;
|
||||
builder_util_1.log.info(chalk.bold('When asked to enter a password ("Create Private Key Password"), please select "None".'));
|
||||
try {
|
||||
await promises_1.mkdir(path.dirname(tempPrefix), { recursive: true });
|
||||
const vendorPath = path.join(await windowsCodeSign_1.getSignVendorPath(), "windows-10", process.arch);
|
||||
await builder_util_1.exec(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]);
|
||||
const pfx = path.join(targetDir, `${filename_1.sanitizeFileName(publisher)}.pfx`);
|
||||
await fs_1.unlinkIfExists(pfx);
|
||||
await builder_util_1.exec(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]);
|
||||
await (0, promises_1.mkdir)(path.dirname(tempPrefix), { recursive: true });
|
||||
const vendorPath = (await (0, windows_1.getWindowsKitsBundle)({ winCodeSign: null, arch: (0, builder_util_1.archFromString)(process.arch) })).kit;
|
||||
await (0, builder_util_1.exec)(path.join(vendorPath, "makecert.exe"), ["-r", "-h", "0", "-n", `CN=${quoteString(publisher)}`, "-eku", "1.3.6.1.5.5.7.3.3", "-pe", "-sv", pvk, cer]);
|
||||
const pfx = path.join(targetDir, `${(0, filename_1.sanitizeFileName)(publisher)}.pfx`);
|
||||
await (0, builder_util_1.unlinkIfExists)(pfx);
|
||||
await (0, builder_util_1.exec)(path.join(vendorPath, "pvk2pfx.exe"), ["-pvk", pvk, "-spc", cer, "-pfx", pfx]);
|
||||
builder_util_1.log.info({ file: pfx }, `created. Please see https://electron.build/code-signing how to use it to sign.`);
|
||||
const certLocation = "Cert:\\LocalMachine\\TrustedPeople";
|
||||
builder_util_1.log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`);
|
||||
await builder_util_1.spawn("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation]);
|
||||
builder_util_1.log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`);
|
||||
await (0, builder_util_1.spawn)("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", "Import-PfxCertificate", "-FilePath", `"${pfx}"`, "-CertStoreLocation", certLocation]);
|
||||
}
|
||||
finally {
|
||||
await tmpDir.cleanup();
|
||||
}
|
||||
}
|
||||
exports.createSelfSignedCert = createSelfSignedCert;
|
||||
function quoteString(s) {
|
||||
if (!s.includes(",") && !s.includes('"')) {
|
||||
return s;
|
||||
|
|
|
|||
2
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/cli/create-self-signed-cert.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"create-self-signed-cert.js","sourceRoot":"","sources":["../../src/cli/create-self-signed-cert.ts"],"names":[],"mappings":";;;AAAA,gEAAoE;AACpE,+CAAuD;AACvD,4CAAoD;AACpD,+BAA8B;AAC9B,kFAAgF;AAChF,0CAAmC;AACnC,6BAA4B;AAE5B,gBAAgB;AACT,KAAK,UAAU,oBAAoB,CAAC,SAAiB;IAC1D,MAAM,MAAM,GAAG,IAAI,qBAAM,CAAC,yBAAyB,CAAC,CAAA;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,EAAE,2BAAgB,CAAC,SAAS,CAAC,CAAC,CAAA;IAC1H,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM,CAAA;IAC/B,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM,CAAA;IAE/B,kBAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,uFAAuF,CAAC,CAAC,CAAA;IAE7G,IAAI;QACF,MAAM,gBAAK,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1D,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,mCAAiB,EAAE,EAAE,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;QACnF,MAAM,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QAE/J,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,2BAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACtE,MAAM,mBAAc,CAAC,GAAG,CAAC,CAAA;QACzB,MAAM,mBAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;QACzF,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,gFAAgF,CAAC,CAAA;QAEzG,MAAM,YAAY,GAAG,oCAAoC,CAAA;QACzD,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,gGAAgG,CAAC,CAAA;QACvI,MAAM,oBAAK,CAAC,gBAAgB,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,uBAAuB,EAAE,WAAW,EAAE,IAAI,GAAG,GAAG,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAA;KACnK;YAAS;QACR,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;KACvB;AACH,CAAC;AAzBD,oDAyBC;AAED,SAAS,WAAW,CAAC,CAAS;IAC5B,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QACxC,OAAO,CAAC,CAAA;KACT;IAED,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAA;AACtC,CAAC","sourcesContent":["import { sanitizeFileName } from \"app-builder-lib/out/util/filename\"\nimport { exec, log, spawn, TmpDir } from \"builder-util\"\nimport { unlinkIfExists } from \"builder-util/out/fs\"\nimport * as chalk from \"chalk\"\nimport { getSignVendorPath } from \"app-builder-lib/out/codeSign/windowsCodeSign\"\nimport { mkdir } from \"fs/promises\"\nimport * as path from \"path\"\n\n/** @internal */\nexport async function createSelfSignedCert(publisher: string) {\n const tmpDir = new TmpDir(\"create-self-signed-cert\")\n const targetDir = process.cwd()\n const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: \"self-signed-cert-creator\" }), sanitizeFileName(publisher))\n const cer = `${tempPrefix}.cer`\n const pvk = `${tempPrefix}.pvk`\n\n log.info(chalk.bold('When asked to enter a password (\"Create Private Key Password\"), please select \"None\".'))\n\n try {\n await mkdir(path.dirname(tempPrefix), { recursive: true })\n const vendorPath = path.join(await getSignVendorPath(), \"windows-10\", process.arch)\n await exec(path.join(vendorPath, \"makecert.exe\"), [\"-r\", \"-h\", \"0\", \"-n\", `CN=${quoteString(publisher)}`, \"-eku\", \"1.3.6.1.5.5.7.3.3\", \"-pe\", \"-sv\", pvk, cer])\n\n const pfx = path.join(targetDir, `${sanitizeFileName(publisher)}.pfx`)\n await unlinkIfExists(pfx)\n await exec(path.join(vendorPath, \"pvk2pfx.exe\"), [\"-pvk\", pvk, \"-spc\", cer, \"-pfx\", pfx])\n log.info({ file: pfx }, `created. Please see https://electron.build/code-signing how to use it to sign.`)\n\n const certLocation = \"Cert:\\\\LocalMachine\\\\TrustedPeople\"\n log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`)\n await spawn(\"powershell.exe\", [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Import-PfxCertificate\", \"-FilePath\", `\"${pfx}\"`, \"-CertStoreLocation\", certLocation])\n } finally {\n await tmpDir.cleanup()\n }\n}\n\nfunction quoteString(s: string): string {\n if (!s.includes(\",\") && !s.includes('\"')) {\n return s\n }\n\n return `\"${s.replace(/\"/g, '\\\\\"')}\"`\n}\n"]}
|
||||
{"version":3,"file":"create-self-signed-cert.js","sourceRoot":"","sources":["../../src/cli/create-self-signed-cert.ts"],"names":[],"mappings":";;AAQA,oDAyBC;AAED,kCAMC;AAzCD,kEAA2E;AAC3E,+CAAuF;AACvF,wDAA4D;AAC5D,+BAA8B;AAC9B,0CAAmC;AACnC,6BAA4B;AAE5B,gBAAgB;AACT,KAAK,UAAU,oBAAoB,CAAC,SAAiB;IAC1D,MAAM,MAAM,GAAG,IAAI,qBAAM,CAAC,yBAAyB,CAAC,CAAA;IACpD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAC/B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,CAAC,EAAE,IAAA,2BAAgB,EAAC,SAAS,CAAC,CAAC,CAAA;IAC1H,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM,CAAA;IAC/B,MAAM,GAAG,GAAG,GAAG,UAAU,MAAM,CAAA;IAE/B,kBAAG,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,uFAAuF,CAAC,CAAC,CAAA;IAE7G,IAAI,CAAC;QACH,MAAM,IAAA,gBAAK,EAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;QAC1D,MAAM,UAAU,GAAG,CAAC,MAAM,IAAA,8BAAoB,EAAC,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,IAAA,6BAAc,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAC9G,MAAM,IAAA,mBAAI,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;QAE/J,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,IAAA,2BAAgB,EAAC,SAAS,CAAC,MAAM,CAAC,CAAA;QACtE,MAAM,IAAA,6BAAc,EAAC,GAAG,CAAC,CAAA;QACzB,MAAM,IAAA,mBAAI,EAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAA;QACzF,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,gFAAgF,CAAC,CAAA;QAEzG,MAAM,YAAY,GAAG,oCAAoC,CAAA;QACzD,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,EAAE,iGAAiG,CAAC,CAAA;QACxI,MAAM,IAAA,oBAAK,EAAC,gBAAgB,EAAE,CAAC,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,uBAAuB,EAAE,WAAW,EAAE,IAAI,GAAG,GAAG,EAAE,oBAAoB,EAAE,YAAY,CAAC,CAAC,CAAA;IACpK,CAAC;YAAS,CAAC;QACT,MAAM,MAAM,CAAC,OAAO,EAAE,CAAA;IACxB,CAAC;AACH,CAAC;AAED,SAAgB,WAAW,CAAC,CAAS;IACnC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,CAAA;IACV,CAAC;IAED,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAA;AACtC,CAAC","sourcesContent":["import { getWindowsKitsBundle } from \"app-builder-lib/out/toolsets/windows\"\nimport { archFromString, exec, log, spawn, TmpDir, unlinkIfExists } from \"builder-util\"\nimport { sanitizeFileName } from \"builder-util/out/filename\"\nimport * as chalk from \"chalk\"\nimport { mkdir } from \"fs/promises\"\nimport * as path from \"path\"\n\n/** @internal */\nexport async function createSelfSignedCert(publisher: string) {\n const tmpDir = new TmpDir(\"create-self-signed-cert\")\n const targetDir = process.cwd()\n const tempPrefix = path.join(await tmpDir.getTempDir({ prefix: \"self-signed-cert-creator\" }), sanitizeFileName(publisher))\n const cer = `${tempPrefix}.cer`\n const pvk = `${tempPrefix}.pvk`\n\n log.info(chalk.bold('When asked to enter a password (\"Create Private Key Password\"), please select \"None\".'))\n\n try {\n await mkdir(path.dirname(tempPrefix), { recursive: true })\n const vendorPath = (await getWindowsKitsBundle({ winCodeSign: null, arch: archFromString(process.arch) })).kit\n await exec(path.join(vendorPath, \"makecert.exe\"), [\"-r\", \"-h\", \"0\", \"-n\", `CN=${quoteString(publisher)}`, \"-eku\", \"1.3.6.1.5.5.7.3.3\", \"-pe\", \"-sv\", pvk, cer])\n\n const pfx = path.join(targetDir, `${sanitizeFileName(publisher)}.pfx`)\n await unlinkIfExists(pfx)\n await exec(path.join(vendorPath, \"pvk2pfx.exe\"), [\"-pvk\", pvk, \"-spc\", cer, \"-pfx\", pfx])\n log.info({ file: pfx }, `created. Please see https://electron.build/code-signing how to use it to sign.`)\n\n const certLocation = \"Cert:\\\\LocalMachine\\\\TrustedPeople\"\n log.info({ file: pfx, certLocation }, `importing. Operation will be succeed only if runned from root. Otherwise import file manually.`)\n await spawn(\"powershell.exe\", [\"-NoProfile\", \"-NonInteractive\", \"-Command\", \"Import-PfxCertificate\", \"-FilePath\", `\"${pfx}\"`, \"-CertStoreLocation\", certLocation])\n } finally {\n await tmpDir.cleanup()\n }\n}\n\nexport function quoteString(s: string): string {\n if (!s.includes(\",\") && !s.includes('\"')) {\n return s\n }\n\n return `\"${s.replace(/\"/g, '\\\\\"')}\"`\n}\n"]}
|
||||
40
electron/node_modules/electron-builder/out/cli/install-app-deps.js
generated
vendored
40
electron/node_modules/electron-builder/out/cli/install-app-deps.js
generated
vendored
|
|
@ -1,18 +1,18 @@
|
|||
#! /usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.installAppDeps = exports.configureInstallAppDepsCommand = void 0;
|
||||
const version_1 = require("app-builder-lib/out/version");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const promise_1 = require("builder-util/out/promise");
|
||||
const config_1 = require("app-builder-lib/out/util/config");
|
||||
exports.configureInstallAppDepsCommand = configureInstallAppDepsCommand;
|
||||
exports.installAppDeps = installAppDeps;
|
||||
const electronVersion_1 = require("app-builder-lib/out/electron/electronVersion");
|
||||
const packageDependencies_1 = require("app-builder-lib/out/util/packageDependencies");
|
||||
const config_1 = require("app-builder-lib/out/util/config/config");
|
||||
const load_1 = require("app-builder-lib/out/util/config/load");
|
||||
const yarn_1 = require("app-builder-lib/out/util/yarn");
|
||||
const version_1 = require("app-builder-lib/out/version");
|
||||
const node_module_collector_1 = require("app-builder-lib/out/node-module-collector");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const path = require("path");
|
||||
const read_config_file_1 = require("read-config-file");
|
||||
const yargs = require("yargs");
|
||||
/** @internal */
|
||||
function configureInstallAppDepsCommand(yargs) {
|
||||
|
|
@ -28,14 +28,14 @@ function configureInstallAppDepsCommand(yargs) {
|
|||
description: "The target platform",
|
||||
})
|
||||
.option("arch", {
|
||||
choices: builder_util_1.getArchCliNames().concat("all"),
|
||||
choices: (0, builder_util_1.getArchCliNames)().concat("all"),
|
||||
default: process.arch === "arm" ? "armv7l" : process.arch,
|
||||
description: "The target arch",
|
||||
});
|
||||
}
|
||||
exports.configureInstallAppDepsCommand = configureInstallAppDepsCommand;
|
||||
/** @internal */
|
||||
async function installAppDeps(args) {
|
||||
var _a;
|
||||
try {
|
||||
builder_util_1.log.info({ version: version_1.PACKAGE_VERSION }, "electron-builder");
|
||||
}
|
||||
|
|
@ -46,26 +46,26 @@ async function installAppDeps(args) {
|
|||
}
|
||||
}
|
||||
const projectDir = process.cwd();
|
||||
const packageMetadata = new lazy_val_1.Lazy(() => read_config_file_1.orNullIfFileNotExist(fs_extra_1.readJson(path.join(projectDir, "package.json"))));
|
||||
const config = await config_1.getConfig(projectDir, null, null, packageMetadata);
|
||||
const [appDir, version] = await Promise.all([
|
||||
config_1.computeDefaultAppDirectory(projectDir, builder_util_1.use(config.directories, it => it.app)),
|
||||
electronVersion_1.getElectronVersion(projectDir, config, packageMetadata),
|
||||
]);
|
||||
const packageMetadata = new lazy_val_1.Lazy(() => (0, load_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json"))));
|
||||
const config = await (0, config_1.getConfig)(projectDir, null, null, packageMetadata);
|
||||
const [appDir, version] = await Promise.all([(0, config_1.computeDefaultAppDirectory)(projectDir, (_a = config.directories) === null || _a === void 0 ? void 0 : _a.app), (0, electronVersion_1.getElectronVersion)(projectDir, config)]);
|
||||
const packageManagerEnv = (0, node_module_collector_1.determinePackageManagerEnv)({ projectDir, appDir, workspaceRoot: undefined });
|
||||
// if two package.json — force full install (user wants to install/update app deps in addition to dev)
|
||||
await yarn_1.installOrRebuild(config, appDir, {
|
||||
await (0, yarn_1.installOrRebuild)(config, {
|
||||
appDir,
|
||||
projectDir,
|
||||
workspaceRoot: await (await packageManagerEnv.value).workspaceRoot,
|
||||
}, {
|
||||
frameworkInfo: { version, useCustomDist: true },
|
||||
platform: args.platform,
|
||||
arch: args.arch,
|
||||
productionDeps: packageDependencies_1.createLazyProductionDeps(appDir, null),
|
||||
}, appDir !== projectDir);
|
||||
}, appDir !== projectDir, {});
|
||||
}
|
||||
exports.installAppDeps = installAppDeps;
|
||||
function main() {
|
||||
return installAppDeps(configureInstallAppDepsCommand(yargs).argv);
|
||||
}
|
||||
if (require.main === module) {
|
||||
builder_util_1.log.warn("please use as subcommand: electron-builder install-app-deps");
|
||||
main().catch(promise_1.printErrorAndExit);
|
||||
main().catch(builder_util_1.printErrorAndExit);
|
||||
}
|
||||
//# sourceMappingURL=install-app-deps.js.map
|
||||
2
electron/node_modules/electron-builder/out/cli/install-app-deps.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/cli/install-app-deps.js.map
generated
vendored
File diff suppressed because one or more lines are too long
3
electron/node_modules/electron-builder/out/cli/start.js
generated
vendored
3
electron/node_modules/electron-builder/out/cli/start.js
generated
vendored
|
|
@ -1,10 +1,9 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.start = void 0;
|
||||
exports.start = start;
|
||||
/** @internal */
|
||||
function start() {
|
||||
require("electron-webpack/dev-runner");
|
||||
return Promise.resolve();
|
||||
}
|
||||
exports.start = start;
|
||||
//# sourceMappingURL=start.js.map
|
||||
2
electron/node_modules/electron-builder/out/cli/start.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/cli/start.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,SAAgB,KAAK;IACnB,OAAO,CAAC,6BAA6B,CAAC,CAAA;IACtC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;AAC1B,CAAC;AAHD,sBAGC","sourcesContent":["/** @internal */\nexport function start() {\n require(\"electron-webpack/dev-runner\")\n return Promise.resolve()\n}\n"]}
|
||||
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/cli/start.ts"],"names":[],"mappings":";;AACA,sBAGC;AAJD,gBAAgB;AAChB,SAAgB,KAAK;IACnB,OAAO,CAAC,6BAA6B,CAAC,CAAA;IACtC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;AAC1B,CAAC","sourcesContent":["/** @internal */\nexport function start() {\n require(\"electron-webpack/dev-runner\")\n return Promise.resolve()\n}\n"]}
|
||||
5
electron/node_modules/electron-builder/out/index.d.ts
generated
vendored
5
electron/node_modules/electron-builder/out/index.d.ts
generated
vendored
|
|
@ -1,5 +1,6 @@
|
|||
export { getArchSuffix, Arch, archFromString } from "builder-util";
|
||||
export { getArchSuffix, Arch, archFromString, log } from "builder-util";
|
||||
export { build, CliOptions, createTargets } from "./builder";
|
||||
export { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel, MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, PkgOptions, DmgContent, DmgWindow, PlatformSpecificBuildOptions, AsarOptions, FileSet, LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, Configuration, AfterPackContext, MetadataDirectories, Protocol, ReleaseInfo, ElectronBrandingOptions, ElectronDownloadOptions, SnapOptions, CommonWindowsInstallerConfiguration, FileAssociation, MsiOptions, AppXOptions, WindowsConfiguration, Packager, BuildResult, PackagerOptions, ArtifactCreated, ArtifactBuildStarted, NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions, SquirrelWindowsOptions, WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo, Metadata, AuthorMetadata, RepositoryInfo, AppInfo, UploadTask, PublishManager, PublishOptions, ProgressInfo, } from "app-builder-lib";
|
||||
export { publish, publishArtifactsWithOptions } from "./publish";
|
||||
export { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel, MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, PkgOptions, DmgContent, DmgWindow, PlatformSpecificBuildOptions, AsarOptions, FileSet, LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, Configuration, AfterPackContext, MetadataDirectories, Protocol, ReleaseInfo, ElectronBrandingOptions, ElectronDownloadOptions, SnapOptions, CommonWindowsInstallerConfiguration, FileAssociation, MsiOptions, AppXOptions, WindowsConfiguration, Packager, BuildResult, PackagerOptions, ArtifactCreated, ArtifactBuildStarted, NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions, SquirrelWindowsOptions, WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo, Metadata, AuthorMetadata, RepositoryInfo, AppInfo, UploadTask, PublishManager, PublishOptions, ProgressInfo, MacPackager, WinPackager, LinuxPackager, } from "app-builder-lib";
|
||||
export { buildForge, ForgeOptions } from "app-builder-lib";
|
||||
export { CancellationToken } from "builder-util-runtime";
|
||||
|
|
|
|||
9
electron/node_modules/electron-builder/out/index.js
generated
vendored
9
electron/node_modules/electron-builder/out/index.js
generated
vendored
|
|
@ -1,13 +1,17 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CancellationToken = exports.buildForge = exports.PublishManager = exports.AppInfo = exports.Packager = exports.DEFAULT_TARGET = exports.DIR_TARGET = exports.Target = exports.Platform = exports.createTargets = exports.build = exports.archFromString = exports.Arch = exports.getArchSuffix = void 0;
|
||||
exports.CancellationToken = exports.buildForge = exports.LinuxPackager = exports.WinPackager = exports.MacPackager = exports.PublishManager = exports.AppInfo = exports.Packager = exports.DEFAULT_TARGET = exports.DIR_TARGET = exports.Target = exports.Platform = exports.publishArtifactsWithOptions = exports.publish = exports.createTargets = exports.build = exports.log = exports.archFromString = exports.Arch = exports.getArchSuffix = void 0;
|
||||
var builder_util_1 = require("builder-util");
|
||||
Object.defineProperty(exports, "getArchSuffix", { enumerable: true, get: function () { return builder_util_1.getArchSuffix; } });
|
||||
Object.defineProperty(exports, "Arch", { enumerable: true, get: function () { return builder_util_1.Arch; } });
|
||||
Object.defineProperty(exports, "archFromString", { enumerable: true, get: function () { return builder_util_1.archFromString; } });
|
||||
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return builder_util_1.log; } });
|
||||
var builder_1 = require("./builder");
|
||||
Object.defineProperty(exports, "build", { enumerable: true, get: function () { return builder_1.build; } });
|
||||
Object.defineProperty(exports, "createTargets", { enumerable: true, get: function () { return builder_1.createTargets; } });
|
||||
var publish_1 = require("./publish");
|
||||
Object.defineProperty(exports, "publish", { enumerable: true, get: function () { return publish_1.publish; } });
|
||||
Object.defineProperty(exports, "publishArtifactsWithOptions", { enumerable: true, get: function () { return publish_1.publishArtifactsWithOptions; } });
|
||||
var app_builder_lib_1 = require("app-builder-lib");
|
||||
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return app_builder_lib_1.Platform; } });
|
||||
Object.defineProperty(exports, "Target", { enumerable: true, get: function () { return app_builder_lib_1.Target; } });
|
||||
|
|
@ -16,6 +20,9 @@ Object.defineProperty(exports, "DEFAULT_TARGET", { enumerable: true, get: functi
|
|||
Object.defineProperty(exports, "Packager", { enumerable: true, get: function () { return app_builder_lib_1.Packager; } });
|
||||
Object.defineProperty(exports, "AppInfo", { enumerable: true, get: function () { return app_builder_lib_1.AppInfo; } });
|
||||
Object.defineProperty(exports, "PublishManager", { enumerable: true, get: function () { return app_builder_lib_1.PublishManager; } });
|
||||
Object.defineProperty(exports, "MacPackager", { enumerable: true, get: function () { return app_builder_lib_1.MacPackager; } });
|
||||
Object.defineProperty(exports, "WinPackager", { enumerable: true, get: function () { return app_builder_lib_1.WinPackager; } });
|
||||
Object.defineProperty(exports, "LinuxPackager", { enumerable: true, get: function () { return app_builder_lib_1.LinuxPackager; } });
|
||||
var app_builder_lib_2 = require("app-builder-lib");
|
||||
Object.defineProperty(exports, "buildForge", { enumerable: true, get: function () { return app_builder_lib_2.buildForge; } });
|
||||
var builder_util_runtime_1 = require("builder-util-runtime");
|
||||
|
|
|
|||
2
electron/node_modules/electron-builder/out/index.js.map
generated
vendored
2
electron/node_modules/electron-builder/out/index.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAAkE;AAAzD,6GAAA,aAAa,OAAA;AAAE,oGAAA,IAAI,OAAA;AAAE,8GAAA,cAAc,OAAA;AAC5C,qCAA4D;AAAnD,gGAAA,KAAK,OAAA;AAAc,wGAAA,aAAa,OAAA;AACzC,mDA+DwB;AA7DtB,2GAAA,QAAQ,OAAA;AACR,yGAAA,MAAM,OAAA;AACN,6GAAA,UAAU,OAAA;AAKV,iHAAA,cAAc,OAAA;AA8Bd,2GAAA,QAAQ,OAAA;AAmBR,0GAAA,OAAO,OAAA;AAEP,iHAAA,cAAc,OAAA;AAIhB,mDAA0D;AAAjD,6GAAA,UAAU,OAAA;AACnB,6DAAwD;AAA/C,yHAAA,iBAAiB,OAAA","sourcesContent":["export { getArchSuffix, Arch, archFromString } from \"builder-util\"\nexport { build, CliOptions, createTargets } from \"./builder\"\nexport {\n TargetConfiguration,\n Platform,\n Target,\n DIR_TARGET,\n BeforeBuildContext,\n SourceRepositoryInfo,\n TargetSpecificOptions,\n TargetConfigType,\n DEFAULT_TARGET,\n CompressionLevel,\n MacConfiguration,\n DmgOptions,\n MasConfiguration,\n MacOsTargetName,\n PkgOptions,\n DmgContent,\n DmgWindow,\n PlatformSpecificBuildOptions,\n AsarOptions,\n FileSet,\n LinuxConfiguration,\n DebOptions,\n CommonLinuxOptions,\n LinuxTargetSpecificOptions,\n AppImageOptions,\n Configuration,\n AfterPackContext,\n MetadataDirectories,\n Protocol,\n ReleaseInfo,\n ElectronBrandingOptions,\n ElectronDownloadOptions,\n SnapOptions,\n CommonWindowsInstallerConfiguration,\n FileAssociation,\n MsiOptions,\n AppXOptions,\n WindowsConfiguration,\n Packager,\n BuildResult,\n PackagerOptions,\n ArtifactCreated,\n ArtifactBuildStarted,\n NsisOptions,\n NsisWebOptions,\n PortableOptions,\n CommonNsisOptions,\n SquirrelWindowsOptions,\n WindowsSignOptions,\n CustomWindowsSignTaskConfiguration,\n WindowsSignTaskConfiguration,\n CustomWindowsSign,\n FileCodeSigningInfo,\n CertificateFromStoreInfo,\n Metadata,\n AuthorMetadata,\n RepositoryInfo,\n AppInfo,\n UploadTask,\n PublishManager,\n PublishOptions,\n ProgressInfo,\n} from \"app-builder-lib\"\nexport { buildForge, ForgeOptions } from \"app-builder-lib\"\nexport { CancellationToken } from \"builder-util-runtime\"\n"]}
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,6CAAuE;AAA9D,6GAAA,aAAa,OAAA;AAAE,oGAAA,IAAI,OAAA;AAAE,8GAAA,cAAc,OAAA;AAAE,mGAAA,GAAG,OAAA;AACjD,qCAA4D;AAAnD,gGAAA,KAAK,OAAA;AAAc,wGAAA,aAAa,OAAA;AACzC,qCAAgE;AAAvD,kGAAA,OAAO,OAAA;AAAE,sHAAA,2BAA2B,OAAA;AAC7C,mDAkEwB;AAhEtB,2GAAA,QAAQ,OAAA;AACR,yGAAA,MAAM,OAAA;AACN,6GAAA,UAAU,OAAA;AAKV,iHAAA,cAAc,OAAA;AA8Bd,2GAAA,QAAQ,OAAA;AAmBR,0GAAA,OAAO,OAAA;AAEP,iHAAA,cAAc,OAAA;AAGd,8GAAA,WAAW,OAAA;AACX,8GAAA,WAAW,OAAA;AACX,gHAAA,aAAa,OAAA;AAEf,mDAA0D;AAAjD,6GAAA,UAAU,OAAA;AACnB,6DAAwD;AAA/C,yHAAA,iBAAiB,OAAA","sourcesContent":["export { getArchSuffix, Arch, archFromString, log } from \"builder-util\"\nexport { build, CliOptions, createTargets } from \"./builder\"\nexport { publish, publishArtifactsWithOptions } from \"./publish\"\nexport {\n TargetConfiguration,\n Platform,\n Target,\n DIR_TARGET,\n BeforeBuildContext,\n SourceRepositoryInfo,\n TargetSpecificOptions,\n TargetConfigType,\n DEFAULT_TARGET,\n CompressionLevel,\n MacConfiguration,\n DmgOptions,\n MasConfiguration,\n MacOsTargetName,\n PkgOptions,\n DmgContent,\n DmgWindow,\n PlatformSpecificBuildOptions,\n AsarOptions,\n FileSet,\n LinuxConfiguration,\n DebOptions,\n CommonLinuxOptions,\n LinuxTargetSpecificOptions,\n AppImageOptions,\n Configuration,\n AfterPackContext,\n MetadataDirectories,\n Protocol,\n ReleaseInfo,\n ElectronBrandingOptions,\n ElectronDownloadOptions,\n SnapOptions,\n CommonWindowsInstallerConfiguration,\n FileAssociation,\n MsiOptions,\n AppXOptions,\n WindowsConfiguration,\n Packager,\n BuildResult,\n PackagerOptions,\n ArtifactCreated,\n ArtifactBuildStarted,\n NsisOptions,\n NsisWebOptions,\n PortableOptions,\n CommonNsisOptions,\n SquirrelWindowsOptions,\n WindowsSignOptions,\n CustomWindowsSignTaskConfiguration,\n WindowsSignTaskConfiguration,\n CustomWindowsSign,\n FileCodeSigningInfo,\n CertificateFromStoreInfo,\n Metadata,\n AuthorMetadata,\n RepositoryInfo,\n AppInfo,\n UploadTask,\n PublishManager,\n PublishOptions,\n ProgressInfo,\n MacPackager,\n WinPackager,\n LinuxPackager,\n} from \"app-builder-lib\"\nexport { buildForge, ForgeOptions } from \"app-builder-lib\"\nexport { CancellationToken } from \"builder-util-runtime\"\n"]}
|
||||
14
electron/node_modules/electron-builder/out/publish.d.ts
generated
vendored
Normal file
14
electron/node_modules/electron-builder/out/publish.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#! /usr/bin/env node
|
||||
import { PublishOptions, UploadTask } from "app-builder-lib";
|
||||
import { Publish } from "app-builder-lib/out/core";
|
||||
import { PublishPolicy } from "electron-publish";
|
||||
export declare function publish(args: {
|
||||
files: string[];
|
||||
version: string | undefined;
|
||||
configurationFilePath: string | undefined;
|
||||
policy: PublishPolicy;
|
||||
}): Promise<UploadTask[] | null>;
|
||||
export declare function publishArtifactsWithOptions(uploadOptions: {
|
||||
file: string;
|
||||
arch: string | null;
|
||||
}[], buildVersion?: string, configurationFilePath?: string, publishConfiguration?: Publish, publishOptions?: PublishOptions): Promise<UploadTask[] | null>;
|
||||
108
electron/node_modules/electron-builder/out/publish.js
generated
vendored
Normal file
108
electron/node_modules/electron-builder/out/publish.js
generated
vendored
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
#! /usr/bin/env node
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.configurePublishCommand = configurePublishCommand;
|
||||
exports.publish = publish;
|
||||
exports.publishArtifactsWithOptions = publishArtifactsWithOptions;
|
||||
const app_builder_lib_1 = require("app-builder-lib");
|
||||
const platformPackager_1 = require("app-builder-lib/out/platformPackager");
|
||||
const config_1 = require("app-builder-lib/out/util/config/config");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const chalk = require("chalk");
|
||||
const path = require("path");
|
||||
const yargs = require("yargs");
|
||||
const builder_1 = require("./builder");
|
||||
/** @internal */
|
||||
function configurePublishCommand(yargs) {
|
||||
// https://github.com/yargs/yargs/issues/760
|
||||
// demandOption is required to be set
|
||||
return yargs
|
||||
.version(false)
|
||||
.parserConfiguration({
|
||||
"camel-case-expansion": false,
|
||||
})
|
||||
.option("files", {
|
||||
alias: "f",
|
||||
string: true,
|
||||
type: "array",
|
||||
requiresArg: true,
|
||||
description: "The file(s) to upload to your publisher",
|
||||
})
|
||||
.option("version", {
|
||||
alias: ["v"],
|
||||
type: "string",
|
||||
description: "The app/build version used when searching for an upload release (used by some Publishers)",
|
||||
})
|
||||
.option("config", {
|
||||
alias: ["c", "configurationFilePath"],
|
||||
type: "string",
|
||||
description: "The path to an electron-builder config. Defaults to `electron-builder.yml` (or `json`, or `json5`, or `js`, or `ts`), see " + chalk.underline("https://goo.gl/YFRJOM"),
|
||||
})
|
||||
.option("policy", {
|
||||
alias: ["p"],
|
||||
type: "string",
|
||||
description: `Publish trigger policy, see ${chalk.underline("https://www.electron.build/publish")}`,
|
||||
choices: ["onTag", "onTagOrDraft", "always", "never", undefined],
|
||||
})
|
||||
.demandOption("files");
|
||||
}
|
||||
async function publish(args) {
|
||||
const uploadTasks = args.files.map(f => {
|
||||
return {
|
||||
file: path.resolve(f),
|
||||
arch: null,
|
||||
};
|
||||
});
|
||||
return publishArtifactsWithOptions(uploadTasks, args.version, args.configurationFilePath, undefined, { publish: args.policy });
|
||||
}
|
||||
async function publishArtifactsWithOptions(uploadOptions, buildVersion, configurationFilePath, publishConfiguration, publishOptions) {
|
||||
const projectDir = process.cwd();
|
||||
const config = await (0, config_1.getConfig)(projectDir, configurationFilePath || null, { publish: publishConfiguration, detectUpdateChannel: false });
|
||||
const buildOptions = (0, builder_1.normalizeOptions)({ config, publish: publishOptions === null || publishOptions === void 0 ? void 0 : publishOptions.publish });
|
||||
(0, app_builder_lib_1.checkBuildRequestOptions)(buildOptions);
|
||||
const uniqueUploads = Array.from(new Set(uploadOptions));
|
||||
const tasks = uniqueUploads.map(({ file, arch }) => {
|
||||
const filename = path.basename(file);
|
||||
return { file, arch: arch ? (0, builder_util_1.archFromString)(arch) : null, safeArtifactName: (0, platformPackager_1.computeSafeArtifactNameIfNeeded)(filename, () => filename) };
|
||||
});
|
||||
return publishPackageWithTasks(buildOptions, tasks, buildVersion);
|
||||
}
|
||||
async function publishPackageWithTasks(options, uploadTasks, buildVersion, cancellationToken = new app_builder_lib_1.CancellationToken(), packager = new app_builder_lib_1.Packager(options, cancellationToken)) {
|
||||
await packager.validateConfig();
|
||||
const appInfo = new app_builder_lib_1.AppInfo(packager, buildVersion);
|
||||
const publishManager = new app_builder_lib_1.PublishManager(packager, options, cancellationToken);
|
||||
const sigIntHandler = () => {
|
||||
builder_util_1.log.warn("cancelled by SIGINT");
|
||||
packager.cancellationToken.cancel();
|
||||
publishManager.cancelTasks();
|
||||
};
|
||||
process.once("SIGINT", sigIntHandler);
|
||||
try {
|
||||
const publishConfigurations = await publishManager.getGlobalPublishConfigurations();
|
||||
if (publishConfigurations == null || publishConfigurations.length === 0) {
|
||||
throw new builder_util_1.InvalidConfigurationError("unable to find any publish configuration");
|
||||
}
|
||||
for (const newArtifact of uploadTasks) {
|
||||
for (const publishConfiguration of publishConfigurations) {
|
||||
await publishManager.scheduleUpload(publishConfiguration, newArtifact, appInfo);
|
||||
}
|
||||
}
|
||||
await publishManager.awaitTasks();
|
||||
return uploadTasks;
|
||||
}
|
||||
catch (error) {
|
||||
packager.cancellationToken.cancel();
|
||||
publishManager.cancelTasks();
|
||||
process.removeListener("SIGINT", sigIntHandler);
|
||||
builder_util_1.log.error({ message: (error.stack || error.message || error).toString() }, "error publishing");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function main() {
|
||||
return publish(configurePublishCommand(yargs).argv);
|
||||
}
|
||||
if (require.main === module) {
|
||||
builder_util_1.log.warn("please use as subcommand: electron-builder publish");
|
||||
main().catch(builder_util_1.printErrorAndExit);
|
||||
}
|
||||
//# sourceMappingURL=publish.js.map
|
||||
1
electron/node_modules/electron-builder/out/publish.js.map
generated
vendored
Normal file
1
electron/node_modules/electron-builder/out/publish.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
27
electron/node_modules/electron-builder/package.json
generated
vendored
27
electron/node_modules/electron-builder/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "electron-builder",
|
||||
"description": "A complete solution to package and build a ready for distribution Electron app for MacOS, Windows and Linux with “auto update” support out of the box",
|
||||
"version": "23.6.0",
|
||||
"version": "26.15.3",
|
||||
"main": "out/index.js",
|
||||
"files": [
|
||||
"out"
|
||||
|
|
@ -44,28 +44,27 @@
|
|||
],
|
||||
"author": "Vladimir Krivosheev",
|
||||
"contributors": [
|
||||
"Stefan Judis"
|
||||
"Stefan Judis",
|
||||
"Mike Maietta"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": "https://github.com/electron-userland/electron-builder/issues",
|
||||
"homepage": "https://github.com/electron-userland/electron-builder",
|
||||
"dependencies": {
|
||||
"@types/yargs": "^17.0.1",
|
||||
"app-builder-lib": "23.6.0",
|
||||
"builder-util": "23.6.0",
|
||||
"builder-util-runtime": "9.1.1",
|
||||
"chalk": "^4.1.1",
|
||||
"dmg-builder": "23.6.0",
|
||||
"fs-extra": "^10.0.0",
|
||||
"is-ci": "^3.0.0",
|
||||
"chalk": "^4.1.2",
|
||||
"ci-info": "^4.2.0",
|
||||
"fs-extra": "^10.1.0",
|
||||
"lazy-val": "^1.0.5",
|
||||
"read-config-file": "6.2.0",
|
||||
"simple-update-notifier": "^1.0.7",
|
||||
"yargs": "^17.5.1"
|
||||
"simple-update-notifier": "2.0.0",
|
||||
"yargs": "^17.6.2",
|
||||
"app-builder-lib": "26.15.3",
|
||||
"builder-util-runtime": "9.7.0",
|
||||
"dmg-builder": "26.15.3",
|
||||
"builder-util": "26.15.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/is-ci": "3.0.0"
|
||||
"@types/yargs": "^17.0.16"
|
||||
},
|
||||
"typings": "./out/index.d.ts",
|
||||
"publishConfig": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue