@pipelab/plugin-construct 1.0.0-beta.23 → 1.0.0-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/script.ts +36 -28
- package/dist/index.cjs +204 -109
- package/dist/index.mjs +145 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -3,9 +3,9 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import { hostname } from "os";
|
|
4
4
|
import { normalize } from "path";
|
|
5
5
|
import { formatWithOptions, types } from "util";
|
|
6
|
-
import path, { delimiter, dirname, join } from "node:path";
|
|
6
|
+
import path, { delimiter, dirname, join, resolve } from "node:path";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
|
-
import { constants, homedir } from "node:os";
|
|
8
|
+
import { constants, homedir, platform } from "node:os";
|
|
9
9
|
import { appendFileSync, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync, statSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { chmod, cp, mkdir, readFile, readdir, rename, rm } from "node:fs/promises";
|
|
11
11
|
import http from "node:http";
|
|
@@ -13,7 +13,7 @@ import { webcrypto } from "node:crypto";
|
|
|
13
13
|
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
14
14
|
import { StringDecoder } from "node:string_decoder";
|
|
15
15
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
16
|
-
import process$1, { execArgv, execPath, hrtime, platform } from "node:process";
|
|
16
|
+
import process$1, { execArgv, execPath, hrtime, platform as platform$1 } from "node:process";
|
|
17
17
|
import tty from "node:tty";
|
|
18
18
|
import { scheduler, setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
19
19
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
@@ -45417,6 +45417,17 @@ const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
|
45417
45417
|
const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
|
|
45418
45418
|
const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? dirname(fileURLToPath(metaUrl)) : process.cwd();
|
|
45419
45419
|
const isDev = process.env.NODE_ENV === "development";
|
|
45420
|
+
const getDefaultUserDataPath = (env) => {
|
|
45421
|
+
const base = (() => {
|
|
45422
|
+
switch (platform()) {
|
|
45423
|
+
case "win32": return process.env.APPDATA || join(homedir(), "AppData", "Roaming");
|
|
45424
|
+
case "darwin": return join(homedir(), "Library", "Application Support");
|
|
45425
|
+
default: return process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
|
|
45426
|
+
}
|
|
45427
|
+
})();
|
|
45428
|
+
const mode = env ?? (isDev ? "dev" : "prod");
|
|
45429
|
+
return join(base, "@pipelab", mode === "dev" ? "app-dev" : mode === "beta" ? "app-beta" : "app");
|
|
45430
|
+
};
|
|
45420
45431
|
/**
|
|
45421
45432
|
* Finds the monorepo root by looking for pnpm-workspace.yaml.
|
|
45422
45433
|
*/
|
|
@@ -49183,6 +49194,71 @@ var WebSocketServer = class {
|
|
|
49183
49194
|
};
|
|
49184
49195
|
const webSocketServer = new WebSocketServer();
|
|
49185
49196
|
//#endregion
|
|
49197
|
+
//#region ../../packages/core-node/src/fs-utils.ts
|
|
49198
|
+
var import_slash = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
49199
|
+
module.exports = (path) => {
|
|
49200
|
+
const isExtendedLengthPath = /^\\\\\?\\/.test(path);
|
|
49201
|
+
const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
|
|
49202
|
+
if (isExtendedLengthPath || hasNonAscii) return path;
|
|
49203
|
+
return path.replace(/\\/g, "/");
|
|
49204
|
+
};
|
|
49205
|
+
})))(), 1);
|
|
49206
|
+
function removeTrailingSlash(path) {
|
|
49207
|
+
return path.replace(/[\\/]+$/, "");
|
|
49208
|
+
}
|
|
49209
|
+
removeTrailingSlash((0, import_slash.default)(resolve(homedir()))).toLowerCase();
|
|
49210
|
+
const additionalProtectedPaths = [
|
|
49211
|
+
getDefaultUserDataPath("dev"),
|
|
49212
|
+
getDefaultUserDataPath("beta"),
|
|
49213
|
+
getDefaultUserDataPath("prod"),
|
|
49214
|
+
projectRoot,
|
|
49215
|
+
process.cwd(),
|
|
49216
|
+
"/tmp",
|
|
49217
|
+
"/var/tmp",
|
|
49218
|
+
process.env.TEMP,
|
|
49219
|
+
process.env.TMP,
|
|
49220
|
+
join(homedir(), "AppData"),
|
|
49221
|
+
join(homedir(), "AppData", "Local"),
|
|
49222
|
+
join(homedir(), "AppData", "Roaming"),
|
|
49223
|
+
join(homedir(), "Library"),
|
|
49224
|
+
join(homedir(), "Library", "Application Support"),
|
|
49225
|
+
join(homedir(), ".config"),
|
|
49226
|
+
join(homedir(), ".local"),
|
|
49227
|
+
join(homedir(), ".local", "share"),
|
|
49228
|
+
join(homedir(), ".cache"),
|
|
49229
|
+
join(homedir(), "OneDrive"),
|
|
49230
|
+
join(homedir(), "Dropbox"),
|
|
49231
|
+
join(homedir(), ".ssh"),
|
|
49232
|
+
join(homedir(), ".gnupg"),
|
|
49233
|
+
join(homedir(), ".aws"),
|
|
49234
|
+
join(homedir(), ".docker"),
|
|
49235
|
+
join(homedir(), ".kube"),
|
|
49236
|
+
join(homedir(), ".vscode"),
|
|
49237
|
+
join(homedir(), ".vscode-insiders"),
|
|
49238
|
+
join(homedir(), ".cursor"),
|
|
49239
|
+
join(homedir(), ".npm"),
|
|
49240
|
+
join(homedir(), ".pnpm-state"),
|
|
49241
|
+
join(homedir(), ".yarn"),
|
|
49242
|
+
join(homedir(), ".cargo"),
|
|
49243
|
+
join(homedir(), ".rustup"),
|
|
49244
|
+
join(homedir(), ".m2"),
|
|
49245
|
+
join(homedir(), ".gradle")
|
|
49246
|
+
].filter((p) => typeof p === "string" && p.length > 0);
|
|
49247
|
+
new Set([
|
|
49248
|
+
join(homedir(), "Downloads"),
|
|
49249
|
+
join(homedir(), "Documents"),
|
|
49250
|
+
join(homedir(), "Desktop"),
|
|
49251
|
+
join(homedir(), "Pictures"),
|
|
49252
|
+
join(homedir(), "Music"),
|
|
49253
|
+
join(homedir(), "Videos"),
|
|
49254
|
+
join(homedir(), "Saved Games"),
|
|
49255
|
+
join(homedir(), "Contacts"),
|
|
49256
|
+
join(homedir(), "Searches"),
|
|
49257
|
+
join(homedir(), "Links"),
|
|
49258
|
+
join(homedir(), "3D Objects"),
|
|
49259
|
+
...additionalProtectedPaths
|
|
49260
|
+
].map((p) => removeTrailingSlash((0, import_slash.default)(resolve(p))).toLowerCase()));
|
|
49261
|
+
//#endregion
|
|
49186
49262
|
//#region ../../node_modules/is-plain-obj/index.js
|
|
49187
49263
|
function isPlainObject(value) {
|
|
49188
49264
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -49464,7 +49540,7 @@ const COMMON_ESCAPES = {
|
|
|
49464
49540
|
const ASTRAL_START = 65535;
|
|
49465
49541
|
const quoteString = (escapedArgument) => {
|
|
49466
49542
|
if (NO_ESCAPE_REGEXP.test(escapedArgument)) return escapedArgument;
|
|
49467
|
-
return platform === "win32" ? `"${escapedArgument.replaceAll("\"", "\"\"")}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
49543
|
+
return platform$1 === "win32" ? `"${escapedArgument.replaceAll("\"", "\"\"")}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`;
|
|
49468
49544
|
};
|
|
49469
49545
|
const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
49470
49546
|
//#endregion
|
|
@@ -59573,13 +59649,13 @@ var require_opts_arg = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
59573
59649
|
//#region ../../node_modules/mkdirp/lib/path-arg.js
|
|
59574
59650
|
var require_path_arg = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
59575
59651
|
const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
|
|
59576
|
-
const { resolve: resolve$
|
|
59652
|
+
const { resolve: resolve$13, parse: parse$2 } = __require("path");
|
|
59577
59653
|
const pathArg = (path) => {
|
|
59578
59654
|
if (/\0/.test(path)) throw Object.assign(/* @__PURE__ */ new TypeError("path must be a string without null bytes"), {
|
|
59579
59655
|
path,
|
|
59580
59656
|
code: "ERR_INVALID_ARG_VALUE"
|
|
59581
59657
|
});
|
|
59582
|
-
path = resolve$
|
|
59658
|
+
path = resolve$13(path);
|
|
59583
59659
|
if (platform === "win32") {
|
|
59584
59660
|
const badWinChars = /[*|"<>?:]/;
|
|
59585
59661
|
const { root } = parse$2(path);
|
|
@@ -62624,7 +62700,7 @@ var require_readdir_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62624
62700
|
const fs$19 = __require("fs");
|
|
62625
62701
|
const { EventEmitter: EventEmitter$1 } = __require("events");
|
|
62626
62702
|
const { Minimatch } = require_minimatch$1();
|
|
62627
|
-
const { resolve: resolve$
|
|
62703
|
+
const { resolve: resolve$12 } = __require("path");
|
|
62628
62704
|
function readdir(dir, strict) {
|
|
62629
62705
|
return new Promise((resolve, reject) => {
|
|
62630
62706
|
fs$19.readdir(dir, { withFileTypes: true }, (err, files) => {
|
|
@@ -62733,7 +62809,7 @@ var require_readdir_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62733
62809
|
if (this.options.ignore) this.ignoreMatchers = (Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore]).map((ignore) => new Minimatch(ignore, { dot: true }));
|
|
62734
62810
|
this.skipMatchers = [];
|
|
62735
62811
|
if (this.options.skip) this.skipMatchers = (Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip]).map((skip) => new Minimatch(skip, { dot: true }));
|
|
62736
|
-
this.iterator = explore(resolve$
|
|
62812
|
+
this.iterator = explore(resolve$12(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this));
|
|
62737
62813
|
this.paused = false;
|
|
62738
62814
|
this.inactive = false;
|
|
62739
62815
|
this.aborted = false;
|
|
@@ -99429,7 +99505,7 @@ var require_sort$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
99429
99505
|
//#region ../../node_modules/@npmcli/package-json/lib/index.js
|
|
99430
99506
|
var require_lib$18 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
99431
99507
|
const { readFile: readFile$5, writeFile: writeFile$2 } = __require("node:fs/promises");
|
|
99432
|
-
const { resolve: resolve$
|
|
99508
|
+
const { resolve: resolve$11 } = __require("node:path");
|
|
99433
99509
|
const parseJSON = require_lib$30();
|
|
99434
99510
|
const updateDeps = require_update_dependencies();
|
|
99435
99511
|
const updateScripts = require_update_scripts();
|
|
@@ -99532,7 +99608,7 @@ var require_lib$18 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
99532
99608
|
parseErr = err;
|
|
99533
99609
|
}
|
|
99534
99610
|
if (parseErr) {
|
|
99535
|
-
const indexFile = resolve$
|
|
99611
|
+
const indexFile = resolve$11(this.path, "index.js");
|
|
99536
99612
|
let indexFileContent;
|
|
99537
99613
|
try {
|
|
99538
99614
|
indexFileContent = await readFile$5(indexFile, "utf8");
|
|
@@ -99577,7 +99653,7 @@ var require_lib$18 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
99577
99653
|
return this.#path;
|
|
99578
99654
|
}
|
|
99579
99655
|
get filename() {
|
|
99580
|
-
if (this.path) return resolve$
|
|
99656
|
+
if (this.path) return resolve$11(this.path, "package.json");
|
|
99581
99657
|
}
|
|
99582
99658
|
create(path) {
|
|
99583
99659
|
this.#path = path;
|
|
@@ -100700,7 +100776,7 @@ var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100700
100776
|
const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE } = require_errors$3();
|
|
100701
100777
|
const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = __require("os");
|
|
100702
100778
|
const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$5, readdir: readdir$5, readlink, stat: stat$4, symlink, unlink, utimes } = __require("fs/promises");
|
|
100703
|
-
const { dirname: dirname$6, isAbsolute: isAbsolute$1, join: join$6, parse, resolve: resolve$
|
|
100779
|
+
const { dirname: dirname$6, isAbsolute: isAbsolute$1, join: join$6, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = __require("path");
|
|
100704
100780
|
const { fileURLToPath: fileURLToPath$1 } = __require("url");
|
|
100705
100781
|
const defaultOptions = {
|
|
100706
100782
|
dereference: false,
|
|
@@ -100787,8 +100863,8 @@ var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100787
100863
|
);
|
|
100788
100864
|
}
|
|
100789
100865
|
async function checkParentPaths(src, srcStat, dest) {
|
|
100790
|
-
const srcParent = resolve$
|
|
100791
|
-
const destParent = resolve$
|
|
100866
|
+
const srcParent = resolve$10(dirname$6(src));
|
|
100867
|
+
const destParent = resolve$10(dirname$6(dest));
|
|
100792
100868
|
if (destParent === srcParent || destParent === parse(destParent).root) return;
|
|
100793
100869
|
let destStat;
|
|
100794
100870
|
try {
|
|
@@ -100807,7 +100883,7 @@ var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100807
100883
|
});
|
|
100808
100884
|
return checkParentPaths(src, srcStat, destParent);
|
|
100809
100885
|
}
|
|
100810
|
-
const normalizePathToArray = (path) => resolve$
|
|
100886
|
+
const normalizePathToArray = (path) => resolve$10(path).split(sep$2).filter(Boolean);
|
|
100811
100887
|
function isSrcSubdir(src, dest) {
|
|
100812
100888
|
const srcArr = normalizePathToArray(src);
|
|
100813
100889
|
const destArr = normalizePathToArray(dest);
|
|
@@ -100917,7 +100993,7 @@ var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100917
100993
|
}
|
|
100918
100994
|
async function onLink(destStat, src, dest) {
|
|
100919
100995
|
let resolvedSrc = await readlink(src);
|
|
100920
|
-
if (!isAbsolute$1(resolvedSrc)) resolvedSrc = resolve$
|
|
100996
|
+
if (!isAbsolute$1(resolvedSrc)) resolvedSrc = resolve$10(dirname$6(src), resolvedSrc);
|
|
100921
100997
|
if (!destStat) return symlink(resolvedSrc, dest);
|
|
100922
100998
|
let resolvedDest;
|
|
100923
100999
|
try {
|
|
@@ -100928,7 +101004,7 @@ var require_polyfill = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
100928
101004
|
// istanbul ignore next: should not be possible
|
|
100929
101005
|
throw err;
|
|
100930
101006
|
}
|
|
100931
|
-
if (!isAbsolute$1(resolvedDest)) resolvedDest = resolve$
|
|
101007
|
+
if (!isAbsolute$1(resolvedDest)) resolvedDest = resolve$10(dirname$6(dest), resolvedDest);
|
|
100932
101008
|
if (isSrcSubdir(resolvedSrc, resolvedDest)) throw new ERR_FS_CP_EINVAL({
|
|
100933
101009
|
message: `cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`,
|
|
100934
101010
|
path: dest,
|
|
@@ -101015,7 +101091,7 @@ var require_readdir_scoped = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
101015
101091
|
//#endregion
|
|
101016
101092
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
|
|
101017
101093
|
var require_move_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
101018
|
-
const { dirname: dirname$5, join: join$3, resolve: resolve$
|
|
101094
|
+
const { dirname: dirname$5, join: join$3, resolve: resolve$9, relative: relative$1, isAbsolute } = __require("path");
|
|
101019
101095
|
const fs$11 = __require("fs/promises");
|
|
101020
101096
|
const pathExists = async (path) => {
|
|
101021
101097
|
try {
|
|
@@ -101051,10 +101127,10 @@ var require_move_file = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
101051
101127
|
if (root) {
|
|
101052
101128
|
await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
|
|
101053
101129
|
let target = await fs$11.readlink(symSource);
|
|
101054
|
-
if (isAbsolute(target)) target = resolve$
|
|
101130
|
+
if (isAbsolute(target)) target = resolve$9(symDestination, relative$1(symSource, target));
|
|
101055
101131
|
let targetStat = "file";
|
|
101056
101132
|
try {
|
|
101057
|
-
targetStat = await fs$11.stat(resolve$
|
|
101133
|
+
targetStat = await fs$11.stat(resolve$9(dirname$5(symSource), target));
|
|
101058
101134
|
if (targetStat.isDirectory()) targetStat = "junction";
|
|
101059
101135
|
} catch {}
|
|
101060
101136
|
await fs$11.symlink(target, symDestination, targetStat);
|
|
@@ -106871,7 +106947,7 @@ var require_lib$12 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
106871
106947
|
var require_lib$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
106872
106948
|
const bundled = require_lib$12();
|
|
106873
106949
|
const { readFile: readFile$2, readdir: readdir$2, stat: stat$2 } = __require("fs/promises");
|
|
106874
|
-
const { resolve: resolve$
|
|
106950
|
+
const { resolve: resolve$8, basename: basename$3, dirname: dirname$4 } = __require("path");
|
|
106875
106951
|
const normalizePackageBin = require_lib$21();
|
|
106876
106952
|
const readPackage = ({ path, packageJsonCache }) => packageJsonCache.has(path) ? Promise.resolve(packageJsonCache.get(path)) : readFile$2(path).then((json) => {
|
|
106877
106953
|
const pkg = normalizePackageBin(JSON.parse(json));
|
|
@@ -106915,7 +106991,7 @@ var require_lib$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
106915
106991
|
const nm = /^@.+/.test(scope) ? dirname$4(dir) : dir;
|
|
106916
106992
|
const binFiles = [];
|
|
106917
106993
|
Object.keys(pkg.bin).forEach((b) => {
|
|
106918
|
-
const base = resolve$
|
|
106994
|
+
const base = resolve$8(nm, ".bin", b);
|
|
106919
106995
|
binFiles.push(base, base + ".cmd", base + ".ps1");
|
|
106920
106996
|
});
|
|
106921
106997
|
(await Promise.all(binFiles.map((b) => stat$2(b).then(() => b).catch(() => null)))).filter((b) => b).forEach((b) => result.add(b));
|
|
@@ -106936,7 +107012,7 @@ var require_lib$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
106936
107012
|
}
|
|
106937
107013
|
const recursePromises = [];
|
|
106938
107014
|
for (const entry of dirEntries) {
|
|
106939
|
-
const p = resolve$
|
|
107015
|
+
const p = resolve$8(path, entry.name);
|
|
106940
107016
|
if (entry.isDirectory() === false) {
|
|
106941
107017
|
result.add(p);
|
|
106942
107018
|
continue;
|
|
@@ -106955,7 +107031,7 @@ var require_lib$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
106955
107031
|
}
|
|
106956
107032
|
if (bundleDeps) recursePromises.push(...bundleDeps.map((dep) => {
|
|
106957
107033
|
return pkgContents({
|
|
106958
|
-
path: resolve$
|
|
107034
|
+
path: resolve$8(path, "node_modules", dep),
|
|
106959
107035
|
packageJsonCache,
|
|
106960
107036
|
pkg: true,
|
|
106961
107037
|
depth,
|
|
@@ -106967,7 +107043,7 @@ var require_lib$11 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
106967
107043
|
return result;
|
|
106968
107044
|
};
|
|
106969
107045
|
module.exports = ({ path, ...opts }) => pkgContents({
|
|
106970
|
-
path: resolve$
|
|
107046
|
+
path: resolve$8(path),
|
|
106971
107047
|
...opts,
|
|
106972
107048
|
pkg: true
|
|
106973
107049
|
}).then((results) => [...results]);
|
|
@@ -110578,18 +110654,18 @@ var require_protected = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
110578
110654
|
//#endregion
|
|
110579
110655
|
//#region ../../node_modules/pacote/lib/util/cache-dir.js
|
|
110580
110656
|
var require_cache_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
110581
|
-
const { resolve: resolve$
|
|
110657
|
+
const { resolve: resolve$7 } = __require("node:path");
|
|
110582
110658
|
const { tmpdir, homedir: homedir$1 } = __require("node:os");
|
|
110583
110659
|
module.exports = (fakePlatform = false) => {
|
|
110584
110660
|
const temp = tmpdir();
|
|
110585
110661
|
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
110586
|
-
const home = homedir$1() || resolve$
|
|
110662
|
+
const home = homedir$1() || resolve$7(temp, "npm-" + uidOrPid);
|
|
110587
110663
|
const platform = fakePlatform || process.platform;
|
|
110588
110664
|
const cacheExtra = platform === "win32" ? "npm-cache" : ".npm";
|
|
110589
110665
|
const cacheRoot = platform === "win32" && process.env.LOCALAPPDATA || home;
|
|
110590
110666
|
return {
|
|
110591
|
-
cacache: resolve$
|
|
110592
|
-
tufcache: resolve$
|
|
110667
|
+
cacache: resolve$7(cacheRoot, cacheExtra, "_cacache"),
|
|
110668
|
+
tufcache: resolve$7(cacheRoot, cacheExtra, "_tuf")
|
|
110593
110669
|
};
|
|
110594
110670
|
};
|
|
110595
110671
|
}));
|
|
@@ -112403,7 +112479,7 @@ var require_lib$10 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112403
112479
|
var require_lib$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112404
112480
|
const { Walker: IgnoreWalker } = require_lib$10();
|
|
112405
112481
|
const { lstatSync: lstat$1, readFileSync: readFile$1 } = __require("fs");
|
|
112406
|
-
const { basename: basename$2, dirname: dirname$3, extname: extname$1, join: join$2, relative, resolve: resolve$
|
|
112482
|
+
const { basename: basename$2, dirname: dirname$3, extname: extname$1, join: join$2, relative, resolve: resolve$6, sep } = __require("path");
|
|
112407
112483
|
const { log } = require_lib$29();
|
|
112408
112484
|
const defaultRules = Symbol("npm-packlist.rules.default");
|
|
112409
112485
|
const strictRules = Symbol("npm-packlist.rules.strict");
|
|
@@ -112454,7 +112530,7 @@ var require_lib$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112454
112530
|
...opts,
|
|
112455
112531
|
includeEmpty: false,
|
|
112456
112532
|
follow: false,
|
|
112457
|
-
path: resolve$
|
|
112533
|
+
path: resolve$6(opts?.path || tree.path).replace(/\\/g, "/"),
|
|
112458
112534
|
ignoreFiles: opts?.ignoreFiles || [
|
|
112459
112535
|
defaultRules,
|
|
112460
112536
|
"package.json",
|
|
@@ -112655,8 +112731,8 @@ var require_lib$9 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112655
112731
|
var require_set_path = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112656
112732
|
init_esm_shims();
|
|
112657
112733
|
const { log } = require_lib$29();
|
|
112658
|
-
const { resolve: resolve$
|
|
112659
|
-
const nodeGypPath = resolve$
|
|
112734
|
+
const { resolve: resolve$5, dirname: dirname$2, delimiter: delimiter$1 } = __require("path");
|
|
112735
|
+
const nodeGypPath = resolve$5(__dirname, "../lib/node-gyp-bin");
|
|
112660
112736
|
const setPATH = (projectPath, binPaths, env) => {
|
|
112661
112737
|
const PATH = Object.keys(env).filter((p) => /^path$/i.test(p) && env[p]).map((p) => env[p].split(delimiter$1)).reduce((set, p) => set.concat(p.filter((concatted) => !set.includes(concatted))), []).join(delimiter$1);
|
|
112662
112738
|
const pathArr = [];
|
|
@@ -112671,7 +112747,7 @@ var require_set_path = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112671
112747
|
let p = projectPath;
|
|
112672
112748
|
let pp;
|
|
112673
112749
|
do {
|
|
112674
|
-
pathArr.push(resolve$
|
|
112750
|
+
pathArr.push(resolve$5(p, "node_modules", ".bin"));
|
|
112675
112751
|
pp = p;
|
|
112676
112752
|
p = dirname$2(p);
|
|
112677
112753
|
} while (p !== pp);
|
|
@@ -112686,7 +112762,7 @@ var require_set_path = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112686
112762
|
//#region ../../node_modules/@npmcli/run-script/lib/make-spawn-args.js
|
|
112687
112763
|
var require_make_spawn_args = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112688
112764
|
const setPATH = require_set_path();
|
|
112689
|
-
const { resolve: resolve$
|
|
112765
|
+
const { resolve: resolve$4 } = __require("path");
|
|
112690
112766
|
let npm_config_node_gyp;
|
|
112691
112767
|
const makeSpawnArgs = (options) => {
|
|
112692
112768
|
const { args, binPaths, cmd, env, event, nodeGyp, path, scriptShell = true, stdio, stdioString } = options;
|
|
@@ -112700,7 +112776,7 @@ var require_make_spawn_args = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
112700
112776
|
env: setPATH(path, binPaths, {
|
|
112701
112777
|
...process.env,
|
|
112702
112778
|
...env,
|
|
112703
|
-
npm_package_json: resolve$
|
|
112779
|
+
npm_package_json: resolve$4(path, "package.json"),
|
|
112704
112780
|
npm_lifecycle_event: event,
|
|
112705
112781
|
npm_lifecycle_script: cmd,
|
|
112706
112782
|
npm_config_node_gyp
|
|
@@ -112788,10 +112864,10 @@ var require_signal_manager = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
112788
112864
|
//#region ../../node_modules/@npmcli/run-script/lib/is-server-package.js
|
|
112789
112865
|
var require_is_server_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112790
112866
|
const { stat: stat$1 } = __require("node:fs/promises");
|
|
112791
|
-
const { resolve: resolve$
|
|
112867
|
+
const { resolve: resolve$3 } = __require("node:path");
|
|
112792
112868
|
module.exports = async (path) => {
|
|
112793
112869
|
try {
|
|
112794
|
-
return (await stat$1(resolve$
|
|
112870
|
+
return (await stat$1(resolve$3(path, "server.js"))).isFile();
|
|
112795
112871
|
} catch (er) {
|
|
112796
112872
|
return false;
|
|
112797
112873
|
}
|
|
@@ -112901,7 +112977,7 @@ var require_run_script = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112901
112977
|
//#endregion
|
|
112902
112978
|
//#region ../../node_modules/pacote/lib/file.js
|
|
112903
112979
|
var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112904
|
-
const { resolve: resolve$
|
|
112980
|
+
const { resolve: resolve$2 } = __require("node:path");
|
|
112905
112981
|
const { stat, chmod: chmod$1 } = __require("node:fs/promises");
|
|
112906
112982
|
const cacache = require_lib$14();
|
|
112907
112983
|
const fsm = require_lib$13();
|
|
@@ -112927,7 +113003,7 @@ var require_file$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
112927
113003
|
#exeBins(pkg, dest) {
|
|
112928
113004
|
if (!pkg.bin) return Promise.resolve();
|
|
112929
113005
|
return Promise.all(Object.keys(pkg.bin).map(async (k) => {
|
|
112930
|
-
const script = resolve$
|
|
113006
|
+
const script = resolve$2(dest, pkg.bin[k]);
|
|
112931
113007
|
try {
|
|
112932
113008
|
const st = await stat(script);
|
|
112933
113009
|
const mode = st.mode | 73;
|
|
@@ -112978,7 +113054,7 @@ var require_tar_create_options = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
112978
113054
|
//#endregion
|
|
112979
113055
|
//#region ../../node_modules/pacote/lib/dir.js
|
|
112980
113056
|
var require_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
112981
|
-
const { resolve } = __require("node:path");
|
|
113057
|
+
const { resolve: resolve$1 } = __require("node:path");
|
|
112982
113058
|
const packlist = require_lib$9();
|
|
112983
113059
|
const runScript = require_run_script();
|
|
112984
113060
|
const tar = require_index_min();
|
|
@@ -113014,7 +113090,7 @@ var require_dir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
113014
113090
|
env: {
|
|
113015
113091
|
npm_package_resolved: this.resolved,
|
|
113016
113092
|
npm_package_integrity: this.integrity,
|
|
113017
|
-
npm_package_json: resolve(this.resolved, "package.json")
|
|
113093
|
+
npm_package_json: resolve$1(this.resolved, "package.json")
|
|
113018
113094
|
}
|
|
113019
113095
|
});
|
|
113020
113096
|
});
|
|
@@ -151753,9 +151829,14 @@ const script = async (page, log, filePath, username, password, version, download
|
|
|
151753
151829
|
await progressDialog.waitFor({ timeout: 0 });
|
|
151754
151830
|
log("Got loading progress dialog");
|
|
151755
151831
|
const progressInterval = setInterval(async () => {
|
|
151756
|
-
|
|
151757
|
-
|
|
151758
|
-
|
|
151832
|
+
try {
|
|
151833
|
+
const text = await progessBar.getAttribute("value", { timeout: 100 });
|
|
151834
|
+
if (text === null) return;
|
|
151835
|
+
const textAsNumber = parseFloat(text);
|
|
151836
|
+
log("progress", `${(Number.isNaN(textAsNumber) ? 0 : textAsNumber) * 100}%`);
|
|
151837
|
+
} catch {
|
|
151838
|
+
clearInterval(progressInterval);
|
|
151839
|
+
}
|
|
151759
151840
|
}, 500);
|
|
151760
151841
|
registerInstallButtonListener(page, log);
|
|
151761
151842
|
registerWebglErrorListener(page, log);
|
|
@@ -151768,7 +151849,7 @@ const script = async (page, log, filePath, username, password, version, download
|
|
|
151768
151849
|
timeout: 0
|
|
151769
151850
|
});
|
|
151770
151851
|
log("Got progress dialog to disapear");
|
|
151771
|
-
|
|
151852
|
+
clearInterval(progressInterval);
|
|
151772
151853
|
await page.getByRole("button", { name: "Menu" }).click();
|
|
151773
151854
|
await page.getByRole("menuitem", { name: "Project" }).click();
|
|
151774
151855
|
await page.getByRole("menuitem", { name: "Export" }).click();
|
|
@@ -151793,13 +151874,13 @@ const script = async (page, log, filePath, username, password, version, download
|
|
|
151793
151874
|
};
|
|
151794
151875
|
//#endregion
|
|
151795
151876
|
//#region src/export-shared.ts
|
|
151796
|
-
const platform$
|
|
151877
|
+
const platform$2 = process.platform;
|
|
151797
151878
|
const { LOCALAPPDATA, XDG_CONFIG_HOME } = process.env;
|
|
151798
151879
|
const isCI = process.env.CI === "true";
|
|
151799
151880
|
let baseProfile;
|
|
151800
|
-
if (platform$
|
|
151801
|
-
else if (platform$
|
|
151802
|
-
else if (platform$
|
|
151881
|
+
if (platform$2 === "win32") baseProfile = join(LOCALAPPDATA ?? "", "Google", "Chrome", "User Data");
|
|
151882
|
+
else if (platform$2 === "linux") baseProfile = join(XDG_CONFIG_HOME && XDG_CONFIG_HOME.trim() !== "" ? XDG_CONFIG_HOME : join(homedir(), ".config"), "google-chrome");
|
|
151883
|
+
else if (platform$2 === "darwin") baseProfile = join(homedir(), "Library", "Application Support", "Google", "Chrome");
|
|
151803
151884
|
const sharedParams = {
|
|
151804
151885
|
username: createStringParam("", {
|
|
151805
151886
|
label: "Username",
|
|
@@ -151890,16 +151971,27 @@ const exportc3p = async (file, { cwd, log, inputs, setOutput, paths, abortSignal
|
|
|
151890
151971
|
const headless = newInputs.headless;
|
|
151891
151972
|
if (newInputs.customProfile) {
|
|
151892
151973
|
const customProfile = join(cwd, "playwright-profile");
|
|
151974
|
+
log("Setting up Playwright profile from custom Chrome profile...");
|
|
151975
|
+
log(` - Target playwright-profile folder: ${customProfile}`);
|
|
151893
151976
|
await mkdir(customProfile, { recursive: true });
|
|
151894
151977
|
const indexedDbPathSource = join(newInputs.customProfile, "Default", "IndexedDB");
|
|
151895
151978
|
const indexedDbPathDestination = join(customProfile, "Default", "IndexedDB");
|
|
151979
|
+
log(` - Source IndexedDB folder: ${indexedDbPathSource}`);
|
|
151980
|
+
log(` - Destination IndexedDB folder: ${indexedDbPathDestination}`);
|
|
151981
|
+
if (!existsSync(indexedDbPathSource)) log(` [WARNING] Source IndexedDB directory does not exist: "${indexedDbPathSource}". Verify your custom profile path.`);
|
|
151896
151982
|
await mkdir(indexedDbPathDestination, { recursive: true });
|
|
151897
151983
|
for (const p of ["https_editor.construct.net_0.indexeddb.blob", "https_editor.construct.net_0.indexeddb.leveldb"]) {
|
|
151898
151984
|
const from = join(indexedDbPathSource, p);
|
|
151899
151985
|
const to = join(indexedDbPathDestination, p);
|
|
151900
|
-
|
|
151901
|
-
|
|
151902
|
-
|
|
151986
|
+
if (existsSync(from)) {
|
|
151987
|
+
log(` - Copying: "${p}" to "${indexedDbPathDestination}"`);
|
|
151988
|
+
try {
|
|
151989
|
+
await cp(from, to, { recursive: true });
|
|
151990
|
+
log(` [OK] Successfully copied "${p}"`);
|
|
151991
|
+
} catch (e) {
|
|
151992
|
+
log(` [ERROR] Failed to copy "${p}":`, e instanceof Error ? `${e.message}\n${e.stack}` : String(e));
|
|
151993
|
+
}
|
|
151994
|
+
} else log(` - Skipping: "${p}" (does not exist in source profile)`);
|
|
151903
151995
|
}
|
|
151904
151996
|
browserContext = await browserInstance.launchPersistentContext(customProfile, {
|
|
151905
151997
|
headless,
|