electron-builder 25.0.0-alpha.5 → 25.0.0-alpha.7
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/cli/cli.js +2 -0
- package/out/cli/cli.js.map +1 -1
- package/out/index.d.ts +3 -2
- package/out/index.js +8 -1
- package/out/index.js.map +1 -1
- package/out/publish.d.ts +12 -0
- package/out/publish.js +103 -0
- package/out/publish.js.map +1 -0
- package/package.json +4 -4
package/out/cli/cli.js
CHANGED
|
@@ -14,11 +14,13 @@ const install_app_deps_1 = require("./install-app-deps");
|
|
|
14
14
|
const start_1 = require("./start");
|
|
15
15
|
const yarn_1 = require("app-builder-lib/out/util/yarn");
|
|
16
16
|
const electronVersion_1 = require("app-builder-lib/out/electron/electronVersion");
|
|
17
|
+
const publish_1 = require("../publish");
|
|
17
18
|
// tslint:disable:no-unused-expression
|
|
18
19
|
void (0, builder_1.createYargs)()
|
|
19
20
|
.command(["build", "*"], "Build", builder_1.configureBuildCommand, wrap(builder_1.build))
|
|
20
21
|
.command("install-app-deps", "Install app deps", install_app_deps_1.configureInstallAppDepsCommand, wrap(install_app_deps_1.installAppDeps))
|
|
21
22
|
.command("node-gyp-rebuild", "Rebuild own native code", install_app_deps_1.configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))
|
|
23
|
+
.command("publish", "Publish a list of artifacts", publish_1.configurePublishCommand, wrap(publish_1.publish))
|
|
22
24
|
.command("create-self-signed-cert", "Create self-signed code signing cert for Windows apps", yargs => yargs
|
|
23
25
|
.option("publisher", {
|
|
24
26
|
alias: ["p"],
|
package/out/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;AAEA,+CAA6D;AAC7D,+BAA8B;AAC9B,uCAAmC;AACnC,8BAA6B;AAC7B,6BAA4B;AAC5B,uDAA0C;AAC1C,g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AC,CAAC,CAAA;IACN,CAAC,CAAA;AACH,CAAC;AAED,KAAK,UAAU,eAAe;IAC5B,IAAI,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;QACnD,OAAM;IACR,CAAC;IAED,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,KAAK,UAAU,oBAAoB,CAAC,IAAS;IAC3C,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;IAChC,6CAA6C;IAC7C,OAAO,IAAA,qBAAc,EAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,IAAA,oCAAkB,EAAC,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;AACzH,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport { InvalidConfigurationError, log } from \"builder-util\"\nimport * as chalk from \"chalk\"\nimport { readJson } from \"fs-extra\"\nimport * as isCi from \"is-ci\"\nimport * as path from \"path\"\nimport { loadEnv } from \"read-config-file\"\nimport { ExecError } from \"builder-util/out/util\"\nimport { build, configureBuildCommand, createYargs } from \"../builder\"\nimport { createSelfSignedCert } from \"./create-self-signed-cert\"\nimport { configureInstallAppDepsCommand, installAppDeps } from \"./install-app-deps\"\nimport { start } from \"./start\"\nimport { nodeGypRebuild } from \"app-builder-lib/out/util/yarn\"\nimport { getElectronVersion } from \"app-builder-lib/out/electron/electronVersion\"\nimport { configurePublishCommand, publish } from \"../publish\"\n\n// tslint:disable:no-unused-expression\nvoid createYargs()\n .command([\"build\", \"*\"], \"Build\", configureBuildCommand, wrap(build))\n .command(\"install-app-deps\", \"Install app deps\", configureInstallAppDepsCommand, wrap(installAppDeps))\n .command(\"node-gyp-rebuild\", \"Rebuild own native code\", configureInstallAppDepsCommand /* yes, args the same as for install app deps */, wrap(rebuildAppNativeCode))\n .command(\"publish\", \"Publish a list of artifacts\", configurePublishCommand, wrap(publish))\n .command(\n \"create-self-signed-cert\",\n \"Create self-signed code signing cert for Windows apps\",\n yargs =>\n yargs\n .option(\"publisher\", {\n alias: [\"p\"],\n type: \"string\",\n requiresArg: true,\n description: \"The publisher name\",\n })\n .demandOption(\"publisher\"),\n wrap(argv => createSelfSignedCert(argv.publisher))\n )\n .command(\n \"start\",\n \"Run application in a development mode using electron-webpack\",\n yargs => yargs,\n wrap(() => start())\n )\n .help()\n .epilog(`See ${chalk.underline(\"https://electron.build\")} for more documentation.`)\n .strict()\n .recommendCommands().argv\n\nfunction wrap(task: (args: any) => Promise<any>) {\n return (args: any) => {\n checkIsOutdated().catch((e: any) => log.warn({ error: e }, \"cannot check updates\"))\n 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\nasync function checkIsOutdated() {\n if (isCi || process.env.NO_UPDATE_NOTIFIER != null) {\n return\n }\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\nasync function rebuildAppNativeCode(args: any) {\n const projectDir = process.cwd()\n // this script must be used only for electron\n return nodeGypRebuild(args.platform, args.arch, { version: await getElectronVersion(projectDir), useCustomDist: true })\n}\n"]}
|
package/out/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { getArchSuffix, Arch, archFromString } from "builder-util";
|
|
1
|
+
export { getArchSuffix, Arch, archFromString, log } from "builder-util";
|
|
2
2
|
export { build, CliOptions, createTargets } from "./builder";
|
|
3
|
-
export {
|
|
3
|
+
export { publish, publishArtifactsWithOptions } from "./publish";
|
|
4
|
+
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";
|
|
4
5
|
export { buildForge, ForgeOptions } from "app-builder-lib";
|
|
5
6
|
export { CancellationToken } from "builder-util-runtime";
|
package/out/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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;
|
|
3
|
+
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;
|
|
4
4
|
var builder_util_1 = require("builder-util");
|
|
5
5
|
Object.defineProperty(exports, "getArchSuffix", { enumerable: true, get: function () { return builder_util_1.getArchSuffix; } });
|
|
6
6
|
Object.defineProperty(exports, "Arch", { enumerable: true, get: function () { return builder_util_1.Arch; } });
|
|
7
7
|
Object.defineProperty(exports, "archFromString", { enumerable: true, get: function () { return builder_util_1.archFromString; } });
|
|
8
|
+
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return builder_util_1.log; } });
|
|
8
9
|
var builder_1 = require("./builder");
|
|
9
10
|
Object.defineProperty(exports, "build", { enumerable: true, get: function () { return builder_1.build; } });
|
|
10
11
|
Object.defineProperty(exports, "createTargets", { enumerable: true, get: function () { return builder_1.createTargets; } });
|
|
12
|
+
var publish_1 = require("./publish");
|
|
13
|
+
Object.defineProperty(exports, "publish", { enumerable: true, get: function () { return publish_1.publish; } });
|
|
14
|
+
Object.defineProperty(exports, "publishArtifactsWithOptions", { enumerable: true, get: function () { return publish_1.publishArtifactsWithOptions; } });
|
|
11
15
|
var app_builder_lib_1 = require("app-builder-lib");
|
|
12
16
|
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return app_builder_lib_1.Platform; } });
|
|
13
17
|
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
|
|
|
16
20
|
Object.defineProperty(exports, "Packager", { enumerable: true, get: function () { return app_builder_lib_1.Packager; } });
|
|
17
21
|
Object.defineProperty(exports, "AppInfo", { enumerable: true, get: function () { return app_builder_lib_1.AppInfo; } });
|
|
18
22
|
Object.defineProperty(exports, "PublishManager", { enumerable: true, get: function () { return app_builder_lib_1.PublishManager; } });
|
|
23
|
+
Object.defineProperty(exports, "MacPackager", { enumerable: true, get: function () { return app_builder_lib_1.MacPackager; } });
|
|
24
|
+
Object.defineProperty(exports, "WinPackager", { enumerable: true, get: function () { return app_builder_lib_1.WinPackager; } });
|
|
25
|
+
Object.defineProperty(exports, "LinuxPackager", { enumerable: true, get: function () { return app_builder_lib_1.LinuxPackager; } });
|
|
19
26
|
var app_builder_lib_2 = require("app-builder-lib");
|
|
20
27
|
Object.defineProperty(exports, "buildForge", { enumerable: true, get: function () { return app_builder_lib_2.buildForge; } });
|
|
21
28
|
var builder_util_runtime_1 = require("builder-util-runtime");
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"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"]}
|
package/out/publish.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
import { UploadTask } from "app-builder-lib";
|
|
3
|
+
import { Publish } from "app-builder-lib/out/core";
|
|
4
|
+
export declare function publish(args: {
|
|
5
|
+
files: string[];
|
|
6
|
+
version: string | undefined;
|
|
7
|
+
config: string | undefined;
|
|
8
|
+
}): Promise<UploadTask[] | null>;
|
|
9
|
+
export declare function publishArtifactsWithOptions(uploadOptions: {
|
|
10
|
+
file: string;
|
|
11
|
+
arch: string | null;
|
|
12
|
+
}[], buildVersion?: string, configurationFilePath?: string, publishConfiguration?: Publish): Promise<UploadTask[] | null>;
|
package/out/publish.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
#! /usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.publishArtifactsWithOptions = exports.publish = exports.configurePublishCommand = void 0;
|
|
5
|
+
const app_builder_lib_1 = require("app-builder-lib");
|
|
6
|
+
const platformPackager_1 = require("app-builder-lib/out/platformPackager");
|
|
7
|
+
const config_1 = require("app-builder-lib/out/util/config");
|
|
8
|
+
const builder_util_1 = require("builder-util");
|
|
9
|
+
const promise_1 = require("builder-util/out/promise");
|
|
10
|
+
const chalk = require("chalk");
|
|
11
|
+
const path = require("path");
|
|
12
|
+
const yargs = require("yargs");
|
|
13
|
+
const builder_1 = require("./builder");
|
|
14
|
+
/** @internal */
|
|
15
|
+
function configurePublishCommand(yargs) {
|
|
16
|
+
// https://github.com/yargs/yargs/issues/760
|
|
17
|
+
// demandOption is required to be set
|
|
18
|
+
return yargs
|
|
19
|
+
.parserConfiguration({
|
|
20
|
+
"camel-case-expansion": false,
|
|
21
|
+
})
|
|
22
|
+
.option("files", {
|
|
23
|
+
alias: "f",
|
|
24
|
+
string: true,
|
|
25
|
+
type: "array",
|
|
26
|
+
requiresArg: true,
|
|
27
|
+
description: "The file(s) to upload to your publisher",
|
|
28
|
+
})
|
|
29
|
+
.option("version", {
|
|
30
|
+
alias: ["v"],
|
|
31
|
+
type: "string",
|
|
32
|
+
description: "The app/build version used when searching for an upload release (used by some Publishers)",
|
|
33
|
+
})
|
|
34
|
+
.option("config", {
|
|
35
|
+
alias: ["c"],
|
|
36
|
+
type: "string",
|
|
37
|
+
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"),
|
|
38
|
+
})
|
|
39
|
+
.demandOption("files");
|
|
40
|
+
}
|
|
41
|
+
exports.configurePublishCommand = configurePublishCommand;
|
|
42
|
+
async function publish(args) {
|
|
43
|
+
const uploadTasks = args.files.map(f => {
|
|
44
|
+
return {
|
|
45
|
+
file: path.resolve(f),
|
|
46
|
+
arch: null,
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
return publishArtifactsWithOptions(uploadTasks, args.version, args.config);
|
|
50
|
+
}
|
|
51
|
+
exports.publish = publish;
|
|
52
|
+
async function publishArtifactsWithOptions(uploadOptions, buildVersion, configurationFilePath, publishConfiguration) {
|
|
53
|
+
const projectDir = process.cwd();
|
|
54
|
+
const config = await (0, config_1.getConfig)(projectDir, configurationFilePath || null, { publish: publishConfiguration, detectUpdateChannel: false });
|
|
55
|
+
const buildOptions = (0, builder_1.normalizeOptions)({ config });
|
|
56
|
+
(0, app_builder_lib_1.checkBuildRequestOptions)(buildOptions);
|
|
57
|
+
const uniqueUploads = Array.from(new Set(uploadOptions));
|
|
58
|
+
const tasks = uniqueUploads.map(({ file, arch }) => {
|
|
59
|
+
const filename = path.basename(file);
|
|
60
|
+
return { file, arch: arch ? (0, builder_util_1.archFromString)(arch) : null, safeArtifactName: (0, platformPackager_1.computeSafeArtifactNameIfNeeded)(filename, () => filename) };
|
|
61
|
+
});
|
|
62
|
+
return publishPackageWithTasks(buildOptions, tasks, buildVersion);
|
|
63
|
+
}
|
|
64
|
+
exports.publishArtifactsWithOptions = publishArtifactsWithOptions;
|
|
65
|
+
async function publishPackageWithTasks(options, uploadTasks, buildVersion, cancellationToken = new app_builder_lib_1.CancellationToken(), packager = new app_builder_lib_1.Packager(options, cancellationToken)) {
|
|
66
|
+
await packager.validateConfig();
|
|
67
|
+
const appInfo = new app_builder_lib_1.AppInfo(packager, buildVersion);
|
|
68
|
+
const publishManager = new app_builder_lib_1.PublishManager(packager, options, cancellationToken);
|
|
69
|
+
const sigIntHandler = () => {
|
|
70
|
+
builder_util_1.log.warn("cancelled by SIGINT");
|
|
71
|
+
packager.cancellationToken.cancel();
|
|
72
|
+
publishManager.cancelTasks();
|
|
73
|
+
};
|
|
74
|
+
process.once("SIGINT", sigIntHandler);
|
|
75
|
+
try {
|
|
76
|
+
const publishConfigurations = await publishManager.getGlobalPublishConfigurations();
|
|
77
|
+
if (publishConfigurations == null || publishConfigurations.length === 0) {
|
|
78
|
+
throw new builder_util_1.InvalidConfigurationError("unable to find any publish configuration");
|
|
79
|
+
}
|
|
80
|
+
for (const newArtifact of uploadTasks) {
|
|
81
|
+
for (const publishConfiguration of publishConfigurations) {
|
|
82
|
+
publishManager.scheduleUpload(publishConfiguration, newArtifact, appInfo);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
await publishManager.awaitTasks();
|
|
86
|
+
return uploadTasks;
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
packager.cancellationToken.cancel();
|
|
90
|
+
publishManager.cancelTasks();
|
|
91
|
+
process.removeListener("SIGINT", sigIntHandler);
|
|
92
|
+
builder_util_1.log.error({ message: (error.stack || error.message || error).toString() }, "error publishing");
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
function main() {
|
|
97
|
+
return publish(configurePublishCommand(yargs).argv);
|
|
98
|
+
}
|
|
99
|
+
if (require.main === module) {
|
|
100
|
+
builder_util_1.log.warn("please use as subcommand: electron-builder publish");
|
|
101
|
+
main().catch(promise_1.printErrorAndExit);
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":";;;;AAEA,qDAA6J;AAE7J,2EAAsF;AACtF,4DAA2D;AAC3D,+CAA6E;AAC7E,sDAA4D;AAC5D,+BAA8B;AAC9B,6BAA4B;AAC5B,+BAA8B;AAC9B,uCAA0D;AAE1D,gBAAgB;AAChB,SAAgB,uBAAuB,CAAC,KAAiB;IACvD,4CAA4C;IAC5C,qCAAqC;IACrC,OAAO,KAAK;SACT,mBAAmB,CAAC;QACnB,sBAAsB,EAAE,KAAK;KAC9B,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,KAAK,EAAE,GAAG;QACV,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,IAAI;QACjB,WAAW,EAAE,yCAAyC;KACvD,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,2FAA2F;KACzG,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,CAAC,GAAG,CAAC;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,4HAA4H,GAAG,KAAK,CAAC,SAAS,CAAC,uBAAuB,CAAC;KAC1K,CAAC;SACD,YAAY,CAAC,OAAO,CAAC,CAAA;AAC1B,CAAC;AA1BD,0DA0BC;AAEM,KAAK,UAAU,OAAO,CAAC,IAAkF;IAC9G,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;QACrC,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;YACrB,IAAI,EAAE,IAAI;SACX,CAAA;IACH,CAA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QAC/C,kBAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,EAAE,kBAAkB,CAAC,CAAA;IAChG,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,SAAS,IAAI;IACX,OAAO,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,IAAW,CAAC,CAAA;AAC5D,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,kBAAG,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAA;IAC9D,IAAI,EAAE,CAAC,KAAK,CAAC,2BAAiB,CAAC,CAAA;AACjC,CAAC","sourcesContent":["#! /usr/bin/env node\n\nimport { AppInfo, CancellationToken, Packager, PackagerOptions, PublishManager, PublishOptions, UploadTask, checkBuildRequestOptions } from \"app-builder-lib\"\nimport { Publish } from \"app-builder-lib/out/core\"\nimport { computeSafeArtifactNameIfNeeded } from \"app-builder-lib/out/platformPackager\"\nimport { getConfig } from \"app-builder-lib/out/util/config\"\nimport { InvalidConfigurationError, archFromString, log } from \"builder-util\"\nimport { printErrorAndExit } from \"builder-util/out/promise\"\nimport * as chalk from \"chalk\"\nimport * as path from \"path\"\nimport * as yargs from \"yargs\"\nimport { BuildOptions, normalizeOptions } from \"./builder\"\n\n/** @internal */\nexport function configurePublishCommand(yargs: yargs.Argv): yargs.Argv {\n // https://github.com/yargs/yargs/issues/760\n // demandOption is required to be set\n return yargs\n .parserConfiguration({\n \"camel-case-expansion\": false,\n })\n .option(\"files\", {\n alias: \"f\",\n string: true,\n type: \"array\",\n requiresArg: true,\n description: \"The file(s) to upload to your publisher\",\n })\n .option(\"version\", {\n alias: [\"v\"],\n type: \"string\",\n description: \"The app/build version used when searching for an upload release (used by some Publishers)\",\n })\n .option(\"config\", {\n alias: [\"c\"],\n type: \"string\",\n description:\n \"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\"),\n })\n .demandOption(\"files\")\n}\n\nexport async function publish(args: { files: string[]; version: string | undefined; config: string | undefined }) {\n const uploadTasks = args.files.map(f => {\n return {\n file: path.resolve(f),\n arch: null,\n }\n })\n return publishArtifactsWithOptions(uploadTasks, args.version, args.config)\n}\n\nexport async function publishArtifactsWithOptions(\n uploadOptions: { file: string; arch: string | null }[],\n buildVersion?: string,\n configurationFilePath?: string,\n publishConfiguration?: Publish\n) {\n const projectDir = process.cwd()\n const config = await getConfig(projectDir, configurationFilePath || null, { publish: publishConfiguration, detectUpdateChannel: false })\n\n const buildOptions: BuildOptions = normalizeOptions({ config })\n checkBuildRequestOptions(buildOptions)\n\n const uniqueUploads = Array.from(new Set(uploadOptions))\n const tasks: UploadTask[] = uniqueUploads.map(({ file, arch }) => {\n const filename = path.basename(file)\n return { file, arch: arch ? archFromString(arch) : null, safeArtifactName: computeSafeArtifactNameIfNeeded(filename, () => filename) }\n })\n\n return publishPackageWithTasks(buildOptions, tasks, buildVersion)\n}\n\nasync function publishPackageWithTasks(\n options: PackagerOptions & PublishOptions,\n uploadTasks: UploadTask[],\n buildVersion?: string,\n cancellationToken: CancellationToken = new CancellationToken(),\n packager: Packager = new Packager(options, cancellationToken)\n) {\n await packager.validateConfig()\n const appInfo = new AppInfo(packager, buildVersion)\n const publishManager = new PublishManager(packager, options, cancellationToken)\n\n const sigIntHandler = () => {\n log.warn(\"cancelled by SIGINT\")\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n }\n process.once(\"SIGINT\", sigIntHandler)\n\n try {\n const publishConfigurations = await publishManager.getGlobalPublishConfigurations()\n if (publishConfigurations == null || publishConfigurations.length === 0) {\n throw new InvalidConfigurationError(\"unable to find any publish configuration\")\n }\n\n for (const newArtifact of uploadTasks) {\n for (const publishConfiguration of publishConfigurations) {\n publishManager.scheduleUpload(publishConfiguration, newArtifact, appInfo)\n }\n }\n\n await publishManager.awaitTasks()\n return uploadTasks\n } catch (error: any) {\n packager.cancellationToken.cancel()\n publishManager.cancelTasks()\n process.removeListener(\"SIGINT\", sigIntHandler)\n log.error({ message: (error.stack || error.message || error).toString() }, \"error publishing\")\n }\n return null\n}\n\nfunction main() {\n return publish(configurePublishCommand(yargs).argv as any)\n}\n\nif (require.main === module) {\n log.warn(\"please use as subcommand: electron-builder publish\")\n main().catch(printErrorAndExit)\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "electron-builder",
|
|
3
3
|
"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",
|
|
4
|
-
"version": "25.0.0-alpha.
|
|
4
|
+
"version": "25.0.0-alpha.7",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"files": [
|
|
7
7
|
"out"
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
"read-config-file": "6.3.2",
|
|
58
58
|
"simple-update-notifier": "2.0.0",
|
|
59
59
|
"yargs": "^17.6.2",
|
|
60
|
-
"app-builder-lib": "25.0.0-alpha.
|
|
60
|
+
"app-builder-lib": "25.0.0-alpha.7",
|
|
61
|
+
"builder-util": "25.0.0-alpha.6",
|
|
61
62
|
"builder-util-runtime": "9.2.5-alpha.2",
|
|
62
|
-
"dmg-builder": "25.0.0-alpha.
|
|
63
|
-
"builder-util": "25.0.0-alpha.4"
|
|
63
|
+
"dmg-builder": "25.0.0-alpha.7"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/fs-extra": "9.0.13",
|