@storm-software/testing-tools 1.12.10 → 1.13.0

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/index.cjs CHANGED
@@ -128641,9 +128641,9 @@ var require_run_tasks_in_serial = __commonJS({
128641
128641
  }
128642
128642
  });
128643
128643
 
128644
- // node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js
128644
+ // node_modules/.pnpm/ignore@5.3.0/node_modules/ignore/index.js
128645
128645
  var require_ignore2 = __commonJS({
128646
- "node_modules/.pnpm/ignore@5.2.4/node_modules/ignore/index.js"(exports, module2) {
128646
+ "node_modules/.pnpm/ignore@5.3.0/node_modules/ignore/index.js"(exports, module2) {
128647
128647
  "use strict";
128648
128648
  function makeArray(subject) {
128649
128649
  return Array.isArray(subject) ? subject : [subject];
@@ -140712,9 +140712,9 @@ var require_supports_color3 = __commonJS({
140712
140712
  }
140713
140713
  });
140714
140714
 
140715
- // node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/util.js
140715
+ // node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js
140716
140716
  var require_util2 = __commonJS({
140717
- "node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/util.js"(exports, module2) {
140717
+ "node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/util.js"(exports, module2) {
140718
140718
  "use strict";
140719
140719
  var stringReplaceAll3 = (string, substring, replacer) => {
140720
140720
  let index = string.indexOf(substring);
@@ -140751,9 +140751,9 @@ var require_util2 = __commonJS({
140751
140751
  }
140752
140752
  });
140753
140753
 
140754
- // node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/templates.js
140754
+ // node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js
140755
140755
  var require_templates3 = __commonJS({
140756
- "node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/templates.js"(exports, module2) {
140756
+ "node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/templates.js"(exports, module2) {
140757
140757
  "use strict";
140758
140758
  var TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
140759
140759
  var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
@@ -140865,9 +140865,9 @@ var require_templates3 = __commonJS({
140865
140865
  }
140866
140866
  });
140867
140867
 
140868
- // node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/index.js
140868
+ // node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js
140869
140869
  var require_source = __commonJS({
140870
- "node_modules/.pnpm/chalk@4.1.0/node_modules/chalk/source/index.js"(exports, module2) {
140870
+ "node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/source/index.js"(exports, module2) {
140871
140871
  "use strict";
140872
140872
  var ansiStyles2 = require_ansi_styles3();
140873
140873
  var { stdout: stdoutColor2, stderr: stderrColor2 } = require_supports_color3();
@@ -330124,9 +330124,9 @@ var require_watch_for_single_file_changes = __commonJS({
330124
330124
  }
330125
330125
  });
330126
330126
 
330127
- // node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
330127
+ // node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
330128
330128
  var require_universalify = __commonJS({
330129
- "node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
330129
+ "node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports) {
330130
330130
  "use strict";
330131
330131
  exports.fromCallback = function(fn6) {
330132
330132
  return Object.defineProperty(function(...args) {
@@ -330134,11 +330134,8 @@ var require_universalify = __commonJS({
330134
330134
  fn6.apply(this, args);
330135
330135
  else {
330136
330136
  return new Promise((resolve2, reject) => {
330137
- fn6.call(
330138
- this,
330139
- ...args,
330140
- (err, res) => err != null ? reject(err) : resolve2(res)
330141
- );
330137
+ args.push((err, res) => err != null ? reject(err) : resolve2(res));
330138
+ fn6.apply(this, args);
330142
330139
  });
330143
330140
  }
330144
330141
  }, "name", { value: fn6.name });
@@ -330148,8 +330145,10 @@ var require_universalify = __commonJS({
330148
330145
  const cb = args[args.length - 1];
330149
330146
  if (typeof cb !== "function")
330150
330147
  return fn6.apply(this, args);
330151
- else
330152
- fn6.apply(this, args.slice(0, -1)).then((r3) => cb(null, r3), cb);
330148
+ else {
330149
+ args.pop();
330150
+ fn6.apply(this, args).then((r3) => cb(null, r3), cb);
330151
+ }
330153
330152
  }, "name", { value: fn6.name });
330154
330153
  };
330155
330154
  }
@@ -330966,9 +330965,9 @@ var require_graceful_fs = __commonJS({
330966
330965
  }
330967
330966
  });
330968
330967
 
330969
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js
330968
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js
330970
330969
  var require_fs6 = __commonJS({
330971
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/fs/index.js"(exports) {
330970
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/fs/index.js"(exports) {
330972
330971
  "use strict";
330973
330972
  var u = require_universalify().fromCallback;
330974
330973
  var fs8 = require_graceful_fs();
@@ -331082,9 +331081,9 @@ var require_fs6 = __commonJS({
331082
331081
  }
331083
331082
  });
331084
331083
 
331085
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js
331084
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js
331086
331085
  var require_utils6 = __commonJS({
331087
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
331086
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/utils.js"(exports, module2) {
331088
331087
  "use strict";
331089
331088
  var path9 = require("path");
331090
331089
  module2.exports.checkPath = function checkPath(pth) {
@@ -331100,9 +331099,9 @@ var require_utils6 = __commonJS({
331100
331099
  }
331101
331100
  });
331102
331101
 
331103
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js
331102
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js
331104
331103
  var require_make_dir = __commonJS({
331105
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
331104
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports, module2) {
331106
331105
  "use strict";
331107
331106
  var fs8 = require_fs6();
331108
331107
  var { checkPath } = require_utils6();
@@ -331129,9 +331128,9 @@ var require_make_dir = __commonJS({
331129
331128
  }
331130
331129
  });
331131
331130
 
331132
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js
331131
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js
331133
331132
  var require_mkdirs = __commonJS({
331134
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
331133
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/mkdirs/index.js"(exports, module2) {
331135
331134
  "use strict";
331136
331135
  var u = require_universalify().fromPromise;
331137
331136
  var { makeDir: _makeDir, makeDirSync } = require_make_dir();
@@ -331148,9 +331147,9 @@ var require_mkdirs = __commonJS({
331148
331147
  }
331149
331148
  });
331150
331149
 
331151
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js
331150
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js
331152
331151
  var require_path_exists = __commonJS({
331153
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
331152
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/path-exists/index.js"(exports, module2) {
331154
331153
  "use strict";
331155
331154
  var u = require_universalify().fromPromise;
331156
331155
  var fs8 = require_fs6();
@@ -331164,22 +331163,27 @@ var require_path_exists = __commonJS({
331164
331163
  }
331165
331164
  });
331166
331165
 
331167
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js
331166
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js
331168
331167
  var require_utimes = __commonJS({
331169
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
331168
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/utimes.js"(exports, module2) {
331170
331169
  "use strict";
331171
- var fs8 = require_graceful_fs();
331172
- function utimesMillis(path9, atime, mtime, callback) {
331173
- fs8.open(path9, "r+", (err, fd) => {
331174
- if (err)
331175
- return callback(err);
331176
- fs8.futimes(fd, atime, mtime, (futimesErr) => {
331177
- fs8.close(fd, (closeErr) => {
331178
- if (callback)
331179
- callback(futimesErr || closeErr);
331180
- });
331181
- });
331182
- });
331170
+ var fs8 = require_fs6();
331171
+ var u = require_universalify().fromPromise;
331172
+ async function utimesMillis(path9, atime, mtime) {
331173
+ const fd = await fs8.open(path9, "r+");
331174
+ let closeErr = null;
331175
+ try {
331176
+ await fs8.futimes(fd, atime, mtime);
331177
+ } finally {
331178
+ try {
331179
+ await fs8.close(fd);
331180
+ } catch (e3) {
331181
+ closeErr = e3;
331182
+ }
331183
+ }
331184
+ if (closeErr) {
331185
+ throw closeErr;
331186
+ }
331183
331187
  }
331184
331188
  function utimesMillisSync(path9, atime, mtime) {
331185
331189
  const fd = fs8.openSync(path9, "r+");
@@ -331187,19 +331191,19 @@ var require_utimes = __commonJS({
331187
331191
  return fs8.closeSync(fd);
331188
331192
  }
331189
331193
  module2.exports = {
331190
- utimesMillis,
331194
+ utimesMillis: u(utimesMillis),
331191
331195
  utimesMillisSync
331192
331196
  };
331193
331197
  }
331194
331198
  });
331195
331199
 
331196
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js
331200
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js
331197
331201
  var require_stat = __commonJS({
331198
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
331202
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/util/stat.js"(exports, module2) {
331199
331203
  "use strict";
331200
331204
  var fs8 = require_fs6();
331201
331205
  var path9 = require("path");
331202
- var util = require("util");
331206
+ var u = require_universalify().fromPromise;
331203
331207
  function getStats(src, dest, opts) {
331204
331208
  const statFunc = opts.dereference ? (file) => fs8.stat(file, { bigint: true }) : (file) => fs8.lstat(file, { bigint: true });
331205
331209
  return Promise.all([
@@ -331224,32 +331228,28 @@ var require_stat = __commonJS({
331224
331228
  }
331225
331229
  return { srcStat, destStat };
331226
331230
  }
331227
- function checkPaths(src, dest, funcName, opts, cb) {
331228
- util.callbackify(getStats)(src, dest, opts, (err, stats) => {
331229
- if (err)
331230
- return cb(err);
331231
- const { srcStat, destStat } = stats;
331232
- if (destStat) {
331233
- if (areIdentical(srcStat, destStat)) {
331234
- const srcBaseName = path9.basename(src);
331235
- const destBaseName = path9.basename(dest);
331236
- if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
331237
- return cb(null, { srcStat, destStat, isChangingCase: true });
331238
- }
331239
- return cb(new Error("Source and destination must not be the same."));
331240
- }
331241
- if (srcStat.isDirectory() && !destStat.isDirectory()) {
331242
- return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`));
331243
- }
331244
- if (!srcStat.isDirectory() && destStat.isDirectory()) {
331245
- return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`));
331231
+ async function checkPaths(src, dest, funcName, opts) {
331232
+ const { srcStat, destStat } = await getStats(src, dest, opts);
331233
+ if (destStat) {
331234
+ if (areIdentical(srcStat, destStat)) {
331235
+ const srcBaseName = path9.basename(src);
331236
+ const destBaseName = path9.basename(dest);
331237
+ if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
331238
+ return { srcStat, destStat, isChangingCase: true };
331246
331239
  }
331240
+ throw new Error("Source and destination must not be the same.");
331241
+ }
331242
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
331243
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`);
331247
331244
  }
331248
- if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
331249
- return cb(new Error(errMsg(src, dest, funcName)));
331245
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
331246
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`);
331250
331247
  }
331251
- return cb(null, { srcStat, destStat });
331252
- });
331248
+ }
331249
+ if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
331250
+ throw new Error(errMsg(src, dest, funcName));
331251
+ }
331252
+ return { srcStat, destStat };
331253
331253
  }
331254
331254
  function checkPathsSync(src, dest, funcName, opts) {
331255
331255
  const { srcStat, destStat } = getStatsSync(src, dest, opts);
@@ -331274,22 +331274,23 @@ var require_stat = __commonJS({
331274
331274
  }
331275
331275
  return { srcStat, destStat };
331276
331276
  }
331277
- function checkParentPaths(src, srcStat, dest, funcName, cb) {
331277
+ async function checkParentPaths(src, srcStat, dest, funcName) {
331278
331278
  const srcParent = path9.resolve(path9.dirname(src));
331279
331279
  const destParent = path9.resolve(path9.dirname(dest));
331280
331280
  if (destParent === srcParent || destParent === path9.parse(destParent).root)
331281
- return cb();
331282
- fs8.stat(destParent, { bigint: true }, (err, destStat) => {
331283
- if (err) {
331284
- if (err.code === "ENOENT")
331285
- return cb();
331286
- return cb(err);
331287
- }
331288
- if (areIdentical(srcStat, destStat)) {
331289
- return cb(new Error(errMsg(src, dest, funcName)));
331290
- }
331291
- return checkParentPaths(src, srcStat, destParent, funcName, cb);
331292
- });
331281
+ return;
331282
+ let destStat;
331283
+ try {
331284
+ destStat = await fs8.stat(destParent, { bigint: true });
331285
+ } catch (err) {
331286
+ if (err.code === "ENOENT")
331287
+ return;
331288
+ throw err;
331289
+ }
331290
+ if (areIdentical(srcStat, destStat)) {
331291
+ throw new Error(errMsg(src, dest, funcName));
331292
+ }
331293
+ return checkParentPaths(src, srcStat, destParent, funcName);
331293
331294
  }
331294
331295
  function checkParentPathsSync(src, srcStat, dest, funcName) {
331295
331296
  const srcParent = path9.resolve(path9.dirname(src));
@@ -331315,42 +331316,39 @@ var require_stat = __commonJS({
331315
331316
  function isSrcSubdir(src, dest) {
331316
331317
  const srcArr = path9.resolve(src).split(path9.sep).filter((i) => i);
331317
331318
  const destArr = path9.resolve(dest).split(path9.sep).filter((i) => i);
331318
- return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true);
331319
+ return srcArr.every((cur, i) => destArr[i] === cur);
331319
331320
  }
331320
331321
  function errMsg(src, dest, funcName) {
331321
331322
  return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`;
331322
331323
  }
331323
331324
  module2.exports = {
331324
- checkPaths,
331325
+ // checkPaths
331326
+ checkPaths: u(checkPaths),
331325
331327
  checkPathsSync,
331326
- checkParentPaths,
331328
+ // checkParent
331329
+ checkParentPaths: u(checkParentPaths),
331327
331330
  checkParentPathsSync,
331331
+ // Misc
331328
331332
  isSrcSubdir,
331329
331333
  areIdentical
331330
331334
  };
331331
331335
  }
331332
331336
  });
331333
331337
 
331334
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js
331338
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js
331335
331339
  var require_copy = __commonJS({
331336
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
331340
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy.js"(exports, module2) {
331337
331341
  "use strict";
331338
- var fs8 = require_graceful_fs();
331342
+ var fs8 = require_fs6();
331339
331343
  var path9 = require("path");
331340
- var mkdirs = require_mkdirs().mkdirs;
331341
- var pathExists = require_path_exists().pathExists;
331342
- var utimesMillis = require_utimes().utimesMillis;
331344
+ var { mkdirs } = require_mkdirs();
331345
+ var { pathExists } = require_path_exists();
331346
+ var { utimesMillis } = require_utimes();
331343
331347
  var stat = require_stat();
331344
- function copy(src, dest, opts, cb) {
331345
- if (typeof opts === "function" && !cb) {
331346
- cb = opts;
331347
- opts = {};
331348
- } else if (typeof opts === "function") {
331348
+ async function copy(src, dest, opts = {}) {
331349
+ if (typeof opts === "function") {
331349
331350
  opts = { filter: opts };
331350
331351
  }
331351
- cb = cb || function() {
331352
- };
331353
- opts = opts || {};
331354
331352
  opts.clobber = "clobber" in opts ? !!opts.clobber : true;
331355
331353
  opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber;
331356
331354
  if (opts.preserveTimestamps && process.arch === "ia32") {
@@ -331360,212 +331358,119 @@ var require_copy = __commonJS({
331360
331358
  "fs-extra-WARN0001"
331361
331359
  );
331362
331360
  }
331363
- stat.checkPaths(src, dest, "copy", opts, (err, stats) => {
331364
- if (err)
331365
- return cb(err);
331366
- const { srcStat, destStat } = stats;
331367
- stat.checkParentPaths(src, srcStat, dest, "copy", (err2) => {
331368
- if (err2)
331369
- return cb(err2);
331370
- runFilter(src, dest, opts, (err3, include) => {
331371
- if (err3)
331372
- return cb(err3);
331373
- if (!include)
331374
- return cb();
331375
- checkParentDir(destStat, src, dest, opts, cb);
331376
- });
331377
- });
331378
- });
331379
- }
331380
- function checkParentDir(destStat, src, dest, opts, cb) {
331361
+ const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts);
331362
+ await stat.checkParentPaths(src, srcStat, dest, "copy");
331363
+ const include = await runFilter(src, dest, opts);
331364
+ if (!include)
331365
+ return;
331381
331366
  const destParent = path9.dirname(dest);
331382
- pathExists(destParent, (err, dirExists) => {
331383
- if (err)
331384
- return cb(err);
331385
- if (dirExists)
331386
- return getStats(destStat, src, dest, opts, cb);
331387
- mkdirs(destParent, (err2) => {
331388
- if (err2)
331389
- return cb(err2);
331390
- return getStats(destStat, src, dest, opts, cb);
331391
- });
331392
- });
331367
+ const dirExists = await pathExists(destParent);
331368
+ if (!dirExists) {
331369
+ await mkdirs(destParent);
331370
+ }
331371
+ await getStatsAndPerformCopy(destStat, src, dest, opts);
331393
331372
  }
331394
- function runFilter(src, dest, opts, cb) {
331373
+ async function runFilter(src, dest, opts) {
331395
331374
  if (!opts.filter)
331396
- return cb(null, true);
331397
- Promise.resolve(opts.filter(src, dest)).then((include) => cb(null, include), (error) => cb(error));
331375
+ return true;
331376
+ return opts.filter(src, dest);
331398
331377
  }
331399
- function getStats(destStat, src, dest, opts, cb) {
331400
- const stat2 = opts.dereference ? fs8.stat : fs8.lstat;
331401
- stat2(src, (err, srcStat) => {
331402
- if (err)
331403
- return cb(err);
331404
- if (srcStat.isDirectory())
331405
- return onDir(srcStat, destStat, src, dest, opts, cb);
331406
- else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
331407
- return onFile(srcStat, destStat, src, dest, opts, cb);
331408
- else if (srcStat.isSymbolicLink())
331409
- return onLink(destStat, src, dest, opts, cb);
331410
- else if (srcStat.isSocket())
331411
- return cb(new Error(`Cannot copy a socket file: ${src}`));
331412
- else if (srcStat.isFIFO())
331413
- return cb(new Error(`Cannot copy a FIFO pipe: ${src}`));
331414
- return cb(new Error(`Unknown file: ${src}`));
331415
- });
331378
+ async function getStatsAndPerformCopy(destStat, src, dest, opts) {
331379
+ const statFn = opts.dereference ? fs8.stat : fs8.lstat;
331380
+ const srcStat = await statFn(src);
331381
+ if (srcStat.isDirectory())
331382
+ return onDir(srcStat, destStat, src, dest, opts);
331383
+ if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice())
331384
+ return onFile(srcStat, destStat, src, dest, opts);
331385
+ if (srcStat.isSymbolicLink())
331386
+ return onLink(destStat, src, dest, opts);
331387
+ if (srcStat.isSocket())
331388
+ throw new Error(`Cannot copy a socket file: ${src}`);
331389
+ if (srcStat.isFIFO())
331390
+ throw new Error(`Cannot copy a FIFO pipe: ${src}`);
331391
+ throw new Error(`Unknown file: ${src}`);
331416
331392
  }
331417
- function onFile(srcStat, destStat, src, dest, opts, cb) {
331393
+ async function onFile(srcStat, destStat, src, dest, opts) {
331418
331394
  if (!destStat)
331419
- return copyFile(srcStat, src, dest, opts, cb);
331420
- return mayCopyFile(srcStat, src, dest, opts, cb);
331421
- }
331422
- function mayCopyFile(srcStat, src, dest, opts, cb) {
331395
+ return copyFile(srcStat, src, dest, opts);
331423
331396
  if (opts.overwrite) {
331424
- fs8.unlink(dest, (err) => {
331425
- if (err)
331426
- return cb(err);
331427
- return copyFile(srcStat, src, dest, opts, cb);
331428
- });
331429
- } else if (opts.errorOnExist) {
331430
- return cb(new Error(`'${dest}' already exists`));
331431
- } else
331432
- return cb();
331433
- }
331434
- function copyFile(srcStat, src, dest, opts, cb) {
331435
- fs8.copyFile(src, dest, (err) => {
331436
- if (err)
331437
- return cb(err);
331438
- if (opts.preserveTimestamps)
331439
- return handleTimestampsAndMode(srcStat.mode, src, dest, cb);
331440
- return setDestMode(dest, srcStat.mode, cb);
331441
- });
331397
+ await fs8.unlink(dest);
331398
+ return copyFile(srcStat, src, dest, opts);
331399
+ }
331400
+ if (opts.errorOnExist) {
331401
+ throw new Error(`'${dest}' already exists`);
331402
+ }
331442
331403
  }
331443
- function handleTimestampsAndMode(srcMode, src, dest, cb) {
331444
- if (fileIsNotWritable(srcMode)) {
331445
- return makeFileWritable(dest, srcMode, (err) => {
331446
- if (err)
331447
- return cb(err);
331448
- return setDestTimestampsAndMode(srcMode, src, dest, cb);
331449
- });
331404
+ async function copyFile(srcStat, src, dest, opts) {
331405
+ await fs8.copyFile(src, dest);
331406
+ if (opts.preserveTimestamps) {
331407
+ if (fileIsNotWritable(srcStat.mode)) {
331408
+ await makeFileWritable(dest, srcStat.mode);
331409
+ }
331410
+ const updatedSrcStat = await fs8.stat(src);
331411
+ await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime);
331450
331412
  }
331451
- return setDestTimestampsAndMode(srcMode, src, dest, cb);
331413
+ return fs8.chmod(dest, srcStat.mode);
331452
331414
  }
331453
331415
  function fileIsNotWritable(srcMode) {
331454
331416
  return (srcMode & 128) === 0;
331455
331417
  }
331456
- function makeFileWritable(dest, srcMode, cb) {
331457
- return setDestMode(dest, srcMode | 128, cb);
331458
- }
331459
- function setDestTimestampsAndMode(srcMode, src, dest, cb) {
331460
- setDestTimestamps(src, dest, (err) => {
331461
- if (err)
331462
- return cb(err);
331463
- return setDestMode(dest, srcMode, cb);
331464
- });
331465
- }
331466
- function setDestMode(dest, srcMode, cb) {
331467
- return fs8.chmod(dest, srcMode, cb);
331468
- }
331469
- function setDestTimestamps(src, dest, cb) {
331470
- fs8.stat(src, (err, updatedSrcStat) => {
331471
- if (err)
331472
- return cb(err);
331473
- return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb);
331474
- });
331475
- }
331476
- function onDir(srcStat, destStat, src, dest, opts, cb) {
331477
- if (!destStat)
331478
- return mkDirAndCopy(srcStat.mode, src, dest, opts, cb);
331479
- return copyDir(src, dest, opts, cb);
331480
- }
331481
- function mkDirAndCopy(srcMode, src, dest, opts, cb) {
331482
- fs8.mkdir(dest, (err) => {
331483
- if (err)
331484
- return cb(err);
331485
- copyDir(src, dest, opts, (err2) => {
331486
- if (err2)
331487
- return cb(err2);
331488
- return setDestMode(dest, srcMode, cb);
331489
- });
331490
- });
331491
- }
331492
- function copyDir(src, dest, opts, cb) {
331493
- fs8.readdir(src, (err, items) => {
331494
- if (err)
331495
- return cb(err);
331496
- return copyDirItems(items, src, dest, opts, cb);
331497
- });
331498
- }
331499
- function copyDirItems(items, src, dest, opts, cb) {
331500
- const item = items.pop();
331501
- if (!item)
331502
- return cb();
331503
- return copyDirItem(items, item, src, dest, opts, cb);
331418
+ function makeFileWritable(dest, srcMode) {
331419
+ return fs8.chmod(dest, srcMode | 128);
331504
331420
  }
331505
- function copyDirItem(items, item, src, dest, opts, cb) {
331506
- const srcItem = path9.join(src, item);
331507
- const destItem = path9.join(dest, item);
331508
- runFilter(srcItem, destItem, opts, (err, include) => {
331509
- if (err)
331510
- return cb(err);
331421
+ async function onDir(srcStat, destStat, src, dest, opts) {
331422
+ if (!destStat) {
331423
+ await fs8.mkdir(dest);
331424
+ }
331425
+ const items = await fs8.readdir(src);
331426
+ await Promise.all(items.map(async (item) => {
331427
+ const srcItem = path9.join(src, item);
331428
+ const destItem = path9.join(dest, item);
331429
+ const include = await runFilter(srcItem, destItem, opts);
331511
331430
  if (!include)
331512
- return copyDirItems(items, src, dest, opts, cb);
331513
- stat.checkPaths(srcItem, destItem, "copy", opts, (err2, stats) => {
331514
- if (err2)
331515
- return cb(err2);
331516
- const { destStat } = stats;
331517
- getStats(destStat, srcItem, destItem, opts, (err3) => {
331518
- if (err3)
331519
- return cb(err3);
331520
- return copyDirItems(items, src, dest, opts, cb);
331521
- });
331522
- });
331523
- });
331524
- }
331525
- function onLink(destStat, src, dest, opts, cb) {
331526
- fs8.readlink(src, (err, resolvedSrc) => {
331527
- if (err)
331528
- return cb(err);
331529
- if (opts.dereference) {
331530
- resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
331531
- }
331532
- if (!destStat) {
331533
- return fs8.symlink(resolvedSrc, dest, cb);
331534
- } else {
331535
- fs8.readlink(dest, (err2, resolvedDest) => {
331536
- if (err2) {
331537
- if (err2.code === "EINVAL" || err2.code === "UNKNOWN")
331538
- return fs8.symlink(resolvedSrc, dest, cb);
331539
- return cb(err2);
331540
- }
331541
- if (opts.dereference) {
331542
- resolvedDest = path9.resolve(process.cwd(), resolvedDest);
331543
- }
331544
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
331545
- return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`));
331546
- }
331547
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
331548
- return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`));
331549
- }
331550
- return copyLink(resolvedSrc, dest, cb);
331551
- });
331552
- }
331553
- });
331431
+ return;
331432
+ const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts);
331433
+ return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
331434
+ }));
331435
+ if (!destStat) {
331436
+ await fs8.chmod(dest, srcStat.mode);
331437
+ }
331554
331438
  }
331555
- function copyLink(resolvedSrc, dest, cb) {
331556
- fs8.unlink(dest, (err) => {
331557
- if (err)
331558
- return cb(err);
331559
- return fs8.symlink(resolvedSrc, dest, cb);
331560
- });
331439
+ async function onLink(destStat, src, dest, opts) {
331440
+ let resolvedSrc = await fs8.readlink(src);
331441
+ if (opts.dereference) {
331442
+ resolvedSrc = path9.resolve(process.cwd(), resolvedSrc);
331443
+ }
331444
+ if (!destStat) {
331445
+ return fs8.symlink(resolvedSrc, dest);
331446
+ }
331447
+ let resolvedDest = null;
331448
+ try {
331449
+ resolvedDest = await fs8.readlink(dest);
331450
+ } catch (e3) {
331451
+ if (e3.code === "EINVAL" || e3.code === "UNKNOWN")
331452
+ return fs8.symlink(resolvedSrc, dest);
331453
+ throw e3;
331454
+ }
331455
+ if (opts.dereference) {
331456
+ resolvedDest = path9.resolve(process.cwd(), resolvedDest);
331457
+ }
331458
+ if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
331459
+ throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`);
331460
+ }
331461
+ if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
331462
+ throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`);
331463
+ }
331464
+ await fs8.unlink(dest);
331465
+ return fs8.symlink(resolvedSrc, dest);
331561
331466
  }
331562
331467
  module2.exports = copy;
331563
331468
  }
331564
331469
  });
331565
331470
 
331566
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js
331471
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js
331567
331472
  var require_copy_sync = __commonJS({
331568
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
331473
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/copy-sync.js"(exports, module2) {
331569
331474
  "use strict";
331570
331475
  var fs8 = require_graceful_fs();
331571
331476
  var path9 = require("path");
@@ -331704,11 +331609,11 @@ var require_copy_sync = __commonJS({
331704
331609
  }
331705
331610
  });
331706
331611
 
331707
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js
331612
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js
331708
331613
  var require_copy2 = __commonJS({
331709
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
331614
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/copy/index.js"(exports, module2) {
331710
331615
  "use strict";
331711
- var u = require_universalify().fromCallback;
331616
+ var u = require_universalify().fromPromise;
331712
331617
  module2.exports = {
331713
331618
  copy: u(require_copy()),
331714
331619
  copySync: require_copy_sync()
@@ -331716,9 +331621,9 @@ var require_copy2 = __commonJS({
331716
331621
  }
331717
331622
  });
331718
331623
 
331719
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js
331624
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js
331720
331625
  var require_remove = __commonJS({
331721
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
331626
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/remove/index.js"(exports, module2) {
331722
331627
  "use strict";
331723
331628
  var fs8 = require_graceful_fs();
331724
331629
  var u = require_universalify().fromCallback;
@@ -331735,9 +331640,9 @@ var require_remove = __commonJS({
331735
331640
  }
331736
331641
  });
331737
331642
 
331738
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js
331643
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js
331739
331644
  var require_empty2 = __commonJS({
331740
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
331645
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/empty/index.js"(exports, module2) {
331741
331646
  "use strict";
331742
331647
  var u = require_universalify().fromPromise;
331743
331648
  var fs8 = require_fs6();
@@ -331774,47 +331679,40 @@ var require_empty2 = __commonJS({
331774
331679
  }
331775
331680
  });
331776
331681
 
331777
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js
331682
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js
331778
331683
  var require_file = __commonJS({
331779
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
331684
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/file.js"(exports, module2) {
331780
331685
  "use strict";
331781
- var u = require_universalify().fromCallback;
331686
+ var u = require_universalify().fromPromise;
331782
331687
  var path9 = require("path");
331783
- var fs8 = require_graceful_fs();
331688
+ var fs8 = require_fs6();
331784
331689
  var mkdir = require_mkdirs();
331785
- function createFile(file, callback) {
331786
- function makeFile() {
331787
- fs8.writeFile(file, "", (err) => {
331788
- if (err)
331789
- return callback(err);
331790
- callback();
331791
- });
331690
+ async function createFile(file) {
331691
+ let stats;
331692
+ try {
331693
+ stats = await fs8.stat(file);
331694
+ } catch {
331695
+ }
331696
+ if (stats && stats.isFile())
331697
+ return;
331698
+ const dir = path9.dirname(file);
331699
+ let dirStats = null;
331700
+ try {
331701
+ dirStats = await fs8.stat(dir);
331702
+ } catch (err) {
331703
+ if (err.code === "ENOENT") {
331704
+ await mkdir.mkdirs(dir);
331705
+ await fs8.writeFile(file, "");
331706
+ return;
331707
+ } else {
331708
+ throw err;
331709
+ }
331710
+ }
331711
+ if (dirStats.isDirectory()) {
331712
+ await fs8.writeFile(file, "");
331713
+ } else {
331714
+ await fs8.readdir(dir);
331792
331715
  }
331793
- fs8.stat(file, (err, stats) => {
331794
- if (!err && stats.isFile())
331795
- return callback();
331796
- const dir = path9.dirname(file);
331797
- fs8.stat(dir, (err2, stats2) => {
331798
- if (err2) {
331799
- if (err2.code === "ENOENT") {
331800
- return mkdir.mkdirs(dir, (err3) => {
331801
- if (err3)
331802
- return callback(err3);
331803
- makeFile();
331804
- });
331805
- }
331806
- return callback(err2);
331807
- }
331808
- if (stats2.isDirectory())
331809
- makeFile();
331810
- else {
331811
- fs8.readdir(dir, (err3) => {
331812
- if (err3)
331813
- return callback(err3);
331814
- });
331815
- }
331816
- });
331817
- });
331818
331716
  }
331819
331717
  function createFileSync(file) {
331820
331718
  let stats;
@@ -331844,46 +331742,37 @@ var require_file = __commonJS({
331844
331742
  }
331845
331743
  });
331846
331744
 
331847
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js
331745
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js
331848
331746
  var require_link = __commonJS({
331849
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
331747
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/link.js"(exports, module2) {
331850
331748
  "use strict";
331851
- var u = require_universalify().fromCallback;
331749
+ var u = require_universalify().fromPromise;
331852
331750
  var path9 = require("path");
331853
- var fs8 = require_graceful_fs();
331751
+ var fs8 = require_fs6();
331854
331752
  var mkdir = require_mkdirs();
331855
- var pathExists = require_path_exists().pathExists;
331753
+ var { pathExists } = require_path_exists();
331856
331754
  var { areIdentical } = require_stat();
331857
- function createLink(srcpath, dstpath, callback) {
331858
- function makeLink(srcpath2, dstpath2) {
331859
- fs8.link(srcpath2, dstpath2, (err) => {
331860
- if (err)
331861
- return callback(err);
331862
- callback(null);
331863
- });
331755
+ async function createLink(srcpath, dstpath) {
331756
+ let dstStat;
331757
+ try {
331758
+ dstStat = await fs8.lstat(dstpath);
331759
+ } catch {
331864
331760
  }
331865
- fs8.lstat(dstpath, (_6, dstStat) => {
331866
- fs8.lstat(srcpath, (err, srcStat) => {
331867
- if (err) {
331868
- err.message = err.message.replace("lstat", "ensureLink");
331869
- return callback(err);
331870
- }
331871
- if (dstStat && areIdentical(srcStat, dstStat))
331872
- return callback(null);
331873
- const dir = path9.dirname(dstpath);
331874
- pathExists(dir, (err2, dirExists) => {
331875
- if (err2)
331876
- return callback(err2);
331877
- if (dirExists)
331878
- return makeLink(srcpath, dstpath);
331879
- mkdir.mkdirs(dir, (err3) => {
331880
- if (err3)
331881
- return callback(err3);
331882
- makeLink(srcpath, dstpath);
331883
- });
331884
- });
331885
- });
331886
- });
331761
+ let srcStat;
331762
+ try {
331763
+ srcStat = await fs8.lstat(srcpath);
331764
+ } catch (err) {
331765
+ err.message = err.message.replace("lstat", "ensureLink");
331766
+ throw err;
331767
+ }
331768
+ if (dstStat && areIdentical(srcStat, dstStat))
331769
+ return;
331770
+ const dir = path9.dirname(dstpath);
331771
+ const dirExists = await pathExists(dir);
331772
+ if (!dirExists) {
331773
+ await mkdir.mkdirs(dir);
331774
+ }
331775
+ await fs8.link(srcpath, dstpath);
331887
331776
  }
331888
331777
  function createLinkSync(srcpath, dstpath) {
331889
331778
  let dstStat;
@@ -331913,109 +331802,102 @@ var require_link = __commonJS({
331913
331802
  }
331914
331803
  });
331915
331804
 
331916
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js
331805
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js
331917
331806
  var require_symlink_paths = __commonJS({
331918
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
331807
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports, module2) {
331919
331808
  "use strict";
331920
331809
  var path9 = require("path");
331921
- var fs8 = require_graceful_fs();
331922
- var pathExists = require_path_exists().pathExists;
331923
- function symlinkPaths(srcpath, dstpath, callback) {
331810
+ var fs8 = require_fs6();
331811
+ var { pathExists } = require_path_exists();
331812
+ var u = require_universalify().fromPromise;
331813
+ async function symlinkPaths(srcpath, dstpath) {
331924
331814
  if (path9.isAbsolute(srcpath)) {
331925
- return fs8.lstat(srcpath, (err) => {
331926
- if (err) {
331927
- err.message = err.message.replace("lstat", "ensureSymlink");
331928
- return callback(err);
331929
- }
331930
- return callback(null, {
331931
- toCwd: srcpath,
331932
- toDst: srcpath
331933
- });
331934
- });
331935
- } else {
331936
- const dstdir = path9.dirname(dstpath);
331937
- const relativeToDst = path9.join(dstdir, srcpath);
331938
- return pathExists(relativeToDst, (err, exists) => {
331939
- if (err)
331940
- return callback(err);
331941
- if (exists) {
331942
- return callback(null, {
331943
- toCwd: relativeToDst,
331944
- toDst: srcpath
331945
- });
331946
- } else {
331947
- return fs8.lstat(srcpath, (err2) => {
331948
- if (err2) {
331949
- err2.message = err2.message.replace("lstat", "ensureSymlink");
331950
- return callback(err2);
331951
- }
331952
- return callback(null, {
331953
- toCwd: srcpath,
331954
- toDst: path9.relative(dstdir, srcpath)
331955
- });
331956
- });
331957
- }
331958
- });
331815
+ try {
331816
+ await fs8.lstat(srcpath);
331817
+ } catch (err) {
331818
+ err.message = err.message.replace("lstat", "ensureSymlink");
331819
+ throw err;
331820
+ }
331821
+ return {
331822
+ toCwd: srcpath,
331823
+ toDst: srcpath
331824
+ };
331825
+ }
331826
+ const dstdir = path9.dirname(dstpath);
331827
+ const relativeToDst = path9.join(dstdir, srcpath);
331828
+ const exists = await pathExists(relativeToDst);
331829
+ if (exists) {
331830
+ return {
331831
+ toCwd: relativeToDst,
331832
+ toDst: srcpath
331833
+ };
331834
+ }
331835
+ try {
331836
+ await fs8.lstat(srcpath);
331837
+ } catch (err) {
331838
+ err.message = err.message.replace("lstat", "ensureSymlink");
331839
+ throw err;
331959
331840
  }
331841
+ return {
331842
+ toCwd: srcpath,
331843
+ toDst: path9.relative(dstdir, srcpath)
331844
+ };
331960
331845
  }
331961
331846
  function symlinkPathsSync(srcpath, dstpath) {
331962
- let exists;
331963
331847
  if (path9.isAbsolute(srcpath)) {
331964
- exists = fs8.existsSync(srcpath);
331965
- if (!exists)
331848
+ const exists2 = fs8.existsSync(srcpath);
331849
+ if (!exists2)
331966
331850
  throw new Error("absolute srcpath does not exist");
331967
331851
  return {
331968
331852
  toCwd: srcpath,
331969
331853
  toDst: srcpath
331970
331854
  };
331971
- } else {
331972
- const dstdir = path9.dirname(dstpath);
331973
- const relativeToDst = path9.join(dstdir, srcpath);
331974
- exists = fs8.existsSync(relativeToDst);
331975
- if (exists) {
331976
- return {
331977
- toCwd: relativeToDst,
331978
- toDst: srcpath
331979
- };
331980
- } else {
331981
- exists = fs8.existsSync(srcpath);
331982
- if (!exists)
331983
- throw new Error("relative srcpath does not exist");
331984
- return {
331985
- toCwd: srcpath,
331986
- toDst: path9.relative(dstdir, srcpath)
331987
- };
331988
- }
331989
331855
  }
331856
+ const dstdir = path9.dirname(dstpath);
331857
+ const relativeToDst = path9.join(dstdir, srcpath);
331858
+ const exists = fs8.existsSync(relativeToDst);
331859
+ if (exists) {
331860
+ return {
331861
+ toCwd: relativeToDst,
331862
+ toDst: srcpath
331863
+ };
331864
+ }
331865
+ const srcExists = fs8.existsSync(srcpath);
331866
+ if (!srcExists)
331867
+ throw new Error("relative srcpath does not exist");
331868
+ return {
331869
+ toCwd: srcpath,
331870
+ toDst: path9.relative(dstdir, srcpath)
331871
+ };
331990
331872
  }
331991
331873
  module2.exports = {
331992
- symlinkPaths,
331874
+ symlinkPaths: u(symlinkPaths),
331993
331875
  symlinkPathsSync
331994
331876
  };
331995
331877
  }
331996
331878
  });
331997
331879
 
331998
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js
331880
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js
331999
331881
  var require_symlink_type = __commonJS({
332000
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
331882
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink-type.js"(exports, module2) {
332001
331883
  "use strict";
332002
- var fs8 = require_graceful_fs();
332003
- function symlinkType(srcpath, type, callback) {
332004
- callback = typeof type === "function" ? type : callback;
332005
- type = typeof type === "function" ? false : type;
331884
+ var fs8 = require_fs6();
331885
+ var u = require_universalify().fromPromise;
331886
+ async function symlinkType(srcpath, type) {
332006
331887
  if (type)
332007
- return callback(null, type);
332008
- fs8.lstat(srcpath, (err, stats) => {
332009
- if (err)
332010
- return callback(null, "file");
332011
- type = stats && stats.isDirectory() ? "dir" : "file";
332012
- callback(null, type);
332013
- });
331888
+ return type;
331889
+ let stats;
331890
+ try {
331891
+ stats = await fs8.lstat(srcpath);
331892
+ } catch {
331893
+ return "file";
331894
+ }
331895
+ return stats && stats.isDirectory() ? "dir" : "file";
332014
331896
  }
332015
331897
  function symlinkTypeSync(srcpath, type) {
332016
- let stats;
332017
331898
  if (type)
332018
331899
  return type;
331900
+ let stats;
332019
331901
  try {
332020
331902
  stats = fs8.lstatSync(srcpath);
332021
331903
  } catch {
@@ -332024,69 +331906,46 @@ var require_symlink_type = __commonJS({
332024
331906
  return stats && stats.isDirectory() ? "dir" : "file";
332025
331907
  }
332026
331908
  module2.exports = {
332027
- symlinkType,
331909
+ symlinkType: u(symlinkType),
332028
331910
  symlinkTypeSync
332029
331911
  };
332030
331912
  }
332031
331913
  });
332032
331914
 
332033
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js
331915
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js
332034
331916
  var require_symlink = __commonJS({
332035
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
331917
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/symlink.js"(exports, module2) {
332036
331918
  "use strict";
332037
- var u = require_universalify().fromCallback;
331919
+ var u = require_universalify().fromPromise;
332038
331920
  var path9 = require("path");
332039
331921
  var fs8 = require_fs6();
332040
- var _mkdirs = require_mkdirs();
332041
- var mkdirs = _mkdirs.mkdirs;
332042
- var mkdirsSync = _mkdirs.mkdirsSync;
332043
- var _symlinkPaths = require_symlink_paths();
332044
- var symlinkPaths = _symlinkPaths.symlinkPaths;
332045
- var symlinkPathsSync = _symlinkPaths.symlinkPathsSync;
332046
- var _symlinkType = require_symlink_type();
332047
- var symlinkType = _symlinkType.symlinkType;
332048
- var symlinkTypeSync = _symlinkType.symlinkTypeSync;
332049
- var pathExists = require_path_exists().pathExists;
331922
+ var { mkdirs, mkdirsSync } = require_mkdirs();
331923
+ var { symlinkPaths, symlinkPathsSync } = require_symlink_paths();
331924
+ var { symlinkType, symlinkTypeSync } = require_symlink_type();
331925
+ var { pathExists } = require_path_exists();
332050
331926
  var { areIdentical } = require_stat();
332051
- function createSymlink(srcpath, dstpath, type, callback) {
332052
- callback = typeof type === "function" ? type : callback;
332053
- type = typeof type === "function" ? false : type;
332054
- fs8.lstat(dstpath, (err, stats) => {
332055
- if (!err && stats.isSymbolicLink()) {
332056
- Promise.all([
332057
- fs8.stat(srcpath),
332058
- fs8.stat(dstpath)
332059
- ]).then(([srcStat, dstStat]) => {
332060
- if (areIdentical(srcStat, dstStat))
332061
- return callback(null);
332062
- _createSymlink(srcpath, dstpath, type, callback);
332063
- });
332064
- } else
332065
- _createSymlink(srcpath, dstpath, type, callback);
332066
- });
332067
- }
332068
- function _createSymlink(srcpath, dstpath, type, callback) {
332069
- symlinkPaths(srcpath, dstpath, (err, relative) => {
332070
- if (err)
332071
- return callback(err);
332072
- srcpath = relative.toDst;
332073
- symlinkType(relative.toCwd, type, (err2, type2) => {
332074
- if (err2)
332075
- return callback(err2);
332076
- const dir = path9.dirname(dstpath);
332077
- pathExists(dir, (err3, dirExists) => {
332078
- if (err3)
332079
- return callback(err3);
332080
- if (dirExists)
332081
- return fs8.symlink(srcpath, dstpath, type2, callback);
332082
- mkdirs(dir, (err4) => {
332083
- if (err4)
332084
- return callback(err4);
332085
- fs8.symlink(srcpath, dstpath, type2, callback);
332086
- });
332087
- });
332088
- });
332089
- });
331927
+ async function createSymlink(srcpath, dstpath, type) {
331928
+ let stats;
331929
+ try {
331930
+ stats = await fs8.lstat(dstpath);
331931
+ } catch {
331932
+ }
331933
+ if (stats && stats.isSymbolicLink()) {
331934
+ const [srcStat, dstStat] = await Promise.all([
331935
+ fs8.stat(srcpath),
331936
+ fs8.stat(dstpath)
331937
+ ]);
331938
+ if (areIdentical(srcStat, dstStat))
331939
+ return;
331940
+ }
331941
+ const relative = await symlinkPaths(srcpath, dstpath);
331942
+ srcpath = relative.toDst;
331943
+ const toType = await symlinkType(relative.toCwd, type);
331944
+ const dir = path9.dirname(dstpath);
331945
+ if (!await pathExists(dir)) {
331946
+ await mkdirs(dir);
331947
+ }
331948
+ return fs8.symlink(srcpath, dstpath, toType);
332090
331949
  }
332091
331950
  function createSymlinkSync(srcpath, dstpath, type) {
332092
331951
  let stats;
@@ -332117,9 +331976,9 @@ var require_symlink = __commonJS({
332117
331976
  }
332118
331977
  });
332119
331978
 
332120
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js
331979
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js
332121
331980
  var require_ensure = __commonJS({
332122
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
331981
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/ensure/index.js"(exports, module2) {
332123
331982
  "use strict";
332124
331983
  var { createFile, createFileSync } = require_file();
332125
331984
  var { createLink, createLinkSync } = require_link();
@@ -332144,6 +332003,37 @@ var require_ensure = __commonJS({
332144
332003
  }
332145
332004
  });
332146
332005
 
332006
+ // node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js
332007
+ var require_universalify2 = __commonJS({
332008
+ "node_modules/.pnpm/universalify@2.0.0/node_modules/universalify/index.js"(exports) {
332009
+ "use strict";
332010
+ exports.fromCallback = function(fn6) {
332011
+ return Object.defineProperty(function(...args) {
332012
+ if (typeof args[args.length - 1] === "function")
332013
+ fn6.apply(this, args);
332014
+ else {
332015
+ return new Promise((resolve2, reject) => {
332016
+ fn6.call(
332017
+ this,
332018
+ ...args,
332019
+ (err, res) => err != null ? reject(err) : resolve2(res)
332020
+ );
332021
+ });
332022
+ }
332023
+ }, "name", { value: fn6.name });
332024
+ };
332025
+ exports.fromPromise = function(fn6) {
332026
+ return Object.defineProperty(function(...args) {
332027
+ const cb = args[args.length - 1];
332028
+ if (typeof cb !== "function")
332029
+ return fn6.apply(this, args);
332030
+ else
332031
+ fn6.apply(this, args.slice(0, -1)).then((r3) => cb(null, r3), cb);
332032
+ }, "name", { value: fn6.name });
332033
+ };
332034
+ }
332035
+ });
332036
+
332147
332037
  // node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js
332148
332038
  var require_utils7 = __commonJS({
332149
332039
  "node_modules/.pnpm/jsonfile@6.1.0/node_modules/jsonfile/utils.js"(exports, module2) {
@@ -332172,7 +332062,7 @@ var require_jsonfile = __commonJS({
332172
332062
  } catch (_6) {
332173
332063
  _fs = require("fs");
332174
332064
  }
332175
- var universalify = require_universalify();
332065
+ var universalify = require_universalify2();
332176
332066
  var { stringify, stripBom } = require_utils7();
332177
332067
  async function _readFile(file, options8 = {}) {
332178
332068
  if (typeof options8 === "string") {
@@ -332236,9 +332126,9 @@ var require_jsonfile = __commonJS({
332236
332126
  }
332237
332127
  });
332238
332128
 
332239
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js
332129
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js
332240
332130
  var require_jsonfile2 = __commonJS({
332241
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
332131
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/jsonfile.js"(exports, module2) {
332242
332132
  "use strict";
332243
332133
  var jsonFile = require_jsonfile();
332244
332134
  module2.exports = {
@@ -332251,39 +332141,27 @@ var require_jsonfile2 = __commonJS({
332251
332141
  }
332252
332142
  });
332253
332143
 
332254
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js
332144
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js
332255
332145
  var require_output_file = __commonJS({
332256
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
332146
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/output-file/index.js"(exports, module2) {
332257
332147
  "use strict";
332258
- var u = require_universalify().fromCallback;
332259
- var fs8 = require_graceful_fs();
332148
+ var u = require_universalify().fromPromise;
332149
+ var fs8 = require_fs6();
332260
332150
  var path9 = require("path");
332261
332151
  var mkdir = require_mkdirs();
332262
332152
  var pathExists = require_path_exists().pathExists;
332263
- function outputFile(file, data, encoding, callback) {
332264
- if (typeof encoding === "function") {
332265
- callback = encoding;
332266
- encoding = "utf8";
332267
- }
332153
+ async function outputFile(file, data, encoding = "utf-8") {
332268
332154
  const dir = path9.dirname(file);
332269
- pathExists(dir, (err, itDoes) => {
332270
- if (err)
332271
- return callback(err);
332272
- if (itDoes)
332273
- return fs8.writeFile(file, data, encoding, callback);
332274
- mkdir.mkdirs(dir, (err2) => {
332275
- if (err2)
332276
- return callback(err2);
332277
- fs8.writeFile(file, data, encoding, callback);
332278
- });
332279
- });
332155
+ if (!await pathExists(dir)) {
332156
+ await mkdir.mkdirs(dir);
332157
+ }
332158
+ return fs8.writeFile(file, data, encoding);
332280
332159
  }
332281
332160
  function outputFileSync(file, ...args) {
332282
332161
  const dir = path9.dirname(file);
332283
- if (fs8.existsSync(dir)) {
332284
- return fs8.writeFileSync(file, ...args);
332162
+ if (!fs8.existsSync(dir)) {
332163
+ mkdir.mkdirsSync(dir);
332285
332164
  }
332286
- mkdir.mkdirsSync(dir);
332287
332165
  fs8.writeFileSync(file, ...args);
332288
332166
  }
332289
332167
  module2.exports = {
@@ -332293,9 +332171,9 @@ var require_output_file = __commonJS({
332293
332171
  }
332294
332172
  });
332295
332173
 
332296
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js
332174
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js
332297
332175
  var require_output_json = __commonJS({
332298
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
332176
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json.js"(exports, module2) {
332299
332177
  "use strict";
332300
332178
  var { stringify } = require_utils7();
332301
332179
  var { outputFile } = require_output_file();
@@ -332307,9 +332185,9 @@ var require_output_json = __commonJS({
332307
332185
  }
332308
332186
  });
332309
332187
 
332310
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js
332188
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js
332311
332189
  var require_output_json_sync = __commonJS({
332312
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
332190
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/output-json-sync.js"(exports, module2) {
332313
332191
  "use strict";
332314
332192
  var { stringify } = require_utils7();
332315
332193
  var { outputFileSync } = require_output_file();
@@ -332321,9 +332199,9 @@ var require_output_json_sync = __commonJS({
332321
332199
  }
332322
332200
  });
332323
332201
 
332324
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js
332202
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js
332325
332203
  var require_json2 = __commonJS({
332326
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
332204
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/json/index.js"(exports, module2) {
332327
332205
  "use strict";
332328
332206
  var u = require_universalify().fromPromise;
332329
332207
  var jsonFile = require_jsonfile2();
@@ -332339,92 +332217,61 @@ var require_json2 = __commonJS({
332339
332217
  }
332340
332218
  });
332341
332219
 
332342
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js
332220
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js
332343
332221
  var require_move = __commonJS({
332344
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
332222
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move.js"(exports, module2) {
332345
332223
  "use strict";
332346
- var fs8 = require_graceful_fs();
332224
+ var fs8 = require_fs6();
332347
332225
  var path9 = require("path");
332348
- var copy = require_copy2().copy;
332349
- var remove = require_remove().remove;
332350
- var mkdirp = require_mkdirs().mkdirp;
332351
- var pathExists = require_path_exists().pathExists;
332226
+ var { copy } = require_copy2();
332227
+ var { remove } = require_remove();
332228
+ var { mkdirp } = require_mkdirs();
332229
+ var { pathExists } = require_path_exists();
332352
332230
  var stat = require_stat();
332353
- function move(src, dest, opts, cb) {
332354
- if (typeof opts === "function") {
332355
- cb = opts;
332356
- opts = {};
332357
- }
332358
- opts = opts || {};
332231
+ async function move(src, dest, opts = {}) {
332359
332232
  const overwrite = opts.overwrite || opts.clobber || false;
332360
- stat.checkPaths(src, dest, "move", opts, (err, stats) => {
332361
- if (err)
332362
- return cb(err);
332363
- const { srcStat, isChangingCase = false } = stats;
332364
- stat.checkParentPaths(src, srcStat, dest, "move", (err2) => {
332365
- if (err2)
332366
- return cb(err2);
332367
- if (isParentRoot(dest))
332368
- return doRename(src, dest, overwrite, isChangingCase, cb);
332369
- mkdirp(path9.dirname(dest), (err3) => {
332370
- if (err3)
332371
- return cb(err3);
332372
- return doRename(src, dest, overwrite, isChangingCase, cb);
332373
- });
332374
- });
332375
- });
332376
- }
332377
- function isParentRoot(dest) {
332378
- const parent = path9.dirname(dest);
332379
- const parsedPath = path9.parse(parent);
332380
- return parsedPath.root === parent;
332381
- }
332382
- function doRename(src, dest, overwrite, isChangingCase, cb) {
332383
- if (isChangingCase)
332384
- return rename(src, dest, overwrite, cb);
332385
- if (overwrite) {
332386
- return remove(dest, (err) => {
332387
- if (err)
332388
- return cb(err);
332389
- return rename(src, dest, overwrite, cb);
332390
- });
332233
+ const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts);
332234
+ await stat.checkParentPaths(src, srcStat, dest, "move");
332235
+ const destParent = path9.dirname(dest);
332236
+ const parsedParentPath = path9.parse(destParent);
332237
+ if (parsedParentPath.root !== destParent) {
332238
+ await mkdirp(destParent);
332391
332239
  }
332392
- pathExists(dest, (err, destExists) => {
332393
- if (err)
332394
- return cb(err);
332395
- if (destExists)
332396
- return cb(new Error("dest already exists."));
332397
- return rename(src, dest, overwrite, cb);
332398
- });
332240
+ return doRename(src, dest, overwrite, isChangingCase);
332399
332241
  }
332400
- function rename(src, dest, overwrite, cb) {
332401
- fs8.rename(src, dest, (err) => {
332402
- if (!err)
332403
- return cb();
332404
- if (err.code !== "EXDEV")
332405
- return cb(err);
332406
- return moveAcrossDevice(src, dest, overwrite, cb);
332407
- });
332242
+ async function doRename(src, dest, overwrite, isChangingCase) {
332243
+ if (!isChangingCase) {
332244
+ if (overwrite) {
332245
+ await remove(dest);
332246
+ } else if (await pathExists(dest)) {
332247
+ throw new Error("dest already exists.");
332248
+ }
332249
+ }
332250
+ try {
332251
+ await fs8.rename(src, dest);
332252
+ } catch (err) {
332253
+ if (err.code !== "EXDEV") {
332254
+ throw err;
332255
+ }
332256
+ await moveAcrossDevice(src, dest, overwrite);
332257
+ }
332408
332258
  }
332409
- function moveAcrossDevice(src, dest, overwrite, cb) {
332259
+ async function moveAcrossDevice(src, dest, overwrite) {
332410
332260
  const opts = {
332411
332261
  overwrite,
332412
332262
  errorOnExist: true,
332413
332263
  preserveTimestamps: true
332414
332264
  };
332415
- copy(src, dest, opts, (err) => {
332416
- if (err)
332417
- return cb(err);
332418
- return remove(src, cb);
332419
- });
332265
+ await copy(src, dest, opts);
332266
+ return remove(src);
332420
332267
  }
332421
332268
  module2.exports = move;
332422
332269
  }
332423
332270
  });
332424
332271
 
332425
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js
332272
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js
332426
332273
  var require_move_sync = __commonJS({
332427
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
332274
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/move-sync.js"(exports, module2) {
332428
332275
  "use strict";
332429
332276
  var fs8 = require_graceful_fs();
332430
332277
  var path9 = require("path");
@@ -332479,11 +332326,11 @@ var require_move_sync = __commonJS({
332479
332326
  }
332480
332327
  });
332481
332328
 
332482
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js
332329
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js
332483
332330
  var require_move2 = __commonJS({
332484
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
332331
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/move/index.js"(exports, module2) {
332485
332332
  "use strict";
332486
- var u = require_universalify().fromCallback;
332333
+ var u = require_universalify().fromPromise;
332487
332334
  module2.exports = {
332488
332335
  move: u(require_move()),
332489
332336
  moveSync: require_move_sync()
@@ -332491,9 +332338,9 @@ var require_move2 = __commonJS({
332491
332338
  }
332492
332339
  });
332493
332340
 
332494
- // node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js
332341
+ // node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js
332495
332342
  var require_lib5 = __commonJS({
332496
- "node_modules/.pnpm/fs-extra@11.1.1/node_modules/fs-extra/lib/index.js"(exports, module2) {
332343
+ "node_modules/.pnpm/fs-extra@11.2.0/node_modules/fs-extra/lib/index.js"(exports, module2) {
332497
332344
  "use strict";
332498
332345
  module2.exports = {
332499
332346
  // Export promiseified graceful-fs: