This commit is contained in:
root
2025-11-25 09:56:15 +03:00
commit 68c8f0e80d
23717 changed files with 3200521 additions and 0 deletions

9
mc_test/node_modules/app-builder-lib/out/vm/MonoVm.d.ts generated vendored Executable file
View File

@ -0,0 +1,9 @@
/// <reference types="node" />
import { SpawnOptions, ExecFileOptions } from "child_process";
import { ExtraSpawnOptions } from "builder-util";
import { VmManager } from "./vm";
export declare class MonoVmManager extends VmManager {
constructor();
exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
}

20
mc_test/node_modules/app-builder-lib/out/vm/MonoVm.js generated vendored Executable file
View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MonoVmManager = void 0;
const builder_util_1 = require("builder-util");
const vm_1 = require("./vm");
class MonoVmManager extends vm_1.VmManager {
constructor() {
super();
}
exec(file, args, options, isLogOutIfDebug = true) {
return (0, builder_util_1.exec)("mono", [file].concat(args), {
...options,
}, isLogOutIfDebug);
}
spawn(file, args, options, extraOptions) {
return (0, builder_util_1.spawn)("mono", [file].concat(args), options, extraOptions);
}
}
exports.MonoVmManager = MonoVmManager;
//# sourceMappingURL=MonoVm.js.map

1
mc_test/node_modules/app-builder-lib/out/vm/MonoVm.js.map generated vendored Executable file
View File

@ -0,0 +1 @@
{"version":3,"file":"MonoVm.js","sourceRoot":"","sources":["../../src/vm/MonoVm.ts"],"names":[],"mappings":";;;AACA,+CAA6D;AAC7D,6BAAgC;AAEhC,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,mBAAI,EACT,MAAM,EACN,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EACnB;YACE,GAAG,OAAO;SACX,EACD,eAAe,CAChB,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,OAAO,IAAA,oBAAK,EAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IAClE,CAAC;CACF;AAnBD,sCAmBC","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { exec, ExtraSpawnOptions, spawn } from \"builder-util\"\nimport { VmManager } from \"./vm\"\n\nexport class MonoVmManager extends VmManager {\n constructor() {\n super()\n }\n\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return exec(\n \"mono\",\n [file].concat(args),\n {\n ...options,\n },\n isLogOutIfDebug\n )\n }\n\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n return spawn(\"mono\", [file].concat(args), options, extraOptions)\n }\n}\n"]}

View File

@ -0,0 +1,7 @@
export declare function macPathToParallelsWindows(file: string): string;
export interface ParallelsVm {
id: string;
name: string;
os: "win-10" | "win-11" | "ubuntu" | "elementary";
state: "running" | "suspended" | "stopped";
}

104
mc_test/node_modules/app-builder-lib/out/vm/ParallelsVm.js generated vendored Executable file
View File

