init
This commit is contained in:
36
mc_test/node_modules/app-builder-lib/out/Framework.d.ts
generated
vendored
Executable file
36
mc_test/node_modules/app-builder-lib/out/Framework.d.ts
generated
vendored
Executable file
@ -0,0 +1,36 @@
|
||||
import { FileTransformer } from "builder-util/out/fs";
|
||||
import { AsarIntegrity } from "./asar/integrity";
|
||||
import { Platform, PlatformPackager, ElectronPlatformName, AfterPackContext } from "./index";
|
||||
export interface Framework {
|
||||
readonly name: string;
|
||||
readonly version: string;
|
||||
readonly distMacOsAppName: string;
|
||||
readonly macOsDefaultTargets: Array<string>;
|
||||
readonly defaultAppIdPrefix: string;
|
||||
readonly isNpmRebuildRequired: boolean;
|
||||
readonly isCopyElevateHelper: boolean;
|
||||
getDefaultIcon?(platform: Platform): string | null;
|
||||
getMainFile?(platform: Platform): string | null;
|
||||
getExcludedDependencies?(platform: Platform): Array<string> | null;
|
||||
prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise<any>;
|
||||
beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise<any>;
|
||||
afterPack?(context: AfterPackContext): Promise<any>;
|
||||
createTransformer?(): FileTransformer | null;
|
||||
}
|
||||
export interface BeforeCopyExtraFilesOptions {
|
||||
packager: PlatformPackager<any>;
|
||||
appOutDir: string;
|
||||
asarIntegrity: AsarIntegrity | null;
|
||||
platformName: string;
|
||||
}
|
||||
export interface PrepareApplicationStageDirectoryOptions {
|
||||
readonly packager: PlatformPackager<any>;
|
||||
/**
|
||||
* Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.
|
||||
*/
|
||||
readonly appOutDir: string;
|
||||
readonly platformName: ElectronPlatformName;
|
||||
readonly arch: string;
|
||||
readonly version: string;
|
||||
}
|
||||
export declare function isElectronBased(framework: Framework): boolean;
|
||||
8
mc_test/node_modules/app-builder-lib/out/Framework.js
generated
vendored
Executable file
8
mc_test/node_modules/app-builder-lib/out/Framework.js
generated
vendored
Executable file
@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isElectronBased = void 0;
|
||||
function isElectronBased(framework) {
|
||||
return framework.name === "electron";
|
||||
}
|
||||
exports.isElectronBased = isElectronBased;
|
||||
//# sourceMappingURL=Framework.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/Framework.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/Framework.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../src/Framework.ts"],"names":[],"mappings":";;;AAmDA,SAAgB,eAAe,CAAC,SAAoB;IAClD,OAAO,SAAS,CAAC,IAAI,KAAK,UAAU,CAAA;AACtC,CAAC;AAFD,0CAEC","sourcesContent":["import { FileTransformer } from \"builder-util/out/fs\"\nimport { AsarIntegrity } from \"./asar/integrity\"\nimport { Platform, PlatformPackager, ElectronPlatformName, AfterPackContext } from \"./index\"\n\nexport interface Framework {\n readonly name: string\n readonly version: string\n readonly distMacOsAppName: string\n readonly macOsDefaultTargets: Array<string>\n readonly defaultAppIdPrefix: string\n\n readonly isNpmRebuildRequired: boolean\n\n readonly isCopyElevateHelper: boolean\n\n getDefaultIcon?(platform: Platform): string | null\n\n getMainFile?(platform: Platform): string | null\n\n getExcludedDependencies?(platform: Platform): Array<string> | null\n\n prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise<any>\n\n beforeCopyExtraFiles?(options: BeforeCopyExtraFilesOptions): Promise<any>\n\n afterPack?(context: AfterPackContext): Promise<any>\n\n createTransformer?(): FileTransformer | null\n}\n\nexport interface BeforeCopyExtraFilesOptions {\n packager: PlatformPackager<any>\n appOutDir: string\n\n asarIntegrity: AsarIntegrity | null\n\n // ElectronPlatformName\n platformName: string\n}\n\nexport interface PrepareApplicationStageDirectoryOptions {\n readonly packager: PlatformPackager<any>\n /**\n * Platform doesn't process application output directory in any way. Unpack implementation must create or empty dir if need.\n */\n readonly appOutDir: string\n readonly platformName: ElectronPlatformName\n readonly arch: string\n readonly version: string\n}\n\nexport function isElectronBased(framework: Framework): boolean {\n return framework.name === \"electron\"\n}\n"]}
|
||||
10
mc_test/node_modules/app-builder-lib/out/ProtonFramework.d.ts
generated
vendored
Executable file
10
mc_test/node_modules/app-builder-lib/out/ProtonFramework.d.ts
generated
vendored
Executable file
@ -0,0 +1,10 @@
|
||||
import { FileTransformer } from "builder-util/out/fs";
|
||||
import { Platform } from "./core";
|
||||
import { LibUiFramework } from "./frameworks/LibUiFramework";
|
||||
export declare class ProtonFramework extends LibUiFramework {
|
||||
readonly name = "proton";
|
||||
readonly defaultAppIdPrefix = "com.proton-native.";
|
||||
constructor(version: string, distMacOsAppName: string, isUseLaunchUi: boolean);
|
||||
getDefaultIcon(platform: Platform): string;
|
||||
createTransformer(): FileTransformer | null;
|
||||
}
|
||||
95
mc_test/node_modules/app-builder-lib/out/ProtonFramework.js
generated
vendored
Executable file
95
mc_test/node_modules/app-builder-lib/out/ProtonFramework.js
generated
vendored
Executable file
@ -0,0 +1,95 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ProtonFramework = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const core_1 = require("./core");
|
||||
const fileTransformer_1 = require("./fileTransformer");
|
||||
const LibUiFramework_1 = require("./frameworks/LibUiFramework");
|
||||
const pathManager_1 = require("./util/pathManager");
|
||||
class ProtonFramework extends LibUiFramework_1.LibUiFramework {
|
||||
constructor(version, distMacOsAppName, isUseLaunchUi) {
|
||||
super(version, distMacOsAppName, isUseLaunchUi);
|
||||
this.name = "proton";
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.defaultAppIdPrefix = "com.proton-native.";
|
||||
}
|
||||
getDefaultIcon(platform) {
|
||||
if (platform === core_1.Platform.WINDOWS) {
|
||||
return (0, pathManager_1.getTemplatePath)("icons/proton-native/proton-native.ico");
|
||||
}
|
||||
else if (platform === core_1.Platform.LINUX) {
|
||||
return (0, pathManager_1.getTemplatePath)("icons/proton-native/linux");
|
||||
}
|
||||
else {
|
||||
return (0, pathManager_1.getTemplatePath)("icons/proton-native/proton-native.icns");
|
||||
}
|
||||
}
|
||||
createTransformer() {
|
||||
let babel;
|
||||
const babelOptions = { ast: false, sourceMaps: "inline" };
|
||||
if (process.env.TEST_SET_BABEL_PRESET === "true") {
|
||||
babel = require("@babel/core");
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
babel = testOnlyBabel(babel, babelOptions, this.version);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
babel = require("babel-core");
|
||||
}
|
||||
catch (e) {
|
||||
// babel isn't installed
|
||||
builder_util_1.log.debug(null, "don't transpile source code using Babel");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
builder_util_1.log.info({
|
||||
options: (0, builder_util_runtime_1.safeStringifyJson)(babelOptions, new Set(["presets"])),
|
||||
}, "transpile source code using Babel");
|
||||
return (file) => {
|
||||
if (!(file.endsWith(".js") || file.endsWith(".jsx")) || file.includes(fileTransformer_1.NODE_MODULES_PATTERN)) {
|
||||
return null;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
return babel.transformFile(file, babelOptions, (error, result) => {
|
||||
if (error == null) {
|
||||
resolve(result.code);
|
||||
}
|
||||
else {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
}
|
||||
exports.ProtonFramework = ProtonFramework;
|
||||
function testOnlyBabel(babel, babelOptions, nodeVersion) {
|
||||
// out test dir can be located outside of electron-builder node_modules and babel cannot resolve string names of preset
|
||||
babelOptions.presets = [[require("@babel/preset-env").default, { targets: { node: nodeVersion } }], require("@babel/preset-react")];
|
||||
babelOptions.plugins = [
|
||||
// stage 0
|
||||
require("@babel/plugin-proposal-function-bind").default,
|
||||
// stage 1
|
||||
require("@babel/plugin-proposal-export-default-from").default,
|
||||
require("@babel/plugin-proposal-logical-assignment-operators").default,
|
||||
[require("@babel/plugin-proposal-optional-chaining").default, { loose: false }],
|
||||
[require("@babel/plugin-proposal-pipeline-operator").default, { proposal: "minimal" }],
|
||||
[require("@babel/plugin-proposal-nullish-coalescing-operator").default, { loose: false }],
|
||||
require("@babel/plugin-proposal-do-expressions").default,
|
||||
// stage 2
|
||||
[require("@babel/plugin-proposal-decorators").default, { legacy: true }],
|
||||
require("@babel/plugin-proposal-function-sent").default,
|
||||
require("@babel/plugin-proposal-export-namespace-from").default,
|
||||
require("@babel/plugin-proposal-numeric-separator").default,
|
||||
require("@babel/plugin-proposal-throw-expressions").default,
|
||||
// stage 3
|
||||
require("@babel/plugin-syntax-dynamic-import").default,
|
||||
require("@babel/plugin-syntax-import-meta").default,
|
||||
[require("@babel/plugin-proposal-class-properties").default, { loose: false }],
|
||||
require("@babel/plugin-proposal-json-strings").default,
|
||||
];
|
||||
babelOptions.babelrc = false;
|
||||
return babel;
|
||||
}
|
||||
//# sourceMappingURL=ProtonFramework.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/ProtonFramework.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/ProtonFramework.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
30
mc_test/node_modules/app-builder-lib/out/appInfo.d.ts
generated
vendored
Executable file
30
mc_test/node_modules/app-builder-lib/out/appInfo.d.ts
generated
vendored
Executable file
@ -0,0 +1,30 @@
|
||||
import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions";
|
||||
import { Packager } from "./packager";
|
||||
export declare function smarten(s: string): string;
|
||||
export declare class AppInfo {
|
||||
private readonly info;
|
||||
private readonly platformSpecificOptions;
|
||||
readonly description: string;
|
||||
readonly version: string;
|
||||
readonly type: string | undefined;
|
||||
readonly shortVersion: string | undefined;
|
||||
readonly shortVersionWindows: string | undefined;
|
||||
readonly buildNumber: string | undefined;
|
||||
readonly buildVersion: string;
|
||||
readonly productName: string;
|
||||
readonly sanitizedProductName: string;
|
||||
readonly productFilename: string;
|
||||
constructor(info: Packager, buildVersion: string | null | undefined, platformSpecificOptions?: PlatformSpecificBuildOptions | null, normalizeNfd?: boolean);
|
||||
get channel(): string | null;
|
||||
getVersionInWeirdWindowsForm(isSetBuildNumber?: boolean): string;
|
||||
private get notNullDevMetadata();
|
||||
get companyName(): string | null;
|
||||
get id(): string;
|
||||
get macBundleIdentifier(): string;
|
||||
get name(): string;
|
||||
get linuxPackageName(): string;
|
||||
get sanitizedName(): string;
|
||||
get updaterCacheDirName(): string;
|
||||
get copyright(): string;
|
||||
computePackageUrl(): Promise<string | null>;
|
||||
}
|
||||
152
mc_test/node_modules/app-builder-lib/out/appInfo.js
generated
vendored
Executable file
152
mc_test/node_modules/app-builder-lib/out/appInfo.js
generated
vendored
Executable file
@ -0,0 +1,152 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.filterCFBundleIdentifier = exports.AppInfo = exports.smarten = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const semver_1 = require("semver");
|
||||
const macroExpander_1 = require("./util/macroExpander");
|
||||
const filename_1 = require("./util/filename");
|
||||
// fpm bug - rpm build --description is not escaped, well... decided to replace quite to smart quote
|
||||
// http://leancrew.com/all-this/2010/11/smart-quotes-in-javascript/
|
||||
function smarten(s) {
|
||||
// opening singles
|
||||
s = s.replace(/(^|[-\u2014\s(["])'/g, "$1\u2018");
|
||||
// closing singles & apostrophes
|
||||
s = s.replace(/'/g, "\u2019");
|
||||
// opening doubles
|
||||
s = s.replace(/(^|[-\u2014/[(\u2018\s])"/g, "$1\u201c");
|
||||
// closing doubles
|
||||
s = s.replace(/"/g, "\u201d");
|
||||
return s;
|
||||
}
|
||||
exports.smarten = smarten;
|
||||
class AppInfo {
|
||||
constructor(info, buildVersion, platformSpecificOptions = null, normalizeNfd = false) {
|
||||
var _a;
|
||||
this.info = info;
|
||||
this.platformSpecificOptions = platformSpecificOptions;
|
||||
this.description = smarten(this.info.metadata.description || "");
|
||||
this.version = info.metadata.version;
|
||||
this.type = info.metadata.type;
|
||||
if (buildVersion == null) {
|
||||
buildVersion = info.config.buildVersion;
|
||||
}
|
||||
const buildNumberEnvs = process.env.BUILD_NUMBER ||
|
||||
process.env.TRAVIS_BUILD_NUMBER ||
|
||||
process.env.APPVEYOR_BUILD_NUMBER ||
|
||||
process.env.CIRCLE_BUILD_NUM ||
|
||||
process.env.BUILD_BUILDNUMBER ||
|
||||
process.env.CI_PIPELINE_IID;
|
||||
this.buildNumber = info.config.buildNumber || buildNumberEnvs;
|
||||
if (buildVersion == null) {
|
||||
buildVersion = this.version;
|
||||
if (!(0, builder_util_1.isEmptyOrSpaces)(this.buildNumber)) {
|
||||
buildVersion += `.${this.buildNumber}`;
|
||||
}
|
||||
}
|
||||
this.buildVersion = buildVersion;
|
||||
if (info.metadata.shortVersion) {
|
||||
this.shortVersion = info.metadata.shortVersion;
|
||||
}
|
||||
if (info.metadata.shortVersionWindows) {
|
||||
this.shortVersionWindows = info.metadata.shortVersionWindows;
|
||||
}
|
||||
this.productName = info.config.productName || info.metadata.productName || info.metadata.name;
|
||||
this.sanitizedProductName = (0, filename_1.sanitizeFileName)(this.productName, normalizeNfd);
|
||||
const executableName = (_a = platformSpecificOptions === null || platformSpecificOptions === void 0 ? void 0 : platformSpecificOptions.executableName) !== null && _a !== void 0 ? _a : info.config.executableName;
|
||||
this.productFilename = executableName != null ? (0, filename_1.sanitizeFileName)(executableName, normalizeNfd) : this.sanitizedProductName;
|
||||
}
|
||||
get channel() {
|
||||
const prereleaseInfo = (0, semver_1.prerelease)(this.version);
|
||||
if (prereleaseInfo != null && prereleaseInfo.length > 0) {
|
||||
return prereleaseInfo[0];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
getVersionInWeirdWindowsForm(isSetBuildNumber = true) {
|
||||
const [major, maybe_minor, maybe_patch] = this.version.split(".").map(versionPart => parseInt(versionPart));
|
||||
// The major component must be present. Here it can be either NaN or undefined, which
|
||||
// both returns true from isNaN.
|
||||
if (isNaN(major)) {
|
||||
throw new Error(`Invalid major number in: ${this.version}`);
|
||||
}
|
||||
// Allow missing version parts. Minor and patch can be left out and default to zero
|
||||
const minor = maybe_minor !== null && maybe_minor !== void 0 ? maybe_minor : 0;
|
||||
const patch = maybe_patch !== null && maybe_patch !== void 0 ? maybe_patch : 0;
|
||||
// ... but reject non-integer version parts. '1.a' is not going to fly
|
||||
if (isNaN(minor) || isNaN(patch)) {
|
||||
throw new Error(`Invalid minor or patch number in: ${this.version}`);
|
||||
}
|
||||
// https://github.com/electron-userland/electron-builder/issues/2635#issuecomment-371792272
|
||||
let buildNumber = isSetBuildNumber ? this.buildNumber : null;
|
||||
if (buildNumber == null || !/^\d+$/.test(buildNumber)) {
|
||||
buildNumber = "0";
|
||||
}
|
||||
return `${major}.${minor}.${patch}.${buildNumber}`;
|
||||
}
|
||||
get notNullDevMetadata() {
|
||||
return this.info.devMetadata || {};
|
||||
}
|
||||
get companyName() {
|
||||
const author = this.info.metadata.author || this.notNullDevMetadata.author;
|
||||
return author == null ? null : author.name;
|
||||
}
|
||||
get id() {
|
||||
let appId = null;
|
||||
for (const options of [this.platformSpecificOptions, this.info.config]) {
|
||||
if (options != null && appId == null) {
|
||||
appId = options.appId;
|
||||
}
|
||||
}
|
||||
const generateDefaultAppId = () => {
|
||||
const info = this.info;
|
||||
return `${info.framework.defaultAppIdPrefix}${info.metadata.name.toLowerCase()}`;
|
||||
};
|
||||
if (appId != null && (appId === "your.id" || (0, builder_util_1.isEmptyOrSpaces)(appId))) {
|
||||
const incorrectAppId = appId;
|
||||
appId = generateDefaultAppId();
|
||||
builder_util_1.log.warn(`do not use "${incorrectAppId}" as appId, "${appId}" will be used instead`);
|
||||
}
|
||||
return appId == null ? generateDefaultAppId() : appId;
|
||||
}
|
||||
get macBundleIdentifier() {
|
||||
return filterCFBundleIdentifier(this.id);
|
||||
}
|
||||
get name() {
|
||||
return this.info.metadata.name;
|
||||
}
|
||||
get linuxPackageName() {
|
||||
const name = this.name;
|
||||
// https://github.com/electron-userland/electron-builder/issues/2963
|
||||
return name.startsWith("@") ? this.sanitizedProductName : name;
|
||||
}
|
||||
get sanitizedName() {
|
||||
return (0, filename_1.sanitizeFileName)(this.name);
|
||||
}
|
||||
get updaterCacheDirName() {
|
||||
return this.sanitizedName.toLowerCase() + "-updater";
|
||||
}
|
||||
get copyright() {
|
||||
const copyright = this.info.config.copyright;
|
||||
if (copyright != null) {
|
||||
return (0, macroExpander_1.expandMacro)(copyright, null, this);
|
||||
}
|
||||
return `Copyright © ${new Date().getFullYear()} ${this.companyName || this.productName}`;
|
||||
}
|
||||
async computePackageUrl() {
|
||||
const url = this.info.metadata.homepage || this.notNullDevMetadata.homepage;
|
||||
if (url != null) {
|
||||
return url;
|
||||
}
|
||||
const info = await this.info.repositoryInfo;
|
||||
return info == null || info.type !== "github" ? null : `https://${info.domain}/${info.user}/${info.project}`;
|
||||
}
|
||||
}
|
||||
exports.AppInfo = AppInfo;
|
||||
/** @internal */
|
||||
function filterCFBundleIdentifier(identifier) {
|
||||
// Remove special characters and allow only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.)
|
||||
// Apple documentation: https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070
|
||||
return identifier.replace(/ /g, "-").replace(/[^a-zA-Z0-9.-]/g, "");
|
||||
}
|
||||
exports.filterCFBundleIdentifier = filterCFBundleIdentifier;
|
||||
//# sourceMappingURL=appInfo.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/appInfo.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/appInfo.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
41
mc_test/node_modules/app-builder-lib/out/asar/asar.d.ts
generated
vendored
Executable file
41
mc_test/node_modules/app-builder-lib/out/asar/asar.d.ts
generated
vendored
Executable file
@ -0,0 +1,41 @@
|
||||
/// <reference types="node" />
|
||||
/// <reference types="node" />
|
||||
import { Stats } from "fs-extra";
|
||||
export interface ReadAsarHeader {
|
||||
readonly header: string;
|
||||
readonly size: number;
|
||||
}
|
||||
export interface NodeIntegrity {
|
||||
algorithm: "SHA256";
|
||||
hash: string;
|
||||
blockSize: number;
|
||||
blocks: Array<string>;
|
||||
}
|
||||
export declare class Node {
|
||||
files?: {
|
||||
[key: string]: Node;
|
||||
};
|
||||
unpacked?: boolean;
|
||||
size?: number;
|
||||
offset?: string;
|
||||
executable?: boolean;
|
||||
link?: string;
|
||||
integrity?: NodeIntegrity;
|
||||
}
|
||||
export declare class AsarFilesystem {
|
||||
readonly src: string;
|
||||
readonly header: Node;
|
||||
readonly headerSize: number;
|
||||
private offset;
|
||||
constructor(src: string, header?: Node, headerSize?: number);
|
||||
searchNodeFromDirectory(p: string, isCreate: boolean): Node | null;
|
||||
getOrCreateNode(p: string): Node;
|
||||
addFileNode(file: string, dirNode: Node, size: number, unpacked: boolean, stat: Stats, integrity?: NodeIntegrity): Node;
|
||||
getNode(p: string): Node | null;
|
||||
getFile(p: string, followLinks?: boolean): Node;
|
||||
readJson(file: string): Promise<any>;
|
||||
readFile(file: string): Promise<Buffer>;
|
||||
}
|
||||
export declare function readAsarHeader(archive: string): Promise<ReadAsarHeader>;
|
||||
export declare function readAsar(archive: string): Promise<AsarFilesystem>;
|
||||
export declare function readAsarJson(archive: string, file: string): Promise<any>;
|
||||
151
mc_test/node_modules/app-builder-lib/out/asar/asar.js
generated
vendored
Executable file
151
mc_test/node_modules/app-builder-lib/out/asar/asar.js
generated
vendored
Executable file
@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readAsarJson = exports.readAsar = exports.readAsarHeader = exports.AsarFilesystem = exports.Node = void 0;
|
||||
const chromium_pickle_js_1 = require("chromium-pickle-js");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
class Node {
|
||||
}
|
||||
exports.Node = Node;
|
||||
class AsarFilesystem {
|
||||
constructor(src, header = new Node(), headerSize = -1) {
|
||||
this.src = src;
|
||||
this.header = header;
|
||||
this.headerSize = headerSize;
|
||||
this.offset = 0;
|
||||
if (this.header.files == null) {
|
||||
this.header.files = {};
|
||||
}
|
||||
}
|
||||
searchNodeFromDirectory(p, isCreate) {
|
||||
let node = this.header;
|
||||
for (const dir of p.split(path.sep)) {
|
||||
if (dir !== ".") {
|
||||
let child = node.files[dir];
|
||||
if (child == null) {
|
||||
if (!isCreate) {
|
||||
return null;
|
||||
}
|
||||
child = new Node();
|
||||
child.files = {};
|
||||
node.files[dir] = child;
|
||||
}
|
||||
node = child;
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
getOrCreateNode(p) {
|
||||
if (p == null || p.length === 0) {
|
||||
return this.header;
|
||||
}
|
||||
const name = path.basename(p);
|
||||
const dirNode = this.searchNodeFromDirectory(path.dirname(p), true);
|
||||
if (dirNode.files == null) {
|
||||
dirNode.files = {};
|
||||
}
|
||||
let result = dirNode.files[name];
|
||||
if (result == null) {
|
||||
result = new Node();
|
||||
dirNode.files[name] = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
addFileNode(file, dirNode, size, unpacked, stat, integrity) {
|
||||
if (size > 4294967295) {
|
||||
throw new Error(`${file}: file size cannot be larger than 4.2GB`);
|
||||
}
|
||||
const node = new Node();
|
||||
node.size = size;
|
||||
if (integrity) {
|
||||
node.integrity = integrity;
|
||||
}
|
||||
if (unpacked) {
|
||||
node.unpacked = true;
|
||||
}
|
||||
else {
|
||||
// electron expects string
|
||||
node.offset = this.offset.toString();
|
||||
if (process.platform !== "win32" && stat.mode & 0o100) {
|
||||
node.executable = true;
|
||||
}
|
||||
this.offset += node.size;
|
||||
}
|
||||
let children = dirNode.files;
|
||||
if (children == null) {
|
||||
children = {};
|
||||
dirNode.files = children;
|
||||
}
|
||||
children[path.basename(file)] = node;
|
||||
return node;
|
||||
}
|
||||
getNode(p) {
|
||||
const node = this.searchNodeFromDirectory(path.dirname(p), false);
|
||||
return node.files[path.basename(p)];
|
||||
}
|
||||
getFile(p, followLinks = true) {
|
||||
const info = this.getNode(p);
|
||||
// if followLinks is false we don't resolve symlinks
|
||||
return followLinks && info.link != null ? this.getFile(info.link) : info;
|
||||
}
|
||||
async readJson(file) {
|
||||
return JSON.parse((await this.readFile(file)).toString());
|
||||
}
|
||||
readFile(file) {
|
||||
return readFileFromAsar(this, file, this.getFile(file));
|
||||
}
|
||||
}
|
||||
exports.AsarFilesystem = AsarFilesystem;
|
||||
async function readAsarHeader(archive) {
|
||||
const fd = await (0, fs_extra_1.open)(archive, "r");
|
||||
let size;
|
||||
let headerBuf;
|
||||
try {
|
||||
const sizeBuf = Buffer.allocUnsafe(8);
|
||||
if ((await (0, fs_extra_1.read)(fd, sizeBuf, 0, 8, null)).bytesRead !== 8) {
|
||||
throw new Error("Unable to read header size");
|
||||
}
|
||||
const sizePickle = (0, chromium_pickle_js_1.createFromBuffer)(sizeBuf);
|
||||
size = sizePickle.createIterator().readUInt32();
|
||||
headerBuf = Buffer.allocUnsafe(size);
|
||||
if ((await (0, fs_extra_1.read)(fd, headerBuf, 0, size, null)).bytesRead !== size) {
|
||||
throw new Error("Unable to read header");
|
||||
}
|
||||
}
|
||||
finally {
|
||||
await (0, fs_extra_1.close)(fd);
|
||||
}
|
||||
const headerPickle = (0, chromium_pickle_js_1.createFromBuffer)(headerBuf);
|
||||
return { header: headerPickle.createIterator().readString(), size };
|
||||
}
|
||||
exports.readAsarHeader = readAsarHeader;
|
||||
async function readAsar(archive) {
|
||||
const { header, size } = await readAsarHeader(archive);
|
||||
return new AsarFilesystem(archive, JSON.parse(header), size);
|
||||
}
|
||||
exports.readAsar = readAsar;
|
||||
async function readAsarJson(archive, file) {
|
||||
const fs = await readAsar(archive);
|
||||
return await fs.readJson(file);
|
||||
}
|
||||
exports.readAsarJson = readAsarJson;
|
||||
async function readFileFromAsar(filesystem, filename, info) {
|
||||
const size = info.size;
|
||||
const buffer = Buffer.allocUnsafe(size);
|
||||
if (size <= 0) {
|
||||
return buffer;
|
||||
}
|
||||
if (info.unpacked) {
|
||||
return await (0, fs_extra_1.readFile)(path.join(`${filesystem.src}.unpacked`, filename));
|
||||
}
|
||||
const fd = await (0, fs_extra_1.open)(filesystem.src, "r");
|
||||
try {
|
||||
const offset = 8 + filesystem.headerSize + parseInt(info.offset, 10);
|
||||
await (0, fs_extra_1.read)(fd, buffer, 0, size, offset);
|
||||
}
|
||||
finally {
|
||||
await (0, fs_extra_1.close)(fd);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
//# sourceMappingURL=asar.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/asar.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/asar.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export {};
|
||||
38
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.js
generated
vendored
Executable file
38
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.js
generated
vendored
Executable file
@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.checkFileInArchive = void 0;
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const asar_1 = require("./asar");
|
||||
/** @internal */
|
||||
async function checkFileInArchive(asarFile, relativeFile, messagePrefix) {
|
||||
function error(text) {
|
||||
return new Error(`${messagePrefix} "${relativeFile}" in the "${asarFile}" ${text}`);
|
||||
}
|
||||
let fs;
|
||||
try {
|
||||
fs = await (0, asar_1.readAsar)(asarFile);
|
||||
}
|
||||
catch (e) {
|
||||
throw error(`is corrupted: ${e}`);
|
||||
}
|
||||
let stat;
|
||||
try {
|
||||
stat = fs.getFile(relativeFile);
|
||||
}
|
||||
catch (e) {
|
||||
const fileStat = await (0, fs_1.statOrNull)(asarFile);
|
||||
if (fileStat == null) {
|
||||
throw error(`does not exist. Seems like a wrong configuration.`);
|
||||
}
|
||||
// asar throws error on access to undefined object (info.link)
|
||||
stat = null;
|
||||
}
|
||||
if (stat == null) {
|
||||
throw error(`does not exist. Seems like a wrong configuration.`);
|
||||
}
|
||||
if (stat.size === 0) {
|
||||
throw error(`is corrupted: size 0`);
|
||||
}
|
||||
}
|
||||
exports.checkFileInArchive = checkFileInArchive;
|
||||
//# sourceMappingURL=asarFileChecker.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/asarFileChecker.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"asarFileChecker.js","sourceRoot":"","sources":["../../src/asar/asarFileChecker.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,iCAAuC;AAEvC,gBAAgB;AACT,KAAK,UAAU,kBAAkB,CAAC,QAAgB,EAAE,YAAoB,EAAE,aAAqB;IACpG,SAAS,KAAK,CAAC,IAAY;QACzB,OAAO,IAAI,KAAK,CAAC,GAAG,aAAa,KAAK,YAAY,aAAa,QAAQ,KAAK,IAAI,EAAE,CAAC,CAAA;IACrF,CAAC;IAED,IAAI,EAAE,CAAA;IACN,IAAI,CAAC;QACH,EAAE,GAAG,MAAM,IAAA,eAAQ,EAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,KAAK,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAA;IACnC,CAAC;IAED,IAAI,IAAiB,CAAA;IACrB,IAAI,CAAC;QACH,IAAI,GAAG,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;IACjC,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,MAAM,QAAQ,GAAG,MAAM,IAAA,eAAU,EAAC,QAAQ,CAAC,CAAA;QAC3C,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACrB,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAA;QAClE,CAAC;QAED,8DAA8D;QAC9D,IAAI,GAAG,IAAI,CAAA;IACb,CAAC;IAED,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,MAAM,KAAK,CAAC,mDAAmD,CAAC,CAAA;IAClE,CAAC;IACD,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,KAAK,CAAC,sBAAsB,CAAC,CAAA;IACrC,CAAC;AACH,CAAC;AA/BD,gDA+BC","sourcesContent":["import { statOrNull } from \"builder-util/out/fs\"\nimport { Node, readAsar } from \"./asar\"\n\n/** @internal */\nexport async function checkFileInArchive(asarFile: string, relativeFile: string, messagePrefix: string) {\n function error(text: string) {\n return new Error(`${messagePrefix} \"${relativeFile}\" in the \"${asarFile}\" ${text}`)\n }\n\n let fs\n try {\n fs = await readAsar(asarFile)\n } catch (e: any) {\n throw error(`is corrupted: ${e}`)\n }\n\n let stat: Node | null\n try {\n stat = fs.getFile(relativeFile)\n } catch (e: any) {\n const fileStat = await statOrNull(asarFile)\n if (fileStat == null) {\n throw error(`does not exist. Seems like a wrong configuration.`)\n }\n\n // asar throws error on access to undefined object (info.link)\n stat = null\n }\n\n if (stat == null) {\n throw error(`does not exist. Seems like a wrong configuration.`)\n }\n if (stat.size === 0) {\n throw error(`is corrupted: size 0`)\n }\n}\n"]}
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export {};
|
||||
241
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.js
generated
vendored
Executable file
241
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.js
generated
vendored
Executable file
@ -0,0 +1,241 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AsarPackager = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const fs_2 = require("fs");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
const appFileCopier_1 = require("../util/appFileCopier");
|
||||
const asar_1 = require("./asar");
|
||||
const integrity_1 = require("./integrity");
|
||||
const unpackDetector_1 = require("./unpackDetector");
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const pickle = require("chromium-pickle-js");
|
||||
/** @internal */
|
||||
class AsarPackager {
|
||||
constructor(src, destination, options, unpackPattern) {
|
||||
this.src = src;
|
||||
this.destination = destination;
|
||||
this.options = options;
|
||||
this.unpackPattern = unpackPattern;
|
||||
this.fs = new asar_1.AsarFilesystem(this.src);
|
||||
this.outFile = path.join(destination, "app.asar");
|
||||
this.unpackedDest = `${this.outFile}.unpacked`;
|
||||
}
|
||||
// sort files to minimize file change (i.e. asar file is not changed dramatically on small change)
|
||||
async pack(fileSets, packager) {
|
||||
if (this.options.ordering != null) {
|
||||
// ordering doesn't support transformed files, but ordering is not used functionality - wait user report to fix it
|
||||
await order(fileSets[0].files, this.options.ordering, fileSets[0].src);
|
||||
}
|
||||
await (0, promises_1.mkdir)(path.dirname(this.outFile), { recursive: true });
|
||||
const unpackedFileIndexMap = new Map();
|
||||
for (const fileSet of fileSets) {
|
||||
unpackedFileIndexMap.set(fileSet, await this.createPackageFromFiles(fileSet, packager.info));
|
||||
}
|
||||
await this.writeAsarFile(fileSets, unpackedFileIndexMap);
|
||||
}
|
||||
async createPackageFromFiles(fileSet, packager) {
|
||||
const metadata = fileSet.metadata;
|
||||
// search auto unpacked dir
|
||||
const unpackedDirs = new Set();
|
||||
const rootForAppFilesWithoutAsar = path.join(this.destination, "app");
|
||||
if (this.options.smartUnpack !== false) {
|
||||
await (0, unpackDetector_1.detectUnpackedDirs)(fileSet, unpackedDirs, this.unpackedDest, rootForAppFilesWithoutAsar);
|
||||
}
|
||||
const dirToCreateForUnpackedFiles = new Set(unpackedDirs);
|
||||
const correctDirNodeUnpackedFlag = async (filePathInArchive, dirNode) => {
|
||||
for (const dir of unpackedDirs) {
|
||||
if (filePathInArchive.length > dir.length + 2 && filePathInArchive[dir.length] === path.sep && filePathInArchive.startsWith(dir)) {
|
||||
dirNode.unpacked = true;
|
||||
unpackedDirs.add(filePathInArchive);
|
||||
// not all dirs marked as unpacked after first iteration - because node module dir can be marked as unpacked after processing node module dir content
|
||||
// e.g. node-notifier/example/advanced.js processed, but only on process vendor/terminal-notifier.app module will be marked as unpacked
|
||||
await (0, promises_1.mkdir)(path.join(this.unpackedDest, filePathInArchive), { recursive: true });
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
const transformedFiles = fileSet.transformedFiles;
|
||||
const taskManager = new builder_util_1.AsyncTaskManager(packager.cancellationToken);
|
||||
const fileCopier = new fs_1.FileCopier();
|
||||
let currentDirNode = null;
|
||||
let currentDirPath = null;
|
||||
const unpackedFileIndexSet = new Set();
|
||||
for (let i = 0, n = fileSet.files.length; i < n; i++) {
|
||||
const file = fileSet.files[i];
|
||||
const stat = metadata.get(file);
|
||||
if (stat == null) {
|
||||
continue;
|
||||
}
|
||||
const pathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, appFileCopier_1.getDestinationPath)(file, fileSet));
|
||||
if (stat.isSymbolicLink()) {
|
||||
const s = stat;
|
||||
this.fs.getOrCreateNode(pathInArchive).link = s.relativeLink;
|
||||
s.pathInArchive = pathInArchive;
|
||||
unpackedFileIndexSet.add(i);
|
||||
continue;
|
||||
}
|
||||
let fileParent = path.dirname(pathInArchive);
|
||||
if (fileParent === ".") {
|
||||
fileParent = "";
|
||||
}
|
||||
if (currentDirPath !== fileParent) {
|
||||
if (fileParent.startsWith("..")) {
|
||||
throw new Error(`Internal error: path must not start with "..": ${fileParent}`);
|
||||
}
|
||||
currentDirPath = fileParent;
|
||||
currentDirNode = this.fs.getOrCreateNode(fileParent);
|
||||
// do not check for root
|
||||
if (fileParent !== "" && !currentDirNode.unpacked) {
|
||||
if (unpackedDirs.has(fileParent)) {
|
||||
currentDirNode.unpacked = true;
|
||||
}
|
||||
else {
|
||||
await correctDirNodeUnpackedFlag(fileParent, currentDirNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
const dirNode = currentDirNode;
|
||||
const newData = transformedFiles == null ? undefined : transformedFiles.get(i);
|
||||
const isUnpacked = dirNode.unpacked || (this.unpackPattern != null && this.unpackPattern(file, stat));
|
||||
const integrity = newData === undefined ? await (0, integrity_1.hashFile)(file) : (0, integrity_1.hashFileContents)(newData);
|
||||
this.fs.addFileNode(file, dirNode, newData == undefined ? stat.size : Buffer.byteLength(newData), isUnpacked, stat, integrity);
|
||||
if (isUnpacked) {
|
||||
if (!dirNode.unpacked && !dirToCreateForUnpackedFiles.has(fileParent)) {
|
||||
dirToCreateForUnpackedFiles.add(fileParent);
|
||||
await (0, promises_1.mkdir)(path.join(this.unpackedDest, fileParent), { recursive: true });
|
||||
}
|
||||
const unpackedFile = path.join(this.unpackedDest, pathInArchive);
|
||||
taskManager.addTask(copyFileOrData(fileCopier, newData, file, unpackedFile, stat));
|
||||
if (taskManager.tasks.length > fs_1.MAX_FILE_REQUESTS) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
unpackedFileIndexSet.add(i);
|
||||
}
|
||||
}
|
||||
if (taskManager.tasks.length > 0) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
return unpackedFileIndexSet;
|
||||
}
|
||||
writeAsarFile(fileSets, unpackedFileIndexMap) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const headerPickle = pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(this.fs.header));
|
||||
const headerBuf = headerPickle.toBuffer();
|
||||
const sizePickle = pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
const sizeBuf = sizePickle.toBuffer();
|
||||
const writeStream = (0, fs_2.createWriteStream)(this.outFile);
|
||||
writeStream.on("error", reject);
|
||||
writeStream.on("close", resolve);
|
||||
writeStream.write(sizeBuf);
|
||||
let fileSetIndex = 0;
|
||||
let files = fileSets[0].files;
|
||||
let metadata = fileSets[0].metadata;
|
||||
let transformedFiles = fileSets[0].transformedFiles;
|
||||
let unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[0]);
|
||||
const w = (index) => {
|
||||
while (true) {
|
||||
if (index >= files.length) {
|
||||
if (++fileSetIndex >= fileSets.length) {
|
||||
writeStream.end();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
files = fileSets[fileSetIndex].files;
|
||||
metadata = fileSets[fileSetIndex].metadata;
|
||||
transformedFiles = fileSets[fileSetIndex].transformedFiles;
|
||||
unpackedFileIndexSet = unpackedFileIndexMap.get(fileSets[fileSetIndex]);
|
||||
index = 0;
|
||||
}
|
||||
}
|
||||
if (!unpackedFileIndexSet.has(index)) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
const stat = metadata.get(files[index]);
|
||||
if (stat != null && stat.isSymbolicLink()) {
|
||||
(0, fs_2.symlink)(stat.linkRelativeToFile, path.join(this.unpackedDest, stat.pathInArchive), () => w(index + 1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
const data = transformedFiles == null ? null : transformedFiles.get(index);
|
||||
const file = files[index];
|
||||
if (data !== null && data !== undefined) {
|
||||
writeStream.write(data, () => w(index + 1));
|
||||
return;
|
||||
}
|
||||
// https://github.com/yarnpkg/yarn/pull/3539
|
||||
const stat = metadata.get(file);
|
||||
if (stat != null && stat.size < 2 * 1024 * 1024) {
|
||||
(0, promises_1.readFile)(file)
|
||||
.then(it => {
|
||||
writeStream.write(it, () => w(index + 1));
|
||||
})
|
||||
.catch((e) => reject(`Cannot read file ${file}: ${e.stack || e}`));
|
||||
}
|
||||
else {
|
||||
const readStream = (0, fs_2.createReadStream)(file);
|
||||
readStream.on("error", reject);
|
||||
readStream.once("end", () => w(index + 1));
|
||||
readStream.on("open", () => {
|
||||
readStream.pipe(writeStream, {
|
||||
end: false,
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
writeStream.write(headerBuf, () => w(0));
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.AsarPackager = AsarPackager;
|
||||
async function order(filenames, orderingFile, src) {
|
||||
const orderingFiles = (await (0, promises_1.readFile)(orderingFile, "utf8")).split("\n").map(line => {
|
||||
if (line.indexOf(":") !== -1) {
|
||||
line = line.split(":").pop();
|
||||
}
|
||||
line = line.trim();
|
||||
if (line[0] === "/") {
|
||||
line = line.slice(1);
|
||||
}
|
||||
return line;
|
||||
});
|
||||
const ordering = [];
|
||||
for (const file of orderingFiles) {
|
||||
const pathComponents = file.split(path.sep);
|
||||
for (const pathComponent of pathComponents) {
|
||||
ordering.push(path.join(src, pathComponent));
|
||||
}
|
||||
}
|
||||
const sortedFiles = [];
|
||||
let missing = 0;
|
||||
const total = filenames.length;
|
||||
for (const file of ordering) {
|
||||
if (!sortedFiles.includes(file) && filenames.includes(file)) {
|
||||
sortedFiles.push(file);
|
||||
}
|
||||
}
|
||||
for (const file of filenames) {
|
||||
if (!sortedFiles.includes(file)) {
|
||||
sortedFiles.push(file);
|
||||
missing += 1;
|
||||
}
|
||||
}
|
||||
builder_util_1.log.info({ coverage: ((total - missing) / total) * 100 }, "ordering files in ASAR archive");
|
||||
return sortedFiles;
|
||||
}
|
||||
function copyFileOrData(fileCopier, data, source, destination, stats) {
|
||||
if (data == null) {
|
||||
return fileCopier.copy(source, destination, stats);
|
||||
}
|
||||
else {
|
||||
return (0, promises_1.writeFile)(destination, data);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=asarUtil.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/asarUtil.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
16
mc_test/node_modules/app-builder-lib/out/asar/integrity.d.ts
generated
vendored
Executable file
16
mc_test/node_modules/app-builder-lib/out/asar/integrity.d.ts
generated
vendored
Executable file
@ -0,0 +1,16 @@
|
||||
/// <reference types="node" />
|
||||
import { NodeIntegrity } from "./asar";
|
||||
export interface AsarIntegrityOptions {
|
||||
readonly resourcesPath: string;
|
||||
readonly resourcesRelativePath: string;
|
||||
}
|
||||
export interface HeaderHash {
|
||||
algorithm: "SHA256";
|
||||
hash: string;
|
||||
}
|
||||
export interface AsarIntegrity {
|
||||
[key: string]: HeaderHash;
|
||||
}
|
||||
export declare function computeData({ resourcesPath, resourcesRelativePath }: AsarIntegrityOptions): Promise<AsarIntegrity>;
|
||||
export declare function hashFile(file: string, blockSize?: number): Promise<NodeIntegrity>;
|
||||
export declare function hashFileContents(contents: Buffer | string, blockSize?: number): NodeIntegrity;
|
||||
89
mc_test/node_modules/app-builder-lib/out/asar/integrity.js
generated
vendored
Executable file
89
mc_test/node_modules/app-builder-lib/out/asar/integrity.js
generated
vendored
Executable file
@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hashFileContents = exports.hashFile = exports.computeData = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const crypto_1 = require("crypto");
|
||||
const fs_1 = require("fs");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
const asar_1 = require("./asar");
|
||||
async function computeData({ resourcesPath, resourcesRelativePath }) {
|
||||
// sort to produce constant result
|
||||
const names = (await (0, promises_1.readdir)(resourcesPath)).filter(it => it.endsWith(".asar")).sort();
|
||||
const checksums = await bluebird_lst_1.default.map(names, it => hashHeader(path.join(resourcesPath, it)));
|
||||
const result = {};
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
result[path.join(resourcesRelativePath, names[i])] = checksums[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.computeData = computeData;
|
||||
async function hashHeader(file) {
|
||||
const hash = (0, crypto_1.createHash)("sha256");
|
||||
const { header } = await (0, asar_1.readAsarHeader)(file);
|
||||
hash.update(header);
|
||||
return {
|
||||
algorithm: "SHA256",
|
||||
hash: hash.digest("hex"),
|
||||
};
|
||||
}
|
||||
function hashFile(file, blockSize = 4 * 1024 * 1024) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const hash = (0, crypto_1.createHash)("sha256");
|
||||
const blocks = new Array();
|
||||
let blockBytes = 0;
|
||||
let blockHash = (0, crypto_1.createHash)("sha256");
|
||||
function updateBlockHash(chunk) {
|
||||
let off = 0;
|
||||
while (off < chunk.length) {
|
||||
const toHash = Math.min(blockSize - blockBytes, chunk.length - off);
|
||||
blockHash.update(chunk.slice(off, off + toHash));
|
||||
off += toHash;
|
||||
blockBytes += toHash;
|
||||
if (blockBytes === blockSize) {
|
||||
blocks.push(blockHash.digest("hex"));
|
||||
blockHash = (0, crypto_1.createHash)("sha256");
|
||||
blockBytes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
(0, fs_1.createReadStream)(file)
|
||||
.on("data", it => {
|
||||
// Note that `it` is a Buffer anyway so this cast is a no-op
|
||||
updateBlockHash(Buffer.from(it));
|
||||
hash.update(it);
|
||||
})
|
||||
.on("error", reject)
|
||||
.on("end", () => {
|
||||
if (blockBytes !== 0) {
|
||||
blocks.push(blockHash.digest("hex"));
|
||||
}
|
||||
resolve({
|
||||
algorithm: "SHA256",
|
||||
hash: hash.digest("hex"),
|
||||
blockSize,
|
||||
blocks,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.hashFile = hashFile;
|
||||
function hashFileContents(contents, blockSize = 4 * 1024 * 1024) {
|
||||
const buffer = Buffer.from(contents);
|
||||
const hash = (0, crypto_1.createHash)("sha256");
|
||||
hash.update(buffer);
|
||||
const blocks = new Array();
|
||||
for (let off = 0; off < buffer.length; off += blockSize) {
|
||||
const blockHash = (0, crypto_1.createHash)("sha256");
|
||||
blockHash.update(buffer.slice(off, off + blockSize));
|
||||
blocks.push(blockHash.digest("hex"));
|
||||
}
|
||||
return {
|
||||
algorithm: "SHA256",
|
||||
hash: hash.digest("hex"),
|
||||
blockSize,
|
||||
blocks,
|
||||
};
|
||||
}
|
||||
exports.hashFileContents = hashFileContents;
|
||||
//# sourceMappingURL=integrity.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/integrity.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/integrity.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export declare function isLibOrExe(file: string): boolean;
|
||||
108
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.js
generated
vendored
Executable file
108
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.js
generated
vendored
Executable file
@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.detectUnpackedDirs = exports.isLibOrExe = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const isbinaryfile_1 = require("isbinaryfile");
|
||||
const path = require("path");
|
||||
const fileTransformer_1 = require("../fileTransformer");
|
||||
const appFileCopier_1 = require("../util/appFileCopier");
|
||||
function addValue(map, key, value) {
|
||||
let list = map.get(key);
|
||||
if (list == null) {
|
||||
list = [value];
|
||||
map.set(key, list);
|
||||
}
|
||||
else {
|
||||
list.push(value);
|
||||
}
|
||||
}
|
||||
function isLibOrExe(file) {
|
||||
return file.endsWith(".dll") || file.endsWith(".exe") || file.endsWith(".dylib") || file.endsWith(".so");
|
||||
}
|
||||
exports.isLibOrExe = isLibOrExe;
|
||||
/** @internal */
|
||||
async function detectUnpackedDirs(fileSet, autoUnpackDirs, unpackedDest, rootForAppFilesWithoutAsar) {
|
||||
const dirToCreate = new Map();
|
||||
const metadata = fileSet.metadata;
|
||||
function addParents(child, root) {
|
||||
child = path.dirname(child);
|
||||
if (autoUnpackDirs.has(child)) {
|
||||
return;
|
||||
}
|
||||
do {
|
||||
autoUnpackDirs.add(child);
|
||||
const p = path.dirname(child);
|
||||
// create parent dir to be able to copy file later without directory existence check
|
||||
addValue(dirToCreate, p, path.basename(child));
|
||||
if (child === root || p === root || autoUnpackDirs.has(p)) {
|
||||
break;
|
||||
}
|
||||
child = p;
|
||||
} while (true);
|
||||
autoUnpackDirs.add(root);
|
||||
}
|
||||
for (let i = 0, n = fileSet.files.length; i < n; i++) {
|
||||
const file = fileSet.files[i];
|
||||
const index = file.lastIndexOf(fileTransformer_1.NODE_MODULES_PATTERN);
|
||||
if (index < 0) {
|
||||
continue;
|
||||
}
|
||||
let nextSlashIndex = file.indexOf(path.sep, index + fileTransformer_1.NODE_MODULES_PATTERN.length + 1);
|
||||
if (nextSlashIndex < 0) {
|
||||
continue;
|
||||
}
|
||||
if (file[index + fileTransformer_1.NODE_MODULES_PATTERN.length] === "@") {
|
||||
nextSlashIndex = file.indexOf(path.sep, nextSlashIndex + 1);
|
||||
}
|
||||
if (!metadata.get(file).isFile()) {
|
||||
continue;
|
||||
}
|
||||
const packageDir = file.substring(0, nextSlashIndex);
|
||||
const packageDirPathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, appFileCopier_1.getDestinationPath)(packageDir, fileSet));
|
||||
const pathInArchive = path.relative(rootForAppFilesWithoutAsar, (0, appFileCopier_1.getDestinationPath)(file, fileSet));
|
||||
if (autoUnpackDirs.has(packageDirPathInArchive)) {
|
||||
// if package dir is unpacked, any file also unpacked
|
||||
addParents(pathInArchive, packageDirPathInArchive);
|
||||
continue;
|
||||
}
|
||||
// https://github.com/electron-userland/electron-builder/issues/2679
|
||||
let shouldUnpack = false;
|
||||
// ffprobe-static and ffmpeg-static are known packages to always unpack
|
||||
const moduleName = path.basename(packageDir);
|
||||
if (moduleName === "ffprobe-static" || moduleName === "ffmpeg-static" || isLibOrExe(file)) {
|
||||
shouldUnpack = true;
|
||||
}
|
||||
else if (!file.includes(".", nextSlashIndex)) {
|
||||
shouldUnpack = !!(0, isbinaryfile_1.isBinaryFileSync)(file);
|
||||
}
|
||||
if (!shouldUnpack) {
|
||||
continue;
|
||||
}
|
||||
if (builder_util_1.log.isDebugEnabled) {
|
||||
builder_util_1.log.debug({ file: pathInArchive, reason: "contains executable code" }, "not packed into asar archive");
|
||||
}
|
||||
addParents(pathInArchive, packageDirPathInArchive);
|
||||
}
|
||||
if (dirToCreate.size > 0) {
|
||||
await (0, fs_extra_1.mkdir)(`${unpackedDest + path.sep}node_modules`, { recursive: true });
|
||||
// child directories should be not created asynchronously - parent directories should be created first
|
||||
await bluebird_lst_1.default.map(dirToCreate.keys(), async (parentDir) => {
|
||||
const base = unpackedDest + path.sep + parentDir;
|
||||
await (0, fs_extra_1.mkdir)(base, { recursive: true });
|
||||
await bluebird_lst_1.default.each(dirToCreate.get(parentDir), (it) => {
|
||||
if (dirToCreate.has(parentDir + path.sep + it)) {
|
||||
// already created
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
return (0, fs_extra_1.mkdir)(base + path.sep + it, { recursive: true });
|
||||
}
|
||||
});
|
||||
}, fs_1.CONCURRENCY);
|
||||
}
|
||||
}
|
||||
exports.detectUnpackedDirs = detectUnpackedDirs;
|
||||
//# sourceMappingURL=unpackDetector.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/asar/unpackDetector.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
4
mc_test/node_modules/app-builder-lib/out/binDownload.d.ts
generated
vendored
Executable file
4
mc_test/node_modules/app-builder-lib/out/binDownload.d.ts
generated
vendored
Executable file
@ -0,0 +1,4 @@
|
||||
export declare function download(url: string, output: string, checksum?: string | null): Promise<void>;
|
||||
export declare function getBinFromCustomLoc(name: string, version: string, binariesLocUrl: string, checksum: string): Promise<string>;
|
||||
export declare function getBinFromUrl(name: string, version: string, checksum: string): Promise<string>;
|
||||
export declare function getBin(name: string, url?: string | null, checksum?: string | null): Promise<string>;
|
||||
64
mc_test/node_modules/app-builder-lib/out/binDownload.js
generated
vendored
Executable file
64
mc_test/node_modules/app-builder-lib/out/binDownload.js
generated
vendored
Executable file
@ -0,0 +1,64 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getBin = exports.getBinFromUrl = exports.getBinFromCustomLoc = exports.download = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const versionToPromise = new Map();
|
||||
function download(url, output, checksum) {
|
||||
const args = ["download", "--url", url, "--output", output];
|
||||
if (checksum != null) {
|
||||
args.push("--sha512", checksum);
|
||||
}
|
||||
return (0, builder_util_1.executeAppBuilder)(args);
|
||||
}
|
||||
exports.download = download;
|
||||
function getBinFromCustomLoc(name, version, binariesLocUrl, checksum) {
|
||||
const dirName = `${name}-${version}`;
|
||||
return getBin(dirName, binariesLocUrl, checksum);
|
||||
}
|
||||
exports.getBinFromCustomLoc = getBinFromCustomLoc;
|
||||
function getBinFromUrl(name, version, checksum) {
|
||||
const dirName = `${name}-${version}`;
|
||||
let url;
|
||||
if (process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL) {
|
||||
url = process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL + "/" + dirName + ".7z";
|
||||
}
|
||||
else {
|
||||
const baseUrl = process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR ||
|
||||
process.env.npm_config_electron_builder_binaries_mirror ||
|
||||
process.env.npm_package_config_electron_builder_binaries_mirror ||
|
||||
process.env.ELECTRON_BUILDER_BINARIES_MIRROR ||
|
||||
"https://github.com/electron-userland/electron-builder-binaries/releases/download/";
|
||||
const middleUrl = process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||
|
||||
process.env.npm_config_electron_builder_binaries_custom_dir ||
|
||||
process.env.npm_package_config_electron_builder_binaries_custom_dir ||
|
||||
process.env.ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||
|
||||
dirName;
|
||||
const urlSuffix = dirName + ".7z";
|
||||
url = `${baseUrl}${middleUrl}/${urlSuffix}`;
|
||||
}
|
||||
return getBin(dirName, url, checksum);
|
||||
}
|
||||
exports.getBinFromUrl = getBinFromUrl;
|
||||
function getBin(name, url, checksum) {
|
||||
// Old cache is ignored if cache environment variable changes
|
||||
const cacheName = `${process.env.ELECTRON_BUILDER_CACHE}${name}`;
|
||||
let promise = versionToPromise.get(cacheName); // if rejected, we will try to download again
|
||||
if (promise != null) {
|
||||
return promise;
|
||||
}
|
||||
promise = doGetBin(name, url, checksum);
|
||||
versionToPromise.set(cacheName, promise);
|
||||
return promise;
|
||||
}
|
||||
exports.getBin = getBin;
|
||||
function doGetBin(name, url, checksum) {
|
||||
const args = ["download-artifact", "--name", name];
|
||||
if (url != null) {
|
||||
args.push("--url", url);
|
||||
}
|
||||
if (checksum != null) {
|
||||
args.push("--sha512", checksum);
|
||||
}
|
||||
return (0, builder_util_1.executeAppBuilder)(args);
|
||||
}
|
||||
//# sourceMappingURL=binDownload.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/binDownload.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/binDownload.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"binDownload.js","sourceRoot":"","sources":["../src/binDownload.ts"],"names":[],"mappings":";;;AAAA,+CAAgD;AAEhD,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA2B,CAAA;AAE3D,SAAgB,QAAQ,CAAC,GAAW,EAAE,MAAc,EAAE,QAAwB;IAC5E,MAAM,IAAI,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,CAAA;IAC3D,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,IAAA,gCAAiB,EAAC,IAAI,CAAiB,CAAA;AAChD,CAAC;AAND,4BAMC;AAED,SAAgB,mBAAmB,CAAC,IAAY,EAAE,OAAe,EAAE,cAAsB,EAAE,QAAgB;IACzG,MAAM,OAAO,GAAG,GAAG,IAAI,IAAI,OAAO,EAAE,CAAA;IACpC,OAAO,MAAM,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAA;AAClD,CAAC;AAHD,kDAGC;AAED,SAAgB,aAAa,CAAC,IAAY,EAAE,OAAe,EAAE,QAAgB;IAC3E,MAAM,OAAO,GAAG,GAAG,IAAI,IAAI,OAAO,EAAE,CAAA;IACpC,IAAI,GAAW,CAAA;IACf,IAAI,OAAO,CAAC,GAAG,CAAC,+CAA+C,EAAE,CAAC;QAChE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,+CAA+C,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAA;IAC3F,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GACX,OAAO,CAAC,GAAG,CAAC,2CAA2C;YACvD,OAAO,CAAC,GAAG,CAAC,2CAA2C;YACvD,OAAO,CAAC,GAAG,CAAC,mDAAmD;YAC/D,OAAO,CAAC,GAAG,CAAC,gCAAgC;YAC5C,mFAAmF,CAAA;QACrF,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,+CAA+C;YAC3D,OAAO,CAAC,GAAG,CAAC,+CAA+C;YAC3D,OAAO,CAAC,GAAG,CAAC,uDAAuD;YACnE,OAAO,CAAC,GAAG,CAAC,oCAAoC;YAChD,OAAO,CAAA;QACT,MAAM,SAAS,GAAG,OAAO,GAAG,KAAK,CAAA;QACjC,GAAG,GAAG,GAAG,OAAO,GAAG,SAAS,IAAI,SAAS,EAAE,CAAA;IAC7C,CAAC;IAED,OAAO,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;AACvC,CAAC;AAvBD,sCAuBC;AAED,SAAgB,MAAM,CAAC,IAAY,EAAE,GAAmB,EAAE,QAAwB;IAChF,6DAA6D;IAC7D,MAAM,SAAS,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,IAAI,EAAE,CAAA;IAChE,IAAI,OAAO,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA,CAAC,6CAA6C;IAE3F,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,OAAO,GAAG,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IACvC,gBAAgB,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IACxC,OAAO,OAAO,CAAA;AAChB,CAAC;AAZD,wBAYC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,GAA8B,EAAE,QAAmC;IACjG,MAAM,IAAI,GAAG,CAAC,mBAAmB,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAClD,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QAChB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACzB,CAAC;IACD,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IACjC,CAAC;IACD,OAAO,IAAA,gCAAiB,EAAC,IAAI,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\n\nconst versionToPromise = new Map<string, Promise<string>>()\n\nexport function download(url: string, output: string, checksum?: string | null): Promise<void> {\n const args = [\"download\", \"--url\", url, \"--output\", output]\n if (checksum != null) {\n args.push(\"--sha512\", checksum)\n }\n return executeAppBuilder(args) as Promise<any>\n}\n\nexport function getBinFromCustomLoc(name: string, version: string, binariesLocUrl: string, checksum: string): Promise<string> {\n const dirName = `${name}-${version}`\n return getBin(dirName, binariesLocUrl, checksum)\n}\n\nexport function getBinFromUrl(name: string, version: string, checksum: string): Promise<string> {\n const dirName = `${name}-${version}`\n let url: string\n if (process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL) {\n url = process.env.ELECTRON_BUILDER_BINARIES_DOWNLOAD_OVERRIDE_URL + \"/\" + dirName + \".7z\"\n } else {\n const baseUrl =\n process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_MIRROR ||\n process.env.npm_config_electron_builder_binaries_mirror ||\n process.env.npm_package_config_electron_builder_binaries_mirror ||\n process.env.ELECTRON_BUILDER_BINARIES_MIRROR ||\n \"https://github.com/electron-userland/electron-builder-binaries/releases/download/\"\n const middleUrl =\n process.env.NPM_CONFIG_ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||\n process.env.npm_config_electron_builder_binaries_custom_dir ||\n process.env.npm_package_config_electron_builder_binaries_custom_dir ||\n process.env.ELECTRON_BUILDER_BINARIES_CUSTOM_DIR ||\n dirName\n const urlSuffix = dirName + \".7z\"\n url = `${baseUrl}${middleUrl}/${urlSuffix}`\n }\n\n return getBin(dirName, url, checksum)\n}\n\nexport function getBin(name: string, url?: string | null, checksum?: string | null): Promise<string> {\n // Old cache is ignored if cache environment variable changes\n const cacheName = `${process.env.ELECTRON_BUILDER_CACHE}${name}`\n let promise = versionToPromise.get(cacheName) // if rejected, we will try to download again\n\n if (promise != null) {\n return promise\n }\n\n promise = doGetBin(name, url, checksum)\n versionToPromise.set(cacheName, promise)\n return promise\n}\n\nfunction doGetBin(name: string, url: string | undefined | null, checksum: string | null | undefined): Promise<string> {\n const args = [\"download-artifact\", \"--name\", name]\n if (url != null) {\n args.push(\"--url\", url)\n }\n if (checksum != null) {\n args.push(\"--sha512\", checksum)\n }\n return executeAppBuilder(args)\n}\n"]}
|
||||
3
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.d.ts
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.d.ts
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
import { TmpDir } from "temp-file";
|
||||
/** @private */
|
||||
export declare function importCertificate(cscLink: string, tmpDir: TmpDir, currentDir: string): Promise<string>;
|
||||
51
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.js
generated
vendored
Executable file
51
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.js
generated
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.importCertificate = void 0;
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const os_1 = require("os");
|
||||
const path = require("path");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const binDownload_1 = require("../binDownload");
|
||||
/** @private */
|
||||
async function importCertificate(cscLink, tmpDir, currentDir) {
|
||||
var _a, _b;
|
||||
cscLink = cscLink.trim();
|
||||
let file = null;
|
||||
if ((cscLink.length > 3 && cscLink[1] === ":") || cscLink.startsWith("/") || cscLink.startsWith(".")) {
|
||||
file = cscLink;
|
||||
}
|
||||
else if (cscLink.startsWith("file://")) {
|
||||
file = cscLink.substring("file://".length);
|
||||
}
|
||||
else if (cscLink.startsWith("~/")) {
|
||||
file = path.join((0, os_1.homedir)(), cscLink.substring("~/".length));
|
||||
}
|
||||
else if (cscLink.startsWith("https://")) {
|
||||
const tempFile = await tmpDir.getTempFile({ suffix: ".p12" });
|
||||
await (0, binDownload_1.download)(cscLink, tempFile);
|
||||
return tempFile;
|
||||
}
|
||||
else {
|
||||
const mimeType = (_a = /data:.*;base64,/.exec(cscLink)) === null || _a === void 0 ? void 0 : _a[0];
|
||||
if (mimeType || cscLink.length > 2048 || cscLink.endsWith("=")) {
|
||||
const tempFile = await tmpDir.getTempFile({ suffix: ".p12" });
|
||||
await (0, fs_extra_1.outputFile)(tempFile, Buffer.from(cscLink.substring((_b = mimeType === null || mimeType === void 0 ? void 0 : mimeType.length) !== null && _b !== void 0 ? _b : 0), "base64"));
|
||||
return tempFile;
|
||||
}
|
||||
file = cscLink;
|
||||
}
|
||||
file = path.resolve(currentDir, file);
|
||||
const stat = await (0, fs_1.statOrNull)(file);
|
||||
if (stat == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`${file} doesn't exist`);
|
||||
}
|
||||
else if (!stat.isFile()) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`${file} not a file`);
|
||||
}
|
||||
else {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
exports.importCertificate = importCertificate;
|
||||
//# sourceMappingURL=codesign.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/codeSign/codesign.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"codesign.js","sourceRoot":"","sources":["../../src/codeSign/codesign.ts"],"names":[],"mappings":";;;AAAA,uCAAqC;AACrC,2BAA4B;AAC5B,6BAA4B;AAE5B,+CAAwD;AACxD,4CAAgD;AAChD,gDAAyC;AAEzC,eAAe;AACR,KAAK,UAAU,iBAAiB,CAAC,OAAe,EAAE,MAAc,EAAE,UAAkB;;IACzF,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAA;IAExB,IAAI,IAAI,GAAkB,IAAI,CAAA;IAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrG,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;SAAM,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACzC,IAAI,GAAG,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;SAAM,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACpC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,YAAO,GAAE,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAC7D,CAAC;SAAM,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,MAAM,IAAA,sBAAQ,EAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QACjC,OAAO,QAAQ,CAAA;IACjB,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAG,MAAA,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,0CAAG,CAAC,CAAC,CAAA;QACrD,IAAI,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;YAC7D,MAAM,IAAA,qBAAU,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,mCAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAA;YAC3F,OAAO,QAAQ,CAAA;QACjB,CAAC;QACD,IAAI,GAAG,OAAO,CAAA;IAChB,CAAC;IAED,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAA;IACrC,MAAM,IAAI,GAAG,MAAM,IAAA,eAAU,EAAC,IAAI,CAAC,CAAA;IACnC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,wCAAyB,CAAC,GAAG,IAAI,gBAAgB,CAAC,CAAA;IAC9D,CAAC;SAAM,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC;QAC1B,MAAM,IAAI,wCAAyB,CAAC,GAAG,IAAI,aAAa,CAAC,CAAA;IAC3D,CAAC;SAAM,CAAC;QACN,OAAO,IAAI,CAAA;IACb,CAAC;AACH,CAAC;AAjCD,8CAiCC","sourcesContent":["import { outputFile } from \"fs-extra\"\nimport { homedir } from \"os\"\nimport * as path from \"path\"\nimport { TmpDir } from \"temp-file\"\nimport { InvalidConfigurationError } from \"builder-util\"\nimport { statOrNull } from \"builder-util/out/fs\"\nimport { download } from \"../binDownload\"\n\n/** @private */\nexport async function importCertificate(cscLink: string, tmpDir: TmpDir, currentDir: string): Promise<string> {\n cscLink = cscLink.trim()\n\n let file: string | null = null\n if ((cscLink.length > 3 && cscLink[1] === \":\") || cscLink.startsWith(\"/\") || cscLink.startsWith(\".\")) {\n file = cscLink\n } else if (cscLink.startsWith(\"file://\")) {\n file = cscLink.substring(\"file://\".length)\n } else if (cscLink.startsWith(\"~/\")) {\n file = path.join(homedir(), cscLink.substring(\"~/\".length))\n } else if (cscLink.startsWith(\"https://\")) {\n const tempFile = await tmpDir.getTempFile({ suffix: \".p12\" })\n await download(cscLink, tempFile)\n return tempFile\n } else {\n const mimeType = /data:.*;base64,/.exec(cscLink)?.[0]\n if (mimeType || cscLink.length > 2048 || cscLink.endsWith(\"=\")) {\n const tempFile = await tmpDir.getTempFile({ suffix: \".p12\" })\n await outputFile(tempFile, Buffer.from(cscLink.substring(mimeType?.length ?? 0), \"base64\"))\n return tempFile\n }\n file = cscLink\n }\n\n file = path.resolve(currentDir, file)\n const stat = await statOrNull(file)\n if (stat == null) {\n throw new InvalidConfigurationError(`${file} doesn't exist`)\n } else if (!stat.isFile()) {\n throw new InvalidConfigurationError(`${file} not a file`)\n } else {\n return file\n }\n}\n"]}
|
||||
27
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.d.ts
generated
vendored
Executable file
27
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.d.ts
generated
vendored
Executable file
@ -0,0 +1,27 @@
|
||||
import { TmpDir } from "builder-util/out/util";
|
||||
export declare const appleCertificatePrefixes: string[];
|
||||
export type CertType = "Developer ID Application" | "Developer ID Installer" | "3rd Party Mac Developer Application" | "3rd Party Mac Developer Installer" | "Mac Developer" | "Apple Development" | "Apple Distribution";
|
||||
export interface CodeSigningInfo {
|
||||
keychainFile?: string | null;
|
||||
}
|
||||
export declare function isSignAllowed(isPrintWarn?: boolean): boolean;
|
||||
export declare function reportError(isMas: boolean, certificateTypes: CertType[], qualifier: string | null | undefined, keychainFile: string | null | undefined, isForceCodeSigning: boolean): Promise<void>;
|
||||
export interface CreateKeychainOptions {
|
||||
tmpDir: TmpDir;
|
||||
cscLink: string;
|
||||
cscKeyPassword: string;
|
||||
cscILink?: string | null;
|
||||
cscIKeyPassword?: string | null;
|
||||
currentDir: string;
|
||||
}
|
||||
export declare function removeKeychain(keychainFile: string, printWarn?: boolean): Promise<any>;
|
||||
export declare function createKeychain({ tmpDir, cscLink, cscKeyPassword, cscILink, cscIKeyPassword, currentDir }: CreateKeychainOptions): Promise<CodeSigningInfo>;
|
||||
/** @private */
|
||||
export declare function sign(path: string, name: string, keychain: string): Promise<any>;
|
||||
export declare let findIdentityRawResult: Promise<Array<string>> | null;
|
||||
export declare class Identity {
|
||||
readonly name: string;
|
||||
readonly hash?: string;
|
||||
constructor(name: string, hash?: string);
|
||||
}
|
||||
export declare function findIdentity(certType: CertType, qualifier?: string | null, keychain?: string | null): Promise<Identity | null>;
|
||||
280
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.js
generated
vendored
Executable file
280
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.js
generated
vendored
Executable file
@ -0,0 +1,280 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findIdentity = exports.findIdentityRawResult = exports.sign = exports.createKeychain = exports.removeKeychain = exports.reportError = exports.isSignAllowed = exports.appleCertificatePrefixes = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const util_1 = require("builder-util/out/util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const log_1 = require("builder-util/out/log");
|
||||
const crypto_1 = require("crypto");
|
||||
const promises_1 = require("fs/promises");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const os_1 = require("os");
|
||||
const path = require("path");
|
||||
const temp_file_1 = require("temp-file");
|
||||
const flags_1 = require("../util/flags");
|
||||
const codesign_1 = require("./codesign");
|
||||
const util_identities_1 = require("@electron/osx-sign/dist/cjs/util-identities");
|
||||
exports.appleCertificatePrefixes = ["Developer ID Application:", "Developer ID Installer:", "3rd Party Mac Developer Application:", "3rd Party Mac Developer Installer:"];
|
||||
function isSignAllowed(isPrintWarn = true) {
|
||||
if (process.platform !== "darwin") {
|
||||
if (isPrintWarn) {
|
||||
util_1.log.warn({ reason: "supported only on macOS" }, "skipped macOS application code signing");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
const buildForPrWarning = "There are serious security concerns with CSC_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.";
|
||||
if ((0, util_1.isPullRequest)()) {
|
||||
if ((0, util_1.isEnvTrue)(process.env.CSC_FOR_PULL_REQUEST)) {
|
||||
if (isPrintWarn) {
|
||||
util_1.log.warn(buildForPrWarning);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isPrintWarn) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/1524
|
||||
util_1.log.warn("Current build is a part of pull request, code signing will be skipped." + "\nSet env CSC_FOR_PULL_REQUEST to true to force code signing." + `\n${buildForPrWarning}`);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.isSignAllowed = isSignAllowed;
|
||||
async function reportError(isMas, certificateTypes, qualifier, keychainFile, isForceCodeSigning) {
|
||||
const logFields = {};
|
||||
if (qualifier == null) {
|
||||
logFields.reason = "";
|
||||
if ((0, flags_1.isAutoDiscoveryCodeSignIdentity)()) {
|
||||
logFields.reason += `cannot find valid "${certificateTypes.join(", ")}" identity${isMas ? "" : ` or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible`}`;
|
||||
}
|
||||
logFields.reason += ", see https://electron.build/code-signing";
|
||||
if (!(0, flags_1.isAutoDiscoveryCodeSignIdentity)()) {
|
||||
logFields.CSC_IDENTITY_AUTO_DISCOVERY = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
logFields.reason = "Identity name is specified, but no valid identity with this name in the keychain";
|
||||
logFields.identity = qualifier;
|
||||
}
|
||||
const args = ["find-identity"];
|
||||
if (keychainFile != null) {
|
||||
args.push(keychainFile);
|
||||
}
|
||||
if (qualifier != null || (0, flags_1.isAutoDiscoveryCodeSignIdentity)()) {
|
||||
logFields.allIdentities = (await (0, util_1.exec)("/usr/bin/security", args))
|
||||
.trim()
|
||||
.split("\n")
|
||||
.filter(it => !(it.includes("Policy: X.509 Basic") || it.includes("Matching identities")))
|
||||
.join("\n");
|
||||
}
|
||||
if (isMas || isForceCodeSigning) {
|
||||
throw new Error(log_1.Logger.createMessage("skipped macOS application code signing", logFields, "error", it => it));
|
||||
}
|
||||
else {
|
||||
util_1.log.warn(logFields, "skipped macOS application code signing");
|
||||
}
|
||||
}
|
||||
exports.reportError = reportError;
|
||||
// "Note that filename will not be searched to resolve the signing identity's certificate chain unless it is also on the user's keychain search list."
|
||||
// but "security list-keychains" doesn't support add - we should 1) get current list 2) set new list - it is very bad http://stackoverflow.com/questions/10538942/add-a-keychain-to-search-list
|
||||
// "overly complicated and introduces a race condition."
|
||||
// https://github.com/electron-userland/electron-builder/issues/398
|
||||
const bundledCertKeychainAdded = new lazy_val_1.Lazy(async () => {
|
||||
// copy to temp and then atomic rename to final path
|
||||
const cacheDir = getCacheDirectory();
|
||||
const tmpKeychainPath = path.join(cacheDir, (0, temp_file_1.getTempName)("electron-builder-root-certs"));
|
||||
const keychainPath = path.join(cacheDir, "electron-builder-root-certs.keychain");
|
||||
const results = await Promise.all([
|
||||
listUserKeychains(),
|
||||
(0, fs_1.copyFile)(path.join(__dirname, "..", "..", "certs", "root_certs.keychain"), tmpKeychainPath).then(() => (0, promises_1.rename)(tmpKeychainPath, keychainPath)),
|
||||
]);
|
||||
const list = results[0];
|
||||
if (!list.includes(keychainPath)) {
|
||||
await (0, util_1.exec)("/usr/bin/security", ["list-keychains", "-d", "user", "-s", keychainPath].concat(list));
|
||||
}
|
||||
});
|
||||
function getCacheDirectory() {
|
||||
const env = process.env.ELECTRON_BUILDER_CACHE;
|
||||
return (0, util_1.isEmptyOrSpaces)(env) ? path.join((0, os_1.homedir)(), "Library", "Caches", "electron-builder") : path.resolve(env);
|
||||
}
|
||||
function listUserKeychains() {
|
||||
return (0, util_1.exec)("/usr/bin/security", ["list-keychains", "-d", "user"]).then(it => it
|
||||
.split("\n")
|
||||
.map(it => {
|
||||
const r = it.trim();
|
||||
return r.substring(1, r.length - 1);
|
||||
})
|
||||
.filter(it => it.length > 0));
|
||||
}
|
||||
function removeKeychain(keychainFile, printWarn = true) {
|
||||
return (0, util_1.exec)("/usr/bin/security", ["delete-keychain", keychainFile]).catch((e) => {
|
||||
if (printWarn) {
|
||||
util_1.log.warn({ file: keychainFile, error: e.stack || e }, "cannot delete keychain");
|
||||
}
|
||||
return (0, fs_1.unlinkIfExists)(keychainFile);
|
||||
});
|
||||
}
|
||||
exports.removeKeychain = removeKeychain;
|
||||
async function createKeychain({ tmpDir, cscLink, cscKeyPassword, cscILink, cscIKeyPassword, currentDir }) {
|
||||
// travis has correct AppleWWDRCA cert
|
||||
if (process.env.TRAVIS !== "true") {
|
||||
await bundledCertKeychainAdded.value;
|
||||
}
|
||||
// https://github.com/electron-userland/electron-builder/issues/3685
|
||||
// use constant file
|
||||
const keychainFile = path.join(process.env.APP_BUILDER_TMP_DIR || (0, os_1.tmpdir)(), `${(0, crypto_1.createHash)("sha256").update(currentDir).update("app-builder").digest("hex")}.keychain`);
|
||||
// noinspection JSUnusedLocalSymbols
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
await removeKeychain(keychainFile, false).catch(_ => {
|
||||
/* ignore*/
|
||||
});
|
||||
const certLinks = [cscLink];
|
||||
if (cscILink != null) {
|
||||
certLinks.push(cscILink);
|
||||
}
|
||||
const certPaths = new Array(certLinks.length);
|
||||
const keychainPassword = (0, crypto_1.randomBytes)(32).toString("base64");
|
||||
const securityCommands = [
|
||||
["create-keychain", "-p", keychainPassword, keychainFile],
|
||||
["unlock-keychain", "-p", keychainPassword, keychainFile],
|
||||
["set-keychain-settings", keychainFile],
|
||||
];
|
||||
// https://stackoverflow.com/questions/42484678/codesign-keychain-gets-ignored
|
||||
// https://github.com/electron-userland/electron-builder/issues/1457
|
||||
const list = await listUserKeychains();
|
||||
if (!list.includes(keychainFile)) {
|
||||
securityCommands.push(["list-keychains", "-d", "user", "-s", keychainFile].concat(list));
|
||||
}
|
||||
await Promise.all([
|
||||
// we do not clear downloaded files - will be removed on tmpDir cleanup automatically. not a security issue since in any case data is available as env variables and protected by password.
|
||||
bluebird_lst_1.default.map(certLinks, (link, i) => (0, codesign_1.importCertificate)(link, tmpDir, currentDir).then(it => (certPaths[i] = it))),
|
||||
bluebird_lst_1.default.mapSeries(securityCommands, it => (0, util_1.exec)("/usr/bin/security", it)),
|
||||
]);
|
||||
return await importCerts(keychainFile, certPaths, [cscKeyPassword, cscIKeyPassword].filter(it => it != null));
|
||||
}
|
||||
exports.createKeychain = createKeychain;
|
||||
async function importCerts(keychainFile, paths, keyPasswords) {
|
||||
for (let i = 0; i < paths.length; i++) {
|
||||
const password = keyPasswords[i];
|
||||
await (0, util_1.exec)("/usr/bin/security", ["import", paths[i], "-k", keychainFile, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", password]);
|
||||
// https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p
|
||||
// https://github.com/electron-userland/electron-packager/issues/701#issuecomment-322315996
|
||||
await (0, util_1.exec)("/usr/bin/security", ["set-key-partition-list", "-S", "apple-tool:,apple:", "-s", "-k", password, keychainFile]);
|
||||
}
|
||||
return {
|
||||
keychainFile,
|
||||
};
|
||||
}
|
||||
/** @private */
|
||||
function sign(path, name, keychain) {
|
||||
const args = ["--deep", "--force", "--sign", name, path];
|
||||
if (keychain != null) {
|
||||
args.push("--keychain", keychain);
|
||||
}
|
||||
return (0, util_1.exec)("/usr/bin/codesign", args);
|
||||
}
|
||||
exports.sign = sign;
|
||||
exports.findIdentityRawResult = null;
|
||||
async function getValidIdentities(keychain) {
|
||||
function addKeychain(args) {
|
||||
if (keychain != null) {
|
||||
args.push(keychain);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
let result = exports.findIdentityRawResult;
|
||||
if (result == null || keychain != null) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/481
|
||||
// https://github.com/electron-userland/electron-builder/issues/535
|
||||
result = Promise.all([
|
||||
(0, util_1.exec)("/usr/bin/security", addKeychain(["find-identity", "-v"])).then(it => it
|
||||
.trim()
|
||||
.split("\n")
|
||||
.filter(it => {
|
||||
for (const prefix of exports.appleCertificatePrefixes) {
|
||||
if (it.includes(prefix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
})),
|
||||
(0, util_1.exec)("/usr/bin/security", addKeychain(["find-identity", "-v", "-p", "codesigning"])).then(it => it.trim().split("\n")),
|
||||
]).then(it => {
|
||||
const array = it[0]
|
||||
.concat(it[1])
|
||||
.filter(it => !it.includes("(Missing required extension)") && !it.includes("valid identities found") && !it.includes("iPhone ") && !it.includes("com.apple.idms.appleid.prd."))
|
||||
// remove 1)
|
||||
.map(it => it.substring(it.indexOf(")") + 1).trim());
|
||||
return Array.from(new Set(array));
|
||||
});
|
||||
if (keychain == null) {
|
||||
exports.findIdentityRawResult = result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async function _findIdentity(type, qualifier, keychain) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/484
|
||||
//noinspection SpellCheckingInspection
|
||||
const lines = await getValidIdentities(keychain);
|
||||
const namePrefix = `${type}:`;
|
||||
for (const line of lines) {
|
||||
if (qualifier != null && !line.includes(qualifier)) {
|
||||
continue;
|
||||
}
|
||||
if (line.includes(namePrefix)) {
|
||||
return parseIdentity(line);
|
||||
}
|
||||
}
|
||||
if (type === "Developer ID Application") {
|
||||
// find non-Apple certificate
|
||||
// https://github.com/electron-userland/electron-builder/issues/458
|
||||
l: for (const line of lines) {
|
||||
if (qualifier != null && !line.includes(qualifier)) {
|
||||
continue;
|
||||
}
|
||||
if (line.includes("Mac Developer:")) {
|
||||
continue;
|
||||
}
|
||||
for (const prefix of exports.appleCertificatePrefixes) {
|
||||
if (line.includes(prefix)) {
|
||||
continue l;
|
||||
}
|
||||
}
|
||||
return parseIdentity(line);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function parseIdentity(line) {
|
||||
const firstQuoteIndex = line.indexOf('"');
|
||||
const name = line.substring(firstQuoteIndex + 1, line.lastIndexOf('"'));
|
||||
const hash = line.substring(0, firstQuoteIndex - 1);
|
||||
return new util_identities_1.Identity(name, hash);
|
||||
}
|
||||
function findIdentity(certType, qualifier, keychain) {
|
||||
let identity = qualifier || process.env.CSC_NAME;
|
||||
if ((0, util_1.isEmptyOrSpaces)(identity)) {
|
||||
if ((0, flags_1.isAutoDiscoveryCodeSignIdentity)()) {
|
||||
return _findIdentity(certType, null, keychain);
|
||||
}
|
||||
else {
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
identity = identity.trim();
|
||||
for (const prefix of exports.appleCertificatePrefixes) {
|
||||
checkPrefix(identity, prefix);
|
||||
}
|
||||
return _findIdentity(certType, identity, keychain);
|
||||
}
|
||||
}
|
||||
exports.findIdentity = findIdentity;
|
||||
function checkPrefix(name, prefix) {
|
||||
if (name.startsWith(prefix)) {
|
||||
throw new util_1.InvalidConfigurationError(`Please remove prefix "${prefix}" from the specified name — appropriate certificate will be chosen automatically`);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=macCodeSign.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/codeSign/macCodeSign.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
38
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.d.ts
generated
vendored
Executable file
38
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.d.ts
generated
vendored
Executable file
@ -0,0 +1,38 @@
|
||||
import { WindowsConfiguration } from "../options/winOptions";
|
||||
import { VmManager } from "../vm/vm";
|
||||
import { WinPackager } from "../winPackager";
|
||||
export declare function getSignVendorPath(): Promise<string>;
|
||||
export type CustomWindowsSign = (configuration: CustomWindowsSignTaskConfiguration, packager?: WinPackager) => Promise<any>;
|
||||
export interface WindowsSignOptions {
|
||||
readonly path: string;
|
||||
readonly name?: string | null;
|
||||
readonly cscInfo?: FileCodeSigningInfo | CertificateFromStoreInfo | null;
|
||||
readonly site?: string | null;
|
||||
readonly options: WindowsConfiguration;
|
||||
}
|
||||
export interface WindowsSignTaskConfiguration extends WindowsSignOptions {
|
||||
resultOutputPath?: string;
|
||||
hash: string;
|
||||
isNest: boolean;
|
||||
}
|
||||
export interface CustomWindowsSignTaskConfiguration extends WindowsSignTaskConfiguration {
|
||||
computeSignToolArgs(isWin: boolean): Array<string>;
|
||||
}
|
||||
export declare function sign(options: WindowsSignOptions, packager: WinPackager): Promise<boolean>;
|
||||
export interface FileCodeSigningInfo {
|
||||
readonly file: string;
|
||||
readonly password: string | null;
|
||||
}
|
||||
export declare function getCertInfo(file: string, password: string): Promise<CertificateInfo>;
|
||||
export interface CertificateInfo {
|
||||
readonly commonName: string;
|
||||
readonly bloodyMicrosoftSubjectDn: string;
|
||||
}
|
||||
export interface CertificateFromStoreInfo {
|
||||
thumbprint: string;
|
||||
subject: string;
|
||||
store: string;
|
||||
isLocalMachineStore: boolean;
|
||||
}
|
||||
export declare function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo>;
|
||||
export declare function doSign(configuration: CustomWindowsSignTaskConfiguration, packager: WinPackager): Promise<void>;
|
||||
253
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js
generated
vendored
Executable file
253
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js
generated
vendored
Executable file
@ -0,0 +1,253 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isOldWin6 = exports.doSign = exports.getCertificateFromStoreInfo = exports.getCertInfo = exports.sign = exports.getSignVendorPath = void 0;
|
||||
const util_1 = require("builder-util/out/util");
|
||||
const binDownload_1 = require("../binDownload");
|
||||
const appBuilder_1 = require("../util/appBuilder");
|
||||
const bundledTool_1 = require("../util/bundledTool");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const os = require("os");
|
||||
const path = require("path");
|
||||
const platformPackager_1 = require("../platformPackager");
|
||||
const flags_1 = require("../util/flags");
|
||||
const vm_1 = require("../vm/vm");
|
||||
function getSignVendorPath() {
|
||||
return (0, binDownload_1.getBin)("winCodeSign");
|
||||
}
|
||||
exports.getSignVendorPath = getSignVendorPath;
|
||||
async function sign(options, packager) {
|
||||
let hashes = options.options.signingHashAlgorithms;
|
||||
// msi does not support dual-signing
|
||||
if (options.path.endsWith(".msi")) {
|
||||
hashes = [hashes != null && !hashes.includes("sha1") ? "sha256" : "sha1"];
|
||||
}
|
||||
else if (options.path.endsWith(".appx")) {
|
||||
hashes = ["sha256"];
|
||||
}
|
||||
else if (hashes == null) {
|
||||
hashes = ["sha1", "sha256"];
|
||||
}
|
||||
else {
|
||||
hashes = Array.isArray(hashes) ? hashes : [hashes];
|
||||
}
|
||||
const executor = (await (0, platformPackager_1.resolveFunction)(packager.appInfo.type, options.options.sign, "sign")) || doSign;
|
||||
let isNest = false;
|
||||
for (const hash of hashes) {
|
||||
const taskConfiguration = { ...options, hash, isNest };
|
||||
await Promise.resolve(executor({
|
||||
...taskConfiguration,
|
||||
computeSignToolArgs: isWin => computeSignToolArgs(taskConfiguration, isWin),
|
||||
}, packager));
|
||||
isNest = true;
|
||||
if (taskConfiguration.resultOutputPath != null) {
|
||||
await (0, fs_extra_1.rename)(taskConfiguration.resultOutputPath, options.path);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
exports.sign = sign;
|
||||
async function getCertInfo(file, password) {
|
||||
let result = null;
|
||||
const errorMessagePrefix = "Cannot extract publisher name from code signing certificate. As workaround, set win.publisherName. Error: ";
|
||||
try {
|
||||
result = await (0, appBuilder_1.executeAppBuilderAsJson)(["certificate-info", "--input", file, "--password", password]);
|
||||
}
|
||||
catch (e) {
|
||||
throw new Error(`${errorMessagePrefix}${e.stack || e}`);
|
||||
}
|
||||
if (result.error != null) {
|
||||
// noinspection ExceptionCaughtLocallyJS
|
||||
throw new util_1.InvalidConfigurationError(`${errorMessagePrefix}${result.error}`);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
exports.getCertInfo = getCertInfo;
|
||||
async function getCertificateFromStoreInfo(options, vm) {
|
||||
const certificateSubjectName = options.certificateSubjectName;
|
||||
const certificateSha1 = options.certificateSha1 ? options.certificateSha1.toUpperCase() : options.certificateSha1;
|
||||
// ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok
|
||||
// powershell can return object if the only item
|
||||
const rawResult = await vm.exec("powershell.exe", [
|
||||
"-NoProfile",
|
||||
"-NonInteractive",
|
||||
"-Command",
|
||||
"Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress",
|
||||
]);
|
||||
const certList = rawResult.length === 0 ? [] : (0, util_1.asArray)(JSON.parse(rawResult));
|
||||
for (const certInfo of certList) {
|
||||
if ((certificateSubjectName != null && !certInfo.Subject.includes(certificateSubjectName)) ||
|
||||
(certificateSha1 != null && certInfo.Thumbprint.toUpperCase() !== certificateSha1)) {
|
||||
continue;
|
||||
}
|
||||
const parentPath = certInfo.PSParentPath;
|
||||
const store = parentPath.substring(parentPath.lastIndexOf("\\") + 1);
|
||||
util_1.log.debug({ store, PSParentPath: parentPath }, "auto-detect certificate store");
|
||||
// https://github.com/electron-userland/electron-builder/issues/1717
|
||||
const isLocalMachineStore = parentPath.includes("Certificate::LocalMachine");
|
||||
util_1.log.debug(null, "auto-detect using of LocalMachine store");
|
||||
return {
|
||||
thumbprint: certInfo.Thumbprint,
|
||||
subject: certInfo.Subject,
|
||||
store,
|
||||
isLocalMachineStore,
|
||||
};
|
||||
}
|
||||
throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`);
|
||||
}
|
||||
exports.getCertificateFromStoreInfo = getCertificateFromStoreInfo;
|
||||
async function doSign(configuration, packager) {
|
||||
// https://github.com/electron-userland/electron-builder/pull/1944
|
||||
const timeout = parseInt(process.env.SIGNTOOL_TIMEOUT, 10) || 10 * 60 * 1000;
|
||||
// decide runtime argument by cases
|
||||
let args;
|
||||
let env = process.env;
|
||||
let vm;
|
||||
const vmRequired = configuration.path.endsWith(".appx") || !("file" in configuration.cscInfo); /* certificateSubjectName and other such options */
|
||||
const isWin = process.platform === "win32" || vmRequired;
|
||||
const toolInfo = await getToolPath(isWin);
|
||||
const tool = toolInfo.path;
|
||||
if (vmRequired) {
|
||||
vm = await packager.vm.value;
|
||||
args = computeSignToolArgs(configuration, isWin, vm);
|
||||
}
|
||||
else {
|
||||
vm = new vm_1.VmManager();
|
||||
args = configuration.computeSignToolArgs(isWin);
|
||||
if (toolInfo.env != null) {
|
||||
env = toolInfo.env;
|
||||
}
|
||||
}
|
||||
try {
|
||||
await vm.exec(tool, args, { timeout, env });
|
||||
}
|
||||
catch (e) {
|
||||
if (e.message.includes("The file is being used by another process") || e.message.includes("The specified timestamp server either could not be reached")) {
|
||||
util_1.log.warn(`First attempt to code sign failed, another attempt will be made in 15 seconds: ${e.message}`);
|
||||
await new Promise((resolve, reject) => {
|
||||
setTimeout(() => {
|
||||
vm.exec(tool, args, { timeout, env }).then(resolve).catch(reject);
|
||||
}, 15000);
|
||||
});
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
exports.doSign = doSign;
|
||||
// on windows be aware of http://stackoverflow.com/a/32640183/1910191
|
||||
function computeSignToolArgs(options, isWin, vm = new vm_1.VmManager()) {
|
||||
const inputFile = vm.toVmFile(options.path);
|
||||
const outputPath = isWin ? inputFile : getOutputPath(inputFile, options.hash);
|
||||
if (!isWin) {
|
||||
options.resultOutputPath = outputPath;
|
||||
}
|
||||
const args = isWin ? ["sign"] : ["-in", inputFile, "-out", outputPath];
|
||||
if (process.env.ELECTRON_BUILDER_OFFLINE !== "true") {
|
||||
const timestampingServiceUrl = options.options.timeStampServer || "http://timestamp.digicert.com";
|
||||
if (isWin) {
|
||||
args.push(options.isNest || options.hash === "sha256" ? "/tr" : "/t", options.isNest || options.hash === "sha256" ? options.options.rfc3161TimeStampServer || "http://timestamp.digicert.com" : timestampingServiceUrl);
|
||||
}
|
||||
else {
|
||||
args.push("-t", timestampingServiceUrl);
|
||||
}
|
||||
}
|
||||
const certificateFile = options.cscInfo.file;
|
||||
if (certificateFile == null) {
|
||||
const cscInfo = options.cscInfo;
|
||||
const subjectName = cscInfo.thumbprint;
|
||||
if (!isWin) {
|
||||
throw new Error(`${subjectName == null ? "certificateSha1" : "certificateSubjectName"} supported only on Windows`);
|
||||
}
|
||||
args.push("/sha1", cscInfo.thumbprint);
|
||||
args.push("/s", cscInfo.store);
|
||||
if (cscInfo.isLocalMachineStore) {
|
||||
args.push("/sm");
|
||||
}
|
||||
}
|
||||
else {
|
||||
const certExtension = path.extname(certificateFile);
|
||||
if (certExtension === ".p12" || certExtension === ".pfx") {
|
||||
args.push(isWin ? "/f" : "-pkcs12", vm.toVmFile(certificateFile));
|
||||
}
|
||||
else {
|
||||
throw new Error(`Please specify pkcs12 (.p12/.pfx) file, ${certificateFile} is not correct`);
|
||||
}
|
||||
}
|
||||
if (!isWin || options.hash !== "sha1") {
|
||||
args.push(isWin ? "/fd" : "-h", options.hash);
|
||||
if (isWin && process.env.ELECTRON_BUILDER_OFFLINE !== "true") {
|
||||
args.push("/td", "sha256");
|
||||
}
|
||||
}
|
||||
if (options.name) {
|
||||
args.push(isWin ? "/d" : "-n", options.name);
|
||||
}
|
||||
if (options.site) {
|
||||
args.push(isWin ? "/du" : "-i", options.site);
|
||||
}
|
||||
// msi does not support dual-signing
|
||||
if (options.isNest) {
|
||||
args.push(isWin ? "/as" : "-nest");
|
||||
}
|
||||
const password = options.cscInfo == null ? null : options.cscInfo.password;
|
||||
if (password) {
|
||||
args.push(isWin ? "/p" : "-pass", password);
|
||||
}
|
||||
if (options.options.additionalCertificateFile) {
|
||||
args.push(isWin ? "/ac" : "-ac", vm.toVmFile(options.options.additionalCertificateFile));
|
||||
}
|
||||
const httpsProxyFromEnv = process.env.HTTPS_PROXY;
|
||||
if (!isWin && httpsProxyFromEnv != null && httpsProxyFromEnv.length) {
|
||||
args.push("-p", httpsProxyFromEnv);
|
||||
}
|
||||
if (isWin) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/2875#issuecomment-387233610
|
||||
args.push("/debug");
|
||||
// must be last argument
|
||||
args.push(inputFile);
|
||||
}
|
||||
return args;
|
||||
}
|
||||
function getOutputPath(inputPath, hash) {
|
||||
const extension = path.extname(inputPath);
|
||||
return path.join(path.dirname(inputPath), `${path.basename(inputPath, extension)}-signed-${hash}${extension}`);
|
||||
}
|
||||
/** @internal */
|
||||
function isOldWin6() {
|
||||
const winVersion = os.release();
|
||||
return winVersion.startsWith("6.") && !winVersion.startsWith("6.3");
|
||||
}
|
||||
exports.isOldWin6 = isOldWin6;
|
||||
function getWinSignTool(vendorPath) {
|
||||
// use modern signtool on Windows Server 2012 R2 to be able to sign AppX
|
||||
if (isOldWin6()) {
|
||||
return path.join(vendorPath, "windows-6", "signtool.exe");
|
||||
}
|
||||
else {
|
||||
return path.join(vendorPath, "windows-10", process.arch, "signtool.exe");
|
||||
}
|
||||
}
|
||||
async function getToolPath(isWin = process.platform === "win32") {
|
||||
if ((0, flags_1.isUseSystemSigncode)()) {
|
||||
return { path: "osslsigncode" };
|
||||
}
|
||||
const result = process.env.SIGNTOOL_PATH;
|
||||
if (result) {
|
||||
return { path: result };
|
||||
}
|
||||
const vendorPath = await getSignVendorPath();
|
||||
if (isWin) {
|
||||
// use modern signtool on Windows Server 2012 R2 to be able to sign AppX
|
||||
return { path: getWinSignTool(vendorPath) };
|
||||
}
|
||||
else if (process.platform === "darwin") {
|
||||
const toolDirPath = path.join(vendorPath, process.platform, "10.12");
|
||||
return {
|
||||
path: path.join(toolDirPath, "osslsigncode"),
|
||||
env: (0, bundledTool_1.computeToolEnv)([path.join(toolDirPath, "lib")]),
|
||||
};
|
||||
}
|
||||
else {
|
||||
return { path: path.join(vendorPath, process.platform, "osslsigncode") };
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=windowsCodeSign.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/codeSign/windowsCodeSign.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
276
mc_test/node_modules/app-builder-lib/out/configuration.d.ts
generated
vendored
Executable file
276
mc_test/node_modules/app-builder-lib/out/configuration.d.ts
generated
vendored
Executable file
@ -0,0 +1,276 @@
|
||||
import { Arch } from "builder-util";
|
||||
import { BeforeBuildContext, Target } from "./core";
|
||||
import { ElectronBrandingOptions, ElectronDownloadOptions } from "./electron/ElectronFramework";
|
||||
import { PrepareApplicationStageDirectoryOptions } from "./Framework";
|
||||
import { AppXOptions } from "./options/AppXOptions";
|
||||
import { AppImageOptions, DebOptions, FlatpakOptions, LinuxConfiguration, LinuxTargetSpecificOptions } from "./options/linuxOptions";
|
||||
import { DmgOptions, MacConfiguration, MasConfiguration } from "./options/macOptions";
|
||||
import { MsiOptions } from "./options/MsiOptions";
|
||||
import { MsiWrappedOptions } from "./options/MsiWrappedOptions";
|
||||
import { PkgOptions } from "./options/pkgOptions";
|
||||
import { PlatformSpecificBuildOptions } from "./options/PlatformSpecificBuildOptions";
|
||||
import { SnapOptions } from "./options/SnapOptions";
|
||||
import { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions";
|
||||
import { WindowsConfiguration } from "./options/winOptions";
|
||||
import { BuildResult } from "./packager";
|
||||
import { ArtifactBuildStarted, ArtifactCreated } from "./packagerApi";
|
||||
import { PlatformPackager } from "./platformPackager";
|
||||
import { NsisOptions, NsisWebOptions, PortableOptions } from "./targets/nsis/nsisOptions";
|
||||
/**
|
||||
* Configuration Options
|
||||
*/
|
||||
export interface Configuration extends PlatformSpecificBuildOptions {
|
||||
/**
|
||||
* The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as
|
||||
* [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
|
||||
* @default com.electron.${name}
|
||||
*/
|
||||
readonly appId?: string | null;
|
||||
/**
|
||||
* As [name](#Metadata-name), but allows you to specify a product name for your executable which contains spaces and other special characters not allowed in the [name property](https://docs.npmjs.com/files/package.json#name).
|
||||
* If not specified inside of the `build` configuration, `productName` property defined at the top level of `package.json` is used. If not specified at the top level of `package.json`, [name property](https://docs.npmjs.com/files/package.json#name) is used.
|
||||
*/
|
||||
readonly productName?: string | null;
|
||||
/**
|
||||
* The human-readable copyright line for the app.
|
||||
* @default Copyright © year ${author}
|
||||
*/
|
||||
readonly copyright?: string | null;
|
||||
readonly directories?: MetadataDirectories | null;
|
||||
/**
|
||||
* Options related to how build macOS targets.
|
||||
*/
|
||||
readonly mac?: MacConfiguration | null;
|
||||
/**
|
||||
* MAS (Mac Application Store) options.
|
||||
*/
|
||||
readonly mas?: MasConfiguration | null;
|
||||
/**
|
||||
* MAS (Mac Application Store) development options (`mas-dev` target).
|
||||
*/
|
||||
readonly masDev?: MasConfiguration | null;
|
||||
/**
|
||||
* macOS DMG options.
|
||||
*/
|
||||
readonly dmg?: DmgOptions | null;
|
||||
/**
|
||||
* macOS PKG options.
|
||||
*/
|
||||
readonly pkg?: PkgOptions | null;
|
||||
/**
|
||||
* Options related to how build Windows targets.
|
||||
*/
|
||||
readonly win?: WindowsConfiguration | null;
|
||||
readonly nsis?: NsisOptions | null;
|
||||
readonly nsisWeb?: NsisWebOptions | null;
|
||||
readonly portable?: PortableOptions | null;
|
||||
readonly appx?: AppXOptions | null;
|
||||
/** @private */
|
||||
readonly msi?: MsiOptions | null;
|
||||
/** @private */
|
||||
readonly msiWrapped?: MsiWrappedOptions | null;
|
||||
readonly squirrelWindows?: SquirrelWindowsOptions | null;
|
||||
/**
|
||||
* Options related to how build Linux targets.
|
||||
*/
|
||||
readonly linux?: LinuxConfiguration | null;
|
||||
/**
|
||||
* Debian package options.
|
||||
*/
|
||||
readonly deb?: DebOptions | null;
|
||||
/**
|
||||
* Snap options.
|
||||
*/
|
||||
readonly snap?: SnapOptions | null;
|
||||
/**
|
||||
* AppImage options.
|
||||
*/
|
||||
readonly appImage?: AppImageOptions | null;
|
||||
/**
|
||||
* Flatpak options.
|
||||
*/
|
||||
readonly flatpak?: FlatpakOptions | null;
|
||||
readonly pacman?: LinuxTargetSpecificOptions | null;
|
||||
readonly rpm?: LinuxTargetSpecificOptions | null;
|
||||
readonly freebsd?: LinuxTargetSpecificOptions | null;
|
||||
readonly p5p?: LinuxTargetSpecificOptions | null;
|
||||
readonly apk?: LinuxTargetSpecificOptions | null;
|
||||
/**
|
||||
* Whether to include *all* of the submodules node_modules directories
|
||||
* @default false
|
||||
*/
|
||||
includeSubNodeModules?: boolean;
|
||||
/**
|
||||
* Whether to build the application native dependencies from source.
|
||||
* @default false
|
||||
*/
|
||||
buildDependenciesFromSource?: boolean;
|
||||
/**
|
||||
* Whether to execute `node-gyp rebuild` before starting to package the app.
|
||||
*
|
||||
* Don't [use](https://github.com/electron-userland/electron-builder/issues/683#issuecomment-241214075) [npm](http://electron.atom.io/docs/tutorial/using-native-node-modules/#using-npm) (neither `.npmrc`) for configuring electron headers. Use `electron-builder node-gyp-rebuild` instead.
|
||||
* @default false
|
||||
*/
|
||||
readonly nodeGypRebuild?: boolean;
|
||||
/**
|
||||
* Additional command line arguments to use when installing app native deps.
|
||||
*/
|
||||
readonly npmArgs?: Array<string> | string | null;
|
||||
/**
|
||||
* Whether to [rebuild](https://docs.npmjs.com/cli/rebuild) native dependencies before starting to package the app.
|
||||
* @default true
|
||||
*/
|
||||
readonly npmRebuild?: boolean;
|
||||
/**
|
||||
* The build number. Maps to the `--iteration` flag for builds using FPM on Linux.
|
||||
* If not defined, then it will fallback to `BUILD_NUMBER` or `TRAVIS_BUILD_NUMBER` or `APPVEYOR_BUILD_NUMBER` or `CIRCLE_BUILD_NUM` or `BUILD_BUILDNUMBER` or `CI_PIPELINE_IID` env.
|
||||
*/
|
||||
readonly buildNumber?: string | null;
|
||||
/**
|
||||
* The build version. Maps to the `CFBundleVersion` on macOS, and `FileVersion` metadata property on Windows. Defaults to the `version`.
|
||||
* If `buildVersion` is not defined and `buildNumber` (or one of the `buildNumber` envs) is defined, it will be used as a build version (`version.buildNumber`).
|
||||
*/
|
||||
readonly buildVersion?: string | null;
|
||||
/**
|
||||
* Whether to download the alternate FFmpeg library from Electron's release assets and replace the default FFmpeg library prior to signing
|
||||
*/
|
||||
readonly downloadAlternateFFmpeg?: boolean;
|
||||
/**
|
||||
* Whether to use [electron-compile](http://github.com/electron/electron-compile) to compile app. Defaults to `true` if `electron-compile` in the dependencies. And `false` if in the `devDependencies` or doesn't specified.
|
||||
*/
|
||||
readonly electronCompile?: boolean;
|
||||
/**
|
||||
* Returns the path to custom Electron build (e.g. `~/electron/out/R`). Zip files must follow the pattern `electron-v${version}-${platformName}-${arch}.zip`, otherwise it will be assumed to be an unpacked Electron app directory
|
||||
*/
|
||||
readonly electronDist?: string | ((options: PrepareApplicationStageDirectoryOptions) => string);
|
||||
/**
|
||||
* The [electron-download](https://github.com/electron-userland/electron-download#usage) options.
|
||||
*/
|
||||
readonly electronDownload?: ElectronDownloadOptions;
|
||||
/**
|
||||
* The branding used by Electron's distributables. This is needed if a fork has modified Electron's BRANDING.json file.
|
||||
*/
|
||||
readonly electronBranding?: ElectronBrandingOptions;
|
||||
/**
|
||||
* The version of electron you are packaging for. Defaults to version of `electron`, `electron-prebuilt` or `electron-prebuilt-compile` dependency.
|
||||
*/
|
||||
electronVersion?: string | null;
|
||||
/**
|
||||
* The name of a built-in configuration preset (currently, only `react-cra` is supported) or any number of paths to config files (relative to project dir).
|
||||
*
|
||||
* The latter allows to mixin a config from multiple other configs, as if you `Object.assign` them, but properly combine `files` glob patterns.
|
||||
*
|
||||
* If `react-scripts` in the app dependencies, `react-cra` will be set automatically. Set to `null` to disable automatic detection.
|
||||
*/
|
||||
extends?: Array<string> | string | null;
|
||||
/**
|
||||
* Inject properties to `package.json`.
|
||||
*/
|
||||
readonly extraMetadata?: any;
|
||||
/**
|
||||
* Whether to fail if the application is not signed (to prevent unsigned app if code signing configuration is not correct).
|
||||
* @default false
|
||||
*/
|
||||
readonly forceCodeSigning?: boolean;
|
||||
/**
|
||||
* *libui-based frameworks only* The version of NodeJS you are packaging for.
|
||||
* You can set it to `current` to set the Node.js version that you use to run.
|
||||
*/
|
||||
readonly nodeVersion?: string | null;
|
||||
/**
|
||||
* *libui-based frameworks only* The version of LaunchUI you are packaging for. Applicable for Windows only. Defaults to version suitable for used framework version.
|
||||
*/
|
||||
readonly launchUiVersion?: boolean | string | null;
|
||||
/**
|
||||
* The framework name. One of `electron`, `proton`, `libui`. Defaults to `electron`.
|
||||
*/
|
||||
readonly framework?: string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be [run before pack](#beforepack)
|
||||
*/
|
||||
readonly beforePack?: ((context: BeforePackContext) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be [run after pack](#afterpack) (but before pack into distributable format and sign).
|
||||
*/
|
||||
readonly afterPack?: ((context: AfterPackContext) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be [run after pack and sign](#aftersign) (but before pack into distributable format).
|
||||
*/
|
||||
readonly afterSign?: ((context: AfterPackContext) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be run on artifact build start.
|
||||
*/
|
||||
readonly artifactBuildStarted?: ((context: ArtifactBuildStarted) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be run on artifact build completed.
|
||||
*/
|
||||
readonly artifactBuildCompleted?: ((context: ArtifactCreated) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be [run after all artifacts are build](#afterAllArtifactBuild).
|
||||
*/
|
||||
readonly afterAllArtifactBuild?: ((context: BuildResult) => Promise<Array<string>> | Array<string>) | string | null;
|
||||
/**
|
||||
* MSI project created on disk - not packed into .msi package yet.
|
||||
*/
|
||||
readonly msiProjectCreated?: ((path: string) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* Appx manifest created on disk - not packed into .appx package yet.
|
||||
*/
|
||||
readonly appxManifestCreated?: ((path: string) => Promise<any> | any) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be [run on each node module](#onnodemodulefile) file. Returning `true`/`false` will determine whether to force include or to use the default copier logic
|
||||
*/
|
||||
readonly onNodeModuleFile?: ((path: string) => void | boolean) | string | null;
|
||||
/**
|
||||
* The function (or path to file or module id) to be run before dependencies are installed or rebuilt. Works when `npmRebuild` is set to `true`. Resolving to `false` will skip dependencies install or rebuild.
|
||||
*
|
||||
* If provided and `node_modules` are missing, it will not invoke production dependencies check.
|
||||
*/
|
||||
readonly beforeBuild?: ((context: BeforeBuildContext) => Promise<any>) | string | null;
|
||||
/**
|
||||
* Whether to include PDB files.
|
||||
* @default false
|
||||
*/
|
||||
readonly includePdb?: boolean;
|
||||
/**
|
||||
* Whether to remove `scripts` field from `package.json` files.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly removePackageScripts?: boolean;
|
||||
/**
|
||||
* Whether to remove `keywords` field from `package.json` files.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly removePackageKeywords?: boolean;
|
||||
}
|
||||
interface PackContext {
|
||||
readonly outDir: string;
|
||||
readonly appOutDir: string;
|
||||
readonly packager: PlatformPackager<any>;
|
||||
readonly electronPlatformName: string;
|
||||
readonly arch: Arch;
|
||||
readonly targets: Array<Target>;
|
||||
}
|
||||
export type AfterPackContext = PackContext;
|
||||
export type BeforePackContext = PackContext;
|
||||
export interface MetadataDirectories {
|
||||
/**
|
||||
* The path to build resources.
|
||||
*
|
||||
* Please note — build resources are not packed into the app. If you need to use some files, e.g. as tray icon, please include required files explicitly: `"files": ["**\/*", "build/icon.*"]`
|
||||
* @default build
|
||||
*/
|
||||
readonly buildResources?: string | null;
|
||||
/**
|
||||
* The output directory. [File macros](/file-patterns#file-macros) are supported.
|
||||
* @default dist
|
||||
*/
|
||||
readonly output?: string | null;
|
||||
/**
|
||||
* The application directory (containing the application package.json), defaults to `app`, `www` or working directory.
|
||||
*/
|
||||
readonly app?: string | null;
|
||||
}
|
||||
export {};
|
||||
3
mc_test/node_modules/app-builder-lib/out/configuration.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/configuration.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=configuration.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/configuration.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/configuration.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
60
mc_test/node_modules/app-builder-lib/out/core.d.ts
generated
vendored
Executable file
60
mc_test/node_modules/app-builder-lib/out/core.d.ts
generated
vendored
Executable file
@ -0,0 +1,60 @@
|
||||
/// <reference types="node" />
|
||||
import { Arch, ArchType } from "builder-util";
|
||||
import { AllPublishOptions } from "builder-util-runtime";
|
||||
export type Publish = AllPublishOptions | Array<AllPublishOptions> | null;
|
||||
export type TargetConfigType = Array<string | TargetConfiguration> | string | TargetConfiguration | null;
|
||||
export interface TargetConfiguration {
|
||||
/**
|
||||
* The target name. e.g. `snap`.
|
||||
*/
|
||||
readonly target: string;
|
||||
/**
|
||||
* The arch or list of archs.
|
||||
*/
|
||||
readonly arch?: Array<ArchType> | ArchType;
|
||||
}
|
||||
export declare class Platform {
|
||||
name: string;
|
||||
buildConfigurationKey: string;
|
||||
nodeName: NodeJS.Platform;
|
||||
static MAC: Platform;
|
||||
static LINUX: Platform;
|
||||
static WINDOWS: Platform;
|
||||
constructor(name: string, buildConfigurationKey: string, nodeName: NodeJS.Platform);
|
||||
toString(): string;
|
||||
createTarget(type?: string | Array<string> | null, ...archs: Array<Arch>): Map<Platform, Map<Arch, Array<string>>>;
|
||||
static current(): Platform;
|
||||
static fromString(name: string): Platform;
|
||||
}
|
||||
export declare abstract class Target {
|
||||
readonly name: string;
|
||||
readonly isAsyncSupported: boolean;
|
||||
abstract readonly outDir: string;
|
||||
abstract readonly options: TargetSpecificOptions | null | undefined;
|
||||
protected constructor(name: string, isAsyncSupported?: boolean);
|
||||
checkOptions(): Promise<any>;
|
||||
abstract build(appOutDir: string, arch: Arch): Promise<any>;
|
||||
finishBuild(): Promise<any>;
|
||||
}
|
||||
export interface TargetSpecificOptions {
|
||||
/**
|
||||
The [artifact file name template](/configuration/configuration#artifact-file-name-template).
|
||||
*/
|
||||
readonly artifactName?: string | null;
|
||||
publish?: Publish;
|
||||
}
|
||||
export declare const DEFAULT_TARGET = "default";
|
||||
export declare const DIR_TARGET = "dir";
|
||||
export type CompressionLevel = "store" | "normal" | "maximum";
|
||||
export interface BeforeBuildContext {
|
||||
readonly appDir: string;
|
||||
readonly electronVersion: string;
|
||||
readonly platform: Platform;
|
||||
readonly arch: string;
|
||||
}
|
||||
export interface SourceRepositoryInfo {
|
||||
type?: string;
|
||||
domain?: string;
|
||||
user: string;
|
||||
project: string;
|
||||
}
|
||||
63
mc_test/node_modules/app-builder-lib/out/core.js
generated
vendored
Executable file
63
mc_test/node_modules/app-builder-lib/out/core.js
generated
vendored
Executable file
@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DIR_TARGET = exports.DEFAULT_TARGET = exports.Target = exports.Platform = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
class Platform {
|
||||
constructor(name, buildConfigurationKey, nodeName) {
|
||||
this.name = name;
|
||||
this.buildConfigurationKey = buildConfigurationKey;
|
||||
this.nodeName = nodeName;
|
||||
}
|
||||
toString() {
|
||||
return this.name;
|
||||
}
|
||||
createTarget(type, ...archs) {
|
||||
if (type == null && (archs == null || archs.length === 0)) {
|
||||
return new Map([[this, new Map()]]);
|
||||
}
|
||||
const archToType = new Map();
|
||||
for (const arch of archs == null || archs.length === 0 ? [(0, builder_util_1.archFromString)(process.arch)] : archs) {
|
||||
archToType.set(arch, type == null ? [] : Array.isArray(type) ? type : [type]);
|
||||
}
|
||||
return new Map([[this, archToType]]);
|
||||
}
|
||||
static current() {
|
||||
return Platform.fromString(process.platform);
|
||||
}
|
||||
static fromString(name) {
|
||||
name = name.toLowerCase();
|
||||
switch (name) {
|
||||
case Platform.MAC.nodeName:
|
||||
case Platform.MAC.name:
|
||||
return Platform.MAC;
|
||||
case Platform.WINDOWS.nodeName:
|
||||
case Platform.WINDOWS.name:
|
||||
case Platform.WINDOWS.buildConfigurationKey:
|
||||
return Platform.WINDOWS;
|
||||
case Platform.LINUX.nodeName:
|
||||
return Platform.LINUX;
|
||||
default:
|
||||
throw new Error(`Unknown platform: ${name}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.Platform = Platform;
|
||||
Platform.MAC = new Platform("mac", "mac", "darwin");
|
||||
Platform.LINUX = new Platform("linux", "linux", "linux");
|
||||
Platform.WINDOWS = new Platform("windows", "win", "win32");
|
||||
class Target {
|
||||
constructor(name, isAsyncSupported = true) {
|
||||
this.name = name;
|
||||
this.isAsyncSupported = isAsyncSupported;
|
||||
}
|
||||
async checkOptions() {
|
||||
// ignore
|
||||
}
|
||||
finishBuild() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
exports.Target = Target;
|
||||
exports.DEFAULT_TARGET = "default";
|
||||
exports.DIR_TARGET = "dir";
|
||||
//# sourceMappingURL=core.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/core.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/core.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
33
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.d.ts
generated
vendored
Executable file
33
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.d.ts
generated
vendored
Executable file
@ -0,0 +1,33 @@
|
||||
import { Configuration } from "../configuration";
|
||||
import { Framework } from "../Framework";
|
||||
import { Packager } from "../index";
|
||||
export type ElectronPlatformName = "darwin" | "linux" | "win32" | "mas";
|
||||
/**
|
||||
* Electron distributables branding options.
|
||||
* @see [Electron BRANDING.json](https://github.com/electron/electron/blob/master/shell/app/BRANDING.json).
|
||||
*/
|
||||
export interface ElectronBrandingOptions {
|
||||
projectName?: string;
|
||||
productName?: string;
|
||||
}
|
||||
export declare function createBrandingOpts(opts: Configuration): Required<ElectronBrandingOptions>;
|
||||
export interface ElectronDownloadOptions {
|
||||
version?: string;
|
||||
/**
|
||||
* The [cache location](https://github.com/electron-userland/electron-download#cache-location).
|
||||
*/
|
||||
cache?: string | null;
|
||||
/**
|
||||
* The mirror.
|
||||
*/
|
||||
mirror?: string | null;
|
||||
/** @private */
|
||||
customDir?: string | null;
|
||||
/** @private */
|
||||
customFilename?: string | null;
|
||||
strictSSL?: boolean;
|
||||
isVerifyChecksum?: boolean;
|
||||
platform?: ElectronPlatformName;
|
||||
arch?: string;
|
||||
}
|
||||
export declare function createElectronFrameworkSupport(configuration: Configuration, packager: Packager): Promise<Framework>;
|
||||
171
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.js
generated
vendored
Executable file
171
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.js
generated
vendored
Executable file
@ -0,0 +1,171 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createElectronFrameworkSupport = exports.createBrandingOpts = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
const index_1 = require("../index");
|
||||
const pathManager_1 = require("../util/pathManager");
|
||||
const electronMac_1 = require("./electronMac");
|
||||
const electronVersion_1 = require("./electronVersion");
|
||||
const fs = require("fs/promises");
|
||||
const injectFFMPEG_1 = require("./injectFFMPEG");
|
||||
function createBrandingOpts(opts) {
|
||||
var _a, _b;
|
||||
return {
|
||||
projectName: ((_a = opts.electronBranding) === null || _a === void 0 ? void 0 : _a.projectName) || "electron",
|
||||
productName: ((_b = opts.electronBranding) === null || _b === void 0 ? void 0 : _b.productName) || "Electron",
|
||||
};
|
||||
}
|
||||
exports.createBrandingOpts = createBrandingOpts;
|
||||
function createDownloadOpts(opts, platform, arch, electronVersion) {
|
||||
return {
|
||||
platform,
|
||||
arch,
|
||||
version: electronVersion,
|
||||
...opts.electronDownload,
|
||||
};
|
||||
}
|
||||
async function beforeCopyExtraFiles(options) {
|
||||
const { appOutDir, packager } = options;
|
||||
const electronBranding = createBrandingOpts(packager.config);
|
||||
if (packager.platform === index_1.Platform.LINUX) {
|
||||
const linuxPackager = packager;
|
||||
const executable = path.join(appOutDir, linuxPackager.executableName);
|
||||
await (0, fs_extra_1.rename)(path.join(appOutDir, electronBranding.projectName), executable);
|
||||
}
|
||||
else if (packager.platform === index_1.Platform.WINDOWS) {
|
||||
const executable = path.join(appOutDir, `${packager.appInfo.productFilename}.exe`);
|
||||
await (0, fs_extra_1.rename)(path.join(appOutDir, `${electronBranding.projectName}.exe`), executable);
|
||||
}
|
||||
else {
|
||||
await (0, electronMac_1.createMacApp)(packager, appOutDir, options.asarIntegrity, options.platformName === "mas");
|
||||
}
|
||||
await removeUnusedLanguagesIfNeeded(options);
|
||||
}
|
||||
async function removeUnusedLanguagesIfNeeded(options) {
|
||||
const { packager: { config, platformSpecificBuildOptions }, } = options;
|
||||
const wantedLanguages = (0, builder_util_1.asArray)(platformSpecificBuildOptions.electronLanguages || config.electronLanguages);
|
||||
if (!wantedLanguages.length) {
|
||||
return;
|
||||
}
|
||||
const { dir, langFileExt } = getLocalesConfig(options);
|
||||
// noinspection SpellCheckingInspection
|
||||
await bluebird_lst_1.default.map((0, fs_extra_1.readdir)(dir), file => {
|
||||
if (!file.endsWith(langFileExt)) {
|
||||
return;
|
||||
}
|
||||
const language = file.substring(0, file.length - langFileExt.length);
|
||||
if (!wantedLanguages.includes(language)) {
|
||||
return fs.rm(path.join(dir, file), { recursive: true, force: true });
|
||||
}
|
||||
return;
|
||||
}, fs_1.CONCURRENCY);
|
||||
function getLocalesConfig(options) {
|
||||
const { appOutDir, packager } = options;
|
||||
if (packager.platform === index_1.Platform.MAC) {
|
||||
return { dir: packager.getResourcesDir(appOutDir), langFileExt: ".lproj" };
|
||||
}
|
||||
else {
|
||||
return { dir: path.join(packager.getResourcesDir(appOutDir), "..", "locales"), langFileExt: ".pak" };
|
||||
}
|
||||
}
|
||||
}
|
||||
class ElectronFramework {
|
||||
constructor(name, version, distMacOsAppName) {
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.distMacOsAppName = distMacOsAppName;
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.macOsDefaultTargets = ["zip", "dmg"];
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.defaultAppIdPrefix = "com.electron.";
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.isCopyElevateHelper = true;
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.isNpmRebuildRequired = true;
|
||||
}
|
||||
getDefaultIcon(platform) {
|
||||
if (platform === index_1.Platform.LINUX) {
|
||||
return path.join((0, pathManager_1.getTemplatePath)("icons"), "electron-linux");
|
||||
}
|
||||
else {
|
||||
// default icon is embedded into app skeleton
|
||||
return null;
|
||||
}
|
||||
}
|
||||
async prepareApplicationStageDirectory(options) {
|
||||
await unpack(options, createDownloadOpts(options.packager.config, options.platformName, options.arch, this.version), this.distMacOsAppName);
|
||||
if (options.packager.config.downloadAlternateFFmpeg) {
|
||||
await (0, injectFFMPEG_1.default)(options, this.version);
|
||||
}
|
||||
}
|
||||
beforeCopyExtraFiles(options) {
|
||||
return beforeCopyExtraFiles(options);
|
||||
}
|
||||
}
|
||||
async function createElectronFrameworkSupport(configuration, packager) {
|
||||
let version = configuration.electronVersion;
|
||||
if (version == null) {
|
||||
// for prepacked app asar no dev deps in the app.asar
|
||||
if (packager.isPrepackedAppAsar) {
|
||||
version = await (0, electronVersion_1.getElectronVersionFromInstalled)(packager.projectDir);
|
||||
if (version == null) {
|
||||
throw new Error(`Cannot compute electron version for prepacked asar`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
version = await (0, electronVersion_1.computeElectronVersion)(packager.projectDir);
|
||||
}
|
||||
configuration.electronVersion = version;
|
||||
}
|
||||
const branding = createBrandingOpts(configuration);
|
||||
return new ElectronFramework(branding.projectName, version, `${branding.productName}.app`);
|
||||
}
|
||||
exports.createElectronFrameworkSupport = createElectronFrameworkSupport;
|
||||
async function unpack(prepareOptions, options, distMacOsAppName) {
|
||||
const { packager, appOutDir, platformName } = prepareOptions;
|
||||
const electronDist = packager.config.electronDist;
|
||||
let dist = typeof electronDist === "function" ? electronDist(prepareOptions) : electronDist;
|
||||
if (dist != null) {
|
||||
const zipFile = `electron-v${options.version}-${platformName}-${options.arch}.zip`;
|
||||
const resolvedDist = path.isAbsolute(dist) ? dist : path.resolve(packager.projectDir, dist);
|
||||
if ((await (0, fs_1.statOrNull)(path.join(resolvedDist, zipFile))) != null) {
|
||||
builder_util_1.log.info({ resolvedDist, zipFile }, "resolved electronDist");
|
||||
options.cache = resolvedDist;
|
||||
dist = null;
|
||||
}
|
||||
}
|
||||
let isFullCleanup = false;
|
||||
if (dist == null) {
|
||||
await (0, builder_util_1.executeAppBuilder)(["unpack-electron", "--configuration", JSON.stringify([options]), "--output", appOutDir, "--distMacOsAppName", distMacOsAppName]);
|
||||
}
|
||||
else {
|
||||
isFullCleanup = true;
|
||||
const source = packager.getElectronSrcDir(dist);
|
||||
const destination = packager.getElectronDestinationDir(appOutDir);
|
||||
builder_util_1.log.info({ source, destination }, "copying Electron");
|
||||
await (0, fs_extra_1.emptyDir)(appOutDir);
|
||||
await (0, fs_1.copyDir)(source, destination, {
|
||||
isUseHardLink: fs_1.DO_NOT_USE_HARD_LINKS,
|
||||
});
|
||||
}
|
||||
await cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup);
|
||||
}
|
||||
function cleanupAfterUnpack(prepareOptions, distMacOsAppName, isFullCleanup) {
|
||||
const out = prepareOptions.appOutDir;
|
||||
const isMac = prepareOptions.packager.platform === index_1.Platform.MAC;
|
||||
const resourcesPath = isMac ? path.join(out, distMacOsAppName, "Contents", "Resources") : path.join(out, "resources");
|
||||
return Promise.all([
|
||||
isFullCleanup ? (0, fs_1.unlinkIfExists)(path.join(resourcesPath, "default_app.asar")) : Promise.resolve(),
|
||||
isFullCleanup ? (0, fs_1.unlinkIfExists)(path.join(out, "version")) : Promise.resolve(),
|
||||
isMac
|
||||
? Promise.resolve()
|
||||
: (0, fs_extra_1.rename)(path.join(out, "LICENSE"), path.join(out, "LICENSE.electron.txt")).catch(() => {
|
||||
/* ignore */
|
||||
}),
|
||||
]);
|
||||
}
|
||||
//# sourceMappingURL=ElectronFramework.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/electron/ElectronFramework.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
mc_test/node_modules/app-builder-lib/out/electron/electronMac.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/electron/electronMac.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export {};
|
||||
269
mc_test/node_modules/app-builder-lib/out/electron/electronMac.js
generated
vendored
Executable file
269
mc_test/node_modules/app-builder-lib/out/electron/electronMac.js
generated
vendored
Executable file
@ -0,0 +1,269 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createMacApp = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
const appInfo_1 = require("../appInfo");
|
||||
const platformPackager_1 = require("../platformPackager");
|
||||
const appBuilder_1 = require("../util/appBuilder");
|
||||
const ElectronFramework_1 = require("./ElectronFramework");
|
||||
function doRename(basePath, oldName, newName) {
|
||||
return (0, promises_1.rename)(path.join(basePath, oldName), path.join(basePath, newName));
|
||||
}
|
||||
function moveHelpers(helperSuffixes, frameworksPath, appName, prefix) {
|
||||
return bluebird_lst_1.default.map(helperSuffixes, suffix => {
|
||||
const executableBasePath = path.join(frameworksPath, `${prefix}${suffix}.app`, "Contents", "MacOS");
|
||||
return doRename(executableBasePath, `${prefix}${suffix}`, appName + suffix).then(() => doRename(frameworksPath, `${prefix}${suffix}.app`, `${appName}${suffix}.app`));
|
||||
});
|
||||
}
|
||||
function getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist) {
|
||||
const result = [" Helper"];
|
||||
if (helperEHPlist != null) {
|
||||
result.push(" Helper EH");
|
||||
}
|
||||
if (helperNPPlist != null) {
|
||||
result.push(" Helper NP");
|
||||
}
|
||||
if (helperRendererPlist != null) {
|
||||
result.push(" Helper (Renderer)");
|
||||
}
|
||||
if (helperPluginPlist != null) {
|
||||
result.push(" Helper (Plugin)");
|
||||
}
|
||||
if (helperGPUPlist != null) {
|
||||
result.push(" Helper (GPU)");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/** @internal */
|
||||
async function createMacApp(packager, appOutDir, asarIntegrity, isMas) {
|
||||
var _a, _b;
|
||||
const appInfo = packager.appInfo;
|
||||
// Electon uses the application name (CFBundleName) to resolve helper apps
|
||||
// https://github.com/electron/electron/blob/main/shell/app/electron_main_delegate_mac.mm
|
||||
// https://github.com/electron-userland/electron-builder/issues/6962
|
||||
const appFilename = appInfo.sanitizedProductName;
|
||||
const electronBranding = (0, ElectronFramework_1.createBrandingOpts)(packager.config);
|
||||
const contentsPath = path.join(appOutDir, packager.info.framework.distMacOsAppName, "Contents");
|
||||
const frameworksPath = path.join(contentsPath, "Frameworks");
|
||||
const loginItemPath = path.join(contentsPath, "Library", "LoginItems");
|
||||
const appPlistFilename = path.join(contentsPath, "Info.plist");
|
||||
const helperPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper.app`, "Contents", "Info.plist");
|
||||
const helperEHPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper EH.app`, "Contents", "Info.plist");
|
||||
const helperNPPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper NP.app`, "Contents", "Info.plist");
|
||||
const helperRendererPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Renderer).app`, "Contents", "Info.plist");
|
||||
const helperPluginPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (Plugin).app`, "Contents", "Info.plist");
|
||||
const helperGPUPlistFilename = path.join(frameworksPath, `${electronBranding.productName} Helper (GPU).app`, "Contents", "Info.plist");
|
||||
const helperLoginPlistFilename = path.join(loginItemPath, `${electronBranding.productName} Login Helper.app`, "Contents", "Info.plist");
|
||||
const plistContent = await (0, appBuilder_1.executeAppBuilderAsJson)([
|
||||
"decode-plist",
|
||||
"-f",
|
||||
appPlistFilename,
|
||||
"-f",
|
||||
helperPlistFilename,
|
||||
"-f",
|
||||
helperEHPlistFilename,
|
||||
"-f",
|
||||
helperNPPlistFilename,
|
||||
"-f",
|
||||
helperRendererPlistFilename,
|
||||
"-f",
|
||||
helperPluginPlistFilename,
|
||||
"-f",
|
||||
helperGPUPlistFilename,
|
||||
"-f",
|
||||
helperLoginPlistFilename,
|
||||
]);
|
||||
if (plistContent[0] == null) {
|
||||
throw new Error("corrupted Electron dist");
|
||||
}
|
||||
const appPlist = plistContent[0];
|
||||
const helperPlist = plistContent[1];
|
||||
const helperEHPlist = plistContent[2];
|
||||
const helperNPPlist = plistContent[3];
|
||||
const helperRendererPlist = plistContent[4];
|
||||
const helperPluginPlist = plistContent[5];
|
||||
const helperGPUPlist = plistContent[6];
|
||||
const helperLoginPlist = plistContent[7];
|
||||
// if an extend-info file was supplied, copy its contents in first
|
||||
if (plistContent[8] != null) {
|
||||
Object.assign(appPlist, plistContent[8]);
|
||||
}
|
||||
const buildMetadata = packager.config;
|
||||
/**
|
||||
* Configure bundleIdentifier for the generic Electron Helper process
|
||||
*
|
||||
* This was the only Helper in Electron 5 and before. Allow users to configure
|
||||
* the bundleIdentifier for continuity.
|
||||
*/
|
||||
const oldHelperBundleId = buildMetadata["helper-bundle-id"];
|
||||
if (oldHelperBundleId != null) {
|
||||
builder_util_1.log.warn("build.helper-bundle-id is deprecated, please set as build.mac.helperBundleId");
|
||||
}
|
||||
const defaultAppId = packager.platformSpecificBuildOptions.appId;
|
||||
const cfBundleIdentifier = (0, appInfo_1.filterCFBundleIdentifier)((isMas ? (_a = packager.config.mas) === null || _a === void 0 ? void 0 : _a.appId : defaultAppId) || defaultAppId || appInfo.macBundleIdentifier);
|
||||
const defaultHelperId = packager.platformSpecificBuildOptions.helperBundleId;
|
||||
const helperBundleIdentifier = (0, appInfo_1.filterCFBundleIdentifier)((isMas ? (_b = packager.config.mas) === null || _b === void 0 ? void 0 : _b.helperBundleId : defaultHelperId) || defaultHelperId || oldHelperBundleId || `${cfBundleIdentifier}.helper`);
|
||||
appPlist.CFBundleIdentifier = cfBundleIdentifier;
|
||||
await packager.applyCommonInfo(appPlist, contentsPath);
|
||||
// required for electron-updater proxy
|
||||
if (!isMas) {
|
||||
configureLocalhostAts(appPlist);
|
||||
}
|
||||
helperPlist.CFBundleExecutable = `${appFilename} Helper`;
|
||||
helperPlist.CFBundleDisplayName = `${appInfo.productName} Helper`;
|
||||
helperPlist.CFBundleIdentifier = helperBundleIdentifier;
|
||||
helperPlist.CFBundleVersion = appPlist.CFBundleVersion;
|
||||
/**
|
||||
* Configure bundleIdentifier for Electron 5+ Helper processes
|
||||
*
|
||||
* In Electron 6, parts of the generic Electron Helper process were split into
|
||||
* individual helper processes. Allow users to configure the bundleIdentifiers
|
||||
* for continuity, specifically because macOS keychain access relies on
|
||||
* bundleIdentifiers not changing (i.e. across versions of Electron).
|
||||
*/
|
||||
function configureHelper(helper, postfix, userProvidedBundleIdentifier) {
|
||||
helper.CFBundleExecutable = `${appFilename} Helper ${postfix}`;
|
||||
helper.CFBundleDisplayName = `${appInfo.productName} Helper ${postfix}`;
|
||||
helper.CFBundleIdentifier = userProvidedBundleIdentifier
|
||||
? (0, appInfo_1.filterCFBundleIdentifier)(userProvidedBundleIdentifier)
|
||||
: (0, appInfo_1.filterCFBundleIdentifier)(`${helperBundleIdentifier}.${postfix}`);
|
||||
helper.CFBundleVersion = appPlist.CFBundleVersion;
|
||||
}
|
||||
if (helperRendererPlist != null) {
|
||||
configureHelper(helperRendererPlist, "(Renderer)", packager.platformSpecificBuildOptions.helperRendererBundleId);
|
||||
}
|
||||
if (helperPluginPlist != null) {
|
||||
configureHelper(helperPluginPlist, "(Plugin)", packager.platformSpecificBuildOptions.helperPluginBundleId);
|
||||
}
|
||||
if (helperGPUPlist != null) {
|
||||
configureHelper(helperGPUPlist, "(GPU)", packager.platformSpecificBuildOptions.helperGPUBundleId);
|
||||
}
|
||||
if (helperEHPlist != null) {
|
||||
configureHelper(helperEHPlist, "EH", packager.platformSpecificBuildOptions.helperEHBundleId);
|
||||
}
|
||||
if (helperNPPlist != null) {
|
||||
configureHelper(helperNPPlist, "NP", packager.platformSpecificBuildOptions.helperNPBundleId);
|
||||
}
|
||||
if (helperLoginPlist != null) {
|
||||
helperLoginPlist.CFBundleExecutable = `${appFilename} Login Helper`;
|
||||
helperLoginPlist.CFBundleDisplayName = `${appInfo.productName} Login Helper`;
|
||||
// noinspection SpellCheckingInspection
|
||||
helperLoginPlist.CFBundleIdentifier = `${cfBundleIdentifier}.loginhelper`;
|
||||
helperLoginPlist.CFBundleVersion = appPlist.CFBundleVersion;
|
||||
}
|
||||
const protocols = (0, builder_util_1.asArray)(buildMetadata.protocols).concat((0, builder_util_1.asArray)(packager.platformSpecificBuildOptions.protocols));
|
||||
if (protocols.length > 0) {
|
||||
appPlist.CFBundleURLTypes = protocols.map(protocol => {
|
||||
const schemes = (0, builder_util_1.asArray)(protocol.schemes);
|
||||
if (schemes.length === 0) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Protocol "${protocol.name}": must be at least one scheme specified`);
|
||||
}
|
||||
return {
|
||||
CFBundleURLName: protocol.name,
|
||||
CFBundleTypeRole: protocol.role || "Editor",
|
||||
CFBundleURLSchemes: schemes.slice(),
|
||||
};
|
||||
});
|
||||
}
|
||||
const fileAssociations = packager.fileAssociations;
|
||||
if (fileAssociations.length > 0) {
|
||||
const documentTypes = await bluebird_lst_1.default.map(fileAssociations, async (fileAssociation) => {
|
||||
const extensions = (0, builder_util_1.asArray)(fileAssociation.ext).map(platformPackager_1.normalizeExt);
|
||||
const customIcon = await packager.getResource((0, builder_util_1.getPlatformIconFileName)(fileAssociation.icon, true), `${extensions[0]}.icns`);
|
||||
let iconFile = appPlist.CFBundleIconFile;
|
||||
if (customIcon != null) {
|
||||
iconFile = path.basename(customIcon);
|
||||
await (0, fs_1.copyOrLinkFile)(customIcon, path.join(path.join(contentsPath, "Resources"), iconFile));
|
||||
}
|
||||
const result = {
|
||||
CFBundleTypeExtensions: extensions,
|
||||
CFBundleTypeName: fileAssociation.name || extensions[0],
|
||||
CFBundleTypeRole: fileAssociation.role || "Editor",
|
||||
LSHandlerRank: fileAssociation.rank || "Default",
|
||||
CFBundleTypeIconFile: iconFile,
|
||||
};
|
||||
if (fileAssociation.isPackage) {
|
||||
result.LSTypeIsPackage = true;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
// `CFBundleDocumentTypes` may be defined in `mac.extendInfo`, so we need to merge it in that case
|
||||
appPlist.CFBundleDocumentTypes = [...(appPlist.CFBundleDocumentTypes || []), ...documentTypes];
|
||||
}
|
||||
if (asarIntegrity != null) {
|
||||
appPlist.ElectronAsarIntegrity = asarIntegrity;
|
||||
}
|
||||
const plistDataToWrite = {
|
||||
[appPlistFilename]: appPlist,
|
||||
[helperPlistFilename]: helperPlist,
|
||||
};
|
||||
if (helperEHPlist != null) {
|
||||
plistDataToWrite[helperEHPlistFilename] = helperEHPlist;
|
||||
}
|
||||
if (helperNPPlist != null) {
|
||||
plistDataToWrite[helperNPPlistFilename] = helperNPPlist;
|
||||
}
|
||||
if (helperRendererPlist != null) {
|
||||
plistDataToWrite[helperRendererPlistFilename] = helperRendererPlist;
|
||||
}
|
||||
if (helperPluginPlist != null) {
|
||||
plistDataToWrite[helperPluginPlistFilename] = helperPluginPlist;
|
||||
}
|
||||
if (helperGPUPlist != null) {
|
||||
plistDataToWrite[helperGPUPlistFilename] = helperGPUPlist;
|
||||
}
|
||||
if (helperLoginPlist != null) {
|
||||
plistDataToWrite[helperLoginPlistFilename] = helperLoginPlist;
|
||||
}
|
||||
await Promise.all([
|
||||
(0, appBuilder_1.executeAppBuilderAndWriteJson)(["encode-plist"], plistDataToWrite),
|
||||
doRename(path.join(contentsPath, "MacOS"), electronBranding.productName, appPlist.CFBundleExecutable),
|
||||
(0, fs_1.unlinkIfExists)(path.join(appOutDir, "LICENSE")),
|
||||
(0, fs_1.unlinkIfExists)(path.join(appOutDir, "LICENSES.chromium.html")),
|
||||
]);
|
||||
await moveHelpers(getAvailableHelperSuffixes(helperEHPlist, helperNPPlist, helperRendererPlist, helperPluginPlist, helperGPUPlist), frameworksPath, appFilename, electronBranding.productName);
|
||||
if (helperLoginPlist != null) {
|
||||
const prefix = electronBranding.productName;
|
||||
const suffix = " Login Helper";
|
||||
const executableBasePath = path.join(loginItemPath, `${prefix}${suffix}.app`, "Contents", "MacOS");
|
||||
await doRename(executableBasePath, `${prefix}${suffix}`, appFilename + suffix).then(() => doRename(loginItemPath, `${prefix}${suffix}.app`, `${appFilename}${suffix}.app`));
|
||||
}
|
||||
const appPath = path.join(appOutDir, `${appInfo.productFilename}.app`);
|
||||
await (0, promises_1.rename)(path.dirname(contentsPath), appPath);
|
||||
// https://github.com/electron-userland/electron-builder/issues/840
|
||||
const now = Date.now() / 1000;
|
||||
await (0, promises_1.utimes)(appPath, now, now);
|
||||
}
|
||||
exports.createMacApp = createMacApp;
|
||||
function configureLocalhostAts(appPlist) {
|
||||
// https://bencoding.com/2015/07/20/app-transport-security-and-localhost/
|
||||
let ats = appPlist.NSAppTransportSecurity;
|
||||
if (ats == null) {
|
||||
ats = {};
|
||||
appPlist.NSAppTransportSecurity = ats;
|
||||
}
|
||||
ats.NSAllowsLocalNetworking = true;
|
||||
// https://github.com/electron-userland/electron-builder/issues/3377#issuecomment-446035814
|
||||
ats.NSAllowsArbitraryLoads = true;
|
||||
let exceptionDomains = ats.NSExceptionDomains;
|
||||
if (exceptionDomains == null) {
|
||||
exceptionDomains = {};
|
||||
ats.NSExceptionDomains = exceptionDomains;
|
||||
}
|
||||
if (exceptionDomains.localhost == null) {
|
||||
const allowHttp = {
|
||||
NSTemporaryExceptionAllowsInsecureHTTPSLoads: false,
|
||||
NSIncludesSubdomains: false,
|
||||
NSTemporaryExceptionAllowsInsecureHTTPLoads: true,
|
||||
NSTemporaryExceptionMinimumTLSVersion: "1.0",
|
||||
NSTemporaryExceptionRequiresForwardSecrecy: false,
|
||||
};
|
||||
exceptionDomains.localhost = allowHttp;
|
||||
exceptionDomains["127.0.0.1"] = allowHttp;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=electronMac.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/electron/electronMac.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/electron/electronMac.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
8
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.d.ts
generated
vendored
Executable file
8
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.d.ts
generated
vendored
Executable file
@ -0,0 +1,8 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
import { Configuration } from "../configuration";
|
||||
export type MetadataValue = Lazy<{
|
||||
[key: string]: any;
|
||||
} | null>;
|
||||
export declare function getElectronVersion(projectDir: string, config?: Configuration): Promise<string>;
|
||||
export declare function getElectronVersionFromInstalled(projectDir: string): Promise<string | null>;
|
||||
export declare function getElectronPackage(projectDir: string): Promise<any>;
|
||||
114
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.js
generated
vendored
Executable file
114
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.js
generated
vendored
Executable file
@ -0,0 +1,114 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.computeElectronVersion = exports.getElectronPackage = exports.getElectronVersionFromInstalled = exports.getElectronVersion = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const nodeHttpExecutor_1 = require("builder-util/out/nodeHttpExecutor");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
const read_config_file_1 = require("read-config-file");
|
||||
const semver = require("semver");
|
||||
const config_1 = require("../util/config");
|
||||
const electronPackages = ["electron", "electron-prebuilt", "electron-prebuilt-compile", "electron-nightly"];
|
||||
async function getElectronVersion(projectDir, config) {
|
||||
if (config == null) {
|
||||
config = await (0, config_1.getConfig)(projectDir, null, null);
|
||||
}
|
||||
if (config.electronVersion != null) {
|
||||
return config.electronVersion;
|
||||
}
|
||||
return computeElectronVersion(projectDir);
|
||||
}
|
||||
exports.getElectronVersion = getElectronVersion;
|
||||
async function getElectronVersionFromInstalled(projectDir) {
|
||||
for (const name of electronPackages) {
|
||||
try {
|
||||
return (await (0, fs_extra_1.readJson)(path.join(projectDir, "node_modules", name, "package.json"))).version;
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code !== "ENOENT") {
|
||||
builder_util_1.log.warn({ name, error: e }, `cannot read electron version package.json`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.getElectronVersionFromInstalled = getElectronVersionFromInstalled;
|
||||
async function getElectronPackage(projectDir) {
|
||||
for (const name of electronPackages) {
|
||||
try {
|
||||
return await (0, fs_extra_1.readJson)(path.join(projectDir, "node_modules", name, "package.json"));
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code !== "ENOENT") {
|
||||
builder_util_1.log.warn({ name, error: e }, `cannot find electron in package.json`);
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
exports.getElectronPackage = getElectronPackage;
|
||||
/** @internal */
|
||||
async function computeElectronVersion(projectDir) {
|
||||
const result = await getElectronVersionFromInstalled(projectDir);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
const metadata = await (0, read_config_file_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json")));
|
||||
const dependency = metadata ? findFromPackageMetadata(metadata) : null;
|
||||
if ((dependency === null || dependency === void 0 ? void 0 : dependency.name) === "electron-nightly") {
|
||||
builder_util_1.log.info("You are using a nightly version of electron, be warned that those builds are highly unstable.");
|
||||
const feedXml = await nodeHttpExecutor_1.httpExecutor.request({
|
||||
hostname: "github.com",
|
||||
path: `/electron/nightlies/releases.atom`,
|
||||
headers: {
|
||||
accept: "application/xml, application/atom+xml, text/xml, */*",
|
||||
},
|
||||
});
|
||||
const feed = (0, builder_util_runtime_1.parseXml)(feedXml);
|
||||
const latestRelease = feed.element("entry", false, `No published versions on GitHub`);
|
||||
const v = /\/tag\/v?([^/]+)$/.exec(latestRelease.element("link").attribute("href"))[1];
|
||||
return v.startsWith("v") ? v.substring(1) : v;
|
||||
}
|
||||
else if ((dependency === null || dependency === void 0 ? void 0 : dependency.version) === "latest") {
|
||||
builder_util_1.log.warn('Electron version is set to "latest", but it is recommended to set it to some more restricted version range.');
|
||||
try {
|
||||
const releaseInfo = JSON.parse((await nodeHttpExecutor_1.httpExecutor.request({
|
||||
hostname: "github.com",
|
||||
path: `/electron/${dependency.name === "electron-nightly" ? "nightlies" : "electron"}/releases/latest`,
|
||||
headers: {
|
||||
accept: "application/json",
|
||||
},
|
||||
})));
|
||||
const version = releaseInfo.tag_name.startsWith("v") ? releaseInfo.tag_name.substring(1) : releaseInfo.tag_name;
|
||||
builder_util_1.log.info({ version }, `resolve ${dependency.name}@${dependency.version}`);
|
||||
return version;
|
||||
}
|
||||
catch (e) {
|
||||
builder_util_1.log.warn(e);
|
||||
}
|
||||
throw new builder_util_1.InvalidConfigurationError(`Cannot find electron dependency to get electron version in the '${path.join(projectDir, "package.json")}'`);
|
||||
}
|
||||
const version = dependency === null || dependency === void 0 ? void 0 : dependency.version;
|
||||
if (version == null || !/^\d/.test(version)) {
|
||||
const versionMessage = version == null ? "" : ` and version ("${version}") is not fixed in project`;
|
||||
throw new builder_util_1.InvalidConfigurationError(`Cannot compute electron version from installed node modules - none of the possible electron modules are installed${versionMessage}.\nSee https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246`);
|
||||
}
|
||||
return semver.coerce(version).format();
|
||||
}
|
||||
exports.computeElectronVersion = computeElectronVersion;
|
||||
function findFromPackageMetadata(packageData) {
|
||||
for (const name of electronPackages) {
|
||||
const devDependencies = packageData.devDependencies;
|
||||
let dep = devDependencies == null ? null : devDependencies[name];
|
||||
if (dep == null) {
|
||||
const dependencies = packageData.dependencies;
|
||||
dep = dependencies == null ? null : dependencies[name];
|
||||
}
|
||||
if (dep != null) {
|
||||
return { name, version: dep };
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//# sourceMappingURL=electronVersion.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/electron/electronVersion.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
2
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.d.ts
generated
vendored
Executable file
2
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.d.ts
generated
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
import { PrepareApplicationStageDirectoryOptions } from "../Framework";
|
||||
export default function injectFFMPEG(options: PrepareApplicationStageDirectoryOptions, electrionVersion: string): Promise<string>;
|
||||
43
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.js
generated
vendored
Executable file
43
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.js
generated
vendored
Executable file
@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const binDownload_1 = require("../binDownload");
|
||||
// NOTE: Adapted from https://github.com/MarshallOfSound/electron-packager-plugin-non-proprietary-codecs-ffmpeg to resolve dependency vulnerabilities
|
||||
const downloadFFMPEG = async (electronVersion, platform, arch) => {
|
||||
const ffmpegFileName = `ffmpeg-v${electronVersion}-${platform}-${arch}.zip`;
|
||||
const url = `https://github.com/electron/electron/releases/download/v${electronVersion}/${ffmpegFileName}`;
|
||||
builder_util_1.log.info({ file: ffmpegFileName }, "downloading non-proprietary FFMPEG");
|
||||
return (0, binDownload_1.getBin)(ffmpegFileName, url);
|
||||
};
|
||||
const copyFFMPEG = (targetPath, platform) => (sourcePath) => {
|
||||
let fileName = "ffmpeg.dll";
|
||||
if (["darwin", "mas"].includes(platform)) {
|
||||
fileName = "libffmpeg.dylib";
|
||||
}
|
||||
else if (platform === "linux") {
|
||||
fileName = "libffmpeg.so";
|
||||
}
|
||||
const libPath = path.resolve(sourcePath, fileName);
|
||||
const libTargetPath = path.resolve(targetPath, fileName);
|
||||
builder_util_1.log.info({ lib: libPath, target: libTargetPath }, "copying non-proprietary FFMPEG");
|
||||
// If the source doesn't exist we have a problem
|
||||
if (!fs.existsSync(libPath)) {
|
||||
throw new Error(`Failed to find FFMPEG library file at path: ${libPath}`);
|
||||
}
|
||||
// If we are copying to the source we can stop immediately
|
||||
if (libPath !== libTargetPath) {
|
||||
fs.copyFileSync(libPath, libTargetPath);
|
||||
}
|
||||
return libTargetPath;
|
||||
};
|
||||
function injectFFMPEG(options, electrionVersion) {
|
||||
let libPath = options.appOutDir;
|
||||
if (options.platformName === "darwin") {
|
||||
libPath = path.resolve(options.appOutDir, "Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries");
|
||||
}
|
||||
return downloadFFMPEG(electrionVersion, options.platformName, options.arch).then(copyFFMPEG(libPath, options.platformName));
|
||||
}
|
||||
exports.default = injectFFMPEG;
|
||||
//# sourceMappingURL=injectFFMPEG.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/electron/injectFFMPEG.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"injectFFMPEG.js","sourceRoot":"","sources":["../../src/electron/injectFFMPEG.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AACxB,6BAA4B;AAG5B,+CAAkC;AAClC,gDAAuC;AAGvC,qJAAqJ;AACrJ,MAAM,cAAc,GAAG,KAAK,EAAE,eAAuB,EAAE,QAA8B,EAAE,IAAY,EAAE,EAAE;IACrG,MAAM,cAAc,GAAG,WAAW,eAAe,IAAI,QAAQ,IAAI,IAAI,MAAM,CAAA;IAC3E,MAAM,GAAG,GAAG,2DAA2D,eAAe,IAAI,cAAc,EAAE,CAAA;IAE1G,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,oCAAoC,CAAC,CAAA;IACxE,OAAO,IAAA,oBAAM,EAAC,cAAc,EAAE,GAAG,CAAC,CAAA;AACpC,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,UAAkB,EAAE,QAA8B,EAAE,EAAE,CAAC,CAAC,UAAkB,EAAE,EAAE;IAChG,IAAI,QAAQ,GAAG,YAAY,CAAA;IAC3B,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,QAAQ,GAAG,iBAAiB,CAAA;IAC9B,CAAC;SAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,QAAQ,GAAG,cAAc,CAAA;IAC3B,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAClD,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IACxD,kBAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEnF,gDAAgD;IAChD,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,+CAA+C,OAAO,EAAE,CAAC,CAAA;IAC3E,CAAC;IAED,0DAA0D;IAC1D,IAAI,OAAO,KAAK,aAAa,EAAE,CAAC;QAC9B,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA;AAED,SAAwB,YAAY,CAAC,OAAgD,EAAE,gBAAwB;IAC7G,IAAI,OAAO,GAAG,OAAO,CAAC,SAAS,CAAA;IAC/B,IAAI,OAAO,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,oFAAoF,CAAC,CAAA;IACjI,CAAC;IAED,OAAO,cAAc,CAAC,gBAAgB,EAAE,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA;AAC7H,CAAC;AAPD,+BAOC","sourcesContent":["import * as fs from \"fs\"\nimport * as path from \"path\"\nimport { ElectronPlatformName } from \"./ElectronFramework\"\n\nimport { log } from \"builder-util\"\nimport { getBin } from \"../binDownload\"\nimport { PrepareApplicationStageDirectoryOptions } from \"../Framework\"\n\n// NOTE: Adapted from https://github.com/MarshallOfSound/electron-packager-plugin-non-proprietary-codecs-ffmpeg to resolve dependency vulnerabilities\nconst downloadFFMPEG = async (electronVersion: string, platform: ElectronPlatformName, arch: string) => {\n const ffmpegFileName = `ffmpeg-v${electronVersion}-${platform}-${arch}.zip`\n const url = `https://github.com/electron/electron/releases/download/v${electronVersion}/${ffmpegFileName}`\n\n log.info({ file: ffmpegFileName }, \"downloading non-proprietary FFMPEG\")\n return getBin(ffmpegFileName, url)\n}\n\nconst copyFFMPEG = (targetPath: string, platform: ElectronPlatformName) => (sourcePath: string) => {\n let fileName = \"ffmpeg.dll\"\n if ([\"darwin\", \"mas\"].includes(platform)) {\n fileName = \"libffmpeg.dylib\"\n } else if (platform === \"linux\") {\n fileName = \"libffmpeg.so\"\n }\n\n const libPath = path.resolve(sourcePath, fileName)\n const libTargetPath = path.resolve(targetPath, fileName)\n log.info({ lib: libPath, target: libTargetPath }, \"copying non-proprietary FFMPEG\")\n\n // If the source doesn't exist we have a problem\n if (!fs.existsSync(libPath)) {\n throw new Error(`Failed to find FFMPEG library file at path: ${libPath}`)\n }\n\n // If we are copying to the source we can stop immediately\n if (libPath !== libTargetPath) {\n fs.copyFileSync(libPath, libTargetPath)\n }\n return libTargetPath\n}\n\nexport default function injectFFMPEG(options: PrepareApplicationStageDirectoryOptions, electrionVersion: string) {\n let libPath = options.appOutDir\n if (options.platformName === \"darwin\") {\n libPath = path.resolve(options.appOutDir, \"Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries\")\n }\n\n return downloadFFMPEG(electrionVersion, options.platformName, options.arch).then(copyFFMPEG(libPath, options.platformName))\n}\n"]}
|
||||
1
mc_test/node_modules/app-builder-lib/out/errorMessages.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/errorMessages.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export declare const authorEmailIsMissed = "Please specify author 'email' in the application package.json\n\nSee https://docs.npmjs.com/files/package.json#people-fields-author-contributors\n\nIt is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.\n(see https://www.electron.build/configuration/linux).\n";
|
||||
11
mc_test/node_modules/app-builder-lib/out/errorMessages.js
generated
vendored
Executable file
11
mc_test/node_modules/app-builder-lib/out/errorMessages.js
generated
vendored
Executable file
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.authorEmailIsMissed = void 0;
|
||||
exports.authorEmailIsMissed = `Please specify author 'email' in the application package.json
|
||||
|
||||
See https://docs.npmjs.com/files/package.json#people-fields-author-contributors
|
||||
|
||||
It is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.
|
||||
(see https://www.electron.build/configuration/linux).
|
||||
`;
|
||||
//# sourceMappingURL=errorMessages.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/errorMessages.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/errorMessages.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"errorMessages.js","sourceRoot":"","sources":["../src/errorMessages.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;;;;;;CAMlC,CAAA","sourcesContent":["export const authorEmailIsMissed = `Please specify author 'email' in the application package.json\n\nSee https://docs.npmjs.com/files/package.json#people-fields-author-contributors\n\nIt is required to set Linux .deb package maintainer. Or you can set maintainer in the custom linux options.\n(see https://www.electron.build/configuration/linux).\n`\n"]}
|
||||
9
mc_test/node_modules/app-builder-lib/out/fileMatcher.d.ts
generated
vendored
Executable file
9
mc_test/node_modules/app-builder-lib/out/fileMatcher.d.ts
generated
vendored
Executable file
@ -0,0 +1,9 @@
|
||||
import { PlatformSpecificBuildOptions } from "./index";
|
||||
export declare const excludedNames: string;
|
||||
export declare const excludedExts: string;
|
||||
export interface GetFileMatchersOptions {
|
||||
readonly macroExpander: (pattern: string) => string;
|
||||
readonly customBuildOptions: PlatformSpecificBuildOptions;
|
||||
readonly globalOutDir: string;
|
||||
readonly defaultSrc: string;
|
||||
}
|
||||
284
mc_test/node_modules/app-builder-lib/out/fileMatcher.js
generated
vendored
Executable file
284
mc_test/node_modules/app-builder-lib/out/fileMatcher.js
generated
vendored
Executable file
@ -0,0 +1,284 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.copyFiles = exports.getFileMatchers = exports.getNodeModuleFileMatcher = exports.getMainFileMatchers = exports.FileMatcher = exports.excludedExts = exports.excludedNames = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const promises_1 = require("fs/promises");
|
||||
const minimatch_1 = require("minimatch");
|
||||
const path = require("path");
|
||||
const filter_1 = require("./util/filter");
|
||||
// https://github.com/electron-userland/electron-builder/issues/733
|
||||
const minimatchOptions = { dot: true };
|
||||
// noinspection SpellCheckingInspection
|
||||
exports.excludedNames = ".git,.hg,.svn,CVS,RCS,SCCS," +
|
||||
"__pycache__,.DS_Store,thumbs.db,.gitignore,.gitkeep,.gitattributes,.npmignore," +
|
||||
".idea,.vs,.flowconfig,.jshintrc,.eslintrc,.circleci," +
|
||||
".yarn-integrity,.yarn-metadata.json,yarn-error.log,yarn.lock,package-lock.json,npm-debug.log," +
|
||||
"appveyor.yml,.travis.yml,circle.yml,.nyc_output,.husky,.github,electron-builder.env";
|
||||
exports.excludedExts = "iml,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,suo,xproj,cc,d.ts," +
|
||||
// https://github.com/electron-userland/electron-builder/issues/7512
|
||||
"mk,a,o,forge-meta";
|
||||
function ensureNoEndSlash(file) {
|
||||
if (path.sep !== "/") {
|
||||
file = file.replace(/\//g, path.sep);
|
||||
}
|
||||
if (path.sep !== "\\") {
|
||||
file = file.replace(/\\/g, path.sep);
|
||||
}
|
||||
if (file.endsWith(path.sep)) {
|
||||
return file.substring(0, file.length - 1);
|
||||
}
|
||||
else {
|
||||
return file;
|
||||
}
|
||||
}
|
||||
/** @internal */
|
||||
class FileMatcher {
|
||||
constructor(from, to, macroExpander, patterns) {
|
||||
this.macroExpander = macroExpander;
|
||||
this.excludePatterns = null;
|
||||
this.from = ensureNoEndSlash(macroExpander(from));
|
||||
this.to = ensureNoEndSlash(macroExpander(to));
|
||||
this.patterns = (0, builder_util_1.asArray)(patterns).map(it => this.normalizePattern(it));
|
||||
this.isSpecifiedAsEmptyArray = Array.isArray(patterns) && patterns.length === 0;
|
||||
}
|
||||
normalizePattern(pattern) {
|
||||
if (pattern.startsWith("./")) {
|
||||
pattern = pattern.substring("./".length);
|
||||
}
|
||||
return path.posix.normalize(this.macroExpander(pattern.replace(/\\/g, "/")));
|
||||
}
|
||||
addPattern(pattern) {
|
||||
this.patterns.push(this.normalizePattern(pattern));
|
||||
}
|
||||
prependPattern(pattern) {
|
||||
this.patterns.unshift(this.normalizePattern(pattern));
|
||||
}
|
||||
isEmpty() {
|
||||
return this.patterns.length === 0;
|
||||
}
|
||||
containsOnlyIgnore() {
|
||||
return !this.isEmpty() && this.patterns.find(it => !it.startsWith("!")) == null;
|
||||
}
|
||||
computeParsedPatterns(result, fromDir) {
|
||||
const relativeFrom = fromDir == null ? null : path.relative(fromDir, this.from);
|
||||
if (this.patterns.length === 0 && relativeFrom != null) {
|
||||
// file mappings, from here is a file
|
||||
result.push(new minimatch_1.Minimatch(relativeFrom, minimatchOptions));
|
||||
return;
|
||||
}
|
||||
for (let pattern of this.patterns) {
|
||||
if (relativeFrom != null) {
|
||||
pattern = path.join(relativeFrom, pattern);
|
||||
}
|
||||
const parsedPattern = new minimatch_1.Minimatch(pattern, minimatchOptions);
|
||||
result.push(parsedPattern);
|
||||
// do not add if contains dot (possibly file if has extension)
|
||||
if (!pattern.includes(".") && !(0, filter_1.hasMagic)(parsedPattern)) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/545
|
||||
// add **/*
|
||||
result.push(new minimatch_1.Minimatch(`${pattern}/**/*`, minimatchOptions));
|
||||
}
|
||||
}
|
||||
}
|
||||
createFilter() {
|
||||
const parsedPatterns = [];
|
||||
this.computeParsedPatterns(parsedPatterns);
|
||||
return (0, filter_1.createFilter)(this.from, parsedPatterns, this.excludePatterns);
|
||||
}
|
||||
toString() {
|
||||
return `from: ${this.from}, to: ${this.to}, patterns: ${this.patterns.join(", ")}`;
|
||||
}
|
||||
}
|
||||
exports.FileMatcher = FileMatcher;
|
||||
/** @internal */
|
||||
function getMainFileMatchers(appDir, destination, macroExpander, platformSpecificBuildOptions, platformPackager, outDir, isElectronCompile) {
|
||||
const packager = platformPackager.info;
|
||||
const buildResourceDir = path.resolve(packager.projectDir, packager.buildResourcesDir);
|
||||
let matchers = packager.isPrepackedAppAsar
|
||||
? null
|
||||
: getFileMatchers(packager.config, "files", destination, {
|
||||
macroExpander,
|
||||
customBuildOptions: platformSpecificBuildOptions,
|
||||
globalOutDir: outDir,
|
||||
defaultSrc: appDir,
|
||||
});
|
||||
if (matchers == null) {
|
||||
matchers = [new FileMatcher(appDir, destination, macroExpander)];
|
||||
}
|
||||
const matcher = matchers[0];
|
||||
// add default patterns, but only if from equals to app dir
|
||||
if (matcher.from !== appDir) {
|
||||
return matchers;
|
||||
}
|
||||
// https://github.com/electron-userland/electron-builder/issues/1741#issuecomment-311111418 so, do not use inclusive patterns
|
||||
const patterns = matcher.patterns;
|
||||
const customFirstPatterns = [];
|
||||
// electron-webpack - we need to copy only package.json and node_modules from root dir (and these files are added by default), so, explicit empty array is specified
|
||||
if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {
|
||||
customFirstPatterns.push("**/*");
|
||||
}
|
||||
else if (!patterns.includes("package.json")) {
|
||||
patterns.push("package.json");
|
||||
}
|
||||
customFirstPatterns.push("!**/node_modules");
|
||||
// https://github.com/electron-userland/electron-builder/issues/1482
|
||||
const relativeBuildResourceDir = path.relative(matcher.from, buildResourceDir);
|
||||
if (relativeBuildResourceDir.length !== 0 && !relativeBuildResourceDir.startsWith(".")) {
|
||||
customFirstPatterns.push(`!${relativeBuildResourceDir}{,/**/*}`);
|
||||
}
|
||||
const relativeOutDir = matcher.normalizePattern(path.relative(packager.projectDir, outDir));
|
||||
if (!relativeOutDir.startsWith(".")) {
|
||||
customFirstPatterns.push(`!${relativeOutDir}{,/**/*}`);
|
||||
}
|
||||
// add our default exclusions after last user possibly defined "all"/permissive pattern
|
||||
let insertIndex = 0;
|
||||
for (let i = patterns.length - 1; i >= 0; i--) {
|
||||
if (patterns[i].startsWith("**/")) {
|
||||
insertIndex = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
patterns.splice(insertIndex, 0, ...customFirstPatterns);
|
||||
patterns.push(`!**/*.{${exports.excludedExts}${packager.config.includePdb === true ? "" : ",pdb"}}`);
|
||||
patterns.push("!**/._*");
|
||||
patterns.push("!**/electron-builder.{yaml,yml,json,json5,toml,ts}");
|
||||
patterns.push(`!**/{${exports.excludedNames}}`);
|
||||
if (isElectronCompile) {
|
||||
patterns.push("!.cache{,/**/*}");
|
||||
}
|
||||
patterns.push("!.yarn{,/**/*}");
|
||||
// https://github.com/electron-userland/electron-builder/issues/1969
|
||||
// exclude ony for app root, use .yarnclean to clean node_modules
|
||||
patterns.push("!.editorconfig");
|
||||
patterns.push("!.yarnrc.yml");
|
||||
const debugLogger = packager.debugLogger;
|
||||
if (debugLogger.isEnabled) {
|
||||
//tslint:disable-next-line:no-invalid-template-strings
|
||||
debugLogger.add(`${macroExpander("${arch}")}.firstOrDefaultFilePatterns`, patterns);
|
||||
}
|
||||
return matchers;
|
||||
}
|
||||
exports.getMainFileMatchers = getMainFileMatchers;
|
||||
/** @internal */
|
||||
function getNodeModuleFileMatcher(appDir, destination, macroExpander, platformSpecificBuildOptions, packager) {
|
||||
// https://github.com/electron-userland/electron-builder/pull/2948#issuecomment-392241632
|
||||
// grab only excludes
|
||||
const matcher = new FileMatcher(appDir, destination, macroExpander);
|
||||
function addPatterns(patterns) {
|
||||
if (patterns == null) {
|
||||
return;
|
||||
}
|
||||
else if (!Array.isArray(patterns)) {
|
||||
if (typeof patterns === "string" && patterns.startsWith("!")) {
|
||||
matcher.addPattern(patterns);
|
||||
return;
|
||||
}
|
||||
// ignore object form
|
||||
return;
|
||||
}
|
||||
for (const pattern of patterns) {
|
||||
if (typeof pattern === "string") {
|
||||
if (pattern.startsWith("!")) {
|
||||
matcher.addPattern(pattern);
|
||||
}
|
||||
}
|
||||
else {
|
||||
const fileSet = pattern;
|
||||
if (fileSet.from == null || fileSet.from === ".") {
|
||||
for (const p of (0, builder_util_1.asArray)(fileSet.filter)) {
|
||||
matcher.addPattern(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
addPatterns(packager.config.files);
|
||||
addPatterns(platformSpecificBuildOptions.files);
|
||||
if (!matcher.isEmpty()) {
|
||||
matcher.prependPattern("**/*");
|
||||
}
|
||||
const debugLogger = packager.debugLogger;
|
||||
if (debugLogger.isEnabled) {
|
||||
//tslint:disable-next-line:no-invalid-template-strings
|
||||
debugLogger.add(`${macroExpander("${arch}")}.nodeModuleFilePatterns`, matcher.patterns);
|
||||
}
|
||||
return matcher;
|
||||
}
|
||||
exports.getNodeModuleFileMatcher = getNodeModuleFileMatcher;
|
||||
/** @internal */
|
||||
function getFileMatchers(config, name, defaultDestination, options) {
|
||||
const defaultMatcher = new FileMatcher(options.defaultSrc, defaultDestination, options.macroExpander);
|
||||
const fileMatchers = [];
|
||||
function addPatterns(patterns) {
|
||||
if (patterns == null) {
|
||||
return;
|
||||
}
|
||||
else if (!Array.isArray(patterns)) {
|
||||
if (typeof patterns === "string") {
|
||||
defaultMatcher.addPattern(patterns);
|
||||
return;
|
||||
}
|
||||
patterns = [patterns];
|
||||
}
|
||||
for (const pattern of patterns) {
|
||||
if (typeof pattern === "string") {
|
||||
// use normalize to transform ./foo to foo
|
||||
defaultMatcher.addPattern(pattern);
|
||||
}
|
||||
else if (name === "asarUnpack") {
|
||||
throw new Error(`Advanced file copying not supported for "${name}"`);
|
||||
}
|
||||
else {
|
||||
const from = pattern.from == null ? options.defaultSrc : path.resolve(options.defaultSrc, pattern.from);
|
||||
const to = pattern.to == null ? defaultDestination : path.resolve(defaultDestination, pattern.to);
|
||||
fileMatchers.push(new FileMatcher(from, to, options.macroExpander, pattern.filter));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (name !== "extraDistFiles") {
|
||||
addPatterns(config[name]);
|
||||
}
|
||||
addPatterns(options.customBuildOptions[name]);
|
||||
if (!defaultMatcher.isEmpty()) {
|
||||
// default matcher should be first in the array
|
||||
fileMatchers.unshift(defaultMatcher);
|
||||
}
|
||||
// we cannot exclude the whole out dir, because sometimes users want to use some file in the out dir in the patterns
|
||||
const relativeOutDir = defaultMatcher.normalizePattern(path.relative(options.defaultSrc, options.globalOutDir));
|
||||
if (!relativeOutDir.startsWith(".")) {
|
||||
defaultMatcher.addPattern(`!${relativeOutDir}/*-unpacked{,/**/*}`);
|
||||
}
|
||||
return fileMatchers.length === 0 ? null : fileMatchers;
|
||||
}
|
||||
exports.getFileMatchers = getFileMatchers;
|
||||
/** @internal */
|
||||
function copyFiles(matchers, transformer, isUseHardLink) {
|
||||
if (matchers == null || matchers.length === 0) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return bluebird_lst_1.default.map(matchers, async (matcher) => {
|
||||
const fromStat = await (0, fs_1.statOrNull)(matcher.from);
|
||||
if (fromStat == null) {
|
||||
builder_util_1.log.warn({ from: matcher.from }, `file source doesn't exist`);
|
||||
return;
|
||||
}
|
||||
if (fromStat.isFile()) {
|
||||
const toStat = await (0, fs_1.statOrNull)(matcher.to);
|
||||
// https://github.com/electron-userland/electron-builder/issues/1245
|
||||
if (toStat != null && toStat.isDirectory()) {
|
||||
return await (0, fs_1.copyOrLinkFile)(matcher.from, path.join(matcher.to, path.basename(matcher.from)), fromStat, isUseHardLink);
|
||||
}
|
||||
await (0, promises_1.mkdir)(path.dirname(matcher.to), { recursive: true });
|
||||
return await (0, fs_1.copyOrLinkFile)(matcher.from, matcher.to, fromStat);
|
||||
}
|
||||
if (matcher.isEmpty() || matcher.containsOnlyIgnore()) {
|
||||
matcher.prependPattern("**/*");
|
||||
}
|
||||
builder_util_1.log.debug({ matcher }, "copying files using pattern");
|
||||
return await (0, fs_1.copyDir)(matcher.from, matcher.to, { filter: matcher.createFilter(), transformer, isUseHardLink: isUseHardLink ? fs_1.USE_HARD_LINKS : null });
|
||||
});
|
||||
}
|
||||
exports.copyFiles = copyFiles;
|
||||
//# sourceMappingURL=fileMatcher.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/fileMatcher.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/fileMatcher.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
1
mc_test/node_modules/app-builder-lib/out/fileTransformer.d.ts
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/fileTransformer.d.ts
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
export {};
|
||||
106
mc_test/node_modules/app-builder-lib/out/fileTransformer.js
generated
vendored
Executable file
106
mc_test/node_modules/app-builder-lib/out/fileTransformer.js
generated
vendored
Executable file
@ -0,0 +1,106 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createElectronCompilerHost = exports.createTransformer = exports.hasDep = exports.isElectronCompileUsed = exports.NODE_MODULES_PATTERN = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
/** @internal */
|
||||
exports.NODE_MODULES_PATTERN = `${path.sep}node_modules${path.sep}`;
|
||||
/** @internal */
|
||||
function isElectronCompileUsed(info) {
|
||||
if (info.config.electronCompile != null) {
|
||||
return info.config.electronCompile;
|
||||
}
|
||||
// if in devDependencies - it means that babel is used for precompilation or for some reason user decided to not use electron-compile for production
|
||||
return hasDep("electron-compile", info);
|
||||
}
|
||||
exports.isElectronCompileUsed = isElectronCompileUsed;
|
||||
/** @internal */
|
||||
function hasDep(name, info) {
|
||||
const deps = info.metadata.dependencies;
|
||||
return deps != null && name in deps;
|
||||
}
|
||||
exports.hasDep = hasDep;
|
||||
/** @internal */
|
||||
function createTransformer(srcDir, configuration, extraMetadata, extraTransformer) {
|
||||
const mainPackageJson = path.join(srcDir, "package.json");
|
||||
const isRemovePackageScripts = configuration.removePackageScripts !== false;
|
||||
const isRemovePackageKeywords = configuration.removePackageKeywords !== false;
|
||||
const packageJson = path.sep + "package.json";
|
||||
return file => {
|
||||
if (file === mainPackageJson) {
|
||||
return modifyMainPackageJson(file, extraMetadata, isRemovePackageScripts, isRemovePackageKeywords);
|
||||
}
|
||||
if (file.endsWith(packageJson) && file.includes(exports.NODE_MODULES_PATTERN)) {
|
||||
return (0, promises_1.readFile)(file, "utf-8")
|
||||
.then(it => cleanupPackageJson(JSON.parse(it), {
|
||||
isMain: false,
|
||||
isRemovePackageScripts,
|
||||
isRemovePackageKeywords,
|
||||
}))
|
||||
.catch((e) => builder_util_1.log.warn(e));
|
||||
}
|
||||
else if (extraTransformer != null) {
|
||||
return extraTransformer(file);
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
exports.createTransformer = createTransformer;
|
||||
/** @internal */
|
||||
function createElectronCompilerHost(projectDir, cacheDir) {
|
||||
const electronCompilePath = path.join(projectDir, "node_modules", "electron-compile", "lib");
|
||||
return require(path.join(electronCompilePath, "config-parser")).createCompilerHostFromProjectRoot(projectDir, cacheDir);
|
||||
}
|
||||
exports.createElectronCompilerHost = createElectronCompilerHost;
|
||||
const ignoredPackageMetadataProperties = new Set(["dist", "gitHead", "build", "jspm", "ava", "xo", "nyc", "eslintConfig", "contributors", "bundleDependencies", "tags"]);
|
||||
function cleanupPackageJson(data, options) {
|
||||
const deps = data.dependencies;
|
||||
// https://github.com/electron-userland/electron-builder/issues/507#issuecomment-312772099
|
||||
const isRemoveBabel = deps != null && typeof deps === "object" && !Object.getOwnPropertyNames(deps).some(it => it.startsWith("babel"));
|
||||
try {
|
||||
let changed = false;
|
||||
for (const prop of Object.getOwnPropertyNames(data)) {
|
||||
// removing devDependencies from package.json breaks levelup in electron, so, remove it only from main package.json
|
||||
if (prop[0] === "_" ||
|
||||
ignoredPackageMetadataProperties.has(prop) ||
|
||||
(options.isRemovePackageScripts && prop === "scripts") ||
|
||||
(options.isRemovePackageKeywords && prop === "keywords") ||
|
||||
(options.isMain && prop === "devDependencies") ||
|
||||
(!options.isMain && prop === "bugs") ||
|
||||
(isRemoveBabel && prop === "babel")) {
|
||||
delete data[prop];
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
return JSON.stringify(data, null, 2);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
(0, builder_util_1.debug)(e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
async function modifyMainPackageJson(file, extraMetadata, isRemovePackageScripts, isRemovePackageKeywords) {
|
||||
const mainPackageData = JSON.parse(await (0, promises_1.readFile)(file, "utf-8"));
|
||||
if (extraMetadata != null) {
|
||||
(0, builder_util_1.deepAssign)(mainPackageData, extraMetadata);
|
||||
}
|
||||
// https://github.com/electron-userland/electron-builder/issues/1212
|
||||
const serializedDataIfChanged = cleanupPackageJson(mainPackageData, {
|
||||
isMain: true,
|
||||
isRemovePackageScripts,
|
||||
isRemovePackageKeywords,
|
||||
});
|
||||
if (serializedDataIfChanged != null) {
|
||||
return serializedDataIfChanged;
|
||||
}
|
||||
else if (extraMetadata != null) {
|
||||
return JSON.stringify(mainPackageData, null, 2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//# sourceMappingURL=fileTransformer.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/fileTransformer.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/fileTransformer.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
5
mc_test/node_modules/app-builder-lib/out/forge-maker.d.ts
generated
vendored
Executable file
5
mc_test/node_modules/app-builder-lib/out/forge-maker.d.ts
generated
vendored
Executable file
@ -0,0 +1,5 @@
|
||||
import { PackagerOptions } from "./packagerApi";
|
||||
export interface ForgeOptions {
|
||||
readonly dir: string;
|
||||
}
|
||||
export declare function buildForge(forgeOptions: ForgeOptions, options: PackagerOptions): Promise<string[]>;
|
||||
20
mc_test/node_modules/app-builder-lib/out/forge-maker.js
generated
vendored
Executable file
20
mc_test/node_modules/app-builder-lib/out/forge-maker.js
generated
vendored
Executable file
@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.buildForge = void 0;
|
||||
const path = require("path");
|
||||
const index_1 = require("./index");
|
||||
function buildForge(forgeOptions, options) {
|
||||
const appDir = forgeOptions.dir;
|
||||
return (0, index_1.build)({
|
||||
prepackaged: appDir,
|
||||
config: {
|
||||
directories: {
|
||||
// https://github.com/electron-userland/electron-forge/blob/master/src/makers/generic/zip.js
|
||||
output: path.resolve(appDir, "..", "make"),
|
||||
},
|
||||
},
|
||||
...options,
|
||||
});
|
||||
}
|
||||
exports.buildForge = buildForge;
|
||||
//# sourceMappingURL=forge-maker.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/forge-maker.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/forge-maker.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"forge-maker.js","sourceRoot":"","sources":["../src/forge-maker.ts"],"names":[],"mappings":";;;AAAA,6BAA4B;AAC5B,mCAA+B;AAO/B,SAAgB,UAAU,CAAC,YAA0B,EAAE,OAAwB;IAC7E,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAA;IAC/B,OAAO,IAAA,aAAK,EAAC;QACX,WAAW,EAAE,MAAM;QACnB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,4FAA4F;gBAC5F,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC;aAC3C;SACF;QACD,GAAG,OAAO;KACX,CAAC,CAAA;AACJ,CAAC;AAZD,gCAYC","sourcesContent":["import * as path from \"path\"\nimport { build } from \"./index\"\nimport { PackagerOptions } from \"./packagerApi\"\n\nexport interface ForgeOptions {\n readonly dir: string\n}\n\nexport function buildForge(forgeOptions: ForgeOptions, options: PackagerOptions) {\n const appDir = forgeOptions.dir\n return build({\n prepackaged: appDir,\n config: {\n directories: {\n // https://github.com/electron-userland/electron-forge/blob/master/src/makers/generic/zip.js\n output: path.resolve(appDir, \"..\", \"make\"),\n },\n },\n ...options,\n })\n}\n"]}
|
||||
21
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.d.ts
generated
vendored
Executable file
21
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.d.ts
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
import { AfterPackContext } from "../configuration";
|
||||
import { Platform } from "../core";
|
||||
import { Framework, PrepareApplicationStageDirectoryOptions } from "../Framework";
|
||||
export declare class LibUiFramework implements Framework {
|
||||
readonly version: string;
|
||||
readonly distMacOsAppName: string;
|
||||
protected readonly isUseLaunchUi: boolean;
|
||||
readonly name: string;
|
||||
readonly macOsDefaultTargets: string[];
|
||||
readonly defaultAppIdPrefix: string;
|
||||
readonly isCopyElevateHelper = false;
|
||||
readonly isNpmRebuildRequired = false;
|
||||
constructor(version: string, distMacOsAppName: string, isUseLaunchUi: boolean);
|
||||
prepareApplicationStageDirectory(options: PrepareApplicationStageDirectoryOptions): Promise<void>;
|
||||
private prepareMacosApplicationStageDirectory;
|
||||
private prepareLinuxApplicationStageDirectory;
|
||||
afterPack(context: AfterPackContext): Promise<void>;
|
||||
getMainFile(platform: Platform): string | null;
|
||||
private isUseLaunchUiForPlatform;
|
||||
getExcludedDependencies(platform: Platform): Array<string> | null;
|
||||
}
|
||||
108
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js
generated
vendored
Executable file
108
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js
generated
vendored
Executable file
@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LibUiFramework = void 0;
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const core_1 = require("../core");
|
||||
const appBuilder_1 = require("../util/appBuilder");
|
||||
class LibUiFramework {
|
||||
constructor(version, distMacOsAppName, isUseLaunchUi) {
|
||||
this.version = version;
|
||||
this.distMacOsAppName = distMacOsAppName;
|
||||
this.isUseLaunchUi = isUseLaunchUi;
|
||||
this.name = "libui";
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.macOsDefaultTargets = ["dmg"];
|
||||
this.defaultAppIdPrefix = "com.libui.";
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.isCopyElevateHelper = false;
|
||||
// noinspection JSUnusedGlobalSymbols
|
||||
this.isNpmRebuildRequired = false;
|
||||
}
|
||||
async prepareApplicationStageDirectory(options) {
|
||||
await (0, fs_extra_1.emptyDir)(options.appOutDir);
|
||||
const packager = options.packager;
|
||||
const platform = packager.platform;
|
||||
if (this.isUseLaunchUiForPlatform(platform)) {
|
||||
const appOutDir = options.appOutDir;
|
||||
await (0, builder_util_1.executeAppBuilder)([
|
||||
"proton-native",
|
||||
"--node-version",
|
||||
this.version,
|
||||
"--use-launch-ui",
|
||||
"--platform",
|
||||
platform.nodeName,
|
||||
"--arch",
|
||||
options.arch,
|
||||
"--stage",
|
||||
appOutDir,
|
||||
"--executable",
|
||||
`${packager.appInfo.productFilename}${platform === core_1.Platform.WINDOWS ? ".exe" : ""}`,
|
||||
]);
|
||||
return;
|
||||
}
|
||||
if (platform === core_1.Platform.MAC) {
|
||||
await this.prepareMacosApplicationStageDirectory(packager, options);
|
||||
}
|
||||
else if (platform === core_1.Platform.LINUX) {
|
||||
await this.prepareLinuxApplicationStageDirectory(options);
|
||||
}
|
||||
}
|
||||
async prepareMacosApplicationStageDirectory(packager, options) {
|
||||
const appContentsDir = path.join(options.appOutDir, this.distMacOsAppName, "Contents");
|
||||
await (0, promises_1.mkdir)(path.join(appContentsDir, "Resources"), { recursive: true });
|
||||
await (0, promises_1.mkdir)(path.join(appContentsDir, "MacOS"), { recursive: true });
|
||||
await (0, builder_util_1.executeAppBuilder)(["proton-native", "--node-version", this.version, "--platform", "darwin", "--stage", path.join(appContentsDir, "MacOS")]);
|
||||
const appPlist = {
|
||||
// https://github.com/albe-rosado/create-proton-app/issues/13
|
||||
NSHighResolutionCapable: true,
|
||||
};
|
||||
await packager.applyCommonInfo(appPlist, appContentsDir);
|
||||
await Promise.all([
|
||||
(0, appBuilder_1.executeAppBuilderAndWriteJson)(["encode-plist"], { [path.join(appContentsDir, "Info.plist")]: appPlist }),
|
||||
writeExecutableMain(path.join(appContentsDir, "MacOS", appPlist.CFBundleExecutable), `#!/bin/sh
|
||||
DIR=$(dirname "$0")
|
||||
"$DIR/node" "$DIR/../Resources/app/${options.packager.info.metadata.main || "index.js"}"
|
||||
`),
|
||||
]);
|
||||
}
|
||||
async prepareLinuxApplicationStageDirectory(options) {
|
||||
const appOutDir = options.appOutDir;
|
||||
await (0, builder_util_1.executeAppBuilder)(["proton-native", "--node-version", this.version, "--platform", "linux", "--arch", options.arch, "--stage", appOutDir]);
|
||||
const mainPath = path.join(appOutDir, options.packager.executableName);
|
||||
await writeExecutableMain(mainPath, `#!/bin/sh
|
||||
DIR=$(dirname "$0")
|
||||
"$DIR/node" "$DIR/app/${options.packager.info.metadata.main || "index.js"}"
|
||||
`);
|
||||
}
|
||||
async afterPack(context) {
|
||||
const packager = context.packager;
|
||||
if (!this.isUseLaunchUiForPlatform(packager.platform)) {
|
||||
return;
|
||||
}
|
||||
// LaunchUI requires main.js, rename if need
|
||||
const userMain = packager.info.metadata.main || "index.js";
|
||||
if (userMain === "main.js") {
|
||||
return;
|
||||
}
|
||||
await (0, promises_1.rename)(path.join(context.appOutDir, "app", userMain), path.join(context.appOutDir, "app", "main.js"));
|
||||
}
|
||||
getMainFile(platform) {
|
||||
return this.isUseLaunchUiForPlatform(platform) ? "main.js" : null;
|
||||
}
|
||||
isUseLaunchUiForPlatform(platform) {
|
||||
return platform === core_1.Platform.WINDOWS || (this.isUseLaunchUi && platform === core_1.Platform.LINUX);
|
||||
}
|
||||
getExcludedDependencies(platform) {
|
||||
// part of launchui
|
||||
return this.isUseLaunchUiForPlatform(platform) ? ["libui-node"] : null;
|
||||
}
|
||||
}
|
||||
exports.LibUiFramework = LibUiFramework;
|
||||
async function writeExecutableMain(file, content) {
|
||||
await (0, promises_1.writeFile)(file, content, { mode: 0o755 });
|
||||
await (0, promises_1.chmod)(file, 0o755);
|
||||
}
|
||||
//# sourceMappingURL=LibUiFramework.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/frameworks/LibUiFramework.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
34
mc_test/node_modules/app-builder-lib/out/index.d.ts
generated
vendored
Executable file
34
mc_test/node_modules/app-builder-lib/out/index.d.ts
generated
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
import { PublishOptions } from "electron-publish/out/publisher";
|
||||
import { Packager } from "./packager";
|
||||
import { PackagerOptions } from "./packagerApi";
|
||||
export { Packager, BuildResult } from "./packager";
|
||||
export { PackagerOptions, ArtifactCreated, ArtifactBuildStarted } from "./packagerApi";
|
||||
export { TargetConfiguration, Platform, Target, DIR_TARGET, BeforeBuildContext, SourceRepositoryInfo, TargetSpecificOptions, TargetConfigType, DEFAULT_TARGET, CompressionLevel, } from "./core";
|
||||
export { getArchSuffix, Arch, archFromString } from "builder-util";
|
||||
export { Configuration, AfterPackContext, MetadataDirectories } from "./configuration";
|
||||
export { ElectronBrandingOptions, ElectronDownloadOptions, ElectronPlatformName } from "./electron/ElectronFramework";
|
||||
export { PlatformSpecificBuildOptions, AsarOptions, FileSet, Protocol, ReleaseInfo } from "./options/PlatformSpecificBuildOptions";
|
||||
export { FileAssociation } from "./options/FileAssociation";
|
||||
export { MacConfiguration, DmgOptions, MasConfiguration, MacOsTargetName, DmgContent, DmgWindow, NotarizeLegacyOptions, NotarizeNotaryOptions } from "./options/macOptions";
|
||||
export { PkgOptions, PkgBackgroundOptions, BackgroundAlignment, BackgroundScaling } from "./options/pkgOptions";
|
||||
export { WindowsConfiguration } from "./options/winOptions";
|
||||
export { AppXOptions } from "./options/AppXOptions";
|
||||
export { MsiOptions } from "./options/MsiOptions";
|
||||
export { MsiWrappedOptions } from "./options/MsiWrappedOptions";
|
||||
export { CommonWindowsInstallerConfiguration } from "./options/CommonWindowsInstallerConfiguration";
|
||||
export { NsisOptions, NsisWebOptions, PortableOptions, CommonNsisOptions } from "./targets/nsis/nsisOptions";
|
||||
export { LinuxConfiguration, DebOptions, CommonLinuxOptions, LinuxTargetSpecificOptions, AppImageOptions, FlatpakOptions } from "./options/linuxOptions";
|
||||
export { SnapOptions, PlugDescriptor, SlotDescriptor } from "./options/SnapOptions";
|
||||
export { Metadata, AuthorMetadata, RepositoryInfo } from "./options/metadata";
|
||||
export { AppInfo } from "./appInfo";
|
||||
export { SquirrelWindowsOptions } from "./options/SquirrelWindowsOptions";
|
||||
export { CustomMacSign, CustomMacSignOptions } from "./macPackager";
|
||||
export { WindowsSignOptions, CustomWindowsSignTaskConfiguration, WindowsSignTaskConfiguration, CustomWindowsSign, FileCodeSigningInfo, CertificateFromStoreInfo, } from "./codeSign/windowsCodeSign";
|
||||
export { CancellationToken, ProgressInfo } from "builder-util-runtime";
|
||||
export { PublishOptions, UploadTask } from "electron-publish";
|
||||
export { PublishManager } from "./publish/PublishManager";
|
||||
export { PlatformPackager } from "./platformPackager";
|
||||
export { Framework, PrepareApplicationStageDirectoryOptions } from "./Framework";
|
||||
export { buildForge, ForgeOptions } from "./forge-maker";
|
||||
export declare function checkBuildRequestOptions(options: PackagerOptions & PublishOptions): void;
|
||||
export declare function build(options: PackagerOptions & PublishOptions, packager?: Packager): Promise<Array<string>>;
|
||||
89
mc_test/node_modules/app-builder-lib/out/index.js
generated
vendored
Executable file
89
mc_test/node_modules/app-builder-lib/out/index.js
generated
vendored
Executable file
@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.build = exports.checkBuildRequestOptions = exports.buildForge = exports.PlatformPackager = exports.PublishManager = exports.CancellationToken = exports.AppInfo = exports.archFromString = exports.Arch = exports.getArchSuffix = exports.DEFAULT_TARGET = exports.DIR_TARGET = exports.Target = exports.Platform = exports.Packager = void 0;
|
||||
const promise_1 = require("builder-util/out/promise");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const builder_util_runtime_1 = require("builder-util-runtime");
|
||||
const packager_1 = require("./packager");
|
||||
const platformPackager_1 = require("./platformPackager");
|
||||
const PublishManager_1 = require("./publish/PublishManager");
|
||||
var packager_2 = require("./packager");
|
||||
Object.defineProperty(exports, "Packager", { enumerable: true, get: function () { return packager_2.Packager; } });
|
||||
var core_1 = require("./core");
|
||||
Object.defineProperty(exports, "Platform", { enumerable: true, get: function () { return core_1.Platform; } });
|
||||
Object.defineProperty(exports, "Target", { enumerable: true, get: function () { return core_1.Target; } });
|
||||
Object.defineProperty(exports, "DIR_TARGET", { enumerable: true, get: function () { return core_1.DIR_TARGET; } });
|
||||
Object.defineProperty(exports, "DEFAULT_TARGET", { enumerable: true, get: function () { return core_1.DEFAULT_TARGET; } });
|
||||
var builder_util_2 = require("builder-util");
|
||||
Object.defineProperty(exports, "getArchSuffix", { enumerable: true, get: function () { return builder_util_2.getArchSuffix; } });
|
||||
Object.defineProperty(exports, "Arch", { enumerable: true, get: function () { return builder_util_2.Arch; } });
|
||||
Object.defineProperty(exports, "archFromString", { enumerable: true, get: function () { return builder_util_2.archFromString; } });
|
||||
var appInfo_1 = require("./appInfo");
|
||||
Object.defineProperty(exports, "AppInfo", { enumerable: true, get: function () { return appInfo_1.AppInfo; } });
|
||||
var builder_util_runtime_2 = require("builder-util-runtime");
|
||||
Object.defineProperty(exports, "CancellationToken", { enumerable: true, get: function () { return builder_util_runtime_2.CancellationToken; } });
|
||||
var PublishManager_2 = require("./publish/PublishManager");
|
||||
Object.defineProperty(exports, "PublishManager", { enumerable: true, get: function () { return PublishManager_2.PublishManager; } });
|
||||
var platformPackager_2 = require("./platformPackager");
|
||||
Object.defineProperty(exports, "PlatformPackager", { enumerable: true, get: function () { return platformPackager_2.PlatformPackager; } });
|
||||
var forge_maker_1 = require("./forge-maker");
|
||||
Object.defineProperty(exports, "buildForge", { enumerable: true, get: function () { return forge_maker_1.buildForge; } });
|
||||
const expectedOptions = new Set(["publish", "targets", "mac", "win", "linux", "projectDir", "platformPackagerFactory", "config", "effectiveOptionComputed", "prepackaged"]);
|
||||
function checkBuildRequestOptions(options) {
|
||||
for (const optionName of Object.keys(options)) {
|
||||
if (!expectedOptions.has(optionName) && options[optionName] !== undefined) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Unknown option "${optionName}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.checkBuildRequestOptions = checkBuildRequestOptions;
|
||||
function build(options, packager = new packager_1.Packager(options)) {
|
||||
checkBuildRequestOptions(options);
|
||||
const publishManager = new PublishManager_1.PublishManager(packager, options);
|
||||
const sigIntHandler = () => {
|
||||
builder_util_1.log.warn("cancelled by SIGINT");
|
||||
packager.cancellationToken.cancel();
|
||||
publishManager.cancelTasks();
|
||||
};
|
||||
process.once("SIGINT", sigIntHandler);
|
||||
const promise = packager.build().then(async (buildResult) => {
|
||||
const afterAllArtifactBuild = await (0, platformPackager_1.resolveFunction)(packager.appInfo.type, buildResult.configuration.afterAllArtifactBuild, "afterAllArtifactBuild");
|
||||
if (afterAllArtifactBuild != null) {
|
||||
const newArtifacts = (0, builder_util_runtime_1.asArray)(await Promise.resolve(afterAllArtifactBuild(buildResult)));
|
||||
if (newArtifacts.length === 0 || !publishManager.isPublish) {
|
||||
return buildResult.artifactPaths;
|
||||
}
|
||||
const publishConfigurations = await publishManager.getGlobalPublishConfigurations();
|
||||
if (publishConfigurations == null || publishConfigurations.length === 0) {
|
||||
return buildResult.artifactPaths;
|
||||
}
|
||||
for (const newArtifact of newArtifacts) {
|
||||
if (buildResult.artifactPaths.includes(newArtifact)) {
|
||||
builder_util_1.log.warn({ newArtifact }, "skipping publish of artifact, already published");
|
||||
continue;
|
||||
}
|
||||
buildResult.artifactPaths.push(newArtifact);
|
||||
for (const publishConfiguration of publishConfigurations) {
|
||||
publishManager.scheduleUpload(publishConfiguration, {
|
||||
file: newArtifact,
|
||||
arch: null,
|
||||
}, packager.appInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
return buildResult.artifactPaths;
|
||||
});
|
||||
return (0, promise_1.executeFinally)(promise, isErrorOccurred => {
|
||||
let promise;
|
||||
if (isErrorOccurred) {
|
||||
publishManager.cancelTasks();
|
||||
promise = Promise.resolve(null);
|
||||
}
|
||||
else {
|
||||
promise = publishManager.awaitTasks();
|
||||
}
|
||||
return promise.then(() => process.removeListener("SIGINT", sigIntHandler));
|
||||
});
|
||||
}
|
||||
exports.build = build;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/index.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/index.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
12
mc_test/node_modules/app-builder-lib/out/linuxPackager.d.ts
generated
vendored
Executable file
12
mc_test/node_modules/app-builder-lib/out/linuxPackager.d.ts
generated
vendored
Executable file
@ -0,0 +1,12 @@
|
||||
import { Arch } from "builder-util";
|
||||
import { Target } from "./core";
|
||||
import { LinuxConfiguration } from "./options/linuxOptions";
|
||||
import { Packager } from "./packager";
|
||||
import { PlatformPackager } from "./platformPackager";
|
||||
export declare class LinuxPackager extends PlatformPackager<LinuxConfiguration> {
|
||||
readonly executableName: string;
|
||||
constructor(info: Packager);
|
||||
get defaultTarget(): Array<string>;
|
||||
createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void;
|
||||
}
|
||||
export declare function toAppImageOrSnapArch(arch: Arch): string;
|
||||
77
mc_test/node_modules/app-builder-lib/out/linuxPackager.js
generated
vendored
Executable file
77
mc_test/node_modules/app-builder-lib/out/linuxPackager.js
generated
vendored
Executable file
@ -0,0 +1,77 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.toAppImageOrSnapArch = exports.LinuxPackager = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const core_1 = require("./core");
|
||||
const platformPackager_1 = require("./platformPackager");
|
||||
const LinuxTargetHelper_1 = require("./targets/LinuxTargetHelper");
|
||||
const targetFactory_1 = require("./targets/targetFactory");
|
||||
const filename_1 = require("./util/filename");
|
||||
class LinuxPackager extends platformPackager_1.PlatformPackager {
|
||||
constructor(info) {
|
||||
var _a;
|
||||
super(info, core_1.Platform.LINUX);
|
||||
const executableName = (_a = this.platformSpecificBuildOptions.executableName) !== null && _a !== void 0 ? _a : info.config.executableName;
|
||||
this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : (0, filename_1.sanitizeFileName)(executableName);
|
||||
}
|
||||
get defaultTarget() {
|
||||
return ["snap", "appimage"];
|
||||
}
|
||||
createTargets(targets, mapper) {
|
||||
let helper;
|
||||
const getHelper = () => {
|
||||
if (helper == null) {
|
||||
helper = new LinuxTargetHelper_1.LinuxTargetHelper(this);
|
||||
}
|
||||
return helper;
|
||||
};
|
||||
for (const name of targets) {
|
||||
if (name === core_1.DIR_TARGET) {
|
||||
continue;
|
||||
}
|
||||
const targetClass = (() => {
|
||||
switch (name) {
|
||||
case "appimage":
|
||||
return require("./targets/AppImageTarget").default;
|
||||
case "snap":
|
||||
return require("./targets/snap").default;
|
||||
case "flatpak":
|
||||
return require("./targets/FlatpakTarget").default;
|
||||
case "deb":
|
||||
case "rpm":
|
||||
case "sh":
|
||||
case "freebsd":
|
||||
case "pacman":
|
||||
case "apk":
|
||||
case "p5p":
|
||||
return require("./targets/FpmTarget").default;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
})();
|
||||
mapper(name, outDir => {
|
||||
if (targetClass === null) {
|
||||
return (0, targetFactory_1.createCommonTarget)(name, outDir, this);
|
||||
}
|
||||
return new targetClass(name, this, getHelper(), outDir);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.LinuxPackager = LinuxPackager;
|
||||
function toAppImageOrSnapArch(arch) {
|
||||
switch (arch) {
|
||||
case builder_util_1.Arch.x64:
|
||||
return "x86_64";
|
||||
case builder_util_1.Arch.ia32:
|
||||
return "i386";
|
||||
case builder_util_1.Arch.armv7l:
|
||||
return "arm";
|
||||
case builder_util_1.Arch.arm64:
|
||||
return "arm_aarch64";
|
||||
default:
|
||||
throw new Error(`Unsupported arch ${arch}`);
|
||||
}
|
||||
}
|
||||
exports.toAppImageOrSnapArch = toAppImageOrSnapArch;
|
||||
//# sourceMappingURL=linuxPackager.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/linuxPackager.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/linuxPackager.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"linuxPackager.js","sourceRoot":"","sources":["../src/linuxPackager.ts"],"names":[],"mappings":";;;AAAA,+CAAmC;AACnC,iCAAqD;AAGrD,yDAAqD;AAIrD,mEAA+D;AAE/D,2DAA4D;AAC5D,8CAAkD;AAElD,MAAa,aAAc,SAAQ,mCAAoC;IAGrE,YAAY,IAAc;;QACxB,KAAK,CAAC,IAAI,EAAE,eAAQ,CAAC,KAAK,CAAC,CAAA;QAE3B,MAAM,cAAc,GAAG,MAAA,IAAI,CAAC,4BAA4B,CAAC,cAAc,mCAAI,IAAI,CAAC,MAAM,CAAC,cAAc,CAAA;QACrG,IAAI,CAAC,cAAc,GAAG,cAAc,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAA,2BAAgB,EAAC,cAAc,CAAC,CAAA;IAC5H,CAAC;IAED,IAAI,aAAa;QACf,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7B,CAAC;IAED,aAAa,CAAC,OAAsB,EAAE,MAAmE;QACvG,IAAI,MAAgC,CAAA;QACpC,MAAM,SAAS,GAAG,GAAG,EAAE;YACrB,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;gBACnB,MAAM,GAAG,IAAI,qCAAiB,CAAC,IAAI,CAAC,CAAA;YACtC,CAAC;YACD,OAAO,MAAM,CAAA;QACf,CAAC,CAAA;QAED,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAC3B,IAAI,IAAI,KAAK,iBAAU,EAAE,CAAC;gBACxB,SAAQ;YACV,CAAC;YAED,MAAM,WAAW,GAA+F,CAAC,GAAG,EAAE;gBACpH,QAAQ,IAAI,EAAE,CAAC;oBACb,KAAK,UAAU;wBACb,OAAO,OAAO,CAAC,0BAA0B,CAAC,CAAC,OAAO,CAAA;oBACpD,KAAK,MAAM;wBACT,OAAO,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAA;oBAC1C,KAAK,SAAS;wBACZ,OAAO,OAAO,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAA;oBACnD,KAAK,KAAK,CAAC;oBACX,KAAK,KAAK,CAAC;oBACX,KAAK,IAAI,CAAC;oBACV,KAAK,SAAS,CAAC;oBACf,KAAK,QAAQ,CAAC;oBACd,KAAK,KAAK,CAAC;oBACX,KAAK,KAAK;wBACR,OAAO,OAAO,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAA;oBAC/C;wBACE,OAAO,IAAI,CAAA;gBACf,CAAC;YACH,CAAC,CAAC,EAAE,CAAA;YAEJ,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE;gBACpB,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;oBACzB,OAAO,IAAA,kCAAkB,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAA;gBAC/C,CAAC;gBAED,OAAO,IAAI,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,MAAM,CAAC,CAAA;YACzD,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF;AA1DD,sCA0DC;AAED,SAAgB,oBAAoB,CAAC,IAAU;IAC7C,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,mBAAI,CAAC,GAAG;YACX,OAAO,QAAQ,CAAA;QACjB,KAAK,mBAAI,CAAC,IAAI;YACZ,OAAO,MAAM,CAAA;QACf,KAAK,mBAAI,CAAC,MAAM;YACd,OAAO,KAAK,CAAA;QACd,KAAK,mBAAI,CAAC,KAAK;YACb,OAAO,aAAa,CAAA;QAEtB;YACE,MAAM,IAAI,KAAK,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC;AAdD,oDAcC","sourcesContent":["import { Arch } from \"builder-util\"\nimport { DIR_TARGET, Platform, Target } from \"./core\"\nimport { LinuxConfiguration } from \"./options/linuxOptions\"\nimport { Packager } from \"./packager\"\nimport { PlatformPackager } from \"./platformPackager\"\nimport AppImageTarget from \"./targets/AppImageTarget\"\nimport FlatpakTarget from \"./targets/FlatpakTarget\"\nimport FpmTarget from \"./targets/FpmTarget\"\nimport { LinuxTargetHelper } from \"./targets/LinuxTargetHelper\"\nimport SnapTarget from \"./targets/snap\"\nimport { createCommonTarget } from \"./targets/targetFactory\"\nimport { sanitizeFileName } from \"./util/filename\"\n\nexport class LinuxPackager extends PlatformPackager<LinuxConfiguration> {\n readonly executableName: string\n\n constructor(info: Packager) {\n super(info, Platform.LINUX)\n\n const executableName = this.platformSpecificBuildOptions.executableName ?? info.config.executableName\n this.executableName = executableName == null ? this.appInfo.sanitizedName.toLowerCase() : sanitizeFileName(executableName)\n }\n\n get defaultTarget(): Array<string> {\n return [\"snap\", \"appimage\"]\n }\n\n createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void {\n let helper: LinuxTargetHelper | null\n const getHelper = () => {\n if (helper == null) {\n helper = new LinuxTargetHelper(this)\n }\n return helper\n }\n\n for (const name of targets) {\n if (name === DIR_TARGET) {\n continue\n }\n\n const targetClass: typeof AppImageTarget | typeof SnapTarget | typeof FlatpakTarget | typeof FpmTarget | null = (() => {\n switch (name) {\n case \"appimage\":\n return require(\"./targets/AppImageTarget\").default\n case \"snap\":\n return require(\"./targets/snap\").default\n case \"flatpak\":\n return require(\"./targets/FlatpakTarget\").default\n case \"deb\":\n case \"rpm\":\n case \"sh\":\n case \"freebsd\":\n case \"pacman\":\n case \"apk\":\n case \"p5p\":\n return require(\"./targets/FpmTarget\").default\n default:\n return null\n }\n })()\n\n mapper(name, outDir => {\n if (targetClass === null) {\n return createCommonTarget(name, outDir, this)\n }\n\n return new targetClass(name, this, getHelper(), outDir)\n })\n }\n }\n}\n\nexport function toAppImageOrSnapArch(arch: Arch): string {\n switch (arch) {\n case Arch.x64:\n return \"x86_64\"\n case Arch.ia32:\n return \"i386\"\n case Arch.armv7l:\n return \"arm\"\n case Arch.arm64:\n return \"arm_aarch64\"\n\n default:\n throw new Error(`Unsupported arch ${arch}`)\n }\n}\n"]}
|
||||
34
mc_test/node_modules/app-builder-lib/out/macPackager.d.ts
generated
vendored
Executable file
34
mc_test/node_modules/app-builder-lib/out/macPackager.d.ts
generated
vendored
Executable file
@ -0,0 +1,34 @@
|
||||
import { Arch, AsyncTaskManager } from "builder-util";
|
||||
import { SignOptions } from "@electron/osx-sign/dist/cjs/types";
|
||||
import { Lazy } from "lazy-val";
|
||||
import { AppInfo } from "./appInfo";
|
||||
import { CodeSigningInfo, Identity } from "./codeSign/macCodeSign";
|
||||
import { Target } from "./core";
|
||||
import { AfterPackContext, ElectronPlatformName } from "./index";
|
||||
import { MacConfiguration } from "./options/macOptions";
|
||||
import { Packager } from "./packager";
|
||||
import { PlatformPackager } from "./platformPackager";
|
||||
export type CustomMacSignOptions = SignOptions;
|
||||
export type CustomMacSign = (configuration: CustomMacSignOptions, packager: MacPackager) => Promise<void>;
|
||||
export default class MacPackager extends PlatformPackager<MacConfiguration> {
|
||||
readonly codeSigningInfo: Lazy<CodeSigningInfo>;
|
||||
private _iconPath;
|
||||
constructor(info: Packager);
|
||||
get defaultTarget(): Array<string>;
|
||||
protected prepareAppInfo(appInfo: AppInfo): AppInfo;
|
||||
getIconPath(): Promise<string | null>;
|
||||
createTargets(targets: Array<string>, mapper: (name: string, factory: (outDir: string) => Target) => void): void;
|
||||
protected doPack(outDir: string, appOutDir: string, platformName: ElectronPlatformName, arch: Arch, platformSpecificBuildOptions: MacConfiguration, targets: Array<Target>): Promise<any>;
|
||||
pack(outDir: string, arch: Arch, targets: Array<Target>, taskManager: AsyncTaskManager): Promise<void>;
|
||||
private sign;
|
||||
private getOptionsForFile;
|
||||
protected doSign(opts: SignOptions, customSignOptions: MacConfiguration): Promise<void>;
|
||||
protected doFlat(appPath: string, outFile: string, identity: Identity, keychain: string | null | undefined): Promise<any>;
|
||||
getElectronSrcDir(dist: string): string;
|
||||
getElectronDestinationDir(appOutDir: string): string;
|
||||
applyCommonInfo(appPlist: any, contentsPath: string): Promise<void>;
|
||||
protected signApp(packContext: AfterPackContext, isAsar: boolean): Promise<boolean>;
|
||||
private notarizeIfProvided;
|
||||
private getNotarizeOptions;
|
||||
private generateNotarizeOptions;
|
||||
}
|
||||
505
mc_test/node_modules/app-builder-lib/out/macPackager.js
generated
vendored
Executable file
505
mc_test/node_modules/app-builder-lib/out/macPackager.js
generated
vendored
Executable file
@ -0,0 +1,505 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const osx_sign_1 = require("@electron/osx-sign");
|
||||
const promises_1 = require("fs/promises");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const path = require("path");
|
||||
const fs_1 = require("builder-util/out/fs");
|
||||
const promise_1 = require("builder-util/out/promise");
|
||||
const appInfo_1 = require("./appInfo");
|
||||
const macCodeSign_1 = require("./codeSign/macCodeSign");
|
||||
const core_1 = require("./core");
|
||||
const platformPackager_1 = require("./platformPackager");
|
||||
const ArchiveTarget_1 = require("./targets/ArchiveTarget");
|
||||
const pkg_1 = require("./targets/pkg");
|
||||
const targetFactory_1 = require("./targets/targetFactory");
|
||||
const macosVersion_1 = require("./util/macosVersion");
|
||||
const pathManager_1 = require("./util/pathManager");
|
||||
const fs = require("fs/promises");
|
||||
const notarize_1 = require("@electron/notarize");
|
||||
class MacPackager extends platformPackager_1.PlatformPackager {
|
||||
constructor(info) {
|
||||
super(info, core_1.Platform.MAC);
|
||||
this.codeSigningInfo = new lazy_val_1.Lazy(() => {
|
||||
const cscLink = this.getCscLink();
|
||||
if (cscLink == null || process.platform !== "darwin") {
|
||||
return Promise.resolve({ keychainFile: process.env.CSC_KEYCHAIN || null });
|
||||
}
|
||||
return (0, macCodeSign_1.createKeychain)({
|
||||
tmpDir: this.info.tempDirManager,
|
||||
cscLink,
|
||||
cscKeyPassword: this.getCscPassword(),
|
||||
cscILink: (0, platformPackager_1.chooseNotNull)(this.platformSpecificBuildOptions.cscInstallerLink, process.env.CSC_INSTALLER_LINK),
|
||||
cscIKeyPassword: (0, platformPackager_1.chooseNotNull)(this.platformSpecificBuildOptions.cscInstallerKeyPassword, process.env.CSC_INSTALLER_KEY_PASSWORD),
|
||||
currentDir: this.projectDir,
|
||||
}).then(result => {
|
||||
const keychainFile = result.keychainFile;
|
||||
if (keychainFile != null) {
|
||||
this.info.disposeOnBuildFinish(() => (0, macCodeSign_1.removeKeychain)(keychainFile));
|
||||
}
|
||||
return result;
|
||||
});
|
||||
});
|
||||
this._iconPath = new lazy_val_1.Lazy(() => this.getOrConvertIcon("icns"));
|
||||
}
|
||||
get defaultTarget() {
|
||||
return this.info.framework.macOsDefaultTargets;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
prepareAppInfo(appInfo) {
|
||||
// codesign requires the filename to be normalized to the NFD form
|
||||
return new appInfo_1.AppInfo(this.info, this.platformSpecificBuildOptions.bundleVersion, this.platformSpecificBuildOptions, true);
|
||||
}
|
||||
async getIconPath() {
|
||||
return this._iconPath.value;
|
||||
}
|
||||
createTargets(targets, mapper) {
|
||||
for (const name of targets) {
|
||||
switch (name) {
|
||||
case core_1.DIR_TARGET:
|
||||
break;
|
||||
case "dmg": {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const { DmgTarget } = require("dmg-builder");
|
||||
mapper(name, outDir => new DmgTarget(this, outDir));
|
||||
break;
|
||||
}
|
||||
case "zip":
|
||||
// https://github.com/electron-userland/electron-builder/issues/2313
|
||||
mapper(name, outDir => new ArchiveTarget_1.ArchiveTarget(name, outDir, this, true));
|
||||
break;
|
||||
case "pkg":
|
||||
mapper(name, outDir => new pkg_1.PkgTarget(this, outDir));
|
||||
break;
|
||||
default:
|
||||
mapper(name, outDir => (name === "mas" || name === "mas-dev" ? new targetFactory_1.NoOpTarget(name) : (0, targetFactory_1.createCommonTarget)(name, outDir, this)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
async doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets) {
|
||||
var _a;
|
||||
switch (arch) {
|
||||
default: {
|
||||
return super.doPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets);
|
||||
}
|
||||
case builder_util_1.Arch.universal: {
|
||||
const outDirName = (arch) => `${appOutDir}-${builder_util_1.Arch[arch]}-temp`;
|
||||
const x64Arch = builder_util_1.Arch.x64;
|
||||
const x64AppOutDir = outDirName(x64Arch);
|
||||
await super.doPack(outDir, x64AppOutDir, platformName, x64Arch, platformSpecificBuildOptions, targets, false, true);
|
||||
const arm64Arch = builder_util_1.Arch.arm64;
|
||||
const arm64AppOutPath = outDirName(arm64Arch);
|
||||
await super.doPack(outDir, arm64AppOutPath, platformName, arm64Arch, platformSpecificBuildOptions, targets, false, true);
|
||||
const framework = this.info.framework;
|
||||
builder_util_1.log.info({
|
||||
platform: platformName,
|
||||
arch: builder_util_1.Arch[arch],
|
||||
[`${framework.name}`]: framework.version,
|
||||
appOutDir: builder_util_1.log.filePath(appOutDir),
|
||||
}, `packaging`);
|
||||
const appFile = `${this.appInfo.productFilename}.app`;
|
||||
const { makeUniversalApp } = require("@electron/universal");
|
||||
await makeUniversalApp({
|
||||
x64AppPath: path.join(x64AppOutDir, appFile),
|
||||
arm64AppPath: path.join(arm64AppOutPath, appFile),
|
||||
outAppPath: path.join(appOutDir, appFile),
|
||||
force: true,
|
||||
mergeASARs: (_a = platformSpecificBuildOptions.mergeASARs) !== null && _a !== void 0 ? _a : true,
|
||||
singleArchFiles: platformSpecificBuildOptions.singleArchFiles,
|
||||
x64ArchFiles: platformSpecificBuildOptions.x64ArchFiles,
|
||||
});
|
||||
await fs.rm(x64AppOutDir, { recursive: true, force: true });
|
||||
await fs.rm(arm64AppOutPath, { recursive: true, force: true });
|
||||
// Give users a final opportunity to perform things on the combined universal package before signing
|
||||
const packContext = {
|
||||
appOutDir,
|
||||
outDir,
|
||||
arch,
|
||||
targets,
|
||||
packager: this,
|
||||
electronPlatformName: platformName,
|
||||
};
|
||||
await this.info.afterPack(packContext);
|
||||
await this.doSignAfterPack(outDir, appOutDir, platformName, arch, platformSpecificBuildOptions, targets);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
async pack(outDir, arch, targets, taskManager) {
|
||||
const hasMas = targets.length !== 0 && targets.some(it => it.name === "mas" || it.name === "mas-dev");
|
||||
const prepackaged = this.packagerOptions.prepackaged;
|
||||
for (const target of targets) {
|
||||
const targetName = target.name;
|
||||
if (!(targetName === "mas" || targetName === "mas-dev")) {
|
||||
continue;
|
||||
}
|
||||
const masBuildOptions = (0, builder_util_1.deepAssign)({}, this.platformSpecificBuildOptions, this.config.mas);
|
||||
if (targetName === "mas-dev") {
|
||||
(0, builder_util_1.deepAssign)(masBuildOptions, this.config.masDev, {
|
||||
type: "development",
|
||||
});
|
||||
}
|
||||
const targetOutDir = path.join(outDir, `${targetName}${(0, builder_util_1.getArchSuffix)(arch, this.platformSpecificBuildOptions.defaultArch)}`);
|
||||
if (prepackaged == null) {
|
||||
await this.doPack(outDir, targetOutDir, "mas", arch, masBuildOptions, [target]);
|
||||
await this.sign(path.join(targetOutDir, `${this.appInfo.productFilename}.app`), targetOutDir, masBuildOptions, arch);
|
||||
}
|
||||
else {
|
||||
await this.sign(prepackaged, targetOutDir, masBuildOptions, arch);
|
||||
}
|
||||
}
|
||||
if (!hasMas || targets.length > 1) {
|
||||
const appPath = prepackaged == null ? path.join(this.computeAppOutDir(outDir, arch), `${this.appInfo.productFilename}.app`) : prepackaged;
|
||||
if (prepackaged == null) {
|
||||
await this.doPack(outDir, path.dirname(appPath), this.platform.nodeName, arch, this.platformSpecificBuildOptions, targets);
|
||||
}
|
||||
this.packageInDistributableFormat(appPath, arch, targets, taskManager);
|
||||
}
|
||||
}
|
||||
async sign(appPath, outDir, masOptions, arch) {
|
||||
if (!(0, macCodeSign_1.isSignAllowed)()) {
|
||||
return false;
|
||||
}
|
||||
const isMas = masOptions != null;
|
||||
const options = masOptions == null ? this.platformSpecificBuildOptions : masOptions;
|
||||
const qualifier = options.identity;
|
||||
if (qualifier === null) {
|
||||
if (this.forceCodeSigning) {
|
||||
throw new builder_util_1.InvalidConfigurationError("identity explicitly is set to null, but forceCodeSigning is set to true");
|
||||
}
|
||||
builder_util_1.log.info({ reason: "identity explicitly is set to null" }, "skipped macOS code signing");
|
||||
return false;
|
||||
}
|
||||
const keychainFile = (await this.codeSigningInfo.value).keychainFile;
|
||||
const explicitType = options.type;
|
||||
const type = explicitType || "distribution";
|
||||
const isDevelopment = type === "development";
|
||||
const certificateTypes = getCertificateTypes(isMas, isDevelopment);
|
||||
let identity = null;
|
||||
for (const certificateType of certificateTypes) {
|
||||
identity = await (0, macCodeSign_1.findIdentity)(certificateType, qualifier, keychainFile);
|
||||
if (identity != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (identity == null) {
|
||||
if (!isMas && !isDevelopment && explicitType !== "distribution") {
|
||||
identity = await (0, macCodeSign_1.findIdentity)("Mac Developer", qualifier, keychainFile);
|
||||
if (identity != null) {
|
||||
builder_util_1.log.warn("Mac Developer is used to sign app — it is only for development and testing, not for production");
|
||||
}
|
||||
}
|
||||
if (!options.sign && identity == null) {
|
||||
await (0, macCodeSign_1.reportError)(isMas, certificateTypes, qualifier, keychainFile, this.forceCodeSigning);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (!(0, macosVersion_1.isMacOsHighSierra)()) {
|
||||
throw new builder_util_1.InvalidConfigurationError("macOS High Sierra 10.13.6 is required to sign");
|
||||
}
|
||||
let filter = options.signIgnore;
|
||||
if (Array.isArray(filter)) {
|
||||
if (filter.length == 0) {
|
||||
filter = null;
|
||||
}
|
||||
}
|
||||
else if (filter != null) {
|
||||
filter = filter.length === 0 ? null : [filter];
|
||||
}
|
||||
const filterRe = filter == null ? null : filter.map(it => new RegExp(it));
|
||||
let binaries = options.binaries || undefined;
|
||||
if (binaries) {
|
||||
// Accept absolute paths for external binaries, else resolve relative paths from the artifact's app Contents path.
|
||||
binaries = await Promise.all(binaries.map(async (destination) => {
|
||||
if (await (0, fs_1.statOrNull)(destination)) {
|
||||
return destination;
|
||||
}
|
||||
return path.resolve(appPath, destination);
|
||||
}));
|
||||
builder_util_1.log.info({ binaries }, "signing additional user-defined binaries");
|
||||
}
|
||||
const customSignOptions = (isMas ? masOptions : this.platformSpecificBuildOptions) || this.platformSpecificBuildOptions;
|
||||
const signOptions = {
|
||||
identityValidation: false,
|
||||
// https://github.com/electron-userland/electron-builder/issues/1699
|
||||
// kext are signed by the chipset manufacturers. You need a special certificate (only available on request) from Apple to be able to sign kext.
|
||||
ignore: (file) => {
|
||||
if (filterRe != null) {
|
||||
for (const regExp of filterRe) {
|
||||
if (regExp.test(file)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return (file.endsWith(".kext") ||
|
||||
file.startsWith("/Contents/PlugIns", appPath.length) ||
|
||||
file.includes("/node_modules/puppeteer/.local-chromium") ||
|
||||
file.includes("/node_modules/playwright-firefox/.local-browsers") ||
|
||||
file.includes("/node_modules/playwright/.local-browsers"));
|
||||
/* Those are browser automating modules, browser (chromium, nightly) cannot be signed
|
||||
https://github.com/electron-userland/electron-builder/issues/2010
|
||||
https://github.com/electron-userland/electron-builder/issues/5383
|
||||
*/
|
||||
},
|
||||
identity: identity ? identity.hash || identity.name : undefined,
|
||||
type,
|
||||
platform: isMas ? "mas" : "darwin",
|
||||
version: this.config.electronVersion || undefined,
|
||||
app: appPath,
|
||||
keychain: keychainFile || undefined,
|
||||
binaries,
|
||||
// https://github.com/electron-userland/electron-builder/issues/1480
|
||||
strictVerify: options.strictVerify,
|
||||
preAutoEntitlements: options.preAutoEntitlements,
|
||||
optionsForFile: await this.getOptionsForFile(appPath, isMas, customSignOptions),
|
||||
provisioningProfile: customSignOptions.provisioningProfile || undefined,
|
||||
};
|
||||
await this.doSign(signOptions, customSignOptions);
|
||||
// https://github.com/electron-userland/electron-builder/issues/1196#issuecomment-312310209
|
||||
if (masOptions != null && !isDevelopment) {
|
||||
const certType = isDevelopment ? "Mac Developer" : "3rd Party Mac Developer Installer";
|
||||
const masInstallerIdentity = await (0, macCodeSign_1.findIdentity)(certType, masOptions.identity, keychainFile);
|
||||
if (masInstallerIdentity == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Cannot find valid "${certType}" identity to sign MAS installer, please see https://electron.build/code-signing`);
|
||||
}
|
||||
// mas uploaded to AppStore, so, use "-" instead of space for name
|
||||
const artifactName = this.expandArtifactNamePattern(masOptions, "pkg", arch);
|
||||
const artifactPath = path.join(outDir, artifactName);
|
||||
await this.doFlat(appPath, artifactPath, masInstallerIdentity, keychainFile);
|
||||
await this.dispatchArtifactCreated(artifactPath, null, builder_util_1.Arch.x64, this.computeSafeArtifactName(artifactName, "pkg", arch, true, this.platformSpecificBuildOptions.defaultArch));
|
||||
}
|
||||
if (!isMas) {
|
||||
await this.notarizeIfProvided(appPath, options);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
async getOptionsForFile(appPath, isMas, customSignOptions) {
|
||||
const resourceList = await this.resourceList;
|
||||
const entitlementsSuffix = isMas ? "mas" : "mac";
|
||||
const getEntitlements = (filePath) => {
|
||||
// check if root app, then use main entitlements
|
||||
if (filePath === appPath) {
|
||||
if (customSignOptions.entitlements) {
|
||||
return customSignOptions.entitlements;
|
||||
}
|
||||
const p = `entitlements.${entitlementsSuffix}.plist`;
|
||||
if (resourceList.includes(p)) {
|
||||
return path.join(this.info.buildResourcesDir, p);
|
||||
}
|
||||
else {
|
||||
return (0, pathManager_1.getTemplatePath)("entitlements.mac.plist");
|
||||
}
|
||||
}
|
||||
// It's a login helper...
|
||||
if (filePath.includes("Library/LoginItems")) {
|
||||
return customSignOptions.entitlementsLoginHelper;
|
||||
}
|
||||
// Only remaining option is that it's inherited entitlements
|
||||
if (customSignOptions.entitlementsInherit) {
|
||||
return customSignOptions.entitlementsInherit;
|
||||
}
|
||||
const p = `entitlements.${entitlementsSuffix}.inherit.plist`;
|
||||
if (resourceList.includes(p)) {
|
||||
return path.join(this.info.buildResourcesDir, p);
|
||||
}
|
||||
else {
|
||||
return (0, pathManager_1.getTemplatePath)("entitlements.mac.plist");
|
||||
}
|
||||
};
|
||||
const requirements = isMas || this.platformSpecificBuildOptions.requirements == null ? undefined : await this.getResource(this.platformSpecificBuildOptions.requirements);
|
||||
// harden by default for mac builds. Only harden mas builds if explicitly true (backward compatibility)
|
||||
const hardenedRuntime = isMas ? customSignOptions.hardenedRuntime === true : customSignOptions.hardenedRuntime !== false;
|
||||
const optionsForFile = filePath => {
|
||||
const entitlements = getEntitlements(filePath);
|
||||
const args = {
|
||||
entitlements: entitlements || undefined,
|
||||
hardenedRuntime: hardenedRuntime !== null && hardenedRuntime !== void 0 ? hardenedRuntime : undefined,
|
||||
timestamp: customSignOptions.timestamp || undefined,
|
||||
requirements: requirements || undefined,
|
||||
};
|
||||
builder_util_1.log.debug({ file: builder_util_1.log.filePath(filePath), ...args }, "selecting signing options");
|
||||
return args;
|
||||
};
|
||||
return optionsForFile;
|
||||
}
|
||||
//noinspection JSMethodCanBeStatic
|
||||
async doSign(opts, customSignOptions) {
|
||||
const customSign = await (0, platformPackager_1.resolveFunction)(this.appInfo.type, customSignOptions.sign, "sign");
|
||||
const { app, platform, type, identity, provisioningProfile } = opts;
|
||||
builder_util_1.log.info({
|
||||
file: builder_util_1.log.filePath(app),
|
||||
platform,
|
||||
type,
|
||||
identity: identity || "none",
|
||||
provisioningProfile: provisioningProfile || "none",
|
||||
}, customSign ? "executing custom sign" : "signing");
|
||||
return customSign ? Promise.resolve(customSign(opts, this)) : (0, osx_sign_1.signAsync)(opts);
|
||||
}
|
||||
//noinspection JSMethodCanBeStatic
|
||||
async doFlat(appPath, outFile, identity, keychain) {
|
||||
// productbuild doesn't created directory for out file
|
||||
await (0, promises_1.mkdir)(path.dirname(outFile), { recursive: true });
|
||||
const args = (0, pkg_1.prepareProductBuildArgs)(identity, keychain);
|
||||
args.push("--component", appPath, "/Applications");
|
||||
args.push(outFile);
|
||||
return await (0, builder_util_1.exec)("productbuild", args);
|
||||
}
|
||||
getElectronSrcDir(dist) {
|
||||
return path.resolve(this.projectDir, dist, this.info.framework.distMacOsAppName);
|
||||
}
|
||||
getElectronDestinationDir(appOutDir) {
|
||||
return path.join(appOutDir, this.info.framework.distMacOsAppName);
|
||||
}
|
||||
// todo fileAssociations
|
||||
async applyCommonInfo(appPlist, contentsPath) {
|
||||
const appInfo = this.appInfo;
|
||||
const appFilename = appInfo.productFilename;
|
||||
// https://github.com/electron-userland/electron-builder/issues/1278
|
||||
appPlist.CFBundleExecutable = appFilename.endsWith(" Helper") ? appFilename.substring(0, appFilename.length - " Helper".length) : appFilename;
|
||||
const icon = await this.getIconPath();
|
||||
if (icon != null) {
|
||||
const oldIcon = appPlist.CFBundleIconFile;
|
||||
const resourcesPath = path.join(contentsPath, "Resources");
|
||||
if (oldIcon != null) {
|
||||
await (0, fs_1.unlinkIfExists)(path.join(resourcesPath, oldIcon));
|
||||
}
|
||||
const iconFileName = "icon.icns";
|
||||
appPlist.CFBundleIconFile = iconFileName;
|
||||
await (0, fs_1.copyFile)(icon, path.join(resourcesPath, iconFileName));
|
||||
}
|
||||
appPlist.CFBundleName = appInfo.productName;
|
||||
appPlist.CFBundleDisplayName = appInfo.productName;
|
||||
const minimumSystemVersion = this.platformSpecificBuildOptions.minimumSystemVersion;
|
||||
if (minimumSystemVersion != null) {
|
||||
appPlist.LSMinimumSystemVersion = minimumSystemVersion;
|
||||
}
|
||||
appPlist.CFBundleShortVersionString = this.platformSpecificBuildOptions.bundleShortVersion || appInfo.version;
|
||||
appPlist.CFBundleVersion = appInfo.buildVersion;
|
||||
(0, builder_util_1.use)(this.platformSpecificBuildOptions.category || this.config.category, it => (appPlist.LSApplicationCategoryType = it));
|
||||
appPlist.NSHumanReadableCopyright = appInfo.copyright;
|
||||
if (this.platformSpecificBuildOptions.darkModeSupport) {
|
||||
appPlist.NSRequiresAquaSystemAppearance = false;
|
||||
}
|
||||
const extendInfo = this.platformSpecificBuildOptions.extendInfo;
|
||||
if (extendInfo != null) {
|
||||
Object.assign(appPlist, extendInfo);
|
||||
}
|
||||
}
|
||||
async signApp(packContext, isAsar) {
|
||||
const readDirectoryAndSign = async (sourceDirectory, directories, filter) => {
|
||||
await bluebird_lst_1.default.map(directories, async (file) => {
|
||||
if (filter(file)) {
|
||||
await this.sign(path.join(sourceDirectory, file), null, null, null);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
return true;
|
||||
};
|
||||
const appFileName = `${this.appInfo.productFilename}.app`;
|
||||
await readDirectoryAndSign(packContext.appOutDir, await (0, promises_1.readdir)(packContext.appOutDir), file => file === appFileName);
|
||||
if (!isAsar) {
|
||||
return true;
|
||||
}
|
||||
const outResourcesDir = path.join(packContext.appOutDir, "resources", "app.asar.unpacked");
|
||||
await readDirectoryAndSign(outResourcesDir, await (0, promise_1.orIfFileNotExist)((0, promises_1.readdir)(outResourcesDir), []), file => file.endsWith(".app"));
|
||||
return true;
|
||||
}
|
||||
async notarizeIfProvided(appPath, buildOptions) {
|
||||
const notarizeOptions = buildOptions.notarize;
|
||||
if (notarizeOptions === false) {
|
||||
builder_util_1.log.info({ reason: "`notarize` options were set explicitly `false`" }, "skipped macOS notarization");
|
||||
return;
|
||||
}
|
||||
const options = this.getNotarizeOptions(appPath);
|
||||
if (!options) {
|
||||
builder_util_1.log.warn({ reason: "`notarize` options were unable to be generated" }, "skipped macOS notarization");
|
||||
return;
|
||||
}
|
||||
await (0, notarize_1.notarize)(options);
|
||||
builder_util_1.log.info(null, "notarization successful");
|
||||
}
|
||||
getNotarizeOptions(appPath) {
|
||||
const appleId = process.env.APPLE_ID;
|
||||
const appleIdPassword = process.env.APPLE_APP_SPECIFIC_PASSWORD;
|
||||
// option 1: app specific password
|
||||
if (appleId || appleIdPassword) {
|
||||
if (!appleId) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`APPLE_ID env var needs to be set`);
|
||||
}
|
||||
if (!appleIdPassword) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`APPLE_APP_SPECIFIC_PASSWORD env var needs to be set`);
|
||||
}
|
||||
return this.generateNotarizeOptions(appPath, { appleId, appleIdPassword });
|
||||
}
|
||||
// option 2: API key
|
||||
const appleApiKey = process.env.APPLE_API_KEY;
|
||||
const appleApiKeyId = process.env.APPLE_API_KEY_ID;
|
||||
const appleApiIssuer = process.env.APPLE_API_ISSUER;
|
||||
if (appleApiKey || appleApiKeyId || appleApiIssuer) {
|
||||
if (!appleApiKey || !appleApiKeyId || !appleApiIssuer) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Env vars APPLE_API_KEY, APPLE_API_KEY_ID and APPLE_API_ISSUER need to be set`);
|
||||
}
|
||||
return this.generateNotarizeOptions(appPath, undefined, { appleApiKey, appleApiKeyId, appleApiIssuer });
|
||||
}
|
||||
// option 3: keychain
|
||||
const keychain = process.env.APPLE_KEYCHAIN;
|
||||
const keychainProfile = process.env.APPLE_KEYCHAIN_PROFILE;
|
||||
if (keychainProfile) {
|
||||
let args = { keychainProfile };
|
||||
if (keychain) {
|
||||
args = { ...args, keychain };
|
||||
}
|
||||
return this.generateNotarizeOptions(appPath, undefined, args);
|
||||
}
|
||||
// if no credentials provided, skip silently
|
||||
return undefined;
|
||||
}
|
||||
generateNotarizeOptions(appPath, legacyLogin, notaryToolLogin) {
|
||||
const options = this.platformSpecificBuildOptions.notarize;
|
||||
if (typeof options === "boolean" && legacyLogin) {
|
||||
const proj = {
|
||||
appPath,
|
||||
...legacyLogin,
|
||||
appBundleId: this.appInfo.id,
|
||||
};
|
||||
return proj;
|
||||
}
|
||||
const teamId = options === null || options === void 0 ? void 0 : options.teamId;
|
||||
if ((teamId || options === true) && (legacyLogin || notaryToolLogin)) {
|
||||
const proj = {
|
||||
appPath,
|
||||
...(legacyLogin !== null && legacyLogin !== void 0 ? legacyLogin : notaryToolLogin),
|
||||
teamId,
|
||||
};
|
||||
return { tool: "notarytool", ...proj };
|
||||
}
|
||||
if (legacyLogin) {
|
||||
const { appBundleId, ascProvider } = options;
|
||||
return {
|
||||
appPath,
|
||||
...legacyLogin,
|
||||
appBundleId: appBundleId || this.appInfo.id,
|
||||
ascProvider: ascProvider || undefined,
|
||||
};
|
||||
}
|
||||
if (notaryToolLogin) {
|
||||
return {
|
||||
tool: "notarytool",
|
||||
appPath,
|
||||
...notaryToolLogin,
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
exports.default = MacPackager;
|
||||
function getCertificateTypes(isMas, isDevelopment) {
|
||||
if (isDevelopment) {
|
||||
return isMas ? ["Mac Developer", "Apple Development"] : ["Mac Developer", "Developer ID Application"];
|
||||
}
|
||||
return isMas ? ["Apple Distribution", "3rd Party Mac Developer Application"] : ["Developer ID Application"];
|
||||
}
|
||||
//# sourceMappingURL=macPackager.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/macPackager.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/macPackager.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
61
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.d.ts
generated
vendored
Executable file
61
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,61 @@
|
||||
import { TargetSpecificOptions } from "../core";
|
||||
export interface AppXOptions extends TargetSpecificOptions {
|
||||
/**
|
||||
* The application id. Defaults to `identityName`. Can’t start with numbers.
|
||||
*/
|
||||
readonly applicationId?: string;
|
||||
/**
|
||||
* The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).
|
||||
* @default #464646
|
||||
*/
|
||||
readonly backgroundColor?: string | null;
|
||||
/**
|
||||
* A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).
|
||||
* Defaults to the application product name.
|
||||
*/
|
||||
readonly displayName?: string | null;
|
||||
/**
|
||||
* The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](/configuration/configuration#Metadata-name).
|
||||
*/
|
||||
readonly identityName?: string | null;
|
||||
/**
|
||||
* The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.
|
||||
*/
|
||||
readonly publisher?: string | null;
|
||||
/**
|
||||
* A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).
|
||||
* Defaults to company name from the application metadata.
|
||||
*/
|
||||
readonly publisherDisplayName?: string | null;
|
||||
/**
|
||||
* The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.
|
||||
* The first entry (index 0) will be the default language.
|
||||
* Defaults to en-US if omitted.
|
||||
*/
|
||||
readonly languages?: Array<string> | string | null;
|
||||
/**
|
||||
* Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.
|
||||
*/
|
||||
readonly addAutoLaunchExtension?: boolean;
|
||||
/**
|
||||
* Relative path to custom extensions xml to be included in an `appmanifest.xml`.
|
||||
*/
|
||||
readonly customExtensionsPath?: string;
|
||||
/**
|
||||
* Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.
|
||||
* @default false
|
||||
*/
|
||||
readonly showNameOnTiles?: boolean;
|
||||
/**
|
||||
* @private
|
||||
* @default false
|
||||
*/
|
||||
readonly electronUpdaterAware?: boolean;
|
||||
/**
|
||||
* Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875
|
||||
* @default false
|
||||
*/
|
||||
readonly setBuildNumber?: boolean;
|
||||
/** @private */
|
||||
readonly makeappxArgs?: Array<string> | null;
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=AppXOptions.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/AppXOptions.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"AppXOptions.js","sourceRoot":"","sources":["../../src/options/AppXOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\n\nexport interface AppXOptions extends TargetSpecificOptions {\n /**\n * The application id. Defaults to `identityName`. Can’t start with numbers.\n */\n readonly applicationId?: string\n\n /**\n * The background color of the app tile. See [Visual Elements](https://msdn.microsoft.com/en-us/library/windows/apps/br211471.aspx).\n * @default #464646\n */\n readonly backgroundColor?: string | null\n\n /**\n * A friendly name that can be displayed to users. Corresponds to [Properties.DisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211432.aspx).\n * Defaults to the application product name.\n */\n readonly displayName?: string | null\n\n /**\n * The name. Corresponds to [Identity.Name](https://msdn.microsoft.com/en-us/library/windows/apps/br211441.aspx). Defaults to the [application name](/configuration/configuration#Metadata-name).\n */\n readonly identityName?: string | null\n\n /**\n * The Windows Store publisher. Not used if AppX is build for testing. See [AppX Package Code Signing](#appx-package-code-signing) below.\n */\n readonly publisher?: string | null\n\n /**\n * A friendly name for the publisher that can be displayed to users. Corresponds to [Properties.PublisherDisplayName](https://msdn.microsoft.com/en-us/library/windows/apps/br211460.aspx).\n * Defaults to company name from the application metadata.\n */\n readonly publisherDisplayName?: string | null\n\n /**\n * The list of [supported languages](https://docs.microsoft.com/en-us/windows/uwp/globalizing/manage-language-and-region#specify-the-supported-languages-in-the-apps-manifest) that will be listed in the Windows Store.\n * The first entry (index 0) will be the default language.\n * Defaults to en-US if omitted.\n */\n readonly languages?: Array<string> | string | null\n\n /**\n * Whether to add auto launch extension. Defaults to `true` if [electron-winstore-auto-launch](https://github.com/felixrieseberg/electron-winstore-auto-launch) in the dependencies.\n */\n readonly addAutoLaunchExtension?: boolean\n\n /**\n * Relative path to custom extensions xml to be included in an `appmanifest.xml`.\n */\n readonly customExtensionsPath?: string\n\n /**\n * Whether to overlay the app's name on top of tile images on the Start screen. Defaults to `false`. (https://docs.microsoft.com/en-us/uwp/schemas/appxpackage/uapmanifestschema/element-uap-shownameontiles) in the dependencies.\n * @default false\n */\n readonly showNameOnTiles?: boolean\n\n /**\n * @private\n * @default false\n */\n readonly electronUpdaterAware?: boolean\n\n /**\n * Whether to set build number. See https://github.com/electron-userland/electron-builder/issues/3875\n * @default false\n */\n readonly setBuildNumber?: boolean\n\n /** @private */\n readonly makeappxArgs?: Array<string> | null\n}\n"]}
|
||||
47
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.d.ts
generated
vendored
Executable file
47
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.d.ts
generated
vendored
Executable file
@ -0,0 +1,47 @@
|
||||
import { WinPackager } from "../winPackager";
|
||||
export interface CommonWindowsInstallerConfiguration {
|
||||
readonly oneClick?: boolean;
|
||||
/**
|
||||
* Whether to install per all users (per-machine).
|
||||
* @default false
|
||||
*/
|
||||
readonly perMachine?: boolean;
|
||||
/**
|
||||
* Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.
|
||||
* @default true
|
||||
*/
|
||||
readonly runAfterFinish?: boolean;
|
||||
/**
|
||||
* Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).
|
||||
* @default true
|
||||
*/
|
||||
readonly createDesktopShortcut?: boolean | "always";
|
||||
/**
|
||||
* Whether to create start menu shortcut.
|
||||
* @default true
|
||||
*/
|
||||
readonly createStartMenuShortcut?: boolean;
|
||||
/**
|
||||
* Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.
|
||||
* @default false
|
||||
*/
|
||||
readonly menuCategory?: boolean | string;
|
||||
/**
|
||||
* The name that will be used for all shortcuts. Defaults to the application name.
|
||||
*/
|
||||
readonly shortcutName?: string | null;
|
||||
}
|
||||
export interface FinalCommonWindowsInstallerOptions {
|
||||
isAssisted: boolean;
|
||||
isPerMachine: boolean;
|
||||
shortcutName: string;
|
||||
menuCategory: string | null;
|
||||
isCreateDesktopShortcut: DesktopShortcutCreationPolicy;
|
||||
isCreateStartMenuShortcut: boolean;
|
||||
}
|
||||
export declare function getEffectiveOptions(options: CommonWindowsInstallerConfiguration, packager: WinPackager): FinalCommonWindowsInstallerOptions;
|
||||
export declare enum DesktopShortcutCreationPolicy {
|
||||
FRESH_INSTALL = 0,
|
||||
ALWAYS = 1,
|
||||
NEVER = 2
|
||||
}
|
||||
51
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js
generated
vendored
Executable file
51
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js
generated
vendored
Executable file
@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DesktopShortcutCreationPolicy = exports.getEffectiveOptions = void 0;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const filename_1 = require("../util/filename");
|
||||
function getEffectiveOptions(options, packager) {
|
||||
const appInfo = packager.appInfo;
|
||||
let menuCategory = null;
|
||||
if (options.menuCategory != null && options.menuCategory !== false) {
|
||||
if (options.menuCategory === true) {
|
||||
const companyName = packager.appInfo.companyName;
|
||||
if (companyName == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Please specify "author" in the application package.json — it is required because "menuCategory" is set to true.`);
|
||||
}
|
||||
menuCategory = (0, filename_1.sanitizeFileName)(companyName);
|
||||
}
|
||||
else {
|
||||
menuCategory = options.menuCategory
|
||||
.split(/[/\\]/)
|
||||
.map(it => (0, filename_1.sanitizeFileName)(it))
|
||||
.join("\\");
|
||||
}
|
||||
}
|
||||
return {
|
||||
isPerMachine: options.perMachine === true,
|
||||
isAssisted: options.oneClick === false,
|
||||
shortcutName: (0, builder_util_1.isEmptyOrSpaces)(options.shortcutName) ? appInfo.sanitizedProductName : packager.expandMacro(options.shortcutName),
|
||||
isCreateDesktopShortcut: convertToDesktopShortcutCreationPolicy(options.createDesktopShortcut),
|
||||
isCreateStartMenuShortcut: options.createStartMenuShortcut !== false,
|
||||
menuCategory,
|
||||
};
|
||||
}
|
||||
exports.getEffectiveOptions = getEffectiveOptions;
|
||||
function convertToDesktopShortcutCreationPolicy(value) {
|
||||
if (value === false) {
|
||||
return DesktopShortcutCreationPolicy.NEVER;
|
||||
}
|
||||
else if (value === "always") {
|
||||
return DesktopShortcutCreationPolicy.ALWAYS;
|
||||
}
|
||||
else {
|
||||
return DesktopShortcutCreationPolicy.FRESH_INSTALL;
|
||||
}
|
||||
}
|
||||
var DesktopShortcutCreationPolicy;
|
||||
(function (DesktopShortcutCreationPolicy) {
|
||||
DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["FRESH_INSTALL"] = 0] = "FRESH_INSTALL";
|
||||
DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["ALWAYS"] = 1] = "ALWAYS";
|
||||
DesktopShortcutCreationPolicy[DesktopShortcutCreationPolicy["NEVER"] = 2] = "NEVER";
|
||||
})(DesktopShortcutCreationPolicy || (exports.DesktopShortcutCreationPolicy = DesktopShortcutCreationPolicy = {}));
|
||||
//# sourceMappingURL=CommonWindowsInstallerConfiguration.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/CommonWindowsInstallerConfiguration.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"CommonWindowsInstallerConfiguration.js","sourceRoot":"","sources":["../../src/options/CommonWindowsInstallerConfiguration.ts"],"names":[],"mappings":";;;AAAA,+CAAyE;AACzE,+CAAmD;AAqDnD,SAAgB,mBAAmB,CAAC,OAA4C,EAAE,QAAqB;IACrG,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;IAEhC,IAAI,YAAY,GAAkB,IAAI,CAAA;IACtC,IAAI,OAAO,CAAC,YAAY,IAAI,IAAI,IAAI,OAAO,CAAC,YAAY,KAAK,KAAK,EAAE,CAAC;QACnE,IAAI,OAAO,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAClC,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAA;YAChD,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;gBACxB,MAAM,IAAI,wCAAyB,CAAC,iHAAiH,CAAC,CAAA;YACxJ,CAAC;YACD,YAAY,GAAG,IAAA,2BAAgB,EAAC,WAAW,CAAC,CAAA;QAC9C,CAAC;aAAM,CAAC;YACN,YAAY,GAAG,OAAO,CAAC,YAAY;iBAChC,KAAK,CAAC,OAAO,CAAC;iBACd,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,2BAAgB,EAAC,EAAE,CAAC,CAAC;iBAC/B,IAAI,CAAC,IAAI,CAAC,CAAA;QACf,CAAC;IACH,CAAC;IAED,OAAO;QACL,YAAY,EAAE,OAAO,CAAC,UAAU,KAAK,IAAI;QACzC,UAAU,EAAE,OAAO,CAAC,QAAQ,KAAK,KAAK;QAEtC,YAAY,EAAE,IAAA,8BAAe,EAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC;QAC/H,uBAAuB,EAAE,sCAAsC,CAAC,OAAO,CAAC,qBAAqB,CAAC;QAC9F,yBAAyB,EAAE,OAAO,CAAC,uBAAuB,KAAK,KAAK;QACpE,YAAY;KACb,CAAA;AACH,CAAC;AA5BD,kDA4BC;AAED,SAAS,sCAAsC,CAAC,KAAmC;IACjF,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACpB,OAAO,6BAA6B,CAAC,KAAK,CAAA;IAC5C,CAAC;SAAM,IAAI,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,6BAA6B,CAAC,MAAM,CAAA;IAC7C,CAAC;SAAM,CAAC;QACN,OAAO,6BAA6B,CAAC,aAAa,CAAA;IACpD,CAAC;AACH,CAAC;AAED,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACvC,mGAAa,CAAA;IACb,qFAAM,CAAA;IACN,mFAAK,CAAA;AACP,CAAC,EAJW,6BAA6B,6CAA7B,6BAA6B,QAIxC","sourcesContent":["import { InvalidConfigurationError, isEmptyOrSpaces } from \"builder-util\"\nimport { sanitizeFileName } from \"../util/filename\"\nimport { WinPackager } from \"../winPackager\"\n\nexport interface CommonWindowsInstallerConfiguration {\n readonly oneClick?: boolean\n\n /**\n * Whether to install per all users (per-machine).\n * @default false\n */\n readonly perMachine?: boolean\n\n /**\n * Whether to run the installed application after finish. For assisted installer corresponding checkbox will be removed.\n * @default true\n */\n readonly runAfterFinish?: boolean\n\n /**\n * Whether to create desktop shortcut. Set to `always` if to recreate also on reinstall (even if removed by user).\n * @default true\n */\n readonly createDesktopShortcut?: boolean | \"always\"\n\n /**\n * Whether to create start menu shortcut.\n * @default true\n */\n readonly createStartMenuShortcut?: boolean\n\n /**\n * Whether to create submenu for start menu shortcut and program files directory. If `true`, company name will be used. Or string value.\n * @default false\n */\n readonly menuCategory?: boolean | string\n\n /**\n * The name that will be used for all shortcuts. Defaults to the application name.\n */\n readonly shortcutName?: string | null\n}\n\nexport interface FinalCommonWindowsInstallerOptions {\n isAssisted: boolean\n isPerMachine: boolean\n\n shortcutName: string\n menuCategory: string | null\n\n isCreateDesktopShortcut: DesktopShortcutCreationPolicy\n isCreateStartMenuShortcut: boolean\n}\n\nexport function getEffectiveOptions(options: CommonWindowsInstallerConfiguration, packager: WinPackager): FinalCommonWindowsInstallerOptions {\n const appInfo = packager.appInfo\n\n let menuCategory: string | null = null\n if (options.menuCategory != null && options.menuCategory !== false) {\n if (options.menuCategory === true) {\n const companyName = packager.appInfo.companyName\n if (companyName == null) {\n throw new InvalidConfigurationError(`Please specify \"author\" in the application package.json — it is required because \"menuCategory\" is set to true.`)\n }\n menuCategory = sanitizeFileName(companyName)\n } else {\n menuCategory = options.menuCategory\n .split(/[/\\\\]/)\n .map(it => sanitizeFileName(it))\n .join(\"\\\\\")\n }\n }\n\n return {\n isPerMachine: options.perMachine === true,\n isAssisted: options.oneClick === false,\n\n shortcutName: isEmptyOrSpaces(options.shortcutName) ? appInfo.sanitizedProductName : packager.expandMacro(options.shortcutName),\n isCreateDesktopShortcut: convertToDesktopShortcutCreationPolicy(options.createDesktopShortcut),\n isCreateStartMenuShortcut: options.createStartMenuShortcut !== false,\n menuCategory,\n }\n}\n\nfunction convertToDesktopShortcutCreationPolicy(value: boolean | undefined | string): DesktopShortcutCreationPolicy {\n if (value === false) {\n return DesktopShortcutCreationPolicy.NEVER\n } else if (value === \"always\") {\n return DesktopShortcutCreationPolicy.ALWAYS\n } else {\n return DesktopShortcutCreationPolicy.FRESH_INSTALL\n }\n}\n\nexport enum DesktopShortcutCreationPolicy {\n FRESH_INSTALL,\n ALWAYS,\n NEVER,\n}\n"]}
|
||||
45
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.d.ts
generated
vendored
Executable file
45
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.d.ts
generated
vendored
Executable file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* File associations.
|
||||
*
|
||||
* macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.
|
||||
*
|
||||
* On Windows (NSIS) works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to `true`.
|
||||
*/
|
||||
export interface FileAssociation {
|
||||
/**
|
||||
* The extension (minus the leading period). e.g. `png`.
|
||||
*/
|
||||
readonly ext: string | Array<string>;
|
||||
/**
|
||||
* The name. e.g. `PNG`. Defaults to `ext`.
|
||||
*/
|
||||
readonly name?: string | null;
|
||||
/**
|
||||
* *windows-only.* The description.
|
||||
*/
|
||||
readonly description?: string | null;
|
||||
/**
|
||||
* *linux-only.* The mime-type.
|
||||
*/
|
||||
readonly mimeType?: string | null;
|
||||
/**
|
||||
* The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon.
|
||||
*
|
||||
* Not supported on Linux, file issue if need (default icon will be `x-office-document`). Not supported on MSI.
|
||||
*/
|
||||
readonly icon?: string | null;
|
||||
/**
|
||||
* *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.
|
||||
* @default Editor
|
||||
*/
|
||||
readonly role?: string;
|
||||
/**
|
||||
* *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.
|
||||
*/
|
||||
readonly isPackage?: boolean;
|
||||
/**
|
||||
* *macOS-only* The app’s rank with respect to the type. The value can be `Owner`, `Default`, `Alternate`, or `None`. Corresponds to `LSHandlerRank`.
|
||||
* @default Default
|
||||
*/
|
||||
readonly rank?: string;
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=FileAssociation.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/FileAssociation.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"FileAssociation.js","sourceRoot":"","sources":["../../src/options/FileAssociation.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * File associations.\n *\n * macOS (corresponds to [CFBundleDocumentTypes](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-101685)), NSIS, and MSI only.\n *\n * On Windows (NSIS) works only if [nsis.perMachine](https://electron.build/configuration/configuration#NsisOptions-perMachine) is set to `true`.\n */\nexport interface FileAssociation {\n /**\n * The extension (minus the leading period). e.g. `png`.\n */\n readonly ext: string | Array<string>\n\n /**\n * The name. e.g. `PNG`. Defaults to `ext`.\n */\n readonly name?: string | null\n\n /**\n * *windows-only.* The description.\n */\n readonly description?: string | null\n\n /**\n * *linux-only.* The mime-type.\n */\n readonly mimeType?: string | null\n\n /**\n * The path to icon (`.icns` for MacOS and `.ico` for Windows), relative to `build` (build resources directory). Defaults to `${firstExt}.icns`/`${firstExt}.ico` (if several extensions specified, first is used) or to application icon.\n *\n * Not supported on Linux, file issue if need (default icon will be `x-office-document`). Not supported on MSI.\n */\n readonly icon?: string | null\n\n /**\n * *macOS-only* The app’s role with respect to the type. The value can be `Editor`, `Viewer`, `Shell`, or `None`. Corresponds to `CFBundleTypeRole`.\n * @default Editor\n */\n readonly role?: string\n\n /**\n * *macOS-only* Whether the document is distributed as a bundle. If set to true, the bundle directory is treated as a file. Corresponds to `LSTypeIsPackage`.\n */\n readonly isPackage?: boolean\n\n /**\n * *macOS-only* The app’s rank with respect to the type. The value can be `Owner`, `Default`, `Alternate`, or `None`. Corresponds to `LSHandlerRank`.\n * @default Default\n */\n readonly rank?: string\n}\n"]}
|
||||
22
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.d.ts
generated
vendored
Executable file
22
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,22 @@
|
||||
import { TargetSpecificOptions } from "../core";
|
||||
import { CommonWindowsInstallerConfiguration } from "./CommonWindowsInstallerConfiguration";
|
||||
export interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions {
|
||||
/**
|
||||
* One-click installation.
|
||||
* @default true
|
||||
*/
|
||||
readonly oneClick?: boolean;
|
||||
/**
|
||||
* The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.
|
||||
*/
|
||||
readonly upgradeCode?: string | null;
|
||||
/**
|
||||
* If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings.
|
||||
* @default true
|
||||
*/
|
||||
readonly warningsAsErrors?: boolean;
|
||||
/**
|
||||
* Any additional arguments to be passed to the WiX installer compiler, such as `["-ext", "WixUtilExtension"]`
|
||||
*/
|
||||
readonly additionalWixArgs?: Array<string> | null;
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=MsiOptions.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/MsiOptions.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"MsiOptions.js","sourceRoot":"","sources":["../../src/options/MsiOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\nimport { CommonWindowsInstallerConfiguration } from \"./CommonWindowsInstallerConfiguration\"\n\nexport interface MsiOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * One-click installation.\n * @default true\n */\n readonly oneClick?: boolean\n\n /**\n * The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.\n */\n readonly upgradeCode?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * Any additional arguments to be passed to the WiX installer compiler, such as `[\"-ext\", \"WixUtilExtension\"]`\n */\n readonly additionalWixArgs?: Array<string> | null\n}\n"]}
|
||||
26
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.d.ts
generated
vendored
Executable file
26
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,26 @@
|
||||
import { TargetSpecificOptions } from "../core";
|
||||
import { CommonWindowsInstallerConfiguration } from "./CommonWindowsInstallerConfiguration";
|
||||
export interface MsiWrappedOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions {
|
||||
/**
|
||||
* Extra arguments to provide to the wrapped installer (ie: /S for silent install)
|
||||
*/
|
||||
readonly wrappedInstallerArgs?: string | null;
|
||||
/**
|
||||
* Determines if the wrapped installer should be executed with impersonation
|
||||
* @default false
|
||||
*/
|
||||
readonly impersonate?: boolean;
|
||||
/**
|
||||
* The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.
|
||||
*/
|
||||
readonly upgradeCode?: string | null;
|
||||
/**
|
||||
* If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings.
|
||||
* @default true
|
||||
*/
|
||||
readonly warningsAsErrors?: boolean;
|
||||
/**
|
||||
* Any additional arguments to be passed to the WiX installer compiler, such as `["-ext", "WixUtilExtension"]`
|
||||
*/
|
||||
readonly additionalWixArgs?: Array<string> | null;
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=MsiWrappedOptions.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/MsiWrappedOptions.js.map
generated
vendored
Executable file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"MsiWrappedOptions.js","sourceRoot":"","sources":["../../src/options/MsiWrappedOptions.ts"],"names":[],"mappings":"","sourcesContent":["import { TargetSpecificOptions } from \"../core\"\nimport { CommonWindowsInstallerConfiguration } from \"./CommonWindowsInstallerConfiguration\"\n\nexport interface MsiWrappedOptions extends CommonWindowsInstallerConfiguration, TargetSpecificOptions {\n /**\n * Extra arguments to provide to the wrapped installer (ie: /S for silent install)\n */\n readonly wrappedInstallerArgs?: string | null\n\n /**\n * Determines if the wrapped installer should be executed with impersonation\n * @default false\n */\n readonly impersonate?: boolean\n\n /**\n * The [upgrade code](https://msdn.microsoft.com/en-us/library/windows/desktop/aa372375(v=vs.85).aspx). Optional, by default generated using app id.\n */\n readonly upgradeCode?: string | null\n\n /**\n * If `warningsAsErrors` is `true` (default): treat warnings as errors. If `warningsAsErrors` is `false`: allow warnings.\n * @default true\n */\n readonly warningsAsErrors?: boolean\n\n /**\n * Any additional arguments to be passed to the WiX installer compiler, such as `[\"-ext\", \"WixUtilExtension\"]`\n */\n readonly additionalWixArgs?: Array<string> | null\n}\n"]}
|
||||
150
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.d.ts
generated
vendored
Executable file
150
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,150 @@
|
||||
import { CompressionLevel, Publish, TargetConfiguration, TargetSpecificOptions } from "../core";
|
||||
import { FileAssociation } from "./FileAssociation";
|
||||
export interface FileSet {
|
||||
/**
|
||||
* The source path relative to the project directory.
|
||||
*/
|
||||
from?: string;
|
||||
/**
|
||||
* The destination path relative to the app's content directory for `extraFiles` and the app's resource directory for `extraResources`.
|
||||
*/
|
||||
to?: string;
|
||||
/**
|
||||
* The [glob patterns](/file-patterns).
|
||||
*/
|
||||
filter?: Array<string> | string;
|
||||
}
|
||||
export interface AsarOptions {
|
||||
/**
|
||||
* Whether to automatically unpack executables files.
|
||||
* @default true
|
||||
*/
|
||||
smartUnpack?: boolean;
|
||||
ordering?: string | null;
|
||||
}
|
||||
export interface PlatformSpecificBuildOptions extends TargetSpecificOptions {
|
||||
/**
|
||||
* The application id. Used as [CFBundleIdentifier](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102070) for MacOS and as
|
||||
* [Application User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx) for Windows (NSIS target only, Squirrel.Windows not supported). It is strongly recommended that an explicit ID is set.
|
||||
* @default com.electron.${name}
|
||||
*/
|
||||
readonly appId?: string | null;
|
||||
/**
|
||||
* The [artifact file name template](/configuration/configuration#artifact-file-name-template). Defaults to `${productName}-${version}.${ext}` (some target can have other defaults, see corresponding options).
|
||||
*/
|
||||
readonly artifactName?: string | null;
|
||||
/**
|
||||
* The executable name. Defaults to `productName`.
|
||||
*/
|
||||
readonly executableName?: string | null;
|
||||
/**
|
||||
* The compression level. If you want to rapidly test build, `store` can reduce build time significantly. `maximum` doesn't lead to noticeable size difference, but increase build time.
|
||||
* @default normal
|
||||
*/
|
||||
readonly compression?: CompressionLevel | null;
|
||||
files?: Array<FileSet | string> | FileSet | string | null;
|
||||
extraResources?: Array<FileSet | string> | FileSet | string | null;
|
||||
extraFiles?: Array<FileSet | string> | FileSet | string | null;
|
||||
/**
|
||||
* Whether to package the application's source code into an archive, using [Electron's archive format](http://electron.atom.io/docs/tutorial/application-packaging/).
|
||||
*
|
||||
* Node modules, that must be unpacked, will be detected automatically, you don't need to explicitly set [asarUnpack](#configuration-asarUnpack) - please file an issue if this doesn't work.
|
||||
* @default true
|
||||
*/
|
||||
readonly asar?: AsarOptions | boolean | null;
|
||||
/**
|
||||
* A [glob patterns](/file-patterns) relative to the [app directory](#MetadataDirectories-app), which specifies which files to unpack when creating the [asar](http://electron.atom.io/docs/tutorial/application-packaging/) archive.
|
||||
*/
|
||||
readonly asarUnpack?: Array<string> | string | null;
|
||||
/** @private */
|
||||
readonly icon?: string | null;
|
||||
/**
|
||||
* The file associations.
|
||||
*/
|
||||
readonly fileAssociations?: Array<FileAssociation> | FileAssociation;
|
||||
/**
|
||||
* The URL protocol schemes.
|
||||
*/
|
||||
readonly protocols?: Array<Protocol> | Protocol;
|
||||
/**
|
||||
* The electron locales to keep. By default, all Electron locales used as-is.
|
||||
*/
|
||||
readonly electronLanguages?: Array<string> | string;
|
||||
/**
|
||||
* Whether to fail if app will be not code signed.
|
||||
*/
|
||||
readonly forceCodeSigning?: boolean;
|
||||
/**
|
||||
* The [electron-updater compatibility](/auto-update#compatibility) semver range.
|
||||
*/
|
||||
readonly electronUpdaterCompatibility?: string | null;
|
||||
publish?: Publish;
|
||||
/**
|
||||
* Whether to infer update channel from application version pre-release components. e.g. if version `0.12.1-alpha.1`, channel will be set to `alpha`. Otherwise to `latest`.
|
||||
* @default true
|
||||
*/
|
||||
readonly detectUpdateChannel?: boolean;
|
||||
/**
|
||||
* Please see [Building and Releasing using Channels](https://github.com/electron-userland/electron-builder/issues/1182#issuecomment-324947139).
|
||||
* @default false
|
||||
*/
|
||||
readonly generateUpdatesFilesForAllChannels?: boolean;
|
||||
/**
|
||||
* The release info. Intended for command line usage:
|
||||
*
|
||||
* ```
|
||||
* -c.releaseInfo.releaseNotes="new features"
|
||||
* ```
|
||||
*/
|
||||
readonly releaseInfo?: ReleaseInfo;
|
||||
readonly target?: Array<string | TargetConfiguration> | string | TargetConfiguration | null;
|
||||
/** @private */
|
||||
cscLink?: string | null;
|
||||
/** @private */
|
||||
cscKeyPassword?: string | null;
|
||||
readonly defaultArch?: string;
|
||||
}
|
||||
export interface ReleaseInfo {
|
||||
/**
|
||||
* The release name.
|
||||
*/
|
||||
releaseName?: string | null;
|
||||
/**
|
||||
* The release notes.
|
||||
*/
|
||||
releaseNotes?: string | null;
|
||||
/**
|
||||
* The path to release notes file. Defaults to `release-notes-${platform}.md` (where `platform` it is current platform — `mac`, `linux` or `windows`) or `release-notes.md` in the [build resources](#MetadataDirectories-buildResources).
|
||||
*/
|
||||
releaseNotesFile?: string | null;
|
||||
/**
|
||||
* The release date.
|
||||
*/
|
||||
releaseDate?: string;
|
||||
/**
|
||||
* Vendor specific information.
|
||||
*/
|
||||
vendor?: {
|
||||
[key: string]: any;
|
||||
} | null;
|
||||
}
|
||||
/**
|
||||
* URL Protocol Schemes. Protocols to associate the app with. macOS only.
|
||||
*
|
||||
* Please note — on macOS [you need to register an `open-url` event handler](http://electron.atom.io/docs/api/app/#event-open-url-macos).
|
||||
*/
|
||||
export interface Protocol {
|
||||
/**
|
||||
* The name. e.g. `IRC server URL`.
|
||||
*/
|
||||
readonly name: string;
|
||||
/**
|
||||
* The schemes. e.g. `["irc", "ircs"]`.
|
||||
*/
|
||||
readonly schemes: Array<string>;
|
||||
/**
|
||||
* *macOS-only* The app’s role with respect to the type.
|
||||
* @default Editor
|
||||
*/
|
||||
readonly role?: "Editor" | "Viewer" | "Shell" | "None";
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=PlatformSpecificBuildOptions.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/PlatformSpecificBuildOptions.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
141
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.d.ts
generated
vendored
Executable file
141
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,141 @@
|
||||
import { TargetSpecificOptions } from "../core";
|
||||
import { CommonLinuxOptions } from "./linuxOptions";
|
||||
export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {
|
||||
/**
|
||||
* A snap of type base to be used as the execution environment for this snap. Examples: `core`, `core18`, `core20`, `core22`. Defaults to `core20`
|
||||
*/
|
||||
readonly base?: string | null;
|
||||
/**
|
||||
* The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap.
|
||||
* @default strict
|
||||
*/
|
||||
readonly confinement?: "devmode" | "strict" | "classic" | null;
|
||||
/**
|
||||
* The custom environment. Defaults to `{"TMPDIR: "$XDG_RUNTIME_DIR"}`. If you set custom, it will be merged with default.
|
||||
*/
|
||||
readonly environment?: {
|
||||
[key: string]: string;
|
||||
} | null;
|
||||
/**
|
||||
* The 78 character long summary. Defaults to [productName](/configuration/configuration#Configuration-productName).
|
||||
*/
|
||||
readonly summary?: string | null;
|
||||
/**
|
||||
* The quality grade of the snap. It can be either `devel` (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels).
|
||||
* @default stable
|
||||
*/
|
||||
readonly grade?: "devel" | "stable" | null;
|
||||
/**
|
||||
* The list of features that must be supported by the core in order for this snap to install.
|
||||
*/
|
||||
readonly assumes?: Array<string> | string | null;
|
||||
/**
|
||||
* The list of debian packages needs to be installed for building this snap.
|
||||
*/
|
||||
readonly buildPackages?: Array<string> | null;
|
||||
/**
|
||||
* The list of Ubuntu packages to use that are needed to support the `app` part creation. Like `depends` for `deb`.
|
||||
* Defaults to `["libnspr4", "libnss3", "libxss1", "libappindicator3-1", "libsecret-1-0"]`.
|
||||
*
|
||||
* If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom package `foo` in addition to defaults.
|
||||
*/
|
||||
readonly stagePackages?: Array<string> | null;
|
||||
/**
|
||||
* The [hooks](https://docs.snapcraft.io/build-snaps/hooks) directory, relative to `build` (build resources directory).
|
||||
* @default build/snap-hooks
|
||||
*/
|
||||
readonly hooks?: string | null;
|
||||
/**
|
||||
* The list of [plugs](https://snapcraft.io/docs/reference/interfaces).
|
||||
* Defaults to `["desktop", "desktop-legacy", "home", "x11", "wayland", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]`.
|
||||
*
|
||||
* If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom plug `foo` in addition to defaults.
|
||||
*
|
||||
* Additional attributes can be specified using object instead of just name of plug:
|
||||
* ```
|
||||
*[
|
||||
* {
|
||||
* "browser-sandbox": {
|
||||
* "interface": "browser-support",
|
||||
* "allow-sandbox": true
|
||||
* },
|
||||
* },
|
||||
* "another-simple-plug-name"
|
||||
*]
|
||||
* ```
|
||||
*/
|
||||
readonly plugs?: Array<string | PlugDescriptor> | PlugDescriptor | null;
|
||||
/**
|
||||
* The list of [slots](https://snapcraft.io/docs/reference/interfaces).
|
||||
*
|
||||
* Additional attributes can be specified using object instead of just name of slot:
|
||||
* ```
|
||||
*[
|
||||
* {
|
||||
* "mpris": {
|
||||
* "name": "chromium"
|
||||
* },
|
||||
* }
|
||||
*]
|
||||
*
|
||||
* In case you want your application to be a compliant MPris player, you will need to definie
|
||||
* The mpris slot with "chromium" name.
|
||||
* This electron has it [hardcoded](https://source.chromium.org/chromium/chromium/src/+/master:components/system_media_controls/linux/system_media_controls_linux.cc;l=51;bpv=0;bpt=1),
|
||||
* and we need to pass this name so snap [will allow it](https://forum.snapcraft.io/t/unable-to-use-mpris-interface/15360/7) in strict confinement.
|
||||
*
|
||||
*/
|
||||
readonly slots?: Array<string | SlotDescriptor> | PlugDescriptor | null;
|
||||
/**
|
||||
* Specifies any [parts](https://snapcraft.io/docs/reference/parts) that should be built before this part.
|
||||
* Defaults to `["desktop-gtk2""]`.
|
||||
*
|
||||
* If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom parts `foo` in addition to defaults.
|
||||
*/
|
||||
readonly after?: Array<string> | null;
|
||||
/**
|
||||
* Whether to use template snap. Defaults to `true` if `stagePackages` not specified.
|
||||
*/
|
||||
readonly useTemplateApp?: boolean;
|
||||
/**
|
||||
* Whether or not the snap should automatically start on login.
|
||||
* @default false
|
||||
*/
|
||||
readonly autoStart?: boolean;
|
||||
/**
|
||||
* Specifies any files to make accessible from locations such as `/usr`, `/var`, and `/etc`. See [snap layouts](https://snapcraft.io/docs/snap-layouts) to learn more.
|
||||
*/
|
||||
readonly layout?: {
|
||||
[key: string]: {
|
||||
[key: string]: string;
|
||||
};
|
||||
} | null;
|
||||
/**
|
||||
* Specifies which files from the app part to stage and which to exclude. Individual files, directories, wildcards, globstars, and exclusions are accepted. See [Snapcraft filesets](https://snapcraft.io/docs/snapcraft-filesets) to learn more about the format.
|
||||
*
|
||||
* The defaults can be found in [snap.ts](https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/snap/snapcraft.yaml#L29).
|
||||
*/
|
||||
readonly appPartStage?: Array<string> | null;
|
||||
/**
|
||||
* An optional title for the snap, may contain uppercase letters and spaces. Defaults to `productName`. See [snap format documentation](https://snapcraft.io/docs/snap-format).
|
||||
*/
|
||||
readonly title?: string | null;
|
||||
/**
|
||||
* Sets the compression type for the snap. Can be xz, lzo, or null.
|
||||
*/
|
||||
readonly compression?: "xz" | "lzo" | null;
|
||||
/**
|
||||
* Allow running the program with native wayland support with --ozone-platform=wayland.
|
||||
* Disabled by default because of this issue in older Electron/Snap versions: https://github.com/electron-userland/electron-builder/issues/4007
|
||||
*/
|
||||
readonly allowNativeWayland?: boolean | null;
|
||||
}
|
||||
export interface PlugDescriptor {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
} | null;
|
||||
}
|
||||
export interface SlotDescriptor {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
} | null;
|
||||
}
|
||||
3
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.js
generated
vendored
Executable file
3
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.js
generated
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=SnapOptions.js.map
|
||||
1
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.js.map
generated
vendored
Executable file
1
mc_test/node_modules/app-builder-lib/out/options/SnapOptions.js.map
generated
vendored
Executable file
File diff suppressed because one or more lines are too long
41
mc_test/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.d.ts
generated
vendored
Executable file
41
mc_test/node_modules/app-builder-lib/out/options/SquirrelWindowsOptions.d.ts
generated
vendored
Executable file
@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Squirrel.Windows options.
|
||||
*/
|
||||
import { TargetSpecificOptions } from "../core";
|
||||
export interface SquirrelWindowsOptions extends TargetSpecificOptions {
|
||||
/**
|
||||
* A URL to an ICO file to use as the application icon (displayed in Control Panel > Programs and Features). Defaults to the Electron icon.
|
||||
*
|
||||
* Please note — [local icon file url is not accepted](https://github.com/atom/grunt-electron-installer/issues/73), must be https/http.
|
||||
*
|
||||
* If you don't plan to build windows installer, you can omit it.
|
||||
* If your project repository is public on GitHub, it will be `https://github.com/${u}/${p}/blob/master/build/icon.ico?raw=true` by default.
|
||||
*/
|
||||
readonly iconUrl?: string | null;
|
||||
/**
|
||||
* The path to a .gif file to display during install. `build/install-spinner.gif` will be used if exists (it is a recommended way to set)
|
||||
* (otherwise [default](https://github.com/electron/windows-installer/blob/master/resources/install-spinner.gif)).
|
||||
*/
|
||||
readonly loadingGif?: string | null;
|
||||
/**
|
||||
* Whether to create an MSI installer. Defaults to `false` (MSI is not created).
|
||||
*/
|
||||
readonly msi?: boolean;
|
||||
/**
|
||||
* A URL to your existing updates. Or `true` to automatically set to your GitHub repository. If given, these will be downloaded to create delta updates.
|
||||
*/
|
||||
readonly remoteReleases?: string | boolean | null;
|
||||
/**
|
||||
* Authentication token for remote updates
|
||||
*/
|
||||
readonly remoteToken?: string | null;
|
||||
/**
|
||||
* Use `appId` to identify package instead of `name`.
|
||||
*/
|
||||
readonly useAppIdAsId?: boolean;
|
||||
/**
|
||||
* https://github.com/electron-userland/electron-builder/issues/1743
|
||||
* @private
|
||||
*/
|
||||
readonly name?: string;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user