forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
17
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.d.ts
generated
vendored
17
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.d.ts
generated
vendored
|
|
@ -1,17 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import { Arch } from "builder-util";
|
||||
import { ClientRequest } from "http";
|
||||
import { HttpPublisher, PublishContext } from "electron-publish";
|
||||
import { BitbucketOptions } from "builder-util-runtime/out/publishOptions";
|
||||
export declare class BitbucketPublisher extends HttpPublisher {
|
||||
readonly providerName = "bitbucket";
|
||||
readonly hostname = "api.bitbucket.org";
|
||||
private readonly info;
|
||||
private readonly auth;
|
||||
private readonly basePath;
|
||||
constructor(context: PublishContext, info: BitbucketOptions);
|
||||
protected doUpload(fileName: string, _arch: Arch, _dataLength: number, _requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, file: string): Promise<any>;
|
||||
deleteRelease(filename: string): Promise<void>;
|
||||
toString(): string;
|
||||
static convertAppPassword(username: string, token: string): string;
|
||||
}
|
||||
60
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.js
generated
vendored
60
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.js
generated
vendored
|
|
@ -1,60 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BitbucketPublisher = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const nodeHttpExecutor_1 = require("builder-util/out/nodeHttpExecutor");
|
||||
const electron_publish_1 = require("electron-publish");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const FormData = require("form-data");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
class BitbucketPublisher extends electron_publish_1.HttpPublisher {
|
||||
constructor(context, info) {
|
||||
super(context);
|
||||
this.providerName = "bitbucket";
|
||||
this.hostname = "api.bitbucket.org";
|
||||
const token = info.token || process.env.BITBUCKET_TOKEN || null;
|
||||
const username = info.username || process.env.BITBUCKET_USERNAME || null;
|
||||
if (builder_util_1.isEmptyOrSpaces(token)) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Bitbucket token is not set using env "BITBUCKET_TOKEN" (see https://www.electron.build/configuration/publish#BitbucketOptions)`);
|
||||
}
|
||||
if (builder_util_1.isEmptyOrSpaces(username)) {
|
||||
builder_util_1.log.warn('No Bitbucket username provided via "BITBUCKET_USERNAME". Defaulting to use repo owner.');
|
||||
}
|
||||
this.info = info;
|
||||
this.auth = BitbucketPublisher.convertAppPassword(username !== null && username !== void 0 ? username : this.info.owner, token);
|
||||
this.basePath = `/2.0/repositories/${this.info.owner}/${this.info.slug}/downloads`;
|
||||
}
|
||||
doUpload(fileName, _arch, _dataLength, _requestProcessor, file) {
|
||||
return builder_util_runtime_1.HttpExecutor.retryOnServerError(async () => {
|
||||
const fileContent = await fs_extra_1.readFile(file);
|
||||
const form = new FormData();
|
||||
form.append("files", fileContent, fileName);
|
||||
const upload = {
|
||||
hostname: this.hostname,
|
||||
path: this.basePath,
|
||||
headers: form.getHeaders(),
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
await nodeHttpExecutor_1.httpExecutor.doApiRequest(builder_util_runtime_1.configureRequestOptions(upload, this.auth, "POST"), this.context.cancellationToken, it => form.pipe(it));
|
||||
return fileName;
|
||||
});
|
||||
}
|
||||
async deleteRelease(filename) {
|
||||
const req = {
|
||||
hostname: this.hostname,
|
||||
path: `${this.basePath}/${filename}`,
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
await nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(req, this.auth, "DELETE"), this.context.cancellationToken);
|
||||
}
|
||||
toString() {
|
||||
const { owner, slug, channel } = this.info;
|
||||
return `Bitbucket (owner: ${owner}, slug: ${slug}, channel: ${channel})`;
|
||||
}
|
||||
static convertAppPassword(username, token) {
|
||||
const base64encodedData = Buffer.from(`${username}:${token.trim()}`).toString("base64");
|
||||
return `Basic ${base64encodedData}`;
|
||||
}
|
||||
}
|
||||
exports.BitbucketPublisher = BitbucketPublisher;
|
||||
//# sourceMappingURL=BitbucketPublisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/BitbucketPublisher.js.map
generated
vendored
File diff suppressed because one or more lines are too long
102
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.d.ts
generated
vendored
102
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.d.ts
generated
vendored
|
|
@ -1,102 +0,0 @@
|
|||
/// <reference types="node" />
|
||||
import { Arch } from "builder-util";
|
||||
import { ClientRequest } from "http";
|
||||
import { HttpPublisher, PublishContext } from "electron-publish";
|
||||
import { KeygenOptions } from "builder-util-runtime/out/publishOptions";
|
||||
export interface KeygenError {
|
||||
title: string;
|
||||
detail: string;
|
||||
code: string;
|
||||
}
|
||||
export interface KeygenRelease {
|
||||
id: string;
|
||||
type: "releases";
|
||||
attributes: {
|
||||
name: string | null;
|
||||
description: string | null;
|
||||
channel: "stable" | "rc" | "beta" | "alpha" | "dev";
|
||||
status: "DRAFT" | "PUBLISHED" | "YANKED";
|
||||
tag: string;
|
||||
version: string;
|
||||
semver: {
|
||||
major: number;
|
||||
minor: number;
|
||||
patch: number;
|
||||
prerelease: string | null;
|
||||
build: string | null;
|
||||
};
|
||||
metadata: {
|
||||
[s: string]: any;
|
||||
};
|
||||
created: string;
|
||||
updated: string;
|
||||
yanked: string | null;
|
||||
};
|
||||
relationships: {
|
||||
account: {
|
||||
data: {
|
||||
type: "accounts";
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
product: {
|
||||
data: {
|
||||
type: "products";
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
export interface KeygenArtifact {
|
||||
id: string;
|
||||
type: "artifacts";
|
||||
attributes: {
|
||||
filename: string;
|
||||
filetype: string | null;
|
||||
filesize: number | null;
|
||||
platform: string | null;
|
||||
arch: string | null;
|
||||
signature: string | null;
|
||||
checksum: string | null;
|
||||
status: "WAITING" | "UPLOADED" | "FAILED" | "YANKED";
|
||||
metadata: {
|
||||
[s: string]: any;
|
||||
};
|
||||
created: string;
|
||||
updated: string;
|
||||
};
|
||||
relationships: {
|
||||
account: {
|
||||
data: {
|
||||
type: "accounts";
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
release: {
|
||||
data: {
|
||||
type: "releases";
|
||||
id: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
links: {
|
||||
redirect: string;
|
||||
};
|
||||
}
|
||||
export declare class KeygenPublisher extends HttpPublisher {
|
||||
readonly providerName = "keygen";
|
||||
readonly hostname = "api.keygen.sh";
|
||||
private readonly info;
|
||||
private readonly auth;
|
||||
private readonly version;
|
||||
private readonly basePath;
|
||||
constructor(context: PublishContext, info: KeygenOptions, version: string);
|
||||
protected doUpload(fileName: string, _arch: Arch, dataLength: number, requestProcessor: (request: ClientRequest, reject: (error: Error) => void) => void, _file: string): Promise<string>;
|
||||
private uploadArtifact;
|
||||
private createArtifact;
|
||||
private getOrCreateRelease;
|
||||
private getRelease;
|
||||
private createRelease;
|
||||
deleteRelease(releaseId: string): Promise<void>;
|
||||
toString(): string;
|
||||
}
|
||||
167
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.js
generated
vendored
167
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.js
generated
vendored
|
|
@ -1,167 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.KeygenPublisher = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const nodeHttpExecutor_1 = require("builder-util/out/nodeHttpExecutor");
|
||||
const electron_publish_1 = require("electron-publish");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const filename_1 = require("../util/filename");
|
||||
class KeygenPublisher extends electron_publish_1.HttpPublisher {
|
||||
constructor(context, info, version) {
|
||||
super(context);
|
||||
this.providerName = "keygen";
|
||||
this.hostname = "api.keygen.sh";
|
||||
const token = process.env.KEYGEN_TOKEN;
|
||||
if (builder_util_1.isEmptyOrSpaces(token)) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Keygen token is not set using env "KEYGEN_TOKEN" (see https://www.electron.build/configuration/publish#KeygenOptions)`);
|
||||
}
|
||||
this.info = info;
|
||||
this.auth = `Bearer ${token.trim()}`;
|
||||
this.version = version;
|
||||
this.basePath = `/v1/accounts/${this.info.account}`;
|
||||
}
|
||||
doUpload(fileName, _arch, dataLength, requestProcessor,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
_file) {
|
||||
return builder_util_runtime_1.HttpExecutor.retryOnServerError(async () => {
|
||||
const { data, errors } = await this.getOrCreateRelease();
|
||||
if (errors) {
|
||||
throw new Error(`Keygen - Creating release returned errors: ${JSON.stringify(errors)}`);
|
||||
}
|
||||
await this.uploadArtifact(data.id, fileName, dataLength, requestProcessor);
|
||||
return data.id;
|
||||
});
|
||||
}
|
||||
async uploadArtifact(releaseId, fileName, dataLength, requestProcessor) {
|
||||
const { data, errors } = await this.createArtifact(releaseId, fileName, dataLength);
|
||||
if (errors) {
|
||||
throw new Error(`Keygen - Creating artifact returned errors: ${JSON.stringify(errors)}`);
|
||||
}
|
||||
// Follow the redirect and upload directly to S3-equivalent storage provider
|
||||
const url = new URL(data.links.redirect);
|
||||
const upload = {
|
||||
hostname: url.hostname,
|
||||
path: url.pathname + url.search,
|
||||
headers: {
|
||||
"Content-Length": dataLength,
|
||||
},
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
await nodeHttpExecutor_1.httpExecutor.doApiRequest(builder_util_runtime_1.configureRequestOptions(upload, null, "PUT"), this.context.cancellationToken, requestProcessor);
|
||||
}
|
||||
async createArtifact(releaseId, fileName, dataLength) {
|
||||
const upload = {
|
||||
hostname: this.hostname,
|
||||
path: `${this.basePath}/artifacts`,
|
||||
headers: {
|
||||
"Content-Type": "application/vnd.api+json",
|
||||
Accept: "application/vnd.api+json",
|
||||
"Keygen-Version": "1.1",
|
||||
Prefer: "no-redirect",
|
||||
},
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
const data = {
|
||||
type: "artifacts",
|
||||
attributes: {
|
||||
filename: fileName,
|
||||
filetype: filename_1.getCompleteExtname(fileName),
|
||||
filesize: dataLength,
|
||||
platform: this.info.platform,
|
||||
},
|
||||
relationships: {
|
||||
release: {
|
||||
data: {
|
||||
type: "releases",
|
||||
id: releaseId,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
builder_util_1.log.debug({ data: JSON.stringify(data) }, "Keygen create artifact");
|
||||
return builder_util_runtime_1.parseJson(nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(upload, this.auth, "POST"), this.context.cancellationToken, { data }));
|
||||
}
|
||||
async getOrCreateRelease() {
|
||||
try {
|
||||
// First, we'll attempt to fetch the release.
|
||||
return await this.getRelease();
|
||||
}
|
||||
catch (e) {
|
||||
if (e.statusCode !== 404) {
|
||||
throw e;
|
||||
}
|
||||
try {
|
||||
// Next, if the release doesn't exist, we'll attempt to create it.
|
||||
return await this.createRelease();
|
||||
}
|
||||
catch (e) {
|
||||
if (e.statusCode !== 409 && e.statusCode !== 422) {
|
||||
throw e;
|
||||
}
|
||||
// Lastly, when a conflict occurs (in the case of parallel uploads),
|
||||
// we'll try to fetch it one last time.
|
||||
return this.getRelease();
|
||||
}
|
||||
}
|
||||
}
|
||||
async getRelease() {
|
||||
const req = {
|
||||
hostname: this.hostname,
|
||||
path: `${this.basePath}/releases/${this.version}?product=${this.info.product}`,
|
||||
headers: {
|
||||
Accept: "application/vnd.api+json",
|
||||
"Keygen-Version": "1.1",
|
||||
},
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
return builder_util_runtime_1.parseJson(nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(req, this.auth, "GET"), this.context.cancellationToken, null));
|
||||
}
|
||||
async createRelease() {
|
||||
const req = {
|
||||
hostname: this.hostname,
|
||||
path: `${this.basePath}/releases`,
|
||||
headers: {
|
||||
"Content-Type": "application/vnd.api+json",
|
||||
Accept: "application/vnd.api+json",
|
||||
"Keygen-Version": "1.1",
|
||||
},
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
const data = {
|
||||
type: "releases",
|
||||
attributes: {
|
||||
version: this.version,
|
||||
channel: this.info.channel || "stable",
|
||||
status: "PUBLISHED",
|
||||
},
|
||||
relationships: {
|
||||
product: {
|
||||
data: {
|
||||
type: "products",
|
||||
id: this.info.product,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
builder_util_1.log.debug({ data: JSON.stringify(data) }, "Keygen create release");
|
||||
return builder_util_runtime_1.parseJson(nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(req, this.auth, "POST"), this.context.cancellationToken, { data }));
|
||||
}
|
||||
async deleteRelease(releaseId) {
|
||||
const req = {
|
||||
hostname: this.hostname,
|
||||
path: `${this.basePath}/releases/${releaseId}`,
|
||||
headers: {
|
||||
Accept: "application/vnd.api+json",
|
||||
"Keygen-Version": "1.1",
|
||||
},
|
||||
timeout: this.info.timeout || undefined,
|
||||
};
|
||||
await nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(req, this.auth, "DELETE"), this.context.cancellationToken);
|
||||
}
|
||||
toString() {
|
||||
const { account, product, platform } = this.info;
|
||||
return `Keygen (account: ${account}, product: ${product}, platform: ${platform}, version: ${this.version})`;
|
||||
}
|
||||
}
|
||||
exports.KeygenPublisher = KeygenPublisher;
|
||||
//# sourceMappingURL=KeygenPublisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/KeygenPublisher.js.map
generated
vendored
File diff suppressed because one or more lines are too long
21
electron/node_modules/app-builder-lib/out/publish/PublishManager.d.ts
generated
vendored
21
electron/node_modules/app-builder-lib/out/publish/PublishManager.d.ts
generated
vendored
|
|
@ -1,9 +1,8 @@
|
|||
/// <reference types="node" />
|
||||
import { Arch } from "builder-util";
|
||||
import { CancellationToken, PublishConfiguration, PublishProvider } from "builder-util-runtime";
|
||||
import { PublishContext, Publisher, PublishOptions } from "electron-publish";
|
||||
import { CancellationToken, Nullish, PublishConfiguration } from "builder-util-runtime";
|
||||
import { PublishContext, Publisher, PublishOptions, UploadTask } from "electron-publish";
|
||||
import { MultiProgress } from "electron-publish/out/multiProgress";
|
||||
import { PlatformSpecificBuildOptions } from "../index";
|
||||
import { AppInfo, PlatformSpecificBuildOptions, TargetSpecificOptions } from "../index";
|
||||
import { Packager } from "../packager";
|
||||
import { PlatformPackager } from "../platformPackager";
|
||||
export declare class PublishManager implements PublishContext {
|
||||
|
|
@ -18,20 +17,14 @@ export declare class PublishManager implements PublishContext {
|
|||
constructor(packager: Packager, publishOptions: PublishOptions, cancellationToken?: CancellationToken);
|
||||
private getAppInfo;
|
||||
getGlobalPublishConfigurations(): Promise<Array<PublishConfiguration> | null>;
|
||||
scheduleUpload(publishConfig: PublishConfiguration, event: UploadTask, appInfo: AppInfo): Promise<void>;
|
||||
private artifactCreatedWithoutExplicitPublishConfig;
|
||||
private getOrCreatePublisher;
|
||||
cancelTasks(): void;
|
||||
awaitTasks(): Promise<void>;
|
||||
}
|
||||
export declare function getAppUpdatePublishConfiguration(packager: PlatformPackager<any>, arch: Arch, errorIfCannot: boolean): Promise<{
|
||||
updaterCacheDirName: string;
|
||||
provider: PublishProvider;
|
||||
publisherName?: string[] | null | undefined;
|
||||
publishAutoUpdate?: boolean | undefined;
|
||||
requestHeaders?: import("http").OutgoingHttpHeaders | undefined;
|
||||
timeout?: number | null | undefined;
|
||||
} | null>;
|
||||
export declare function getAppUpdatePublishConfiguration(packager: PlatformPackager<any>, targetSpecificOptions: TargetSpecificOptions | Nullish, arch: Arch, errorIfCannot: boolean): Promise<PublishConfiguration | null>;
|
||||
export declare function getPublishConfigsForUpdateInfo(packager: PlatformPackager<any>, publishConfigs: Array<PublishConfiguration> | null, arch: Arch | null): Promise<Array<PublishConfiguration> | null>;
|
||||
export declare function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Publisher | null;
|
||||
export declare function createPublisher(context: PublishContext, version: string, publishConfig: PublishConfiguration, options: PublishOptions, packager: Packager): Promise<Publisher | null>;
|
||||
export declare function computeDownloadUrl(publishConfiguration: PublishConfiguration, fileName: string | null, packager: PlatformPackager<any>): string;
|
||||
export declare function getPublishConfigs(platformPackager: PlatformPackager<any>, targetSpecificOptions: PlatformSpecificBuildOptions | null | undefined, arch: Arch | null, errorIfCannot: boolean): Promise<Array<PublishConfiguration> | null>;
|
||||
export declare function getPublishConfigs(platformPackager: PlatformPackager<any>, targetSpecificOptions: PlatformSpecificBuildOptions | Nullish, arch: Arch | null, errorIfCannot: boolean): Promise<Array<PublishConfiguration> | null>;
|
||||
|
|
|
|||
200
electron/node_modules/app-builder-lib/out/publish/PublishManager.js
generated
vendored
200
electron/node_modules/app-builder-lib/out/publish/PublishManager.js
generated
vendored
|
|
@ -1,28 +1,28 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getPublishConfigs = exports.computeDownloadUrl = exports.createPublisher = exports.getPublishConfigsForUpdateInfo = exports.getAppUpdatePublishConfiguration = exports.PublishManager = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
exports.PublishManager = void 0;
|
||||
exports.getAppUpdatePublishConfiguration = getAppUpdatePublishConfiguration;
|
||||
exports.getPublishConfigsForUpdateInfo = getPublishConfigsForUpdateInfo;
|
||||
exports.createPublisher = createPublisher;
|
||||
exports.computeDownloadUrl = computeDownloadUrl;
|
||||
exports.getPublishConfigs = getPublishConfigs;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const debug_1 = require("debug");
|
||||
const electron_publish_1 = require("electron-publish");
|
||||
const gitHubPublisher_1 = require("electron-publish/out/gitHubPublisher");
|
||||
const multiProgress_1 = require("electron-publish/out/multiProgress");
|
||||
const s3Publisher_1 = require("./s3/s3Publisher");
|
||||
const spacesPublisher_1 = require("./s3/spacesPublisher");
|
||||
const promises_1 = require("fs/promises");
|
||||
const isCi = require("is-ci");
|
||||
const ci_info_1 = require("ci-info");
|
||||
const path = require("path");
|
||||
const url = require("url");
|
||||
const index_1 = require("../index");
|
||||
const macroExpander_1 = require("../util/macroExpander");
|
||||
const SnapStorePublisher_1 = require("./SnapStorePublisher");
|
||||
const updateInfoBuilder_1 = require("./updateInfoBuilder");
|
||||
const KeygenPublisher_1 = require("./KeygenPublisher");
|
||||
const BitbucketPublisher_1 = require("./BitbucketPublisher");
|
||||
const resolve_1 = require("../util/resolve");
|
||||
const pathManager_1 = require("../util/pathManager");
|
||||
const publishForPrWarning = "There are serious security concerns with PUBLISH_FOR_PULL_REQUEST=true (see the CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)" +
|
||||
"\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you.";
|
||||
const debug = debug_1.default("electron-builder:publish");
|
||||
const debug = (0, debug_1.default)("electron-builder:publish");
|
||||
function checkOptions(publishPolicy) {
|
||||
if (publishPolicy != null && publishPolicy !== "onTag" && publishPolicy !== "onTagOrDraft" && publishPolicy !== "always" && publishPolicy !== "never") {
|
||||
if (typeof publishPolicy === "string") {
|
||||
|
|
@ -42,25 +42,26 @@ class PublishManager {
|
|||
checkOptions(publishOptions.publish);
|
||||
this.taskManager = new builder_util_1.AsyncTaskManager(cancellationToken);
|
||||
const forcePublishForPr = process.env.PUBLISH_FOR_PULL_REQUEST === "true";
|
||||
if (!builder_util_1.isPullRequest() || forcePublishForPr) {
|
||||
if (!(0, builder_util_1.isPullRequest)() || forcePublishForPr) {
|
||||
if (publishOptions.publish === undefined) {
|
||||
if (process.env.npm_lifecycle_event === "release") {
|
||||
builder_util_1.log.warn("Implicit publishing triggered by npm lifecycle event 'release'. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.");
|
||||
publishOptions.publish = "always";
|
||||
}
|
||||
else {
|
||||
const tag = electron_publish_1.getCiTag();
|
||||
const tag = (0, electron_publish_1.getCiTag)();
|
||||
if (tag != null) {
|
||||
builder_util_1.log.info({ reason: "tag is defined", tag }, "artifacts will be published");
|
||||
builder_util_1.log.warn({ tag }, "Implicit publishing triggered by git tag. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.");
|
||||
publishOptions.publish = "onTag";
|
||||
}
|
||||
else if (isCi) {
|
||||
builder_util_1.log.info({ reason: "CI detected" }, "artifacts will be published if draft release exists");
|
||||
else if (ci_info_1.isCI) {
|
||||
builder_util_1.log.warn("Implicit publishing triggered by CI detection. This behavior will be disabled in electron-builder v27. Please use --publish explicitly.");
|
||||
publishOptions.publish = "onTagOrDraft";
|
||||
}
|
||||
}
|
||||
}
|
||||
const publishPolicy = publishOptions.publish;
|
||||
this.isPublish = publishPolicy != null && publishOptions.publish !== "never" && (publishPolicy !== "onTag" || electron_publish_1.getCiTag() != null);
|
||||
this.isPublish = publishPolicy != null && publishOptions.publish !== "never" && (publishPolicy !== "onTag" || (0, electron_publish_1.getCiTag)() != null);
|
||||
if (this.isPublish && forcePublishForPr) {
|
||||
builder_util_1.log.warn(publishForPrWarning);
|
||||
}
|
||||
|
|
@ -71,7 +72,7 @@ class PublishManager {
|
|||
solution: `set env PUBLISH_FOR_PULL_REQUEST to true to force code signing\n${publishForPrWarning}`,
|
||||
}, "publishing will be skipped");
|
||||
}
|
||||
packager.addAfterPackHandler(async (event) => {
|
||||
packager.onAfterPack(async (event) => {
|
||||
const packager = event.packager;
|
||||
if (event.electronPlatformName === "darwin") {
|
||||
if (!event.targets.some(it => it.name === "dmg" || it.name === "zip")) {
|
||||
|
|
@ -83,25 +84,21 @@ class PublishManager {
|
|||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// AppImage writes data to AppImage stage dir, not to linux-unpacked
|
||||
return;
|
||||
}
|
||||
const publishConfig = await getAppUpdatePublishConfiguration(packager, event.arch, this.isPublish);
|
||||
const publishConfig = await getAppUpdatePublishConfiguration(packager, null, event.arch, this.isPublish);
|
||||
if (publishConfig != null) {
|
||||
await promises_1.writeFile(path.join(packager.getResourcesDir(event.appOutDir), "app-update.yml"), builder_util_1.serializeToYaml(publishConfig));
|
||||
await (0, promises_1.writeFile)(path.join(packager.getResourcesDir(event.appOutDir), "app-update.yml"), (0, builder_util_1.serializeToYaml)(publishConfig));
|
||||
}
|
||||
});
|
||||
packager.artifactCreated(event => {
|
||||
packager.onArtifactCreated(async (event) => {
|
||||
const publishConfiguration = event.publishConfig;
|
||||
if (publishConfiguration == null) {
|
||||
this.taskManager.addTask(this.artifactCreatedWithoutExplicitPublishConfig(event));
|
||||
}
|
||||
else if (this.isPublish) {
|
||||
if (debug.enabled) {
|
||||
debug(`artifactCreated (isPublish: ${this.isPublish}): ${builder_util_1.safeStringifyJson(event, new Set(["packager"]))},\n publishConfig: ${builder_util_1.safeStringifyJson(publishConfiguration)}`);
|
||||
debug(`artifactCreated (isPublish: ${this.isPublish}): ${(0, builder_util_1.safeStringifyJson)(event, new Set(["packager"]))},\n publishConfig: ${(0, builder_util_1.safeStringifyJson)(publishConfiguration)}`);
|
||||
}
|
||||
this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager));
|
||||
await this.scheduleUpload(publishConfiguration, event, this.getAppInfo(event.packager));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -112,23 +109,22 @@ class PublishManager {
|
|||
const publishers = this.packager.config.publish;
|
||||
return await resolvePublishConfigurations(publishers, null, this.packager, null, true);
|
||||
}
|
||||
/** @internal */
|
||||
scheduleUpload(publishConfig, event, appInfo) {
|
||||
async scheduleUpload(publishConfig, event, appInfo) {
|
||||
if (publishConfig.provider === "generic") {
|
||||
return;
|
||||
}
|
||||
const publisher = this.getOrCreatePublisher(publishConfig, appInfo);
|
||||
const publisher = await this.getOrCreatePublisher(publishConfig, appInfo);
|
||||
if (publisher == null) {
|
||||
builder_util_1.log.debug({
|
||||
file: event.file,
|
||||
file: builder_util_1.log.filePath(event.file),
|
||||
reason: "publisher is null",
|
||||
publishConfig: builder_util_1.safeStringifyJson(publishConfig),
|
||||
publishConfig: (0, builder_util_1.safeStringifyJson)(publishConfig),
|
||||
}, "not published");
|
||||
return;
|
||||
}
|
||||
const providerName = publisher.providerName;
|
||||
if (this.publishOptions.publish === "onTagOrDraft" && electron_publish_1.getCiTag() == null && providerName !== "bitbucket" && providerName !== "github") {
|
||||
builder_util_1.log.info({ file: event.file, reason: "current build is not for a git tag", publishPolicy: "onTagOrDraft" }, `not published to ${providerName}`);
|
||||
if (this.publishOptions.publish === "onTagOrDraft" && (0, electron_publish_1.getCiTag)() == null && providerName !== "bitbucket" && providerName !== "github") {
|
||||
builder_util_1.log.info({ file: builder_util_1.log.filePath(event.file), reason: "current build is not for a git tag", publishPolicy: "onTagOrDraft" }, `not published to ${providerName}`);
|
||||
return;
|
||||
}
|
||||
if (publishConfig.timeout) {
|
||||
|
|
@ -141,7 +137,7 @@ class PublishManager {
|
|||
const target = event.target;
|
||||
const publishConfigs = await getPublishConfigs(platformPackager, target == null ? null : target.options, event.arch, this.isPublish);
|
||||
if (debug.enabled) {
|
||||
debug(`artifactCreated (isPublish: ${this.isPublish}): ${builder_util_1.safeStringifyJson(event, new Set(["packager"]))},\n publishConfigs: ${builder_util_1.safeStringifyJson(publishConfigs)}`);
|
||||
debug(`artifactCreated (isPublish: ${this.isPublish}): ${(0, builder_util_1.safeStringifyJson)(event, new Set(["packager"]))},\n publishConfigs: ${(0, builder_util_1.safeStringifyJson)(publishConfigs)}`);
|
||||
}
|
||||
const eventFile = event.file;
|
||||
if (publishConfigs == null) {
|
||||
|
|
@ -156,7 +152,7 @@ class PublishManager {
|
|||
builder_util_1.log.debug({ file: event.file, reason: "cancelled" }, "not published");
|
||||
break;
|
||||
}
|
||||
this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager));
|
||||
await this.scheduleUpload(publishConfig, event, this.getAppInfo(platformPackager));
|
||||
}
|
||||
}
|
||||
if (event.isWriteUpdateInfo &&
|
||||
|
|
@ -164,15 +160,15 @@ class PublishManager {
|
|||
eventFile != null &&
|
||||
!this.cancellationToken.cancelled &&
|
||||
(platformPackager.platform !== index_1.Platform.WINDOWS || isSuitableWindowsTarget(target))) {
|
||||
this.taskManager.addTask(updateInfoBuilder_1.createUpdateInfoTasks(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)));
|
||||
this.taskManager.addTask((0, updateInfoBuilder_1.createUpdateInfoTasks)(event, publishConfigs).then(it => this.updateFileWriteTask.push(...it)));
|
||||
}
|
||||
}
|
||||
getOrCreatePublisher(publishConfig, appInfo) {
|
||||
async getOrCreatePublisher(publishConfig, appInfo) {
|
||||
// to not include token into cache key
|
||||
const providerCacheKey = builder_util_1.safeStringifyJson(publishConfig);
|
||||
const providerCacheKey = (0, builder_util_1.safeStringifyJson)(publishConfig);
|
||||
let publisher = this.nameToPublisher.get(providerCacheKey);
|
||||
if (publisher == null) {
|
||||
publisher = createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager);
|
||||
publisher = await createPublisher(this, appInfo.version, publishConfig, this.publishOptions, this.packager);
|
||||
this.nameToPublisher.set(providerCacheKey, publisher);
|
||||
builder_util_1.log.info({ publisher: publisher.toString() }, "publishing");
|
||||
}
|
||||
|
|
@ -189,12 +185,12 @@ class PublishManager {
|
|||
if (this.cancellationToken.cancelled || updateInfoFileTasks.length === 0) {
|
||||
return;
|
||||
}
|
||||
await updateInfoBuilder_1.writeUpdateInfoFiles(updateInfoFileTasks, this.packager);
|
||||
await (0, updateInfoBuilder_1.writeUpdateInfoFiles)(updateInfoFileTasks, this.packager);
|
||||
await this.taskManager.awaitTasks();
|
||||
}
|
||||
}
|
||||
exports.PublishManager = PublishManager;
|
||||
async function getAppUpdatePublishConfiguration(packager, arch, errorIfCannot) {
|
||||
async function getAppUpdatePublishConfiguration(packager, targetSpecificOptions, arch, errorIfCannot) {
|
||||
const publishConfigs = await getPublishConfigsForUpdateInfo(packager, await getPublishConfigs(packager, null, arch, errorIfCannot), arch);
|
||||
if (publishConfigs == null || publishConfigs.length === 0) {
|
||||
return null;
|
||||
|
|
@ -205,14 +201,13 @@ async function getAppUpdatePublishConfiguration(packager, arch, errorIfCannot) {
|
|||
};
|
||||
if (packager.platform === index_1.Platform.WINDOWS && publishConfig.publisherName == null) {
|
||||
const winPackager = packager;
|
||||
const publisherName = winPackager.isForceCodeSigningVerification ? await winPackager.computedPublisherName.value : undefined;
|
||||
const publisherName = winPackager.isForceCodeSigningVerification ? await (await winPackager.signingManager.value).computedPublisherName.value : undefined;
|
||||
if (publisherName != null) {
|
||||
publishConfig.publisherName = publisherName;
|
||||
}
|
||||
}
|
||||
return publishConfig;
|
||||
}
|
||||
exports.getAppUpdatePublishConfiguration = getAppUpdatePublishConfiguration;
|
||||
async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
|
||||
if (publishConfigs === null) {
|
||||
return null;
|
||||
|
|
@ -222,68 +217,98 @@ async function getPublishConfigsForUpdateInfo(packager, publishConfigs, arch) {
|
|||
// https://github.com/electron-userland/electron-builder/issues/925#issuecomment-261732378
|
||||
// default publish config is github, file should be generated regardless of publish state (user can test installer locally or manage the release process manually)
|
||||
const repositoryInfo = await packager.info.repositoryInfo;
|
||||
debug(`getPublishConfigsForUpdateInfo: ${builder_util_1.safeStringifyJson(repositoryInfo)}`);
|
||||
debug(`getPublishConfigsForUpdateInfo: ${(0, builder_util_1.safeStringifyJson)(repositoryInfo)}`);
|
||||
if (repositoryInfo != null && repositoryInfo.type === "github") {
|
||||
const resolvedPublishConfig = await getResolvedPublishConfig(packager, packager.info, { provider: repositoryInfo.type }, arch, false);
|
||||
if (resolvedPublishConfig != null) {
|
||||
debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${builder_util_1.safeStringifyJson(resolvedPublishConfig)}`);
|
||||
debug(`getPublishConfigsForUpdateInfo: resolve to publish config ${(0, builder_util_1.safeStringifyJson)(resolvedPublishConfig)}`);
|
||||
return [resolvedPublishConfig];
|
||||
}
|
||||
}
|
||||
}
|
||||
return publishConfigs;
|
||||
}
|
||||
exports.getPublishConfigsForUpdateInfo = getPublishConfigsForUpdateInfo;
|
||||
function createPublisher(context, version, publishConfig, options, packager) {
|
||||
async function resolveReleaseBody(packager) {
|
||||
const releaseInfo = packager.config.releaseInfo;
|
||||
if (releaseInfo === null || releaseInfo === void 0 ? void 0 : releaseInfo.releaseNotes) {
|
||||
return releaseInfo.releaseNotes;
|
||||
}
|
||||
if (releaseInfo === null || releaseInfo === void 0 ? void 0 : releaseInfo.releaseNotesFile) {
|
||||
try {
|
||||
return await (0, promises_1.readFile)(path.resolve(packager.projectDir, releaseInfo.releaseNotesFile), "utf-8");
|
||||
}
|
||||
catch (e) {
|
||||
builder_util_1.log.warn({ file: releaseInfo.releaseNotesFile, error: e.message }, "cannot read release notes file");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
try {
|
||||
return await (0, promises_1.readFile)(path.resolve(packager.projectDir, "release-notes.md"), "utf-8");
|
||||
}
|
||||
catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async function createPublisher(context, version, publishConfig, options, packager) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
if (debug.enabled) {
|
||||
debug(`Create publisher: ${builder_util_1.safeStringifyJson(publishConfig)}`);
|
||||
debug(`Create publisher: ${(0, builder_util_1.safeStringifyJson)(publishConfig)}`);
|
||||
}
|
||||
const provider = publishConfig.provider;
|
||||
switch (provider) {
|
||||
case "github":
|
||||
return new gitHubPublisher_1.GitHubPublisher(context, publishConfig, version, options);
|
||||
case "github": {
|
||||
const releaseBody = await resolveReleaseBody(packager);
|
||||
const releaseName = (_b = (_a = packager.config.releaseInfo) === null || _a === void 0 ? void 0 : _a.releaseName) !== null && _b !== void 0 ? _b : null;
|
||||
return new electron_publish_1.GitHubPublisher(context, publishConfig, version, options, releaseBody, releaseName);
|
||||
}
|
||||
case "gitlab": {
|
||||
const releaseBody = await resolveReleaseBody(packager);
|
||||
const releaseName = (_d = (_c = packager.config.releaseInfo) === null || _c === void 0 ? void 0 : _c.releaseName) !== null && _d !== void 0 ? _d : null;
|
||||
return new electron_publish_1.GitlabPublisher(context, publishConfig, version, releaseBody, releaseName);
|
||||
}
|
||||
case "keygen":
|
||||
return new KeygenPublisher_1.KeygenPublisher(context, publishConfig, version);
|
||||
return new electron_publish_1.KeygenPublisher(context, publishConfig, version);
|
||||
case "snapStore":
|
||||
return new SnapStorePublisher_1.SnapStorePublisher(context, publishConfig);
|
||||
return new electron_publish_1.SnapStorePublisher(context, publishConfig, { cscLink: (_e = packager.config.snapcraft) === null || _e === void 0 ? void 0 : _e.cscLink, resourcesDir: packager.buildResourcesDir });
|
||||
case "generic":
|
||||
return null;
|
||||
default: {
|
||||
const clazz = requireProviderClass(provider, packager);
|
||||
const clazz = await requireProviderClass(provider, packager);
|
||||
return clazz == null ? null : new clazz(context, publishConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.createPublisher = createPublisher;
|
||||
function requireProviderClass(provider, packager) {
|
||||
async function requireProviderClass(provider, packager) {
|
||||
switch (provider) {
|
||||
case "github":
|
||||
return gitHubPublisher_1.GitHubPublisher;
|
||||
return electron_publish_1.GitHubPublisher;
|
||||
case "gitlab":
|
||||
return electron_publish_1.GitlabPublisher;
|
||||
case "generic":
|
||||
return null;
|
||||
case "keygen":
|
||||
return KeygenPublisher_1.KeygenPublisher;
|
||||
return electron_publish_1.KeygenPublisher;
|
||||
case "s3":
|
||||
return s3Publisher_1.default;
|
||||
return electron_publish_1.S3Publisher;
|
||||
case "snapStore":
|
||||
return SnapStorePublisher_1.SnapStorePublisher;
|
||||
return electron_publish_1.SnapStorePublisher;
|
||||
case "spaces":
|
||||
return spacesPublisher_1.default;
|
||||
return electron_publish_1.SpacesPublisher;
|
||||
case "bitbucket":
|
||||
return BitbucketPublisher_1.BitbucketPublisher;
|
||||
return electron_publish_1.BitbucketPublisher;
|
||||
default: {
|
||||
const name = `electron-publisher-${provider}`;
|
||||
let module = null;
|
||||
try {
|
||||
module = require(path.join(packager.buildResourcesDir, name + ".js"));
|
||||
const extensions = ["mjs", "js", "cjs"];
|
||||
const template = `electron-publisher-${provider}`;
|
||||
const name = (ext) => `${template}.${ext}`;
|
||||
const validPublisherFiles = extensions.map(ext => path.join(packager.buildResourcesDir, name(ext)));
|
||||
for (const potentialFile of validPublisherFiles) {
|
||||
if (await (0, builder_util_1.exists)(potentialFile)) {
|
||||
const module = await (0, resolve_1.resolveModule)(packager.appInfo.type, potentialFile);
|
||||
return module.default || module;
|
||||
}
|
||||
}
|
||||
catch (ignored) {
|
||||
console.log(ignored);
|
||||
}
|
||||
if (module == null) {
|
||||
module = require(name);
|
||||
}
|
||||
return module.default || module;
|
||||
builder_util_1.log.error({ path: builder_util_1.log.filePath(packager.buildResourcesDir), template, extensionsChecked: extensions }, "unable to find publish provider in build resources");
|
||||
throw new builder_util_1.InvalidConfigurationError(`Cannot find module for publisher "${provider}" with any extension: ${extensions.join(", ")}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -293,23 +318,22 @@ function computeDownloadUrl(publishConfiguration, fileName, packager) {
|
|||
if (fileName == null) {
|
||||
return baseUrlString;
|
||||
}
|
||||
const baseUrl = url.parse(baseUrlString);
|
||||
return url.format({ ...baseUrl, pathname: path.posix.resolve(baseUrl.pathname || "/", encodeURI(fileName)) });
|
||||
const baseUrl = (0, pathManager_1.parseUrl)(baseUrlString);
|
||||
return url.format({ ...baseUrl, pathname: path.posix.resolve((baseUrl === null || baseUrl === void 0 ? void 0 : baseUrl.pathname) || "/", encodeURI(fileName)) });
|
||||
}
|
||||
let baseUrl;
|
||||
if (publishConfiguration.provider === "github") {
|
||||
const gh = publishConfiguration;
|
||||
baseUrl = `${builder_util_runtime_1.githubUrl(gh)}/${gh.owner}/${gh.repo}/releases/download/${gh.vPrefixedTagName === false ? "" : "v"}${packager.appInfo.version}`;
|
||||
baseUrl = `${(0, builder_util_runtime_1.githubUrl)(gh)}/${gh.owner}/${gh.repo}/releases/download/${(0, builder_util_runtime_1.githubTagPrefix)(gh)}${packager.appInfo.version}`;
|
||||
}
|
||||
else {
|
||||
baseUrl = builder_util_runtime_1.getS3LikeProviderBaseUrl(publishConfiguration);
|
||||
baseUrl = (0, builder_util_runtime_1.getS3LikeProviderBaseUrl)(publishConfiguration);
|
||||
}
|
||||
if (fileName == null) {
|
||||
return baseUrl;
|
||||
}
|
||||
return `${baseUrl}/${encodeURI(fileName)}`;
|
||||
}
|
||||
exports.computeDownloadUrl = computeDownloadUrl;
|
||||
async function getPublishConfigs(platformPackager, targetSpecificOptions, arch, errorIfCannot) {
|
||||
let publishers;
|
||||
// check build.nsis (target)
|
||||
|
|
@ -335,20 +359,22 @@ async function getPublishConfigs(platformPackager, targetSpecificOptions, arch,
|
|||
}
|
||||
return await resolvePublishConfigurations(publishers, platformPackager, platformPackager.info, arch, errorIfCannot);
|
||||
}
|
||||
exports.getPublishConfigs = getPublishConfigs;
|
||||
async function resolvePublishConfigurations(publishers, platformPackager, packager, arch, errorIfCannot) {
|
||||
if (publishers == null) {
|
||||
let serviceName = null;
|
||||
if (!builder_util_1.isEmptyOrSpaces(process.env.GH_TOKEN) || !builder_util_1.isEmptyOrSpaces(process.env.GITHUB_TOKEN)) {
|
||||
if (!(0, builder_util_1.isEmptyOrSpaces)(process.env.GH_TOKEN) || !(0, builder_util_1.isEmptyOrSpaces)(process.env.GITHUB_TOKEN)) {
|
||||
serviceName = "github";
|
||||
}
|
||||
else if (!builder_util_1.isEmptyOrSpaces(process.env.KEYGEN_TOKEN)) {
|
||||
else if (!(0, builder_util_1.isEmptyOrSpaces)(process.env.GITLAB_TOKEN)) {
|
||||
serviceName = "gitlab";
|
||||
}
|
||||
else if (!(0, builder_util_1.isEmptyOrSpaces)(process.env.KEYGEN_TOKEN)) {
|
||||
serviceName = "keygen";
|
||||
}
|
||||
else if (!builder_util_1.isEmptyOrSpaces(process.env.BITBUCKET_TOKEN)) {
|
||||
else if (!(0, builder_util_1.isEmptyOrSpaces)(process.env.BITBUCKET_TOKEN)) {
|
||||
serviceName = "bitbucket";
|
||||
}
|
||||
else if (!builder_util_1.isEmptyOrSpaces(process.env.BT_TOKEN)) {
|
||||
else if (!(0, builder_util_1.isEmptyOrSpaces)(process.env.BT_TOKEN)) {
|
||||
throw new Error("Bintray has been sunset and is no longer supported by electron-builder. Ref: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/");
|
||||
}
|
||||
if (serviceName != null) {
|
||||
|
|
@ -359,8 +385,8 @@ async function resolvePublishConfigurations(publishers, platformPackager, packag
|
|||
if (publishers == null) {
|
||||
return [];
|
||||
}
|
||||
debug(`Explicit publish provider: ${builder_util_1.safeStringifyJson(publishers)}`);
|
||||
return await bluebird_lst_1.default.map(builder_util_1.asArray(publishers), it => getResolvedPublishConfig(platformPackager, packager, typeof it === "string" ? { provider: it } : it, arch, errorIfCannot));
|
||||
debug(`Explicit publish provider: ${(0, builder_util_1.safeStringifyJson)(publishers)}`);
|
||||
return (await Promise.all((0, builder_util_1.asArray)(publishers).map(it => getResolvedPublishConfig(platformPackager, packager, typeof it === "string" ? { provider: it } : it, arch, errorIfCannot))));
|
||||
}
|
||||
function isSuitableWindowsTarget(target) {
|
||||
if (target.name === "appx" && target.options != null && target.options.electronUpdaterAware) {
|
||||
|
|
@ -373,7 +399,7 @@ function expandPublishConfig(options, platformPackager, packager, arch) {
|
|||
const value = options[name];
|
||||
if (typeof value === "string") {
|
||||
const archValue = arch == null ? null : builder_util_1.Arch[arch];
|
||||
const expanded = platformPackager == null ? macroExpander_1.expandMacro(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue);
|
||||
const expanded = platformPackager == null ? (0, macroExpander_1.expandMacro)(value, archValue, packager.appInfo) : platformPackager.expandMacro(value, archValue);
|
||||
if (expanded !== value) {
|
||||
options[name] = expanded;
|
||||
}
|
||||
|
|
@ -404,7 +430,7 @@ async function getResolvedPublishConfig(platformPackager, packager, options, arc
|
|||
}
|
||||
return options;
|
||||
}
|
||||
const providerClass = requireProviderClass(options.provider, packager);
|
||||
const providerClass = await requireProviderClass(options.provider, packager);
|
||||
if (providerClass != null && providerClass.checkAndResolveOptions != null) {
|
||||
await providerClass.checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot);
|
||||
return options;
|
||||
|
|
@ -434,7 +460,7 @@ async function getResolvedPublishConfig(platformPackager, packager, options, arc
|
|||
if (info != null) {
|
||||
return info;
|
||||
}
|
||||
const message = `Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).\nPlease see https://electron.build/configuration/publish`;
|
||||
const message = `Cannot detect repository by .git/config. Please specify "repository" in the package.json (https://docs.npmjs.com/files/package.json#repository).\nPlease see https://electron.build/publish`;
|
||||
if (errorIfCannot) {
|
||||
throw new Error(message);
|
||||
}
|
||||
|
|
|
|||
2
electron/node_modules/app-builder-lib/out/publish/PublishManager.js.map
generated
vendored
2
electron/node_modules/app-builder-lib/out/publish/PublishManager.js.map
generated
vendored
File diff suppressed because one or more lines are too long
9
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.d.ts
generated
vendored
9
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.d.ts
generated
vendored
|
|
@ -1,9 +0,0 @@
|
|||
import { Publisher, UploadTask, PublishContext } from "electron-publish";
|
||||
import { SnapStoreOptions } from "builder-util-runtime/out/publishOptions";
|
||||
export declare class SnapStorePublisher extends Publisher {
|
||||
private options;
|
||||
readonly providerName = "snapStore";
|
||||
constructor(context: PublishContext, options: SnapStoreOptions);
|
||||
upload(task: UploadTask): Promise<any>;
|
||||
toString(): string;
|
||||
}
|
||||
35
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.js
generated
vendored
35
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.js
generated
vendored
|
|
@ -1,35 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.SnapStorePublisher = void 0;
|
||||
const electron_publish_1 = require("electron-publish");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const path = require("path");
|
||||
class SnapStorePublisher extends electron_publish_1.Publisher {
|
||||
constructor(context, options) {
|
||||
super(context);
|
||||
this.options = options;
|
||||
this.providerName = "snapStore";
|
||||
}
|
||||
upload(task) {
|
||||
this.createProgressBar(path.basename(task.file), -1);
|
||||
const args = ["publish-snap", "-f", task.file];
|
||||
let channels = this.options.channels;
|
||||
if (channels == null) {
|
||||
channels = ["edge"];
|
||||
}
|
||||
else {
|
||||
if (typeof channels === "string") {
|
||||
channels = channels.split(",");
|
||||
}
|
||||
}
|
||||
for (const channel of channels) {
|
||||
args.push("-c", channel);
|
||||
}
|
||||
return builder_util_1.executeAppBuilder(args);
|
||||
}
|
||||
toString() {
|
||||
return "Snap Store";
|
||||
}
|
||||
}
|
||||
exports.SnapStorePublisher = SnapStorePublisher;
|
||||
//# sourceMappingURL=SnapStorePublisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/SnapStorePublisher.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"SnapStorePublisher.js","sourceRoot":"","sources":["../../src/publish/SnapStorePublisher.ts"],"names":[],"mappings":";;;AAAA,uDAAwE;AACxE,+CAAgD;AAChD,6BAA4B;AAG5B,MAAa,kBAAmB,SAAQ,4BAAS;IAG/C,YAAY,OAAuB,EAAU,OAAyB;QACpE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,YAAO,GAAP,OAAO,CAAkB;QAF7D,iBAAY,GAAG,WAAW,CAAA;IAInC,CAAC;IAED,MAAM,CAAC,IAAgB;QACrB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;QAEpD,MAAM,IAAI,GAAG,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QAE9C,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAA;QACpC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,QAAQ,GAAG,CAAC,MAAM,CAAC,CAAA;SACpB;aAAM;YACL,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;gBAChC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;aAC/B;SACF;QAED,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;SACzB;QAED,OAAO,gCAAiB,CAAC,IAAI,CAAC,CAAA;IAChC,CAAC;IAED,QAAQ;QACN,OAAO,YAAY,CAAA;IACrB,CAAC;CACF;AA/BD,gDA+BC","sourcesContent":["import { Publisher, UploadTask, PublishContext } from \"electron-publish\"\nimport { executeAppBuilder } from \"builder-util\"\nimport * as path from \"path\"\nimport { SnapStoreOptions } from \"builder-util-runtime/out/publishOptions\"\n\nexport class SnapStorePublisher extends Publisher {\n readonly providerName = \"snapStore\"\n\n constructor(context: PublishContext, private options: SnapStoreOptions) {\n super(context)\n }\n\n upload(task: UploadTask): Promise<any> {\n this.createProgressBar(path.basename(task.file), -1)\n\n const args = [\"publish-snap\", \"-f\", task.file]\n\n let channels = this.options.channels\n if (channels == null) {\n channels = [\"edge\"]\n } else {\n if (typeof channels === \"string\") {\n channels = channels.split(\",\")\n }\n }\n\n for (const channel of channels) {\n args.push(\"-c\", channel)\n }\n\n return executeAppBuilder(args)\n }\n\n toString(): string {\n return \"Snap Store\"\n }\n}\n"]}
|
||||
10
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.d.ts
generated
vendored
10
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.d.ts
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
import { BaseS3Options } from "builder-util-runtime";
|
||||
import { PublishContext, Publisher, UploadTask } from "electron-publish";
|
||||
export declare abstract class BaseS3Publisher extends Publisher {
|
||||
private options;
|
||||
protected constructor(context: PublishContext, options: BaseS3Options);
|
||||
protected abstract getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
upload(task: UploadTask): Promise<any>;
|
||||
toString(): string;
|
||||
}
|
||||
64
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js
generated
vendored
64
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js
generated
vendored
|
|
@ -1,64 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BaseS3Publisher = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const electron_publish_1 = require("electron-publish");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
class BaseS3Publisher extends electron_publish_1.Publisher {
|
||||
constructor(context, options) {
|
||||
super(context);
|
||||
this.options = options;
|
||||
}
|
||||
configureS3Options(args) {
|
||||
// if explicitly set to null, do not add
|
||||
if (this.options.acl !== null) {
|
||||
args.push("--acl", this.options.acl || "public-read");
|
||||
}
|
||||
}
|
||||
// http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html
|
||||
async upload(task) {
|
||||
const fileName = path.basename(task.file);
|
||||
const cancellationToken = this.context.cancellationToken;
|
||||
const target = (this.options.path == null ? "" : `${this.options.path}/`) + fileName;
|
||||
const args = ["publish-s3", "--bucket", this.getBucketName(), "--key", target, "--file", task.file];
|
||||
this.configureS3Options(args);
|
||||
if (process.env.__TEST_S3_PUBLISHER__ != null) {
|
||||
const testFile = path.join(process.env.__TEST_S3_PUBLISHER__, target);
|
||||
await promises_1.mkdir(path.dirname(testFile), { recursive: true });
|
||||
await promises_1.symlink(task.file, testFile);
|
||||
return;
|
||||
}
|
||||
// https://github.com/aws/aws-sdk-go/issues/279
|
||||
this.createProgressBar(fileName, -1);
|
||||
// if (progressBar != null) {
|
||||
// const callback = new ProgressCallback(progressBar)
|
||||
// uploader.on("progress", () => {
|
||||
// if (!cancellationToken.cancelled) {
|
||||
// callback.update(uploader.loaded, uploader.contentLength)
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
return await cancellationToken.createPromise((resolve, reject, onCancel) => {
|
||||
builder_util_1.executeAppBuilder(args, process => {
|
||||
onCancel(() => {
|
||||
process.kill("SIGINT");
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
try {
|
||||
builder_util_1.log.debug({ provider: this.providerName, file: fileName, bucket: this.getBucketName() }, "uploaded");
|
||||
}
|
||||
finally {
|
||||
resolve(undefined);
|
||||
}
|
||||
})
|
||||
.catch(reject);
|
||||
});
|
||||
}
|
||||
toString() {
|
||||
return `${this.providerName} (bucket: ${this.getBucketName()})`;
|
||||
}
|
||||
}
|
||||
exports.BaseS3Publisher = BaseS3Publisher;
|
||||
//# sourceMappingURL=BaseS3Publisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/s3/BaseS3Publisher.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"BaseS3Publisher.js","sourceRoot":"","sources":["../../../src/publish/s3/BaseS3Publisher.ts"],"names":[],"mappings":";;;AAAA,+CAAqD;AAErD,uDAAwE;AACxE,0CAA4C;AAC5C,6BAA4B;AAE5B,MAAsB,eAAgB,SAAQ,4BAAS;IACrD,YAAsB,OAAuB,EAAU,OAAsB;QAC3E,KAAK,CAAC,OAAO,CAAC,CAAA;QADuC,YAAO,GAAP,OAAO,CAAe;IAE7E,CAAC;IAIS,kBAAkB,CAAC,IAAmB;QAC9C,wCAAwC;QACxC,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,IAAI,EAAE;YAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,aAAa,CAAC,CAAA;SACtD;IACH,CAAC;IAED,oGAAoG;IACpG,KAAK,CAAC,MAAM,CAAC,IAAgB;QAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACzC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAA;QAExD,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAA;QAEpF,MAAM,IAAI,GAAG,CAAC,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QACnG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE7B,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,IAAI,EAAE;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAsB,EAAE,MAAM,CAAC,CAAA;YACtE,MAAM,gBAAK,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YACxD,MAAM,kBAAO,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;YAClC,OAAM;SACP;QAED,+CAA+C;QAC/C,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAA;QACpC,6BAA6B;QAC7B,uDAAuD;QACvD,oCAAoC;QACpC,0CAA0C;QAC1C,iEAAiE;QACjE,QAAQ;QACR,OAAO;QACP,IAAI;QAEJ,OAAO,MAAM,iBAAiB,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;YACzE,gCAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE;gBAChC,QAAQ,CAAC,GAAG,EAAE;oBACZ,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;gBACxB,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC;iBACC,IAAI,CAAC,GAAG,EAAE;gBACT,IAAI;oBACF,kBAAG,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,EAAE,EAAE,UAAU,CAAC,CAAA;iBACrG;wBAAS;oBACR,OAAO,CAAC,SAAS,CAAC,CAAA;iBACnB;YACH,CAAC,CAAC;iBACD,KAAK,CAAC,MAAM,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,QAAQ;QACN,OAAO,GAAG,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,aAAa,EAAE,GAAG,CAAA;IACjE,CAAC;CACF;AA9DD,0CA8DC","sourcesContent":["import { log, executeAppBuilder } from \"builder-util\"\nimport { BaseS3Options } from \"builder-util-runtime\"\nimport { PublishContext, Publisher, UploadTask } from \"electron-publish\"\nimport { mkdir, symlink } from \"fs/promises\"\nimport * as path from \"path\"\n\nexport abstract class BaseS3Publisher extends Publisher {\n protected constructor(context: PublishContext, private options: BaseS3Options) {\n super(context)\n }\n\n protected abstract getBucketName(): string\n\n protected configureS3Options(args: Array<string>) {\n // if explicitly set to null, do not add\n if (this.options.acl !== null) {\n args.push(\"--acl\", this.options.acl || \"public-read\")\n }\n }\n\n // http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/s3-example-creating-buckets.html\n async upload(task: UploadTask): Promise<any> {\n const fileName = path.basename(task.file)\n const cancellationToken = this.context.cancellationToken\n\n const target = (this.options.path == null ? \"\" : `${this.options.path}/`) + fileName\n\n const args = [\"publish-s3\", \"--bucket\", this.getBucketName(), \"--key\", target, \"--file\", task.file]\n this.configureS3Options(args)\n\n if (process.env.__TEST_S3_PUBLISHER__ != null) {\n const testFile = path.join(process.env.__TEST_S3_PUBLISHER__!, target)\n await mkdir(path.dirname(testFile), { recursive: true })\n await symlink(task.file, testFile)\n return\n }\n\n // https://github.com/aws/aws-sdk-go/issues/279\n this.createProgressBar(fileName, -1)\n // if (progressBar != null) {\n // const callback = new ProgressCallback(progressBar)\n // uploader.on(\"progress\", () => {\n // if (!cancellationToken.cancelled) {\n // callback.update(uploader.loaded, uploader.contentLength)\n // }\n // })\n // }\n\n return await cancellationToken.createPromise((resolve, reject, onCancel) => {\n executeAppBuilder(args, process => {\n onCancel(() => {\n process.kill(\"SIGINT\")\n })\n })\n .then(() => {\n try {\n log.debug({ provider: this.providerName, file: fileName, bucket: this.getBucketName() }, \"uploaded\")\n } finally {\n resolve(undefined)\n }\n })\n .catch(reject)\n })\n }\n\n toString() {\n return `${this.providerName} (bucket: ${this.getBucketName()})`\n }\n}\n"]}
|
||||
12
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.d.ts
generated
vendored
12
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.d.ts
generated
vendored
|
|
@ -1,12 +0,0 @@
|
|||
import { S3Options } from "builder-util-runtime";
|
||||
import { PublishContext } from "electron-publish";
|
||||
import { BaseS3Publisher } from "./BaseS3Publisher";
|
||||
export default class S3Publisher extends BaseS3Publisher {
|
||||
private readonly info;
|
||||
readonly providerName = "s3";
|
||||
constructor(context: PublishContext, info: S3Options);
|
||||
static checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise<void>;
|
||||
protected getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
toString(): string;
|
||||
}
|
||||
66
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js
generated
vendored
66
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js
generated
vendored
|
|
@ -1,66 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const builder_util_1 = require("builder-util");
|
||||
const BaseS3Publisher_1 = require("./BaseS3Publisher");
|
||||
class S3Publisher extends BaseS3Publisher_1.BaseS3Publisher {
|
||||
constructor(context, info) {
|
||||
super(context, info);
|
||||
this.info = info;
|
||||
this.providerName = "s3";
|
||||
}
|
||||
static async checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
||||
const bucket = options.bucket;
|
||||
if (bucket == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Please specify "bucket" for "s3" publish provider`);
|
||||
}
|
||||
if (options.endpoint == null && bucket.includes(".") && options.region == null) {
|
||||
// on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.
|
||||
try {
|
||||
options.region = await builder_util_1.executeAppBuilder(["get-bucket-location", "--bucket", bucket]);
|
||||
}
|
||||
catch (e) {
|
||||
if (errorIfCannot) {
|
||||
throw e;
|
||||
}
|
||||
else {
|
||||
builder_util_1.log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (options.channel == null && channelFromAppVersion != null) {
|
||||
options.channel = channelFromAppVersion;
|
||||
}
|
||||
if (options.endpoint != null && options.endpoint.endsWith("/")) {
|
||||
;
|
||||
options.endpoint = options.endpoint.slice(0, -1);
|
||||
}
|
||||
}
|
||||
getBucketName() {
|
||||
return this.info.bucket;
|
||||
}
|
||||
configureS3Options(args) {
|
||||
super.configureS3Options(args);
|
||||
if (this.info.endpoint != null) {
|
||||
args.push("--endpoint", this.info.endpoint);
|
||||
}
|
||||
if (this.info.region != null) {
|
||||
args.push("--region", this.info.region);
|
||||
}
|
||||
if (this.info.storageClass != null) {
|
||||
args.push("--storageClass", this.info.storageClass);
|
||||
}
|
||||
if (this.info.encryption != null) {
|
||||
args.push("--encryption", this.info.encryption);
|
||||
}
|
||||
}
|
||||
toString() {
|
||||
const result = super.toString();
|
||||
const endpoint = this.info.endpoint;
|
||||
if (endpoint != null) {
|
||||
return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
exports.default = S3Publisher;
|
||||
//# sourceMappingURL=s3Publisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/s3/s3Publisher.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"s3Publisher.js","sourceRoot":"","sources":["../../../src/publish/s3/s3Publisher.ts"],"names":[],"mappings":";;AAAA,+CAAgF;AAGhF,uDAAmD;AAEnD,MAAqB,WAAY,SAAQ,iCAAe;IAGtD,YAAY,OAAuB,EAAmB,IAAe;QACnE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QADgC,SAAI,GAAJ,IAAI,CAAW;QAF5D,iBAAY,GAAG,IAAI,CAAA;IAI5B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,OAAkB,EAAE,qBAAoC,EAAE,aAAsB;QAClH,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;QAC7B,IAAI,MAAM,IAAI,IAAI,EAAE;YAClB,MAAM,IAAI,wCAAyB,CAAC,mDAAmD,CAAC,CAAA;SACzF;QAED,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE;YAC9E,yHAAyH;YACzH,IAAI;gBACF,OAAO,CAAC,MAAM,GAAG,MAAM,gCAAiB,CAAC,CAAC,qBAAqB,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;aACtF;YAAC,OAAO,CAAC,EAAE;gBACV,IAAI,aAAa,EAAE;oBACjB,MAAM,CAAC,CAAA;iBACR;qBAAM;oBACL,kBAAG,CAAC,IAAI,CAAC,yHAAyH,CAAC,EAAE,CAAC,CAAA;iBACvI;aACF;SACF;QAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,qBAAqB,IAAI,IAAI,EAAE;YAC5D,OAAO,CAAC,OAAO,GAAG,qBAAqB,CAAA;SACxC;QAED,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC9D,CAAC;YAAC,OAAe,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;SAC3D;IACH,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAA;IACzB,CAAC;IAES,kBAAkB,CAAC,IAAmB;QAC9C,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE9B,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,EAAE;YAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SAC5C;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE;YAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;SACxC;QAED,IAAI,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,EAAE;YAClC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;SACpD;QACD,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,IAAI,EAAE;YAChC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;SAChD;IACH,CAAC;IAED,QAAQ;QACN,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAA;QACnC,IAAI,QAAQ,IAAI,IAAI,EAAE;YACpB,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,eAAe,QAAQ,GAAG,CAAA;SAC3E;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAjED,8BAiEC","sourcesContent":["import { executeAppBuilder, InvalidConfigurationError, log } from \"builder-util\"\nimport { S3Options } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class S3Publisher extends BaseS3Publisher {\n readonly providerName = \"s3\"\n\n constructor(context: PublishContext, private readonly info: S3Options) {\n super(context, info)\n }\n\n static async checkAndResolveOptions(options: S3Options, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n const bucket = options.bucket\n if (bucket == null) {\n throw new InvalidConfigurationError(`Please specify \"bucket\" for \"s3\" publish provider`)\n }\n\n if (options.endpoint == null && bucket.includes(\".\") && options.region == null) {\n // on dotted bucket names, we need to use a path-based endpoint URL. Path-based endpoint URLs need to include the region.\n try {\n options.region = await executeAppBuilder([\"get-bucket-location\", \"--bucket\", bucket])\n } catch (e) {\n if (errorIfCannot) {\n throw e\n } else {\n log.warn(`cannot compute region for bucket (required because on dotted bucket names, we need to use a path-based endpoint URL): ${e}`)\n }\n }\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n\n if (options.endpoint != null && options.endpoint.endsWith(\"/\")) {\n ;(options as any).endpoint = options.endpoint.slice(0, -1)\n }\n }\n\n protected getBucketName(): string {\n return this.info.bucket\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n if (this.info.endpoint != null) {\n args.push(\"--endpoint\", this.info.endpoint)\n }\n if (this.info.region != null) {\n args.push(\"--region\", this.info.region)\n }\n\n if (this.info.storageClass != null) {\n args.push(\"--storageClass\", this.info.storageClass)\n }\n if (this.info.encryption != null) {\n args.push(\"--encryption\", this.info.encryption)\n }\n }\n\n toString() {\n const result = super.toString()\n const endpoint = this.info.endpoint\n if (endpoint != null) {\n return result.substring(0, result.length - 1) + `, endpoint: ${endpoint})`\n }\n return result\n }\n}\n"]}
|
||||
11
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.d.ts
generated
vendored
11
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.d.ts
generated
vendored
|
|
@ -1,11 +0,0 @@
|
|||
import { SpacesOptions } from "builder-util-runtime";
|
||||
import { PublishContext } from "electron-publish";
|
||||
import { BaseS3Publisher } from "./BaseS3Publisher";
|
||||
export default class SpacesPublisher extends BaseS3Publisher {
|
||||
private readonly info;
|
||||
readonly providerName = "spaces";
|
||||
constructor(context: PublishContext, info: SpacesOptions);
|
||||
static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean): Promise<void>;
|
||||
protected getBucketName(): string;
|
||||
protected configureS3Options(args: Array<string>): void;
|
||||
}
|
||||
44
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js
generated
vendored
44
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js
generated
vendored
|
|
@ -1,44 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const builder_util_1 = require("builder-util");
|
||||
const BaseS3Publisher_1 = require("./BaseS3Publisher");
|
||||
class SpacesPublisher extends BaseS3Publisher_1.BaseS3Publisher {
|
||||
constructor(context, info) {
|
||||
super(context, info);
|
||||
this.info = info;
|
||||
this.providerName = "spaces";
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
static checkAndResolveOptions(options, channelFromAppVersion, errorIfCannot) {
|
||||
if (options.name == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Please specify "name" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`);
|
||||
}
|
||||
if (options.region == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Please specify "region" for "spaces" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`);
|
||||
}
|
||||
if (options.channel == null && channelFromAppVersion != null) {
|
||||
options.channel = channelFromAppVersion;
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
getBucketName() {
|
||||
return this.info.name;
|
||||
}
|
||||
configureS3Options(args) {
|
||||
super.configureS3Options(args);
|
||||
args.push("--endpoint", `${this.info.region}.digitaloceanspaces.com`);
|
||||
args.push("--region", this.info.region);
|
||||
const accessKey = process.env.DO_KEY_ID;
|
||||
const secretKey = process.env.DO_SECRET_KEY;
|
||||
if (builder_util_1.isEmptyOrSpaces(accessKey)) {
|
||||
throw new builder_util_1.InvalidConfigurationError("Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)");
|
||||
}
|
||||
if (builder_util_1.isEmptyOrSpaces(secretKey)) {
|
||||
throw new builder_util_1.InvalidConfigurationError("Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)");
|
||||
}
|
||||
args.push("--accessKey", accessKey);
|
||||
args.push("--secretKey", secretKey);
|
||||
}
|
||||
}
|
||||
exports.default = SpacesPublisher;
|
||||
//# sourceMappingURL=spacesPublisher.js.map
|
||||
1
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js.map
generated
vendored
1
electron/node_modules/app-builder-lib/out/publish/s3/spacesPublisher.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"spacesPublisher.js","sourceRoot":"","sources":["../../../src/publish/s3/spacesPublisher.ts"],"names":[],"mappings":";;AAAA,+CAAyE;AAGzE,uDAAmD;AAEnD,MAAqB,eAAgB,SAAQ,iCAAe;IAG1D,YAAY,OAAuB,EAAmB,IAAmB;QACvE,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QADgC,SAAI,GAAJ,IAAI,CAAe;QAFhE,iBAAY,GAAG,QAAQ,CAAA;IAIhC,CAAC;IAED,6DAA6D;IAC7D,MAAM,CAAC,sBAAsB,CAAC,OAAsB,EAAE,qBAAoC,EAAE,aAAsB;QAChH,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,EAAE;YACxB,MAAM,IAAI,wCAAyB,CAAC,0HAA0H,CAAC,CAAA;SAChK;QACD,IAAI,OAAO,CAAC,MAAM,IAAI,IAAI,EAAE;YAC1B,MAAM,IAAI,wCAAyB,CAAC,4HAA4H,CAAC,CAAA;SAClK;QAED,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,IAAI,qBAAqB,IAAI,IAAI,EAAE;YAC5D,OAAO,CAAC,OAAO,GAAG,qBAAqB,CAAA;SACxC;QACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAES,aAAa;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAA;IACvB,CAAC;IAES,kBAAkB,CAAC,IAAmB;QAC9C,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAA;QAE9B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,yBAAyB,CAAC,CAAA;QACrE,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAEvC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAA;QACvC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;QAC3C,IAAI,8BAAe,CAAC,SAAS,CAAC,EAAE;YAC9B,MAAM,IAAI,wCAAyB,CAAC,+FAA+F,CAAC,CAAA;SACrI;QACD,IAAI,8BAAe,CAAC,SAAS,CAAC,EAAE;YAC9B,MAAM,IAAI,wCAAyB,CAAC,mGAAmG,CAAC,CAAA;SACzI;QACD,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;QACnC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAA;IACrC,CAAC;CACF;AA3CD,kCA2CC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport { SpacesOptions } from \"builder-util-runtime\"\nimport { PublishContext } from \"electron-publish\"\nimport { BaseS3Publisher } from \"./BaseS3Publisher\"\n\nexport default class SpacesPublisher extends BaseS3Publisher {\n readonly providerName = \"spaces\"\n\n constructor(context: PublishContext, private readonly info: SpacesOptions) {\n super(context, info)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n static checkAndResolveOptions(options: SpacesOptions, channelFromAppVersion: string | null, errorIfCannot: boolean) {\n if (options.name == null) {\n throw new InvalidConfigurationError(`Please specify \"name\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n if (options.region == null) {\n throw new InvalidConfigurationError(`Please specify \"region\" for \"spaces\" publish provider (see https://www.electron.build/configuration/publish#spacesoptions)`)\n }\n\n if (options.channel == null && channelFromAppVersion != null) {\n options.channel = channelFromAppVersion\n }\n return Promise.resolve()\n }\n\n protected getBucketName(): string {\n return this.info.name\n }\n\n protected configureS3Options(args: Array<string>): void {\n super.configureS3Options(args)\n\n args.push(\"--endpoint\", `${this.info.region}.digitaloceanspaces.com`)\n args.push(\"--region\", this.info.region)\n\n const accessKey = process.env.DO_KEY_ID\n const secretKey = process.env.DO_SECRET_KEY\n if (isEmptyOrSpaces(accessKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_KEY_ID (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n if (isEmptyOrSpaces(secretKey)) {\n throw new InvalidConfigurationError(\"Please set env DO_SECRET_KEY (see https://www.electron.build/configuration/publish#spacesoptions)\")\n }\n args.push(\"--accessKey\", accessKey)\n args.push(\"--secretKey\", secretKey)\n }\n}\n"]}
|
||||
4
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.d.ts
generated
vendored
4
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.d.ts
generated
vendored
|
|
@ -1,10 +1,14 @@
|
|||
import { Arch } from "builder-util";
|
||||
import { PublishConfiguration, UpdateInfo } from "builder-util-runtime";
|
||||
import { Packager } from "../packager";
|
||||
import { ArtifactCreated } from "../packagerApi";
|
||||
import { PlatformPackager } from "../platformPackager";
|
||||
export interface UpdateInfoFileTask {
|
||||
readonly file: string;
|
||||
readonly info: UpdateInfo;
|
||||
readonly publishConfiguration: PublishConfiguration;
|
||||
readonly packager: PlatformPackager<any>;
|
||||
readonly arch?: Arch | null;
|
||||
}
|
||||
export declare function createUpdateInfoTasks(event: ArtifactCreated, _publishConfigs: Array<PublishConfiguration>): Promise<Array<UpdateInfoFileTask>>;
|
||||
export declare function writeUpdateInfoFiles(updateInfoFileTasks: Array<UpdateInfoFileTask>, packager: Packager): Promise<void>;
|
||||
|
|
|
|||
50
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js
generated
vendored
50
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js
generated
vendored
|
|
@ -1,7 +1,8 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.writeUpdateInfoFiles = exports.createUpdateInfoTasks = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
exports.createUpdateInfoTasks = createUpdateInfoTasks;
|
||||
exports.writeUpdateInfoFiles = writeUpdateInfoFiles;
|
||||
const tiny_async_pool_1 = require("tiny-async-pool");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
|
|
@ -14,7 +15,7 @@ async function getReleaseInfo(packager) {
|
|||
const releaseInfo = { ...(packager.platformSpecificBuildOptions.releaseInfo || packager.config.releaseInfo) };
|
||||
if (releaseInfo.releaseNotes == null) {
|
||||
const releaseNotesFile = await packager.getResource(releaseInfo.releaseNotesFile, `release-notes-${packager.platform.buildConfigurationKey}.md`, `release-notes-${packager.platform.name}.md`, `release-notes-${packager.platform.nodeName}.md`, "release-notes.md");
|
||||
const releaseNotes = releaseNotesFile == null ? null : await fs_extra_1.readFile(releaseNotesFile, "utf-8");
|
||||
const releaseNotes = releaseNotesFile == null ? null : await (0, fs_extra_1.readFile)(releaseNotesFile, "utf-8");
|
||||
// to avoid undefined in the file, check for null
|
||||
if (releaseNotes != null) {
|
||||
releaseInfo.releaseNotes = releaseNotes;
|
||||
|
|
@ -68,16 +69,15 @@ function computeIsisElectronUpdater1xCompatibility(updaterCompatibility, publish
|
|||
const updaterVersion = packager.metadata.dependencies == null ? null : packager.metadata.dependencies["electron-updater"];
|
||||
return updaterVersion == null || semver.lt(updaterVersion, "4.0.0");
|
||||
}
|
||||
/** @internal */
|
||||
async function createUpdateInfoTasks(event, _publishConfigs) {
|
||||
const packager = event.packager;
|
||||
const publishConfigs = await PublishManager_1.getPublishConfigsForUpdateInfo(packager, _publishConfigs, event.arch);
|
||||
const publishConfigs = await (0, PublishManager_1.getPublishConfigsForUpdateInfo)(packager, _publishConfigs, event.arch);
|
||||
if (publishConfigs == null || publishConfigs.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const outDir = event.target.outDir;
|
||||
const version = packager.appInfo.version;
|
||||
const sha2 = new lazy_val_1.Lazy(() => hash_1.hashFile(event.file, "sha256", "hex"));
|
||||
const sha2 = new lazy_val_1.Lazy(() => (0, hash_1.hashFile)(event.file, "sha256", "hex"));
|
||||
const isMac = packager.platform === core_1.Platform.MAC;
|
||||
const createdFiles = new Set();
|
||||
const sharedInfo = await createUpdateInfo(version, event, await getReleaseInfo(packager));
|
||||
|
|
@ -123,16 +123,16 @@ async function createUpdateInfoTasks(event, _publishConfigs) {
|
|||
info,
|
||||
publishConfiguration,
|
||||
packager,
|
||||
arch: event.arch,
|
||||
});
|
||||
}
|
||||
}
|
||||
return tasks;
|
||||
}
|
||||
exports.createUpdateInfoTasks = createUpdateInfoTasks;
|
||||
async function createUpdateInfo(version, event, releaseInfo) {
|
||||
const customUpdateInfo = event.updateInfo;
|
||||
const url = path.basename(event.file);
|
||||
const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || (await hash_1.hashFile(event.file));
|
||||
const sha512 = (customUpdateInfo == null ? null : customUpdateInfo.sha512) || (await (0, hash_1.hashFile)(event.file));
|
||||
const files = [{ url, sha512 }];
|
||||
const result = {
|
||||
// @ts-ignore
|
||||
|
|
@ -153,11 +153,23 @@ async function createUpdateInfo(version, event, releaseInfo) {
|
|||
}
|
||||
async function writeUpdateInfoFiles(updateInfoFileTasks, packager) {
|
||||
// zip must be first and zip info must be used for old path/sha512 properties in the update info
|
||||
updateInfoFileTasks.sort((a, b) => (a.info.files[0].url.endsWith(".zip") ? 0 : 100) - (b.info.files[0].url.endsWith(".zip") ? 0 : 100));
|
||||
// universal installer (arch === null) must precede arch-specific ones so path:/sha512: point to the right artifact
|
||||
updateInfoFileTasks.sort((a, b) => {
|
||||
var _a, _b;
|
||||
const zipDiff = (a.info.files[0].url.endsWith(".zip") ? 0 : 100) - (b.info.files[0].url.endsWith(".zip") ? 0 : 100);
|
||||
if (zipDiff !== 0) {
|
||||
return zipDiff;
|
||||
}
|
||||
// universal (arch === null) before arch-specific; tie-break by Arch enum value for full determinism
|
||||
// undefined arch (external callers predating this field) treated as arch-specific via strict === null check
|
||||
const aArch = a.arch === null ? -1 : ((_a = a.arch) !== null && _a !== void 0 ? _a : Number.MAX_SAFE_INTEGER);
|
||||
const bArch = b.arch === null ? -1 : ((_b = b.arch) !== null && _b !== void 0 ? _b : Number.MAX_SAFE_INTEGER);
|
||||
return aArch - bArch;
|
||||
});
|
||||
const updateChannelFileToInfo = new Map();
|
||||
for (const task of updateInfoFileTasks) {
|
||||
// https://github.com/electron-userland/electron-builder/pull/2994
|
||||
const key = `${task.file}@${builder_util_1.safeStringifyJson(task.publishConfiguration, new Set(["releaseType"]))}`;
|
||||
const key = `${task.file}@${(0, builder_util_1.safeStringifyJson)(task.publishConfiguration, new Set(["releaseType"]))}`;
|
||||
const existingTask = updateChannelFileToInfo.get(key);
|
||||
if (existingTask == null) {
|
||||
updateChannelFileToInfo.set(key, task);
|
||||
|
|
@ -166,7 +178,8 @@ async function writeUpdateInfoFiles(updateInfoFileTasks, packager) {
|
|||
existingTask.info.files.push(...task.info.files);
|
||||
}
|
||||
const releaseDate = new Date().toISOString();
|
||||
await bluebird_lst_1.default.map(updateChannelFileToInfo.values(), async (task) => {
|
||||
const concurrency = 4;
|
||||
await (0, tiny_async_pool_1.default)(concurrency, Array.from(updateChannelFileToInfo.values()), async (task) => {
|
||||
const publishConfig = task.publishConfiguration;
|
||||
if (publishConfig.publishAutoUpdate === false) {
|
||||
builder_util_1.log.debug({
|
||||
|
|
@ -178,9 +191,9 @@ async function writeUpdateInfoFiles(updateInfoFileTasks, packager) {
|
|||
if (task.info.releaseDate == null) {
|
||||
task.info.releaseDate = releaseDate;
|
||||
}
|
||||
const fileContent = Buffer.from(builder_util_1.serializeToYaml(task.info, false, true));
|
||||
await fs_extra_1.outputFile(task.file, fileContent);
|
||||
packager.dispatchArtifactCreated({
|
||||
const fileContent = Buffer.from((0, builder_util_1.serializeToYaml)(task.info, false, true));
|
||||
await (0, fs_extra_1.outputFile)(task.file, fileContent);
|
||||
await packager.emitArtifactCreated({
|
||||
file: task.file,
|
||||
fileContent,
|
||||
arch: null,
|
||||
|
|
@ -188,21 +201,20 @@ async function writeUpdateInfoFiles(updateInfoFileTasks, packager) {
|
|||
target: null,
|
||||
publishConfig,
|
||||
});
|
||||
}, { concurrency: 4 });
|
||||
});
|
||||
}
|
||||
exports.writeUpdateInfoFiles = writeUpdateInfoFiles;
|
||||
// backward compatibility - write json file
|
||||
async function writeOldMacInfo(publishConfig, outDir, dir, channel, createdFiles, version, packager) {
|
||||
const isGitHub = publishConfig.provider === "github";
|
||||
const updateInfoFile = isGitHub && outDir === dir ? path.join(dir, "github", `${channel}-mac.json`) : path.join(dir, `${channel}-mac.json`);
|
||||
if (!createdFiles.has(updateInfoFile)) {
|
||||
createdFiles.add(updateInfoFile);
|
||||
await fs_extra_1.outputJson(updateInfoFile, {
|
||||
await (0, fs_extra_1.outputJson)(updateInfoFile, {
|
||||
version,
|
||||
releaseDate: new Date().toISOString(),
|
||||
url: PublishManager_1.computeDownloadUrl(publishConfig, packager.generateName2("zip", "mac", isGitHub), packager),
|
||||
url: (0, PublishManager_1.computeDownloadUrl)(publishConfig, packager.generateName2("zip", "mac", isGitHub), packager),
|
||||
}, { spaces: 2 });
|
||||
packager.info.dispatchArtifactCreated({
|
||||
await packager.info.emitArtifactCreated({
|
||||
file: updateInfoFile,
|
||||
arch: null,
|
||||
packager,
|
||||
|
|
|
|||
2
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js.map
generated
vendored
2
electron/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js.map
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue