@oclif/plugin-test-esbuild 0.5.121 → 0.5.123

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.
@@ -254,7 +254,7 @@ var require_package = __commonJS({
254
254
  module.exports = {
255
255
  name: "@oclif/core",
256
256
  description: "base library for oclif CLIs",
257
- version: "4.10.2",
257
+ version: "4.10.3",
258
258
  author: "Salesforce",
259
259
  bugs: "https://github.com/oclif/core/issues",
260
260
  dependencies: {
@@ -288,7 +288,7 @@ var require_package = __commonJS({
288
288
  "@types/chai": "^4.3.16",
289
289
  "@types/chai-as-promised": "^7.1.8",
290
290
  "@types/clean-stack": "^2.1.1",
291
- "@types/debug": "^4.1.10",
291
+ "@types/debug": "^4.1.13",
292
292
  "@types/ejs": "^3.1.5",
293
293
  "@types/indent-string": "^4.0.1",
294
294
  "@types/mocha": "^10.0.10",
@@ -1164,69 +1164,6 @@ var require_ejs = __commonJS({
1164
1164
  }
1165
1165
  });
1166
1166
 
1167
- // node_modules/is-docker/index.js
1168
- var require_is_docker = __commonJS({
1169
- "node_modules/is-docker/index.js"(exports, module) {
1170
- "use strict";
1171
- init_cjs_shims();
1172
- var fs = __require("fs");
1173
- var isDocker;
1174
- function hasDockerEnv() {
1175
- try {
1176
- fs.statSync("/.dockerenv");
1177
- return true;
1178
- } catch (_) {
1179
- return false;
1180
- }
1181
- }
1182
- function hasDockerCGroup() {
1183
- try {
1184
- return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
1185
- } catch (_) {
1186
- return false;
1187
- }
1188
- }
1189
- module.exports = () => {
1190
- if (isDocker === void 0) {
1191
- isDocker = hasDockerEnv() || hasDockerCGroup();
1192
- }
1193
- return isDocker;
1194
- };
1195
- }
1196
- });
1197
-
1198
- // node_modules/is-wsl/index.js
1199
- var require_is_wsl = __commonJS({
1200
- "node_modules/is-wsl/index.js"(exports, module) {
1201
- "use strict";
1202
- init_cjs_shims();
1203
- var os = __require("os");
1204
- var fs = __require("fs");
1205
- var isDocker = require_is_docker();
1206
- var isWsl = () => {
1207
- if (process.platform !== "linux") {
1208
- return false;
1209
- }
1210
- if (os.release().toLowerCase().includes("microsoft")) {
1211
- if (isDocker()) {
1212
- return false;
1213
- }
1214
- return true;
1215
- }
1216
- try {
1217
- return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
1218
- } catch (_) {
1219
- return false;
1220
- }
1221
- };
1222
- if (process.env.__IS_WSL_TEST__) {
1223
- module.exports = isWsl;
1224
- } else {
1225
- module.exports = isWsl();
1226
- }
1227
- }
1228
- });
1229
-
1230
1167
  // node_modules/ms/index.js
1231
1168
  var require_ms = __commonJS({
1232
1169
  "node_modules/ms/index.js"(exports, module) {
@@ -217712,20 +217649,87 @@ var require_determine_priority = __commonJS({
217712
217649
  }
217713
217650
  });
217714
217651
 
217652
+ // node_modules/is-docker/index.js
217653
+ var require_is_docker = __commonJS({
217654
+ "node_modules/is-docker/index.js"(exports, module) {
217655
+ "use strict";
217656
+ init_cjs_shims();
217657
+ var fs = __require("fs");
217658
+ var isDocker;
217659
+ function hasDockerEnv() {
217660
+ try {
217661
+ fs.statSync("/.dockerenv");
217662
+ return true;
217663
+ } catch (_) {
217664
+ return false;
217665
+ }
217666
+ }
217667
+ function hasDockerCGroup() {
217668
+ try {
217669
+ return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
217670
+ } catch (_) {
217671
+ return false;
217672
+ }
217673
+ }
217674
+ module.exports = () => {
217675
+ if (isDocker === void 0) {
217676
+ isDocker = hasDockerEnv() || hasDockerCGroup();
217677
+ }
217678
+ return isDocker;
217679
+ };
217680
+ }
217681
+ });
217682
+
217683
+ // node_modules/is-wsl/index.js
217684
+ var require_is_wsl = __commonJS({
217685
+ "node_modules/is-wsl/index.js"(exports, module) {
217686
+ "use strict";
217687
+ init_cjs_shims();
217688
+ var os = __require("os");
217689
+ var fs = __require("fs");
217690
+ var isDocker = require_is_docker();
217691
+ var isWsl = () => {
217692
+ if (process.platform !== "linux") {
217693
+ return false;
217694
+ }
217695
+ if (os.release().toLowerCase().includes("microsoft")) {
217696
+ if (isDocker()) {
217697
+ return false;
217698
+ }
217699
+ return true;
217700
+ }
217701
+ try {
217702
+ return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isDocker() : false;
217703
+ } catch (_) {
217704
+ return false;
217705
+ }
217706
+ };
217707
+ if (process.env.__IS_WSL_TEST__) {
217708
+ module.exports = isWsl;
217709
+ } else {
217710
+ module.exports = isWsl();
217711
+ }
217712
+ }
217713
+ });
217714
+
217715
217715
  // node_modules/@oclif/core/lib/util/os.js
217716
217716
  var require_os = __commonJS({
217717
217717
  "node_modules/@oclif/core/lib/util/os.js"(exports) {
217718
217718
  "use strict";
217719
217719
  init_cjs_shims();
217720
+ var __importDefault = exports && exports.__importDefault || function(mod) {
217721
+ return mod && mod.__esModule ? mod : { "default": mod };
217722
+ };
217720
217723
  Object.defineProperty(exports, "__esModule", { value: true });
217721
217724
  exports.getHomeDir = getHomeDir;
217722
217725
  exports.getPlatform = getPlatform;
217726
+ var is_wsl_1 = __importDefault(require_is_wsl());
217723
217727
  var node_os_1 = __require("node:os");
217724
217728
  function getHomeDir() {
217725
217729
  return (0, node_os_1.homedir)();
217726
217730
  }
217727
217731
  function getPlatform() {
217728
- return (0, node_os_1.platform)();
217732
+ return is_wsl_1.default ? "wsl" : (0, node_os_1.platform)();
217729
217733
  }
217730
217734
  }
217731
217735
  });
@@ -219638,631 +219642,6 @@ var require_commonjs3 = __commonJS({
219638
219642
  }
219639
219643
  });
219640
219644
 
219641
- // node_modules/fdir/dist/utils.js
219642
- var require_utils2 = __commonJS({
219643
- "node_modules/fdir/dist/utils.js"(exports) {
219644
- "use strict";
219645
- init_cjs_shims();
219646
- Object.defineProperty(exports, "__esModule", { value: true });
219647
- exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
219648
- var path_1 = __require("path");
219649
- function cleanPath(path) {
219650
- let normalized = (0, path_1.normalize)(path);
219651
- if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep)
219652
- normalized = normalized.substring(0, normalized.length - 1);
219653
- return normalized;
219654
- }
219655
- exports.cleanPath = cleanPath;
219656
- var SLASHES_REGEX = /[\\/]/g;
219657
- function convertSlashes(path, separator) {
219658
- return path.replace(SLASHES_REGEX, separator);
219659
- }
219660
- exports.convertSlashes = convertSlashes;
219661
- function isRootDirectory(path) {
219662
- return path === "/" || /^[a-z]:\\$/i.test(path);
219663
- }
219664
- exports.isRootDirectory = isRootDirectory;
219665
- function normalizePath(path, options) {
219666
- const { resolvePaths, normalizePath: normalizePath2, pathSeparator } = options;
219667
- const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
219668
- if (resolvePaths)
219669
- path = (0, path_1.resolve)(path);
219670
- if (normalizePath2 || pathNeedsCleaning)
219671
- path = cleanPath(path);
219672
- if (path === ".")
219673
- return "";
219674
- const needsSeperator = path[path.length - 1] !== pathSeparator;
219675
- return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
219676
- }
219677
- exports.normalizePath = normalizePath;
219678
- }
219679
- });
219680
-
219681
- // node_modules/fdir/dist/api/functions/join-path.js
219682
- var require_join_path = __commonJS({
219683
- "node_modules/fdir/dist/api/functions/join-path.js"(exports) {
219684
- "use strict";
219685
- init_cjs_shims();
219686
- Object.defineProperty(exports, "__esModule", { value: true });
219687
- exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
219688
- var path_1 = __require("path");
219689
- var utils_1 = require_utils2();
219690
- function joinPathWithBasePath(filename, directoryPath) {
219691
- return directoryPath + filename;
219692
- }
219693
- exports.joinPathWithBasePath = joinPathWithBasePath;
219694
- function joinPathWithRelativePath(root, options) {
219695
- return function(filename, directoryPath) {
219696
- const sameRoot = directoryPath.startsWith(root);
219697
- if (sameRoot)
219698
- return directoryPath.replace(root, "") + filename;
219699
- else
219700
- return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
219701
- };
219702
- }
219703
- function joinPath(filename) {
219704
- return filename;
219705
- }
219706
- function joinDirectoryPath(filename, directoryPath, separator) {
219707
- return directoryPath + filename + separator;
219708
- }
219709
- exports.joinDirectoryPath = joinDirectoryPath;
219710
- function build(root, options) {
219711
- const { relativePaths, includeBasePath } = options;
219712
- return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
219713
- }
219714
- exports.build = build;
219715
- }
219716
- });
219717
-
219718
- // node_modules/fdir/dist/api/functions/push-directory.js
219719
- var require_push_directory = __commonJS({
219720
- "node_modules/fdir/dist/api/functions/push-directory.js"(exports) {
219721
- "use strict";
219722
- init_cjs_shims();
219723
- Object.defineProperty(exports, "__esModule", { value: true });
219724
- exports.build = void 0;
219725
- function pushDirectoryWithRelativePath(root) {
219726
- return function(directoryPath, paths) {
219727
- paths.push(directoryPath.substring(root.length) || ".");
219728
- };
219729
- }
219730
- function pushDirectoryFilterWithRelativePath(root) {
219731
- return function(directoryPath, paths, filters) {
219732
- const relativePath = directoryPath.substring(root.length) || ".";
219733
- if (filters.every((filter) => filter(relativePath, true))) {
219734
- paths.push(relativePath);
219735
- }
219736
- };
219737
- }
219738
- var pushDirectory = (directoryPath, paths) => {
219739
- paths.push(directoryPath || ".");
219740
- };
219741
- var pushDirectoryFilter = (directoryPath, paths, filters) => {
219742
- const path = directoryPath || ".";
219743
- if (filters.every((filter) => filter(path, true))) {
219744
- paths.push(path);
219745
- }
219746
- };
219747
- var empty = () => {
219748
- };
219749
- function build(root, options) {
219750
- const { includeDirs, filters, relativePaths } = options;
219751
- if (!includeDirs)
219752
- return empty;
219753
- if (relativePaths)
219754
- return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
219755
- return filters && filters.length ? pushDirectoryFilter : pushDirectory;
219756
- }
219757
- exports.build = build;
219758
- }
219759
- });
219760
-
219761
- // node_modules/fdir/dist/api/functions/push-file.js
219762
- var require_push_file = __commonJS({
219763
- "node_modules/fdir/dist/api/functions/push-file.js"(exports) {
219764
- "use strict";
219765
- init_cjs_shims();
219766
- Object.defineProperty(exports, "__esModule", { value: true });
219767
- exports.build = void 0;
219768
- var pushFileFilterAndCount = (filename, _paths, counts, filters) => {
219769
- if (filters.every((filter) => filter(filename, false)))
219770
- counts.files++;
219771
- };
219772
- var pushFileFilter = (filename, paths, _counts, filters) => {
219773
- if (filters.every((filter) => filter(filename, false)))
219774
- paths.push(filename);
219775
- };
219776
- var pushFileCount = (_filename, _paths, counts, _filters) => {
219777
- counts.files++;
219778
- };
219779
- var pushFile = (filename, paths) => {
219780
- paths.push(filename);
219781
- };
219782
- var empty = () => {
219783
- };
219784
- function build(options) {
219785
- const { excludeFiles, filters, onlyCounts } = options;
219786
- if (excludeFiles)
219787
- return empty;
219788
- if (filters && filters.length) {
219789
- return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
219790
- } else if (onlyCounts) {
219791
- return pushFileCount;
219792
- } else {
219793
- return pushFile;
219794
- }
219795
- }
219796
- exports.build = build;
219797
- }
219798
- });
219799
-
219800
- // node_modules/fdir/dist/api/functions/get-array.js
219801
- var require_get_array = __commonJS({
219802
- "node_modules/fdir/dist/api/functions/get-array.js"(exports) {
219803
- "use strict";
219804
- init_cjs_shims();
219805
- Object.defineProperty(exports, "__esModule", { value: true });
219806
- exports.build = void 0;
219807
- var getArray = (paths) => {
219808
- return paths;
219809
- };
219810
- var getArrayGroup = () => {
219811
- return [""].slice(0, 0);
219812
- };
219813
- function build(options) {
219814
- return options.group ? getArrayGroup : getArray;
219815
- }
219816
- exports.build = build;
219817
- }
219818
- });
219819
-
219820
- // node_modules/fdir/dist/api/functions/group-files.js
219821
- var require_group_files = __commonJS({
219822
- "node_modules/fdir/dist/api/functions/group-files.js"(exports) {
219823
- "use strict";
219824
- init_cjs_shims();
219825
- Object.defineProperty(exports, "__esModule", { value: true });
219826
- exports.build = void 0;
219827
- var groupFiles = (groups, directory, files) => {
219828
- groups.push({ directory, files, dir: directory });
219829
- };
219830
- var empty = () => {
219831
- };
219832
- function build(options) {
219833
- return options.group ? groupFiles : empty;
219834
- }
219835
- exports.build = build;
219836
- }
219837
- });
219838
-
219839
- // node_modules/fdir/dist/api/functions/resolve-symlink.js
219840
- var require_resolve_symlink = __commonJS({
219841
- "node_modules/fdir/dist/api/functions/resolve-symlink.js"(exports) {
219842
- "use strict";
219843
- init_cjs_shims();
219844
- var __importDefault = exports && exports.__importDefault || function(mod) {
219845
- return mod && mod.__esModule ? mod : { "default": mod };
219846
- };
219847
- Object.defineProperty(exports, "__esModule", { value: true });
219848
- exports.build = void 0;
219849
- var fs_1 = __importDefault(__require("fs"));
219850
- var path_1 = __require("path");
219851
- var resolveSymlinksAsync = function(path, state, callback) {
219852
- const { queue, options: { suppressErrors } } = state;
219853
- queue.enqueue();
219854
- fs_1.default.realpath(path, (error, resolvedPath) => {
219855
- if (error)
219856
- return queue.dequeue(suppressErrors ? null : error, state);
219857
- fs_1.default.stat(resolvedPath, (error2, stat) => {
219858
- if (error2)
219859
- return queue.dequeue(suppressErrors ? null : error2, state);
219860
- if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
219861
- return queue.dequeue(null, state);
219862
- callback(stat, resolvedPath);
219863
- queue.dequeue(null, state);
219864
- });
219865
- });
219866
- };
219867
- var resolveSymlinks = function(path, state, callback) {
219868
- const { queue, options: { suppressErrors } } = state;
219869
- queue.enqueue();
219870
- try {
219871
- const resolvedPath = fs_1.default.realpathSync(path);
219872
- const stat = fs_1.default.statSync(resolvedPath);
219873
- if (stat.isDirectory() && isRecursive(path, resolvedPath, state))
219874
- return;
219875
- callback(stat, resolvedPath);
219876
- } catch (e) {
219877
- if (!suppressErrors)
219878
- throw e;
219879
- }
219880
- };
219881
- function build(options, isSynchronous) {
219882
- if (!options.resolveSymlinks || options.excludeSymlinks)
219883
- return null;
219884
- return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
219885
- }
219886
- exports.build = build;
219887
- function isRecursive(path, resolved, state) {
219888
- if (state.options.useRealPaths)
219889
- return isRecursiveUsingRealPaths(resolved, state);
219890
- let parent = (0, path_1.dirname)(path);
219891
- let depth = 1;
219892
- while (parent !== state.root && depth < 2) {
219893
- const resolvedPath = state.symlinks.get(parent);
219894
- const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
219895
- if (isSameRoot)
219896
- depth++;
219897
- else
219898
- parent = (0, path_1.dirname)(parent);
219899
- }
219900
- state.symlinks.set(path, resolved);
219901
- return depth > 1;
219902
- }
219903
- function isRecursiveUsingRealPaths(resolved, state) {
219904
- return state.visited.includes(resolved + state.options.pathSeparator);
219905
- }
219906
- }
219907
- });
219908
-
219909
- // node_modules/fdir/dist/api/functions/invoke-callback.js
219910
- var require_invoke_callback = __commonJS({
219911
- "node_modules/fdir/dist/api/functions/invoke-callback.js"(exports) {
219912
- "use strict";
219913
- init_cjs_shims();
219914
- Object.defineProperty(exports, "__esModule", { value: true });
219915
- exports.build = void 0;
219916
- var onlyCountsSync = (state) => {
219917
- return state.counts;
219918
- };
219919
- var groupsSync = (state) => {
219920
- return state.groups;
219921
- };
219922
- var defaultSync = (state) => {
219923
- return state.paths;
219924
- };
219925
- var limitFilesSync = (state) => {
219926
- return state.paths.slice(0, state.options.maxFiles);
219927
- };
219928
- var onlyCountsAsync = (state, error, callback) => {
219929
- report(error, callback, state.counts, state.options.suppressErrors);
219930
- return null;
219931
- };
219932
- var defaultAsync = (state, error, callback) => {
219933
- report(error, callback, state.paths, state.options.suppressErrors);
219934
- return null;
219935
- };
219936
- var limitFilesAsync = (state, error, callback) => {
219937
- report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
219938
- return null;
219939
- };
219940
- var groupsAsync = (state, error, callback) => {
219941
- report(error, callback, state.groups, state.options.suppressErrors);
219942
- return null;
219943
- };
219944
- function report(error, callback, output, suppressErrors) {
219945
- if (error && !suppressErrors)
219946
- callback(error, output);
219947
- else
219948
- callback(null, output);
219949
- }
219950
- function build(options, isSynchronous) {
219951
- const { onlyCounts, group, maxFiles } = options;
219952
- if (onlyCounts)
219953
- return isSynchronous ? onlyCountsSync : onlyCountsAsync;
219954
- else if (group)
219955
- return isSynchronous ? groupsSync : groupsAsync;
219956
- else if (maxFiles)
219957
- return isSynchronous ? limitFilesSync : limitFilesAsync;
219958
- else
219959
- return isSynchronous ? defaultSync : defaultAsync;
219960
- }
219961
- exports.build = build;
219962
- }
219963
- });
219964
-
219965
- // node_modules/fdir/dist/api/functions/walk-directory.js
219966
- var require_walk_directory = __commonJS({
219967
- "node_modules/fdir/dist/api/functions/walk-directory.js"(exports) {
219968
- "use strict";
219969
- init_cjs_shims();
219970
- var __importDefault = exports && exports.__importDefault || function(mod) {
219971
- return mod && mod.__esModule ? mod : { "default": mod };
219972
- };
219973
- Object.defineProperty(exports, "__esModule", { value: true });
219974
- exports.build = void 0;
219975
- var fs_1 = __importDefault(__require("fs"));
219976
- var readdirOpts = { withFileTypes: true };
219977
- var walkAsync = (state, crawlPath, directoryPath, currentDepth, callback) => {
219978
- if (currentDepth < 0)
219979
- return state.queue.dequeue(null, state);
219980
- state.visited.push(crawlPath);
219981
- state.counts.directories++;
219982
- state.queue.enqueue();
219983
- fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
219984
- callback(entries, directoryPath, currentDepth);
219985
- state.queue.dequeue(state.options.suppressErrors ? null : error, state);
219986
- });
219987
- };
219988
- var walkSync = (state, crawlPath, directoryPath, currentDepth, callback) => {
219989
- if (currentDepth < 0)
219990
- return;
219991
- state.visited.push(crawlPath);
219992
- state.counts.directories++;
219993
- let entries = [];
219994
- try {
219995
- entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
219996
- } catch (e) {
219997
- if (!state.options.suppressErrors)
219998
- throw e;
219999
- }
220000
- callback(entries, directoryPath, currentDepth);
220001
- };
220002
- function build(isSynchronous) {
220003
- return isSynchronous ? walkSync : walkAsync;
220004
- }
220005
- exports.build = build;
220006
- }
220007
- });
220008
-
220009
- // node_modules/fdir/dist/api/queue.js
220010
- var require_queue = __commonJS({
220011
- "node_modules/fdir/dist/api/queue.js"(exports) {
220012
- "use strict";
220013
- init_cjs_shims();
220014
- Object.defineProperty(exports, "__esModule", { value: true });
220015
- exports.Queue = void 0;
220016
- var Queue = class {
220017
- onQueueEmpty;
220018
- count = 0;
220019
- constructor(onQueueEmpty) {
220020
- this.onQueueEmpty = onQueueEmpty;
220021
- }
220022
- enqueue() {
220023
- this.count++;
220024
- }
220025
- dequeue(error, output) {
220026
- if (--this.count <= 0 || error)
220027
- this.onQueueEmpty(error, output);
220028
- }
220029
- };
220030
- exports.Queue = Queue;
220031
- }
220032
- });
220033
-
220034
- // node_modules/fdir/dist/api/counter.js
220035
- var require_counter = __commonJS({
220036
- "node_modules/fdir/dist/api/counter.js"(exports) {
220037
- "use strict";
220038
- init_cjs_shims();
220039
- Object.defineProperty(exports, "__esModule", { value: true });
220040
- exports.Counter = void 0;
220041
- var Counter = class {
220042
- _files = 0;
220043
- _directories = 0;
220044
- set files(num) {
220045
- this._files = num;
220046
- }
220047
- get files() {
220048
- return this._files;
220049
- }
220050
- set directories(num) {
220051
- this._directories = num;
220052
- }
220053
- get directories() {
220054
- return this._directories;
220055
- }
220056
- /**
220057
- * @deprecated use `directories` instead
220058
- */
220059
- /* c8 ignore next 3 */
220060
- get dirs() {
220061
- return this._directories;
220062
- }
220063
- };
220064
- exports.Counter = Counter;
220065
- }
220066
- });
220067
-
220068
- // node_modules/fdir/dist/api/walker.js
220069
- var require_walker = __commonJS({
220070
- "node_modules/fdir/dist/api/walker.js"(exports) {
220071
- "use strict";
220072
- init_cjs_shims();
220073
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
220074
- if (k2 === void 0) k2 = k;
220075
- var desc = Object.getOwnPropertyDescriptor(m, k);
220076
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
220077
- desc = { enumerable: true, get: function() {
220078
- return m[k];
220079
- } };
220080
- }
220081
- Object.defineProperty(o, k2, desc);
220082
- }) : (function(o, m, k, k2) {
220083
- if (k2 === void 0) k2 = k;
220084
- o[k2] = m[k];
220085
- }));
220086
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
220087
- Object.defineProperty(o, "default", { enumerable: true, value: v });
220088
- }) : function(o, v) {
220089
- o["default"] = v;
220090
- });
220091
- var __importStar = exports && exports.__importStar || function(mod) {
220092
- if (mod && mod.__esModule) return mod;
220093
- var result = {};
220094
- if (mod != null) {
220095
- for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
220096
- }
220097
- __setModuleDefault(result, mod);
220098
- return result;
220099
- };
220100
- Object.defineProperty(exports, "__esModule", { value: true });
220101
- exports.Walker = void 0;
220102
- var path_1 = __require("path");
220103
- var utils_1 = require_utils2();
220104
- var joinPath = __importStar(require_join_path());
220105
- var pushDirectory = __importStar(require_push_directory());
220106
- var pushFile = __importStar(require_push_file());
220107
- var getArray = __importStar(require_get_array());
220108
- var groupFiles = __importStar(require_group_files());
220109
- var resolveSymlink = __importStar(require_resolve_symlink());
220110
- var invokeCallback = __importStar(require_invoke_callback());
220111
- var walkDirectory = __importStar(require_walk_directory());
220112
- var queue_1 = require_queue();
220113
- var counter_1 = require_counter();
220114
- var Walker = class {
220115
- root;
220116
- isSynchronous;
220117
- state;
220118
- joinPath;
220119
- pushDirectory;
220120
- pushFile;
220121
- getArray;
220122
- groupFiles;
220123
- resolveSymlink;
220124
- walkDirectory;
220125
- callbackInvoker;
220126
- constructor(root, options, callback) {
220127
- this.isSynchronous = !callback;
220128
- this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
220129
- this.root = (0, utils_1.normalizePath)(root, options);
220130
- this.state = {
220131
- root: (0, utils_1.isRootDirectory)(this.root) ? this.root : this.root.slice(0, -1),
220132
- // Perf: we explicitly tell the compiler to optimize for String arrays
220133
- paths: [""].slice(0, 0),
220134
- groups: [],
220135
- counts: new counter_1.Counter(),
220136
- options,
220137
- queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
220138
- symlinks: /* @__PURE__ */ new Map(),
220139
- visited: [""].slice(0, 0)
220140
- };
220141
- this.joinPath = joinPath.build(this.root, options);
220142
- this.pushDirectory = pushDirectory.build(this.root, options);
220143
- this.pushFile = pushFile.build(options);
220144
- this.getArray = getArray.build(options);
220145
- this.groupFiles = groupFiles.build(options);
220146
- this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
220147
- this.walkDirectory = walkDirectory.build(this.isSynchronous);
220148
- }
220149
- start() {
220150
- this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
220151
- return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
220152
- }
220153
- walk = (entries, directoryPath, depth) => {
220154
- const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator } } = this.state;
220155
- if (signal && signal.aborted || maxFiles && paths.length > maxFiles)
220156
- return;
220157
- this.pushDirectory(directoryPath, paths, filters);
220158
- const files = this.getArray(this.state.paths);
220159
- for (let i = 0; i < entries.length; ++i) {
220160
- const entry = entries[i];
220161
- if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
220162
- const filename = this.joinPath(entry.name, directoryPath);
220163
- this.pushFile(filename, files, this.state.counts, filters);
220164
- } else if (entry.isDirectory()) {
220165
- let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
220166
- if (exclude && exclude(entry.name, path))
220167
- continue;
220168
- this.walkDirectory(this.state, path, path, depth - 1, this.walk);
220169
- } else if (entry.isSymbolicLink() && this.resolveSymlink) {
220170
- let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
220171
- this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
220172
- if (stat.isDirectory()) {
220173
- resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
220174
- if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator))
220175
- return;
220176
- this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
220177
- } else {
220178
- resolvedPath = useRealPaths ? resolvedPath : path;
220179
- const filename = (0, path_1.basename)(resolvedPath);
220180
- const directoryPath2 = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
220181
- resolvedPath = this.joinPath(filename, directoryPath2);
220182
- this.pushFile(resolvedPath, files, this.state.counts, filters);
220183
- }
220184
- });
220185
- }
220186
- }
220187
- this.groupFiles(this.state.groups, directoryPath, files);
220188
- };
220189
- };
220190
- exports.Walker = Walker;
220191
- }
220192
- });
220193
-
220194
- // node_modules/fdir/dist/api/async.js
220195
- var require_async2 = __commonJS({
220196
- "node_modules/fdir/dist/api/async.js"(exports) {
220197
- "use strict";
220198
- init_cjs_shims();
220199
- Object.defineProperty(exports, "__esModule", { value: true });
220200
- exports.callback = exports.promise = void 0;
220201
- var walker_1 = require_walker();
220202
- function promise(root, options) {
220203
- return new Promise((resolve, reject) => {
220204
- callback(root, options, (err, output) => {
220205
- if (err)
220206
- return reject(err);
220207
- resolve(output);
220208
- });
220209
- });
220210
- }
220211
- exports.promise = promise;
220212
- function callback(root, options, callback2) {
220213
- let walker = new walker_1.Walker(root, options, callback2);
220214
- walker.start();
220215
- }
220216
- exports.callback = callback;
220217
- }
220218
- });
220219
-
220220
- // node_modules/fdir/dist/api/sync.js
220221
- var require_sync2 = __commonJS({
220222
- "node_modules/fdir/dist/api/sync.js"(exports) {
220223
- "use strict";
220224
- init_cjs_shims();
220225
- Object.defineProperty(exports, "__esModule", { value: true });
220226
- exports.sync = void 0;
220227
- var walker_1 = require_walker();
220228
- function sync(root, options) {
220229
- const walker = new walker_1.Walker(root, options);
220230
- return walker.start();
220231
- }
220232
- exports.sync = sync;
220233
- }
220234
- });
220235
-
220236
- // node_modules/fdir/dist/builder/api-builder.js
220237
- var require_api_builder = __commonJS({
220238
- "node_modules/fdir/dist/builder/api-builder.js"(exports) {
220239
- "use strict";
220240
- init_cjs_shims();
220241
- Object.defineProperty(exports, "__esModule", { value: true });
220242
- exports.APIBuilder = void 0;
220243
- var async_1 = require_async2();
220244
- var sync_1 = require_sync2();
220245
- var APIBuilder = class {
220246
- root;
220247
- options;
220248
- constructor(root, options) {
220249
- this.root = root;
220250
- this.options = options;
220251
- }
220252
- withPromise() {
220253
- return (0, async_1.promise)(this.root, this.options);
220254
- }
220255
- withCallback(cb) {
220256
- (0, async_1.callback)(this.root, this.options, cb);
220257
- }
220258
- sync() {
220259
- return (0, sync_1.sync)(this.root, this.options);
220260
- }
220261
- };
220262
- exports.APIBuilder = APIBuilder;
220263
- }
220264
- });
220265
-
220266
219645
  // node_modules/picomatch/lib/constants.js
