main funcions fixes
This commit is contained in:
13
desktop-operator/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts
generated
vendored
Normal file
13
desktop-operator/node_modules/app-builder-lib/out/util/AppFileWalker.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Filter } from "builder-util";
|
||||
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;
|
||||
}
|
||||
97
desktop-operator/node_modules/app-builder-lib/out/util/AppFileWalker.js
generated
vendored
Normal file
97
desktop-operator/node_modules/app-builder-lib/out/util/AppFileWalker.js
generated
vendored
Normal file
@@ -0,0 +1,97 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AppFileWalker = exports.FileCopyHelper = void 0;
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
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, fs_extra_1.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, fs_extra_1.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 !!packager.config.includeSubNodeModules;
|
||||
}
|
||||
return filter(file, fileStat);
|
||||
};
|
||||
}
|
||||
/** @internal */
|
||||
class AppFileWalker extends FileCopyHelper {
|
||||
constructor(matcher, packager) {
|
||||
super(addAllPatternIfNeed(matcher), createAppFilter(matcher, packager), packager);
|
||||
this.matcherFilter = matcher.createFilter();
|
||||
}
|
||||
// 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)) {
|
||||
if (!this.packager.config.includeSubNodeModules) {
|
||||
const matchesFilter = this.matcherFilter(file, fileStat);
|
||||
if (!matchesFilter) {
|
||||
// Skip the file
|
||||
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;
|
||||
//# sourceMappingURL=AppFileWalker.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/AppFileWalker.js.map
generated
vendored
Normal file
1
desktop-operator/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
desktop-operator/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
151
desktop-operator/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js
generated
vendored
Normal file
151
desktop-operator/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.NodeModuleCopyHelper = void 0;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
const fileMatcher_1 = require("../fileMatcher");
|
||||
const resolve_1 = require("./resolve");
|
||||
const AppFileWalker_1 = require("./AppFileWalker");
|
||||
const fs_1 = require("fs");
|
||||
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_1.excludedNames.split(",")));
|
||||
const topLevelExcludedFiles = new Set([
|
||||
"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_1.FileCopyHelper {
|
||||
constructor(matcher, packager) {
|
||||
super(matcher, matcher.isEmpty() ? null : matcher.createFilter(), packager);
|
||||
}
|
||||
async collectNodeModules(moduleInfo, nodeModuleExcludedExts) {
|
||||
var _a;
|
||||
const filter = this.filter;
|
||||
const metadata = this.metadata;
|
||||
const onNodeModuleFile = await (0, resolve_1.resolveFunction)(this.packager.appInfo.type, this.packager.config.onNodeModuleFile, "onNodeModuleFile");
|
||||
const result = [];
|
||||
const queue = [];
|
||||
const emptyDirs = new Set();
|
||||
const symlinkFiles = new Map();
|
||||
const tmpPath = moduleInfo.dir;
|
||||
const moduleName = moduleInfo.name;
|
||||
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, fs_extra_1.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 bluebird_lst_1.default.map(childNames, name => {
|
||||
const filePath = path.join(dirPath, name);
|
||||
const forceIncluded = onNodeModuleFile != null && !!onNodeModuleFile(filePath);
|
||||
if (excludedFiles.has(name) || name.startsWith("._")) {
|
||||
return null;
|
||||
}
|
||||
// check if filematcher matches the files array as more important than the default excluded files.
|
||||
const fileMatched = filter != null && filter(dirPath, (0, fs_extra_1.lstatSync)(dirPath));
|
||||
if (!fileMatched || !forceIncluded || !!this.packager.config.disableDefaultIgnoredFiles) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
return (0, fs_extra_1.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;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}, builder_util_1.CONCURRENCY);
|
||||
let isEmpty = true;
|
||||
for (const child of sortedFilePaths) {
|
||||
if (child != null) {
|
||||
result.push(child);
|
||||
if ((_a = this.metadata.get(child)) === null || _a === void 0 ? void 0 : _a.isSymbolicLink()) {
|
||||
symlinkFiles.set(child, result.length - 1);
|
||||
}
|
||||
isEmpty = false;
|
||||
}
|
||||
}
|
||||
if (isEmpty) {
|
||||
emptyDirs.add(dirPath);
|
||||
}
|
||||
dirs.sort();
|
||||
for (const child of dirs) {
|
||||
queue.push(dirPath + path.sep + child);
|
||||
}
|
||||
}
|
||||
for (const [file, index] of symlinkFiles) {
|
||||
const resolvedPath = (0, fs_1.realpathSync)(file);
|
||||
if (emptyDirs.has(resolvedPath)) {
|
||||
// delete symlink file if target is a empty dir
|
||||
result[index] = undefined;
|
||||
}
|
||||
}
|
||||
return result.filter((it) => it !== undefined);
|
||||
}
|
||||
}
|
||||
exports.NodeModuleCopyHelper = NodeModuleCopyHelper;
|
||||
//# sourceMappingURL=NodeModuleCopyHelper.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/NodeModuleCopyHelper.js.map
generated
vendored
Normal file
1
desktop-operator/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
desktop-operator/node_modules/app-builder-lib/out/util/appBuilder.d.ts
generated
vendored
Normal file
6
desktop-operator/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;
|
||||
36
desktop-operator/node_modules/app-builder-lib/out/util/appBuilder.js
generated
vendored
Normal file
36
desktop-operator/node_modules/app-builder-lib/out/util/appBuilder.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.executeAppBuilderAsJson = executeAppBuilderAsJson;
|
||||
exports.executeAppBuilderAndWriteJson = executeAppBuilderAndWriteJson;
|
||||
exports.objectToArgs = objectToArgs;
|
||||
const builder_util_1 = require("builder-util");
|
||||
function executeAppBuilderAsJson(args) {
|
||||
return (0, builder_util_1.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, builder_util_1.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=appBuilder.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/appBuilder.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/appBuilder.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"appBuilder.js","sourceRoot":"","sources":["../../src/util/appBuilder.ts"],"names":[],"mappings":";;AAGA,0DAYC;AAED,sEAWC;AAED,oCAOC;AArCD,+CAAgD;AAGhD,SAAgB,uBAAuB,CAAI,IAAmB;IAC5D,OAAO,IAAA,gCAAiB,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAC9C,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAM,CAAA;QACjC,CAAC;QAED,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAM,CAAA;QACnC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,OAAO,MAAM,SAAS,GAAG,CAAC,CAAA;QACtE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,6BAA6B,CAAC,IAAmB,EAAE,IAAS,EAAE,eAA6B,EAAE;IAC3G,OAAO,IAAA,gCAAiB,EACtB,IAAI,EACJ,YAAY,CAAC,EAAE;QACb,YAAY,CAAC,KAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/C,CAAC,EACD;QACE,GAAG,YAAY;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC;KACxC,CACF,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,EAAiB,EAAE,cAAgD;IAC9F,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;AACH,CAAC","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).then(rawResult => {\n if (rawResult === \"\") {\n return Object.create(null) as T\n }\n\n try {\n return JSON.parse(rawResult) as T\n } catch (e: any) {\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(\n args,\n childProcess => {\n childProcess.stdin!.end(JSON.stringify(data))\n },\n {\n ...extraOptions,\n stdio: [\"pipe\", \"pipe\", process.stdout],\n }\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"]}
|
||||
16
desktop-operator/node_modules/app-builder-lib/out/util/appFileCopier.d.ts
generated
vendored
Normal file
16
desktop-operator/node_modules/app-builder-lib/out/util/appFileCopier.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import { FileTransformer } from "builder-util";
|
||||
import { Stats } from "fs";
|
||||
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>>;
|
||||
227
desktop-operator/node_modules/app-builder-lib/out/util/appFileCopier.js
generated
vendored
Normal file
227
desktop-operator/node_modules/app-builder-lib/out/util/appFileCopier.js
generated
vendored
Normal file
@@ -0,0 +1,227 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ELECTRON_COMPILE_SHIM_FILENAME = void 0;
|
||||
exports.getDestinationPath = getDestinationPath;
|
||||
exports.copyAppFiles = copyAppFiles;
|
||||
exports.transformFiles = transformFiles;
|
||||
exports.computeFileSets = computeFileSets;
|
||||
exports.computeNodeModuleFileSets = computeNodeModuleFileSets;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const promises_1 = require("fs/promises");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
const unpackDetector_1 = require("../asar/unpackDetector");
|
||||
const core_1 = require("../core");
|
||||
const fileMatcher_1 = require("../fileMatcher");
|
||||
const fileTransformer_1 = require("../fileTransformer");
|
||||
const AppFileWalker_1 = require("./AppFileWalker");
|
||||
const NodeModuleCopyHelper_1 = require("./NodeModuleCopyHelper");
|
||||
const BOWER_COMPONENTS_PATTERN = `${path.sep}bower_components${path.sep}`;
|
||||
/** @internal */
|
||||
exports.ELECTRON_COMPILE_SHIM_FILENAME = "__shim.js";
|
||||
function getDestinationPath(file, fileSet) {
|
||||
if (file === fileSet.src) {
|
||||
return fileSet.destination;
|
||||
}
|
||||
const src = fileSet.src;
|
||||
const dest = fileSet.destination;
|
||||
// get node_modules path relative to src and then append to dest
|
||||
if (file.startsWith(src)) {
|
||||
return path.join(dest, path.relative(src, file));
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
async function copyAppFiles(fileSet, packager, transformer) {
|
||||
const metadata = fileSet.metadata;
|
||||
// search auto unpacked dir
|
||||
const taskManager = new builder_util_1.AsyncTaskManager(packager.cancellationToken);
|
||||
const createdParentDirs = new Set();
|
||||
const fileCopier = new builder_util_1.FileCopier(file => {
|
||||
// https://github.com/electron-userland/electron-builder/issues/3038
|
||||
return !((0, unpackDetector_1.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, promises_1.readlink)(sourceFile) });
|
||||
continue;
|
||||
}
|
||||
const fileParent = path.dirname(destinationFile);
|
||||
if (!createdParentDirs.has(fileParent)) {
|
||||
createdParentDirs.add(fileParent);
|
||||
await (0, promises_1.mkdir)(fileParent, { recursive: true });
|
||||
}
|
||||
taskManager.addTask(fileCopier.copy(sourceFile, destinationFile, stat));
|
||||
if (taskManager.tasks.length > builder_util_1.MAX_FILE_REQUESTS) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
}
|
||||
if (taskManager.tasks.length > 0) {
|
||||
await taskManager.awaitTasks();
|
||||
}
|
||||
if (links.length > 0) {
|
||||
await bluebird_lst_1.default.map(links, it => (0, fs_extra_1.ensureSymlink)(it.link, it.file), builder_util_1.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 bluebird_lst_1.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;
|
||||
}, builder_util_1.CONCURRENCY);
|
||||
}
|
||||
async function computeFileSets(matchers, transformer, platformPackager, isElectronCompile) {
|
||||
const fileSets = [];
|
||||
const packager = platformPackager.info;
|
||||
for (const matcher of matchers) {
|
||||
const fileWalker = new AppFileWalker_1.AppFileWalker(matcher, packager);
|
||||
const fromStat = await (0, builder_util_1.statOrNull)(matcher.from);
|
||||
if (fromStat == null) {
|
||||
builder_util_1.log.debug({ directory: matcher.from, reason: "doesn't exist" }, `skipped copying`);
|
||||
continue;
|
||||
}
|
||||
const files = await (0, builder_util_1.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_1.excludedExts.split(",").map(it => `.${it}`));
|
||||
if (platformPackager.config.includePdb !== true) {
|
||||
result.push(".pdb");
|
||||
}
|
||||
if (platformPackager.platform !== core_1.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;
|
||||
const NODE_MODULES = "node_modules";
|
||||
const getRealSource = (name, source) => {
|
||||
let parentDir = path.dirname(source);
|
||||
const scopeDepth = name.split("/").length;
|
||||
// get the parent dir of the package, input: /root/path/node_modules/@electron/remote, output: /root/path/node_modules
|
||||
for (let i = 0; i < scopeDepth - 1; i++) {
|
||||
parentDir = path.dirname(parentDir);
|
||||
}
|
||||
// for the local node modules which is not in node modules
|
||||
if (!parentDir.endsWith(path.sep + NODE_MODULES)) {
|
||||
return parentDir;
|
||||
}
|
||||
// use main matcher patterns,return parent dir of the node_modules, so user can exclude some files !node_modules/xxxx
|
||||
return path.dirname(parentDir);
|
||||
};
|
||||
const collectNodeModules = async (dep, realSource, destination) => {
|
||||
const source = dep.dir;
|
||||
const matcher = new fileMatcher_1.FileMatcher(realSource, destination, mainMatcher.macroExpander, mainMatcher.patterns);
|
||||
const copier = new NodeModuleCopyHelper_1.NodeModuleCopyHelper(matcher, platformPackager.info);
|
||||
const files = await copier.collectNodeModules(dep, nodeModuleExcludedExts);
|
||||
result[index++] = validateFileSet({ src: source, destination, files, metadata: copier.metadata });
|
||||
if (dep.conflictDependency) {
|
||||
for (const c of dep.conflictDependency) {
|
||||
await collectNodeModules(c, realSource, path.join(destination, NODE_MODULES, c.name));
|
||||
}
|
||||
}
|
||||
};
|
||||
for (const dep of deps) {
|
||||
const destination = path.join(mainMatcher.to, NODE_MODULES, dep.name);
|
||||
const realSource = getRealSource(dep.name, dep.dir);
|
||||
await collectNodeModules(dep, realSource, destination);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
async function compileUsingElectronCompile(mainFileSet, packager) {
|
||||
builder_util_1.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, promises_1.mkdir)(cacheDir, { recursive: true });
|
||||
const compilerHost = await (0, fileTransformer_1.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 bluebird_lst_1.default.map(mainFileSet.files, file => {
|
||||
if (file.includes(fileTransformer_1.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);
|
||||
}, builder_util_1.CONCURRENCY);
|
||||
await compilerHost.saveConfiguration();
|
||||
const metadata = new Map();
|
||||
const cacheFiles = await (0, builder_util_1.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}${exports.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 };
|
||||
}
|
||||
//# sourceMappingURL=appFileCopier.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/appFileCopier.js.map
generated
vendored
Normal file
1
desktop-operator/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
desktop-operator/node_modules/app-builder-lib/out/util/bundledTool.d.ts
generated
vendored
Normal file
6
desktop-operator/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;
|
||||
19
desktop-operator/node_modules/app-builder-lib/out/util/bundledTool.js
generated
vendored
Normal file
19
desktop-operator/node_modules/app-builder-lib/out/util/bundledTool.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"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),
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=bundledTool.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/bundledTool.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/bundledTool.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bundledTool.js","sourceRoot":"","sources":["../../src/util/bundledTool.ts"],"names":[],"mappings":";;AAKA,gCAMC;AAED,wCAMC;AAdD,SAAgB,UAAU,CAAC,QAAmC,EAAE,SAAwB;IACtF,MAAM,cAAc,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC1D,OAAO,SAAS;SACb,MAAM,CAAC,cAAc,CAAC;SACtB,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SAC3B,IAAI,CAAC,GAAG,CAAC,CAAA;AACd,CAAC;AAED,SAAgB,cAAc,CAAC,OAAsB;IACnD,uCAAuC;IACvC,OAAO;QACL,GAAG,OAAO,CAAC,GAAG;QACd,iBAAiB,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC;KACtE,CAAA;AACH,CAAC","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\n .concat(parsedOldValue)\n .filter(it => it.length > 0)\n .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}\n"]}
|
||||
18
desktop-operator/node_modules/app-builder-lib/out/util/cacheManager.d.ts
generated
vendored
Normal file
18
desktop-operator/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>;
|
||||
71
desktop-operator/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
Normal file
71
desktop-operator/node_modules/app-builder-lib/out/util/cacheManager.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.BuildCacheManager = void 0;
|
||||
exports.digest = digest;
|
||||
const bluebird_lst_1 = require("bluebird-lst");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const promises_1 = require("fs/promises");
|
||||
const path = require("path");
|
||||
class BuildCacheManager {
|
||||
constructor(outDir, executableFile, arch) {
|
||||
this.executableFile = executableFile;
|
||||
this.cacheInfo = null;
|
||||
this.newDigest = null;
|
||||
this.cacheDir = path.join(outDir, ".cache", builder_util_1.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, builder_util_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(this.cacheInfoFile));
|
||||
const oldDigest = this.cacheInfo == null ? null : this.cacheInfo.executableDigest;
|
||||
if (oldDigest !== digest) {
|
||||
builder_util_1.log.debug({ oldDigest, newDigest: digest }, "no valid cached executable found");
|
||||
return false;
|
||||
}
|
||||
builder_util_1.log.debug({ cacheFile: this.cacheFile, file: this.executableFile }, `copying cached executable`);
|
||||
try {
|
||||
await (0, builder_util_1.copyFile)(this.cacheFile, this.executableFile, false);
|
||||
return true;
|
||||
}
|
||||
catch (e) {
|
||||
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
||||
builder_util_1.log.debug({ error: e.code }, "copy cached executable failed");
|
||||
}
|
||||
else {
|
||||
builder_util_1.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, promises_1.mkdir)(this.cacheDir, { recursive: true });
|
||||
await Promise.all([(0, fs_extra_1.writeJson)(this.cacheInfoFile, this.cacheInfo), (0, builder_util_1.copyFile)(this.executableFile, this.cacheFile, false)]);
|
||||
}
|
||||
catch (e) {
|
||||
builder_util_1.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 bluebird_lst_1.default.map(files, it => (0, promises_1.readFile)(it))) {
|
||||
hash.update(content);
|
||||
}
|
||||
hash.update(BuildCacheManager.VERSION);
|
||||
return hash.digest("base64");
|
||||
}
|
||||
//# sourceMappingURL=cacheManager.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/cacheManager.js.map
generated
vendored
Normal file
1
desktop-operator/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
13
desktop-operator/node_modules/app-builder-lib/out/util/config/config.d.ts
generated
vendored
Normal file
13
desktop-operator/node_modules/app-builder-lib/out/util/config/config.d.ts
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
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>;
|
||||
/**
|
||||
* `doMergeConfigs` takes configs in the order you would pass them to
|
||||
* Object.assign as sources.
|
||||
*/
|
||||
export declare function doMergeConfigs(configs: Configuration[]): Configuration;
|
||||
export declare function validateConfiguration(config: Configuration, debugLogger: DebugLogger): Promise<void>;
|
||||
export declare function computeDefaultAppDirectory(projectDir: string, userAppDir: string | null | undefined): Promise<string>;
|
||||
256
desktop-operator/node_modules/app-builder-lib/out/util/config/config.js
generated
vendored
Normal file
256
desktop-operator/node_modules/app-builder-lib/out/util/config/config.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getConfig = getConfig;
|
||||
exports.doMergeConfigs = doMergeConfigs;
|
||||
exports.validateConfiguration = validateConfiguration;
|
||||
exports.computeDefaultAppDirectory = computeDefaultAppDirectory;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const path = require("path");
|
||||
const load_1 = require("./load");
|
||||
const rectCra_1 = require("../../presets/rectCra");
|
||||
const version_1 = require("../../version");
|
||||
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, builder_util_1.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 lazy_val_1.Lazy(() => (0, load_1.orNullIfFileNotExist)((0, fs_extra_1.readJson)(path.join(projectDir, "package.json"))))) {
|
||||
const configRequest = { packageKey: "build", configFilename: "electron-builder", projectDir, packageMetadata };
|
||||
const configAndEffectiveFile = await (0, load_1.getConfig)(configRequest, configPath);
|
||||
const config = configAndEffectiveFile == null ? {} : configAndEffectiveFile.result;
|
||||
if (configFromOptions != null) {
|
||||
mergePublish(config, configFromOptions);
|
||||
}
|
||||
if (configAndEffectiveFile != null) {
|
||||
builder_util_1.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}`;
|
||||
}
|
||||
}
|
||||
const parentConfigs = await loadParentConfigsRecursively(config.extends, async (configExtend) => {
|
||||
if (configExtend === "react-cra") {
|
||||
const result = await (0, rectCra_1.reactCra)(projectDir);
|
||||
builder_util_1.log.info({ preset: configExtend }, "loaded parent configuration");
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
const { configFile, result } = await (0, load_1.loadParentConfig)(configRequest, configExtend);
|
||||
builder_util_1.log.info({ file: configFile }, "loaded parent configuration");
|
||||
return result;
|
||||
}
|
||||
});
|
||||
return doMergeConfigs([...parentConfigs, config]);
|
||||
}
|
||||
function asArray(value) {
|
||||
return Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
|
||||
}
|
||||
async function loadParentConfigsRecursively(configExtends, loader) {
|
||||
const configs = [];
|
||||
for (const configExtend of asArray(configExtends)) {
|
||||
const result = await loader(configExtend);
|
||||
const parentConfigs = await loadParentConfigsRecursively(result.extends, loader);
|
||||
configs.push(...parentConfigs, result);
|
||||
}
|
||||
return configs;
|
||||
}
|
||||
// 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 isSimilarFileSet(value, other) {
|
||||
return value.from === other.from && value.to === other.to;
|
||||
}
|
||||
function mergeFilters(value, other) {
|
||||
return asArray(value).concat(asArray(other));
|
||||
}
|
||||
function mergeFileSets(lists) {
|
||||
const result = [];
|
||||
for (const list of lists) {
|
||||
for (const item of list) {
|
||||
const existingItem = result.find(i => isSimilarFileSet(i, item));
|
||||
if (existingItem) {
|
||||
existingItem.filter = mergeFilters(item.filter, existingItem.filter);
|
||||
}
|
||||
else {
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* `doMergeConfigs` takes configs in the order you would pass them to
|
||||
* Object.assign as sources.
|
||||
*/
|
||||
function doMergeConfigs(configs) {
|
||||
for (const config of configs) {
|
||||
normalizeFiles(config, "files");
|
||||
normalizeFiles(config, "extraFiles");
|
||||
normalizeFiles(config, "extraResources");
|
||||
}
|
||||
const result = (0, builder_util_1.deepAssign)(getDefaultConfig(), ...configs);
|
||||
// `deepAssign` prioritises latter configs, while `mergeFilesSets` prioritises
|
||||
// former configs, so we have to reverse the order, because latter configs
|
||||
// must have higher priority.
|
||||
configs = configs.slice().reverse();
|
||||
result.files = mergeFileSets(configs.map(config => { var _a; return ((_a = config.files) !== null && _a !== void 0 ? _a : []); }));
|
||||
return result;
|
||||
}
|
||||
function getDefaultConfig() {
|
||||
return {
|
||||
directories: {
|
||||
output: "dist",
|
||||
buildResources: "build",
|
||||
},
|
||||
};
|
||||
}
|
||||
const schemeDataPromise = new lazy_val_1.Lazy(() => (0, fs_extra_1.readJson)(path.join(__dirname, "..", "..", "..", "scheme.json")));
|
||||
async function validateConfiguration(config, debugLogger) {
|
||||
const extraMetadata = config.extraMetadata;
|
||||
if (extraMetadata != null) {
|
||||
if (extraMetadata.build != null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`--em.build is deprecated, please specify as -c"`);
|
||||
}
|
||||
if (extraMetadata.directories != null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`--em.directories is deprecated, please specify as -c.directories"`);
|
||||
}
|
||||
}
|
||||
const oldConfig = config;
|
||||
if (oldConfig.npmSkipBuildFromSource === false) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`npmSkipBuildFromSource is deprecated, please use buildDependenciesFromSource"`);
|
||||
}
|
||||
if (oldConfig.appImage != null && oldConfig.appImage.systemIntegration != null) {
|
||||
throw new builder_util_1.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 ${version_1.PACKAGE_VERSION}`,
|
||||
postFormatter: (formattedError, error) => {
|
||||
if (debugLogger.isEnabled) {
|
||||
debugLogger.add("invalidConfig", (0, builder_util_1.safeStringifyJson)(error));
|
||||
}
|
||||
const site = "https://www.electron.build";
|
||||
let url = `${site}/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}/${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, builder_util_1.statOrNull)(absolutePath);
|
||||
if (stat == null) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Application directory ${userAppDir} doesn't exist`);
|
||||
}
|
||||
else if (!stat.isDirectory()) {
|
||||
throw new builder_util_1.InvalidConfigurationError(`Application directory ${userAppDir} is not a directory`);
|
||||
}
|
||||
else if (projectDir === absolutePath) {
|
||||
builder_util_1.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, builder_util_1.statOrNull)(packageJson);
|
||||
if (stat != null && stat.isFile()) {
|
||||
return absolutePath;
|
||||
}
|
||||
}
|
||||
return projectDir;
|
||||
}
|
||||
//# sourceMappingURL=config.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/config/config.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/config/config.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
desktop-operator/node_modules/app-builder-lib/out/util/config/load.d.ts
generated
vendored
Normal file
21
desktop-operator/node_modules/app-builder-lib/out/util/config/load.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
import { DotenvParseInput } from "dotenv-expand";
|
||||
export interface ReadConfigResult<T> {
|
||||
readonly result: T;
|
||||
readonly configFile: string | null;
|
||||
}
|
||||
export declare function findAndReadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function orNullIfFileNotExist<T>(promise: Promise<T>): Promise<T | null>;
|
||||
export declare function orIfFileNotExist<T>(promise: Promise<T>, fallbackValue: T): Promise<T>;
|
||||
export interface ReadConfigRequest {
|
||||
packageKey: string;
|
||||
configFilename: string;
|
||||
projectDir: string;
|
||||
packageMetadata: Lazy<{
|
||||
[key: string]: any;
|
||||
} | null> | null;
|
||||
}
|
||||
export declare function loadConfig<T>(request: ReadConfigRequest): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function getConfig<T>(request: ReadConfigRequest, configPath?: string | null): Promise<ReadConfigResult<T> | null>;
|
||||
export declare function loadParentConfig<T>(request: ReadConfigRequest, spec: string): Promise<ReadConfigResult<T>>;
|
||||
export declare function loadEnv(envFile: string): Promise<DotenvParseInput | null>;
|
||||
128
desktop-operator/node_modules/app-builder-lib/out/util/config/load.js
generated
vendored
Normal file
128
desktop-operator/node_modules/app-builder-lib/out/util/config/load.js
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.findAndReadConfig = findAndReadConfig;
|
||||
exports.orNullIfFileNotExist = orNullIfFileNotExist;
|
||||
exports.orIfFileNotExist = orIfFileNotExist;
|
||||
exports.loadConfig = loadConfig;
|
||||
exports.getConfig = getConfig;
|
||||
exports.loadParentConfig = loadParentConfig;
|
||||
exports.loadEnv = loadEnv;
|
||||
const fs_1 = require("fs");
|
||||
const js_yaml_1 = require("js-yaml");
|
||||
const path = require("path");
|
||||
const dotenv_1 = require("dotenv");
|
||||
const config_file_ts_1 = require("config-file-ts");
|
||||
const dotenv_expand_1 = require("dotenv-expand");
|
||||
const resolve_1 = require("../resolve");
|
||||
const builder_util_1 = require("builder-util");
|
||||
async function readConfig(configFile, request) {
|
||||
const data = await fs_1.promises.readFile(configFile, "utf8");
|
||||
let result;
|
||||
if (configFile.endsWith(".json5") || configFile.endsWith(".json")) {
|
||||
result = require("json5").parse(data);
|
||||
}
|
||||
else if (configFile.endsWith(".js") || configFile.endsWith(".cjs") || configFile.endsWith(".mjs")) {
|
||||
const json = await orNullIfFileNotExist(fs_1.promises.readFile(path.join(process.cwd(), "package.json"), "utf8"));
|
||||
const moduleType = json === null ? null : JSON.parse(json).type;
|
||||
result = await (0, resolve_1.resolveModule)(moduleType, configFile);
|
||||
if (result.default != null) {
|
||||
result = result.default;
|
||||
}
|
||||
if (typeof result === "function") {
|
||||
result = result(request);
|
||||
}
|
||||
result = await Promise.resolve(result);
|
||||
}
|
||||
else if (configFile.endsWith(".ts")) {
|
||||
result = (0, config_file_ts_1.loadTsConfig)(configFile);
|
||||
if (typeof result === "function") {
|
||||
result = result(request);
|
||||
}
|
||||
result = await Promise.resolve(result);
|
||||
}
|
||||
else if (configFile.endsWith(".toml")) {
|
||||
result = require("toml").parse(data);
|
||||
}
|
||||
else {
|
||||
result = (0, js_yaml_1.load)(data);
|
||||
}
|
||||
return { result, configFile };
|
||||
}
|
||||
async function findAndReadConfig(request) {
|
||||
const prefix = request.configFilename;
|
||||
for (const configFile of [`${prefix}.yml`, `${prefix}.yaml`, `${prefix}.json`, `${prefix}.json5`, `${prefix}.toml`, `${prefix}.js`, `${prefix}.cjs`, `${prefix}.ts`]) {
|
||||
const data = await orNullIfFileNotExist(readConfig(path.join(request.projectDir, configFile), request));
|
||||
if (data != null) {
|
||||
return data;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function orNullIfFileNotExist(promise) {
|
||||
return orIfFileNotExist(promise, null);
|
||||
}
|
||||
function orIfFileNotExist(promise, fallbackValue) {
|
||||
return promise.catch(e => {
|
||||
if (e.code === "ENOENT" || e.code === "ENOTDIR") {
|
||||
return fallbackValue;
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
}
|
||||
async function loadConfig(request) {
|
||||
let packageMetadata = request.packageMetadata == null ? null : await request.packageMetadata.value;
|
||||
if (packageMetadata == null) {
|
||||
const json = await orNullIfFileNotExist(fs_1.promises.readFile(path.join(request.projectDir, "package.json"), "utf8"));
|
||||
packageMetadata = json == null ? null : JSON.parse(json);
|
||||
}
|
||||
const data = packageMetadata == null ? null : packageMetadata[request.packageKey];
|
||||
return data == null ? findAndReadConfig(request) : { result: data, configFile: null };
|
||||
}
|
||||
function getConfig(request, configPath) {
|
||||
if (configPath == null) {
|
||||
return loadConfig(request);
|
||||
}
|
||||
else {
|
||||
return readConfig(path.resolve(request.projectDir, configPath), request);
|
||||
}
|
||||
}
|
||||
async function loadParentConfig(request, spec) {
|
||||
let isFileSpec;
|
||||
if (spec.startsWith("file:")) {
|
||||
spec = spec.substring("file:".length);
|
||||
isFileSpec = true;
|
||||
}
|
||||
let parentConfig = await orNullIfFileNotExist(readConfig(path.resolve(request.projectDir, spec), request));
|
||||
if (parentConfig == null && isFileSpec !== true) {
|
||||
let resolved = null;
|
||||
try {
|
||||
resolved = require.resolve(spec);
|
||||
}
|
||||
catch (_e) {
|
||||
// ignore
|
||||
}
|
||||
if (resolved != null) {
|
||||
parentConfig = await readConfig(resolved, request);
|
||||
}
|
||||
}
|
||||
if (parentConfig == null) {
|
||||
throw new Error(`Cannot find parent config file: ${spec}`);
|
||||
}
|
||||
return parentConfig;
|
||||
}
|
||||
async function loadEnv(envFile) {
|
||||
const data = await orNullIfFileNotExist(fs_1.promises.readFile(envFile, "utf8"));
|
||||
if (data == null) {
|
||||
return null;
|
||||
}
|
||||
const parsed = (0, dotenv_1.parse)(data);
|
||||
builder_util_1.log.info({ envFile }, "injecting environment");
|
||||
Object.entries(parsed).forEach(([key, value]) => {
|
||||
if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
|
||||
process.env[key] = value;
|
||||
}
|
||||
});
|
||||
(0, dotenv_expand_1.expand)({ parsed });
|
||||
return parsed;
|
||||
}
|
||||
//# sourceMappingURL=load.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/config/load.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/config/load.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
desktop-operator/node_modules/app-builder-lib/out/util/filename.d.ts
generated
vendored
Normal file
2
desktop-operator/node_modules/app-builder-lib/out/util/filename.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function sanitizeFileName(s: string, normalizeNfd?: boolean): string;
|
||||
export declare function getCompleteExtname(filename: string): string;
|
||||
39
desktop-operator/node_modules/app-builder-lib/out/util/filename.js
generated
vendored
Normal file
39
desktop-operator/node_modules/app-builder-lib/out/util/filename.js
generated
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.sanitizeFileName = sanitizeFileName;
|
||||
exports.getCompleteExtname = getCompleteExtname;
|
||||
// @ts-ignore
|
||||
const _sanitizeFileName = require("sanitize-filename");
|
||||
const path = require("path");
|
||||
function sanitizeFileName(s, normalizeNfd = false) {
|
||||
const sanitized = _sanitizeFileName(s);
|
||||
return normalizeNfd ? sanitized.normalize("NFD") : sanitized;
|
||||
}
|
||||
// Get the filetype from a filename. Returns a string of one or more file extensions,
|
||||
// e.g. .zip, .dmg, .tar.gz, .tar.bz2, .exe.blockmap. We'd normally use `path.extname()`,
|
||||
// but it doesn't support multiple extensions, e.g. Foo-1.0.0.dmg.blockmap should be
|
||||
// .dmg.blockmap, not .blockmap.
|
||||
function getCompleteExtname(filename) {
|
||||
let extname = path.extname(filename);
|
||||
switch (extname) {
|
||||
// Append leading extension for blockmap filetype
|
||||
case ".blockmap": {
|
||||
extname = path.extname(filename.replace(extname, "")) + extname;
|
||||
break;
|
||||
}
|
||||
// Append leading extension for known compressed tar formats
|
||||
case ".bz2":
|
||||
case ".gz":
|
||||
case ".lz":
|
||||
case ".xz":
|
||||
case ".7z": {
|
||||
const ext = path.extname(filename.replace(extname, ""));
|
||||
if (ext === ".tar") {
|
||||
extname = ext + extname;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return extname;
|
||||
}
|
||||
//# sourceMappingURL=filename.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/filename.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/filename.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filename.js","sourceRoot":"","sources":["../../src/util/filename.ts"],"names":[],"mappings":";;AAIA,4CAGC;AAMD,gDA0BC;AAvCD,aAAa;AACb,uDAAsD;AACtD,6BAA4B;AAE5B,SAAgB,gBAAgB,CAAC,CAAS,EAAE,YAAY,GAAG,KAAK;IAC9D,MAAM,SAAS,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;IACtC,OAAO,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC9D,CAAC;AAED,qFAAqF;AACrF,yFAAyF;AACzF,oFAAoF;AACpF,gCAAgC;AAChC,SAAgB,kBAAkB,CAAC,QAAgB;IACjD,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAA;IAEpC,QAAQ,OAAO,EAAE,CAAC;QAChB,iDAAiD;QACjD,KAAK,WAAW,CAAC,CAAC,CAAC;YACjB,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,GAAG,OAAO,CAAA;YAE/D,MAAK;QACP,CAAC;QACD,4DAA4D;QAC5D,KAAK,MAAM,CAAC;QACZ,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC;QACX,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;YACvD,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,OAAO,GAAG,GAAG,GAAG,OAAO,CAAA;YACzB,CAAC;YAED,MAAK;QACP,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["// @ts-ignore\nimport * as _sanitizeFileName from \"sanitize-filename\"\nimport * as path from \"path\"\n\nexport function sanitizeFileName(s: string, normalizeNfd = false): string {\n const sanitized = _sanitizeFileName(s)\n return normalizeNfd ? sanitized.normalize(\"NFD\") : sanitized\n}\n\n// Get the filetype from a filename. Returns a string of one or more file extensions,\n// e.g. .zip, .dmg, .tar.gz, .tar.bz2, .exe.blockmap. We'd normally use `path.extname()`,\n// but it doesn't support multiple extensions, e.g. Foo-1.0.0.dmg.blockmap should be\n// .dmg.blockmap, not .blockmap.\nexport function getCompleteExtname(filename: string): string {\n let extname = path.extname(filename)\n\n switch (extname) {\n // Append leading extension for blockmap filetype\n case \".blockmap\": {\n extname = path.extname(filename.replace(extname, \"\")) + extname\n\n break\n }\n // Append leading extension for known compressed tar formats\n case \".bz2\":\n case \".gz\":\n case \".lz\":\n case \".xz\":\n case \".7z\": {\n const ext = path.extname(filename.replace(extname, \"\"))\n if (ext === \".tar\") {\n extname = ext + extname\n }\n\n break\n }\n }\n\n return extname\n}\n"]}
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/filter.d.ts
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/filter.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
71
desktop-operator/node_modules/app-builder-lib/out/util/filter.js
generated
vendored
Normal file
71
desktop-operator/node_modules/app-builder-lib/out/util/filter.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hasMagic = hasMagic;
|
||||
exports.createFilter = createFilter;
|
||||
const path = require("path");
|
||||
const fileTransformer_1 = require("../fileTransformer");
|
||||
/** @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_1.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;
|
||||
}
|
||||
//# sourceMappingURL=filter.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/filter.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/filter.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
desktop-operator/node_modules/app-builder-lib/out/util/flags.d.ts
generated
vendored
Normal file
3
desktop-operator/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;
|
||||
16
desktop-operator/node_modules/app-builder-lib/out/util/flags.js
generated
vendored
Normal file
16
desktop-operator/node_modules/app-builder-lib/out/util/flags.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isUseSystemSigncode = isUseSystemSigncode;
|
||||
exports.isBuildCacheEnabled = isBuildCacheEnabled;
|
||||
exports.isAutoDiscoveryCodeSignIdentity = isAutoDiscoveryCodeSignIdentity;
|
||||
const builder_util_1 = require("builder-util");
|
||||
function isUseSystemSigncode() {
|
||||
return (0, builder_util_1.isEnvTrue)(process.env.USE_SYSTEM_SIGNCODE);
|
||||
}
|
||||
function isBuildCacheEnabled() {
|
||||
return !(0, builder_util_1.isEnvTrue)(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE);
|
||||
}
|
||||
function isAutoDiscoveryCodeSignIdentity() {
|
||||
return process.env.CSC_IDENTITY_AUTO_DISCOVERY !== "false";
|
||||
}
|
||||
//# sourceMappingURL=flags.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/flags.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/flags.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/util/flags.ts"],"names":[],"mappings":";;AAEA,kDAEC;AAED,kDAEC;AAED,0EAEC;AAZD,+CAAwC;AAExC,SAAgB,mBAAmB;IACjC,OAAO,IAAA,wBAAS,EAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;AACnD,CAAC;AAED,SAAgB,mBAAmB;IACjC,OAAO,CAAC,IAAA,wBAAS,EAAC,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAA;AACrE,CAAC;AAED,SAAgB,+BAA+B;IAC7C,OAAO,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,OAAO,CAAA;AAC5D,CAAC","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}\n"]}
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/hash.d.ts
generated
vendored
Normal file
1
desktop-operator/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>;
|
||||
19
desktop-operator/node_modules/app-builder-lib/out/util/hash.js
generated
vendored
Normal file
19
desktop-operator/node_modules/app-builder-lib/out/util/hash.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hashFile = hashFile;
|
||||
const crypto_1 = require("crypto");
|
||||
const fs_1 = require("fs");
|
||||
function hashFile(file, algorithm = "sha512", encoding = "base64", options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const hash = (0, crypto_1.createHash)(algorithm);
|
||||
hash.on("error", reject).setEncoding(encoding);
|
||||
(0, fs_1.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 });
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=hash.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/hash.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/hash.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hash.js","sourceRoot":"","sources":["../../src/util/hash.ts"],"names":[],"mappings":";;AAGA,4BAaC;AAhBD,mCAAmC;AACnC,2BAAqC;AAErC,SAAgB,QAAQ,CAAC,IAAY,EAAE,SAAS,GAAG,QAAQ,EAAE,WAA6B,QAAQ,EAAE,OAAa;IAC/G,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC7C,MAAM,IAAI,GAAG,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAA;QAClC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAE9C,IAAA,qBAAgB,EAAC,IAAI,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,CAAC,+CAA+C,EAAE,CAAC;aAC/G,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;aACnB,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;YACd,IAAI,CAAC,GAAG,EAAE,CAAA;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,EAAY,CAAC,CAAA;QAChC,CAAC,CAAC;aACD,IAAI,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { createHash } from \"crypto\"\nimport { createReadStream } from \"fs\"\n\nexport function hashFile(file: string, algorithm = \"sha512\", encoding: \"base64\" | \"hex\" = \"base64\", options?: any) {\n return new Promise<string>((resolve, reject) => {\n const hash = createHash(algorithm)\n hash.on(\"error\", reject).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}\n"]}
|
||||
189
desktop-operator/node_modules/app-builder-lib/out/util/langs.d.ts
generated
vendored
Normal file
189
desktop-operator/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;
|
||||
};
|
||||
436
desktop-operator/node_modules/app-builder-lib/out/util/langs.js
generated
vendored
Normal file
436
desktop-operator/node_modules/app-builder-lib/out/util/langs.js
generated
vendored
Normal file
@@ -0,0 +1,436 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.langIdToName = exports.lcid = exports.bundledLanguages = void 0;
|
||||
exports.toLangWithRegion = toLangWithRegion;
|
||||
exports.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"
|
||||
const langToLangWithRegion = new Map();
|
||||
for (const id of exports.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;
|
||||
}
|
||||
exports.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.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",
|
||||
};
|
||||
//# sourceMappingURL=langs.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/langs.js.map
generated
vendored
Normal file
1
desktop-operator/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
desktop-operator/node_modules/app-builder-lib/out/util/license.d.ts
generated
vendored
Normal file
15
desktop-operator/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;
|
||||
}
|
||||
47
desktop-operator/node_modules/app-builder-lib/out/util/license.js
generated
vendored
Normal file
47
desktop-operator/node_modules/app-builder-lib/out/util/license.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getLicenseAssets = getLicenseAssets;
|
||||
exports.getNotLocalizedLicenseFile = getNotLocalizedLicenseFile;
|
||||
exports.getLicenseFiles = getLicenseFiles;
|
||||
const path = require("path");
|
||||
const langs_1 = require("./langs");
|
||||
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 = /_([^.]+)\./.exec(file)[1];
|
||||
let langWithRegion;
|
||||
if (lang.includes("_")) {
|
||||
langWithRegion = lang;
|
||||
lang = langWithRegion.substring(0, lang.indexOf("_"));
|
||||
}
|
||||
else {
|
||||
lang = lang.toLowerCase();
|
||||
langWithRegion = (0, langs_1.toLangWithRegion)(lang);
|
||||
}
|
||||
return { file: path.join(packager.buildResourcesDir, file), lang, langWithRegion, langName: langs_1.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") || name.endsWith(".html"));
|
||||
}), packager);
|
||||
}
|
||||
//# sourceMappingURL=license.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/license.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/license.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"license.js","sourceRoot":"","sources":["../../src/util/license.ts"],"names":[],"mappings":";;AAIA,4CAmBC;AAED,gEAgBC;AAED,0CAQC;AAnDD,6BAA4B;AAC5B,mCAAwD;AAGxD,SAAgB,gBAAgB,CAAC,SAAwB,EAAE,QAA+B;IACxF,OAAO,SAAS;SACb,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QACb,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QACtC,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;QACtC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAA;IACjD,CAAC,CAAC;SACD,GAAG,CAAC,IAAI,CAAC,EAAE;QACV,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC,CAAA;QACtC,IAAI,cAAc,CAAA;QAClB,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACvB,cAAc,GAAG,IAAI,CAAA;YACrB,IAAI,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;QACvD,CAAC;aAAM,CAAC;YACN,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;YACzB,cAAc,GAAG,IAAA,wBAAgB,EAAC,IAAI,CAAC,CAAA;QACzC,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAG,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAA;IAC3H,CAAC,CAAC,CAAA;AACN,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAC9C,MAAiC,EACjC,QAA+B,EAC/B,qBAAoC,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC;IAE1D,MAAM,aAAa,GAAkB,EAAE,CAAA;IACvC,KAAK,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,CAAC;QACvC,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACrC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,EAAE,CAAC,CAAA;YACpC,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,EAAE,CAAC,CAAA;YAClD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;YAClD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,CAAA;AAC7D,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,QAA+B;IACnE,OAAO,gBAAgB,CACrB,CAAC,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;QACxC,MAAM,IAAI,GAAG,EAAE,CAAC,WAAW,EAAE,CAAA;QAC7B,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IAChJ,CAAC,CAAC,EACF,QAAQ,CACT,CAAA;AACH,CAAC","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\n .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 = /_([^.]+)\\./.exec(file)![1]\n let langWithRegion\n if (lang.includes(\"_\")) {\n langWithRegion = lang\n lang = langWithRegion.substring(0, lang.indexOf(\"_\"))\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(\n custom: string | null | undefined,\n packager: PlatformPackager<any>,\n supportedExtension: Array<string> = [\"rtf\", \"txt\", \"html\"]\n): 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(\n (await packager.resourceList).filter(it => {\n const name = it.toLowerCase()\n return (name.startsWith(\"license_\") || name.startsWith(\"eula_\")) && (name.endsWith(\".rtf\") || name.endsWith(\".txt\") || name.endsWith(\".html\"))\n }),\n packager\n )\n}\n\nexport interface LicenseFile {\n file: string\n lang: string\n langWithRegion: string\n langName: string\n}\n"]}
|
||||
3
desktop-operator/node_modules/app-builder-lib/out/util/macosVersion.d.ts
generated
vendored
Normal file
3
desktop-operator/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;
|
||||
36
desktop-operator/node_modules/app-builder-lib/out/util/macosVersion.js
generated
vendored
Normal file
36
desktop-operator/node_modules/app-builder-lib/out/util/macosVersion.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isMacOsHighSierra = isMacOsHighSierra;
|
||||
exports.isMacOsSierra = isMacOsSierra;
|
||||
exports.isMacOsCatalina = isMacOsCatalina;
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const semver = require("semver");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const os_1 = require("os");
|
||||
const macOsVersion = new lazy_val_1.Lazy(async () => {
|
||||
const file = await (0, fs_extra_1.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");
|
||||
}
|
||||
builder_util_1.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_1.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_1.release)(), "19.0.0");
|
||||
}
|
||||
//# sourceMappingURL=macosVersion.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/macosVersion.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/macosVersion.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"macosVersion.js","sourceRoot":"","sources":["../../src/util/macosVersion.ts"],"names":[],"mappings":";;AAwBA,8CAGC;AAED,sCAEC;AAED,0CAEC;AAnCD,uCAAmC;AACnC,uCAA+B;AAC/B,iCAAgC;AAChC,+CAAkC;AAClC,2BAAyC;AAEzC,MAAM,YAAY,GAAG,IAAI,eAAI,CAAS,KAAK,IAAI,EAAE;IAC/C,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,kDAAkD,EAAE,MAAM,CAAC,CAAA;IACvF,MAAM,OAAO,GAAG,6DAA6D,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACxF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;IACpD,CAAC;IACD,kBAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,eAAe,CAAC,CAAA;IACnD,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAA;AAC1B,CAAC,CAAC,CAAA;AAEF,SAAS,KAAK,CAAC,OAAe;IAC5B,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAA;AACnE,CAAC;AAED,KAAK,UAAU,+BAA+B,CAAC,KAAa;IAC1D,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAA;AAC3D,CAAC;AAED,SAAgB,iBAAiB;IAC/B,qBAAqB;IACrB,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,IAAA,YAAS,GAAE,EAAE,QAAQ,CAAC,CAAA;AAC3E,CAAC;AAEM,KAAK,UAAU,aAAa;IACjC,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,MAAM,+BAA+B,CAAC,SAAS,CAAC,CAAC,CAAA;AAC5F,CAAC;AAED,SAAgB,eAAe;IAC7B,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,CAAC,GAAG,CAAC,IAAA,YAAS,GAAE,EAAE,QAAQ,CAAC,CAAA;AAC3E,CAAC","sourcesContent":["import { readFile } from \"fs-extra\"\nimport { Lazy } from \"lazy-val\"\nimport * as semver from \"semver\"\nimport { log } from \"builder-util\"\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}\n"]}
|
||||
2
desktop-operator/node_modules/app-builder-lib/out/util/macroExpander.d.ts
generated
vendored
Normal file
2
desktop-operator/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;
|
||||
61
desktop-operator/node_modules/app-builder-lib/out/util/macroExpander.js
generated
vendored
Normal file
61
desktop-operator/node_modules/app-builder-lib/out/util/macroExpander.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.expandMacro = expandMacro;
|
||||
const builder_util_1 = require("builder-util");
|
||||
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.sanitizedProductName : 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 builder_util_1.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 builder_util_1.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 builder_util_1.InvalidConfigurationError(`cannot expand pattern "${pattern}": macro ${p1} is not defined`, "ERR_ELECTRON_BUILDER_MACRO_NOT_DEFINED");
|
||||
}
|
||||
else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=macroExpander.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/macroExpander.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/macroExpander.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"macroExpander.js","sourceRoot":"","sources":["../../src/util/macroExpander.ts"],"names":[],"mappings":";;AAGA,kCA8DC;AAjED,+CAAwD;AAGxD,SAAgB,WAAW,CAAC,OAAe,EAAE,IAA+B,EAAE,OAAgB,EAAE,QAAa,EAAE,EAAE,sBAAsB,GAAG,IAAI;IAC5I,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;QACjB,OAAO,GAAG,OAAO;YACf,uDAAuD;aACtD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;YACxB,uDAAuD;aACtD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;YACxB,uDAAuD;aACtD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;YACxB,uDAAuD;aACtD,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAC5B,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC,KAAK,EAAE,EAAE,EAAU,EAAE;QACpE,QAAQ,EAAE,EAAE,CAAC;YACX,KAAK,aAAa;gBAChB,OAAO,sBAAsB,CAAC,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAA;YAEpF,KAAK,MAAM;gBACT,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;oBACjB,wCAAwC;oBACxC,OAAO,EAAE,CAAA;gBACX,CAAC;gBACD,OAAO,IAAI,CAAA;YAEb,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAA;gBACvC,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;oBACxB,MAAM,IAAI,wCAAyB,CAAC,0BAA0B,OAAO,4BAA4B,EAAE,yCAAyC,CAAC,CAAA;gBAC/I,CAAC;gBACD,OAAO,WAAW,CAAA;YACpB,CAAC;YAED,KAAK,UAAU;gBACb,OAAO,OAAO,CAAC,QAAQ,CAAA;YAEzB,KAAK,SAAS;gBACZ,OAAO,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAA;YAEpC,OAAO,CAAC,CAAC,CAAC;gBACR,IAAI,EAAE,IAAI,OAAO,EAAE,CAAC;oBAClB,OAAQ,OAAe,CAAC,EAAE,CAAC,CAAA;gBAC7B,CAAC;gBAED,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC1B,MAAM,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;oBAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;oBACrC,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;wBACrB,MAAM,IAAI,wCAAyB,CAAC,0BAA0B,OAAO,UAAU,OAAO,iBAAiB,EAAE,sCAAsC,CAAC,CAAA;oBAClJ,CAAC;oBACD,OAAO,QAAQ,CAAA;gBACjB,CAAC;gBAED,MAAM,KAAK,GAAG,KAAK,CAAC,EAAE,CAAC,CAAA;gBACvB,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;oBAClB,MAAM,IAAI,wCAAyB,CAAC,0BAA0B,OAAO,YAAY,EAAE,iBAAiB,EAAE,wCAAwC,CAAC,CAAA;gBACjJ,CAAC;qBAAM,CAAC;oBACN,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC","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.sanitizedProductName : 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 } else {\n return value\n }\n }\n }\n })\n}\n"]}
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.d.ts
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function normalizePackageData(data: any): void;
|
||||
326
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.js
generated
vendored
Normal file
326
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.js
generated
vendored
Normal file
@@ -0,0 +1,326 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.normalizePackageData = normalizePackageData;
|
||||
const semver = require("semver");
|
||||
const hosted_git_info_1 = require("hosted-git-info");
|
||||
const url = require("url");
|
||||
function normalizePackageData(data) {
|
||||
for (const it of check) {
|
||||
it(data);
|
||||
}
|
||||
}
|
||||
const depTypes = ["dependencies", "devDependencies", "optionalDependencies"];
|
||||
const check = [
|
||||
function (data) {
|
||||
if (data.repositories) {
|
||||
data.repository = data.repositories[0];
|
||||
}
|
||||
if (typeof data.repository === "string") {
|
||||
data.repository = {
|
||||
type: "git",
|
||||
url: data.repository,
|
||||
};
|
||||
}
|
||||
if (data.repository != null && data.repository.url) {
|
||||
const hosted = (0, hosted_git_info_1.fromUrl)(data.repository.url);
|
||||
if (hosted) {
|
||||
data.repository.url = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString();
|
||||
}
|
||||
}
|
||||
},
|
||||
function (data) {
|
||||
const files = data.files;
|
||||
if (files && !Array.isArray(files)) {
|
||||
delete data.files;
|
||||
}
|
||||
else if (data.files) {
|
||||
data.files = data.files.filter(function (file) {
|
||||
return !(!file || typeof file !== "string");
|
||||
});
|
||||
}
|
||||
},
|
||||
function (data) {
|
||||
if (!data.bin) {
|
||||
return;
|
||||
}
|
||||
if (typeof data.bin === "string") {
|
||||
const b = {};
|
||||
const match = data.name.match(/^@[^/]+[/](.*)$/);
|
||||
if (match) {
|
||||
b[match[1]] = data.bin;
|
||||
}
|
||||
else {
|
||||
b[data.name] = data.bin;
|
||||
}
|
||||
data.bin = b;
|
||||
}
|
||||
},
|
||||
function (data) {
|
||||
if (data.description && typeof data.description !== "string") {
|
||||
delete data.description;
|
||||
}
|
||||
if (data.description === undefined) {
|
||||
delete data.description;
|
||||
}
|
||||
},
|
||||
fixBundleDependenciesField,
|
||||
function fixDependencies(data) {
|
||||
objectifyDeps(data);
|
||||
fixBundleDependenciesField(data);
|
||||
for (const deps of ["dependencies", "devDependencies", "optionalDependencies"]) {
|
||||
if (!(deps in data)) {
|
||||
continue;
|
||||
}
|
||||
if (!data[deps] || typeof data[deps] !== "object") {
|
||||
delete data[deps];
|
||||
continue;
|
||||
}
|
||||
Object.keys(data[deps]).forEach(function (d) {
|
||||
const r = data[deps][d];
|
||||
if (typeof r !== "string") {
|
||||
delete data[deps][d];
|
||||
}
|
||||
const hosted = (0, hosted_git_info_1.fromUrl)(data[deps][d]);
|
||||
if (hosted) {
|
||||
data[deps][d] = hosted.toString();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
function fixBugsField(data) {
|
||||
if (!data.bugs && data.repository && data.repository.url) {
|
||||
const hosted = (0, hosted_git_info_1.fromUrl)(data.repository.url);
|
||||
if (hosted && hosted.bugs()) {
|
||||
data.bugs = { url: hosted.bugs() };
|
||||
}
|
||||
}
|
||||
else if (data.bugs) {
|
||||
const emailRe = /^.+@.*\..+$/;
|
||||
if (typeof data.bugs == "string") {
|
||||
if (emailRe.test(data.bugs)) {
|
||||
data.bugs = { email: data.bugs };
|
||||
}
|
||||
else if (url.parse(data.bugs).protocol) {
|
||||
data.bugs = { url: data.bugs };
|
||||
}
|
||||
}
|
||||
else {
|
||||
bugsTypos(data.bugs);
|
||||
const oldBugs = data.bugs;
|
||||
data.bugs = {};
|
||||
if (oldBugs.url) {
|
||||
if (typeof oldBugs.url == "string" && url.parse(oldBugs.url).protocol) {
|
||||
data.bugs.url = oldBugs.url;
|
||||
}
|
||||
}
|
||||
if (oldBugs.email) {
|
||||
if (typeof oldBugs.email == "string" && emailRe.test(oldBugs.email)) {
|
||||
data.bugs.email = oldBugs.email;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!data.bugs.email && !data.bugs.url) {
|
||||
delete data.bugs;
|
||||
}
|
||||
}
|
||||
},
|
||||
function fixModulesField(data) {
|
||||
if (data.modules) {
|
||||
delete data.modules;
|
||||
}
|
||||
},
|
||||
function fixKeywordsField(data) {
|
||||
if (typeof data.keywords === "string") {
|
||||
data.keywords = data.keywords.split(/,\s+/);
|
||||
}
|
||||
if (data.keywords && !Array.isArray(data.keywords)) {
|
||||
delete data.keywords;
|
||||
}
|
||||
else if (data.keywords) {
|
||||
data.keywords = data.keywords.filter(function (kw) {
|
||||
return !(typeof kw !== "string" || !kw);
|
||||
});
|
||||
}
|
||||
},
|
||||
function fixVersionField(data) {
|
||||
const loose = true;
|
||||
if (!data.version) {
|
||||
data.version = "";
|
||||
return true;
|
||||
}
|
||||
if (!semver.valid(data.version, loose)) {
|
||||
throw new Error(`Invalid version: "${data.version}"`);
|
||||
}
|
||||
data.version = semver.clean(data.version, loose);
|
||||
return true;
|
||||
},
|
||||
function fixPeople(data) {
|
||||
modifyPeople(data, unParsePerson);
|
||||
modifyPeople(data, parsePerson);
|
||||
},
|
||||
function fixNameField(data) {
|
||||
if (!data.name) {
|
||||
data.name = "";
|
||||
return;
|
||||
}
|
||||
if (typeof data.name !== "string") {
|
||||
throw new Error("name field must be a string.");
|
||||
}
|
||||
data.name = data.name.trim();
|
||||
ensureValidName(data.name);
|
||||
},
|
||||
function fixHomepageField(data) {
|
||||
if (!data.homepage && data.repository && data.repository.url) {
|
||||
const hosted = (0, hosted_git_info_1.fromUrl)(data.repository.url);
|
||||
if (hosted && hosted.docs()) {
|
||||
data.homepage = hosted.docs();
|
||||
}
|
||||
}
|
||||
if (!data.homepage) {
|
||||
return;
|
||||
}
|
||||
if (typeof data.homepage !== "string") {
|
||||
delete data.homepage;
|
||||
}
|
||||
if (!url.parse(data.homepage).protocol) {
|
||||
data.homepage = `https://${data.homepage}`;
|
||||
}
|
||||
return;
|
||||
},
|
||||
];
|
||||
function fixBundleDependenciesField(data) {
|
||||
const bdd = "bundledDependencies";
|
||||
const bd = "bundleDependencies";
|
||||
if (data[bdd] && !data[bd]) {
|
||||
data[bd] = data[bdd];
|
||||
delete data[bdd];
|
||||
}
|
||||
if (data[bd] && !Array.isArray(data[bd])) {
|
||||
delete data[bd];
|
||||
}
|
||||
else if (data[bd]) {
|
||||
data[bd] = data[bd].filter(function (bd) {
|
||||
if (!bd || typeof bd !== "string") {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
if (!data.dependencies) {
|
||||
data.dependencies = {};
|
||||
}
|
||||
if (!("bd" in data.dependencies)) {
|
||||
data.dependencies[bd] = "*";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
function isValidScopedPackageName(spec) {
|
||||
if (spec.charAt(0) !== "@") {
|
||||
return false;
|
||||
}
|
||||
const rest = spec.slice(1).split("/");
|
||||
if (rest.length !== 2) {
|
||||
return false;
|
||||
}
|
||||
return rest[0] !== "" && rest[1] !== "" && rest[0] != null && rest[1] != null && rest[0] === encodeURIComponent(rest[0]) && rest[1] === encodeURIComponent(rest[1]);
|
||||
}
|
||||
function isCorrectlyEncodedName(spec) {
|
||||
return !/[/@\s+%:]/.test(spec) && spec === encodeURIComponent(spec);
|
||||
}
|
||||
function ensureValidName(name) {
|
||||
if (name.charAt(0) === "." ||
|
||||
!(isValidScopedPackageName(name) || isCorrectlyEncodedName(name)) ||
|
||||
name.toLowerCase() === "node_modules" ||
|
||||
name.toLowerCase() === "favicon.ico") {
|
||||
throw new Error("Invalid name: " + JSON.stringify(name));
|
||||
}
|
||||
}
|
||||
function modifyPeople(data, fn) {
|
||||
if (data.author) {
|
||||
data.author = fn(data.author);
|
||||
}
|
||||
for (const set of ["maintainers", "contributors"]) {
|
||||
if (!Array.isArray(data[set])) {
|
||||
continue;
|
||||
}
|
||||
data[set] = data[set].map(fn);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
function unParsePerson(person) {
|
||||
if (typeof person === "string") {
|
||||
return person;
|
||||
}
|
||||
const name = person.name || "";
|
||||
const u = person.url || person.web;
|
||||
const url = u ? ` (${u})` : "";
|
||||
const e = person.email || person.mail;
|
||||
const email = e ? ` <${e}>` : "";
|
||||
return `${name}${email}${url}`;
|
||||
}
|
||||
function parsePerson(person) {
|
||||
if (typeof person !== "string") {
|
||||
return person;
|
||||
}
|
||||
const name = /^([^(<]+)/.exec(person);
|
||||
const url = /\(([^)]+)\)/.exec(person);
|
||||
const email = /<([^>]+)>/.exec(person);
|
||||
const obj = {};
|
||||
if (name && name[0].trim()) {
|
||||
obj.name = name[0].trim();
|
||||
}
|
||||
if (email) {
|
||||
obj.email = email[1];
|
||||
}
|
||||
if (url) {
|
||||
obj.url = url[1];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
function depObjectify(deps) {
|
||||
if (!deps) {
|
||||
return {};
|
||||
}
|
||||
if (typeof deps === "string") {
|
||||
deps = deps.trim().split(/[\n\r\s\t ,]+/);
|
||||
}
|
||||
if (!Array.isArray(deps)) {
|
||||
return deps;
|
||||
}
|
||||
const o = {};
|
||||
deps
|
||||
.filter(function (d) {
|
||||
return typeof d === "string";
|
||||
})
|
||||
.forEach(function (d) {
|
||||
const arr = d.trim().split(/(:?[@\s><=])/);
|
||||
const dn = arr.shift();
|
||||
let dv = arr.join("");
|
||||
dv = dv.trim();
|
||||
dv = dv.replace(/^@/, "");
|
||||
o[dn] = dv;
|
||||
});
|
||||
return o;
|
||||
}
|
||||
function objectifyDeps(data) {
|
||||
depTypes.forEach(function (type) {
|
||||
if (!data[type]) {
|
||||
return;
|
||||
}
|
||||
data[type] = depObjectify(data[type]);
|
||||
});
|
||||
}
|
||||
const typoBugs = { web: "url", name: "url" };
|
||||
function bugsTypos(bugs) {
|
||||
if (!bugs) {
|
||||
return;
|
||||
}
|
||||
Object.keys(bugs).forEach(function (k) {
|
||||
if (typoBugs[k]) {
|
||||
bugs[typoBugs[k]] = bugs[k];
|
||||
delete bugs[k];
|
||||
}
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=normalizePackageData.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/normalizePackageData.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
12
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.d.ts
generated
vendored
Normal file
12
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Lazy } from "lazy-val";
|
||||
export declare function createLazyProductionDeps<T extends boolean>(projectDir: string, excludedDependencies: Array<string> | null, flatten: T): Lazy<(T extends true ? NodeModuleInfo : NodeModuleDirInfo)[]>;
|
||||
export interface NodeModuleDirInfo {
|
||||
readonly dir: string;
|
||||
readonly deps: Array<NodeModuleInfo>;
|
||||
}
|
||||
export interface NodeModuleInfo {
|
||||
readonly name: string;
|
||||
readonly version: string;
|
||||
readonly dir: string;
|
||||
readonly conflictDependency: Array<NodeModuleInfo>;
|
||||
}
|
||||
19
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.js
generated
vendored
Normal file
19
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createLazyProductionDeps = createLazyProductionDeps;
|
||||
const lazy_val_1 = require("lazy-val");
|
||||
const appBuilder_1 = require("./appBuilder");
|
||||
function createLazyProductionDeps(projectDir, excludedDependencies, flatten) {
|
||||
return new lazy_val_1.Lazy(async () => {
|
||||
const args = ["node-dep-tree", "--dir", projectDir];
|
||||
if (flatten)
|
||||
args.push("--flatten");
|
||||
if (excludedDependencies != null) {
|
||||
for (const name of excludedDependencies) {
|
||||
args.push("--exclude-dep", name);
|
||||
}
|
||||
}
|
||||
return (0, appBuilder_1.executeAppBuilderAsJson)(args);
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=packageDependencies.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/packageDependencies.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"packageDependencies.js","sourceRoot":"","sources":["../../src/util/packageDependencies.ts"],"names":[],"mappings":";;AAGA,4DAWC;AAdD,uCAA+B;AAC/B,6CAAsD;AAEtD,SAAgB,wBAAwB,CAAoB,UAAkB,EAAE,oBAA0C,EAAE,OAAU;IACpI,OAAO,IAAI,eAAI,CAAC,KAAK,IAAI,EAAE;QACzB,MAAM,IAAI,GAAG,CAAC,eAAe,EAAE,OAAO,EAAE,UAAU,CAAC,CAAA;QACnD,IAAI,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QACnC,IAAI,oBAAoB,IAAI,IAAI,EAAE,CAAC;YACjC,KAAK,MAAM,IAAI,IAAI,oBAAoB,EAAE,CAAC;gBACxC,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAA;YAClC,CAAC;QACH,CAAC;QACD,OAAO,IAAA,oCAAuB,EAA6D,IAAI,CAAC,CAAA;IAClG,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import { Lazy } from \"lazy-val\"\nimport { executeAppBuilderAsJson } from \"./appBuilder\"\n\nexport function createLazyProductionDeps<T extends boolean>(projectDir: string, excludedDependencies: Array<string> | null, flatten: T) {\n return new Lazy(async () => {\n const args = [\"node-dep-tree\", \"--dir\", projectDir]\n if (flatten) args.push(\"--flatten\")\n if (excludedDependencies != null) {\n for (const name of excludedDependencies) {\n args.push(\"--exclude-dep\", name)\n }\n }\n return executeAppBuilderAsJson<Array<T extends true ? NodeModuleInfo : NodeModuleDirInfo>>(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 readonly version: string\n readonly dir: string\n readonly conflictDependency: Array<NodeModuleInfo>\n}\n"]}
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/packageMetadata.d.ts
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/packageMetadata.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
102
desktop-operator/node_modules/app-builder-lib/out/util/packageMetadata.js
generated
vendored
Normal file
102
desktop-operator/node_modules/app-builder-lib/out/util/packageMetadata.js
generated
vendored
Normal file
@@ -0,0 +1,102 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.readPackageJson = readPackageJson;
|
||||
exports.checkMetadata = checkMetadata;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path = require("path");
|
||||
const semver = require("semver");
|
||||
const normalizePackageData_1 = require("./normalizePackageData");
|
||||
/** @internal */
|
||||
async function readPackageJson(file) {
|
||||
const data = await (0, fs_extra_1.readJson)(file);
|
||||
await authors(file, data);
|
||||
// remove not required fields because can be used for remote build
|
||||
delete data.scripts;
|
||||
delete data.readme;
|
||||
(0, normalizePackageData_1.normalizePackageData)(data);
|
||||
return data;
|
||||
}
|
||||
async function authors(file, data) {
|
||||
if (data.contributors != null) {
|
||||
return;
|
||||
}
|
||||
let authorData;
|
||||
try {
|
||||
authorData = await (0, fs_extra_1.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, builder_util_1.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, builder_util_1.isEmptyOrSpaces)(metadata.description)) {
|
||||
builder_util_1.log.warn({ appPackageFile }, `description is missed in the package.json`);
|
||||
}
|
||||
if (metadata.author == null) {
|
||||
builder_util_1.log.warn({ appPackageFile }, `author is missed in the package.json`);
|
||||
}
|
||||
checkNotEmpty("version", metadata.version);
|
||||
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 || "@electron/rebuild" in devDependencies)) {
|
||||
builder_util_1.log.info('@electron/rebuild already used by 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 builder_util_1.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.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=packageMetadata.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/packageMetadata.js.map
generated
vendored
Normal file
1
desktop-operator/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
desktop-operator/node_modules/app-builder-lib/out/util/pathManager.d.ts
generated
vendored
Normal file
2
desktop-operator/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;
|
||||
13
desktop-operator/node_modules/app-builder-lib/out/util/pathManager.js
generated
vendored
Normal file
13
desktop-operator/node_modules/app-builder-lib/out/util/pathManager.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getTemplatePath = getTemplatePath;
|
||||
exports.getVendorPath = getVendorPath;
|
||||
const path = require("path");
|
||||
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);
|
||||
}
|
||||
//# sourceMappingURL=pathManager.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/pathManager.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/pathManager.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pathManager.js","sourceRoot":"","sources":["../../src/util/pathManager.ts"],"names":[],"mappings":";;AAIA,0CAEC;AAED,sCAEC;AAVD,6BAA4B;AAE5B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE7C,SAAgB,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;AAC3C,CAAC;AAED,SAAgB,aAAa,CAAC,IAAa;IACzC,OAAO,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;AACnF,CAAC","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}\n"]}
|
||||
2
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.d.ts
generated
vendored
Normal file
2
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
import { RebuildOptions } from "@electron/rebuild";
|
||||
export declare const rebuild: (options: RebuildOptions) => Promise<void>;
|
||||
60
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.js
generated
vendored
Normal file
60
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.rebuild = void 0;
|
||||
const cp = require("child_process");
|
||||
const path = require("path");
|
||||
const builder_util_1 = require("builder-util");
|
||||
const rebuild = async (options) => {
|
||||
var _a, _b;
|
||||
const { arch } = options;
|
||||
builder_util_1.log.info({ arch }, `installing native dependencies`);
|
||||
const child = cp.fork(path.resolve(__dirname, "remote-rebuild.js"), [JSON.stringify(options)], {
|
||||
stdio: ["pipe", "pipe", "pipe", "ipc"],
|
||||
});
|
||||
let pendingError;
|
||||
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on("data", chunk => {
|
||||
builder_util_1.log.info(chunk.toString());
|
||||
});
|
||||
(_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on("data", chunk => {
|
||||
builder_util_1.log.error(chunk.toString());
|
||||
});
|
||||
child.on("message", (message) => {
|
||||
var _a;
|
||||
const { moduleName, msg } = message;
|
||||
switch (msg) {
|
||||
case "module-found": {
|
||||
builder_util_1.log.info({ moduleName, arch }, "preparing");
|
||||
break;
|
||||
}
|
||||
case "module-done": {
|
||||
builder_util_1.log.info({ moduleName, arch }, "finished");
|
||||
break;
|
||||
}
|
||||
case "module-skip": {
|
||||
(_a = builder_util_1.log.debug) === null || _a === void 0 ? void 0 : _a.call(builder_util_1.log, { moduleName, arch }, "skipped. set ENV=electron-rebuild to determine why");
|
||||
break;
|
||||
}
|
||||
case "rebuild-error": {
|
||||
pendingError = new Error(message.err.message);
|
||||
pendingError.stack = message.err.stack;
|
||||
break;
|
||||
}
|
||||
case "rebuild-done": {
|
||||
builder_util_1.log.info("completed installing native dependencies");
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
await new Promise((resolve, reject) => {
|
||||
child.on("exit", code => {
|
||||
if (code === 0 && !pendingError) {
|
||||
resolve();
|
||||
}
|
||||
else {
|
||||
reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`));
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.rebuild = rebuild;
|
||||
//# sourceMappingURL=rebuild.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/rebuild.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/rebuild.ts"],"names":[],"mappings":";;;AAAA,oCAAmC;AACnC,6BAA4B;AAE5B,+CAAkC;AAE3B,MAAM,OAAO,GAAG,KAAK,EAAE,OAAuB,EAAiB,EAAE;;IACtE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAA;IACxB,kBAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,gCAAgC,CAAC,CAAA;IAEpD,MAAM,KAAK,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE;QAC7F,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;KACvC,CAAC,CAAA;IAEF,IAAI,YAAmB,CAAA;IAEvB,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC5B,CAAC,CAAC,CAAA;IACF,MAAA,KAAK,CAAC,MAAM,0CAAE,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;QAC/B,kBAAG,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;IAEF,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAqF,EAAE,EAAE;;QAC5G,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,OAAO,CAAA;QACnC,QAAQ,GAAG,EAAE,CAAC;YACZ,KAAK,cAAc,CAAC,CAAC,CAAC;gBACpB,kBAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,WAAW,CAAC,CAAA;gBAC3C,MAAK;YACP,CAAC;YACD,KAAK,aAAa,CAAC,CAAC,CAAC;gBACnB,kBAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,CAAC,CAAA;gBAC1C,MAAK;YACP,CAAC;YACD,KAAK,aAAa,CAAC,CAAC,CAAC;gBACnB,MAAA,kBAAG,CAAC,KAAK,mEAAG,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,oDAAoD,CAAC,CAAA;gBACvF,MAAK;YACP,CAAC;YACD,KAAK,eAAe,CAAC,CAAC,CAAC;gBACrB,YAAY,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;gBAC7C,YAAY,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAA;gBACtC,MAAK;YACP,CAAC;YACD,KAAK,cAAc,CAAC,CAAC,CAAC;gBACpB,kBAAG,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAA;gBACpD,MAAK;YACP,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC1C,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE;YACtB,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBAChC,OAAO,EAAE,CAAA;YACX,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,YAAY,IAAI,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC,CAAA;YAC/E,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AArDY,QAAA,OAAO,WAqDnB","sourcesContent":["import * as cp from \"child_process\"\nimport * as path from \"path\"\nimport { RebuildOptions } from \"@electron/rebuild\"\nimport { log } from \"builder-util\"\n\nexport const rebuild = async (options: RebuildOptions): Promise<void> => {\n const { arch } = options\n log.info({ arch }, `installing native dependencies`)\n\n const child = cp.fork(path.resolve(__dirname, \"remote-rebuild.js\"), [JSON.stringify(options)], {\n stdio: [\"pipe\", \"pipe\", \"pipe\", \"ipc\"],\n })\n\n let pendingError: Error\n\n child.stdout?.on(\"data\", chunk => {\n log.info(chunk.toString())\n })\n child.stderr?.on(\"data\", chunk => {\n log.error(chunk.toString())\n })\n\n child.on(\"message\", (message: { msg: string; moduleName: string; err: { message: string; stack: string } }) => {\n const { moduleName, msg } = message\n switch (msg) {\n case \"module-found\": {\n log.info({ moduleName, arch }, \"preparing\")\n break\n }\n case \"module-done\": {\n log.info({ moduleName, arch }, \"finished\")\n break\n }\n case \"module-skip\": {\n log.debug?.({ moduleName, arch }, \"skipped. set ENV=electron-rebuild to determine why\")\n break\n }\n case \"rebuild-error\": {\n pendingError = new Error(message.err.message)\n pendingError.stack = message.err.stack\n break\n }\n case \"rebuild-done\": {\n log.info(\"completed installing native dependencies\")\n break\n }\n }\n })\n\n await new Promise<void>((resolve, reject) => {\n child.on(\"exit\", code => {\n if (code === 0 && !pendingError) {\n resolve()\n } else {\n reject(pendingError || new Error(`Rebuilder failed with exit code: ${code}`))\n }\n })\n })\n}\n"]}
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.d.ts
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.d.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
30
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.js
generated
vendored
Normal file
30
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const rebuild_1 = require("@electron/rebuild");
|
||||
if (!process.send) {
|
||||
console.error("The remote rebuilder expects to be spawned with an IPC channel");
|
||||
process.exit(1);
|
||||
}
|
||||
const options = JSON.parse(process.argv[2]);
|
||||
const rebuilder = (0, rebuild_1.rebuild)(options);
|
||||
rebuilder.lifecycle.on("module-found", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-found", moduleName }); });
|
||||
rebuilder.lifecycle.on("module-done", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-done", moduleName }); });
|
||||
rebuilder.lifecycle.on("module-skip", (moduleName) => { var _a; return (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "module-skip", moduleName }); });
|
||||
rebuilder
|
||||
.then(() => {
|
||||
var _a;
|
||||
(_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { msg: "rebuild-done" });
|
||||
return process.exit(0);
|
||||
})
|
||||
.catch(err => {
|
||||
var _a;
|
||||
(_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, {
|
||||
msg: "rebuild-error",
|
||||
err: {
|
||||
message: err.message,
|
||||
stack: err.stack,
|
||||
},
|
||||
});
|
||||
process.exit(0);
|
||||
});
|
||||
//# sourceMappingURL=remote-rebuild.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/rebuild/remote-rebuild.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"remote-rebuild.js","sourceRoot":"","sources":["../../../src/util/rebuild/remote-rebuild.ts"],"names":[],"mappings":";;AAAA,+CAA2D;AAE3D,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IAClB,OAAO,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAA;IAC/E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC;AAED,MAAM,OAAO,GAAmB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAE3D,MAAM,SAAS,GAAG,IAAA,iBAAO,EAAC,OAAO,CAAC,CAAA;AAElC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AACnH,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AACjH,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC,UAAkB,EAAE,EAAE,WAAC,OAAA,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,CAAC,CAAA,EAAA,CAAC,CAAA;AAEjH,SAAS;KACN,IAAI,CAAC,GAAG,EAAE;;IACT,MAAA,OAAO,CAAC,IAAI,wDAAG,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAA;IACvC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACxB,CAAC,CAAC;KACD,KAAK,CAAC,GAAG,CAAC,EAAE;;IACX,MAAA,OAAO,CAAC,IAAI,wDAAG;QACb,GAAG,EAAE,eAAe;QACpB,GAAG,EAAE;YACH,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,KAAK,EAAE,GAAG,CAAC,KAAK;SACjB;KACF,CAAC,CAAA;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA","sourcesContent":["import { rebuild, RebuildOptions } from \"@electron/rebuild\"\n\nif (!process.send) {\n console.error(\"The remote rebuilder expects to be spawned with an IPC channel\")\n process.exit(1)\n}\n\nconst options: RebuildOptions = JSON.parse(process.argv[2])\n\nconst rebuilder = rebuild(options)\n\nrebuilder.lifecycle.on(\"module-found\", (moduleName: string) => process.send?.({ msg: \"module-found\", moduleName }))\nrebuilder.lifecycle.on(\"module-done\", (moduleName: string) => process.send?.({ msg: \"module-done\", moduleName }))\nrebuilder.lifecycle.on(\"module-skip\", (moduleName: string) => process.send?.({ msg: \"module-skip\", moduleName }))\n\nrebuilder\n .then(() => {\n process.send?.({ msg: \"rebuild-done\" })\n return process.exit(0)\n })\n .catch(err => {\n process.send?.({\n msg: \"rebuild-error\",\n err: {\n message: err.message,\n stack: err.stack,\n },\n })\n process.exit(0)\n })\n"]}
|
||||
3
desktop-operator/node_modules/app-builder-lib/out/util/repositoryInfo.d.ts
generated
vendored
Normal file
3
desktop-operator/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 "../options/metadata";
|
||||
export declare function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata | null): Promise<SourceRepositoryInfo | null>;
|
||||
79
desktop-operator/node_modules/app-builder-lib/out/util/repositoryInfo.js
generated
vendored
Normal file
79
desktop-operator/node_modules/app-builder-lib/out/util/repositoryInfo.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRepositoryInfo = getRepositoryInfo;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const hosted_git_info_1 = require("hosted-git-info");
|
||||
const path = require("path");
|
||||
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, builder_util_1.orNullIfFileNotExist)((0, fs_extra_1.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 (!/^\s*url =/.exec(u)) {
|
||||
u = conf[i + 2];
|
||||
}
|
||||
if (/^\s*url =/.exec(u)) {
|
||||
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, hosted_git_info_1.fromUrl)(url);
|
||||
if (info == null) {
|
||||
return 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;
|
||||
}
|
||||
//# sourceMappingURL=repositoryInfo.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/repositoryInfo.js.map
generated
vendored
Normal file
1
desktop-operator/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
2
desktop-operator/node_modules/app-builder-lib/out/util/resolve.d.ts
generated
vendored
Normal file
2
desktop-operator/node_modules/app-builder-lib/out/util/resolve.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare function resolveModule<T>(type: string | undefined, name: string): Promise<T>;
|
||||
export declare function resolveFunction<T>(type: string | undefined, executor: T | string, name: string): Promise<T>;
|
||||
54
desktop-operator/node_modules/app-builder-lib/out/util/resolve.js
generated
vendored
Normal file
54
desktop-operator/node_modules/app-builder-lib/out/util/resolve.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.resolveModule = resolveModule;
|
||||
exports.resolveFunction = resolveFunction;
|
||||
const log_1 = require("builder-util/out/log");
|
||||
const debug_1 = require("debug");
|
||||
const path = require("path");
|
||||
const url_1 = require("url");
|
||||
async function resolveModule(type, name) {
|
||||
var _a, _b, _c;
|
||||
const extension = path.extname(name).toLowerCase();
|
||||
const isModuleType = type === "module";
|
||||
try {
|
||||
if (extension === ".mjs" || (extension === ".js" && isModuleType)) {
|
||||
const fileUrl = (0, url_1.pathToFileURL)(name).href;
|
||||
return await eval("import('" + fileUrl + "')");
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
log_1.log.debug({ moduleName: name, message: (_a = error.message) !== null && _a !== void 0 ? _a : error.stack }, "Unable to dynamically import, falling back to `require`");
|
||||
}
|
||||
try {
|
||||
return require(name);
|
||||
}
|
||||
catch (error) {
|
||||
log_1.log.error({ moduleName: name, message: (_b = error.message) !== null && _b !== void 0 ? _b : error.stack }, "Unable to `require`");
|
||||
throw new Error((_c = error.message) !== null && _c !== void 0 ? _c : error.stack);
|
||||
}
|
||||
}
|
||||
async function resolveFunction(type, executor, name) {
|
||||
if (executor == null || typeof executor !== "string") {
|
||||
return executor;
|
||||
}
|
||||
let p = executor;
|
||||
if (p.startsWith(".")) {
|
||||
p = path.resolve(p);
|
||||
}
|
||||
try {
|
||||
p = require.resolve(p);
|
||||
}
|
||||
catch (e) {
|
||||
(0, debug_1.default)(e);
|
||||
p = path.resolve(p);
|
||||
}
|
||||
const m = await resolveModule(type, p);
|
||||
const namedExport = m[name];
|
||||
if (namedExport == null) {
|
||||
return m.default || m;
|
||||
}
|
||||
else {
|
||||
return namedExport;
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=resolve.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/resolve.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/resolve.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../src/util/resolve.ts"],"names":[],"mappings":";;AAKA,sCAiBC;AAED,0CAwBC;AAhDD,8CAA0C;AAC1C,iCAAyB;AACzB,6BAA4B;AAC5B,6BAAmC;AAE5B,KAAK,UAAU,aAAa,CAAI,IAAwB,EAAE,IAAY;;IAC3E,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAA;IAClD,MAAM,YAAY,GAAG,IAAI,KAAK,QAAQ,CAAA;IACtC,IAAI,CAAC;QACH,IAAI,SAAS,KAAK,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK,IAAI,YAAY,CAAC,EAAE,CAAC;YAClE,MAAM,OAAO,GAAG,IAAA,mBAAa,EAAC,IAAI,CAAC,CAAC,IAAI,CAAA;YACxC,OAAO,MAAM,IAAI,CAAC,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC,CAAA;QAChD,CAAC;IACH,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,SAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,EAAE,EAAE,yDAAyD,CAAC,CAAA;IACnI,CAAC;IACD,IAAI,CAAC;QACH,OAAO,OAAO,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,SAAG,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,EAAE,EAAE,qBAAqB,CAAC,CAAA;QAC7F,MAAM,IAAI,KAAK,CAAC,MAAA,KAAK,CAAC,OAAO,mCAAI,KAAK,CAAC,KAAK,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,eAAe,CAAI,IAAwB,EAAE,QAAoB,EAAE,IAAY;IACnG,IAAI,QAAQ,IAAI,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,GAAG,QAAkB,CAAA;IAC1B,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,IAAI,CAAC;QACH,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACxB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,IAAA,eAAK,EAAC,CAAC,CAAC,CAAA;QACR,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IACrB,CAAC;IAED,MAAM,CAAC,GAAQ,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC3C,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAA;IAC3B,IAAI,WAAW,IAAI,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,CAAC,OAAO,IAAI,CAAC,CAAA;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC","sourcesContent":["import { log } from \"builder-util/out/log\"\nimport debug from \"debug\"\nimport * as path from \"path\"\nimport { pathToFileURL } from \"url\"\n\nexport async function resolveModule<T>(type: string | undefined, name: string): Promise<T> {\n const extension = path.extname(name).toLowerCase()\n const isModuleType = type === \"module\"\n try {\n if (extension === \".mjs\" || (extension === \".js\" && isModuleType)) {\n const fileUrl = pathToFileURL(name).href\n return await eval(\"import('\" + fileUrl + \"')\")\n }\n } catch (error: any) {\n log.debug({ moduleName: name, message: error.message ?? error.stack }, \"Unable to dynamically import, falling back to `require`\")\n }\n try {\n return require(name)\n } catch (error: any) {\n log.error({ moduleName: name, message: error.message ?? error.stack }, \"Unable to `require`\")\n throw new Error(error.message ?? error.stack)\n }\n}\n\nexport async function resolveFunction<T>(type: string | undefined, executor: T | string, name: string): Promise<T> {\n if (executor == null || typeof executor !== \"string\") {\n return executor\n }\n\n let p = executor as string\n if (p.startsWith(\".\")) {\n p = path.resolve(p)\n }\n\n try {\n p = require.resolve(p)\n } catch (e: any) {\n debug(e)\n p = path.resolve(p)\n }\n\n const m: any = await resolveModule(type, p)\n const namedExport = m[name]\n if (namedExport == null) {\n return m.default || m\n } else {\n return namedExport\n }\n}\n"]}
|
||||
11
desktop-operator/node_modules/app-builder-lib/out/util/timer.d.ts
generated
vendored
Normal file
11
desktop-operator/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;
|
||||
28
desktop-operator/node_modules/app-builder-lib/out/util/timer.js
generated
vendored
Normal file
28
desktop-operator/node_modules/app-builder-lib/out/util/timer.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.DevTimer = void 0;
|
||||
exports.time = time;
|
||||
const builder_util_1 = require("builder-util");
|
||||
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 builder_util_1.debug.enabled ? new DevTimer(label) : new ProductionTimer();
|
||||
}
|
||||
//# sourceMappingURL=timer.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/timer.js.map
generated
vendored
Normal file
1
desktop-operator/node_modules/app-builder-lib/out/util/timer.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../src/util/timer.ts"],"names":[],"mappings":";;;AA2BA,oBAEC;AA7BD,+CAAoC;AAMpC,MAAa,QAAQ;IAGnB,YAA6B,KAAa;QAAb,UAAK,GAAL,KAAK,CAAQ;QAFlC,UAAK,GAAG,OAAO,CAAC,MAAM,EAAE,CAAA;IAEa,CAAC;IAE9C,SAAS;QACP,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAA;IACvD,CAAC;IAED,GAAG;QACD,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;IACpD,CAAC;CACF;AAbD,4BAaC;AAED,MAAM,eAAe;IACnB,GAAG;QACD,SAAS;IACX,CAAC;CACF;AAED,SAAgB,IAAI,CAAC,KAAa;IAChC,OAAO,oBAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,eAAe,EAAE,CAAA;AACpE,CAAC","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 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}\n"]}
|
||||
18
desktop-operator/node_modules/app-builder-lib/out/util/yarn.d.ts
generated
vendored
Normal file
18
desktop-operator/node_modules/app-builder-lib/out/util/yarn.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
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 declare function nodeGypRebuild(platform: NodeJS.Platform, arch: string, frameworkInfo: DesktopFrameworkInfo): Promise<void>;
|
||||
export interface RebuildOptions {
|
||||
frameworkInfo: DesktopFrameworkInfo;
|
||||
productionDeps: Lazy<Array<NodeModuleDirInfo>>;
|
||||
platform?: NodeJS.Platform;
|
||||
arch?: string;
|
||||
buildFromSource?: boolean;
|
||||
additionalArgs?: Array<string> | null;
|
||||
}
|
||||
177
desktop-operator/node_modules/app-builder-lib/out/util/yarn.js
generated
vendored
Normal file
177
desktop-operator/node_modules/app-builder-lib/out/util/yarn.js
generated
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.installOrRebuild = installOrRebuild;
|
||||
exports.getGypEnv = getGypEnv;
|
||||
exports.nodeGypRebuild = nodeGypRebuild;
|
||||
exports.rebuild = rebuild;
|
||||
const builder_util_1 = require("builder-util");
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const os_1 = require("os");
|
||||
const path = require("path");
|
||||
const search_module_1 = require("@electron/rebuild/lib/search-module");
|
||||
const rebuild_1 = require("./rebuild/rebuild");
|
||||
const appBuilder_1 = require("./appBuilder");
|
||||
async function installOrRebuild(config, appDir, options, forceInstall = false) {
|
||||
const effectiveOptions = {
|
||||
buildFromSource: config.buildDependenciesFromSource === true,
|
||||
additionalArgs: (0, builder_util_1.asArray)(config.npmArgs),
|
||||
...options,
|
||||
};
|
||||
let isDependenciesInstalled = false;
|
||||
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
|
||||
if (await (0, fs_extra_1.pathExists)(path.join(appDir, fileOrDir))) {
|
||||
isDependenciesInstalled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (forceInstall || !isDependenciesInstalled) {
|
||||
await installDependencies(config, appDir, effectiveOptions);
|
||||
}
|
||||
else {
|
||||
await rebuild(config, appDir, effectiveOptions);
|
||||
}
|
||||
}
|
||||
function getElectronGypCacheDir() {
|
||||
return path.join((0, os_1.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 checkYarnBerry() {
|
||||
var _a;
|
||||
const npmUserAgent = process.env["npm_config_user_agent"] || "";
|
||||
const regex = /yarn\/(\d+)\./gm;
|
||||
const yarnVersionMatch = regex.exec(npmUserAgent);
|
||||
const yarnMajorVersion = Number((_a = yarnVersionMatch === null || yarnVersionMatch === void 0 ? void 0 : yarnVersionMatch[1]) !== null && _a !== void 0 ? _a : 0);
|
||||
return yarnMajorVersion >= 2;
|
||||
}
|
||||
async function installDependencies(config, appDir, options) {
|
||||
const platform = options.platform || process.platform;
|
||||
const arch = options.arch || process.arch;
|
||||
const additionalArgs = options.additionalArgs;
|
||||
builder_util_1.log.info({ platform, arch, appDir }, `installing production dependencies`);
|
||||
let execPath = process.env.npm_execpath || process.env.NPM_CLI_JS;
|
||||
const execArgs = ["install"];
|
||||
const isYarnBerry = checkYarnBerry();
|
||||
if (!isYarnBerry) {
|
||||
if (process.env.NPM_NO_BIN_LINKS === "true") {
|
||||
execArgs.push("--no-bin-links");
|
||||
}
|
||||
execArgs.push("--production");
|
||||
}
|
||||
if (!isRunningYarn(execPath)) {
|
||||
execArgs.push("--prefer-offline");
|
||||
}
|
||||
if (execPath == null) {
|
||||
execPath = getPackageToolPath();
|
||||
}
|
||||
else if (!isYarnBerry) {
|
||||
execArgs.unshift(execPath);
|
||||
execPath = process.env.npm_node_execpath || process.env.NODE_EXE || "node";
|
||||
}
|
||||
if (additionalArgs != null) {
|
||||
execArgs.push(...additionalArgs);
|
||||
}
|
||||
await (0, builder_util_1.spawn)(execPath, execArgs, {
|
||||
cwd: appDir,
|
||||
env: getGypEnv(options.frameworkInfo, platform, arch, options.buildFromSource === true),
|
||||
});
|
||||
// Some native dependencies no longer use `install` hook for building their native module, (yarn 3+ removed implicit link of `install` and `rebuild` steps)
|
||||
// https://github.com/electron-userland/electron-builder/issues/8024
|
||||
return rebuild(config, appDir, options);
|
||||
}
|
||||
async function nodeGypRebuild(platform, arch, frameworkInfo) {
|
||||
builder_util_1.log.info({ platform, arch }, "executing node-gyp rebuild");
|
||||
// this script must be used only for electron
|
||||
const nodeGyp = `node-gyp${process.platform === "win32" ? ".cmd" : ""}`;
|
||||
const args = ["rebuild"];
|
||||
// headers of old Electron versions do not have a valid config.gypi file
|
||||
// and --force-process-config must be passed to node-gyp >= 8.4.0 to
|
||||
// correctly build modules for them.
|
||||
// see also https://github.com/nodejs/node-gyp/pull/2497
|
||||
const [major, minor] = frameworkInfo.version
|
||||
.split(".")
|
||||
.slice(0, 2)
|
||||
.map(n => parseInt(n, 10));
|
||||
if (major <= 13 || (major == 14 && minor <= 1) || (major == 15 && minor <= 2)) {
|
||||
args.push("--force-process-config");
|
||||
}
|
||||
await (0, builder_util_1.spawn)(nodeGyp, args, { env: getGypEnv(frameworkInfo, platform, arch, 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(config, 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 { arch, buildFromSource, platform } = configuration;
|
||||
if (config.nativeRebuilder === "legacy") {
|
||||
const env = getGypEnv(options.frameworkInfo, platform, arch, buildFromSource);
|
||||
return (0, appBuilder_1.executeAppBuilderAndWriteJson)(["rebuild-node-modules"], configuration, { env, cwd: appDir });
|
||||
}
|
||||
const { frameworkInfo: { version: electronVersion }, } = options;
|
||||
const logInfo = {
|
||||
electronVersion,
|
||||
arch,
|
||||
buildFromSource,
|
||||
appDir: builder_util_1.log.filePath(appDir) || "./",
|
||||
};
|
||||
builder_util_1.log.info(logInfo, "executing @electron/rebuild");
|
||||
const rebuildOptions = {
|
||||
buildPath: appDir,
|
||||
electronVersion,
|
||||
arch,
|
||||
platform,
|
||||
buildFromSource,
|
||||
projectRootPath: await (0, search_module_1.getProjectRootPath)(appDir),
|
||||
mode: config.nativeRebuilder || "sequential",
|
||||
disablePreGypCopy: true,
|
||||
};
|
||||
return (0, rebuild_1.rebuild)(rebuildOptions);
|
||||
}
|
||||
//# sourceMappingURL=yarn.js.map
|
||||
1
desktop-operator/node_modules/app-builder-lib/out/util/yarn.js.map
generated
vendored
Normal file
1
desktop-operator/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