stuff
This commit is contained in:
13
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts
generated
vendored
Normal file
13
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
import { Filter } from "builder-util/out/fs";
|
||||
import { Stats } from "fs-extra";
|
||||
import { FileMatcher } from "../fileMatcher";
|
||||
import { Packager } from "../packager";
|
||||
export declare abstract class FileCopyHelper {
|
||||
protected readonly matcher: FileMatcher;
|
||||
readonly filter: Filter | null;
|
||||
protected readonly packager: Packager;
|
||||
readonly metadata: Map<string, Stats>;
|
||||
protected constructor(matcher: FileMatcher, filter: Filter | null, packager: Packager);
|
||||
protected handleFile(file: string, parent: string, fileStat: Stats): Promise<Stats | null> | null;
|
||||
private handleSymlink;
|
||||
}
|
126
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.js
generated
vendored
Normal file
126
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.js
generated
vendored
Normal file
@ -0,0 +1,126 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.AppFileWalker = exports.FileCopyHelper = void 0;
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const nodeModulesSystemDependentSuffix = `${path.sep}node_modules`;
|
||||
|
||||
function addAllPatternIfNeed(matcher) {
|
||||
if (!matcher.isSpecifiedAsEmptyArray && (matcher.isEmpty() || matcher.containsOnlyIgnore())) {
|
||||
matcher.prependPattern("**/*");
|
||||
}
|
||||
|
||||
return matcher;
|
||||
}
|
||||
|
||||
class FileCopyHelper {
|
||||
constructor(matcher, filter, packager) {
|
||||
this.matcher = matcher;
|
||||
this.filter = filter;
|
||||
this.packager = packager;
|
||||
this.metadata = new Map();
|
||||
}
|
||||
|
||||
handleFile(file, parent, fileStat) {
|
||||
if (!fileStat.isSymbolicLink()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (0, _fsExtra().readlink)(file).then(linkTarget => {
|
||||
// http://unix.stackexchange.com/questions/105637/is-symlinks-target-relative-to-the-destinations-parent-directory-and-if-so-wh
|
||||
return this.handleSymlink(fileStat, file, parent, linkTarget);
|
||||
});
|
||||
}
|
||||
|
||||
handleSymlink(fileStat, file, parent, linkTarget) {
|
||||
const resolvedLinkTarget = path.resolve(parent, linkTarget);
|
||||
const link = path.relative(this.matcher.from, resolvedLinkTarget);
|
||||
|
||||
if (link.startsWith("..")) {
|
||||
// outside of project, linked module (https://github.com/electron-userland/electron-builder/issues/675)
|
||||
return (0, _fsExtra().stat)(resolvedLinkTarget).then(targetFileStat => {
|
||||
this.metadata.set(file, targetFileStat);
|
||||
return targetFileStat;
|
||||
});
|
||||
} else {
|
||||
const s = fileStat;
|
||||
s.relativeLink = link;
|
||||
s.linkRelativeToFile = path.relative(parent, resolvedLinkTarget);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.FileCopyHelper = FileCopyHelper;
|
||||
|
||||
function createAppFilter(matcher, packager) {
|
||||
if (packager.areNodeModulesHandledExternally) {
|
||||
return matcher.isEmpty() ? null : matcher.createFilter();
|
||||
}
|
||||
|
||||
const nodeModulesFilter = (file, fileStat) => {
|
||||
return !(fileStat.isDirectory() && file.endsWith(nodeModulesSystemDependentSuffix));
|
||||
};
|
||||
|
||||
if (matcher.isEmpty()) {
|
||||
return nodeModulesFilter;
|
||||
}
|
||||
|
||||
const filter = matcher.createFilter();
|
||||
return (file, fileStat) => {
|
||||
if (!nodeModulesFilter(file, fileStat)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return filter(file, fileStat);
|
||||
};
|
||||
}
|
||||
/** @internal */
|
||||
|
||||
|
||||
class AppFileWalker extends FileCopyHelper {
|
||||
constructor(matcher, packager) {
|
||||
super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager);
|
||||
} // noinspection JSUnusedGlobalSymbols
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
||||
|
||||
consume(file, fileStat, parent, siblingNames) {
|
||||
if (fileStat.isDirectory()) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/1539
|
||||
// but do not filter if we inside node_modules dir
|
||||
// update: solution disabled, node module resolver should support such setup
|
||||
if (file.endsWith(nodeModulesSystemDependentSuffix)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// save memory - no need to store stat for directory
|
||||
this.metadata.set(file, fileStat);
|
||||
}
|
||||
|
||||
return this.handleFile(file, parent, fileStat);
|
||||
}
|
||||
|
||||
} exports.AppFileWalker = AppFileWalker;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=AppFileWalker.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/AppFileWalker.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
192
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js
generated
vendored
Normal file
192
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js
generated
vendored
Normal file
@ -0,0 +1,192 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.NodeModuleCopyHelper = void 0;
|
||||
|
||||
function _bluebirdLst() {
|
||||
const data = _interopRequireDefault(require("bluebird-lst"));
|
||||
|
||||
_bluebirdLst = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = require("builder-util/out/fs");
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _fileMatcher() {
|
||||
const data = require("../fileMatcher");
|
||||
|
||||
_fileMatcher = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _platformPackager() {
|
||||
const data = require("../platformPackager");
|
||||
|
||||
_platformPackager = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _AppFileWalker() {
|
||||
const data = require("./AppFileWalker");
|
||||
|
||||
_AppFileWalker = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const excludedFiles = new Set([".DS_Store", "node_modules"
|
||||
/* already in the queue */
|
||||
, "CHANGELOG.md", "ChangeLog", "changelog.md", "Changelog.md", "Changelog", "binding.gyp", ".npmignore"].concat(_fileMatcher().excludedNames.split(",")));
|
||||
const topLevelExcludedFiles = new Set(["test.js", "karma.conf.js", ".coveralls.yml", "README.md", "readme.markdown", "README", "readme.md", "Readme.md", "Readme", "readme", "test", "__tests__", "tests", "powered-test", "example", "examples", ".bin"]);
|
||||
/** @internal */
|
||||
|
||||
class NodeModuleCopyHelper extends _AppFileWalker().FileCopyHelper {
|
||||
constructor(matcher, packager) {
|
||||
super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager);
|
||||
}
|
||||
|
||||
async collectNodeModules(baseDir, moduleNames, nodeModuleExcludedExts) {
|
||||
const filter = this.filter;
|
||||
const metadata = this.metadata;
|
||||
const onNodeModuleFile = (0, _platformPackager().resolveFunction)(this.packager.config.onNodeModuleFile, "onNodeModuleFile");
|
||||
const result = [];
|
||||
const queue = [];
|
||||
|
||||
for (const moduleName of moduleNames) {
|
||||
const tmpPath = baseDir + path.sep + moduleName;
|
||||
queue.length = 1; // The path should be corrected in Windows that when the moduleName is Scoped packages named.
|
||||
|
||||
const depPath = path.normalize(tmpPath);
|
||||
queue[0] = depPath;
|
||||
|
||||
while (queue.length > 0) {
|
||||
const dirPath = queue.pop();
|
||||
const childNames = await (0, _fsExtra().readdir)(dirPath);
|
||||
childNames.sort();
|
||||
const isTopLevel = dirPath === depPath;
|
||||
const dirs = []; // our handler is async, but we should add sorted files, so, we add file to result not in the mapper, but after map
|
||||
|
||||
const sortedFilePaths = await _bluebirdLst().default.map(childNames, name => {
|
||||
if (onNodeModuleFile != null) {
|
||||
onNodeModuleFile(dirPath + path.sep + name);
|
||||
}
|
||||
|
||||
if (excludedFiles.has(name) || name.startsWith("._")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const ext of nodeModuleExcludedExts) {
|
||||
if (name.endsWith(ext)) {
|
||||
return null;
|
||||
}
|
||||
} // noinspection SpellCheckingInspection
|
||||
|
||||
|
||||
if (isTopLevel && (topLevelExcludedFiles.has(name) || moduleName === "libui-node" && (name === "build" || name === "docs" || name === "src"))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (dirPath.endsWith("build")) {
|
||||
if (name === "gyp-mac-tool" || name === "Makefile" || name.endsWith(".mk") || name.endsWith(".gypi") || name.endsWith(".Makefile")) {
|
||||
return null;
|
||||
}
|
||||
} else if (dirPath.endsWith("Release") && (name === ".deps" || name === "obj.target")) {
|
||||
return null;
|
||||
} else if (name === "src" && (dirPath.endsWith("keytar") || dirPath.endsWith("keytar-prebuild"))) {
|
||||
return null;
|
||||
} else if (dirPath.endsWith("lzma-native") && (name === "build" || name === "deps")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const filePath = dirPath + path.sep + name;
|
||||
return (0, _fsExtra().lstat)(filePath).then(stat => {
|
||||
if (filter != null && !filter(filePath, stat)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!stat.isDirectory()) {
|
||||
metadata.set(filePath, stat);
|
||||
}
|
||||
|
||||
const consumerResult = this.handleFile(filePath, dirPath, stat);
|
||||
|
||||
if (consumerResult == null) {
|
||||
if (stat.isDirectory()) {
|
||||
dirs.push(name);
|
||||
return null;
|
||||
} else {
|
||||
return filePath;
|
||||
}
|
||||
} else {
|
||||
return consumerResult.then(it => {
|
||||
// asarUtil can return modified stat (symlink handling)
|
||||
if ((it == null ? stat : it).isDirectory()) {
|
||||
dirs.push(name);
|
||||
return null;
|
||||
} else {
|
||||
return filePath;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, _fs().CONCURRENCY);
|
||||
|
||||
for (const child of sortedFilePaths) {
|
||||
if (child != null) {
|
||||
result.push(child);
|
||||
}
|
||||
}
|
||||
|
||||
dirs.sort();
|
||||
|
||||
for (const child of dirs) {
|
||||
queue.push(dirPath + path.sep + child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
} exports.NodeModuleCopyHelper = NodeModuleCopyHelper;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=NodeModuleCopyHelper.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.d.ts
generated
vendored
Normal file
6
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
import { SpawnOptions } from "child_process";
|
||||
export declare function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T>;
|
||||
export declare function executeAppBuilderAndWriteJson(args: Array<string>, data: any, extraOptions?: SpawnOptions): Promise<string>;
|
||||
export declare function objectToArgs(to: Array<string>, argNameToValue: {
|
||||
[key: string]: string | null;
|
||||
}): void;
|
52
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.js
generated
vendored
Normal file
52
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.executeAppBuilderAsJson = executeAppBuilderAsJson;
|
||||
exports.executeAppBuilderAndWriteJson = executeAppBuilderAndWriteJson;
|
||||
exports.objectToArgs = objectToArgs;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function executeAppBuilderAsJson(args) {
|
||||
return (0, _builderUtil().executeAppBuilder)(args).then(rawResult => {
|
||||
if (rawResult === "") {
|
||||
return Object.create(null);
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(rawResult);
|
||||
} catch (e) {
|
||||
throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function executeAppBuilderAndWriteJson(args, data, extraOptions = {}) {
|
||||
return (0, _builderUtil().executeAppBuilder)(args, childProcess => {
|
||||
childProcess.stdin.end(JSON.stringify(data));
|
||||
}, { ...extraOptions,
|
||||
stdio: ["pipe", "pipe", process.stdout]
|
||||
});
|
||||
}
|
||||
|
||||
function objectToArgs(to, argNameToValue) {
|
||||
for (const name of Object.keys(argNameToValue)) {
|
||||
const value = argNameToValue[name];
|
||||
|
||||
if (value != null) {
|
||||
to.push(`--${name}`, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=appBuilder.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/appBuilder.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/appBuilder.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGM,SAAU,uBAAV,CAAqC,IAArC,EAAwD;AAC5D,SAAO,sCAAkB,IAAlB,EACJ,IADI,CACC,SAAS,IAAG;AAChB,QAAI,SAAS,KAAK,EAAlB,EAAsB;AACpB,aAAO,MAAM,CAAC,MAAP,CAAc,IAAd,CAAP;AACD;;AAED,QAAI;AACF,aAAO,IAAI,CAAC,KAAL,CAAW,SAAX,CAAP;AACD,KAFD,CAGA,OAAO,CAAP,EAAU;AACR,YAAM,IAAI,KAAJ,CAAU,wBAAwB,CAAC,CAAC,OAAO,MAAM,SAAS,GAA1D,CAAN;AACD;AACF,GAZI,CAAP;AAaD;;AAEK,SAAU,6BAAV,CAAwC,IAAxC,EAA6D,IAA7D,EAAwE,YAAA,GAA6B,EAArG,EAAuG;AAC3G,SAAO,sCAAkB,IAAlB,EAAwB,YAAY,IAAG;AAC5C,IAAA,YAAY,CAAC,KAAb,CAAqB,GAArB,CAAyB,IAAI,CAAC,SAAL,CAAe,IAAf,CAAzB;AACD,GAFM,EAEJ,EACD,GAAG,YADF;AAED,IAAA,KAAK,EAAE,CAAC,MAAD,EAAS,MAAT,EAAiB,OAAO,CAAC,MAAzB;AAFN,GAFI,CAAP;AAMD;;AAEK,SAAU,YAAV,CAAuB,EAAvB,EAA0C,cAA1C,EAA0F;AAC9F,OAAK,MAAM,IAAX,IAAmB,MAAM,CAAC,IAAP,CAAY,cAAZ,CAAnB,EAAgD;AAC9C,UAAM,KAAK,GAAG,cAAc,CAAC,IAAD,CAA5B;;AACA,QAAI,KAAK,IAAI,IAAb,EAAmB;AACjB,MAAA,EAAE,CAAC,IAAH,CAAQ,KAAK,IAAI,EAAjB,EAAqB,KAArB;AACD;AACF;AACF,C","sourcesContent":["import { executeAppBuilder } from \"builder-util\"\nimport { SpawnOptions } from \"child_process\"\n\nexport function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T> {\n return executeAppBuilder(args)\n .then(rawResult => {\n if (rawResult === \"\") {\n return Object.create(null) as T\n }\n\n try {\n return JSON.parse(rawResult) as T\n }\n catch (e) {\n throw new Error(`Cannot parse result: ${e.message}: \"${rawResult}\"`)\n }\n })\n}\n\nexport function executeAppBuilderAndWriteJson(args: Array<string>, data: any, extraOptions: SpawnOptions = {}): Promise<string> {\n return executeAppBuilder(args, childProcess => {\n childProcess.stdin!!.end(JSON.stringify(data))\n }, {\n ...extraOptions,\n stdio: [\"pipe\", \"pipe\", process.stdout]\n })\n}\n\nexport function objectToArgs(to: Array<string>, argNameToValue: { [key: string]: string | null }): void {\n for (const name of Object.keys(argNameToValue)) {\n const value = argNameToValue[name]\n if (value != null) {\n to.push(`--${name}`, value)\n }\n }\n}\n"],"sourceRoot":""}
|
16
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.d.ts
generated
vendored
Normal file
16
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.d.ts
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import { FileTransformer } from "builder-util/out/fs";
|
||||
import { Stats } from "fs-extra";
|
||||
import { FileMatcher } from "../fileMatcher";
|
||||
import { Packager } from "../packager";
|
||||
import { PlatformPackager } from "../platformPackager";
|
||||
export declare function getDestinationPath(file: string, fileSet: ResolvedFileSet): string;
|
||||
export declare function copyAppFiles(fileSet: ResolvedFileSet, packager: Packager, transformer: FileTransformer): Promise<void>;
|
||||
export interface ResolvedFileSet {
|
||||
src: string;
|
||||
destination: string;
|
||||
files: Array<string>;
|
||||
metadata: Map<string, Stats>;
|
||||
transformedFiles?: Map<number, string | Buffer> | null;
|
||||
}
|
||||
export declare function transformFiles(transformer: FileTransformer, fileSet: ResolvedFileSet): Promise<void>;
|
||||
export declare function computeFileSets(matchers: Array<FileMatcher>, transformer: FileTransformer | null, platformPackager: PlatformPackager<any>, isElectronCompile: boolean): Promise<Array<ResolvedFileSet>>;
|
399
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.js
generated
vendored
Normal file
399
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.js
generated
vendored
Normal file
@ -0,0 +1,399 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getDestinationPath = getDestinationPath;
|
||||
exports.copyAppFiles = copyAppFiles;
|
||||
exports.transformFiles = transformFiles;
|
||||
exports.computeFileSets = computeFileSets;
|
||||
exports.computeNodeModuleFileSets = computeNodeModuleFileSets;
|
||||
exports.ELECTRON_COMPILE_SHIM_FILENAME = void 0;
|
||||
|
||||
function _bluebirdLst() {
|
||||
const data = _interopRequireDefault(require("bluebird-lst"));
|
||||
|
||||
_bluebirdLst = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = require("builder-util/out/fs");
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _unpackDetector() {
|
||||
const data = require("../asar/unpackDetector");
|
||||
|
||||
_unpackDetector = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _core() {
|
||||
const data = require("../core");
|
||||
|
||||
_core = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fileMatcher() {
|
||||
const data = require("../fileMatcher");
|
||||
|
||||
_fileMatcher = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fileTransformer() {
|
||||
const data = require("../fileTransformer");
|
||||
|
||||
_fileTransformer = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _AppFileWalker() {
|
||||
const data = require("./AppFileWalker");
|
||||
|
||||
_AppFileWalker = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _NodeModuleCopyHelper() {
|
||||
const data = require("./NodeModuleCopyHelper");
|
||||
|
||||
_NodeModuleCopyHelper = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`;
|
||||
/** @internal */
|
||||
|
||||
const ELECTRON_COMPILE_SHIM_FILENAME = "__shim.js";
|
||||
exports.ELECTRON_COMPILE_SHIM_FILENAME = ELECTRON_COMPILE_SHIM_FILENAME;
|
||||
|
||||
function getDestinationPath(file, fileSet) {
|
||||
if (file === fileSet.src) {
|
||||
return fileSet.destination;
|
||||
} else {
|
||||
const src = fileSet.src;
|
||||
const dest = fileSet.destination;
|
||||
|
||||
if (file.length > src.length && file.startsWith(src) && file[src.length] === path.sep) {
|
||||
return dest + file.substring(src.length);
|
||||
} else {
|
||||
// hoisted node_modules
|
||||
// not lastIndexOf, to ensure that nested module (top-level module depends on) copied to parent node_modules, not to top-level directory
|
||||
// project https://github.com/angexis/punchcontrol/commit/cf929aba55c40d0d8901c54df7945e1d001ce022
|
||||
let index = file.indexOf(_fileTransformer().NODE_MODULES_PATTERN);
|
||||
|
||||
if (index < 0 && file.endsWith(`${path.sep}node_modules`)) {
|
||||
index = file.length - 13;
|
||||
}
|
||||
|
||||
if (index < 0) {
|
||||
throw new Error(`File "${file}" not under the source directory "${fileSet.src}"`);
|
||||
}
|
||||
|
||||
return dest + file.substring(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function copyAppFiles(fileSet, packager, transformer) {
|
||||
const metadata = fileSet.metadata; // search auto unpacked dir
|
||||
|
||||
const taskManager = new (_builderUtil().AsyncTaskManager)(packager.cancellationToken);
|
||||
const createdParentDirs = new Set();
|
||||
const fileCopier = new (_fs().FileCopier)(file => {
|
||||
// https://github.com/electron-userland/electron-builder/issues/3038
|
||||
return !((0, _unpackDetector().isLibOrExe)(file) || file.endsWith(".node"));
|
||||
}, transformer);
|
||||
const links = [];
|
||||
|
||||
for (let i = 0, n = fileSet.files.length; i < n; i++) {
|
||||
const sourceFile = fileSet.files[i];
|
||||
const stat = metadata.get(sourceFile);
|
||||
|
||||
if (stat == null) {
|
||||
// dir
|
||||
continue;
|
||||
}
|
||||
|
||||
const destinationFile = getDestinationPath(sourceFile, fileSet);
|
||||
|
||||
if (stat.isSymbolicLink()) {
|
||||
links.push({
|
||||
file: destinationFile,
|
||||
link: await (0, _fsExtra().readlink)(sourceFile)
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
const fileParent = path.dirname(destinationFile);
|
||||
|
||||
if (!createdParentDirs.has(fileParent)) {
|
||||
createdParentDirs.add(fileParent);
|
||||
await (0, _fsExtra().ensureDir)(fileParent);
|
||||
}
|
||||
|
||||
taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat));
|
||||
|
||||
if (taskManager.tasks.length > _fs().MAX_FILE_REQUESTS) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
}
|
||||
|
||||
if (taskManager.tasks.length > 0) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
|
||||
if (links.length > 0) {
|
||||
await _bluebirdLst().default.map(links, it => (0, _fsExtra().symlink)(it.link, it.file), _fs().CONCURRENCY);
|
||||
}
|
||||
} // used only for ASAR, if no asar, file transformed on the fly
|
||||
|
||||
|
||||
async function transformFiles(transformer, fileSet) {
|
||||
if (transformer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let transformedFiles = fileSet.transformedFiles;
|
||||
|
||||
if (fileSet.transformedFiles == null) {
|
||||
transformedFiles = new Map();
|
||||
fileSet.transformedFiles = transformedFiles;
|
||||
}
|
||||
|
||||
const metadata = fileSet.metadata;
|
||||
await _bluebirdLst().default.filter(fileSet.files, (it, index) => {
|
||||
const fileStat = metadata.get(it);
|
||||
|
||||
if (fileStat == null || !fileStat.isFile()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const transformedValue = transformer(it);
|
||||
|
||||
if (transformedValue == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeof transformedValue === "object" && "then" in transformedValue) {
|
||||
return transformedValue.then(it => {
|
||||
if (it != null) {
|
||||
transformedFiles.set(index, it);
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
transformedFiles.set(index, transformedValue);
|
||||
return false;
|
||||
}, _fs().CONCURRENCY);
|
||||
}
|
||||
|
||||
async function computeFileSets(matchers, transformer, platformPackager, isElectronCompile) {
|
||||
const fileSets = [];
|
||||
const packager = platformPackager.info;
|
||||
|
||||
for (const matcher of matchers) {
|
||||
const fileWalker = new (_AppFileWalker().AppFileWalker)(matcher, packager);
|
||||
const fromStat = await (0, _fs().statOrNull)(matcher.from);
|
||||
|
||||
if (fromStat == null) {
|
||||
_builderUtil().log.debug({
|
||||
directory: matcher.from,
|
||||
reason: "doesn't exist"
|
||||
}, `skipped copying`);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
const files = await (0, _fs().walk)(matcher.from, fileWalker.filter, fileWalker);
|
||||
const metadata = fileWalker.metadata;
|
||||
fileSets.push(validateFileSet({
|
||||
src: matcher.from,
|
||||
files,
|
||||
metadata,
|
||||
destination: matcher.to
|
||||
}));
|
||||
}
|
||||
|
||||
if (isElectronCompile) {
|
||||
// cache files should be first (better IO)
|
||||
fileSets.unshift(await compileUsingElectronCompile(fileSets[0], packager));
|
||||
}
|
||||
|
||||
return fileSets;
|
||||
}
|
||||
|
||||
function getNodeModuleExcludedExts(platformPackager) {
|
||||
// do not exclude *.h files (https://github.com/electron-userland/electron-builder/issues/2852)
|
||||
const result = [".o", ".obj"].concat(_fileMatcher().excludedExts.split(",").map(it => `.${it}`));
|
||||
|
||||
if (platformPackager.config.includePdb !== true) {
|
||||
result.push(".pdb");
|
||||
}
|
||||
|
||||
if (platformPackager.platform !== _core().Platform.WINDOWS) {
|
||||
// https://github.com/electron-userland/electron-builder/issues/1738
|
||||
result.push(".dll");
|
||||
result.push(".exe");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function validateFileSet(fileSet) {
|
||||
if (fileSet.src == null || fileSet.src.length === 0) {
|
||||
throw new Error("fileset src is empty");
|
||||
}
|
||||
|
||||
return fileSet;
|
||||
}
|
||||
/** @internal */
|
||||
|
||||
|
||||
async function computeNodeModuleFileSets(platformPackager, mainMatcher) {
|
||||
const deps = await platformPackager.info.getNodeDependencyInfo(platformPackager.platform).value;
|
||||
const nodeModuleExcludedExts = getNodeModuleExcludedExts(platformPackager); // serial execution because copyNodeModules is concurrent and so, no need to increase queue/pressure
|
||||
|
||||
const result = new Array();
|
||||
let index = 0;
|
||||
|
||||
for (const info of deps) {
|
||||
const source = info.dir;
|
||||
const destination = getDestinationPath(source, {
|
||||
src: mainMatcher.from,
|
||||
destination: mainMatcher.to,
|
||||
files: [],
|
||||
metadata: null
|
||||
}); // use main matcher patterns, so, user can exclude some files in such hoisted node modules
|
||||
// source here includes node_modules, but pattern base should be without because users expect that pattern "!node_modules/loot-core/src{,/**/*}" will work
|
||||
|
||||
const matcher = new (_fileMatcher().FileMatcher)(path.dirname(source), destination, mainMatcher.macroExpander, mainMatcher.patterns);
|
||||
const copier = new (_NodeModuleCopyHelper().NodeModuleCopyHelper)(matcher, platformPackager.info);
|
||||
const files = await copier.collectNodeModules(source, info.deps.map(it => it.name), nodeModuleExcludedExts);
|
||||
result[index++] = validateFileSet({
|
||||
src: source,
|
||||
destination,
|
||||
files,
|
||||
metadata: copier.metadata
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
async function compileUsingElectronCompile(mainFileSet, packager) {
|
||||
_builderUtil().log.info("compiling using electron-compile");
|
||||
|
||||
const electronCompileCache = await packager.tempDirManager.getTempDir({
|
||||
prefix: "electron-compile-cache"
|
||||
});
|
||||
const cacheDir = path.join(electronCompileCache, ".cache"); // clear and create cache dir
|
||||
|
||||
await (0, _fsExtra().ensureDir)(cacheDir);
|
||||
const compilerHost = await (0, _fileTransformer().createElectronCompilerHost)(mainFileSet.src, cacheDir);
|
||||
const nextSlashIndex = mainFileSet.src.length + 1; // pre-compute electron-compile to cache dir - we need to process only subdirectories, not direct files of app dir
|
||||
|
||||
await _bluebirdLst().default.map(mainFileSet.files, file => {
|
||||
if (file.includes(_fileTransformer().NODE_MODULES_PATTERN) || file.includes(BOWER_COMPONENTS_PATTERN) || !file.includes(path.sep, nextSlashIndex) // ignore not root files
|
||||
|| !mainFileSet.metadata.get(file).isFile()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return compilerHost.compile(file).then(() => null);
|
||||
}, _fs().CONCURRENCY);
|
||||
await compilerHost.saveConfiguration();
|
||||
const metadata = new Map();
|
||||
const cacheFiles = await (0, _fs().walk)(cacheDir, file => !file.startsWith("."), {
|
||||
consume: (file, fileStat) => {
|
||||
if (fileStat.isFile()) {
|
||||
metadata.set(file, fileStat);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}); // add shim
|
||||
|
||||
const shimPath = `${mainFileSet.src}${path.sep}${ELECTRON_COMPILE_SHIM_FILENAME}`;
|
||||
mainFileSet.files.push(shimPath);
|
||||
mainFileSet.metadata.set(shimPath, {
|
||||
isFile: () => true,
|
||||
isDirectory: () => false,
|
||||
isSymbolicLink: () => false
|
||||
});
|
||||
|
||||
if (mainFileSet.transformedFiles == null) {
|
||||
mainFileSet.transformedFiles = new Map();
|
||||
}
|
||||
|
||||
mainFileSet.transformedFiles.set(mainFileSet.files.length - 1, `
|
||||
'use strict';
|
||||
require('electron-compile').init(__dirname, require('path').resolve(__dirname, '${packager.metadata.main || "index"}'), true);
|
||||
`);
|
||||
return {
|
||||
src: electronCompileCache,
|
||||
files: cacheFiles,
|
||||
metadata,
|
||||
destination: mainFileSet.destination
|
||||
};
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=appFileCopier.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/appFileCopier.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.d.ts
generated
vendored
Normal file
6
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.d.ts
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
export interface ToolInfo {
|
||||
path: string;
|
||||
env?: any;
|
||||
}
|
||||
export declare function computeEnv(oldValue: string | null | undefined, newValues: Array<string>): string;
|
||||
export declare function computeToolEnv(libPath: Array<string>): any;
|
21
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.js
generated
vendored
Normal file
21
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.computeEnv = computeEnv;
|
||||
exports.computeToolEnv = computeToolEnv;
|
||||
|
||||
function computeEnv(oldValue, newValues) {
|
||||
const parsedOldValue = oldValue ? oldValue.split(":") : [];
|
||||
return newValues.concat(parsedOldValue).filter(it => it.length > 0).join(":");
|
||||
}
|
||||
|
||||
function computeToolEnv(libPath) {
|
||||
// noinspection SpellCheckingInspection
|
||||
return { ...process.env,
|
||||
DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, libPath)
|
||||
};
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=bundledTool.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/bundledTool.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/bundledTool.ts"],"names":[],"mappings":";;;;;;;;AAKM,SAAU,UAAV,CAAqB,QAArB,EAA0D,SAA1D,EAAkF;AACtF,QAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,CAAC,KAAT,CAAe,GAAf,CAAH,GAAyB,EAAxD;AACA,SAAO,SAAS,CAAC,MAAV,CAAiB,cAAjB,EAAiC,MAAjC,CAAwC,EAAE,IAAI,EAAE,CAAC,MAAH,GAAY,CAA1D,EAA6D,IAA7D,CAAkE,GAAlE,CAAP;AACD;;AAEK,SAAU,cAAV,CAAyB,OAAzB,EAA+C;AACnD;AACA,SAAO,EACL,GAAG,OAAO,CAAC,GADN;AAEL,IAAA,iBAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,GAAR,CAAY,iBAAb,EAAgC,OAAhC;AAFxB,GAAP;AAID,C","sourcesContent":["export interface ToolInfo {\n path: string\n env?: any\n}\n\nexport function computeEnv(oldValue: string | null | undefined, newValues: Array<string>): string {\n const parsedOldValue = oldValue ? oldValue.split(\":\") : []\n return newValues.concat(parsedOldValue).filter(it => it.length > 0).join(\":\")\n}\n\nexport function computeToolEnv(libPath: Array<string>): any {\n // noinspection SpellCheckingInspection\n return {\n ...process.env,\n DYLD_LIBRARY_PATH: computeEnv(process.env.DYLD_LIBRARY_PATH, libPath)\n }\n}"],"sourceRoot":""}
|
18
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.d.ts
generated
vendored
Normal file
18
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.d.ts
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
import { Arch } from "builder-util";
|
||||
import { Hash } from "crypto";
|
||||
export interface BuildCacheInfo {
|
||||
executableDigest: string;
|
||||
}
|
||||
export declare class BuildCacheManager {
|
||||
private readonly executableFile;
|
||||
static VERSION: string;
|
||||
readonly cacheDir: string;
|
||||
readonly cacheInfoFile: string;
|
||||
readonly cacheFile: string;
|
||||
cacheInfo: BuildCacheInfo | null;
|
||||
private newDigest;
|
||||
constructor(outDir: string, executableFile: string, arch: Arch);
|
||||
copyIfValid(digest: string): Promise<boolean>;
|
||||
save(): Promise<void>;
|
||||
}
|
||||
export declare function digest(hash: Hash, files: Array<string>): Promise<string>;
|
152
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
Normal file
152
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.digest = digest;
|
||||
exports.BuildCacheManager = void 0;
|
||||
|
||||
function _bluebirdLst() {
|
||||
const data = _interopRequireDefault(require("bluebird-lst"));
|
||||
|
||||
_bluebirdLst = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = require("builder-util/out/fs");
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _promise() {
|
||||
const data = require("builder-util/out/promise");
|
||||
|
||||
_promise = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
class BuildCacheManager {
|
||||
constructor(outDir, executableFile, arch) {
|
||||
this.executableFile = executableFile;
|
||||
this.cacheInfo = null;
|
||||
this.newDigest = null;
|
||||
this.cacheDir = path.join(outDir, ".cache", _builderUtil().Arch[arch]);
|
||||
this.cacheFile = path.join(this.cacheDir, "app.exe");
|
||||
this.cacheInfoFile = path.join(this.cacheDir, "info.json");
|
||||
}
|
||||
|
||||
async copyIfValid(digest) {
|
||||
this.newDigest = digest;
|
||||
this.cacheInfo = await (0, _promise().orNullIfFileNotExist)((0, _fsExtra().readJson)(this.cacheInfoFile));
|
||||
const oldDigest = this.cacheInfo == null ? null : this.cacheInfo.executableDigest;
|
||||
|
||||
if (oldDigest !== digest) {
|
||||
_builderUtil().log.debug({
|
||||
oldDigest,
|
||||
newDigest: digest
|
||||
}, "no valid cached executable found");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
_builderUtil().log.debug({
|
||||
cacheFile: this.cacheFile,
|
||||
file: this.executableFile
|
||||
}, `copying cached executable`);
|
||||
|
||||
try {
|
||||
await (0, _fs().copyFile)(this.cacheFile, this.executableFile, false);
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
||||
_builderUtil().log.debug({
|
||||
error: e.code
|
||||
}, "copy cached executable failed");
|
||||
} else {
|
||||
_builderUtil().log.warn({
|
||||
error: e.stack || e
|
||||
}, `cannot copy cached executable`);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
async save() {
|
||||
if (this.newDigest == null) {
|
||||
throw new Error("call copyIfValid before");
|
||||
}
|
||||
|
||||
if (this.cacheInfo == null) {
|
||||
this.cacheInfo = {
|
||||
executableDigest: this.newDigest
|
||||
};
|
||||
} else {
|
||||
this.cacheInfo.executableDigest = this.newDigest;
|
||||
}
|
||||
|
||||
try {
|
||||
await (0, _fsExtra().ensureDir)(this.cacheDir);
|
||||
await Promise.all([(0, _fsExtra().writeJson)(this.cacheInfoFile, this.cacheInfo), (0, _fs().copyFile)(this.executableFile, this.cacheFile, false)]);
|
||||
} catch (e) {
|
||||
_builderUtil().log.warn({
|
||||
error: e.stack || e
|
||||
}, `cannot save build cache`);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.BuildCacheManager = BuildCacheManager;
|
||||
BuildCacheManager.VERSION = "0";
|
||||
|
||||
async function digest(hash, files) {
|
||||
// do not use pipe - better do bulk file read (https://github.com/yarnpkg/yarn/commit/7a63e0d23c46a4564bc06645caf8a59690f04d01)
|
||||
for (const content of await _bluebirdLst().default.map(files, it => (0, _fsExtra().readFile)(it))) {
|
||||
hash.update(content);
|
||||
}
|
||||
|
||||
hash.update(BuildCacheManager.VERSION);
|
||||
return hash.digest("base64");
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=cacheManager.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/cacheManager.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
9
buildfiles/node_modules/app-builder-lib/out/util/config.d.ts
generated
vendored
Normal file
9
buildfiles/node_modules/app-builder-lib/out/util/config.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { DebugLogger } from "builder-util";
|
||||
import { Lazy } from "lazy-val";
|
||||
import { Configuration } from "../configuration";
|
||||
export declare function getConfig(projectDir: string, configPath: string | null, configFromOptions: Configuration | null | undefined, packageMetadata?: Lazy<{
|
||||
[key: string]: any;
|
||||
} | null>): Promise<Configuration>;
|
||||
export declare function doMergeConfigs(configuration: Configuration, parentConfiguration: Configuration | null): Configuration;
|
||||
export declare function validateConfig(config: Configuration, debugLogger: DebugLogger): Promise<void>;
|
||||
export declare function computeDefaultAppDirectory(projectDir: string, userAppDir: string | null | undefined): Promise<string>;
|
373
buildfiles/node_modules/app-builder-lib/out/util/config.js
generated
vendored
Normal file
373
buildfiles/node_modules/app-builder-lib/out/util/config.js
generated
vendored
Normal file
@ -0,0 +1,373 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getConfig = getConfig;
|
||||
exports.doMergeConfigs = doMergeConfigs;
|
||||
exports.validateConfig = validateConfig;
|
||||
exports.computeDefaultAppDirectory = computeDefaultAppDirectory;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = require("builder-util/out/fs");
|
||||
|
||||
_fs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lazyVal() {
|
||||
const data = require("lazy-val");
|
||||
|
||||
_lazyVal = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _readConfigFile() {
|
||||
const data = require("read-config-file");
|
||||
|
||||
_readConfigFile = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _rectCra() {
|
||||
const data = require("../presets/rectCra");
|
||||
|
||||
_rectCra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
const validateSchema = require("@develar/schema-utils"); // https://github.com/electron-userland/electron-builder/issues/1847
|
||||
|
||||
|
||||
function mergePublish(config, configFromOptions) {
|
||||
// if config from disk doesn't have publish (or object), no need to handle, it will be simply merged by deepAssign
|
||||
const publish = Array.isArray(config.publish) ? configFromOptions.publish : null;
|
||||
|
||||
if (publish != null) {
|
||||
delete configFromOptions.publish;
|
||||
}
|
||||
|
||||
(0, _builderUtil().deepAssign)(config, configFromOptions);
|
||||
|
||||
if (publish == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const listOnDisk = config.publish;
|
||||
|
||||
if (listOnDisk.length === 0) {
|
||||
config.publish = publish;
|
||||
} else {
|
||||
// apply to first
|
||||
Object.assign(listOnDisk[0], publish);
|
||||
}
|
||||
}
|
||||
|
||||
async function getConfig(projectDir, configPath, configFromOptions, packageMetadata = new (_lazyVal().Lazy)(() => (0, _readConfigFile().orNullIfFileNotExist)((0, _fsExtra().readJson)(path.join(projectDir, "package.json"))))) {
|
||||
const configRequest = {
|
||||
packageKey: "build",
|
||||
configFilename: "electron-builder",
|
||||
projectDir,
|
||||
packageMetadata
|
||||
};
|
||||
const configAndEffectiveFile = await (0, _readConfigFile().getConfig)(configRequest, configPath);
|
||||
const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result;
|
||||
|
||||
if (configFromOptions != null) {
|
||||
mergePublish(config, configFromOptions);
|
||||
}
|
||||
|
||||
if (configAndEffectiveFile != null) {
|
||||
_builderUtil().log.info({
|
||||
file: configAndEffectiveFile.configFile == null ? 'package.json ("build" field)' : configAndEffectiveFile.configFile
|
||||
}, "loaded configuration");
|
||||
}
|
||||
|
||||
if (config.extends == null && config.extends !== null) {
|
||||
const metadata = (await packageMetadata.value) || {};
|
||||
const devDependencies = metadata.devDependencies;
|
||||
const dependencies = metadata.dependencies;
|
||||
|
||||
if (dependencies != null && "react-scripts" in dependencies || devDependencies != null && "react-scripts" in devDependencies) {
|
||||
config.extends = "react-cra";
|
||||
} else if (devDependencies != null && "electron-webpack" in devDependencies) {
|
||||
let file = "electron-webpack/out/electron-builder.js";
|
||||
|
||||
try {
|
||||
file = require.resolve(file);
|
||||
} catch (ignore) {
|
||||
file = require.resolve("electron-webpack/electron-builder.yml");
|
||||
}
|
||||
|
||||
config.extends = `file:${file}`;
|
||||
}
|
||||
}
|
||||
|
||||
let parentConfig;
|
||||
|
||||
if (config.extends === "react-cra") {
|
||||
parentConfig = await (0, _rectCra().reactCra)(projectDir);
|
||||
|
||||
_builderUtil().log.info({
|
||||
preset: config.extends
|
||||
}, "loaded parent configuration");
|
||||
} else if (config.extends != null) {
|
||||
const parentConfigAndEffectiveFile = await (0, _readConfigFile().loadParentConfig)(configRequest, config.extends);
|
||||
|
||||
_builderUtil().log.info({
|
||||
file: parentConfigAndEffectiveFile.configFile
|
||||
}, "loaded parent configuration");
|
||||
|
||||
parentConfig = parentConfigAndEffectiveFile.result;
|
||||
} else {
|
||||
parentConfig = null;
|
||||
}
|
||||
|
||||
return doMergeConfigs(config, parentConfig);
|
||||
} // normalize for easy merge
|
||||
|
||||
|
||||
function normalizeFiles(configuration, name) {
|
||||
let value = configuration[name];
|
||||
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Array.isArray(value)) {
|
||||
value = [value];
|
||||
}
|
||||
|
||||
itemLoop: for (let i = 0; i < value.length; i++) {
|
||||
let item = value[i];
|
||||
|
||||
if (typeof item === "string") {
|
||||
// merge with previous if possible
|
||||
if (i !== 0) {
|
||||
let prevItemIndex = i - 1;
|
||||
let prevItem;
|
||||
|
||||
do {
|
||||
prevItem = value[prevItemIndex--];
|
||||
} while (prevItem == null);
|
||||
|
||||
if (prevItem.from == null && prevItem.to == null) {
|
||||
if (prevItem.filter == null) {
|
||||
prevItem.filter = [item];
|
||||
} else {
|
||||
prevItem.filter.push(item);
|
||||
}
|
||||
|
||||
value[i] = null;
|
||||
continue itemLoop;
|
||||
}
|
||||
}
|
||||
|
||||
item = {
|
||||
filter: [item]
|
||||
};
|
||||
value[i] = item;
|
||||
} else if (Array.isArray(item)) {
|
||||
throw new Error(`${name} configuration is invalid, nested array not expected for index ${i}: ` + item);
|
||||
} // make sure that merge logic is not complex - unify different presentations
|
||||
|
||||
|
||||
if (item.from === ".") {
|
||||
item.from = undefined;
|
||||
}
|
||||
|
||||
if (item.to === ".") {
|
||||
item.to = undefined;
|
||||
}
|
||||
|
||||
if (item.filter != null && typeof item.filter === "string") {
|
||||
item.filter = [item.filter];
|
||||
}
|
||||
}
|
||||
|
||||
configuration[name] = value.filter(it => it != null);
|
||||
}
|
||||
|
||||
function mergeFiles(configuration, parentConfiguration, mergedConfiguration, name) {
|
||||
const list = configuration[name];
|
||||
const parentList = parentConfiguration[name];
|
||||
|
||||
if (list == null || parentList == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = list.slice();
|
||||
mergedConfiguration[name] = result;
|
||||
|
||||
itemLoop: for (const item of parentConfiguration.files) {
|
||||
for (const existingItem of list) {
|
||||
if (existingItem.from === item.from && existingItem.to === item.to) {
|
||||
if (item.filter != null) {
|
||||
if (existingItem.filter == null) {
|
||||
existingItem.filter = item.filter.slice();
|
||||
} else {
|
||||
existingItem.filter = item.filter.concat(existingItem.filter);
|
||||
}
|
||||
}
|
||||
|
||||
continue itemLoop;
|
||||
}
|
||||
} // existing item not found, simply add
|
||||
|
||||
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
function doMergeConfigs(configuration, parentConfiguration) {
|
||||
normalizeFiles(configuration, "files");
|
||||
normalizeFiles(configuration, "extraFiles");
|
||||
normalizeFiles(configuration, "extraResources");
|
||||
|
||||
if (parentConfiguration == null) {
|
||||
return (0, _builderUtil().deepAssign)(getDefaultConfig(), configuration);
|
||||
}
|
||||
|
||||
normalizeFiles(parentConfiguration, "files");
|
||||
normalizeFiles(parentConfiguration, "extraFiles");
|
||||
normalizeFiles(parentConfiguration, "extraResources");
|
||||
const result = (0, _builderUtil().deepAssign)(getDefaultConfig(), parentConfiguration, configuration);
|
||||
mergeFiles(configuration, parentConfiguration, result, "files");
|
||||
return result;
|
||||
}
|
||||
|
||||
function getDefaultConfig() {
|
||||
return {
|
||||
directories: {
|
||||
output: "dist",
|
||||
buildResources: "build"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
const schemeDataPromise = new (_lazyVal().Lazy)(() => (0, _fsExtra().readJson)(path.join(__dirname, "..", "..", "scheme.json")));
|
||||
|
||||
async function validateConfig(config, debugLogger) {
|
||||
const extraMetadata = config.extraMetadata;
|
||||
|
||||
if (extraMetadata != null) {
|
||||
if (extraMetadata.build != null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`--em.build is deprecated, please specify as -c"`);
|
||||
}
|
||||
|
||||
if (extraMetadata.directories != null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`--em.directories is deprecated, please specify as -c.directories"`);
|
||||
}
|
||||
}
|
||||
|
||||
const oldConfig = config;
|
||||
|
||||
if (oldConfig.npmSkipBuildFromSource === false) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`npmSkipBuildFromSource is deprecated, please use buildDependenciesFromSource"`);
|
||||
}
|
||||
|
||||
if (oldConfig.appImage != null && oldConfig.appImage.systemIntegration != null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`appImage.systemIntegration is deprecated, https://github.com/TheAssassin/AppImageLauncher is used for desktop integration"`);
|
||||
} // noinspection JSUnusedGlobalSymbols
|
||||
|
||||
|
||||
validateSchema(await schemeDataPromise.value, config, {
|
||||
name: `electron-builder ${"22.9.1"}`,
|
||||
postFormatter: (formattedError, error) => {
|
||||
if (debugLogger.isEnabled) {
|
||||
debugLogger.add("invalidConfig", (0, _builderUtil().safeStringifyJson)(error));
|
||||
}
|
||||
|
||||
const site = "https://www.electron.build";
|
||||
let url = `${site}/configuration/configuration`;
|
||||
const targets = new Set(["mac", "dmg", "pkg", "mas", "win", "nsis", "appx", "linux", "appimage", "snap"]);
|
||||
const dataPath = error.dataPath == null ? null : error.dataPath;
|
||||
const targetPath = dataPath.startsWith(".") ? dataPath.substr(1).toLowerCase() : null;
|
||||
|
||||
if (targetPath != null && targets.has(targetPath)) {
|
||||
url = `${site}/configuration/${targetPath}`;
|
||||
}
|
||||
|
||||
return `${formattedError}\n How to fix:
|
||||
1. Open ${url}
|
||||
2. Search the option name on the page (or type in into Search to find across the docs).
|
||||
* Not found? The option was deprecated or not exists (check spelling).
|
||||
* Found? Check that the option in the appropriate place. e.g. "title" only in the "dmg", not in the root.
|
||||
`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const DEFAULT_APP_DIR_NAMES = ["app", "www"];
|
||||
|
||||
async function computeDefaultAppDirectory(projectDir, userAppDir) {
|
||||
if (userAppDir != null) {
|
||||
const absolutePath = path.resolve(projectDir, userAppDir);
|
||||
const stat = await (0, _fs().statOrNull)(absolutePath);
|
||||
|
||||
if (stat == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`Application directory ${userAppDir} doesn't exist`);
|
||||
} else if (!stat.isDirectory()) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`Application directory ${userAppDir} is not a directory`);
|
||||
} else if (projectDir === absolutePath) {
|
||||
_builderUtil().log.warn({
|
||||
appDirectory: userAppDir
|
||||
}, `Specified application directory equals to project dir — superfluous or wrong configuration`);
|
||||
}
|
||||
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
for (const dir of DEFAULT_APP_DIR_NAMES) {
|
||||
const absolutePath = path.join(projectDir, dir);
|
||||
const packageJson = path.join(absolutePath, "package.json");
|
||||
const stat = await (0, _fs().statOrNull)(packageJson);
|
||||
|
||||
if (stat != null && stat.isFile()) {
|
||||
return absolutePath;
|
||||
}
|
||||
}
|
||||
|
||||
return projectDir;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=config.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/config.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/config.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
buildfiles/node_modules/app-builder-lib/out/util/filter.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/filter.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
108
buildfiles/node_modules/app-builder-lib/out/util/filter.js
generated
vendored
Normal file
108
buildfiles/node_modules/app-builder-lib/out/util/filter.js
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hasMagic = hasMagic;
|
||||
exports.createFilter = createFilter;
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _fileTransformer() {
|
||||
const data = require("../fileTransformer");
|
||||
|
||||
_fileTransformer = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/** @internal */
|
||||
function hasMagic(pattern) {
|
||||
const set = pattern.set;
|
||||
|
||||
if (set.length > 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (const i of set[0]) {
|
||||
if (typeof i !== "string") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} // sometimes, destination may not contain path separator in the end (path to folder), but the src does. So let's ensure paths have path separators in the end
|
||||
|
||||
|
||||
function ensureEndSlash(s) {
|
||||
return s.length === 0 || s.endsWith(path.sep) ? s : s + path.sep;
|
||||
}
|
||||
|
||||
function getRelativePath(file, srcWithEndSlash) {
|
||||
if (!file.startsWith(srcWithEndSlash)) {
|
||||
const index = file.indexOf(_fileTransformer().NODE_MODULES_PATTERN);
|
||||
|
||||
if (index < 0) {
|
||||
throw new Error(`${file} must be under ${srcWithEndSlash}`);
|
||||
} else {
|
||||
return file.substring(index + 1
|
||||
/* leading slash */
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let relative = file.substring(srcWithEndSlash.length);
|
||||
|
||||
if (path.sep === "\\") {
|
||||
if (relative.startsWith("\\")) {
|
||||
// windows problem: double backslash, the above substring call removes root path with a single slash, so here can me some leftovers
|
||||
relative = relative.substring(1);
|
||||
}
|
||||
|
||||
relative = relative.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
return relative;
|
||||
}
|
||||
/** @internal */
|
||||
|
||||
|
||||
function createFilter(src, patterns, excludePatterns) {
|
||||
const srcWithEndSlash = ensureEndSlash(src);
|
||||
return (file, stat) => {
|
||||
if (src === file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const relative = getRelativePath(file, srcWithEndSlash); // https://github.com/electron-userland/electron-builder/issues/867
|
||||
|
||||
return minimatchAll(relative, patterns, stat) && (excludePatterns == null || stat.isDirectory() || !minimatchAll(relative, excludePatterns, stat));
|
||||
};
|
||||
} // https://github.com/joshwnj/minimatch-all/blob/master/index.js
|
||||
|
||||
|
||||
function minimatchAll(path, patterns, stat) {
|
||||
let match = false;
|
||||
|
||||
for (const pattern of patterns) {
|
||||
// If we've got a match, only re-test for exclusions.
|
||||
// if we don't have a match, only re-test for inclusions.
|
||||
if (match !== pattern.negate) {
|
||||
continue;
|
||||
} // partial match — pattern: foo/bar.txt path: foo — we must allow foo
|
||||
// use it only for non-negate patterns: const m = new Minimatch("!node_modules/@(electron-download|electron)/**/*", {dot: true }); m.match("node_modules", true) will return false, but must be true
|
||||
|
||||
|
||||
match = pattern.match(path, stat.isDirectory() && !pattern.negate);
|
||||
}
|
||||
|
||||
return match;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=filter.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/filter.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/filter.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/filter.ts"],"names":[],"mappings":";;;;;;;;AAGA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA;AACM,SAAU,QAAV,CAAmB,OAAnB,EAAqC;AACzC,QAAM,GAAG,GAAG,OAAO,CAAC,GAApB;;AACA,MAAI,GAAG,CAAC,MAAJ,GAAa,CAAjB,EAAoB;AAClB,WAAO,IAAP;AACD;;AAED,OAAK,MAAM,CAAX,IAAgB,GAAG,CAAC,CAAD,CAAnB,EAAwB;AACtB,QAAI,OAAO,CAAP,KAAa,QAAjB,EAA2B;AACzB,aAAO,IAAP;AACD;AACF;;AAED,SAAO,KAAP;AACD,C,CAED;;;AACA,SAAS,cAAT,CAAwB,CAAxB,EAAiC;AAC/B,SAAO,CAAC,CAAC,MAAF,KAAa,CAAb,IAAkB,CAAC,CAAC,QAAF,CAAW,IAAI,CAAC,GAAhB,CAAlB,GAAyC,CAAzC,GAA8C,CAAC,GAAG,IAAI,CAAC,GAA9D;AACD;;AAED,SAAS,eAAT,CAAyB,IAAzB,EAAuC,eAAvC,EAA8D;AAC5D,MAAI,CAAC,IAAI,CAAC,UAAL,CAAgB,eAAhB,CAAL,EAAuC;AACrC,UAAM,KAAK,GAAG,IAAI,CAAC,OAAL,CAAa,uCAAb,CAAd;;AACA,QAAI,KAAK,GAAG,CAAZ,EAAe;AACb,YAAM,IAAI,KAAJ,CAAU,GAAG,IAAI,kBAAkB,eAAe,EAAlD,CAAN;AACD,KAFD,MAGK;AACH,aAAO,IAAI,CAAC,SAAL,CAAe,KAAK,GAAG;AAAE;AAAzB,OAAP;AACD;AACF;;AAED,MAAI,QAAQ,GAAG,IAAI,CAAC,SAAL,CAAe,eAAe,CAAC,MAA/B,CAAf;;AACA,MAAI,IAAI,CAAC,GAAL,KAAa,IAAjB,EAAuB;AACrB,QAAI,QAAQ,CAAC,UAAT,CAAoB,IAApB,CAAJ,EAA+B;AAC7B;AACA,MAAA,QAAQ,GAAG,QAAQ,CAAC,SAAT,CAAmB,CAAnB,CAAX;AACD;;AACD,IAAA,QAAQ,GAAG,QAAQ,CAAC,OAAT,CAAiB,KAAjB,EAAwB,GAAxB,CAAX;AACD;;AACD,SAAO,QAAP;AACD;AAED;;;AACM,SAAU,YAAV,CAAuB,GAAvB,EAAoC,QAApC,EAAgE,eAAhE,EAAyG;AAC7G,QAAM,eAAe,GAAG,cAAc,CAAC,GAAD,CAAtC;AACA,SAAO,CAAC,IAAD,EAAO,IAAP,KAAe;AACpB,QAAI,GAAG,KAAK,IAAZ,EAAkB;AAChB,aAAO,IAAP;AACD;;AAED,UAAM,QAAQ,GAAG,eAAe,CAAC,IAAD,EAAO,eAAP,CAAhC,CALoB,CAMpB;;AACA,WAAO,YAAY,CAAC,QAAD,EAAW,QAAX,EAAqB,IAArB,CAAZ,KAA2C,eAAe,IAAI,IAAnB,IAA2B,IAAI,CAAC,WAAL,EAA3B,IAAiD,CAAC,YAAY,CAAC,QAAD,EAAW,eAAX,EAA4B,IAA5B,CAAzG,CAAP;AACD,GARD;AASD,C,CAED;;;AACA,SAAS,YAAT,CAAsB,IAAtB,EAAoC,QAApC,EAAgE,IAAhE,EAA2E;AACzE,MAAI,KAAK,GAAG,KAAZ;;AACA,OAAK,MAAM,OAAX,IAAsB,QAAtB,EAAgC;AAC9B;AACA;AACA,QAAI,KAAK,KAAK,OAAO,CAAC,MAAtB,EAA8B;AAC5B;AACD,KAL6B,CAO9B;AACA;;;AACA,IAAA,KAAK,GAAG,OAAO,CAAC,KAAR,CAAc,IAAd,EAAoB,IAAI,CAAC,WAAL,MAAsB,CAAC,OAAO,CAAC,MAAnD,CAAR;AACD;;AACD,SAAO,KAAP;AACD,C","sourcesContent":["import { Filter } from \"builder-util/out/fs\"\nimport { Stats } from \"fs-extra\"\nimport { Minimatch } from \"minimatch\"\nimport * as path from \"path\"\nimport { NODE_MODULES_PATTERN } from \"../fileTransformer\"\n\n/** @internal */\nexport function hasMagic(pattern: Minimatch) {\n const set = pattern.set\n if (set.length > 1) {\n return true\n }\n\n for (const i of set[0]) {\n if (typeof i !== \"string\") {\n return true\n }\n }\n\n return false\n}\n\n// sometimes, destination may not contain path separator in the end (path to folder), but the src does. So let's ensure paths have path separators in the end\nfunction ensureEndSlash(s: string) {\n return s.length === 0 || s.endsWith(path.sep) ? s : (s + path.sep)\n}\n\nfunction getRelativePath(file: string, srcWithEndSlash: string) {\n if (!file.startsWith(srcWithEndSlash)) {\n const index = file.indexOf(NODE_MODULES_PATTERN)\n if (index < 0) {\n throw new Error(`${file} must be under ${srcWithEndSlash}`)\n }\n else {\n return file.substring(index + 1 /* leading slash */)\n }\n }\n\n let relative = file.substring(srcWithEndSlash.length)\n if (path.sep === \"\\\\\") {\n if (relative.startsWith(\"\\\\\")) {\n // windows problem: double backslash, the above substring call removes root path with a single slash, so here can me some leftovers\n relative = relative.substring(1)\n }\n relative = relative.replace(/\\\\/g, \"/\")\n }\n return relative\n}\n\n/** @internal */\nexport function createFilter(src: string, patterns: Array<Minimatch>, excludePatterns?: Array<Minimatch> | null): Filter {\n const srcWithEndSlash = ensureEndSlash(src)\n return (file, stat) => {\n if (src === file) {\n return true\n }\n\n const relative = getRelativePath(file, srcWithEndSlash)\n // https://github.com/electron-userland/electron-builder/issues/867\n return minimatchAll(relative, patterns, stat) && (excludePatterns == null || stat.isDirectory() || !minimatchAll(relative, excludePatterns, stat))\n }\n}\n\n// https://github.com/joshwnj/minimatch-all/blob/master/index.js\nfunction minimatchAll(path: string, patterns: Array<Minimatch>, stat: Stats): boolean {\n let match = false\n for (const pattern of patterns) {\n // If we've got a match, only re-test for exclusions.\n // if we don't have a match, only re-test for inclusions.\n if (match !== pattern.negate) {\n continue\n }\n\n // partial match — pattern: foo/bar.txt path: foo — we must allow foo\n // use it only for non-negate patterns: const m = new Minimatch(\"!node_modules/@(electron-download|electron)/**/*\", {dot: true }); m.match(\"node_modules\", true) will return false, but must be true\n match = pattern.match(path, stat.isDirectory() && !pattern.negate)\n }\n return match\n}\n"],"sourceRoot":""}
|
3
buildfiles/node_modules/app-builder-lib/out/util/flags.d.ts
generated
vendored
Normal file
3
buildfiles/node_modules/app-builder-lib/out/util/flags.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare function isUseSystemSigncode(): boolean;
|
||||
export declare function isBuildCacheEnabled(): boolean;
|
||||
export declare function isAutoDiscoveryCodeSignIdentity(): boolean;
|
32
buildfiles/node_modules/app-builder-lib/out/util/flags.js
generated
vendored
Normal file
32
buildfiles/node_modules/app-builder-lib/out/util/flags.js
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isUseSystemSigncode = isUseSystemSigncode;
|
||||
exports.isBuildCacheEnabled = isBuildCacheEnabled;
|
||||
exports.isAutoDiscoveryCodeSignIdentity = isAutoDiscoveryCodeSignIdentity;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function isUseSystemSigncode() {
|
||||
return (0, _builderUtil().isEnvTrue)(process.env.USE_SYSTEM_SIGNCODE);
|
||||
}
|
||||
|
||||
function isBuildCacheEnabled() {
|
||||
return !(0, _builderUtil().isEnvTrue)(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE);
|
||||
}
|
||||
|
||||
function isAutoDiscoveryCodeSignIdentity() {
|
||||
return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== "false";
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=flags.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/flags.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/flags.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/flags.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,SAAU,mBAAV,GAA6B;AACjC,SAAO,8BAAU,OAAO,CAAC,GAAR,CAAY,mBAAtB,CAAP;AACD;;AAEK,SAAU,mBAAV,GAA6B;AACjC,SAAO,CAAC,8BAAU,OAAO,CAAC,GAAR,CAAY,oCAAtB,CAAR;AACD;;AAEK,SAAU,+BAAV,GAAyC;AAC7C,SAAO,OAAO,CAAC,GAAR,CAAY,2BAAZ,KAA4C,OAAnD;AACD,C","sourcesContent":["import { isEnvTrue } from \"builder-util\"\n\nexport function isUseSystemSigncode() {\n return isEnvTrue(process.env.USE_SYSTEM_SIGNCODE)\n}\n\nexport function isBuildCacheEnabled() {\n return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)\n}\n\nexport function isAutoDiscoveryCodeSignIdentity() {\n return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== \"false\"\n}"],"sourceRoot":""}
|
1
buildfiles/node_modules/app-builder-lib/out/util/hash.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/hash.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export declare function hashFile(file: string, algorithm?: string, encoding?: "base64" | "hex", options?: any): Promise<string>;
|
37
buildfiles/node_modules/app-builder-lib/out/util/hash.js
generated
vendored
Normal file
37
buildfiles/node_modules/app-builder-lib/out/util/hash.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.hashFile = hashFile;
|
||||
|
||||
function _crypto() {
|
||||
const data = require("crypto");
|
||||
|
||||
_crypto = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _fs = require("fs");
|
||||
|
||||
function hashFile(file, algorithm = "sha512", encoding = "base64", options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const hash = (0, _crypto().createHash)(algorithm);
|
||||
hash.on("error", reject).setEncoding(encoding);
|
||||
(0, _fs.createReadStream)(file, { ...options,
|
||||
highWaterMark: 1024 * 1024
|
||||
/* better to use more memory but hash faster */
|
||||
|
||||
}).on("error", reject).on("end", () => {
|
||||
hash.end();
|
||||
resolve(hash.read());
|
||||
}).pipe(hash, {
|
||||
end: false
|
||||
});
|
||||
});
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=hash.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/hash.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/hash.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/hash.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;;AAEM,SAAU,QAAV,CAAmB,IAAnB,EAAiC,SAAA,GAAoB,QAArD,EAA+D,QAAA,GAA6B,QAA5F,EAAsG,OAAtG,EAAmH;AACvH,SAAO,IAAI,OAAJ,CAAoB,CAAC,OAAD,EAAU,MAAV,KAAoB;AAC7C,UAAM,IAAI,GAAG,0BAAW,SAAX,CAAb;AACA,IAAA,IAAI,CACD,EADH,CACM,OADN,EACe,MADf,EAEG,WAFH,CAEe,QAFf;AAIA,8BAAiB,IAAjB,EAAuB,EAAC,GAAG,OAAJ;AAAa,MAAA,aAAa,EAAE,OAAO;AAAK;;AAAxC,KAAvB,EACG,EADH,CACM,OADN,EACe,MADf,EAEG,EAFH,CAEM,KAFN,EAEa,MAAK;AACd,MAAA,IAAI,CAAC,GAAL;AACA,MAAA,OAAO,CAAC,IAAI,CAAC,IAAL,EAAD,CAAP;AACD,KALH,EAMG,IANH,CAMQ,IANR,EAMc;AAAC,MAAA,GAAG,EAAE;AAAN,KANd;AAOD,GAbM,CAAP;AAcD,C","sourcesContent":["import { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\n\nexport function hashFile(file: string, algorithm: string = \"sha512\", encoding: \"base64\" | \"hex\" = \"base64\", options?: any) {\n return new Promise<string>((resolve, reject) => {\n const hash = createHash(algorithm)\n hash\n .on(\"error\", reject)\n .setEncoding(encoding)\n\n createReadStream(file, {...options, highWaterMark: 1024 * 1024 /* better to use more memory but hash faster */})\n .on(\"error\", reject)\n .on(\"end\", () => {\n hash.end()\n resolve(hash.read() as string)\n })\n .pipe(hash, {end: false})\n })\n}"],"sourceRoot":""}
|
189
buildfiles/node_modules/app-builder-lib/out/util/langs.d.ts
generated
vendored
Normal file
189
buildfiles/node_modules/app-builder-lib/out/util/langs.d.ts
generated
vendored
Normal file
@ -0,0 +1,189 @@
|
||||
export declare const bundledLanguages: string[];
|
||||
export declare function toLangWithRegion(lang: string): string;
|
||||
export declare const lcid: any;
|
||||
export declare const langIdToName: {
|
||||
ab: string;
|
||||
aa: string;
|
||||
af: string;
|
||||
ak: string;
|
||||
sq: string;
|
||||
am: string;
|
||||
ar: string;
|
||||
an: string;
|
||||
hy: string;
|
||||
as: string;
|
||||
av: string;
|
||||
ae: string;
|
||||
ay: string;
|
||||
az: string;
|
||||
bm: string;
|
||||
ba: string;
|
||||
eu: string;
|
||||
be: string;
|
||||
bn: string;
|
||||
bh: string;
|
||||
bi: string;
|
||||
bs: string;
|
||||
br: string;
|
||||
bg: string;
|
||||
my: string;
|
||||
ca: string;
|
||||
ch: string;
|
||||
ce: string;
|
||||
ny: string;
|
||||
zh: string;
|
||||
cv: string;
|
||||
kw: string;
|
||||
co: string;
|
||||
cr: string;
|
||||
hr: string;
|
||||
cs: string;
|
||||
da: string;
|
||||
dv: string;
|
||||
nl: string;
|
||||
dz: string;
|
||||
en: string;
|
||||
eo: string;
|
||||
et: string;
|
||||
ee: string;
|
||||
fo: string;
|
||||
fj: string;
|
||||
fi: string;
|
||||
fr: string;
|
||||
ff: string;
|
||||
gl: string;
|
||||
ka: string;
|
||||
de: string;
|
||||
el: string;
|
||||
gn: string;
|
||||
gu: string;
|
||||
ht: string;
|
||||
ha: string;
|
||||
he: string;
|
||||
hz: string;
|
||||
hi: string;
|
||||
ho: string;
|
||||
hu: string;
|
||||
ia: string;
|
||||
id: string;
|
||||
ie: string;
|
||||
ga: string;
|
||||
ig: string;
|
||||
ik: string;
|
||||
io: string;
|
||||
is: string;
|
||||
it: string;
|
||||
iu: string;
|
||||
ja: string;
|
||||
jv: string;
|
||||
kl: string;
|
||||
kn: string;
|
||||
kr: string;
|
||||
ks: string;
|
||||
kk: string;
|
||||
km: string;
|
||||
ki: string;
|
||||
rw: string;
|
||||
ky: string;
|
||||
kv: string;
|
||||
kg: string;
|
||||
ko: string;
|
||||
ku: string;
|
||||
kj: string;
|
||||
la: string;
|
||||
lb: string;
|
||||
lg: string;
|
||||
li: string;
|
||||
ln: string;
|
||||
lo: string;
|
||||
lt: string;
|
||||
lu: string;
|
||||
lv: string;
|
||||
gv: string;
|
||||
mk: string;
|
||||
mg: string;
|
||||
ms: string;
|
||||
ml: string;
|
||||
mt: string;
|
||||
mi: string;
|
||||
mr: string;
|
||||
mh: string;
|
||||
mn: string;
|
||||
na: string;
|
||||
nv: string;
|
||||
nd: string;
|
||||
ne: string;
|
||||
ng: string;
|
||||
nb: string;
|
||||
nn: string;
|
||||
no: string;
|
||||
ii: string;
|
||||
nr: string;
|
||||
oc: string;
|
||||
oj: string;
|
||||
cu: string;
|
||||
om: string;
|
||||
or: string;
|
||||
os: string;
|
||||
pa: string;
|
||||
pi: string;
|
||||
fa: string;
|
||||
pl: string;
|
||||
ps: string;
|
||||
pt: string;
|
||||
qu: string;
|
||||
rm: string;
|
||||
rn: string;
|
||||
ro: string;
|
||||
ru: string;
|
||||
sa: string;
|
||||
sc: string;
|
||||
sd: string;
|
||||
se: string;
|
||||
sm: string;
|
||||
sg: string;
|
||||
sr: string;
|
||||
gd: string;
|
||||
sn: string;
|
||||
si: string;
|
||||
sk: string;
|
||||
sl: string;
|
||||
so: string;
|
||||
st: string;
|
||||
es: string;
|
||||
su: string;
|
||||
sw: string;
|
||||
ss: string;
|
||||
sv: string;
|
||||
ta: string;
|
||||
te: string;
|
||||
tg: string;
|
||||
th: string;
|
||||
ti: string;
|
||||
bo: string;
|
||||
tk: string;
|
||||
tl: string;
|
||||
tn: string;
|
||||
to: string;
|
||||
tr: string;
|
||||
ts: string;
|
||||
tt: string;
|
||||
tw: string;
|
||||
ty: string;
|
||||
ug: string;
|
||||
uk: string;
|
||||
ur: string;
|
||||
uz: string;
|
||||
ve: string;
|
||||
vi: string;
|
||||
vo: string;
|
||||
wa: string;
|
||||
cy: string;
|
||||
wo: string;
|
||||
fy: string;
|
||||
xh: string;
|
||||
yi: string;
|
||||
yo: string;
|
||||
za: string;
|
||||
zu: string;
|
||||
};
|
419
buildfiles/node_modules/app-builder-lib/out/util/langs.js
generated
vendored
Normal file
419
buildfiles/node_modules/app-builder-lib/out/util/langs.js
generated
vendored
Normal file
@ -0,0 +1,419 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toLangWithRegion = toLangWithRegion;
|
||||
exports.langIdToName = exports.lcid = exports.bundledLanguages = void 0;
|
||||
const bundledLanguages = ["en_US", "de_DE", "fr_FR", "es_ES", "zh_CN", "zh_TW", "ja_JP", "ko_KR", "it_IT", "nl_NL", "da_DK", "sv_SE", "nb_NO", "fi_FI", "ru_RU", "pt_PT", "pt_BR", "pl_PL", "uk_UA", "cs_CZ", "sk_SK", "hu_HU", "ar_SA", "tr_TR", "th_TH", "vi_VN"]; // todo "ro_RO" "el_GR" "et_EE" "ka_GE"
|
||||
|
||||
exports.bundledLanguages = bundledLanguages;
|
||||
const langToLangWithRegion = new Map();
|
||||
|
||||
for (const id of bundledLanguages) {
|
||||
langToLangWithRegion.set(id.substring(0, id.indexOf("_")), id);
|
||||
}
|
||||
|
||||
function toLangWithRegion(lang) {
|
||||
if (lang.includes("_")) {
|
||||
return lang;
|
||||
}
|
||||
|
||||
lang = lang.toLowerCase();
|
||||
const result = langToLangWithRegion.get(lang);
|
||||
return result == null ? `${lang}_${lang.toUpperCase()}` : result;
|
||||
}
|
||||
|
||||
const lcid = {
|
||||
af_ZA: 1078,
|
||||
am_ET: 1118,
|
||||
ar_AE: 14337,
|
||||
ar_BH: 15361,
|
||||
ar_DZ: 5121,
|
||||
ar_EG: 3073,
|
||||
ar_IQ: 2049,
|
||||
ar_JO: 11265,
|
||||
ar_KW: 13313,
|
||||
ar_LB: 12289,
|
||||
ar_LY: 4097,
|
||||
ar_MA: 6145,
|
||||
ar_OM: 8193,
|
||||
ar_QA: 16385,
|
||||
ar_SA: 1025,
|
||||
ar_SY: 10241,
|
||||
ar_TN: 7169,
|
||||
ar_YE: 9217,
|
||||
arn_CL: 1146,
|
||||
as_IN: 1101,
|
||||
az_AZ: 2092,
|
||||
ba_RU: 1133,
|
||||
be_BY: 1059,
|
||||
bg_BG: 1026,
|
||||
bn_IN: 1093,
|
||||
bo_BT: 2129,
|
||||
bo_CN: 1105,
|
||||
br_FR: 1150,
|
||||
bs_BA: 8218,
|
||||
ca_ES: 1027,
|
||||
co_FR: 1155,
|
||||
cs_CZ: 1029,
|
||||
cy_GB: 1106,
|
||||
da_DK: 1030,
|
||||
de_AT: 3079,
|
||||
de_CH: 2055,
|
||||
de_DE: 1031,
|
||||
de_LI: 5127,
|
||||
de_LU: 4103,
|
||||
div_MV: 1125,
|
||||
dsb_DE: 2094,
|
||||
el_GR: 1032,
|
||||
en_AU: 3081,
|
||||
en_BZ: 10249,
|
||||
en_CA: 4105,
|
||||
en_CB: 9225,
|
||||
en_GB: 2057,
|
||||
en_IE: 6153,
|
||||
en_IN: 18441,
|
||||
en_JA: 8201,
|
||||
en_MY: 17417,
|
||||
en_NZ: 5129,
|
||||
en_PH: 13321,
|
||||
en_TT: 11273,
|
||||
en_US: 1033,
|
||||
en_ZA: 7177,
|
||||
en_ZW: 12297,
|
||||
es_AR: 11274,
|
||||
es_BO: 16394,
|
||||
es_CL: 13322,
|
||||
es_CO: 9226,
|
||||
es_CR: 5130,
|
||||
es_DO: 7178,
|
||||
es_EC: 12298,
|
||||
es_ES: 3082,
|
||||
es_GT: 4106,
|
||||
es_HN: 18442,
|
||||
es_MX: 2058,
|
||||
es_NI: 19466,
|
||||
es_PA: 6154,
|
||||
es_PE: 10250,
|
||||
es_PR: 20490,
|
||||
es_PY: 15370,
|
||||
es_SV: 17418,
|
||||
es_UR: 14346,
|
||||
es_US: 21514,
|
||||
es_VE: 8202,
|
||||
et_EE: 1061,
|
||||
eu_ES: 1069,
|
||||
fa_IR: 1065,
|
||||
fi_FI: 1035,
|
||||
fil_PH: 1124,
|
||||
fo_FO: 1080,
|
||||
fr_BE: 2060,
|
||||
fr_CA: 3084,
|
||||
fr_CH: 4108,
|
||||
fr_FR: 1036,
|
||||
fr_LU: 5132,
|
||||
fr_MC: 6156,
|
||||
fy_NL: 1122,
|
||||
ga_IE: 2108,
|
||||
gbz_AF: 1164,
|
||||
gl_ES: 1110,
|
||||
gsw_FR: 1156,
|
||||
gu_IN: 1095,
|
||||
ha_NG: 1128,
|
||||
he_IL: 1037,
|
||||
hi_IN: 1081,
|
||||
hr_BA: 4122,
|
||||
hr_HR: 1050,
|
||||
hu_HU: 1038,
|
||||
hy_AM: 1067,
|
||||
id_ID: 1057,
|
||||
ii_CN: 1144,
|
||||
is_IS: 1039,
|
||||
it_CH: 2064,
|
||||
it_IT: 1040,
|
||||
iu_CA: 2141,
|
||||
ja_JP: 1041,
|
||||
ka_GE: 1079,
|
||||
kh_KH: 1107,
|
||||
kk_KZ: 1087,
|
||||
kl_GL: 1135,
|
||||
kn_IN: 1099,
|
||||
ko_KR: 1042,
|
||||
kok_IN: 1111,
|
||||
ky_KG: 1088,
|
||||
lb_LU: 1134,
|
||||
lo_LA: 1108,
|
||||
lt_LT: 1063,
|
||||
lv_LV: 1062,
|
||||
mi_NZ: 1153,
|
||||
mk_MK: 1071,
|
||||
ml_IN: 1100,
|
||||
mn_CN: 2128,
|
||||
mn_MN: 1104,
|
||||
moh_CA: 1148,
|
||||
mr_IN: 1102,
|
||||
ms_BN: 2110,
|
||||
ms_MY: 1086,
|
||||
mt_MT: 1082,
|
||||
my_MM: 1109,
|
||||
nb_NO: 1044,
|
||||
ne_NP: 1121,
|
||||
nl_BE: 2067,
|
||||
nl_NL: 1043,
|
||||
nn_NO: 2068,
|
||||
ns_ZA: 1132,
|
||||
oc_FR: 1154,
|
||||
or_IN: 1096,
|
||||
pa_IN: 1094,
|
||||
pl_PL: 1045,
|
||||
ps_AF: 1123,
|
||||
pt_BR: 1046,
|
||||
pt_PT: 2070,
|
||||
qut_GT: 1158,
|
||||
quz_BO: 1131,
|
||||
quz_EC: 2155,
|
||||
quz_PE: 3179,
|
||||
rm_CH: 1047,
|
||||
ro_RO: 1048,
|
||||
ru_RU: 1049,
|
||||
rw_RW: 1159,
|
||||
sa_IN: 1103,
|
||||
sah_RU: 1157,
|
||||
se_FI: 3131,
|
||||
se_NO: 1083,
|
||||
se_SE: 2107,
|
||||
si_LK: 1115,
|
||||
sk_SK: 1051,
|
||||
sl_SI: 1060,
|
||||
sma_NO: 6203,
|
||||
sma_SE: 7227,
|
||||
smj_NO: 4155,
|
||||
smj_SE: 5179,
|
||||
smn_FI: 9275,
|
||||
sms_FI: 8251,
|
||||
sq_AL: 1052,
|
||||
sr_BA: 7194,
|
||||
sr_SP: 3098,
|
||||
sv_FI: 2077,
|
||||
sv_SE: 1053,
|
||||
sw_KE: 1089,
|
||||
syr_SY: 1114,
|
||||
ta_IN: 1097,
|
||||
te_IN: 1098,
|
||||
tg_TJ: 1064,
|
||||
th_TH: 1054,
|
||||
tk_TM: 1090,
|
||||
tmz_DZ: 2143,
|
||||
tn_ZA: 1074,
|
||||
tr_TR: 1055,
|
||||
tt_RU: 1092,
|
||||
ug_CN: 1152,
|
||||
uk_UA: 1058,
|
||||
ur_IN: 2080,
|
||||
ur_PK: 1056,
|
||||
uz_UZ: 2115,
|
||||
vi_VN: 1066,
|
||||
wen_DE: 1070,
|
||||
wo_SN: 1160,
|
||||
xh_ZA: 1076,
|
||||
yo_NG: 1130,
|
||||
zh_CHS: 4,
|
||||
zh_CHT: 31748,
|
||||
zh_CN: 2052,
|
||||
zh_HK: 3076,
|
||||
zh_MO: 5124,
|
||||
zh_SG: 4100,
|
||||
zh_TW: 1028,
|
||||
zu_ZA: 1077
|
||||
}; // noinspection SpellCheckingInspection
|
||||
|
||||
exports.lcid = lcid;
|
||||
const langIdToName = {
|
||||
ab: "Abkhaz",
|
||||
aa: "Afar",
|
||||
af: "Afrikaans",
|
||||
ak: "Akan",
|
||||
sq: "Albanian",
|
||||
am: "Amharic",
|
||||
ar: "Arabic",
|
||||
an: "Aragonese",
|
||||
hy: "Armenian",
|
||||
as: "Assamese",
|
||||
av: "Avaric",
|
||||
ae: "Avestan",
|
||||
ay: "Aymara",
|
||||
az: "Azerbaijani",
|
||||
bm: "Bambara",
|
||||
ba: "Bashkir",
|
||||
eu: "Basque",
|
||||
be: "Belarusian",
|
||||
bn: "Bengali",
|
||||
bh: "Bihari",
|
||||
bi: "Bislama",
|
||||
bs: "Bosnian",
|
||||
br: "Breton",
|
||||
bg: "Bulgarian",
|
||||
my: "Burmese",
|
||||
ca: "Catalan",
|
||||
ch: "Chamorro",
|
||||
ce: "Chechen",
|
||||
ny: "Chichewa",
|
||||
zh: "Chinese",
|
||||
cv: "Chuvash",
|
||||
kw: "Cornish",
|
||||
co: "Corsican",
|
||||
cr: "Cree",
|
||||
hr: "Croatian",
|
||||
cs: "Czech",
|
||||
da: "Danish",
|
||||
dv: "Divehi",
|
||||
nl: "Dutch",
|
||||
dz: "Dzongkha",
|
||||
en: "English",
|
||||
eo: "Esperanto",
|
||||
et: "Estonian",
|
||||
ee: "Ewe",
|
||||
fo: "Faroese",
|
||||
fj: "Fijian",
|
||||
fi: "Finnish",
|
||||
fr: "French",
|
||||
ff: "Fula",
|
||||
gl: "Galician",
|
||||
ka: "Georgian",
|
||||
de: "German",
|
||||
el: "Greek",
|
||||
gn: "Guaraní",
|
||||
gu: "Gujarati",
|
||||
ht: "Haitian",
|
||||
ha: "Hausa",
|
||||
he: "Hebrew",
|
||||
hz: "Herero",
|
||||
hi: "Hindi",
|
||||
ho: "Hiri Motu",
|
||||
hu: "Hungarian",
|
||||
ia: "Interlingua",
|
||||
id: "Indonesian",
|
||||
ie: "Interlingue",
|
||||
ga: "Irish",
|
||||
ig: "Igbo",
|
||||
ik: "Inupiaq",
|
||||
io: "Ido",
|
||||
is: "Icelandic",
|
||||
it: "Italian",
|
||||
iu: "Inuktitut",
|
||||
ja: "Japanese",
|
||||
jv: "Javanese",
|
||||
kl: "Kalaallisut",
|
||||
kn: "Kannada",
|
||||
kr: "Kanuri",
|
||||
ks: "Kashmiri",
|
||||
kk: "Kazakh",
|
||||
km: "Khmer",
|
||||
ki: "Kikuyu",
|
||||
rw: "Kinyarwanda",
|
||||
ky: "Kyrgyz",
|
||||
kv: "Komi",
|
||||
kg: "Kongo",
|
||||
ko: "Korean",
|
||||
ku: "Kurdish",
|
||||
kj: "Kwanyama",
|
||||
la: "Latin",
|
||||
lb: "Luxembourgish",
|
||||
lg: "Ganda",
|
||||
li: "Limburgish",
|
||||
ln: "Lingala",
|
||||
lo: "Lao",
|
||||
lt: "Lithuanian",
|
||||
lu: "Luba-Katanga",
|
||||
lv: "Latvian",
|
||||
gv: "Manx",
|
||||
mk: "Macedonian",
|
||||
mg: "Malagasy",
|
||||
ms: "Malay",
|
||||
ml: "Malayalam",
|
||||
mt: "Maltese",
|
||||
mi: "Māori",
|
||||
mr: "Marathi",
|
||||
mh: "Marshallese",
|
||||
mn: "Mongolian",
|
||||
na: "Nauru",
|
||||
nv: "Navajo",
|
||||
nd: "Northern Ndebele",
|
||||
ne: "Nepali",
|
||||
ng: "Ndonga",
|
||||
nb: "Norwegian Bokmål",
|
||||
nn: "Norwegian Nynorsk",
|
||||
no: "Norwegian",
|
||||
ii: "Nuosu",
|
||||
nr: "Southern Ndebele",
|
||||
oc: "Occitan",
|
||||
oj: "Ojibwe",
|
||||
cu: "Old Church Slavonic",
|
||||
om: "Oromo",
|
||||
or: "Oriya",
|
||||
os: "Ossetian",
|
||||
pa: "Panjabi",
|
||||
pi: "Pāli",
|
||||
fa: "Persian",
|
||||
pl: "Polish",
|
||||
ps: "Pashto",
|
||||
pt: "Portuguese",
|
||||
qu: "Quechua",
|
||||
rm: "Romansh",
|
||||
rn: "Kirundi",
|
||||
ro: "Romanian",
|
||||
ru: "Russian",
|
||||
sa: "Sanskrit",
|
||||
sc: "Sardinian",
|
||||
sd: "Sindhi",
|
||||
se: "Northern Sami",
|
||||
sm: "Samoan",
|
||||
sg: "Sango",
|
||||
sr: "Serbian",
|
||||
gd: "Gaelic",
|
||||
sn: "Shona",
|
||||
si: "Sinhala",
|
||||
sk: "Slovak",
|
||||
sl: "Slovene",
|
||||
so: "Somali",
|
||||
st: "Southern Sotho",
|
||||
es: "Spanish",
|
||||
su: "Sundanese",
|
||||
sw: "Swahili",
|
||||
ss: "Swati",
|
||||
sv: "Swedish",
|
||||
ta: "Tamil",
|
||||
te: "Telugu",
|
||||
tg: "Tajik",
|
||||
th: "Thai",
|
||||
ti: "Tigrinya",
|
||||
bo: "Tibetan Standard",
|
||||
tk: "Turkmen",
|
||||
tl: "Tagalog",
|
||||
tn: "Tswana",
|
||||
to: "Tonga",
|
||||
tr: "Turkish",
|
||||
ts: "Tsonga",
|
||||
tt: "Tatar",
|
||||
tw: "Twi",
|
||||
ty: "Tahitian",
|
||||
ug: "Uyghur",
|
||||
uk: "Ukrainian",
|
||||
ur: "Urdu",
|
||||
uz: "Uzbek",
|
||||
ve: "Venda",
|
||||
vi: "Vietnamese",
|
||||
vo: "Volapük",
|
||||
wa: "Walloon",
|
||||
cy: "Welsh",
|
||||
wo: "Wolof",
|
||||
fy: "Western Frisian",
|
||||
xh: "Xhosa",
|
||||
yi: "Yiddish",
|
||||
yo: "Yoruba",
|
||||
za: "Zhuang",
|
||||
zu: "Zulu"
|
||||
}; exports.langIdToName = langIdToName;
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=langs.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/langs.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/langs.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
buildfiles/node_modules/app-builder-lib/out/util/license.d.ts
generated
vendored
Normal file
15
buildfiles/node_modules/app-builder-lib/out/util/license.d.ts
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
import { PlatformPackager } from "../platformPackager";
|
||||
export declare function getLicenseAssets(fileNames: Array<string>, packager: PlatformPackager<any>): {
|
||||
file: string;
|
||||
lang: string;
|
||||
langWithRegion: string;
|
||||
langName: any;
|
||||
}[];
|
||||
export declare function getNotLocalizedLicenseFile(custom: string | null | undefined, packager: PlatformPackager<any>, supportedExtension?: Array<string>): Promise<string | null>;
|
||||
export declare function getLicenseFiles(packager: PlatformPackager<any>): Promise<Array<LicenseFile>>;
|
||||
export interface LicenseFile {
|
||||
file: string;
|
||||
lang: string;
|
||||
langWithRegion: string;
|
||||
langName: string;
|
||||
}
|
74
buildfiles/node_modules/app-builder-lib/out/util/license.js
generated
vendored
Normal file
74
buildfiles/node_modules/app-builder-lib/out/util/license.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getLicenseAssets = getLicenseAssets;
|
||||
exports.getNotLocalizedLicenseFile = getNotLocalizedLicenseFile;
|
||||
exports.getLicenseFiles = getLicenseFiles;
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _langs() {
|
||||
const data = require("./langs");
|
||||
|
||||
_langs = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getLicenseAssets(fileNames, packager) {
|
||||
return fileNames.sort((a, b) => {
|
||||
const aW = a.includes("_en") ? 0 : 100;
|
||||
const bW = b.includes("_en") ? 0 : 100;
|
||||
return aW === bW ? a.localeCompare(b) : aW - bW;
|
||||
}).map(file => {
|
||||
let lang = file.match(/_([^.]+)\./)[1];
|
||||
let langWithRegion;
|
||||
|
||||
if (lang.includes("_")) {
|
||||
langWithRegion = lang;
|
||||
lang = langWithRegion.substring(0, lang.indexOf("_"));
|
||||
} else {
|
||||
lang = lang.toLowerCase();
|
||||
langWithRegion = (0, _langs().toLangWithRegion)(lang);
|
||||
}
|
||||
|
||||
return {
|
||||
file: path.join(packager.buildResourcesDir, file),
|
||||
lang,
|
||||
langWithRegion,
|
||||
langName: _langs().langIdToName[lang]
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
async function getNotLocalizedLicenseFile(custom, packager, supportedExtension = ["rtf", "txt", "html"]) {
|
||||
const possibleFiles = [];
|
||||
|
||||
for (const name of ["license", "eula"]) {
|
||||
for (const ext of supportedExtension) {
|
||||
possibleFiles.push(`${name}.${ext}`);
|
||||
possibleFiles.push(`${name.toUpperCase()}.${ext}`);
|
||||
possibleFiles.push(`${name}.${ext.toUpperCase()}`);
|
||||
possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`);
|
||||
}
|
||||
}
|
||||
|
||||
return await packager.getResource(custom, ...possibleFiles);
|
||||
}
|
||||
|
||||
async function getLicenseFiles(packager) {
|
||||
return getLicenseAssets((await packager.resourceList).filter(it => {
|
||||
const name = it.toLowerCase();
|
||||
return (name.startsWith("license_") || name.startsWith("eula_")) && (name.endsWith(".rtf") || name.endsWith(".txt"));
|
||||
}), packager);
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=license.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/license.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/license.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/license.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAGM,SAAU,gBAAV,CAA2B,SAA3B,EAAqD,QAArD,EAAoF;AACxF,SAAO,SAAS,CAAC,IAAV,CAAe,CAAC,CAAD,EAAI,CAAJ,KAAS;AAC7B,UAAM,EAAE,GAAG,CAAC,CAAC,QAAF,CAAW,KAAX,IAAoB,CAApB,GAAwB,GAAnC;AACA,UAAM,EAAE,GAAG,CAAC,CAAC,QAAF,CAAW,KAAX,IAAoB,CAApB,GAAwB,GAAnC;AACA,WAAO,EAAE,KAAK,EAAP,GAAY,CAAC,CAAC,aAAF,CAAgB,CAAhB,CAAZ,GAAiC,EAAE,GAAG,EAA7C;AACD,GAJM,EAKJ,GALI,CAKA,IAAI,IAAG;AACV,QAAI,IAAI,GAAG,IAAI,CAAC,KAAL,CAAW,YAAX,EAA0B,CAA1B,CAAX;AACA,QAAI,cAAJ;;AACA,QAAI,IAAI,CAAC,QAAL,CAAc,GAAd,CAAJ,EAAwB;AACtB,MAAA,cAAc,GAAG,IAAjB;AACA,MAAA,IAAI,GAAG,cAAc,CAAC,SAAf,CAAyB,CAAzB,EAA4B,IAAI,CAAC,OAAL,CAAa,GAAb,CAA5B,CAAP;AACD,KAHD,MAIK;AACH,MAAA,IAAI,GAAG,IAAI,CAAC,WAAL,EAAP;AACA,MAAA,cAAc,GAAG,+BAAiB,IAAjB,CAAjB;AACD;;AACD,WAAO;AAAC,MAAA,IAAI,EAAE,IAAI,CAAC,IAAL,CAAU,QAAQ,CAAC,iBAAnB,EAAsC,IAAtC,CAAP;AAAoD,MAAA,IAApD;AAA0D,MAAA,cAA1D;AAA0E,MAAA,QAAQ,EAAG,sBAAqB,IAArB;AAArF,KAAP;AACD,GAjBI,CAAP;AAkBD;;AAEM,eAAe,0BAAf,CAA0C,MAA1C,EAA6E,QAA7E,EAA8G,kBAAA,GAAoC,CAAC,KAAD,EAAQ,KAAR,EAAe,MAAf,CAAlJ,EAAwK;AAC7K,QAAM,aAAa,GAAkB,EAArC;;AACA,OAAK,MAAM,IAAX,IAAmB,CAAC,SAAD,EAAY,MAAZ,CAAnB,EAAwC;AACtC,SAAK,MAAM,GAAX,IAAkB,kBAAlB,EAAsC;AACpC,MAAA,aAAa,CAAC,IAAd,CAAmB,GAAG,IAAI,IAAI,GAAG,EAAjC;AACA,MAAA,aAAa,CAAC,IAAd,CAAmB,GAAG,IAAI,CAAC,WAAL,EAAkB,IAAI,GAAG,EAA/C;AACA,MAAA,aAAa,CAAC,IAAd,CAAmB,GAAG,IAAI,IAAI,GAAG,CAAC,WAAJ,EAAiB,EAA/C;AACA,MAAA,aAAa,CAAC,IAAd,CAAmB,GAAG,IAAI,CAAC,WAAL,EAAkB,IAAI,GAAG,CAAC,WAAJ,EAAiB,EAA7D;AACD;AACF;;AAED,SAAO,MAAM,QAAQ,CAAC,WAAT,CAAqB,MAArB,EAA6B,GAAG,aAAhC,CAAb;AACD;;AAEM,eAAe,eAAf,CAA+B,QAA/B,EAA8D;AACnE,SAAO,gBAAgB,CAAC,CAAC,MAAM,QAAQ,CAAC,YAAhB,EACrB,MADqB,CACd,EAAE,IAAG;AACX,UAAM,IAAI,GAAG,EAAE,CAAC,WAAH,EAAb;AACA,WAAO,CAAC,IAAI,CAAC,UAAL,CAAgB,UAAhB,KAA+B,IAAI,CAAC,UAAL,CAAgB,OAAhB,CAAhC,MAA8D,IAAI,CAAC,QAAL,CAAc,MAAd,KAAyB,IAAI,CAAC,QAAL,CAAc,MAAd,CAAvF,CAAP;AACD,GAJqB,CAAD,EAIjB,QAJiB,CAAvB;AAKD,C","sourcesContent":["import * as path from \"path\"\nimport { langIdToName, toLangWithRegion } from \"./langs\"\nimport { PlatformPackager } from \"../platformPackager\"\n\nexport function getLicenseAssets(fileNames: Array<string>, packager: PlatformPackager<any>) {\n return fileNames.sort((a, b) => {\n const aW = a.includes(\"_en\") ? 0 : 100\n const bW = b.includes(\"_en\") ? 0 : 100\n return aW === bW ? a.localeCompare(b) : aW - bW\n })\n .map(file => {\n let lang = file.match(/_([^.]+)\\./)![1]\n let langWithRegion\n if (lang.includes(\"_\")) {\n langWithRegion = lang\n lang = langWithRegion.substring(0, lang.indexOf(\"_\"))\n }\n else {\n lang = lang.toLowerCase()\n langWithRegion = toLangWithRegion(lang)\n }\n return {file: path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: (langIdToName as any)[lang]}\n })\n}\n\nexport async function getNotLocalizedLicenseFile(custom: string | null | undefined, packager: PlatformPackager<any>, supportedExtension: Array<string> = [\"rtf\", \"txt\", \"html\"]): Promise<string | null> {\n const possibleFiles: Array<string> = []\n for (const name of [\"license\", \"eula\"]) {\n for (const ext of supportedExtension) {\n possibleFiles.push(`${name}.${ext}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext}`)\n possibleFiles.push(`${name}.${ext.toUpperCase()}`)\n possibleFiles.push(`${name.toUpperCase()}.${ext.toUpperCase()}`)\n }\n }\n\n return await packager.getResource(custom, ...possibleFiles)\n}\n\nexport async function getLicenseFiles(packager: PlatformPackager<any>): Promise<Array<LicenseFile>> {\n return getLicenseAssets((await packager.resourceList)\n .filter(it => {\n const name = it.toLowerCase()\n return (name.startsWith(\"license_\") || name.startsWith(\"eula_\")) && (name.endsWith(\".rtf\") || name.endsWith(\".txt\"))\n }), packager)\n}\n\nexport interface LicenseFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}"],"sourceRoot":""}
|
3
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.d.ts
generated
vendored
Normal file
3
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
export declare function isMacOsHighSierra(): boolean;
|
||||
export declare function isMacOsSierra(): Promise<boolean>;
|
||||
export declare function isMacOsCatalina(): boolean;
|
100
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.js
generated
vendored
Normal file
100
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.js
generated
vendored
Normal file
@ -0,0 +1,100 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.isMacOsHighSierra = isMacOsHighSierra;
|
||||
exports.isMacOsSierra = isMacOsSierra;
|
||||
exports.isMacOsCatalina = isMacOsCatalina;
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _lazyVal() {
|
||||
const data = require("lazy-val");
|
||||
|
||||
_lazyVal = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function semver() {
|
||||
const data = _interopRequireWildcard(require("semver"));
|
||||
|
||||
semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _log() {
|
||||
const data = require("builder-util/out/log");
|
||||
|
||||
_log = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _os() {
|
||||
const data = require("os");
|
||||
|
||||
_os = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const macOsVersion = new (_lazyVal().Lazy)(async () => {
|
||||
const file = await (0, _fsExtra().readFile)("/System/Library/CoreServices/SystemVersion.plist", "utf8");
|
||||
const matches = /<key>ProductVersion<\/key>[\s\S]*<string>([\d.]+)<\/string>/.exec(file);
|
||||
|
||||
if (!matches) {
|
||||
throw new Error("Couldn't find the macOS version");
|
||||
}
|
||||
|
||||
_log().log.debug({
|
||||
version: matches[1]
|
||||
}, "macOS version");
|
||||
|
||||
return clean(matches[1]);
|
||||
});
|
||||
|
||||
function clean(version) {
|
||||
return version.split(".").length === 2 ? `${version}.0` : version;
|
||||
}
|
||||
|
||||
async function isOsVersionGreaterThanOrEqualTo(input) {
|
||||
return semver().gte(await macOsVersion.value, clean(input));
|
||||
}
|
||||
|
||||
function isMacOsHighSierra() {
|
||||
// 17.7.0 === 10.13.6
|
||||
return process.platform === "darwin" && semver().gte((0, _os().release)(), "17.7.0");
|
||||
}
|
||||
|
||||
async function isMacOsSierra() {
|
||||
return process.platform === "darwin" && (await isOsVersionGreaterThanOrEqualTo("10.12.0"));
|
||||
}
|
||||
|
||||
function isMacOsCatalina() {
|
||||
return process.platform === "darwin" && semver().gte((0, _os().release)(), "19.0.0");
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=macosVersion.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/macosVersion.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/macosVersion.ts"],"names":[],"mappings":";;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA,MAAM,YAAY,GAAG,KAAI,eAAJ,EAAiB,YAAW;AAC/C,QAAM,IAAI,GAAG,MAAM,yBAAS,kDAAT,EAA6D,MAA7D,CAAnB;AACA,QAAM,OAAO,GAAG,8DAA8D,IAA9D,CAAmE,IAAnE,CAAhB;;AACA,MAAI,CAAC,OAAL,EAAc;AACZ,UAAM,IAAI,KAAJ,CAAU,iCAAV,CAAN;AACD;;AACD,aAAI,KAAJ,CAAU;AAAC,IAAA,OAAO,EAAE,OAAO,CAAC,CAAD;AAAjB,GAAV,EAAiC,eAAjC;;AACA,SAAO,KAAK,CAAC,OAAO,CAAC,CAAD,CAAR,CAAZ;AACD,CARoB,CAArB;;AAUA,SAAS,KAAT,CAAe,OAAf,EAA8B;AAC5B,SAAO,OAAO,CAAC,KAAR,CAAc,GAAd,EAAmB,MAAnB,KAA8B,CAA9B,GAAkC,GAAG,OAAO,IAA5C,GAAmD,OAA1D;AACD;;AAED,eAAe,+BAAf,CAA+C,KAA/C,EAA4D;AAC1D,SAAO,MAAM,GAAC,GAAP,CAAW,MAAM,YAAY,CAAC,KAA9B,EAAqC,KAAK,CAAC,KAAD,CAA1C,CAAP;AACD;;AAEK,SAAU,iBAAV,GAA2B;AAC/B;AACA,SAAO,OAAO,CAAC,QAAR,KAAqB,QAArB,IAAiC,MAAM,GAAC,GAAP,CAAW,oBAAX,EAAwB,QAAxB,CAAxC;AACD;;AAEM,eAAe,aAAf,GAA4B;AACjC,SAAO,OAAO,CAAC,QAAR,KAAqB,QAArB,KAAiC,MAAM,+BAA+B,CAAC,SAAD,CAAtE,CAAP;AACD;;AAEK,SAAU,eAAV,GAAyB;AAC7B,SAAO,OAAO,CAAC,QAAR,KAAqB,QAArB,IAAiC,MAAM,GAAC,GAAP,CAAW,oBAAX,EAAwB,QAAxB,CAAxC;AACD,C","sourcesContent":["import { readFile } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as semver from \"semver\"\nimport { log } from \"builder-util/out/log\"\nimport { release as osRelease } from \"os\"\n\nconst macOsVersion = new Lazy<string>(async () => {\n const file = await readFile(\"/System/Library/CoreServices/SystemVersion.plist\", \"utf8\")\n const matches = /<key>ProductVersion<\\/key>[\\s\\S]*<string>([\\d.]+)<\\/string>/.exec(file)\n if (!matches) {\n throw new Error(\"Couldn't find the macOS version\")\n }\n log.debug({version: matches[1]}, \"macOS version\")\n return clean(matches[1])\n})\n\nfunction clean(version: string) {\n return version.split(\".\").length === 2 ? `${version}.0` : version\n}\n\nasync function isOsVersionGreaterThanOrEqualTo(input: string) {\n return semver.gte(await macOsVersion.value, clean(input))\n}\n\nexport function isMacOsHighSierra(): boolean {\n // 17.7.0 === 10.13.6\n return process.platform === \"darwin\" && semver.gte(osRelease(), \"17.7.0\")\n}\n\nexport async function isMacOsSierra() {\n return process.platform === \"darwin\" && await isOsVersionGreaterThanOrEqualTo(\"10.12.0\")\n}\n\nexport function isMacOsCatalina() {\n return process.platform === \"darwin\" && semver.gte(osRelease(), \"19.0.0\")\n}"],"sourceRoot":""}
|
2
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.d.ts
generated
vendored
Normal file
2
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
import { AppInfo } from "../appInfo";
|
||||
export declare function expandMacro(pattern: string, arch: string | null | undefined, appInfo: AppInfo, extra?: any, isProductNameSanitized?: boolean): string;
|
86
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.js
generated
vendored
Normal file
86
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.js
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.expandMacro = expandMacro;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function expandMacro(pattern, arch, appInfo, extra = {}, isProductNameSanitized = true) {
|
||||
if (arch == null) {
|
||||
pattern = pattern // tslint:disable-next-line:no-invalid-template-strings
|
||||
.replace("-${arch}", "") // tslint:disable-next-line:no-invalid-template-strings
|
||||
.replace(" ${arch}", "") // tslint:disable-next-line:no-invalid-template-strings
|
||||
.replace("_${arch}", "") // tslint:disable-next-line:no-invalid-template-strings
|
||||
.replace("/${arch}", "");
|
||||
}
|
||||
|
||||
return pattern.replace(/\${([_a-zA-Z./*]+)}/g, (match, p1) => {
|
||||
switch (p1) {
|
||||
case "productName":
|
||||
return isProductNameSanitized ? appInfo.productFilename : appInfo.productName;
|
||||
|
||||
case "arch":
|
||||
if (arch == null) {
|
||||
// see above, we remove macro if no arch
|
||||
return "";
|
||||
}
|
||||
|
||||
return arch;
|
||||
|
||||
case "author":
|
||||
{
|
||||
const companyName = appInfo.companyName;
|
||||
|
||||
if (companyName == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": author is not specified`, "ERR_ELECTRON_BUILDER_AUTHOR_UNSPECIFIED");
|
||||
}
|
||||
|
||||
return companyName;
|
||||
}
|
||||
|
||||
case "platform":
|
||||
return process.platform;
|
||||
|
||||
case "channel":
|
||||
return appInfo.channel || "latest";
|
||||
|
||||
default:
|
||||
{
|
||||
if (p1 in appInfo) {
|
||||
return appInfo[p1];
|
||||
}
|
||||
|
||||
if (p1.startsWith("env.")) {
|
||||
const envName = p1.substring("env.".length);
|
||||
const envValue = process.env[envName];
|
||||
|
||||
if (envValue == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": env ${envName} is not defined`, "ERR_ELECTRON_BUILDER_ENV_NOT_DEFINED");
|
||||
}
|
||||
|
||||
return envValue;
|
||||
}
|
||||
|
||||
const value = extra[p1];
|
||||
|
||||
if (value == null) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(`cannot expand pattern "${pattern}": macro ${p1} is not defined`, "ERR_ELECTRON_BUILDER_MACRO_NOT_DEFINED");
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=macroExpander.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/macroExpander.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/macroExpander.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAGM,SAAU,WAAV,CAAsB,OAAtB,EAAuC,IAAvC,EAAwE,OAAxE,EAA0F,KAAA,GAAa,EAAvG,EAA2G,sBAAsB,GAAG,IAApI,EAAwI;AAC5I,MAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB,IAAA,OAAO,GAAG,OAAO,CACjB;AADiB,KAEd,OAFO,CAEC,UAFD,EAEa,EAFb,EAGR;AAHQ,KAIP,OAJO,CAIC,UAJD,EAIa,EAJb,EAKR;AALQ,KAMP,OANO,CAMC,UAND,EAMa,EANb,EAOR;AAPQ,KAQP,OARO,CAQC,UARD,EAQa,EARb,CAAV;AASD;;AAED,SAAO,OAAO,CAAC,OAAR,CAAgB,sBAAhB,EAAwC,CAAC,KAAD,EAAQ,EAAR,KAAsB;AACnE,YAAQ,EAAR;AACE,WAAK,aAAL;AACE,eAAO,sBAAsB,GAAG,OAAO,CAAC,eAAX,GAA6B,OAAO,CAAC,WAAlE;;AAEF,WAAK,MAAL;AACE,YAAI,IAAI,IAAI,IAAZ,EAAkB;AAChB;AACA,iBAAO,EAAP;AACD;;AACD,eAAO,IAAP;;AAEF,WAAK,QAAL;AAAe;AACb,gBAAM,WAAW,GAAG,OAAO,CAAC,WAA5B;;AACA,cAAI,WAAW,IAAI,IAAnB,EAAyB;AACvB,kBAAM,KAAI,wCAAJ,EAA8B,0BAA0B,OAAO,4BAA/D,EAA6F,yCAA7F,CAAN;AACD;;AACD,iBAAO,WAAP;AACD;;AAED,WAAK,UAAL;AACE,eAAO,OAAO,CAAC,QAAf;;AAEF,WAAK,SAAL;AACE,eAAO,OAAO,CAAC,OAAR,IAAmB,QAA1B;;AAEF;AAAS;AACP,cAAI,EAAE,IAAI,OAAV,EAAmB;AACjB,mBAAQ,OAAe,CAAC,EAAD,CAAvB;AACD;;AAED,cAAI,EAAE,CAAC,UAAH,CAAc,MAAd,CAAJ,EAA2B;AACzB,kBAAM,OAAO,GAAG,EAAE,CAAC,SAAH,CAAa,OAAO,MAApB,CAAhB;AACA,kBAAM,QAAQ,GAAG,OAAO,CAAC,GAAR,CAAY,OAAZ,CAAjB;;AACA,gBAAI,QAAQ,IAAI,IAAhB,EAAsB;AACpB,oBAAM,KAAI,wCAAJ,EAA8B,0BAA0B,OAAO,UAAU,OAAO,iBAAhF,EAAmG,sCAAnG,CAAN;AACD;;AACD,mBAAO,QAAP;AACD;;AAED,gBAAM,KAAK,GAAG,KAAK,CAAC,EAAD,CAAnB;;AACA,cAAI,KAAK,IAAI,IAAb,EAAmB;AACjB,kBAAM,KAAI,wCAAJ,EAA8B,0BAA0B,OAAO,YAAY,EAAE,iBAA7E,EAAgG,wCAAhG,CAAN;AACD,WAFD,MAGK;AACH,mBAAO,KAAP;AACD;AACF;AA9CH;AAgDD,GAjDM,CAAP;AAkDD,C","sourcesContent":["import { InvalidConfigurationError } from \"builder-util\"\nimport { AppInfo } from \"../appInfo\"\n\nexport function expandMacro(pattern: string, arch: string | null | undefined, appInfo: AppInfo, extra: any = {}, isProductNameSanitized = true): string {\n if (arch == null) {\n pattern = pattern\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"-${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\" ${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"_${arch}\", \"\")\n // tslint:disable-next-line:no-invalid-template-strings\n .replace(\"/${arch}\", \"\")\n }\n\n return pattern.replace(/\\${([_a-zA-Z./*]+)}/g, (match, p1): string => {\n switch (p1) {\n case \"productName\":\n return isProductNameSanitized ? appInfo.productFilename : appInfo.productName\n\n case \"arch\":\n if (arch == null) {\n // see above, we remove macro if no arch\n return \"\"\n }\n return arch\n\n case \"author\": {\n const companyName = appInfo.companyName\n if (companyName == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": author is not specified`, \"ERR_ELECTRON_BUILDER_AUTHOR_UNSPECIFIED\")\n }\n return companyName\n }\n\n case \"platform\":\n return process.platform\n\n case \"channel\":\n return appInfo.channel || \"latest\"\n\n default: {\n if (p1 in appInfo) {\n return (appInfo as any)[p1]\n }\n\n if (p1.startsWith(\"env.\")) {\n const envName = p1.substring(\"env.\".length)\n const envValue = process.env[envName]\n if (envValue == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": env ${envName} is not defined`, \"ERR_ELECTRON_BUILDER_ENV_NOT_DEFINED\")\n }\n return envValue\n }\n\n const value = extra[p1]\n if (value == null) {\n throw new InvalidConfigurationError(`cannot expand pattern \"${pattern}\": macro ${p1} is not defined`, \"ERR_ELECTRON_BUILDER_MACRO_NOT_DEFINED\")\n }\n else {\n return value\n }\n }\n }\n })\n}"],"sourceRoot":""}
|
9
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.d.ts
generated
vendored
Normal file
9
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
export declare function createLazyProductionDeps(projectDir: string, excludedDependencies: Array<string> | null): Lazy<any[]>;
|
||||
export interface NodeModuleDirInfo {
|
||||
readonly dir: string;
|
||||
readonly deps: Array<NodeModuleInfo>;
|
||||
}
|
||||
export interface NodeModuleInfo {
|
||||
readonly name: string;
|
||||
}
|
42
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.js
generated
vendored
Normal file
42
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createLazyProductionDeps = createLazyProductionDeps;
|
||||
|
||||
function _lazyVal() {
|
||||
const data = require("lazy-val");
|
||||
|
||||
_lazyVal = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _appBuilder() {
|
||||
const data = require("./appBuilder");
|
||||
|
||||
_appBuilder = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function createLazyProductionDeps(projectDir, excludedDependencies) {
|
||||
return new (_lazyVal().Lazy)(async () => {
|
||||
const args = ["node-dep-tree", "--dir", projectDir];
|
||||
|
||||
if (excludedDependencies != null) {
|
||||
for (const name of excludedDependencies) {
|
||||
args.push("--exclude-dep", name);
|
||||
}
|
||||
}
|
||||
|
||||
return (0, _appBuilder().executeAppBuilderAsJson)(args);
|
||||
});
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=packageDependencies.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/packageDependencies.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/packageDependencies.ts"],"names":[],"mappings":";;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEM,SAAU,wBAAV,CAAmC,UAAnC,EAAuD,oBAAvD,EAAiG;AACrG,SAAO,KAAI,eAAJ,EAAS,YAAW;AACzB,UAAM,IAAI,GAAG,CAAC,eAAD,EAAkB,OAAlB,EAA2B,UAA3B,CAAb;;AACA,QAAI,oBAAoB,IAAI,IAA5B,EAAkC;AAChC,WAAK,MAAM,IAAX,IAAmB,oBAAnB,EAAyC;AACvC,QAAA,IAAI,CAAC,IAAL,CAAU,eAAV,EAA2B,IAA3B;AACD;AACF;;AACD,WAAO,2CAAoC,IAApC,CAAP;AACD,GARM,CAAP;AASD,C","sourcesContent":["import { Lazy } from \"lazy-val\"\nimport { executeAppBuilderAsJson } from \"./appBuilder\"\n\nexport function createLazyProductionDeps(projectDir: string, excludedDependencies: Array<string> | null) {\n return new Lazy(async () => {\n const args = [\"node-dep-tree\", \"--dir\", projectDir]\n if (excludedDependencies != null) {\n for (const name of excludedDependencies) {\n args.push(\"--exclude-dep\", name)\n }\n }\n return executeAppBuilderAsJson<Array<any>>(args)\n })\n}\n\nexport interface NodeModuleDirInfo {\n readonly dir: string\n readonly deps: Array<NodeModuleInfo>\n}\n\nexport interface NodeModuleInfo {\n readonly name: string\n}"],"sourceRoot":""}
|
1
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.d.ts
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.d.ts
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
export {};
|
185
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.js
generated
vendored
Normal file
185
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.js
generated
vendored
Normal file
@ -0,0 +1,185 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.readPackageJson = readPackageJson;
|
||||
exports.checkMetadata = checkMetadata;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function semver() {
|
||||
const data = _interopRequireWildcard(require("semver"));
|
||||
|
||||
semver = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _normalizePackageData() {
|
||||
const data = _interopRequireDefault(require("normalize-package-data"));
|
||||
|
||||
_normalizePackageData = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
/** @internal */
|
||||
async function readPackageJson(file) {
|
||||
const data = await (0, _fsExtra().readJson)(file);
|
||||
await authors(file, data);
|
||||
(0, _normalizePackageData().default)(data); // remove not required fields because can be used for remote build
|
||||
|
||||
delete data.scripts;
|
||||
delete data.readme;
|
||||
return data;
|
||||
}
|
||||
|
||||
async function authors(file, data) {
|
||||
if (data.contributors != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
let authorData;
|
||||
|
||||
try {
|
||||
authorData = await (0, _fsExtra().readFile)(path.resolve(path.dirname(file), "AUTHORS"), "utf8");
|
||||
} catch (ignored) {
|
||||
return;
|
||||
}
|
||||
|
||||
data.contributors = authorData.split(/\r?\n/g).map(it => it.replace(/^\s*#.*$/, "").trim());
|
||||
}
|
||||
/** @internal */
|
||||
|
||||
|
||||
function checkMetadata(metadata, devMetadata, appPackageFile, devAppPackageFile) {
|
||||
const errors = [];
|
||||
|
||||
const reportError = missedFieldName => {
|
||||
errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`);
|
||||
};
|
||||
|
||||
const checkNotEmpty = (name, value) => {
|
||||
if ((0, _builderUtil().isEmptyOrSpaces)(value)) {
|
||||
reportError(name);
|
||||
}
|
||||
};
|
||||
|
||||
if (metadata.directories != null) {
|
||||
errors.push(`"directories" in the root is deprecated, please specify in the "build"`);
|
||||
}
|
||||
|
||||
checkNotEmpty("name", metadata.name);
|
||||
|
||||
if ((0, _builderUtil().isEmptyOrSpaces)(metadata.description)) {
|
||||
_builderUtil().log.warn({
|
||||
appPackageFile
|
||||
}, `description is missed in the package.json`);
|
||||
}
|
||||
|
||||
if (metadata.author == null) {
|
||||
_builderUtil().log.warn({
|
||||
appPackageFile
|
||||
}, `author is missed in the package.json`);
|
||||
}
|
||||
|
||||
checkNotEmpty("version", metadata.version);
|
||||
|
||||
if (metadata != null) {
|
||||
checkDependencies(metadata.dependencies, errors);
|
||||
}
|
||||
|
||||
if (metadata !== devMetadata) {
|
||||
if (metadata.build != null) {
|
||||
errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`);
|
||||
}
|
||||
}
|
||||
|
||||
const devDependencies = metadata.devDependencies;
|
||||
|
||||
if (devDependencies != null && "electron-rebuild" in devDependencies) {
|
||||
_builderUtil().log.info('electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\n\nTo ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`');
|
||||
}
|
||||
|
||||
if (errors.length > 0) {
|
||||
throw new (_builderUtil().InvalidConfigurationError)(errors.join("\n"));
|
||||
}
|
||||
}
|
||||
|
||||
function versionSatisfies(version, range, loose) {
|
||||
if (version == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const coerced = semver().coerce(version);
|
||||
|
||||
if (coerced == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return semver().satisfies(coerced, range, loose);
|
||||
}
|
||||
|
||||
function checkDependencies(dependencies, errors) {
|
||||
if (dependencies == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updaterVersion = dependencies["electron-updater"];
|
||||
const requiredElectronUpdaterVersion = "4.0.0";
|
||||
|
||||
if (updaterVersion != null && !versionSatisfies(updaterVersion, `>=${requiredElectronUpdaterVersion}`)) {
|
||||
errors.push(`At least electron-updater ${requiredElectronUpdaterVersion} is recommended by current electron-builder version. Please set electron-updater version to "^${requiredElectronUpdaterVersion}"`);
|
||||
}
|
||||
|
||||
const swVersion = dependencies["electron-builder-squirrel-windows"];
|
||||
|
||||
if (swVersion != null && !versionSatisfies(swVersion, ">=20.32.0")) {
|
||||
errors.push(`At least electron-builder-squirrel-windows 20.32.0 is required by current electron-builder version. Please set electron-builder-squirrel-windows to "^20.32.0"`);
|
||||
}
|
||||
|
||||
const deps = ["electron", "electron-prebuilt", "electron-rebuild"];
|
||||
|
||||
if (process.env.ALLOW_ELECTRON_BUILDER_AS_PRODUCTION_DEPENDENCY !== "true") {
|
||||
deps.push("electron-builder");
|
||||
}
|
||||
|
||||
for (const name of deps) {
|
||||
if (name in dependencies) {
|
||||
errors.push(`Package "${name}" is only allowed in "devDependencies". ` + `Please remove it from the "dependencies" section in your package.json.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=packageMetadata.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/packageMetadata.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
buildfiles/node_modules/app-builder-lib/out/util/pathManager.d.ts
generated
vendored
Normal file
2
buildfiles/node_modules/app-builder-lib/out/util/pathManager.d.ts
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
export declare function getTemplatePath(file: string): string;
|
||||
export declare function getVendorPath(file?: string): string;
|
25
buildfiles/node_modules/app-builder-lib/out/util/pathManager.js
generated
vendored
Normal file
25
buildfiles/node_modules/app-builder-lib/out/util/pathManager.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getTemplatePath = getTemplatePath;
|
||||
exports.getVendorPath = getVendorPath;
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
const root = path.join(__dirname, "..", "..");
|
||||
|
||||
function getTemplatePath(file) {
|
||||
return path.join(root, "templates", file);
|
||||
}
|
||||
|
||||
function getVendorPath(file) {
|
||||
return file == null ? path.join(root, "vendor") : path.join(root, "vendor", file);
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=pathManager.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/pathManager.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/pathManager.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/pathManager.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;;;;AAEA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAL,CAAU,SAAV,EAAqB,IAArB,EAA2B,IAA3B,CAAb;;AAEM,SAAU,eAAV,CAA0B,IAA1B,EAAsC;AAC1C,SAAO,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,WAAhB,EAA6B,IAA7B,CAAP;AACD;;AAEK,SAAU,aAAV,CAAwB,IAAxB,EAAqC;AACzC,SAAO,IAAI,IAAI,IAAR,GAAe,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,QAAhB,CAAf,GAA2C,IAAI,CAAC,IAAL,CAAU,IAAV,EAAgB,QAAhB,EAA0B,IAA1B,CAAlD;AACD,C","sourcesContent":["import * as path from \"path\"\n\nconst root = path.join(__dirname, \"..\", \"..\")\n\nexport function getTemplatePath(file: string) {\n return path.join(root, \"templates\", file)\n}\n\nexport function getVendorPath(file?: string) {\n return file == null ? path.join(root, \"vendor\") : path.join(root, \"vendor\", file)\n}"],"sourceRoot":""}
|
3
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts
generated
vendored
Normal file
3
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import { SourceRepositoryInfo } from "../core";
|
||||
import { Metadata } from "..";
|
||||
export declare function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata | null): Promise<SourceRepositoryInfo | null>;
|
131
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.js
generated
vendored
Normal file
131
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.js
generated
vendored
Normal file
@ -0,0 +1,131 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.getRepositoryInfo = getRepositoryInfo;
|
||||
|
||||
function _promise() {
|
||||
const data = require("builder-util/out/promise");
|
||||
|
||||
_promise = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _hostedGitInfo() {
|
||||
const data = require("hosted-git-info");
|
||||
|
||||
_hostedGitInfo = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
function getRepositoryInfo(projectDir, metadata, devMetadata) {
|
||||
return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository));
|
||||
}
|
||||
|
||||
async function getGitUrlFromGitConfig(projectDir) {
|
||||
const data = await (0, _promise().orNullIfFileNotExist)((0, _fsExtra().readFile)(path.join(projectDir, ".git", "config"), "utf8"));
|
||||
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const conf = data.split(/\r?\n/);
|
||||
const i = conf.indexOf('[remote "origin"]');
|
||||
|
||||
if (i !== -1) {
|
||||
let u = conf[i + 1];
|
||||
|
||||
if (!u.match(/^\s*url =/)) {
|
||||
u = conf[i + 2];
|
||||
}
|
||||
|
||||
if (u.match(/^\s*url =/)) {
|
||||
return u.replace(/^\s*url = /, "");
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
async function _getInfo(projectDir, repo) {
|
||||
if (repo != null) {
|
||||
return parseRepositoryUrl(typeof repo === "string" ? repo : repo.url);
|
||||
}
|
||||
|
||||
const slug = process.env.TRAVIS_REPO_SLUG || process.env.APPVEYOR_REPO_NAME;
|
||||
|
||||
if (slug != null) {
|
||||
const splitted = slug.split("/");
|
||||
return {
|
||||
user: splitted[0],
|
||||
project: splitted[1]
|
||||
};
|
||||
}
|
||||
|
||||
const user = process.env.CIRCLE_PROJECT_USERNAME;
|
||||
const project = process.env.CIRCLE_PROJECT_REPONAME;
|
||||
|
||||
if (user != null && project != null) {
|
||||
return {
|
||||
user,
|
||||
project
|
||||
};
|
||||
}
|
||||
|
||||
const url = await getGitUrlFromGitConfig(projectDir);
|
||||
return url == null ? null : parseRepositoryUrl(url);
|
||||
}
|
||||
|
||||
function parseRepositoryUrl(url) {
|
||||
const info = (0, _hostedGitInfo().fromUrl)(url);
|
||||
|
||||
if (info != null) {
|
||||
delete info.protocols;
|
||||
delete info.treepath;
|
||||
delete info.filetemplate;
|
||||
delete info.bugstemplate;
|
||||
delete info.gittemplate;
|
||||
delete info.tarballtemplate;
|
||||
delete info.sshtemplate;
|
||||
delete info.sshurltemplate;
|
||||
delete info.browsetemplate;
|
||||
delete info.docstemplate;
|
||||
delete info.httpstemplate;
|
||||
delete info.shortcuttemplate;
|
||||
delete info.pathtemplate;
|
||||
delete info.pathmatch;
|
||||
delete info.protocols_re;
|
||||
delete info.committish;
|
||||
delete info.default;
|
||||
delete info.opts;
|
||||
delete info.browsefiletemplate;
|
||||
delete info.auth;
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=repositoryInfo.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/repositoryInfo.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
11
buildfiles/node_modules/app-builder-lib/out/util/timer.d.ts
generated
vendored
Normal file
11
buildfiles/node_modules/app-builder-lib/out/util/timer.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
export interface Timer {
|
||||
end(): void;
|
||||
}
|
||||
export declare class DevTimer implements Timer {
|
||||
private readonly label;
|
||||
private start;
|
||||
constructor(label: string);
|
||||
endAndGet(): string;
|
||||
end(): void;
|
||||
}
|
||||
export declare function time(label: string): Timer;
|
48
buildfiles/node_modules/app-builder-lib/out/util/timer.js
generated
vendored
Normal file
48
buildfiles/node_modules/app-builder-lib/out/util/timer.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.time = time;
|
||||
exports.DevTimer = void 0;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
class DevTimer {
|
||||
constructor(label) {
|
||||
this.label = label;
|
||||
this.start = process.hrtime();
|
||||
}
|
||||
|
||||
endAndGet() {
|
||||
const end = process.hrtime(this.start);
|
||||
return `${end[0]}s ${Math.round(end[1] / 1000000)}ms`;
|
||||
}
|
||||
|
||||
end() {
|
||||
console.info(`${this.label}: ${this.endAndGet()}`);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exports.DevTimer = DevTimer;
|
||||
|
||||
class ProductionTimer {
|
||||
end() {// ignore
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function time(label) {
|
||||
return _builderUtil().debug.enabled ? new DevTimer(label) : new ProductionTimer();
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=timer.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/timer.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/timer.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../src/util/timer.ts"],"names":[],"mappings":";;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAMM,MAAO,QAAP,CAAe;AAGnB,EAAA,WAAA,CAA6B,KAA7B,EAA0C;AAAb,SAAA,KAAA,GAAA,KAAA;AAFrB,SAAA,KAAA,GAAQ,OAAO,CAAC,MAAR,EAAR;AAGP;;AAED,EAAA,SAAS,GAAA;AACP,UAAM,GAAG,GAAG,OAAO,CAAC,MAAR,CAAe,KAAK,KAApB,CAAZ;AACA,WAAO,GAAG,GAAG,CAAC,CAAD,CAAG,KAAK,IAAI,CAAC,KAAL,CAAW,GAAG,CAAC,CAAD,CAAH,GAAS,OAApB,CAA4B,IAAjD;AACD;;AAED,EAAA,GAAG,GAAA;AACD,IAAA,OAAO,CAAC,IAAR,CAAa,GAAG,KAAK,KAAK,KAAK,KAAK,SAAL,EAAgB,EAA/C;AACD;;AAbkB;;;;AAgBrB,MAAM,eAAN,CAAqB;AACnB,EAAA,GAAG,GAAA,CACD;AACD;;AAHkB;;AAMf,SAAU,IAAV,CAAe,KAAf,EAA4B;AAChC,SAAO,qBAAM,OAAN,GAAgB,IAAI,QAAJ,CAAa,KAAb,CAAhB,GAAsC,IAAI,eAAJ,EAA7C;AACD,C","sourcesContent":["import { debug } from \"builder-util\"\n\nexport interface Timer {\n end(): void\n}\n\nexport class DevTimer implements Timer {\n private start = process.hrtime()\n\n constructor(private readonly label: string) {\n }\n\n endAndGet(): string {\n const end = process.hrtime(this.start)\n return `${end[0]}s ${Math.round(end[1] / 1000000)}ms`\n }\n\n end(): void {\n console.info(`${this.label}: ${this.endAndGet()}`)\n }\n}\n\nclass ProductionTimer implements Timer {\n end(): void {\n // ignore\n }\n}\n\nexport function time(label: string): Timer {\n return debug.enabled ? new DevTimer(label) : new ProductionTimer()\n}"],"sourceRoot":""}
|
17
buildfiles/node_modules/app-builder-lib/out/util/yarn.d.ts
generated
vendored
Normal file
17
buildfiles/node_modules/app-builder-lib/out/util/yarn.d.ts
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
import { Configuration } from "../configuration";
|
||||
import { NodeModuleDirInfo } from "./packageDependencies";
|
||||
export declare function installOrRebuild(config: Configuration, appDir: string, options: RebuildOptions, forceInstall?: boolean): Promise<void>;
|
||||
export interface DesktopFrameworkInfo {
|
||||
version: string;
|
||||
useCustomDist: boolean;
|
||||
}
|
||||
export declare function getGypEnv(frameworkInfo: DesktopFrameworkInfo, platform: NodeJS.Platform, arch: string, buildFromSource: boolean): any;
|
||||
export interface RebuildOptions {
|
||||
frameworkInfo: DesktopFrameworkInfo;
|
||||
productionDeps?: Lazy<Array<NodeModuleDirInfo>>;
|
||||
platform?: NodeJS.Platform;
|
||||
arch?: string;
|
||||
buildFromSource?: boolean;
|
||||
additionalArgs?: Array<string> | null;
|
||||
}
|
193
buildfiles/node_modules/app-builder-lib/out/util/yarn.js
generated
vendored
Normal file
193
buildfiles/node_modules/app-builder-lib/out/util/yarn.js
generated
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.installOrRebuild = installOrRebuild;
|
||||
exports.getGypEnv = getGypEnv;
|
||||
exports.rebuild = rebuild;
|
||||
|
||||
function _builderUtil() {
|
||||
const data = require("builder-util");
|
||||
|
||||
_builderUtil = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fsExtra() {
|
||||
const data = require("fs-extra");
|
||||
|
||||
_fsExtra = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _os() {
|
||||
const data = require("os");
|
||||
|
||||
_os = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var path = _interopRequireWildcard(require("path"));
|
||||
|
||||
function _appBuilder() {
|
||||
const data = require("./appBuilder");
|
||||
|
||||
_appBuilder = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
||||
|
||||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
||||
|
||||
async function installOrRebuild(config, appDir, options, forceInstall = false) {
|
||||
const effectiveOptions = {
|
||||
buildFromSource: config.buildDependenciesFromSource === true,
|
||||
additionalArgs: (0, _builderUtil().asArray)(config.npmArgs),
|
||||
...options
|
||||
};
|
||||
let isDependenciesInstalled = false;
|
||||
|
||||
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
|
||||
if (await (0, _fsExtra().pathExists)(path.join(appDir, fileOrDir))) {
|
||||
isDependenciesInstalled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (forceInstall || !isDependenciesInstalled) {
|
||||
await installDependencies(appDir, effectiveOptions);
|
||||
} else {
|
||||
await rebuild(appDir, effectiveOptions);
|
||||
}
|
||||
}
|
||||
|
||||
function getElectronGypCacheDir() {
|
||||
return path.join((0, _os().homedir)(), ".electron-gyp");
|
||||
}
|
||||
|
||||
function getGypEnv(frameworkInfo, platform, arch, buildFromSource) {
|
||||
const npmConfigArch = arch === "armv7l" ? "arm" : arch;
|
||||
const common = { ...process.env,
|
||||
npm_config_arch: npmConfigArch,
|
||||
npm_config_target_arch: npmConfigArch,
|
||||
npm_config_platform: platform,
|
||||
npm_config_build_from_source: buildFromSource,
|
||||
// required for node-pre-gyp
|
||||
npm_config_target_platform: platform,
|
||||
npm_config_update_binary: true,
|
||||
npm_config_fallback_to_build: true
|
||||
};
|
||||
|
||||
if (platform !== process.platform) {
|
||||
common.npm_config_force = "true";
|
||||
}
|
||||
|
||||
if (platform === "win32" || platform === "darwin") {
|
||||
common.npm_config_target_libc = "unknown";
|
||||
}
|
||||
|
||||
if (!frameworkInfo.useCustomDist) {
|
||||
return common;
|
||||
} // https://github.com/nodejs/node-gyp/issues/21
|
||||
|
||||
|
||||
return { ...common,
|
||||
npm_config_disturl: "https://electronjs.org/headers",
|
||||
npm_config_target: frameworkInfo.version,
|
||||
npm_config_runtime: "electron",
|
||||
npm_config_devdir: getElectronGypCacheDir()
|
||||
};
|
||||
}
|
||||
|
||||
function installDependencies(appDir, options) {
|
||||
const platform = options.platform || process.platform;
|
||||
const arch = options.arch || process.arch;
|
||||
const additionalArgs = options.additionalArgs;
|
||||
|
||||
_builderUtil().log.info({
|
||||
platform,
|
||||
arch,
|
||||
appDir
|
||||
}, `installing production dependencies`);
|
||||
|
||||
let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS;
|
||||
const execArgs = ["install"];
|
||||
const npmUserAgent = process.env["npm_config_user_agent"];
|
||||
const isYarn2 = npmUserAgent != null && npmUserAgent.startsWith("yarn/2.");
|
||||
|
||||
if (!isYarn2) {
|
||||
if (process.env.NPM_NO_BIN_LINKS === "true") {
|
||||
execArgs.push("--no-bin-links");
|
||||
}
|
||||
|
||||
execArgs.push("--production");
|
||||
}
|
||||
|
||||
if (!isRunningYarn(execPath)) {
|
||||
execArgs.push("--cache-min", "999999999");
|
||||
}
|
||||
|
||||
if (execPath == null) {
|
||||
execPath = getPackageToolPath();
|
||||
} else if (!isYarn2) {
|
||||
execArgs.unshift(execPath);
|
||||
execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node";
|
||||
}
|
||||
|
||||
if (additionalArgs != null) {
|
||||
execArgs.push(...additionalArgs);
|
||||
}
|
||||
|
||||
return (0, _builderUtil().spawn)(execPath, execArgs, {
|
||||
cwd: appDir,
|
||||
env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true)
|
||||
});
|
||||
}
|
||||
|
||||
function getPackageToolPath() {
|
||||
if (process.env.FORCE_YARN === "true") {
|
||||
return process.platform === "win32" ? "yarn.cmd" : "yarn";
|
||||
} else {
|
||||
return process.platform === "win32" ? "npm.cmd" : "npm";
|
||||
}
|
||||
}
|
||||
|
||||
function isRunningYarn(execPath) {
|
||||
const userAgent = process.env.npm_config_user_agent;
|
||||
return process.env.FORCE_YARN === "true" || execPath != null && path.basename(execPath).startsWith("yarn") || userAgent != null && /\byarn\b/.test(userAgent);
|
||||
}
|
||||
/** @internal */
|
||||
|
||||
|
||||
async function rebuild(appDir, options) {
|
||||
const configuration = {
|
||||
dependencies: await options.productionDeps.value,
|
||||
nodeExecPath: process.execPath,
|
||||
platform: options.platform || process.platform,
|
||||
arch: options.arch || process.arch,
|
||||
additionalArgs: options.additionalArgs,
|
||||
execPath: process.env.npm_execpath || process.env.NPM_CLI_JS,
|
||||
buildFromSource: options.buildFromSource === true
|
||||
};
|
||||
const env = getGypEnv(options.frameworkInfo, configuration.platform, configuration.arch, options.buildFromSource === true);
|
||||
await (0, _appBuilder().executeAppBuilderAndWriteJson)(["rebuild-node-modules"], configuration, {
|
||||
env,
|
||||
cwd: appDir
|
||||
});
|
||||
}
|
||||
// __ts-babel@6.0.4
|
||||
//# sourceMappingURL=yarn.js.map
|
1
buildfiles/node_modules/app-builder-lib/out/util/yarn.js.map
generated
vendored
Normal file
1
buildfiles/node_modules/app-builder-lib/out/util/yarn.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user