220267
219646
  var require_constants = __commonJS({
220268
219647
  "node_modules/picomatch/lib/constants.js"(exports, module) {
@@ -220347,6 +219726,7 @@ var require_constants = __commonJS({
220347
219726
  REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
220348
219727
  // Replace globs with equivalent patterns to reduce parsing time.
220349
219728
  REPLACEMENTS: {
219729
+ __proto__: null,
220350
219730
  "***": "*",
220351
219731
  "**/**": "**",
220352
219732
  "**/**/**": "**"
@@ -220463,7 +219843,7 @@ var require_constants = __commonJS({
220463
219843
  });
220464
219844
 
220465
219845
  // node_modules/picomatch/lib/utils.js
220466
- var require_utils3 = __commonJS({
219846
+ var require_utils2 = __commonJS({
220467
219847
  "node_modules/picomatch/lib/utils.js"(exports) {
220468
219848
  "use strict";
220469
219849
  init_cjs_shims();
@@ -220532,7 +219912,7 @@ var require_scan = __commonJS({
220532
219912
  "node_modules/picomatch/lib/scan.js"(exports, module) {
220533
219913
  "use strict";
220534
219914
  init_cjs_shims();
220535
- var utils = require_utils3();
219915
+ var utils = require_utils2();
220536
219916
  var {
220537
219917
  CHAR_ASTERISK,
220538
219918
  /* * */
@@ -220864,7 +220244,7 @@ var require_parse = __commonJS({
220864
220244
  "use strict";
220865
220245
  init_cjs_shims();
220866
220246
  var constants = require_constants();
220867
- var utils = require_utils3();
220247
+ var utils = require_utils2();
220868
220248
  var {
220869
220249
  MAX_LENGTH,
220870
220250
  POSIX_REGEX_SOURCE,
@@ -221634,7 +221014,7 @@ var require_picomatch = __commonJS({
221634
221014
  init_cjs_shims();
221635
221015
  var scan = require_scan();
221636
221016
  var parse = require_parse();
221637
- var utils = require_utils3();
221017
+ var utils = require_utils2();
221638
221018
  var constants = require_constants();
221639
221019
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
221640
221020
  var picomatch = (glob, options, returnState = false) => {
@@ -221774,7 +221154,7 @@ var require_picomatch2 = __commonJS({
221774
221154
  "use strict";
221775
221155
  init_cjs_shims();
221776
221156
  var pico = require_picomatch();
221777
- var utils = require_utils3();
221157
+ var utils = require_utils2();
221778
221158
  function picomatch(glob, options, returnState = false) {
221779
221159
  if (options && (options.windows === null || options.windows === void 0)) {
221780
221160
  options = { ...options, windows: utils.isWindows() };
@@ -221786,32 +221166,428 @@ var require_picomatch2 = __commonJS({
221786
221166
  }
221787
221167
  });
221788
221168
 
221789
- // node_modules/fdir/dist/builder/index.js
221790
- var require_builder = __commonJS({
221791
- "node_modules/fdir/dist/builder/index.js"(exports) {
221792
- "use strict";
221169
+ // node_modules/fdir/dist/index.cjs
221170
+ var require_dist = __commonJS({
221171
+ "node_modules/fdir/dist/index.cjs"(exports) {
221793
221172
  init_cjs_shims();
221794
- Object.defineProperty(exports, "__esModule", { value: true });
221795
- exports.Builder = void 0;
221796
- var path_1 = __require("path");
221797
- var api_builder_1 = require_api_builder();
221173
+ var __create = Object.create;
221174
+ var __defProp = Object.defineProperty;
221175
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
221176
+ var __getOwnPropNames = Object.getOwnPropertyNames;
221177
+ var __getProtoOf = Object.getPrototypeOf;
221178
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
221179
+ var __copyProps = (to, from, except, desc) => {
221180
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
221181
+ key = keys[i];
221182
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
221183
+ get: ((k) => from[k]).bind(null, key),
221184
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
221185
+ });
221186
+ }
221187
+ return to;
221188
+ };
221189
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
221190
+ value: mod,
221191
+ enumerable: true
221192
+ }) : target, mod));
221193
+ var path = __toESM(__require("path"));
221194
+ var fs = __toESM(__require("fs"));
221195
+ function cleanPath(path$1) {
221196
+ let normalized = (0, path.normalize)(path$1);
221197
+ if (normalized.length > 1 && normalized[normalized.length - 1] === path.sep) normalized = normalized.substring(0, normalized.length - 1);
221198
+ return normalized;
221199
+ }
221200
+ var SLASHES_REGEX = /[\\/]/g;
221201
+ function convertSlashes(path$1, separator) {
221202
+ return path$1.replace(SLASHES_REGEX, separator);
221203
+ }
221204
+ var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
221205
+ function isRootDirectory(path$1) {
221206
+ return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
221207
+ }
221208
+ function normalizePath(path$1, options) {
221209
+ const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
221210
+ const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
221211
+ if (resolvePaths) path$1 = (0, path.resolve)(path$1);
221212
+ if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
221213
+ if (path$1 === ".") return "";
221214
+ const needsSeperator = path$1[path$1.length - 1] !== pathSeparator;
221215
+ return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
221216
+ }
221217
+ function joinPathWithBasePath(filename, directoryPath) {
221218
+ return directoryPath + filename;
221219
+ }
221220
+ function joinPathWithRelativePath(root, options) {
221221
+ return function(filename, directoryPath) {
221222
+ const sameRoot = directoryPath.startsWith(root);
221223
+ if (sameRoot) return directoryPath.slice(root.length) + filename;
221224
+ else return convertSlashes((0, path.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
221225
+ };
221226
+ }
221227
+ function joinPath(filename) {
221228
+ return filename;
221229
+ }
221230
+ function joinDirectoryPath(filename, directoryPath, separator) {
221231
+ return directoryPath + filename + separator;
221232
+ }
221233
+ function build$7(root, options) {
221234
+ const { relativePaths, includeBasePath } = options;
221235
+ return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
221236
+ }
221237
+ function pushDirectoryWithRelativePath(root) {
221238
+ return function(directoryPath, paths) {
221239
+ paths.push(directoryPath.substring(root.length) || ".");
221240
+ };
221241
+ }
221242
+ function pushDirectoryFilterWithRelativePath(root) {
221243
+ return function(directoryPath, paths, filters) {
221244
+ const relativePath = directoryPath.substring(root.length) || ".";
221245
+ if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
221246
+ };
221247
+ }
221248
+ var pushDirectory = (directoryPath, paths) => {
221249
+ paths.push(directoryPath || ".");
221250
+ };
221251
+ var pushDirectoryFilter = (directoryPath, paths, filters) => {
221252
+ const path$1 = directoryPath || ".";
221253
+ if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
221254
+ };
221255
+ var empty$2 = () => {
221256
+ };
221257
+ function build$6(root, options) {
221258
+ const { includeDirs, filters, relativePaths } = options;
221259
+ if (!includeDirs) return empty$2;
221260
+ if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
221261
+ return filters && filters.length ? pushDirectoryFilter : pushDirectory;
221262
+ }
221263
+ var pushFileFilterAndCount = (filename, _paths, counts, filters) => {
221264
+ if (filters.every((filter) => filter(filename, false))) counts.files++;
221265
+ };
221266
+ var pushFileFilter = (filename, paths, _counts, filters) => {
221267
+ if (filters.every((filter) => filter(filename, false))) paths.push(filename);
221268
+ };
221269
+ var pushFileCount = (_filename, _paths, counts, _filters) => {
221270
+ counts.files++;
221271
+ };
221272
+ var pushFile = (filename, paths) => {
221273
+ paths.push(filename);
221274
+ };
221275
+ var empty$1 = () => {
221276
+ };
221277
+ function build$5(options) {
221278
+ const { excludeFiles, filters, onlyCounts } = options;
221279
+ if (excludeFiles) return empty$1;
221280
+ if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
221281
+ else if (onlyCounts) return pushFileCount;
221282
+ else return pushFile;
221283
+ }
221284
+ var getArray = (paths) => {
221285
+ return paths;
221286
+ };
221287
+ var getArrayGroup = () => {
221288
+ return [""].slice(0, 0);
221289
+ };
221290
+ function build$4(options) {
221291
+ return options.group ? getArrayGroup : getArray;
221292
+ }
221293
+ var groupFiles = (groups, directory, files) => {
221294
+ groups.push({
221295
+ directory,
221296
+ files,
221297
+ dir: directory
221298
+ });
221299
+ };
221300
+ var empty = () => {
221301
+ };
221302
+ function build$3(options) {
221303
+ return options.group ? groupFiles : empty;
221304
+ }
221305
+ var resolveSymlinksAsync = function(path$1, state, callback$1) {
221306
+ const { queue, fs: fs$1, options: { suppressErrors } } = state;
221307
+ queue.enqueue();
221308
+ fs$1.realpath(path$1, (error, resolvedPath) => {
221309
+ if (error) return queue.dequeue(suppressErrors ? null : error, state);
221310
+ fs$1.stat(resolvedPath, (error$1, stat) => {
221311
+ if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
221312
+ if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
221313
+ callback$1(stat, resolvedPath);
221314
+ queue.dequeue(null, state);
221315
+ });
221316
+ });
221317
+ };
221318
+ var resolveSymlinks = function(path$1, state, callback$1) {
221319
+ const { queue, fs: fs$1, options: { suppressErrors } } = state;
221320
+ queue.enqueue();
221321
+ try {
221322
+ const resolvedPath = fs$1.realpathSync(path$1);
221323
+ const stat = fs$1.statSync(resolvedPath);
221324
+ if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
221325
+ callback$1(stat, resolvedPath);
221326
+ } catch (e) {
221327
+ if (!suppressErrors) throw e;
221328
+ }
221329
+ };
221330
+ function build$2(options, isSynchronous) {
221331
+ if (!options.resolveSymlinks || options.excludeSymlinks) return null;
221332
+ return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
221333
+ }
221334
+ function isRecursive(path$1, resolved, state) {
221335
+ if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
221336
+ let parent = (0, path.dirname)(path$1);
221337
+ let depth = 1;
221338
+ while (parent !== state.root && depth < 2) {
221339
+ const resolvedPath = state.symlinks.get(parent);
221340
+ const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
221341
+ if (isSameRoot) depth++;
221342
+ else parent = (0, path.dirname)(parent);
221343
+ }
221344
+ state.symlinks.set(path$1, resolved);
221345
+ return depth > 1;
221346
+ }
221347
+ function isRecursiveUsingRealPaths(resolved, state) {
221348
+ return state.visited.includes(resolved + state.options.pathSeparator);
221349
+ }
221350
+ var onlyCountsSync = (state) => {
221351
+ return state.counts;
221352
+ };
221353
+ var groupsSync = (state) => {
221354
+ return state.groups;
221355
+ };
221356
+ var defaultSync = (state) => {
221357
+ return state.paths;
221358
+ };
221359
+ var limitFilesSync = (state) => {
221360
+ return state.paths.slice(0, state.options.maxFiles);
221361
+ };
221362
+ var onlyCountsAsync = (state, error, callback$1) => {
221363
+ report(error, callback$1, state.counts, state.options.suppressErrors);
221364
+ return null;
221365
+ };
221366
+ var defaultAsync = (state, error, callback$1) => {
221367
+ report(error, callback$1, state.paths, state.options.suppressErrors);
221368
+ return null;
221369
+ };
221370
+ var limitFilesAsync = (state, error, callback$1) => {
221371
+ report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
221372
+ return null;
221373
+ };
221374
+ var groupsAsync = (state, error, callback$1) => {
221375
+ report(error, callback$1, state.groups, state.options.suppressErrors);
221376
+ return null;
221377
+ };
221378
+ function report(error, callback$1, output, suppressErrors) {
221379
+ if (error && !suppressErrors) callback$1(error, output);
221380
+ else callback$1(null, output);
221381
+ }
221382
+ function build$1(options, isSynchronous) {
221383
+ const { onlyCounts, group, maxFiles } = options;
221384
+ if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
221385
+ else if (group) return isSynchronous ? groupsSync : groupsAsync;
221386
+ else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
221387
+ else return isSynchronous ? defaultSync : defaultAsync;
221388
+ }
221389
+ var readdirOpts = { withFileTypes: true };
221390
+ var walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
221391
+ state.queue.enqueue();
221392
+ if (currentDepth < 0) return state.queue.dequeue(null, state);
221393
+ const { fs: fs$1 } = state;
221394
+ state.visited.push(crawlPath);
221395
+ state.counts.directories++;
221396
+ fs$1.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
221397
+ callback$1(entries, directoryPath, currentDepth);
221398
+ state.queue.dequeue(state.options.suppressErrors ? null : error, state);
221399
+ });
221400
+ };
221401
+ var walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
221402
+ const { fs: fs$1 } = state;
221403
+ if (currentDepth < 0) return;
221404
+ state.visited.push(crawlPath);
221405
+ state.counts.directories++;
221406
+ let entries = [];
221407
+ try {
221408
+ entries = fs$1.readdirSync(crawlPath || ".", readdirOpts);
221409
+ } catch (e) {
221410
+ if (!state.options.suppressErrors) throw e;
221411
+ }
221412
+ callback$1(entries, directoryPath, currentDepth);
221413
+ };
221414
+ function build(isSynchronous) {
221415
+ return isSynchronous ? walkSync : walkAsync;
221416
+ }
221417
+ var Queue = class {
221418
+ count = 0;
221419
+ constructor(onQueueEmpty) {
221420
+ this.onQueueEmpty = onQueueEmpty;
221421
+ }
221422
+ enqueue() {
221423
+ this.count++;
221424
+ return this.count;
221425
+ }
221426
+ dequeue(error, output) {
221427
+ if (this.onQueueEmpty && (--this.count <= 0 || error)) {
221428
+ this.onQueueEmpty(error, output);
221429
+ if (error) {
221430
+ output.controller.abort();
221431
+ this.onQueueEmpty = void 0;
221432
+ }
221433
+ }
221434
+ }
221435
+ };
221436
+ var Counter = class {
221437
+ _files = 0;
221438
+ _directories = 0;
221439
+ set files(num) {
221440
+ this._files = num;
221441
+ }
221442
+ get files() {
221443
+ return this._files;
221444
+ }
221445
+ set directories(num) {
221446
+ this._directories = num;
221447
+ }
221448
+ get directories() {
221449
+ return this._directories;
221450
+ }
221451
+ /**
221452
+ * @deprecated use `directories` instead
221453
+ */
221454
+ /* c8 ignore next 3 */
221455
+ get dirs() {
221456
+ return this._directories;
221457
+ }
221458
+ };
221459
+ var Aborter = class {
221460
+ aborted = false;
221461
+ abort() {
221462
+ this.aborted = true;
221463
+ }
221464
+ };
221465
+ var Walker = class {
221466
+ root;
221467
+ isSynchronous;
221468
+ state;
221469
+ joinPath;
221470
+ pushDirectory;
221471
+ pushFile;
221472
+ getArray;
221473
+ groupFiles;
221474
+ resolveSymlink;
221475
+ walkDirectory;
221476
+ callbackInvoker;
221477
+ constructor(root, options, callback$1) {
221478
+ this.isSynchronous = !callback$1;
221479
+ this.callbackInvoker = build$1(options, this.isSynchronous);
221480
+ this.root = normalizePath(root, options);
221481
+ this.state = {
221482
+ root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
221483
+ paths: [""].slice(0, 0),
221484
+ groups: [],
221485
+ counts: new Counter(),
221486
+ options,
221487
+ queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
221488
+ symlinks: /* @__PURE__ */ new Map(),
221489
+ visited: [""].slice(0, 0),
221490
+ controller: new Aborter(),
221491
+ fs: options.fs || fs
221492
+ };
221493
+ this.joinPath = build$7(this.root, options);
221494
+ this.pushDirectory = build$6(this.root, options);
221495
+ this.pushFile = build$5(options);
221496
+ this.getArray = build$4(options);
221497
+ this.groupFiles = build$3(options);
221498
+ this.resolveSymlink = build$2(options, this.isSynchronous);
221499
+ this.walkDirectory = build(this.isSynchronous);
221500
+ }
221501
+ start() {
221502
+ this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
221503
+ this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
221504
+ return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
221505
+ }
221506
+ walk = (entries, directoryPath, depth) => {
221507
+ const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
221508
+ if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
221509
+ const files = this.getArray(this.state.paths);
221510
+ for (let i = 0; i < entries.length; ++i) {
221511
+ const entry = entries[i];
221512
+ if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
221513
+ const filename = this.joinPath(entry.name, directoryPath);
221514
+ this.pushFile(filename, files, this.state.counts, filters);
221515
+ } else if (entry.isDirectory()) {
221516
+ let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
221517
+ if (exclude && exclude(entry.name, path$1)) continue;
221518
+ this.pushDirectory(path$1, paths, filters);
221519
+ this.walkDirectory(this.state, path$1, path$1, depth - 1, this.walk);
221520
+ } else if (this.resolveSymlink && entry.isSymbolicLink()) {
221521
+ let path$1 = joinPathWithBasePath(entry.name, directoryPath);
221522
+ this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
221523
+ if (stat.isDirectory()) {
221524
+ resolvedPath = normalizePath(resolvedPath, this.state.options);
221525
+ if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
221526
+ this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth - 1, this.walk);
221527
+ } else {
221528
+ resolvedPath = useRealPaths ? resolvedPath : path$1;
221529
+ const filename = (0, path.basename)(resolvedPath);
221530
+ const directoryPath$1 = normalizePath((0, path.dirname)(resolvedPath), this.state.options);
221531
+ resolvedPath = this.joinPath(filename, directoryPath$1);
221532
+ this.pushFile(resolvedPath, files, this.state.counts, filters);
221533
+ }
221534
+ });
221535
+ }
221536
+ }
221537
+ this.groupFiles(this.state.groups, directoryPath, files);
221538
+ };
221539
+ };
221540
+ function promise(root, options) {
221541
+ return new Promise((resolve$1, reject) => {
221542
+ callback(root, options, (err, output) => {
221543
+ if (err) return reject(err);
221544
+ resolve$1(output);
221545
+ });
221546
+ });
221547
+ }
221548
+ function callback(root, options, callback$1) {
221549
+ let walker = new Walker(root, options, callback$1);
221550
+ walker.start();
221551
+ }
221552
+ function sync(root, options) {
221553
+ const walker = new Walker(root, options);
221554
+ return walker.start();
221555
+ }
221556
+ var APIBuilder = class {
221557
+ constructor(root, options) {
221558
+ this.root = root;
221559
+ this.options = options;
221560
+ }
221561
+ withPromise() {
221562
+ return promise(this.root, this.options);
221563
+ }
221564
+ withCallback(cb) {
221565
+ callback(this.root, this.options, cb);
221566
+ }
221567
+ sync() {
221568
+ return sync(this.root, this.options);
221569
+ }
221570
+ };
221798
221571
  var pm = null;
221799
221572
  try {
221800
221573
  __require.resolve("picomatch");
221801
221574
  pm = require_picomatch2();
221802
- } catch (_e) {
221575
+ } catch {
221803
221576
  }
221804
221577
  var Builder = class {
221805
221578
  globCache = {};
221806
221579
  options = {
221807
221580
  maxDepth: Infinity,
221808
221581
  suppressErrors: true,
221809
- pathSeparator: path_1.sep,
221582
+ pathSeparator: path.sep,
221810
221583
  filters: []
221811
221584
  };
221812
221585
  globFunction;
221813
221586
  constructor(options) {
221814
- this.options = { ...this.options, ...options };
221587
+ this.options = {
221588
+ ...this.options,
221589
+ ...options
221590
+ };
221815
221591
  this.globFunction = this.options.globFunction;
221816
221592
  }
221817
221593
  group() {
@@ -221882,91 +221658,50 @@ var require_builder = __commonJS({
221882
221658
  return this;
221883
221659
  }
221884
221660
  crawl(root) {
221885
- return new api_builder_1.APIBuilder(root || ".", this.options);
221661
+ return new APIBuilder(root || ".", this.options);
221886
221662
  }
221887
221663
  withGlobFunction(fn) {
221888
221664
  this.globFunction = fn;
221889
221665
  return this;
221890
221666
  }
221891
221667
  /**
221892
- * @deprecated Pass options using the constructor instead:
221893
- * ```ts
221894
- * new fdir(options).crawl("/path/to/root");
221895
- * ```
221896
- * This method will be removed in v7.0
221897
- */
221668
+ * @deprecated Pass options using the constructor instead:
221669
+ * ```ts
221670
+ * new fdir(options).crawl("/path/to/root");
221671
+ * ```
221672
+ * This method will be removed in v7.0
221673
+ */
221898
221674
  /* c8 ignore next 4 */
221899
221675
  crawlWithOptions(root, options) {
221900
- this.options = { ...this.options, ...options };
221901
- return new api_builder_1.APIBuilder(root || ".", this.options);
221676
+ this.options = {
221677
+ ...this.options,
221678
+ ...options
221679
+ };
221680
+ return new APIBuilder(root || ".", this.options);
221902
221681
  }
221903
221682
  glob(...patterns) {
221904
- if (this.globFunction) {
221905
- return this.globWithOptions(patterns);
221906
- }
221683
+ if (this.globFunction) return this.globWithOptions(patterns);
221907
221684
  return this.globWithOptions(patterns, ...[{ dot: true }]);
221908
221685
  }
221909
221686
  globWithOptions(patterns, ...options) {
221910
221687
  const globFn = this.globFunction || pm;
221911
- if (!globFn) {
221912
- throw new Error("Please specify a glob function to use glob matching.");
221913
- }
221688
+ if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
221914
221689
  var isMatch = this.globCache[patterns.join("\0")];
221915
221690
  if (!isMatch) {
221916
221691
  isMatch = globFn(patterns, ...options);
221917
221692
  this.globCache[patterns.join("\0")] = isMatch;
221918
221693
  }
221919
- this.options.filters.push((path) => isMatch(path));
221694
+ this.options.filters.push((path$1) => isMatch(path$1));
221920
221695
  return this;
221921
221696
  }
221922
221697
  };
221923
- exports.Builder = Builder;
221924
- }
221925
- });
221926
-
221927
- // node_modules/fdir/dist/types.js
221928
- var require_types = __commonJS({
221929
- "node_modules/fdir/dist/types.js"(exports) {
221930
- "use strict";
221931
- init_cjs_shims();
221932
- Object.defineProperty(exports, "__esModule", { value: true });
221698
+ exports.fdir = Builder;
221933
221699
  }
221934
221700
  });
221935
221701
 
221936
- // node_modules/fdir/dist/index.js
221937
- var require_dist = __commonJS({
221938
- "node_modules/fdir/dist/index.js"(exports) {
221939
- "use strict";
221940
- init_cjs_shims();
221941
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
221942
- if (k2 === void 0) k2 = k;
221943
- var desc = Object.getOwnPropertyDescriptor(m, k);
221944
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
221945
- desc = { enumerable: true, get: function() {
221946
- return m[k];
221947
- } };
221948
- }
221949
- Object.defineProperty(o, k2, desc);
221950
- }) : (function(o, m, k, k2) {
221951
- if (k2 === void 0) k2 = k;
221952
- o[k2] = m[k];
221953
- }));
221954
- var __exportStar = exports && exports.__exportStar || function(m, exports2) {
221955
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
221956
- };
221957
- Object.defineProperty(exports, "__esModule", { value: true });
221958
- exports.fdir = void 0;
221959
- var builder_1 = require_builder();
221960
- Object.defineProperty(exports, "fdir", { enumerable: true, get: function() {
221961
- return builder_1.Builder;
221962
- } });
221963
- __exportStar(require_types(), exports);
221964
- }
221965
- });
221966
-
221967
- // node_modules/tinyglobby/dist/index.js
221702
+ // node_modules/tinyglobby/dist/index.cjs
221968
221703
  var require_dist2 = __commonJS({
221969
- "node_modules/tinyglobby/dist/index.js"(exports) {
221704
+ "node_modules/tinyglobby/dist/index.cjs"(exports) {
221970
221705
  init_cjs_shims();
221971
221706
  var __create = Object.create;
221972
221707
  var __defProp = Object.defineProperty;
@@ -221988,37 +221723,47 @@ var require_dist2 = __commonJS({
221988
221723
  value: mod,
221989
221724
  enumerable: true
221990
221725
  }) : target, mod));
221991
- var path = __toESM(__require("path"));
221992
- var fdir = __toESM(require_dist());
221993
- var picomatch = __toESM(require_picomatch2());
221726
+ var fs = __require("fs");
221727
+ fs = __toESM(fs);
221728
+ var path = __require("path");
221729
+ path = __toESM(path);
221730
+ var url = __require("url");
221731
+ url = __toESM(url);
221732
+ var fdir = require_dist();
221733
+ fdir = __toESM(fdir);
221734
+ var picomatch = require_picomatch2();
221735
+ picomatch = __toESM(picomatch);
221736
+ var isReadonlyArray = Array.isArray;
221737
+ var isWin = process.platform === "win32";
221994
221738
  var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
221995
- function getPartialMatcher(patterns, options) {
221739
+ function getPartialMatcher(patterns, options = {}) {
221996
221740
  const patternsCount = patterns.length;
221997
221741
  const patternsParts = Array(patternsCount);
221998
- const regexes = Array(patternsCount);
221742
+ const matchers = Array(patternsCount);
221743
+ const globstarEnabled = !options.noglobstar;
221999
221744
  for (let i = 0; i < patternsCount; i++) {
222000
221745
  const parts = splitPattern(patterns[i]);
222001
221746
  patternsParts[i] = parts;
222002
221747
  const partsCount = parts.length;
222003
- const partRegexes = Array(partsCount);
222004
- for (let j = 0; j < partsCount; j++) partRegexes[j] = picomatch.default.makeRe(parts[j], options);
222005
- regexes[i] = partRegexes;
221748
+ const partMatchers = Array(partsCount);
221749
+ for (let j = 0; j < partsCount; j++) partMatchers[j] = (0, picomatch.default)(parts[j], options);
221750
+ matchers[i] = partMatchers;
222006
221751
  }
222007
221752
  return (input) => {
222008
221753
  const inputParts = input.split("/");
222009
221754
  if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
222010
221755
  for (let i = 0; i < patterns.length; i++) {
222011
221756
  const patternParts = patternsParts[i];
222012
- const regex = regexes[i];
221757
+ const matcher = matchers[i];
222013
221758
  const inputPatternCount = inputParts.length;
222014
221759
  const minParts = Math.min(inputPatternCount, patternParts.length);
222015
221760
  let j = 0;
222016
221761
  while (j < minParts) {
222017
221762
  const part = patternParts[j];
222018
221763
  if (part.includes("/")) return true;
222019
- const match = regex[j].test(inputParts[j]);
221764
+ const match = matcher[j](inputParts[j]);
222020
221765
  if (!match) break;
222021
- if (part === "**") return true;
221766
+ if (globstarEnabled && part === "**") return true;
222022
221767
  j++;
222023
221768
  }
222024
221769
  if (j === inputPatternCount) return true;
@@ -222026,13 +221771,42 @@ var require_dist2 = __commonJS({
222026
221771
  return false;
222027
221772
  };
222028
221773
  }
221774
+ var WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
221775
+ var isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
221776
+ function buildFormat(cwd, root, absolute) {
221777
+ if (cwd === root || root.startsWith(`${cwd}/`)) {
221778
+ if (absolute) {
221779
+ const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
221780
+ return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
221781
+ }
221782
+ const prefix = root.slice(cwd.length + 1);
221783
+ if (prefix) return (p, isDir) => {
221784
+ if (p === ".") return prefix;
221785
+ const result = `${prefix}/${p}`;
221786
+ return isDir ? result.slice(0, -1) : result;
221787
+ };
221788
+ return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
221789
+ }
221790
+ if (absolute) return (p) => path.posix.relative(cwd, p) || ".";
221791
+ return (p) => path.posix.relative(cwd, `${root}/${p}`) || ".";
221792
+ }
221793
+ function buildRelative(cwd, root) {
221794
+ if (root.startsWith(`${cwd}/`)) {
221795
+ const prefix = root.slice(cwd.length + 1);
221796
+ return (p) => `${prefix}/${p}`;
221797
+ }
221798
+ return (p) => {
221799
+ const result = path.posix.relative(cwd, `${root}/${p}`);
221800
+ if (p.endsWith("/") && result !== "") return `${result}/`;
221801
+ return result || ".";
221802
+ };
221803
+ }
222029
221804
  var splitPatternOptions = { parts: true };
222030
221805
  function splitPattern(path$2) {
222031
221806
  var _result$parts;
222032
221807
  const result = picomatch.default.scan(path$2, splitPatternOptions);
222033
221808
  return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$2];
222034
221809
  }
222035
- var isWin = process.platform === "win32";
222036
221810
  var ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
222037
221811
  function convertPosixPathToPattern(path$2) {
222038
221812
  return escapePosixPath(path$2);
@@ -222096,13 +221870,12 @@ var require_dist2 = __commonJS({
222096
221870
  }
222097
221871
  props.depthOffset = newCommonPath.length;
222098
221872
  props.commonPath = newCommonPath;
222099
- props.root = newCommonPath.length > 0 ? path.default.posix.join(cwd, ...newCommonPath) : cwd;
221873
+ props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
222100
221874
  }
222101
221875
  return result;
222102
221876
  }
222103
- function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
221877
+ function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories = true }, cwd, props) {
222104
221878
  if (typeof patterns === "string") patterns = [patterns];
222105
- else if (!patterns) patterns = ["**/*"];
222106
221879
  if (typeof ignore === "string") ignore = [ignore];
222107
221880
  const matchPatterns = [];
222108
221881
  const ignorePatterns = [];
@@ -222120,66 +221893,88 @@ var require_dist2 = __commonJS({
222120
221893
  ignore: ignorePatterns
222121
221894
  };
222122
221895
  }
222123
- function getRelativePath(path$2, cwd, root) {
222124
- return path.posix.relative(cwd, `${root}/${path$2}`) || ".";
222125
- }
222126
- function processPath(path$2, cwd, root, isDirectory, absolute) {
222127
- const relativePath = absolute ? path$2.slice(root === "/" ? 1 : root.length + 1) || "." : path$2;
222128
- if (root === cwd) return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
222129
- return getRelativePath(relativePath, cwd, root);
222130
- }
222131
- function formatPaths(paths, cwd, root) {
221896
+ function formatPaths(paths, relative) {
222132
221897
  for (let i = paths.length - 1; i >= 0; i--) {
222133
221898
  const path$2 = paths[i];
222134
- paths[i] = getRelativePath(path$2, cwd, root) + (!path$2 || path$2.endsWith("/") ? "/" : "");
221899
+ paths[i] = relative(path$2);
222135
221900
  }
222136
221901
  return paths;
222137
221902
  }
222138
- function crawl(options, cwd, sync) {
222139
- if (process.env.TINYGLOBBY_DEBUG) options.debug = true;
222140
- if (options.debug) log("globbing with options:", options, "cwd:", cwd);
222141
- if (Array.isArray(options.patterns) && options.patterns.length === 0) return sync ? [] : Promise.resolve([]);
221903
+ function normalizeCwd(cwd) {
221904
+ if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
221905
+ if (cwd instanceof URL) return (0, url.fileURLToPath)(cwd).replace(BACKSLASHES, "/");
221906
+ return path.default.resolve(cwd).replace(BACKSLASHES, "/");
221907
+ }
221908
+ function getCrawler(patterns, inputOptions = {}) {
221909
+ const options = process.env.TINYGLOBBY_DEBUG ? {
221910
+ ...inputOptions,
221911
+ debug: true
221912
+ } : inputOptions;
221913
+ const cwd = normalizeCwd(options.cwd);
221914
+ if (options.debug) log("globbing with:", {
221915
+ patterns,
221916
+ options,
221917
+ cwd
221918
+ });
221919
+ if (Array.isArray(patterns) && patterns.length === 0) return [{
221920
+ sync: () => [],
221921
+ withPromise: async () => []
221922
+ }, false];
222142
221923
  const props = {
222143
221924
  root: cwd,
222144
221925
  commonPath: null,
222145
221926
  depthOffset: 0
222146
221927
  };
222147
- const processed = processPatterns(options, cwd, props);
222148
- const nocase = options.caseSensitiveMatch === false;
221928
+ const processed = processPatterns({
221929
+ ...options,
221930
+ patterns
221931
+ }, cwd, props);
222149
221932
  if (options.debug) log("internal processing patterns:", processed);
222150
- const matcher = (0, picomatch.default)(processed.match, {
221933
+ const matchOptions = {
222151
221934
  dot: options.dot,
222152
- nocase,
221935
+ nobrace: options.braceExpansion === false,
221936
+ nocase: options.caseSensitiveMatch === false,
221937
+ noextglob: options.extglob === false,
221938
+ noglobstar: options.globstar === false,
221939
+ posix: true
221940
+ };
221941
+ const matcher = (0, picomatch.default)(processed.match, {
221942
+ ...matchOptions,
222153
221943
  ignore: processed.ignore
222154
221944
  });
222155
- const ignore = (0, picomatch.default)(processed.ignore, {
222156
- dot: options.dot,
222157
- nocase
222158
- });
222159
- const partialMatcher = getPartialMatcher(processed.match, {
222160
- dot: options.dot,
222161
- nocase
222162
- });
221945
+ const ignore = (0, picomatch.default)(processed.ignore, matchOptions);
221946
+ const partialMatcher = getPartialMatcher(processed.match, matchOptions);
221947
+ const format = buildFormat(cwd, props.root, options.absolute);
221948
+ const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
222163
221949
  const fdirOptions = {
222164
221950
  filters: [options.debug ? (p, isDirectory) => {
222165
- const path$2 = processPath(p, cwd, props.root, isDirectory, options.absolute);
221951
+ const path$2 = format(p, isDirectory);
222166
221952
  const matches = matcher(path$2);
222167
221953
  if (matches) log(`matched ${path$2}`);
222168
221954
  return matches;
222169
- } : (p, isDirectory) => matcher(processPath(p, cwd, props.root, isDirectory, options.absolute))],
221955
+ } : (p, isDirectory) => matcher(format(p, isDirectory))],
222170
221956
  exclude: options.debug ? (_, p) => {
222171
- const relativePath = processPath(p, cwd, props.root, true, true);
221957
+ const relativePath = formatExclude(p, true);
222172
221958
  const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
222173
221959
  if (skipped) log(`skipped ${p}`);
222174
221960
  else log(`crawling ${p}`);
222175
221961
  return skipped;
222176
221962
  } : (_, p) => {
222177
- const relativePath = processPath(p, cwd, props.root, true, true);
221963
+ const relativePath = formatExclude(p, true);
222178
221964
  return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
222179
221965
  },
221966
+ fs: options.fs ? {
221967
+ readdir: options.fs.readdir || fs.default.readdir,
221968
+ readdirSync: options.fs.readdirSync || fs.default.readdirSync,
221969
+ realpath: options.fs.realpath || fs.default.realpath,
221970
+ realpathSync: options.fs.realpathSync || fs.default.realpathSync,
221971
+ stat: options.fs.stat || fs.default.stat,
221972
+ statSync: options.fs.statSync || fs.default.statSync
221973
+ } : void 0,
222180
221974
  pathSeparator: "/",
222181
221975
  relativePaths: true,
222182
- resolveSymlinks: true
221976
+ resolveSymlinks: true,
221977
+ signal: options.signal
222183
221978
  };
222184
221979
  if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
222185
221980
  if (options.absolute) {
@@ -222198,27 +221993,26 @@ var require_dist2 = __commonJS({
222198
221993
  props.root = props.root.replace(BACKSLASHES, "");
222199
221994
  const root = props.root;
222200
221995
  if (options.debug) log("internal properties:", props);
222201
- const api = new fdir.fdir(fdirOptions).crawl(root);
222202
- if (cwd === root || options.absolute) return sync ? api.sync() : api.withPromise();
222203
- return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
221996
+ const relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
221997
+ return [new fdir.fdir(fdirOptions).crawl(root), relative];
222204
221998
  }
222205
221999
  async function glob(patternsOrOptions, options) {
222206
222000
  if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
222207
- const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? {
222208
- ...options,
222209
- patterns: patternsOrOptions
222210
- } : patternsOrOptions;
222211
- const cwd = opts.cwd ? path.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
222212
- return crawl(opts, cwd, false);
222001
+ const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
222002
+ const opts = isModern ? options : patternsOrOptions;
222003
+ const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
222004
+ const [crawler, relative] = getCrawler(patterns, opts);
222005
+ if (!relative) return crawler.withPromise();
222006
+ return formatPaths(await crawler.withPromise(), relative);
222213
222007
  }
222214
222008
  function globSync(patternsOrOptions, options) {
222215
222009
  if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
222216
- const opts = Array.isArray(patternsOrOptions) || typeof patternsOrOptions === "string" ? {
222217
- ...options,
222218
- patterns: patternsOrOptions
222219
- } : patternsOrOptions;
222220
- const cwd = opts.cwd ? path.default.resolve(opts.cwd).replace(BACKSLASHES, "/") : process.cwd().replace(BACKSLASHES, "/");
222221
- return crawl(opts, cwd, true);
222010
+ const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
222011
+ const opts = isModern ? options : patternsOrOptions;
222012
+ const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
222013
+ const [crawler, relative] = getCrawler(patterns, opts);
222014
+ if (!relative) return crawler.sync();
222015
+ return formatPaths(crawler.sync(), relative);
222222
222016
  }
222223
222017
  exports.convertPathToPattern = convertPathToPattern;
222224
222018
  exports.escapePath = escapePath;
@@ -223620,7 +223414,6 @@ var require_config = __commonJS({
223620
223414
  Object.defineProperty(exports, "__esModule", { value: true });
223621
223415
  exports.Config = void 0;
223622
223416
  var ejs = __importStar(require_ejs());
223623
- var is_wsl_1 = __importDefault(require_is_wsl());
223624
223417
  var node_os_1 = __require("node:os");
223625
223418
  var node_path_1 = __require("node:path");
223626
223419
  var node_url_1 = __require("node:url");
@@ -223881,7 +223674,7 @@ var require_config = __commonJS({
223881
223674
  this.channel = this.options.channel || channelFromVersion(this.version);
223882
223675
  this.valid = this.rootPlugin.valid;
223883
223676
  this.arch = (0, node_os_1.arch)() === "ia32" ? "x86" : (0, node_os_1.arch)();
223884
- this.platform = is_wsl_1.default ? "wsl" : (0, os_1.getPlatform)();
223677
+ this.platform = (0, os_1.getPlatform)();
223885
223678
  this.windows = this.platform === "win32";
223886
223679
  this.bin = this.pjson.oclif.bin || this.name;
223887
223680
  this.binAliases = this.pjson.oclif.binAliases;