@ -0,0 +1,104 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.macPathToParallelsWindows = exports.ParallelsVmManager = exports.parseVmList = void 0;
const builder_util_1 = require("builder-util");
const child_process_1 = require("child_process");
const vm_1 = require("./vm");
/** @internal */
async function parseVmList(debugLogger) {
// do not log output if debug - it is huge, logged using debugLogger
let rawList = await (0, builder_util_1.exec)("prlctl", ["list", "-i", "-s", "name"], undefined, false);
debugLogger.add("parallels.list", rawList);
rawList = rawList.substring(rawList.indexOf("ID:"));
// let match: Array<string> | null
const result = [];
for (const info of rawList
.split("\n\n")
.map(it => it.trim())
.filter(it => it.length > 0)) {
const vm = {};
for (const line of info.split("\n")) {
const meta = /^([^:("]+): (.*)$/.exec(line);
if (meta == null) {
continue;
}
const key = meta[1].toLowerCase();
if (key === "id" || key === "os" || key === "name" || key === "state" || key === "name") {
vm[key] = meta[2].trim();
}
}
result.push(vm);
}
return result;
}
exports.parseVmList = parseVmList;
/** @internal */
class ParallelsVmManager extends vm_1.VmManager {
constructor(vm) {
super();
this.vm = vm;
this.isExitHookAdded = false;
this.startPromise = this.doStartVm();
}
get pathSep() {
return "/";
}
handleExecuteError(error) {
if (error.message.includes("Unable to open new session in this virtual machine")) {
throw new Error(`Please ensure that your are logged in "${this.vm.name}" parallels virtual machine. In the future please do not stop VM, but suspend.\n\n${error.message}`);
}
builder_util_1.log.warn("ensure that 'Share folders' is set to 'All Disks', see https://goo.gl/E6XphP");
throw error;
}
async exec(file, args, options) {
await this.ensureThatVmStarted();
// it is important to use "--current-user" to execute command under logged in user - to access certs.
return await (0, builder_util_1.exec)("prlctl", ["exec", this.vm.id, "--current-user", file.startsWith("/") ? macPathToParallelsWindows(file) : file].concat(args), options).catch(error => this.handleExecuteError(error));
}
async spawn(file, args, options, extraOptions) {
await this.ensureThatVmStarted();
return await (0, builder_util_1.spawn)("prlctl", ["exec", this.vm.id, file].concat(args), options, extraOptions).catch(error => this.handleExecuteError(error));
}
async doStartVm() {
const vmId = this.vm.id;
const state = this.vm.state;
if (state === "running") {
return;
}
if (!this.isExitHookAdded) {
this.isExitHookAdded = true;
// eslint-disable-next-line @typescript-eslint/no-var-requires
require("async-exit-hook")((callback) => {
const stopArgs = ["suspend", vmId];
if (callback == null) {
(0, child_process_1.execFileSync)("prlctl", stopArgs);
}
else {
(0, builder_util_1.exec)("prlctl", stopArgs).then(callback).catch(callback);
}
});
}
await (0, builder_util_1.exec)("prlctl", ["start", vmId]);
}
ensureThatVmStarted() {
let startPromise = this.startPromise;
if (startPromise == null) {
startPromise = this.doStartVm();
this.startPromise = startPromise;
}
return startPromise;
}
toVmFile(file) {
// https://stackoverflow.com/questions/4742992/cannot-access-network-drive-in-powershell-running-as-administrator
return macPathToParallelsWindows(file);
}
}
exports.ParallelsVmManager = ParallelsVmManager;
function macPathToParallelsWindows(file) {
if (file.startsWith("C:\\")) {
return file;
}
return "\\\\Mac\\Host\\" + file.replace(/\//g, "\\");
}
exports.macPathToParallelsWindows = macPathToParallelsWindows;
//# sourceMappingURL=ParallelsVm.js.map

File diff suppressed because one or more lines are too long

10
mc_test/node_modules/app-builder-lib/out/vm/WineVm.d.ts generated vendored Executable file
View File

@ -0,0 +1,10 @@
/// <reference types="node" />
import { SpawnOptions, ExecFileOptions } from "child_process";
import { ExtraSpawnOptions } from "builder-util";
import { VmManager } from "./vm";
export declare class WineVmManager extends VmManager {
constructor();
exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
toVmFile(file: string): string;
}

24
mc_test/node_modules/app-builder-lib/out/vm/WineVm.js generated vendored Executable file
View File

@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WineVmManager = void 0;
const wine_1 = require("../wine");
const vm_1 = require("./vm");
const path = require("path");
class WineVmManager extends vm_1.VmManager {
constructor() {
super();
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
exec(file, args, options, isLogOutIfDebug = true) {
return (0, wine_1.execWine)(file, null, args, options);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
spawn(file, args, options, extraOptions) {
throw new Error("Unsupported");
}
toVmFile(file) {
return path.win32.join("Z:", file);
}
}
exports.WineVmManager = WineVmManager;
//# sourceMappingURL=WineVm.js.map

1
mc_test/node_modules/app-builder-lib/out/vm/WineVm.js.map generated vendored Executable file
View File

@ -0,0 +1 @@
{"version":3,"file":"WineVm.js","sourceRoot":"","sources":["../../src/vm/WineVm.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,6BAAgC;AAChC,6BAA4B;AAE5B,MAAa,aAAc,SAAQ,cAAS;IAC1C;QACE,KAAK,EAAE,CAAA;IACT,CAAC;IAED,6DAA6D;IAC7D,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,eAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IAC5C,CAAC;IAED,6DAA6D;IAC7D,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACpC,CAAC;CACF;AAlBD,sCAkBC","sourcesContent":["import { SpawnOptions, ExecFileOptions } from \"child_process\"\nimport { ExtraSpawnOptions } from \"builder-util\"\nimport { execWine } from \"../wine\"\nimport { VmManager } from \"./vm\"\nimport * as path from \"path\"\n\nexport class WineVmManager extends VmManager {\n constructor() {\n super()\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return execWine(file, null, args, options)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n throw new Error(\"Unsupported\")\n }\n\n toVmFile(file: string): string {\n return path.win32.join(\"Z:\", file)\n }\n}\n"]}

10
mc_test/node_modules/app-builder-lib/out/vm/vm.d.ts generated vendored Executable file
View File

@ -0,0 +1,10 @@
/// <reference types="node" />
import { DebugLogger, ExtraSpawnOptions } from "builder-util";
import { ExecFileOptions, SpawnOptions } from "child_process";
export declare class VmManager {
get pathSep(): string;
exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug?: boolean): Promise<string>;
spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any>;
toVmFile(file: string): string;
}
export declare function getWindowsVm(debugLogger: DebugLogger): Promise<VmManager>;

31
mc_test/node_modules/app-builder-lib/out/vm/vm.js generated vendored Executable file
View File

@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWindowsVm = exports.VmManager = void 0;
const builder_util_1 = require("builder-util");
const path = require("path");
class VmManager {
get pathSep() {
return path.sep;
}
exec(file, args, options, isLogOutIfDebug = true) {
return (0, builder_util_1.exec)(file, args, options, isLogOutIfDebug);
}
spawn(file, args, options, extraOptions) {
return (0, builder_util_1.spawn)(file, args, options, extraOptions);
}
toVmFile(file) {
return file;
}
}
exports.VmManager = VmManager;
async function getWindowsVm(debugLogger) {
const parallelsVmModule = await Promise.resolve().then(() => require("./ParallelsVm"));
const vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => ["win-10", "win-11"].includes(it.os));
if (vmList.length === 0) {
throw new builder_util_1.InvalidConfigurationError("Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)");
}
// prefer running or suspended vm
return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === "running") || vmList.find(it => it.state === "suspended") || vmList[0]);
}
exports.getWindowsVm = getWindowsVm;
//# sourceMappingURL=vm.js.map

1
mc_test/node_modules/app-builder-lib/out/vm/vm.js.map generated vendored Executable file
View File

@ -0,0 +1 @@
{"version":3,"file":"vm.js","sourceRoot":"","sources":["../../src/vm/vm.ts"],"names":[],"mappings":";;;AAAA,+CAAqG;AAErG,6BAA4B;AAE5B,MAAa,SAAS;IACpB,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,IAAI,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAyB,EAAE,eAAe,GAAG,IAAI;QACvF,OAAO,IAAA,mBAAI,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,CAAC,CAAA;IACnD,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,IAAmB,EAAE,OAAsB,EAAE,YAAgC;QAC/F,OAAO,IAAA,oBAAK,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IACjD,CAAC;IAED,QAAQ,CAAC,IAAY;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAhBD,8BAgBC;AAEM,KAAK,UAAU,YAAY,CAAC,WAAwB;IACzD,MAAM,iBAAiB,GAAG,2CAAa,eAAe,EAAC,CAAA;IACvD,MAAM,MAAM,GAAG,CAAC,MAAM,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACpH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,wCAAyB,CAAC,iFAAiF,CAAC,CAAA;IACxH,CAAC;IAED,iCAAiC;IACjC,OAAO,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,KAAK,WAAW,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AACxJ,CAAC;AATD,oCASC","sourcesContent":["import { DebugLogger, exec, ExtraSpawnOptions, InvalidConfigurationError, spawn } from \"builder-util\"\nimport { ExecFileOptions, SpawnOptions } from \"child_process\"\nimport * as path from \"path\"\n\nexport class VmManager {\n get pathSep(): string {\n return path.sep\n }\n\n exec(file: string, args: Array<string>, options?: ExecFileOptions, isLogOutIfDebug = true): Promise<string> {\n return exec(file, args, options, isLogOutIfDebug)\n }\n\n spawn(file: string, args: Array<string>, options?: SpawnOptions, extraOptions?: ExtraSpawnOptions): Promise<any> {\n return spawn(file, args, options, extraOptions)\n }\n\n toVmFile(file: string): string {\n return file\n }\n}\n\nexport async function getWindowsVm(debugLogger: DebugLogger): Promise<VmManager> {\n const parallelsVmModule = await import(\"./ParallelsVm\")\n const vmList = (await parallelsVmModule.parseVmList(debugLogger)).filter(it => [\"win-10\", \"win-11\"].includes(it.os))\n if (vmList.length === 0) {\n throw new InvalidConfigurationError(\"Cannot find suitable Parallels Desktop virtual machine (Windows 10 is required)\")\n }\n\n // prefer running or suspended vm\n return new parallelsVmModule.ParallelsVmManager(vmList.find(it => it.state === \"running\") || vmList.find(it => it.state === \"suspended\") || vmList[0])\n}\n"]}