@pipelab/plugin-filesystem 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/index.cjs +270 -103
- package/dist/index.mjs +224 -60
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -45391,6 +45391,17 @@ const websocketPort = 33753;
|
|
|
45391
45391
|
const metaUrl = require("url").pathToFileURL(__filename).href;
|
|
45392
45392
|
const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
|
|
45393
45393
|
const isDev = process.env.NODE_ENV === "development";
|
|
45394
|
+
const getDefaultUserDataPath = (env) => {
|
|
45395
|
+
const base = (() => {
|
|
45396
|
+
switch ((0, node_os.platform)()) {
|
|
45397
|
+
case "win32": return process.env.APPDATA || (0, node_path.join)((0, node_os.homedir)(), "AppData", "Roaming");
|
|
45398
|
+
case "darwin": return (0, node_path.join)((0, node_os.homedir)(), "Library", "Application Support");
|
|
45399
|
+
default: return process.env.XDG_CONFIG_HOME || (0, node_path.join)((0, node_os.homedir)(), ".config");
|
|
45400
|
+
}
|
|
45401
|
+
})();
|
|
45402
|
+
const mode = env ?? (isDev ? "dev" : "prod");
|
|
45403
|
+
return (0, node_path.join)(base, "@pipelab", mode === "dev" ? "app-dev" : mode === "beta" ? "app-beta" : "app");
|
|
45404
|
+
};
|
|
45394
45405
|
/**
|
|
45395
45406
|
* Finds the monorepo root by looking for pnpm-workspace.yaml.
|
|
45396
45407
|
*/
|
|
@@ -49152,6 +49163,124 @@ var WebSocketServer = class {
|
|
|
49152
49163
|
};
|
|
49153
49164
|
new WebSocketServer();
|
|
49154
49165
|
//#endregion
|
|
49166
|
+
//#region ../../node_modules/slash/index.js
|
|
49167
|
+
var require_slash = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
49168
|
+
module.exports = (path) => {
|
|
49169
|
+
const isExtendedLengthPath = /^\\\\\?\\/.test(path);
|
|
49170
|
+
const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
|
|
49171
|
+
if (isExtendedLengthPath || hasNonAscii) return path;
|
|
49172
|
+
return path.replace(/\\/g, "/");
|
|
49173
|
+
};
|
|
49174
|
+
}));
|
|
49175
|
+
//#endregion
|
|
49176
|
+
//#region ../../packages/core-node/src/fs-utils.ts
|
|
49177
|
+
var import_slash = /* @__PURE__ */ require_chunk.__toESM(require_slash(), 1);
|
|
49178
|
+
function removeTrailingSlash(path) {
|
|
49179
|
+
return path.replace(/[\\/]+$/, "");
|
|
49180
|
+
}
|
|
49181
|
+
function isWindowsDriveRoot(path) {
|
|
49182
|
+
return /^[a-z]:$/.test(path);
|
|
49183
|
+
}
|
|
49184
|
+
const windowsSystemFolders = [
|
|
49185
|
+
"windows",
|
|
49186
|
+
"program files",
|
|
49187
|
+
"program files (x86)",
|
|
49188
|
+
"users",
|
|
49189
|
+
"programdata",
|
|
49190
|
+
"perflogs"
|
|
49191
|
+
];
|
|
49192
|
+
function isWindowsSystemDirectory(path) {
|
|
49193
|
+
if (!isWindowsDriveRoot(path.substring(0, 2)) || path.charAt(2) !== "/") return false;
|
|
49194
|
+
const folder = path.substring(3);
|
|
49195
|
+
return windowsSystemFolders.includes(folder);
|
|
49196
|
+
}
|
|
49197
|
+
const unixSystemDirectories = new Set([
|
|
49198
|
+
"",
|
|
49199
|
+
"/usr",
|
|
49200
|
+
"/var",
|
|
49201
|
+
"/opt",
|
|
49202
|
+
"/etc",
|
|
49203
|
+
"/bin",
|
|
49204
|
+
"/sbin",
|
|
49205
|
+
"/lib",
|
|
49206
|
+
"/lib64",
|
|
49207
|
+
"/boot",
|
|
49208
|
+
"/sys",
|
|
49209
|
+
"/proc",
|
|
49210
|
+
"/dev",
|
|
49211
|
+
"/run",
|
|
49212
|
+
"/home",
|
|
49213
|
+
"/root",
|
|
49214
|
+
"/mnt",
|
|
49215
|
+
"/media",
|
|
49216
|
+
"/srv",
|
|
49217
|
+
"/applications",
|
|
49218
|
+
"/library",
|
|
49219
|
+
"/system",
|
|
49220
|
+
"/volumes",
|
|
49221
|
+
"/snap"
|
|
49222
|
+
]);
|
|
49223
|
+
const homeDirectory = removeTrailingSlash((0, import_slash.default)((0, node_path.resolve)((0, node_os.homedir)()))).toLowerCase();
|
|
49224
|
+
const additionalProtectedPaths = [
|
|
49225
|
+
getDefaultUserDataPath("dev"),
|
|
49226
|
+
getDefaultUserDataPath("beta"),
|
|
49227
|
+
getDefaultUserDataPath("prod"),
|
|
49228
|
+
projectRoot,
|
|
49229
|
+
process.cwd(),
|
|
49230
|
+
"/tmp",
|
|
49231
|
+
"/var/tmp",
|
|
49232
|
+
process.env.TEMP,
|
|
49233
|
+
process.env.TMP,
|
|
49234
|
+
(0, node_path.join)((0, node_os.homedir)(), "AppData"),
|
|
49235
|
+
(0, node_path.join)((0, node_os.homedir)(), "AppData", "Local"),
|
|
49236
|
+
(0, node_path.join)((0, node_os.homedir)(), "AppData", "Roaming"),
|
|
49237
|
+
(0, node_path.join)((0, node_os.homedir)(), "Library"),
|
|
49238
|
+
(0, node_path.join)((0, node_os.homedir)(), "Library", "Application Support"),
|
|
49239
|
+
(0, node_path.join)((0, node_os.homedir)(), ".config"),
|
|
49240
|
+
(0, node_path.join)((0, node_os.homedir)(), ".local"),
|
|
49241
|
+
(0, node_path.join)((0, node_os.homedir)(), ".local", "share"),
|
|
49242
|
+
(0, node_path.join)((0, node_os.homedir)(), ".cache"),
|
|
49243
|
+
(0, node_path.join)((0, node_os.homedir)(), "OneDrive"),
|
|
49244
|
+
(0, node_path.join)((0, node_os.homedir)(), "Dropbox"),
|
|
49245
|
+
(0, node_path.join)((0, node_os.homedir)(), ".ssh"),
|
|
49246
|
+
(0, node_path.join)((0, node_os.homedir)(), ".gnupg"),
|
|
49247
|
+
(0, node_path.join)((0, node_os.homedir)(), ".aws"),
|
|
49248
|
+
(0, node_path.join)((0, node_os.homedir)(), ".docker"),
|
|
49249
|
+
(0, node_path.join)((0, node_os.homedir)(), ".kube"),
|
|
49250
|
+
(0, node_path.join)((0, node_os.homedir)(), ".vscode"),
|
|
49251
|
+
(0, node_path.join)((0, node_os.homedir)(), ".vscode-insiders"),
|
|
49252
|
+
(0, node_path.join)((0, node_os.homedir)(), ".cursor"),
|
|
49253
|
+
(0, node_path.join)((0, node_os.homedir)(), ".npm"),
|
|
49254
|
+
(0, node_path.join)((0, node_os.homedir)(), ".pnpm-state"),
|
|
49255
|
+
(0, node_path.join)((0, node_os.homedir)(), ".yarn"),
|
|
49256
|
+
(0, node_path.join)((0, node_os.homedir)(), ".cargo"),
|
|
49257
|
+
(0, node_path.join)((0, node_os.homedir)(), ".rustup"),
|
|
49258
|
+
(0, node_path.join)((0, node_os.homedir)(), ".m2"),
|
|
49259
|
+
(0, node_path.join)((0, node_os.homedir)(), ".gradle")
|
|
49260
|
+
].filter((p) => typeof p === "string" && p.length > 0);
|
|
49261
|
+
const userSubdirectories = new Set([
|
|
49262
|
+
(0, node_path.join)((0, node_os.homedir)(), "Downloads"),
|
|
49263
|
+
(0, node_path.join)((0, node_os.homedir)(), "Documents"),
|
|
49264
|
+
(0, node_path.join)((0, node_os.homedir)(), "Desktop"),
|
|
49265
|
+
(0, node_path.join)((0, node_os.homedir)(), "Pictures"),
|
|
49266
|
+
(0, node_path.join)((0, node_os.homedir)(), "Music"),
|
|
49267
|
+
(0, node_path.join)((0, node_os.homedir)(), "Videos"),
|
|
49268
|
+
(0, node_path.join)((0, node_os.homedir)(), "Saved Games"),
|
|
49269
|
+
(0, node_path.join)((0, node_os.homedir)(), "Contacts"),
|
|
49270
|
+
(0, node_path.join)((0, node_os.homedir)(), "Searches"),
|
|
49271
|
+
(0, node_path.join)((0, node_os.homedir)(), "Links"),
|
|
49272
|
+
(0, node_path.join)((0, node_os.homedir)(), "3D Objects"),
|
|
49273
|
+
...additionalProtectedPaths
|
|
49274
|
+
].map((p) => removeTrailingSlash((0, import_slash.default)((0, node_path.resolve)(p))).toLowerCase()));
|
|
49275
|
+
/**
|
|
49276
|
+
* Checks if a path matches a critical user or system directory.
|
|
49277
|
+
*/
|
|
49278
|
+
function isPathBlacklisted(pathToCheck) {
|
|
49279
|
+
if (!pathToCheck) return false;
|
|
49280
|
+
const normalized = removeTrailingSlash((0, import_slash.default)((0, node_path.resolve)(pathToCheck))).toLowerCase();
|
|
49281
|
+
return normalized === homeDirectory || unixSystemDirectories.has(normalized) || userSubdirectories.has(normalized) || isWindowsDriveRoot(normalized) || isWindowsSystemDirectory(normalized);
|
|
49282
|
+
}
|
|
49283
|
+
//#endregion
|
|
49155
49284
|
//#region ../../node_modules/is-plain-obj/index.js
|
|
49156
49285
|
function isPlainObject(value) {
|
|
49157
49286
|
if (typeof value !== "object" || value === null) return false;
|
|
@@ -59545,13 +59674,13 @@ var require_opts_arg = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
59545
59674
|
//#region ../../node_modules/mkdirp/lib/path-arg.js
|
|
59546
59675
|
var require_path_arg = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
59547
59676
|
const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
|
|
59548
|
-
const { resolve: resolve$
|
|
59677
|
+
const { resolve: resolve$14, parse: parse$2 } = require("path");
|
|
59549
59678
|
const pathArg = (path$85) => {
|
|
59550
59679
|
if (/\0/.test(path$85)) throw Object.assign(/* @__PURE__ */ new TypeError("path must be a string without null bytes"), {
|
|
59551
59680
|
path: path$85,
|
|
59552
59681
|
code: "ERR_INVALID_ARG_VALUE"
|
|
59553
59682
|
});
|
|
59554
|
-
path$85 = resolve$
|
|
59683
|
+
path$85 = resolve$14(path$85);
|
|
59555
59684
|
if (platform === "win32") {
|
|
59556
59685
|
const badWinChars = /[*|"<>?:]/;
|
|
59557
59686
|
const { root } = parse$2(path$85);
|
|
@@ -59969,14 +60098,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
59969
60098
|
const assert$1 = require("assert");
|
|
59970
60099
|
const normalize = require_normalize_unicode();
|
|
59971
60100
|
const stripSlashes = require_strip_trailing_slashes();
|
|
59972
|
-
const { join: join$
|
|
60101
|
+
const { join: join$20 } = require("path");
|
|
59973
60102
|
const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
|
|
59974
60103
|
module.exports = () => {
|
|
59975
60104
|
const queues = /* @__PURE__ */ new Map();
|
|
59976
60105
|
const reservations = /* @__PURE__ */ new Map();
|
|
59977
60106
|
const getDirs = (path$62) => {
|
|
59978
60107
|
return path$62.split("/").slice(0, -1).reduce((set, path$63) => {
|
|
59979
|
-
if (set.length) path$63 = join$
|
|
60108
|
+
if (set.length) path$63 = join$20(set[set.length - 1], path$63);
|
|
59980
60109
|
set.push(path$63 || "/");
|
|
59981
60110
|
return set;
|
|
59982
60111
|
}, []);
|
|
@@ -60030,7 +60159,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
60030
60159
|
};
|
|
60031
60160
|
const reserve = (paths, fn) => {
|
|
60032
60161
|
paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
|
|
60033
|
-
return stripSlashes(join$
|
|
60162
|
+
return stripSlashes(join$20(normalize(p))).toLowerCase();
|
|
60034
60163
|
});
|
|
60035
60164
|
const dirs = new Set(paths.map((path$67) => getDirs(path$67)).reduce((a, b) => a.concat(b)));
|
|
60036
60165
|
reservations.set(fn, {
|
|
@@ -62501,7 +62630,7 @@ var require_readdir_glob = /* @__PURE__ */ require_chunk.__commonJSMin(((exports
|
|
|
62501
62630
|
const fs$23 = require("fs");
|
|
62502
62631
|
const { EventEmitter } = require("events");
|
|
62503
62632
|
const { Minimatch } = require_minimatch$1();
|
|
62504
|
-
const { resolve: resolve$
|
|
62633
|
+
const { resolve: resolve$13 } = require("path");
|
|
62505
62634
|
function readdir(dir, strict) {
|
|
62506
62635
|
return new Promise((resolve, reject) => {
|
|
62507
62636
|
fs$23.readdir(dir, { withFileTypes: true }, (err, files) => {
|
|
@@ -62610,7 +62739,7 @@ var require_readdir_glob = /* @__PURE__ */ require_chunk.__commonJSMin(((exports
|
|
|
62610
62739
|
if (this.options.ignore) this.ignoreMatchers = (Array.isArray(this.options.ignore) ? this.options.ignore : [this.options.ignore]).map((ignore) => new Minimatch(ignore, { dot: true }));
|
|
62611
62740
|
this.skipMatchers = [];
|
|
62612
62741
|
if (this.options.skip) this.skipMatchers = (Array.isArray(this.options.skip) ? this.options.skip : [this.options.skip]).map((skip) => new Minimatch(skip, { dot: true }));
|
|
62613
|
-
this.iterator = explore(resolve$
|
|
62742
|
+
this.iterator = explore(resolve$13(cwd || "."), this.options.follow, this.options.stat, this._shouldSkipDirectory.bind(this));
|
|
62614
62743
|
this.paused = false;
|
|
62615
62744
|
this.inactive = false;
|
|
62616
62745
|
this.aborted = false;
|
|
@@ -95711,7 +95840,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
95711
95840
|
//#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
|
|
95712
95841
|
var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
95713
95842
|
const { isexe, sync: isexeSync } = require_index_min$3();
|
|
95714
|
-
const { join: join$
|
|
95843
|
+
const { join: join$17, delimiter: delimiter$3, sep: sep$4, posix: posix$1 } = require("path");
|
|
95715
95844
|
const isWindows = process.platform === "win32";
|
|
95716
95845
|
/* istanbul ignore next */
|
|
95717
95846
|
const rSlash = new RegExp(`[${posix$1.sep}${sep$4 === posix$1.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -95741,7 +95870,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
95741
95870
|
};
|
|
95742
95871
|
const getPathPart = (raw, cmd) => {
|
|
95743
95872
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
95744
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
95873
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$17(pathPart, cmd);
|
|
95745
95874
|
};
|
|
95746
95875
|
const which = async (cmd, opt = {}) => {
|
|
95747
95876
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -96490,7 +96619,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
96490
96619
|
//#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
|
|
96491
96620
|
var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
96492
96621
|
const { isexe, sync: isexeSync } = require_index_min$2();
|
|
96493
|
-
const { join: join$
|
|
96622
|
+
const { join: join$16, delimiter: delimiter$2, sep: sep$3, posix } = require("path");
|
|
96494
96623
|
const isWindows = process.platform === "win32";
|
|
96495
96624
|
/* istanbul ignore next */
|
|
96496
96625
|
const rSlash = new RegExp(`[${posix.sep}${sep$3 === posix.sep ? "" : sep$3}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -96520,7 +96649,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
96520
96649
|
};
|
|
96521
96650
|
const getPathPart = (raw, cmd) => {
|
|
96522
96651
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
96523
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
96652
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$16(pathPart, cmd);
|
|
96524
96653
|
};
|
|
96525
96654
|
const which = async (cmd, opt = {}) => {
|
|
96526
96655
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -98418,7 +98547,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98418
98547
|
//#endregion
|
|
98419
98548
|
//#region ../../node_modules/npm-normalize-package-bin/lib/index.js
|
|
98420
98549
|
var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
98421
|
-
const { join: join$
|
|
98550
|
+
const { join: join$15, basename: basename$5 } = require("path");
|
|
98422
98551
|
const normalize = (pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg);
|
|
98423
98552
|
const normalizeString = (pkg) => {
|
|
98424
98553
|
if (!pkg.name) return removeBin(pkg);
|
|
@@ -98441,9 +98570,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98441
98570
|
const clean = {};
|
|
98442
98571
|
let hasBins = false;
|
|
98443
98572
|
Object.keys(orig).forEach((binKey) => {
|
|
98444
|
-
const base = join$
|
|
98573
|
+
const base = join$15("/", basename$5(binKey.replace(/\\|:/g, "/"))).slice(1);
|
|
98445
98574
|
if (typeof orig[binKey] !== "string" || !base) return;
|
|
98446
|
-
const binTarget = join$
|
|
98575
|
+
const binTarget = join$15("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
|
|
98447
98576
|
if (!binTarget) return;
|
|
98448
98577
|
clean[base] = binTarget;
|
|
98449
98578
|
hasBins = true;
|
|
@@ -98709,8 +98838,8 @@ var require_clone = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
98709
98838
|
//#endregion
|
|
98710
98839
|
//#region ../../node_modules/@npmcli/git/lib/is.js
|
|
98711
98840
|
var require_is = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
98712
|
-
const { stat: stat$
|
|
98713
|
-
module.exports = ({ cwd = process.cwd() } = {}) => stat$
|
|
98841
|
+
const { stat: stat$8 } = require("fs/promises");
|
|
98842
|
+
module.exports = ({ cwd = process.cwd() } = {}) => stat$8(cwd + "/.git").then(() => true, () => false);
|
|
98714
98843
|
}));
|
|
98715
98844
|
//#endregion
|
|
98716
98845
|
//#region ../../node_modules/@npmcli/git/lib/find.js
|
|
@@ -99244,8 +99373,8 @@ var require_sort$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
99244
99373
|
//#endregion
|
|
99245
99374
|
//#region ../../node_modules/@npmcli/package-json/lib/index.js
|
|
99246
99375
|
var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
99247
|
-
const { readFile: readFile$8, writeFile: writeFile$
|
|
99248
|
-
const { resolve: resolve$
|
|
99376
|
+
const { readFile: readFile$8, writeFile: writeFile$4 } = require("node:fs/promises");
|
|
99377
|
+
const { resolve: resolve$12 } = require("node:path");
|
|
99249
99378
|
const parseJSON = require_lib$30();
|
|
99250
99379
|
const updateDeps = require_update_dependencies();
|
|
99251
99380
|
const updateScripts = require_update_scripts();
|
|
@@ -99348,7 +99477,7 @@ var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
99348
99477
|
parseErr = err;
|
|
99349
99478
|
}
|
|
99350
99479
|
if (parseErr) {
|
|
99351
|
-
const indexFile = resolve$
|
|
99480
|
+
const indexFile = resolve$12(this.path, "index.js");
|
|
99352
99481
|
let indexFileContent;
|
|
99353
99482
|
try {
|
|
99354
99483
|
indexFileContent = await readFile$8(indexFile, "utf8");
|
|
@@ -99393,7 +99522,7 @@ var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
99393
99522
|
return this.#path;
|
|
99394
99523
|
}
|
|
99395
99524
|
get filename() {
|
|
99396
|
-
if (this.path) return resolve$
|
|
99525
|
+
if (this.path) return resolve$12(this.path, "package.json");
|
|
99397
99526
|
}
|
|
99398
99527
|
create(path) {
|
|
99399
99528
|
this.#path = path;
|
|
@@ -99417,7 +99546,7 @@ var require_lib$18 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
99417
99546
|
const content = sort ? packageSort(rest) : rest;
|
|
99418
99547
|
const fileContent = `${JSON.stringify(content, null, format)}\n`.replace(/\n/g, eol);
|
|
99419
99548
|
if (fileContent.trim() !== this.#readFileContent.trim()) {
|
|
99420
|
-
const written = await writeFile$
|
|
99549
|
+
const written = await writeFile$4(this.filename, fileContent);
|
|
99421
99550
|
this.#readFileContent = fileContent;
|
|
99422
99551
|
return written;
|
|
99423
99552
|
}
|
|
@@ -100515,8 +100644,8 @@ var require_errors$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100515
100644
|
var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100516
100645
|
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();
|
|
100517
100646
|
const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
|
|
100518
|
-
const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$
|
|
100519
|
-
const { dirname: dirname$10, isAbsolute: isAbsolute$2, join: join$
|
|
100647
|
+
const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$9, readdir: readdir$7, readlink, stat: stat$7, symlink, unlink, utimes } = require("fs/promises");
|
|
100648
|
+
const { dirname: dirname$10, isAbsolute: isAbsolute$2, join: join$14, parse, resolve: resolve$11, sep: sep$2, toNamespacedPath } = require("path");
|
|
100520
100649
|
const { fileURLToPath } = require("url");
|
|
100521
100650
|
const defaultOptions = {
|
|
100522
100651
|
dereference: false,
|
|
@@ -100581,7 +100710,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100581
100710
|
return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev;
|
|
100582
100711
|
}
|
|
100583
100712
|
function getStats(src, dest, opts) {
|
|
100584
|
-
const statFunc = opts.dereference ? (file) => stat$
|
|
100713
|
+
const statFunc = opts.dereference ? (file) => stat$7(file, { bigint: true }) : (file) => lstat$2(file, { bigint: true });
|
|
100585
100714
|
return Promise.all([statFunc(src), statFunc(dest).catch((err) => {
|
|
100586
100715
|
// istanbul ignore next: unsure how to cover.
|
|
100587
100716
|
if (err.code === "ENOENT") return null;
|
|
@@ -100592,23 +100721,23 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100592
100721
|
async function checkParentDir(destStat, src, dest, opts) {
|
|
100593
100722
|
const destParent = dirname$10(dest);
|
|
100594
100723
|
if (await pathExists(destParent)) return getStatsForCopy(destStat, src, dest, opts);
|
|
100595
|
-
await mkdir$
|
|
100724
|
+
await mkdir$9(destParent, { recursive: true });
|
|
100596
100725
|
return getStatsForCopy(destStat, src, dest, opts);
|
|
100597
100726
|
}
|
|
100598
100727
|
function pathExists(dest) {
|
|
100599
|
-
return stat$
|
|
100728
|
+
return stat$7(dest).then(
|
|
100600
100729
|
() => true,
|
|
100601
100730
|
// istanbul ignore next: not sure when this would occur
|
|
100602
100731
|
(err) => err.code === "ENOENT" ? false : Promise.reject(err)
|
|
100603
100732
|
);
|
|
100604
100733
|
}
|
|
100605
100734
|
async function checkParentPaths(src, srcStat, dest) {
|
|
100606
|
-
const srcParent = resolve$
|
|
100607
|
-
const destParent = resolve$
|
|
100735
|
+
const srcParent = resolve$11(dirname$10(src));
|
|
100736
|
+
const destParent = resolve$11(dirname$10(dest));
|
|
100608
100737
|
if (destParent === srcParent || destParent === parse(destParent).root) return;
|
|
100609
100738
|
let destStat;
|
|
100610
100739
|
try {
|
|
100611
|
-
destStat = await stat$
|
|
100740
|
+
destStat = await stat$7(destParent, { bigint: true });
|
|
100612
100741
|
} catch (err) {
|
|
100613
100742
|
// istanbul ignore else: not sure when this would occur
|
|
100614
100743
|
if (err.code === "ENOENT") return;
|
|
@@ -100623,7 +100752,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100623
100752
|
});
|
|
100624
100753
|
return checkParentPaths(src, srcStat, destParent);
|
|
100625
100754
|
}
|
|
100626
|
-
const normalizePathToArray = (path$55) => resolve$
|
|
100755
|
+
const normalizePathToArray = (path$55) => resolve$11(path$55).split(sep$2).filter(Boolean);
|
|
100627
100756
|
function isSrcSubdir(src, dest) {
|
|
100628
100757
|
const srcArr = normalizePathToArray(src);
|
|
100629
100758
|
const destArr = normalizePathToArray(dest);
|
|
@@ -100637,7 +100766,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100637
100766
|
return getStatsForCopy(destStat, src, dest, opts);
|
|
100638
100767
|
}
|
|
100639
100768
|
async function getStatsForCopy(destStat, src, dest, opts) {
|
|
100640
|
-
const srcStat = await (opts.dereference ? stat$
|
|
100769
|
+
const srcStat = await (opts.dereference ? stat$7 : lstat$2)(src);
|
|
100641
100770
|
// istanbul ignore else: can't portably test FIFO
|
|
100642
100771
|
if (srcStat.isDirectory() && opts.recursive) return onDir(srcStat, destStat, src, dest, opts);
|
|
100643
100772
|
else if (srcStat.isDirectory()) throw new ERR_FS_EISDIR({
|
|
@@ -100709,7 +100838,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100709
100838
|
return chmod$2(dest, srcMode);
|
|
100710
100839
|
}
|
|
100711
100840
|
async function setDestTimestamps(src, dest) {
|
|
100712
|
-
const updatedSrcStat = await stat$
|
|
100841
|
+
const updatedSrcStat = await stat$7(src);
|
|
100713
100842
|
return utimes(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
|
|
100714
100843
|
}
|
|
100715
100844
|
function onDir(srcStat, destStat, src, dest, opts) {
|
|
@@ -100717,23 +100846,23 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100717
100846
|
return copyDir(src, dest, opts);
|
|
100718
100847
|
}
|
|
100719
100848
|
async function mkDirAndCopy(srcMode, src, dest, opts) {
|
|
100720
|
-
await mkdir$
|
|
100849
|
+
await mkdir$9(dest);
|
|
100721
100850
|
await copyDir(src, dest, opts);
|
|
100722
100851
|
return setDestMode(dest, srcMode);
|
|
100723
100852
|
}
|
|
100724
100853
|
async function copyDir(src, dest, opts) {
|
|
100725
|
-
const dir = await readdir$
|
|
100854
|
+
const dir = await readdir$7(src);
|
|
100726
100855
|
for (let i = 0; i < dir.length; i++) {
|
|
100727
100856
|
const item = dir[i];
|
|
100728
|
-
const srcItem = join$
|
|
100729
|
-
const destItem = join$
|
|
100857
|
+
const srcItem = join$14(src, item);
|
|
100858
|
+
const destItem = join$14(dest, item);
|
|
100730
100859
|
const { destStat } = await checkPaths(srcItem, destItem, opts);
|
|
100731
100860
|
await startCopy(destStat, srcItem, destItem, opts);
|
|
100732
100861
|
}
|
|
100733
100862
|
}
|
|
100734
100863
|
async function onLink(destStat, src, dest) {
|
|
100735
100864
|
let resolvedSrc = await readlink(src);
|
|
100736
|
-
if (!isAbsolute$2(resolvedSrc)) resolvedSrc = resolve$
|
|
100865
|
+
if (!isAbsolute$2(resolvedSrc)) resolvedSrc = resolve$11(dirname$10(src), resolvedSrc);
|
|
100737
100866
|
if (!destStat) return symlink(resolvedSrc, dest);
|
|
100738
100867
|
let resolvedDest;
|
|
100739
100868
|
try {
|
|
@@ -100744,14 +100873,14 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100744
100873
|
// istanbul ignore next: should not be possible
|
|
100745
100874
|
throw err;
|
|
100746
100875
|
}
|
|
100747
|
-
if (!isAbsolute$2(resolvedDest)) resolvedDest = resolve$
|
|
100876
|
+
if (!isAbsolute$2(resolvedDest)) resolvedDest = resolve$11(dirname$10(dest), resolvedDest);
|
|
100748
100877
|
if (isSrcSubdir(resolvedSrc, resolvedDest)) throw new ERR_FS_CP_EINVAL({
|
|
100749
100878
|
message: `cannot copy ${resolvedSrc} to a subdirectory of self ${resolvedDest}`,
|
|
100750
100879
|
path: dest,
|
|
100751
100880
|
syscall: "cp",
|
|
100752
100881
|
errno: EINVAL
|
|
100753
100882
|
});
|
|
100754
|
-
if ((await stat$
|
|
100883
|
+
if ((await stat$7(src)).isDirectory() && isSrcSubdir(resolvedDest, resolvedSrc)) throw new ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY({
|
|
100755
100884
|
message: `cannot overwrite ${resolvedDest} with ${resolvedSrc}`,
|
|
100756
100885
|
path: dest,
|
|
100757
100886
|
syscall: "cp",
|
|
@@ -100790,13 +100919,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
100790
100919
|
//#endregion
|
|
100791
100920
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
|
|
100792
100921
|
var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100793
|
-
const { join: join$
|
|
100922
|
+
const { join: join$13, sep: sep$1 } = require("path");
|
|
100794
100923
|
const getOptions = require_get_options();
|
|
100795
|
-
const { mkdir: mkdir$
|
|
100924
|
+
const { mkdir: mkdir$8, mkdtemp, rm: rm$10 } = require("fs/promises");
|
|
100796
100925
|
const withTempDir = async (root, fn, opts) => {
|
|
100797
100926
|
const options = getOptions(opts, { copy: ["tmpPrefix"] });
|
|
100798
|
-
await mkdir$
|
|
100799
|
-
const target = await mkdtemp(join$
|
|
100927
|
+
await mkdir$8(root, { recursive: true });
|
|
100928
|
+
const target = await mkdtemp(join$13(`${root}${sep$1}`, options.tmpPrefix || ""));
|
|
100800
100929
|
let err;
|
|
100801
100930
|
let result;
|
|
100802
100931
|
try {
|
|
@@ -100818,11 +100947,11 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
|
|
|
100818
100947
|
//#endregion
|
|
100819
100948
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
|
|
100820
100949
|
var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100821
|
-
const { readdir: readdir$
|
|
100822
|
-
const { join: join$
|
|
100950
|
+
const { readdir: readdir$6 } = require("fs/promises");
|
|
100951
|
+
const { join: join$12 } = require("path");
|
|
100823
100952
|
const readdirScoped = async (dir) => {
|
|
100824
100953
|
const results = [];
|
|
100825
|
-
for (const item of await readdir$
|
|
100954
|
+
for (const item of await readdir$6(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$6(join$12(dir, item))) results.push(join$12(item, scopedItem));
|
|
100826
100955
|
else results.push(item);
|
|
100827
100956
|
return results;
|
|
100828
100957
|
};
|
|
@@ -100831,7 +100960,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
|
|
|
100831
100960
|
//#endregion
|
|
100832
100961
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
|
|
100833
100962
|
var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100834
|
-
const { dirname: dirname$9, join: join$
|
|
100963
|
+
const { dirname: dirname$9, join: join$11, resolve: resolve$10, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
|
|
100835
100964
|
const fs$14 = require("fs/promises");
|
|
100836
100965
|
const pathExists = async (path$54) => {
|
|
100837
100966
|
try {
|
|
@@ -100856,7 +100985,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
100856
100985
|
const sourceStat = await fs$14.lstat(source);
|
|
100857
100986
|
if (sourceStat.isDirectory()) {
|
|
100858
100987
|
const files = await fs$14.readdir(source);
|
|
100859
|
-
await Promise.all(files.map((file) => moveFile(join$
|
|
100988
|
+
await Promise.all(files.map((file) => moveFile(join$11(source, file), join$11(destination, file), options, false, symlinks)));
|
|
100860
100989
|
} else if (sourceStat.isSymbolicLink()) symlinks.push({
|
|
100861
100990
|
source,
|
|
100862
100991
|
destination
|
|
@@ -100867,10 +100996,10 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
100867
100996
|
if (root) {
|
|
100868
100997
|
await Promise.all(symlinks.map(async ({ source: symSource, destination: symDestination }) => {
|
|
100869
100998
|
let target = await fs$14.readlink(symSource);
|
|
100870
|
-
if (isAbsolute$1(target)) target = resolve$
|
|
100999
|
+
if (isAbsolute$1(target)) target = resolve$10(symDestination, relative$1(symSource, target));
|
|
100871
101000
|
let targetStat = "file";
|
|
100872
101001
|
try {
|
|
100873
|
-
targetStat = await fs$14.stat(resolve$
|
|
101002
|
+
targetStat = await fs$14.stat(resolve$10(dirname$9(symSource), target));
|
|
100874
101003
|
if (targetStat.isDirectory()) targetStat = "junction";
|
|
100875
101004
|
} catch {}
|
|
100876
101005
|
await fs$14.symlink(target, symDestination, targetStat);
|
|
@@ -101032,7 +101161,7 @@ var require_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
|
|
|
101032
101161
|
//#region ../../node_modules/cacache/lib/entry-index.js
|
|
101033
101162
|
var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
101034
101163
|
const crypto$1 = require("crypto");
|
|
101035
|
-
const { appendFile, mkdir: mkdir$
|
|
101164
|
+
const { appendFile, mkdir: mkdir$7, readFile: readFile$7, readdir: readdir$5, rm: rm$9, writeFile: writeFile$3 } = require("fs/promises");
|
|
101036
101165
|
const { Minipass } = require_commonjs$10();
|
|
101037
101166
|
const path$15 = require("path");
|
|
101038
101167
|
const ssri = require_lib$17();
|
|
@@ -101066,7 +101195,7 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
|
|
|
101066
101195
|
}).join("\n");
|
|
101067
101196
|
const setup = async () => {
|
|
101068
101197
|
const target = tmpName(cache, opts.tmpPrefix);
|
|
101069
|
-
await mkdir$
|
|
101198
|
+
await mkdir$7(path$15.dirname(target), { recursive: true });
|
|
101070
101199
|
return {
|
|
101071
101200
|
target,
|
|
101072
101201
|
moved: false
|
|
@@ -101079,8 +101208,8 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
|
|
|
101079
101208
|
});
|
|
101080
101209
|
};
|
|
101081
101210
|
const write = async (tmp) => {
|
|
101082
|
-
await writeFile$
|
|
101083
|
-
await mkdir$
|
|
101211
|
+
await writeFile$3(tmp.target, newIndex, { flag: "wx" });
|
|
101212
|
+
await mkdir$7(path$15.dirname(bucket), { recursive: true });
|
|
101084
101213
|
await moveFile(tmp.target, bucket);
|
|
101085
101214
|
tmp.moved = true;
|
|
101086
101215
|
};
|
|
@@ -101104,7 +101233,7 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
|
|
|
101104
101233
|
metadata
|
|
101105
101234
|
};
|
|
101106
101235
|
try {
|
|
101107
|
-
await mkdir$
|
|
101236
|
+
await mkdir$7(path$15.dirname(bucket), { recursive: true });
|
|
101108
101237
|
const stringified = JSON.stringify(entry);
|
|
101109
101238
|
await appendFile(bucket, `\n${hashEntry(stringified)}\t${stringified}`);
|
|
101110
101239
|
} catch (err) {
|
|
@@ -101225,7 +101354,7 @@ var require_entry_index = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
|
|
|
101225
101354
|
};
|
|
101226
101355
|
}
|
|
101227
101356
|
function readdirOrEmpty(dir) {
|
|
101228
|
-
return readdir$
|
|
101357
|
+
return readdir$5(dir).catch((err) => {
|
|
101229
101358
|
if (err.code === "ENOENT" || err.code === "ENOTDIR") return [];
|
|
101230
101359
|
throw err;
|
|
101231
101360
|
});
|
|
@@ -105947,7 +106076,7 @@ var require_rm = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
105947
106076
|
//#endregion
|
|
105948
106077
|
//#region ../../node_modules/cacache/lib/verify.js
|
|
105949
106078
|
var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
105950
|
-
const { mkdir: mkdir$
|
|
106079
|
+
const { mkdir: mkdir$6, readFile: readFile$6, rm: rm$7, stat: stat$6, truncate, writeFile: writeFile$2 } = require("fs/promises");
|
|
105951
106080
|
const contentPath = require_path();
|
|
105952
106081
|
const fsm = require_lib$15();
|
|
105953
106082
|
const glob = require_glob();
|
|
@@ -105997,7 +106126,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
105997
106126
|
}
|
|
105998
106127
|
async function fixPerms(cache, opts) {
|
|
105999
106128
|
opts.log.silly("verify", "fixing cache permissions");
|
|
106000
|
-
await mkdir$
|
|
106129
|
+
await mkdir$6(cache, { recursive: true });
|
|
106001
106130
|
return null;
|
|
106002
106131
|
}
|
|
106003
106132
|
async function garbageCollect(cache, opts) {
|
|
@@ -106043,7 +106172,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
106043
106172
|
}
|
|
106044
106173
|
} else {
|
|
106045
106174
|
stats.reclaimedCount++;
|
|
106046
|
-
const s = await stat$
|
|
106175
|
+
const s = await stat$6(f);
|
|
106047
106176
|
await rm$7(f, {
|
|
106048
106177
|
recursive: true,
|
|
106049
106178
|
force: true
|
|
@@ -106057,7 +106186,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
106057
106186
|
async function verifyContent(filepath, sri) {
|
|
106058
106187
|
const contentInfo = {};
|
|
106059
106188
|
try {
|
|
106060
|
-
const { size } = await stat$
|
|
106189
|
+
const { size } = await stat$6(filepath);
|
|
106061
106190
|
contentInfo.size = size;
|
|
106062
106191
|
contentInfo.valid = true;
|
|
106063
106192
|
await ssri.checkStream(new fsm.ReadStream(filepath), sri);
|
|
@@ -106111,7 +106240,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
106111
106240
|
for (const entry of bucket) {
|
|
106112
106241
|
const content = contentPath(cache, entry.integrity);
|
|
106113
106242
|
try {
|
|
106114
|
-
await stat$
|
|
106243
|
+
await stat$6(content);
|
|
106115
106244
|
await index.insert(cache, entry.key, entry.integrity, {
|
|
106116
106245
|
metadata: entry.metadata,
|
|
106117
106246
|
size: entry.size,
|
|
@@ -106136,7 +106265,7 @@ var require_verify$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
106136
106265
|
async function writeVerifile(cache, opts) {
|
|
106137
106266
|
const verifile = path$11.join(cache, "_lastverified");
|
|
106138
106267
|
opts.log.silly("verify", "writing verifile to " + verifile);
|
|
106139
|
-
return writeFile$
|
|
106268
|
+
return writeFile$2(verifile, `${Date.now()}`);
|
|
106140
106269
|
}
|
|
106141
106270
|
module.exports.lastRun = lastRun;
|
|
106142
106271
|
async function lastRun(cache) {
|
|
@@ -106686,8 +106815,8 @@ var require_lib$12 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
106686
106815
|
//#region ../../node_modules/@npmcli/installed-package-contents/lib/index.js
|
|
106687
106816
|
var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
106688
106817
|
const bundled = require_lib$12();
|
|
106689
|
-
const { readFile: readFile$5, readdir: readdir$
|
|
106690
|
-
const { resolve: resolve$
|
|
106818
|
+
const { readFile: readFile$5, readdir: readdir$4, stat: stat$5 } = require("fs/promises");
|
|
106819
|
+
const { resolve: resolve$9, basename: basename$4, dirname: dirname$8 } = require("path");
|
|
106691
106820
|
const normalizePackageBin = require_lib$21();
|
|
106692
106821
|
const readPackage = ({ path: path$49, packageJsonCache }) => packageJsonCache.has(path$49) ? Promise.resolve(packageJsonCache.get(path$49)) : readFile$5(path$49).then((json) => {
|
|
106693
106822
|
const pkg = normalizePackageBin(JSON.parse(json));
|
|
@@ -106731,17 +106860,17 @@ var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
106731
106860
|
const nm = /^@.+/.test(scope) ? dirname$8(dir) : dir;
|
|
106732
106861
|
const binFiles = [];
|
|
106733
106862
|
Object.keys(pkg.bin).forEach((b) => {
|
|
106734
|
-
const base = resolve$
|
|
106863
|
+
const base = resolve$9(nm, ".bin", b);
|
|
106735
106864
|
binFiles.push(base, base + ".cmd", base + ".ps1");
|
|
106736
106865
|
});
|
|
106737
|
-
(await Promise.all(binFiles.map((b) => stat$
|
|
106866
|
+
(await Promise.all(binFiles.map((b) => stat$5(b).then(() => b).catch(() => null)))).filter((b) => b).forEach((b) => result.add(b));
|
|
106738
106867
|
}
|
|
106739
106868
|
}
|
|
106740
106869
|
if (currentDepth >= depth) {
|
|
106741
106870
|
result.add(path$51);
|
|
106742
106871
|
return result;
|
|
106743
106872
|
}
|
|
106744
|
-
const [dirEntries, bundleDeps] = await Promise.all([readdir$
|
|
106873
|
+
const [dirEntries, bundleDeps] = await Promise.all([readdir$4(path$51, { withFileTypes: true }), currentDepth === 0 && pkg && pkg.bundleDependencies ? bundled({
|
|
106745
106874
|
path: path$51,
|
|
106746
106875
|
packageJsonCache
|
|
106747
106876
|
}) : null]).catch(() => []);
|
|
@@ -106752,7 +106881,7 @@ var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
106752
106881
|
}
|
|
106753
106882
|
const recursePromises = [];
|
|
106754
106883
|
for (const entry of dirEntries) {
|
|
106755
|
-
const p = resolve$
|
|
106884
|
+
const p = resolve$9(path$51, entry.name);
|
|
106756
106885
|
if (entry.isDirectory() === false) {
|
|
106757
106886
|
result.add(p);
|
|
106758
106887
|
continue;
|
|
@@ -106771,7 +106900,7 @@ var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
106771
106900
|
}
|
|
106772
106901
|
if (bundleDeps) recursePromises.push(...bundleDeps.map((dep) => {
|
|
106773
106902
|
return pkgContents({
|
|
106774
|
-
path: resolve$
|
|
106903
|
+
path: resolve$9(path$51, "node_modules", dep),
|
|
106775
106904
|
packageJsonCache,
|
|
106776
106905
|
pkg: true,
|
|
106777
106906
|
depth,
|
|
@@ -106783,7 +106912,7 @@ var require_lib$11 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
106783
106912
|
return result;
|
|
106784
106913
|
};
|
|
106785
106914
|
module.exports = ({ path: path$52, ...opts }) => pkgContents({
|
|
106786
|
-
path: resolve$
|
|
106915
|
+
path: resolve$9(path$52),
|
|
106787
106916
|
...opts,
|
|
106788
106917
|
pkg: true
|
|
106789
106918
|
}).then((results) => [...results]);
|
|
@@ -110394,18 +110523,18 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
110394
110523
|
//#endregion
|
|
110395
110524
|
//#region ../../node_modules/pacote/lib/util/cache-dir.js
|
|
110396
110525
|
var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
110397
|
-
const { resolve: resolve$
|
|
110526
|
+
const { resolve: resolve$8 } = require("node:path");
|
|
110398
110527
|
const { tmpdir, homedir } = require("node:os");
|
|
110399
110528
|
module.exports = (fakePlatform = false) => {
|
|
110400
110529
|
const temp = tmpdir();
|
|
110401
110530
|
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
110402
|
-
const home = homedir() || resolve$
|
|
110531
|
+
const home = homedir() || resolve$8(temp, "npm-" + uidOrPid);
|
|
110403
110532
|
const platform = fakePlatform || process.platform;
|
|
110404
110533
|
const cacheExtra = platform === "win32" ? "npm-cache" : ".npm";
|
|
110405
110534
|
const cacheRoot = platform === "win32" && process.env.LOCALAPPDATA || home;
|
|
110406
110535
|
return {
|
|
110407
|
-
cacache: resolve$
|
|
110408
|
-
tufcache: resolve$
|
|
110536
|
+
cacache: resolve$8(cacheRoot, cacheExtra, "_cacache"),
|
|
110537
|
+
tufcache: resolve$8(cacheRoot, cacheExtra, "_tuf")
|
|
110409
110538
|
};
|
|
110410
110539
|
};
|
|
110411
110540
|
}));
|
|
@@ -112219,7 +112348,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
112219
112348
|
var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112220
112349
|
const { Walker: IgnoreWalker } = require_lib$10();
|
|
112221
112350
|
const { lstatSync: lstat$1, readFileSync: readFile$4 } = require("fs");
|
|
112222
|
-
const { basename: basename$3, dirname: dirname$7, extname: extname$1, join: join$
|
|
112351
|
+
const { basename: basename$3, dirname: dirname$7, extname: extname$1, join: join$10, relative, resolve: resolve$7, sep } = require("path");
|
|
112223
112352
|
const { log } = require_lib$29();
|
|
112224
112353
|
const defaultRules = Symbol("npm-packlist.rules.default");
|
|
112225
112354
|
const strictRules = Symbol("npm-packlist.rules.strict");
|
|
@@ -112252,7 +112381,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112252
112381
|
const normalizePath = (path$46) => path$46.split("\\").join("/");
|
|
112253
112382
|
const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
|
|
112254
112383
|
for (const file of [".npmignore", ".gitignore"]) try {
|
|
112255
|
-
const ignoreContent = readFile$4(join$
|
|
112384
|
+
const ignoreContent = readFile$4(join$10(root, file), { encoding: "utf8" });
|
|
112256
112385
|
result.push(ignoreContent);
|
|
112257
112386
|
break;
|
|
112258
112387
|
} catch (err) {
|
|
@@ -112261,8 +112390,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112261
112390
|
}
|
|
112262
112391
|
if (!rel) return result;
|
|
112263
112392
|
const firstRel = rel.split(sep, 1)[0];
|
|
112264
|
-
const newRoot = join$
|
|
112265
|
-
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$
|
|
112393
|
+
const newRoot = join$10(root, firstRel);
|
|
112394
|
+
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$10(root, rel)), result);
|
|
112266
112395
|
};
|
|
112267
112396
|
var PackWalker = class PackWalker extends IgnoreWalker {
|
|
112268
112397
|
constructor(tree, opts) {
|
|
@@ -112270,7 +112399,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112270
112399
|
...opts,
|
|
112271
112400
|
includeEmpty: false,
|
|
112272
112401
|
follow: false,
|
|
112273
|
-
path: resolve$
|
|
112402
|
+
path: resolve$7(opts?.path || tree.path).replace(/\\/g, "/"),
|
|
112274
112403
|
ignoreFiles: opts?.ignoreFiles || [
|
|
112275
112404
|
defaultRules,
|
|
112276
112405
|
"package.json",
|
|
@@ -112329,7 +112458,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112329
112458
|
let ignoreFiles = null;
|
|
112330
112459
|
if (this.tree.workspaces) {
|
|
112331
112460
|
const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
|
|
112332
|
-
const entryPath = join$
|
|
112461
|
+
const entryPath = join$10(this.path, entry).replace(/\\/g, "/");
|
|
112333
112462
|
if (workspaceDirs.includes(entryPath)) ignoreFiles = [
|
|
112334
112463
|
defaultRules,
|
|
112335
112464
|
"package.json",
|
|
@@ -112389,7 +112518,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112389
112518
|
if (file.endsWith("/*")) file += "*";
|
|
112390
112519
|
const inverse = `!${file}`;
|
|
112391
112520
|
try {
|
|
112392
|
-
const stat = lstat$1(join$
|
|
112521
|
+
const stat = lstat$1(join$10(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
|
|
112393
112522
|
if (stat.isFile()) {
|
|
112394
112523
|
strict.unshift(inverse);
|
|
112395
112524
|
this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
|
|
@@ -112446,7 +112575,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112446
112575
|
walker.start();
|
|
112447
112576
|
});
|
|
112448
112577
|
const relativeFrom = relative(this.root, walker.path);
|
|
112449
|
-
for (const file of bundled) this.result.add(join$
|
|
112578
|
+
for (const file of bundled) this.result.add(join$10(relativeFrom, file).replace(/\\/g, "/"));
|
|
112450
112579
|
}
|
|
112451
112580
|
}
|
|
112452
112581
|
};
|
|
@@ -112470,8 +112599,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112470
112599
|
//#region ../../node_modules/@npmcli/run-script/lib/set-path.js
|
|
112471
112600
|
var require_set_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112472
112601
|
const { log } = require_lib$29();
|
|
112473
|
-
const { resolve: resolve$
|
|
112474
|
-
const nodeGypPath = resolve$
|
|
112602
|
+
const { resolve: resolve$6, dirname: dirname$6, delimiter: delimiter$1 } = require("path");
|
|
112603
|
+
const nodeGypPath = resolve$6(__dirname, "../lib/node-gyp-bin");
|
|
112475
112604
|
const setPATH = (projectPath, binPaths, env) => {
|
|
112476
112605
|
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);
|
|
112477
112606
|
const pathArr = [];
|
|
@@ -112486,7 +112615,7 @@ var require_set_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
112486
112615
|
let p = projectPath;
|
|
112487
112616
|
let pp;
|
|
112488
112617
|
do {
|
|
112489
|
-
pathArr.push(resolve$
|
|
112618
|
+
pathArr.push(resolve$6(p, "node_modules", ".bin"));
|
|
112490
112619
|
pp = p;
|
|
112491
112620
|
p = dirname$6(p);
|
|
112492
112621
|
} while (p !== pp);
|
|
@@ -112501,7 +112630,7 @@ var require_set_path = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
112501
112630
|
//#region ../../node_modules/@npmcli/run-script/lib/make-spawn-args.js
|
|
112502
112631
|
var require_make_spawn_args = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112503
112632
|
const setPATH = require_set_path();
|
|
112504
|
-
const { resolve: resolve$
|
|
112633
|
+
const { resolve: resolve$5 } = require("path");
|
|
112505
112634
|
let npm_config_node_gyp;
|
|
112506
112635
|
const makeSpawnArgs = (options) => {
|
|
112507
112636
|
const { args, binPaths, cmd, env, event, nodeGyp, path: path$45, scriptShell = true, stdio, stdioString } = options;
|
|
@@ -112515,7 +112644,7 @@ var require_make_spawn_args = /* @__PURE__ */ require_chunk.__commonJSMin(((expo
|
|
|
112515
112644
|
env: setPATH(path$45, binPaths, {
|
|
112516
112645
|
...process.env,
|
|
112517
112646
|
...env,
|
|
112518
|
-
npm_package_json: resolve$
|
|
112647
|
+
npm_package_json: resolve$5(path$45, "package.json"),
|
|
112519
112648
|
npm_lifecycle_event: event,
|
|
112520
112649
|
npm_lifecycle_script: cmd,
|
|
112521
112650
|
npm_config_node_gyp
|
|
@@ -112602,11 +112731,11 @@ var require_signal_manager = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
|
|
|
112602
112731
|
//#endregion
|
|
112603
112732
|
//#region ../../node_modules/@npmcli/run-script/lib/is-server-package.js
|
|
112604
112733
|
var require_is_server_package = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112605
|
-
const { stat: stat$
|
|
112606
|
-
const { resolve: resolve$
|
|
112734
|
+
const { stat: stat$4 } = require("node:fs/promises");
|
|
112735
|
+
const { resolve: resolve$4 } = require("node:path");
|
|
112607
112736
|
module.exports = async (path) => {
|
|
112608
112737
|
try {
|
|
112609
|
-
return (await stat$
|
|
112738
|
+
return (await stat$4(resolve$4(path, "server.js"))).isFile();
|
|
112610
112739
|
} catch (er) {
|
|
112611
112740
|
return false;
|
|
112612
112741
|
}
|
|
@@ -112716,8 +112845,8 @@ var require_run_script = /* @__PURE__ */ require_chunk.__commonJSMin(((exports,
|
|
|
112716
112845
|
//#endregion
|
|
112717
112846
|
//#region ../../node_modules/pacote/lib/file.js
|
|
112718
112847
|
var require_file$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112719
|
-
const { resolve: resolve$
|
|
112720
|
-
const { stat: stat$
|
|
112848
|
+
const { resolve: resolve$3 } = require("node:path");
|
|
112849
|
+
const { stat: stat$3, chmod: chmod$1 } = require("node:fs/promises");
|
|
112721
112850
|
const cacache = require_lib$14();
|
|
112722
112851
|
const fsm = require_lib$13();
|
|
112723
112852
|
const Fetcher = require_fetcher();
|
|
@@ -112742,9 +112871,9 @@ var require_file$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
112742
112871
|
#exeBins(pkg, dest) {
|
|
112743
112872
|
if (!pkg.bin) return Promise.resolve();
|
|
112744
112873
|
return Promise.all(Object.keys(pkg.bin).map(async (k) => {
|
|
112745
|
-
const script = resolve$
|
|
112874
|
+
const script = resolve$3(dest, pkg.bin[k]);
|
|
112746
112875
|
try {
|
|
112747
|
-
const st = await stat$
|
|
112876
|
+
const st = await stat$3(script);
|
|
112748
112877
|
const mode = st.mode | 73;
|
|
112749
112878
|
if (mode === st.mode) return;
|
|
112750
112879
|
await chmod$1(script, mode);
|
|
@@ -112793,7 +112922,7 @@ var require_tar_create_options = /* @__PURE__ */ require_chunk.__commonJSMin(((e
|
|
|
112793
112922
|
//#endregion
|
|
112794
112923
|
//#region ../../node_modules/pacote/lib/dir.js
|
|
112795
112924
|
var require_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112796
|
-
const { resolve: resolve$
|
|
112925
|
+
const { resolve: resolve$2 } = require("node:path");
|
|
112797
112926
|
const packlist = require_lib$9();
|
|
112798
112927
|
const runScript = require_run_script();
|
|
112799
112928
|
const tar = require_index_min();
|
|
@@ -112829,7 +112958,7 @@ var require_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
112829
112958
|
env: {
|
|
112830
112959
|
npm_package_resolved: this.resolved,
|
|
112831
112960
|
npm_package_integrity: this.integrity,
|
|
112832
|
-
npm_package_json: resolve$
|
|
112961
|
+
npm_package_json: resolve$2(this.resolved, "package.json")
|
|
112833
112962
|
}
|
|
112834
112963
|
});
|
|
112835
112964
|
});
|
|
@@ -141840,7 +141969,7 @@ var require_registry = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
141840
141969
|
//#region ../../node_modules/pacote/lib/fetcher.js
|
|
141841
141970
|
var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
141842
141971
|
const { basename: basename$2, dirname: dirname$5 } = require("node:path");
|
|
141843
|
-
const { rm: rm$6, mkdir: mkdir$
|
|
141972
|
+
const { rm: rm$6, mkdir: mkdir$5 } = require("node:fs/promises");
|
|
141844
141973
|
const PackageJson = require_lib$18();
|
|
141845
141974
|
const cacache = require_lib$14();
|
|
141846
141975
|
const fsm = require_lib$13();
|
|
@@ -142024,7 +142153,7 @@ var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mod
|
|
|
142024
142153
|
}
|
|
142025
142154
|
async #mkdir(dest) {
|
|
142026
142155
|
await this.#empty(dest);
|
|
142027
|
-
return await mkdir$
|
|
142156
|
+
return await mkdir$5(dest, { recursive: true });
|
|
142028
142157
|
}
|
|
142029
142158
|
async extract(dest) {
|
|
142030
142159
|
await this.#mkdir(dest);
|
|
@@ -142044,7 +142173,7 @@ var require_fetcher = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mod
|
|
|
142044
142173
|
}));
|
|
142045
142174
|
}
|
|
142046
142175
|
async tarballFile(dest) {
|
|
142047
|
-
await mkdir$
|
|
142176
|
+
await mkdir$5(dirname$5(dest), { recursive: true });
|
|
142048
142177
|
return this.#toFile(dest);
|
|
142049
142178
|
}
|
|
142050
142179
|
#extract(dest, tarball) {
|
|
@@ -150471,7 +150600,7 @@ var require_src = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
150471
150600
|
const { promisify } = require("util");
|
|
150472
150601
|
const path$4 = require("path");
|
|
150473
150602
|
const { createHash } = require("crypto");
|
|
150474
|
-
const { realpath, lstat, createReadStream, readdir: readdir$
|
|
150603
|
+
const { realpath, lstat, createReadStream, readdir: readdir$3 } = require("fs");
|
|
150475
150604
|
const url = require("url");
|
|
150476
150605
|
const slasher = require_glob_slash();
|
|
150477
150606
|
const minimatch = require_minimatch();
|
|
@@ -150796,7 +150925,7 @@ var require_src = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
150796
150925
|
lstat: promisify(lstat),
|
|
150797
150926
|
realpath: promisify(realpath),
|
|
150798
150927
|
createReadStream,
|
|
150799
|
-
readdir: promisify(readdir$
|
|
150928
|
+
readdir: promisify(readdir$3),
|
|
150800
150929
|
sendError
|
|
150801
150930
|
}, methods);
|
|
150802
150931
|
module.exports = async (request, response, config = {}, methods = {}) => {
|
|
@@ -150925,7 +151054,7 @@ require_lib();
|
|
|
150925
151054
|
require_src();
|
|
150926
151055
|
//#endregion
|
|
150927
151056
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
150928
|
-
const { join: join$
|
|
151057
|
+
const { join: join$8 } = node_path.default;
|
|
150929
151058
|
//#endregion
|
|
150930
151059
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
150931
151060
|
const localPluginsMap = /* @__PURE__ */ new Map();
|
|
@@ -150949,6 +151078,39 @@ if (isDev && projectRoot) {
|
|
|
150949
151078
|
//#endregion
|
|
150950
151079
|
//#region ../plugin-core/src/pipelab.ts
|
|
150951
151080
|
const createActionRunner = (runner) => runner;
|
|
151081
|
+
//#endregion
|
|
151082
|
+
//#region ../plugin-core/src/fs-utils.ts
|
|
151083
|
+
/**
|
|
151084
|
+
* Asserts that a directory is safe to be deleted/cleaned up.
|
|
151085
|
+
* Throws an error if the directory is protected or is not empty and lacks the Pipelab folder marker.
|
|
151086
|
+
*/
|
|
151087
|
+
async function assertSafeDirectoryCleanup(directoryPath) {
|
|
151088
|
+
if (!directoryPath) return;
|
|
151089
|
+
const resolvedPath = (0, node_path.resolve)(directoryPath);
|
|
151090
|
+
if (isPathBlacklisted(resolvedPath)) throw new Error(`Cannot cleanup/delete protected system or user directory: ${resolvedPath}`);
|
|
151091
|
+
try {
|
|
151092
|
+
if ((await (0, node_fs_promises.stat)(resolvedPath)).isDirectory()) {
|
|
151093
|
+
const files = await (0, node_fs_promises.readdir)(resolvedPath);
|
|
151094
|
+
if (files.length > 0) {
|
|
151095
|
+
if (!files.includes(".pipelab")) throw new Error(`Directory is not empty and was not created by Pipelab: ${resolvedPath}. Aborting to prevent data loss.`);
|
|
151096
|
+
}
|
|
151097
|
+
}
|
|
151098
|
+
} catch (e) {
|
|
151099
|
+
if (e.code !== "ENOENT") throw e;
|
|
151100
|
+
}
|
|
151101
|
+
}
|
|
151102
|
+
/**
|
|
151103
|
+
* Creates a hidden Pipelab marker directory with metadata.json at the specified destination path.
|
|
151104
|
+
*/
|
|
151105
|
+
async function writePipelabFolderMarker(directoryPath, generator = "unknown") {
|
|
151106
|
+
if (!directoryPath) return;
|
|
151107
|
+
const markerDir = (0, node_path.join)(directoryPath, ".pipelab");
|
|
151108
|
+
await (0, node_fs_promises.mkdir)(markerDir, { recursive: true });
|
|
151109
|
+
await (0, node_fs_promises.writeFile)((0, node_path.join)(markerDir, "metadata.json"), JSON.stringify({
|
|
151110
|
+
createdBy: generator,
|
|
151111
|
+
timestamp: Date.now()
|
|
151112
|
+
}, null, 2), "utf-8");
|
|
151113
|
+
}
|
|
150952
151114
|
const zip = createAction({
|
|
150953
151115
|
id: "zip-node",
|
|
150954
151116
|
name: "Zip",
|
|
@@ -151977,6 +152139,7 @@ const copy = createAction({
|
|
|
151977
152139
|
required: true,
|
|
151978
152140
|
control: {
|
|
151979
152141
|
type: "path",
|
|
152142
|
+
warnIfBlacklisted: true,
|
|
151980
152143
|
options: { properties: [
|
|
151981
152144
|
"openFile",
|
|
151982
152145
|
"openDirectory",
|
|
@@ -152000,7 +152163,7 @@ const copy = createAction({
|
|
|
152000
152163
|
cleanup: {
|
|
152001
152164
|
label: "Cleanup",
|
|
152002
152165
|
required: true,
|
|
152003
|
-
description: "
|
|
152166
|
+
description: "Delete existing files at destination before copying",
|
|
152004
152167
|
value: true,
|
|
152005
152168
|
control: { type: "boolean" }
|
|
152006
152169
|
}
|
|
@@ -152051,6 +152214,7 @@ const copyRunner = createActionRunner(async ({ log, inputs, setOutput }) => {
|
|
|
152051
152214
|
} catch (e) {}
|
|
152052
152215
|
log("Copying", from, "to", to, "recursive", inputs.recursive, "overwrite", inputs.overwrite);
|
|
152053
152216
|
if (inputs.cleanup) try {
|
|
152217
|
+
await assertSafeDirectoryCleanup(to);
|
|
152054
152218
|
log("Cleaning up", to);
|
|
152055
152219
|
process.noAsar = true;
|
|
152056
152220
|
await (0, node_fs_promises.rm)(to, {
|
|
@@ -152070,6 +152234,7 @@ const copyRunner = createActionRunner(async ({ log, inputs, setOutput }) => {
|
|
|
152070
152234
|
recursive: inputs.recursive && !fromIsAFile,
|
|
152071
152235
|
force: inputs.overwrite
|
|
152072
152236
|
});
|
|
152237
|
+
if (!fromIsAFile) await writePipelabFolderMarker(to, "fs:copy");
|
|
152073
152238
|
process.noAsar = false;
|
|
152074
152239
|
setOutput("output", to);
|
|
152075
152240
|
setOutput("input", from);
|
|
@@ -152090,6 +152255,7 @@ const remove = createAction({
|
|
|
152090
152255
|
required: true,
|
|
152091
152256
|
control: {
|
|
152092
152257
|
type: "path",
|
|
152258
|
+
warnIfBlacklisted: true,
|
|
152093
152259
|
options: { properties: ["openFile"] }
|
|
152094
152260
|
}
|
|
152095
152261
|
}),
|
|
@@ -152114,6 +152280,7 @@ const removeRunner = createActionRunner(async ({ log, inputs }) => {
|
|
|
152114
152280
|
throw new Error("Missing source");
|
|
152115
152281
|
}
|
|
152116
152282
|
try {
|
|
152283
|
+
await assertSafeDirectoryCleanup(from);
|
|
152117
152284
|
process.noAsar = true;
|
|
152118
152285
|
await (0, node_fs_promises.rm)(from, {
|
|
152119
152286
|
recursive: true,
|