storybook 10.0.0-beta.5 → 10.0.0-beta.6
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/assets/server/openBrowser.applescript +94 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_node-chunks/{builder-manager-ZTS4EIKQ.js → builder-manager-V33CQT2M.js} +21 -151
- package/dist/_node-chunks/camelcase-BZ55OCHI.js +18 -0
- package/dist/_node-chunks/{chunk-WCSHG2QT.js → chunk-2DMFI367.js} +7 -7
- package/dist/_node-chunks/{chunk-VQN4WAIA.js → chunk-4TOI4VSK.js} +7 -7
- package/dist/_node-chunks/{chunk-TBWOUVTA.js → chunk-55VWKF63.js} +709 -935
- package/dist/_node-chunks/{chunk-P3TWEOO5.js → chunk-5IEY46LQ.js} +7 -7
- package/dist/_node-chunks/{chunk-EIHJ5J3O.js → chunk-6PTV7XGR.js} +8 -8
- package/dist/_node-chunks/{chunk-D7SDB4XE.js → chunk-7NJGTQ3W.js} +8 -8
- package/dist/_node-chunks/{chunk-4VDRH7SM.js → chunk-7WH7AGOR.js} +7 -7
- package/dist/_node-chunks/{chunk-AK5PHLUA.js → chunk-A7CUP23N.js} +7 -7
- package/dist/_node-chunks/{chunk-K4YETNYJ.js → chunk-B3AMFGAL.js} +7 -7
- package/dist/_node-chunks/{chunk-PIKDGR3O.js → chunk-BNOZ3EKF.js} +7 -7
- package/dist/_node-chunks/{chunk-F7YW5W6B.js → chunk-DC7OWBHB.js} +12 -12
- package/dist/_node-chunks/{chunk-VX5P3IYA.js → chunk-E6TLN2J2.js} +7 -7
- package/dist/_node-chunks/{chunk-TVKUJ3SE.js → chunk-EAOPWIKA.js} +8 -8
- package/dist/_node-chunks/{chunk-TKN5TEZV.js → chunk-EY5PTUZL.js} +13 -13
- package/dist/_node-chunks/{chunk-DZJNLBBL.js → chunk-F3PO67U3.js} +7 -7
- package/dist/_node-chunks/chunk-FDDJHDCE.js +62 -0
- package/dist/_node-chunks/{chunk-KZB7ELL6.js → chunk-HEBHWRWL.js} +7 -7
- package/dist/_node-chunks/{chunk-VWSUFVUF.js → chunk-HPFXREVG.js} +7 -7
- package/dist/_node-chunks/{chunk-OC3TVLYU.js → chunk-IINJT47N.js} +7 -7
- package/dist/_node-chunks/{chunk-J3DQMIO4.js → chunk-JNHUDBJL.js} +7 -7
- package/dist/_node-chunks/{chunk-SW3VZAH7.js → chunk-JOXYGIZK.js} +9 -9
- package/dist/_node-chunks/{chunk-P7YMEOXF.js → chunk-MLBTKECD.js} +7 -7
- package/dist/_node-chunks/{chunk-UTCFHTQH.js → chunk-NJXBURX7.js} +7 -7
- package/dist/_node-chunks/{chunk-H52PBBSK.js → chunk-NKZ4UPPV.js} +7 -7
- package/dist/_node-chunks/{chunk-F3WE3456.js → chunk-NUVGSFQI.js} +7 -7
- package/dist/_node-chunks/chunk-R5DIBOM6.js +18 -0
- package/dist/_node-chunks/{chunk-ACUNHBEO.js → chunk-RIPA4LFD.js} +22 -22
- package/dist/_node-chunks/{chunk-KU3JBNPY.js → chunk-TJIMCNYJ.js} +8 -8
- package/dist/_node-chunks/{chunk-4KRR46V2.js → chunk-UYKQJMQY.js} +15 -15
- package/dist/_node-chunks/{chunk-3VVGIILJ.js → chunk-VQH4ZFTS.js} +8 -8
- package/dist/_node-chunks/{chunk-QHIU5I7C.js → chunk-VSC6LSCQ.js} +6 -6
- package/dist/_node-chunks/{chunk-2VMDKLSW.js → chunk-XZTBG2TG.js} +6 -6
- package/dist/_node-chunks/{dist-OGRBL76N.js → dist-CGGAYWME.js} +9 -9
- package/dist/_node-chunks/{globby-65LOULA6.js → globby-3IFB7BJC.js} +17 -13
- package/dist/_node-chunks/{lib-TF7JCT3A.js → lib-IT6OBSID.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-6ZJEUZMZ.js → mdx-N42X6CFJ-WM36SSZ6.js} +8 -8
- package/dist/_node-chunks/{p-limit-PF7JSPDT.js → p-limit-3V5XIKA7.js} +7 -7
- package/dist/_node-chunks/{plugin-LGHGAC6J.js → plugin-3YREMMJJ.js} +10 -10
- package/dist/_node-chunks/{plugin-A6XAWMXN.js → plugin-GJUBUKCT.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js → webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-ZJJVMJUS.js → webpack-mock-plugin-XJNFAHBI.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.js +27 -22
- package/dist/common/index.js +21 -21
- package/dist/components/index.js +3 -3
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +1104 -999
- package/dist/core-server/presets/common-manager.js +67 -27
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -29
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +1250 -972
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +1724 -464
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +284 -48
- package/dist/node-logger/index.js +14 -14
- package/dist/preview/runtime.js +7 -1
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +24 -24
- package/dist/types/index.d.ts +4 -0
- package/package.json +5 -4
- package/dist/_node-chunks/camelcase-K3BM7RII.js +0 -18
- package/dist/_node-chunks/chunk-7LG5CLCT.js +0 -18
- package/dist/_node-chunks/chunk-DWJ7TV2O.js +0 -62
- package/dist/_node-chunks/default-browser-id-4RZZMHJE.js +0 -1719
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0v1evul49qdo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0v1evul49qdo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0v1evul49qdo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0v1evul49qdo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0v1evul49qdo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0v1evul49qdo.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,668 +13,13 @@ import {
|
|
|
13
13
|
any,
|
|
14
14
|
up,
|
|
15
15
|
up2
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-F3PO67U3.js";
|
|
17
17
|
import {
|
|
18
18
|
__commonJS,
|
|
19
19
|
__name,
|
|
20
20
|
__require,
|
|
21
21
|
__toESM
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
|
|
24
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/utils.js
|
|
25
|
-
var require_utils = __commonJS({
|
|
26
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/utils.js"(exports) {
|
|
27
|
-
"use strict";
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
|
|
30
|
-
var path_1 = __require("path");
|
|
31
|
-
function cleanPath(path4) {
|
|
32
|
-
let normalized = (0, path_1.normalize)(path4);
|
|
33
|
-
if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep)
|
|
34
|
-
normalized = normalized.substring(0, normalized.length - 1);
|
|
35
|
-
return normalized;
|
|
36
|
-
}
|
|
37
|
-
__name(cleanPath, "cleanPath");
|
|
38
|
-
exports.cleanPath = cleanPath;
|
|
39
|
-
var SLASHES_REGEX = /[\\/]/g;
|
|
40
|
-
function convertSlashes(path4, separator) {
|
|
41
|
-
return path4.replace(SLASHES_REGEX, separator);
|
|
42
|
-
}
|
|
43
|
-
__name(convertSlashes, "convertSlashes");
|
|
44
|
-
exports.convertSlashes = convertSlashes;
|
|
45
|
-
var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
46
|
-
function isRootDirectory(path4) {
|
|
47
|
-
return path4 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path4);
|
|
48
|
-
}
|
|
49
|
-
__name(isRootDirectory, "isRootDirectory");
|
|
50
|
-
exports.isRootDirectory = isRootDirectory;
|
|
51
|
-
function normalizePath(path4, options) {
|
|
52
|
-
const { resolvePaths, normalizePath: normalizePath2, pathSeparator } = options;
|
|
53
|
-
const pathNeedsCleaning = process.platform === "win32" && path4.includes("/") || path4.startsWith(".");
|
|
54
|
-
if (resolvePaths)
|
|
55
|
-
path4 = (0, path_1.resolve)(path4);
|
|
56
|
-
if (normalizePath2 || pathNeedsCleaning)
|
|
57
|
-
path4 = cleanPath(path4);
|
|
58
|
-
if (path4 === ".")
|
|
59
|
-
return "";
|
|
60
|
-
const needsSeperator = path4[path4.length - 1] !== pathSeparator;
|
|
61
|
-
return convertSlashes(needsSeperator ? path4 + pathSeparator : path4, pathSeparator);
|
|
62
|
-
}
|
|
63
|
-
__name(normalizePath, "normalizePath");
|
|
64
|
-
exports.normalizePath = normalizePath;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/join-path.js
|
|
69
|
-
var require_join_path = __commonJS({
|
|
70
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/join-path.js"(exports) {
|
|
71
|
-
"use strict";
|
|
72
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
73
|
-
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
|
|
74
|
-
var path_1 = __require("path");
|
|
75
|
-
var utils_1 = require_utils();
|
|
76
|
-
function joinPathWithBasePath(filename, directoryPath) {
|
|
77
|
-
return directoryPath + filename;
|
|
78
|
-
}
|
|
79
|
-
__name(joinPathWithBasePath, "joinPathWithBasePath");
|
|
80
|
-
exports.joinPathWithBasePath = joinPathWithBasePath;
|
|
81
|
-
function joinPathWithRelativePath(root, options) {
|
|
82
|
-
return function(filename, directoryPath) {
|
|
83
|
-
const sameRoot = directoryPath.startsWith(root);
|
|
84
|
-
if (sameRoot)
|
|
85
|
-
return directoryPath.replace(root, "") + filename;
|
|
86
|
-
else
|
|
87
|
-
return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
__name(joinPathWithRelativePath, "joinPathWithRelativePath");
|
|
91
|
-
function joinPath(filename) {
|
|
92
|
-
return filename;
|
|
93
|
-
}
|
|
94
|
-
__name(joinPath, "joinPath");
|
|
95
|
-
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
96
|
-
return directoryPath + filename + separator;
|
|
97
|
-
}
|
|
98
|
-
__name(joinDirectoryPath, "joinDirectoryPath");
|
|
99
|
-
exports.joinDirectoryPath = joinDirectoryPath;
|
|
100
|
-
function build(root, options) {
|
|
101
|
-
const { relativePaths, includeBasePath } = options;
|
|
102
|
-
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
103
|
-
}
|
|
104
|
-
__name(build, "build");
|
|
105
|
-
exports.build = build;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-directory.js
|
|
110
|
-
var require_push_directory = __commonJS({
|
|
111
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-directory.js"(exports) {
|
|
112
|
-
"use strict";
|
|
113
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
114
|
-
exports.build = void 0;
|
|
115
|
-
function pushDirectoryWithRelativePath(root) {
|
|
116
|
-
return function(directoryPath, paths) {
|
|
117
|
-
paths.push(directoryPath.substring(root.length) || ".");
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
__name(pushDirectoryWithRelativePath, "pushDirectoryWithRelativePath");
|
|
121
|
-
function pushDirectoryFilterWithRelativePath(root) {
|
|
122
|
-
return function(directoryPath, paths, filters) {
|
|
123
|
-
const relativePath = directoryPath.substring(root.length) || ".";
|
|
124
|
-
if (filters.every((filter) => filter(relativePath, true))) {
|
|
125
|
-
paths.push(relativePath);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
__name(pushDirectoryFilterWithRelativePath, "pushDirectoryFilterWithRelativePath");
|
|
130
|
-
var pushDirectory = /* @__PURE__ */ __name((directoryPath, paths) => {
|
|
131
|
-
paths.push(directoryPath || ".");
|
|
132
|
-
}, "pushDirectory");
|
|
133
|
-
var pushDirectoryFilter = /* @__PURE__ */ __name((directoryPath, paths, filters) => {
|
|
134
|
-
const path4 = directoryPath || ".";
|
|
135
|
-
if (filters.every((filter) => filter(path4, true))) {
|
|
136
|
-
paths.push(path4);
|
|
137
|
-
}
|
|
138
|
-
}, "pushDirectoryFilter");
|
|
139
|
-
var empty = /* @__PURE__ */ __name(() => {
|
|
140
|
-
}, "empty");
|
|
141
|
-
function build(root, options) {
|
|
142
|
-
const { includeDirs, filters, relativePaths } = options;
|
|
143
|
-
if (!includeDirs)
|
|
144
|
-
return empty;
|
|
145
|
-
if (relativePaths)
|
|
146
|
-
return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
147
|
-
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
148
|
-
}
|
|
149
|
-
__name(build, "build");
|
|
150
|
-
exports.build = build;
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-file.js
|
|
155
|
-
var require_push_file = __commonJS({
|
|
156
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-file.js"(exports) {
|
|
157
|
-
"use strict";
|
|
158
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
159
|
-
exports.build = void 0;
|
|
160
|
-
var pushFileFilterAndCount = /* @__PURE__ */ __name((filename, _paths, counts, filters) => {
|
|
161
|
-
if (filters.every((filter) => filter(filename, false)))
|
|
162
|
-
counts.files++;
|
|
163
|
-
}, "pushFileFilterAndCount");
|
|
164
|
-
var pushFileFilter = /* @__PURE__ */ __name((filename, paths, _counts, filters) => {
|
|
165
|
-
if (filters.every((filter) => filter(filename, false)))
|
|
166
|
-
paths.push(filename);
|
|
167
|
-
}, "pushFileFilter");
|
|
168
|
-
var pushFileCount = /* @__PURE__ */ __name((_filename, _paths, counts, _filters) => {
|
|
169
|
-
counts.files++;
|
|
170
|
-
}, "pushFileCount");
|
|
171
|
-
var pushFile = /* @__PURE__ */ __name((filename, paths) => {
|
|
172
|
-
paths.push(filename);
|
|
173
|
-
}, "pushFile");
|
|
174
|
-
var empty = /* @__PURE__ */ __name(() => {
|
|
175
|
-
}, "empty");
|
|
176
|
-
function build(options) {
|
|
177
|
-
const { excludeFiles, filters, onlyCounts } = options;
|
|
178
|
-
if (excludeFiles)
|
|
179
|
-
return empty;
|
|
180
|
-
if (filters && filters.length) {
|
|
181
|
-
return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
182
|
-
} else if (onlyCounts) {
|
|
183
|
-
return pushFileCount;
|
|
184
|
-
} else {
|
|
185
|
-
return pushFile;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
__name(build, "build");
|
|
189
|
-
exports.build = build;
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/get-array.js
|
|
194
|
-
var require_get_array = __commonJS({
|
|
195
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/get-array.js"(exports) {
|
|
196
|
-
"use strict";
|
|
197
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
198
|
-
exports.build = void 0;
|
|
199
|
-
var getArray = /* @__PURE__ */ __name((paths) => {
|
|
200
|
-
return paths;
|
|
201
|
-
}, "getArray");
|
|
202
|
-
var getArrayGroup = /* @__PURE__ */ __name(() => {
|
|
203
|
-
return [""].slice(0, 0);
|
|
204
|
-
}, "getArrayGroup");
|
|
205
|
-
function build(options) {
|
|
206
|
-
return options.group ? getArrayGroup : getArray;
|
|
207
|
-
}
|
|
208
|
-
__name(build, "build");
|
|
209
|
-
exports.build = build;
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/group-files.js
|
|
214
|
-
var require_group_files = __commonJS({
|
|
215
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/group-files.js"(exports) {
|
|
216
|
-
"use strict";
|
|
217
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
218
|
-
exports.build = void 0;
|
|
219
|
-
var groupFiles = /* @__PURE__ */ __name((groups, directory, files) => {
|
|
220
|
-
groups.push({ directory, files, dir: directory });
|
|
221
|
-
}, "groupFiles");
|
|
222
|
-
var empty = /* @__PURE__ */ __name(() => {
|
|
223
|
-
}, "empty");
|
|
224
|
-
function build(options) {
|
|
225
|
-
return options.group ? groupFiles : empty;
|
|
226
|
-
}
|
|
227
|
-
__name(build, "build");
|
|
228
|
-
exports.build = build;
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/resolve-symlink.js
|
|
233
|
-
var require_resolve_symlink = __commonJS({
|
|
234
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/resolve-symlink.js"(exports) {
|
|
235
|
-
"use strict";
|
|
236
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
237
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
238
|
-
};
|
|
239
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
240
|
-
exports.build = void 0;
|
|
241
|
-
var fs_1 = __importDefault(__require("fs"));
|
|
242
|
-
var path_1 = __require("path");
|
|
243
|
-
var resolveSymlinksAsync = /* @__PURE__ */ __name(function(path4, state, callback) {
|
|
244
|
-
const { queue, options: { suppressErrors } } = state;
|
|
245
|
-
queue.enqueue();
|
|
246
|
-
fs_1.default.realpath(path4, (error, resolvedPath) => {
|
|
247
|
-
if (error)
|
|
248
|
-
return queue.dequeue(suppressErrors ? null : error, state);
|
|
249
|
-
fs_1.default.stat(resolvedPath, (error2, stat) => {
|
|
250
|
-
if (error2)
|
|
251
|
-
return queue.dequeue(suppressErrors ? null : error2, state);
|
|
252
|
-
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state))
|
|
253
|
-
return queue.dequeue(null, state);
|
|
254
|
-
callback(stat, resolvedPath);
|
|
255
|
-
queue.dequeue(null, state);
|
|
256
|
-
});
|
|
257
|
-
});
|
|
258
|
-
}, "resolveSymlinksAsync");
|
|
259
|
-
var resolveSymlinks = /* @__PURE__ */ __name(function(path4, state, callback) {
|
|
260
|
-
const { queue, options: { suppressErrors } } = state;
|
|
261
|
-
queue.enqueue();
|
|
262
|
-
try {
|
|
263
|
-
const resolvedPath = fs_1.default.realpathSync(path4);
|
|
264
|
-
const stat = fs_1.default.statSync(resolvedPath);
|
|
265
|
-
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state))
|
|
266
|
-
return;
|
|
267
|
-
callback(stat, resolvedPath);
|
|
268
|
-
} catch (e) {
|
|
269
|
-
if (!suppressErrors)
|
|
270
|
-
throw e;
|
|
271
|
-
}
|
|
272
|
-
}, "resolveSymlinks");
|
|
273
|
-
function build(options, isSynchronous) {
|
|
274
|
-
if (!options.resolveSymlinks || options.excludeSymlinks)
|
|
275
|
-
return null;
|
|
276
|
-
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
277
|
-
}
|
|
278
|
-
__name(build, "build");
|
|
279
|
-
exports.build = build;
|
|
280
|
-
function isRecursive(path4, resolved, state) {
|
|
281
|
-
if (state.options.useRealPaths)
|
|
282
|
-
return isRecursiveUsingRealPaths(resolved, state);
|
|
283
|
-
let parent = (0, path_1.dirname)(path4);
|
|
284
|
-
let depth = 1;
|
|
285
|
-
while (parent !== state.root && depth < 2) {
|
|
286
|
-
const resolvedPath = state.symlinks.get(parent);
|
|
287
|
-
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
288
|
-
if (isSameRoot)
|
|
289
|
-
depth++;
|
|
290
|
-
else
|
|
291
|
-
parent = (0, path_1.dirname)(parent);
|
|
292
|
-
}
|
|
293
|
-
state.symlinks.set(path4, resolved);
|
|
294
|
-
return depth > 1;
|
|
295
|
-
}
|
|
296
|
-
__name(isRecursive, "isRecursive");
|
|
297
|
-
function isRecursiveUsingRealPaths(resolved, state) {
|
|
298
|
-
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
299
|
-
}
|
|
300
|
-
__name(isRecursiveUsingRealPaths, "isRecursiveUsingRealPaths");
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
|
|
304
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/invoke-callback.js
|
|
305
|
-
var require_invoke_callback = __commonJS({
|
|
306
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/invoke-callback.js"(exports) {
|
|
307
|
-
"use strict";
|
|
308
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
309
|
-
exports.build = void 0;
|
|
310
|
-
var onlyCountsSync = /* @__PURE__ */ __name((state) => {
|
|
311
|
-
return state.counts;
|
|
312
|
-
}, "onlyCountsSync");
|
|
313
|
-
var groupsSync = /* @__PURE__ */ __name((state) => {
|
|
314
|
-
return state.groups;
|
|
315
|
-
}, "groupsSync");
|
|
316
|
-
var defaultSync = /* @__PURE__ */ __name((state) => {
|
|
317
|
-
return state.paths;
|
|
318
|
-
}, "defaultSync");
|
|
319
|
-
var limitFilesSync = /* @__PURE__ */ __name((state) => {
|
|
320
|
-
return state.paths.slice(0, state.options.maxFiles);
|
|
321
|
-
}, "limitFilesSync");
|
|
322
|
-
var onlyCountsAsync = /* @__PURE__ */ __name((state, error, callback) => {
|
|
323
|
-
report(error, callback, state.counts, state.options.suppressErrors);
|
|
324
|
-
return null;
|
|
325
|
-
}, "onlyCountsAsync");
|
|
326
|
-
var defaultAsync = /* @__PURE__ */ __name((state, error, callback) => {
|
|
327
|
-
report(error, callback, state.paths, state.options.suppressErrors);
|
|
328
|
-
return null;
|
|
329
|
-
}, "defaultAsync");
|
|
330
|
-
var limitFilesAsync = /* @__PURE__ */ __name((state, error, callback) => {
|
|
331
|
-
report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
332
|
-
return null;
|
|
333
|
-
}, "limitFilesAsync");
|
|
334
|
-
var groupsAsync = /* @__PURE__ */ __name((state, error, callback) => {
|
|
335
|
-
report(error, callback, state.groups, state.options.suppressErrors);
|
|
336
|
-
return null;
|
|
337
|
-
}, "groupsAsync");
|
|
338
|
-
function report(error, callback, output, suppressErrors) {
|
|
339
|
-
if (error && !suppressErrors)
|
|
340
|
-
callback(error, output);
|
|
341
|
-
else
|
|
342
|
-
callback(null, output);
|
|
343
|
-
}
|
|
344
|
-
__name(report, "report");
|
|
345
|
-
function build(options, isSynchronous) {
|
|
346
|
-
const { onlyCounts, group, maxFiles } = options;
|
|
347
|
-
if (onlyCounts)
|
|
348
|
-
return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
349
|
-
else if (group)
|
|
350
|
-
return isSynchronous ? groupsSync : groupsAsync;
|
|
351
|
-
else if (maxFiles)
|
|
352
|
-
return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
353
|
-
else
|
|
354
|
-
return isSynchronous ? defaultSync : defaultAsync;
|
|
355
|
-
}
|
|
356
|
-
__name(build, "build");
|
|
357
|
-
exports.build = build;
|
|
358
|
-
}
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/walk-directory.js
|
|
362
|
-
var require_walk_directory = __commonJS({
|
|
363
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/walk-directory.js"(exports) {
|
|
364
|
-
"use strict";
|
|
365
|
-
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
366
|
-
return mod && mod.__esModule ? mod : { "default": mod };
|
|
367
|
-
};
|
|
368
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
369
|
-
exports.build = void 0;
|
|
370
|
-
var fs_1 = __importDefault(__require("fs"));
|
|
371
|
-
var readdirOpts = { withFileTypes: true };
|
|
372
|
-
var walkAsync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback) => {
|
|
373
|
-
state.queue.enqueue();
|
|
374
|
-
if (currentDepth < 0)
|
|
375
|
-
return state.queue.dequeue(null, state);
|
|
376
|
-
state.visited.push(crawlPath);
|
|
377
|
-
state.counts.directories++;
|
|
378
|
-
fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
|
379
|
-
callback(entries, directoryPath, currentDepth);
|
|
380
|
-
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
381
|
-
});
|
|
382
|
-
}, "walkAsync");
|
|
383
|
-
var walkSync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback) => {
|
|
384
|
-
if (currentDepth < 0)
|
|
385
|
-
return;
|
|
386
|
-
state.visited.push(crawlPath);
|
|
387
|
-
state.counts.directories++;
|
|
388
|
-
let entries = [];
|
|
389
|
-
try {
|
|
390
|
-
entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
|
|
391
|
-
} catch (e) {
|
|
392
|
-
if (!state.options.suppressErrors)
|
|
393
|
-
throw e;
|
|
394
|
-
}
|
|
395
|
-
callback(entries, directoryPath, currentDepth);
|
|
396
|
-
}, "walkSync");
|
|
397
|
-
function build(isSynchronous) {
|
|
398
|
-
return isSynchronous ? walkSync : walkAsync;
|
|
399
|
-
}
|
|
400
|
-
__name(build, "build");
|
|
401
|
-
exports.build = build;
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/queue.js
|
|
406
|
-
var require_queue = __commonJS({
|
|
407
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/queue.js"(exports) {
|
|
408
|
-
"use strict";
|
|
409
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
410
|
-
exports.Queue = void 0;
|
|
411
|
-
var Queue = class {
|
|
412
|
-
static {
|
|
413
|
-
__name(this, "Queue");
|
|
414
|
-
}
|
|
415
|
-
onQueueEmpty;
|
|
416
|
-
count = 0;
|
|
417
|
-
constructor(onQueueEmpty) {
|
|
418
|
-
this.onQueueEmpty = onQueueEmpty;
|
|
419
|
-
}
|
|
420
|
-
enqueue() {
|
|
421
|
-
this.count++;
|
|
422
|
-
return this.count;
|
|
423
|
-
}
|
|
424
|
-
dequeue(error, output) {
|
|
425
|
-
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
|
426
|
-
this.onQueueEmpty(error, output);
|
|
427
|
-
if (error) {
|
|
428
|
-
output.controller.abort();
|
|
429
|
-
this.onQueueEmpty = void 0;
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
exports.Queue = Queue;
|
|
435
|
-
}
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/counter.js
|
|
439
|
-
var require_counter = __commonJS({
|
|
440
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/counter.js"(exports) {
|
|
441
|
-
"use strict";
|
|
442
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
443
|
-
exports.Counter = void 0;
|
|
444
|
-
var Counter = class {
|
|
445
|
-
static {
|
|
446
|
-
__name(this, "Counter");
|
|
447
|
-
}
|
|
448
|
-
_files = 0;
|
|
449
|
-
_directories = 0;
|
|
450
|
-
set files(num) {
|
|
451
|
-
this._files = num;
|
|
452
|
-
}
|
|
453
|
-
get files() {
|
|
454
|
-
return this._files;
|
|
455
|
-
}
|
|
456
|
-
set directories(num) {
|
|
457
|
-
this._directories = num;
|
|
458
|
-
}
|
|
459
|
-
get directories() {
|
|
460
|
-
return this._directories;
|
|
461
|
-
}
|
|
462
|
-
/**
|
|
463
|
-
* @deprecated use `directories` instead
|
|
464
|
-
*/
|
|
465
|
-
/* c8 ignore next 3 */
|
|
466
|
-
get dirs() {
|
|
467
|
-
return this._directories;
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
exports.Counter = Counter;
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/walker.js
|
|
475
|
-
var require_walker = __commonJS({
|
|
476
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/walker.js"(exports) {
|
|
477
|
-
"use strict";
|
|
478
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
479
|
-
if (k2 === void 0) k2 = k;
|
|
480
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
481
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
482
|
-
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
483
|
-
return m[k];
|
|
484
|
-
}, "get") };
|
|
485
|
-
}
|
|
486
|
-
Object.defineProperty(o, k2, desc);
|
|
487
|
-
} : function(o, m, k, k2) {
|
|
488
|
-
if (k2 === void 0) k2 = k;
|
|
489
|
-
o[k2] = m[k];
|
|
490
|
-
});
|
|
491
|
-
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {
|
|
492
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
493
|
-
} : function(o, v) {
|
|
494
|
-
o["default"] = v;
|
|
495
|
-
});
|
|
496
|
-
var __importStar = exports && exports.__importStar || function(mod) {
|
|
497
|
-
if (mod && mod.__esModule) return mod;
|
|
498
|
-
var result = {};
|
|
499
|
-
if (mod != null) {
|
|
500
|
-
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
501
|
-
}
|
|
502
|
-
__setModuleDefault(result, mod);
|
|
503
|
-
return result;
|
|
504
|
-
};
|
|
505
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
506
|
-
exports.Walker = void 0;
|
|
507
|
-
var path_1 = __require("path");
|
|
508
|
-
var utils_1 = require_utils();
|
|
509
|
-
var joinPath = __importStar(require_join_path());
|
|
510
|
-
var pushDirectory = __importStar(require_push_directory());
|
|
511
|
-
var pushFile = __importStar(require_push_file());
|
|
512
|
-
var getArray = __importStar(require_get_array());
|
|
513
|
-
var groupFiles = __importStar(require_group_files());
|
|
514
|
-
var resolveSymlink = __importStar(require_resolve_symlink());
|
|
515
|
-
var invokeCallback = __importStar(require_invoke_callback());
|
|
516
|
-
var walkDirectory = __importStar(require_walk_directory());
|
|
517
|
-
var queue_1 = require_queue();
|
|
518
|
-
var counter_1 = require_counter();
|
|
519
|
-
var Walker = class {
|
|
520
|
-
static {
|
|
521
|
-
__name(this, "Walker");
|
|
522
|
-
}
|
|
523
|
-
root;
|
|
524
|
-
isSynchronous;
|
|
525
|
-
state;
|
|
526
|
-
joinPath;
|
|
527
|
-
pushDirectory;
|
|
528
|
-
pushFile;
|
|
529
|
-
getArray;
|
|
530
|
-
groupFiles;
|
|
531
|
-
resolveSymlink;
|
|
532
|
-
walkDirectory;
|
|
533
|
-
callbackInvoker;
|
|
534
|
-
constructor(root, options, callback) {
|
|
535
|
-
this.isSynchronous = !callback;
|
|
536
|
-
this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
|
|
537
|
-
this.root = (0, utils_1.normalizePath)(root, options);
|
|
538
|
-
this.state = {
|
|
539
|
-
root: (0, utils_1.isRootDirectory)(this.root) ? this.root : this.root.slice(0, -1),
|
|
540
|
-
// Perf: we explicitly tell the compiler to optimize for String arrays
|
|
541
|
-
paths: [""].slice(0, 0),
|
|
542
|
-
groups: [],
|
|
543
|
-
counts: new counter_1.Counter(),
|
|
544
|
-
options,
|
|
545
|
-
queue: new queue_1.Queue((error, state) => this.callbackInvoker(state, error, callback)),
|
|
546
|
-
symlinks: /* @__PURE__ */ new Map(),
|
|
547
|
-
visited: [""].slice(0, 0),
|
|
548
|
-
controller: new AbortController()
|
|
549
|
-
};
|
|
550
|
-
this.joinPath = joinPath.build(this.root, options);
|
|
551
|
-
this.pushDirectory = pushDirectory.build(this.root, options);
|
|
552
|
-
this.pushFile = pushFile.build(options);
|
|
553
|
-
this.getArray = getArray.build(options);
|
|
554
|
-
this.groupFiles = groupFiles.build(options);
|
|
555
|
-
this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
|
|
556
|
-
this.walkDirectory = walkDirectory.build(this.isSynchronous);
|
|
557
|
-
}
|
|
558
|
-
start() {
|
|
559
|
-
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
|
560
|
-
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
561
|
-
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
562
|
-
}
|
|
563
|
-
walk = /* @__PURE__ */ __name((entries, directoryPath, depth) => {
|
|
564
|
-
const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
565
|
-
if (controller.signal.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles)
|
|
566
|
-
return;
|
|
567
|
-
const files = this.getArray(this.state.paths);
|
|
568
|
-
for (let i = 0; i < entries.length; ++i) {
|
|
569
|
-
const entry = entries[i];
|
|
570
|
-
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
|
|
571
|
-
const filename = this.joinPath(entry.name, directoryPath);
|
|
572
|
-
this.pushFile(filename, files, this.state.counts, filters);
|
|
573
|
-
} else if (entry.isDirectory()) {
|
|
574
|
-
let path4 = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
575
|
-
if (exclude && exclude(entry.name, path4))
|
|
576
|
-
continue;
|
|
577
|
-
this.pushDirectory(path4, paths, filters);
|
|
578
|
-
this.walkDirectory(this.state, path4, path4, depth - 1, this.walk);
|
|
579
|
-
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
580
|
-
let path4 = joinPath.joinPathWithBasePath(entry.name, directoryPath);
|
|
581
|
-
this.resolveSymlink(path4, this.state, (stat, resolvedPath) => {
|
|
582
|
-
if (stat.isDirectory()) {
|
|
583
|
-
resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
|
|
584
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path4 + pathSeparator))
|
|
585
|
-
return;
|
|
586
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path4 + pathSeparator, depth - 1, this.walk);
|
|
587
|
-
} else {
|
|
588
|
-
resolvedPath = useRealPaths ? resolvedPath : path4;
|
|
589
|
-
const filename = (0, path_1.basename)(resolvedPath);
|
|
590
|
-
const directoryPath2 = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
|
|
591
|
-
resolvedPath = this.joinPath(filename, directoryPath2);
|
|
592
|
-
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
593
|
-
}
|
|
594
|
-
});
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
this.groupFiles(this.state.groups, directoryPath, files);
|
|
598
|
-
}, "walk");
|
|
599
|
-
};
|
|
600
|
-
exports.Walker = Walker;
|
|
601
|
-
}
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/async.js
|
|
605
|
-
var require_async = __commonJS({
|
|
606
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/async.js"(exports) {
|
|
607
|
-
"use strict";
|
|
608
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
609
|
-
exports.callback = exports.promise = void 0;
|
|
610
|
-
var walker_1 = require_walker();
|
|
611
|
-
function promise(root, options) {
|
|
612
|
-
return new Promise((resolve2, reject) => {
|
|
613
|
-
callback(root, options, (err, output) => {
|
|
614
|
-
if (err)
|
|
615
|
-
return reject(err);
|
|
616
|
-
resolve2(output);
|
|
617
|
-
});
|
|
618
|
-
});
|
|
619
|
-
}
|
|
620
|
-
__name(promise, "promise");
|
|
621
|
-
exports.promise = promise;
|
|
622
|
-
function callback(root, options, callback2) {
|
|
623
|
-
let walker = new walker_1.Walker(root, options, callback2);
|
|
624
|
-
walker.start();
|
|
625
|
-
}
|
|
626
|
-
__name(callback, "callback");
|
|
627
|
-
exports.callback = callback;
|
|
628
|
-
}
|
|
629
|
-
});
|
|
630
|
-
|
|
631
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/api/sync.js
|
|
632
|
-
var require_sync = __commonJS({
|
|
633
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/api/sync.js"(exports) {
|
|
634
|
-
"use strict";
|
|
635
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
636
|
-
exports.sync = void 0;
|
|
637
|
-
var walker_1 = require_walker();
|
|
638
|
-
function sync(root, options) {
|
|
639
|
-
const walker = new walker_1.Walker(root, options);
|
|
640
|
-
return walker.start();
|
|
641
|
-
}
|
|
642
|
-
__name(sync, "sync");
|
|
643
|
-
exports.sync = sync;
|
|
644
|
-
}
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/builder/api-builder.js
|
|
648
|
-
var require_api_builder = __commonJS({
|
|
649
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/builder/api-builder.js"(exports) {
|
|
650
|
-
"use strict";
|
|
651
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
652
|
-
exports.APIBuilder = void 0;
|
|
653
|
-
var async_1 = require_async();
|
|
654
|
-
var sync_1 = require_sync();
|
|
655
|
-
var APIBuilder = class {
|
|
656
|
-
static {
|
|
657
|
-
__name(this, "APIBuilder");
|
|
658
|
-
}
|
|
659
|
-
root;
|
|
660
|
-
options;
|
|
661
|
-
constructor(root, options) {
|
|
662
|
-
this.root = root;
|
|
663
|
-
this.options = options;
|
|
664
|
-
}
|
|
665
|
-
withPromise() {
|
|
666
|
-
return (0, async_1.promise)(this.root, this.options);
|
|
667
|
-
}
|
|
668
|
-
withCallback(cb) {
|
|
669
|
-
(0, async_1.callback)(this.root, this.options, cb);
|
|
670
|
-
}
|
|
671
|
-
sync() {
|
|
672
|
-
return (0, sync_1.sync)(this.root, this.options);
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
exports.APIBuilder = APIBuilder;
|
|
676
|
-
}
|
|
677
|
-
});
|
|
22
|
+
} from "./chunk-XZTBG2TG.js";
|
|
678
23
|
|
|
679
24
|
// ../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js
|
|
680
25
|
var require_constants = __commonJS({
|
|
@@ -876,7 +221,7 @@ var require_constants = __commonJS({
|
|
|
876
221
|
});
|
|
877
222
|
|
|
878
223
|
// ../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
|
|
879
|
-
var
|
|
224
|
+
var require_utils = __commonJS({
|
|
880
225
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports) {
|
|
881
226
|
"use strict";
|
|
882
227
|
var {
|
|
@@ -943,7 +288,7 @@ var require_utils2 = __commonJS({
|
|
|
943
288
|
var require_scan = __commonJS({
|
|
944
289
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
945
290
|
"use strict";
|
|
946
|
-
var utils =
|
|
291
|
+
var utils = require_utils();
|
|
947
292
|
var {
|
|
948
293
|
CHAR_ASTERISK,
|
|
949
294
|
/* * */
|
|
@@ -1274,7 +619,7 @@ var require_parse = __commonJS({
|
|
|
1274
619
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
1275
620
|
"use strict";
|
|
1276
621
|
var constants3 = require_constants();
|
|
1277
|
-
var utils =
|
|
622
|
+
var utils = require_utils();
|
|
1278
623
|
var {
|
|
1279
624
|
MAX_LENGTH,
|
|
1280
625
|
POSIX_REGEX_SOURCE,
|
|
@@ -2043,7 +1388,7 @@ var require_picomatch = __commonJS({
|
|
|
2043
1388
|
"use strict";
|
|
2044
1389
|
var scan = require_scan();
|
|
2045
1390
|
var parse = require_parse();
|
|
2046
|
-
var utils =
|
|
1391
|
+
var utils = require_utils();
|
|
2047
1392
|
var constants3 = require_constants();
|
|
2048
1393
|
var isObject = /* @__PURE__ */ __name((val) => val && typeof val === "object" && !Array.isArray(val), "isObject");
|
|
2049
1394
|
var picomatch2 = /* @__PURE__ */ __name((glob, options, returnState = false) => {
|
|
@@ -2182,7 +1527,7 @@ var require_picomatch2 = __commonJS({
|
|
|
2182
1527
|
"../node_modules/tinyglobby/node_modules/picomatch/index.js"(exports, module) {
|
|
2183
1528
|
"use strict";
|
|
2184
1529
|
var pico = require_picomatch();
|
|
2185
|
-
var utils =
|
|
1530
|
+
var utils = require_utils();
|
|
2186
1531
|
function picomatch2(glob, options, returnState = false) {
|
|
2187
1532
|
if (options && (options.windows === null || options.windows === void 0)) {
|
|
2188
1533
|
options = { ...options, windows: utils.isWindows() };
|
|
@@ -2195,189 +1540,11 @@ var require_picomatch2 = __commonJS({
|
|
|
2195
1540
|
}
|
|
2196
1541
|
});
|
|
2197
1542
|
|
|
2198
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js
|
|
2199
|
-
var require_builder = __commonJS({
|
|
2200
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js"(exports) {
|
|
2201
|
-
"use strict";
|
|
2202
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2203
|
-
exports.Builder = void 0;
|
|
2204
|
-
var path_1 = __require("path");
|
|
2205
|
-
var api_builder_1 = require_api_builder();
|
|
2206
|
-
var pm = null;
|
|
2207
|
-
try {
|
|
2208
|
-
__require.resolve("picomatch");
|
|
2209
|
-
pm = require_picomatch2();
|
|
2210
|
-
} catch (_e) {
|
|
2211
|
-
}
|
|
2212
|
-
var Builder = class {
|
|
2213
|
-
static {
|
|
2214
|
-
__name(this, "Builder");
|
|
2215
|
-
}
|
|
2216
|
-
globCache = {};
|
|
2217
|
-
options = {
|
|
2218
|
-
maxDepth: Infinity,
|
|
2219
|
-
suppressErrors: true,
|
|
2220
|
-
pathSeparator: path_1.sep,
|
|
2221
|
-
filters: []
|
|
2222
|
-
};
|
|
2223
|
-
globFunction;
|
|
2224
|
-
constructor(options) {
|
|
2225
|
-
this.options = { ...this.options, ...options };
|
|
2226
|
-
this.globFunction = this.options.globFunction;
|
|
2227
|
-
}
|
|
2228
|
-
group() {
|
|
2229
|
-
this.options.group = true;
|
|
2230
|
-
return this;
|
|
2231
|
-
}
|
|
2232
|
-
withPathSeparator(separator) {
|
|
2233
|
-
this.options.pathSeparator = separator;
|
|
2234
|
-
return this;
|
|
2235
|
-
}
|
|
2236
|
-
withBasePath() {
|
|
2237
|
-
this.options.includeBasePath = true;
|
|
2238
|
-
return this;
|
|
2239
|
-
}
|
|
2240
|
-
withRelativePaths() {
|
|
2241
|
-
this.options.relativePaths = true;
|
|
2242
|
-
return this;
|
|
2243
|
-
}
|
|
2244
|
-
withDirs() {
|
|
2245
|
-
this.options.includeDirs = true;
|
|
2246
|
-
return this;
|
|
2247
|
-
}
|
|
2248
|
-
withMaxDepth(depth) {
|
|
2249
|
-
this.options.maxDepth = depth;
|
|
2250
|
-
return this;
|
|
2251
|
-
}
|
|
2252
|
-
withMaxFiles(limit) {
|
|
2253
|
-
this.options.maxFiles = limit;
|
|
2254
|
-
return this;
|
|
2255
|
-
}
|
|
2256
|
-
withFullPaths() {
|
|
2257
|
-
this.options.resolvePaths = true;
|
|
2258
|
-
this.options.includeBasePath = true;
|
|
2259
|
-
return this;
|
|
2260
|
-
}
|
|
2261
|
-
withErrors() {
|
|
2262
|
-
this.options.suppressErrors = false;
|
|
2263
|
-
return this;
|
|
2264
|
-
}
|
|
2265
|
-
withSymlinks({ resolvePaths = true } = {}) {
|
|
2266
|
-
this.options.resolveSymlinks = true;
|
|
2267
|
-
this.options.useRealPaths = resolvePaths;
|
|
2268
|
-
return this.withFullPaths();
|
|
2269
|
-
}
|
|
2270
|
-
withAbortSignal(signal) {
|
|
2271
|
-
this.options.signal = signal;
|
|
2272
|
-
return this;
|
|
2273
|
-
}
|
|
2274
|
-
normalize() {
|
|
2275
|
-
this.options.normalizePath = true;
|
|
2276
|
-
return this;
|
|
2277
|
-
}
|
|
2278
|
-
filter(predicate) {
|
|
2279
|
-
this.options.filters.push(predicate);
|
|
2280
|
-
return this;
|
|
2281
|
-
}
|
|
2282
|
-
onlyDirs() {
|
|
2283
|
-
this.options.excludeFiles = true;
|
|
2284
|
-
this.options.includeDirs = true;
|
|
2285
|
-
return this;
|
|
2286
|
-
}
|
|
2287
|
-
exclude(predicate) {
|
|
2288
|
-
this.options.exclude = predicate;
|
|
2289
|
-
return this;
|
|
2290
|
-
}
|
|
2291
|
-
onlyCounts() {
|
|
2292
|
-
this.options.onlyCounts = true;
|
|
2293
|
-
return this;
|
|
2294
|
-
}
|
|
2295
|
-
crawl(root) {
|
|
2296
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
2297
|
-
}
|
|
2298
|
-
withGlobFunction(fn) {
|
|
2299
|
-
this.globFunction = fn;
|
|
2300
|
-
return this;
|
|
2301
|
-
}
|
|
2302
|
-
/**
|
|
2303
|
-
* @deprecated Pass options using the constructor instead:
|
|
2304
|
-
* ```ts
|
|
2305
|
-
* new fdir(options).crawl("/path/to/root");
|
|
2306
|
-
* ```
|
|
2307
|
-
* This method will be removed in v7.0
|
|
2308
|
-
*/
|
|
2309
|
-
/* c8 ignore next 4 */
|
|
2310
|
-
crawlWithOptions(root, options) {
|
|
2311
|
-
this.options = { ...this.options, ...options };
|
|
2312
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
2313
|
-
}
|
|
2314
|
-
glob(...patterns) {
|
|
2315
|
-
if (this.globFunction) {
|
|
2316
|
-
return this.globWithOptions(patterns);
|
|
2317
|
-
}
|
|
2318
|
-
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
|
2319
|
-
}
|
|
2320
|
-
globWithOptions(patterns, ...options) {
|
|
2321
|
-
const globFn = this.globFunction || pm;
|
|
2322
|
-
if (!globFn) {
|
|
2323
|
-
throw new Error("Please specify a glob function to use glob matching.");
|
|
2324
|
-
}
|
|
2325
|
-
var isMatch = this.globCache[patterns.join("\0")];
|
|
2326
|
-
if (!isMatch) {
|
|
2327
|
-
isMatch = globFn(patterns, ...options);
|
|
2328
|
-
this.globCache[patterns.join("\0")] = isMatch;
|
|
2329
|
-
}
|
|
2330
|
-
this.options.filters.push((path4) => isMatch(path4));
|
|
2331
|
-
return this;
|
|
2332
|
-
}
|
|
2333
|
-
};
|
|
2334
|
-
exports.Builder = Builder;
|
|
2335
|
-
}
|
|
2336
|
-
});
|
|
2337
|
-
|
|
2338
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/types.js
|
|
2339
|
-
var require_types = __commonJS({
|
|
2340
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/types.js"(exports) {
|
|
2341
|
-
"use strict";
|
|
2342
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2343
|
-
}
|
|
2344
|
-
});
|
|
2345
|
-
|
|
2346
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/index.js
|
|
2347
|
-
var require_dist = __commonJS({
|
|
2348
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/index.js"(exports) {
|
|
2349
|
-
"use strict";
|
|
2350
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2351
|
-
if (k2 === void 0) k2 = k;
|
|
2352
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2353
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2354
|
-
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2355
|
-
return m[k];
|
|
2356
|
-
}, "get") };
|
|
2357
|
-
}
|
|
2358
|
-
Object.defineProperty(o, k2, desc);
|
|
2359
|
-
} : function(o, m, k, k2) {
|
|
2360
|
-
if (k2 === void 0) k2 = k;
|
|
2361
|
-
o[k2] = m[k];
|
|
2362
|
-
});
|
|
2363
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
2364
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
2365
|
-
};
|
|
2366
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2367
|
-
exports.fdir = void 0;
|
|
2368
|
-
var builder_1 = require_builder();
|
|
2369
|
-
Object.defineProperty(exports, "fdir", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2370
|
-
return builder_1.Builder;
|
|
2371
|
-
}, "get") });
|
|
2372
|
-
__exportStar(require_types(), exports);
|
|
2373
|
-
}
|
|
2374
|
-
});
|
|
2375
|
-
|
|
2376
1543
|
// ../node_modules/isexe/windows.js
|
|
2377
1544
|
var require_windows = __commonJS({
|
|
2378
1545
|
"../node_modules/isexe/windows.js"(exports, module) {
|
|
2379
1546
|
module.exports = isexe;
|
|
2380
|
-
isexe.sync =
|
|
1547
|
+
isexe.sync = sync2;
|
|
2381
1548
|
var fs = __require("fs");
|
|
2382
1549
|
function checkPathExt(path4, options) {
|
|
2383
1550
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
@@ -2410,10 +1577,10 @@ var require_windows = __commonJS({
|
|
|
2410
1577
|
});
|
|
2411
1578
|
}
|
|
2412
1579
|
__name(isexe, "isexe");
|
|
2413
|
-
function
|
|
1580
|
+
function sync2(path4, options) {
|
|
2414
1581
|
return checkStat(fs.statSync(path4), path4, options);
|
|
2415
1582
|
}
|
|
2416
|
-
__name(
|
|
1583
|
+
__name(sync2, "sync");
|
|
2417
1584
|
}
|
|
2418
1585
|
});
|
|
2419
1586
|
|
|
@@ -2421,7 +1588,7 @@ var require_windows = __commonJS({
|
|
|
2421
1588
|
var require_mode = __commonJS({
|
|
2422
1589
|
"../node_modules/isexe/mode.js"(exports, module) {
|
|
2423
1590
|
module.exports = isexe;
|
|
2424
|
-
isexe.sync =
|
|
1591
|
+
isexe.sync = sync2;
|
|
2425
1592
|
var fs = __require("fs");
|
|
2426
1593
|
function isexe(path4, options, cb) {
|
|
2427
1594
|
fs.stat(path4, function(er, stat) {
|
|
@@ -2429,10 +1596,10 @@ var require_mode = __commonJS({
|
|
|
2429
1596
|
});
|
|
2430
1597
|
}
|
|
2431
1598
|
__name(isexe, "isexe");
|
|
2432
|
-
function
|
|
1599
|
+
function sync2(path4, options) {
|
|
2433
1600
|
return checkStat(fs.statSync(path4), options);
|
|
2434
1601
|
}
|
|
2435
|
-
__name(
|
|
1602
|
+
__name(sync2, "sync");
|
|
2436
1603
|
function checkStat(stat, options) {
|
|
2437
1604
|
return stat.isFile() && checkMode(stat, options);
|
|
2438
1605
|
}
|
|
@@ -2465,7 +1632,7 @@ var require_isexe = __commonJS({
|
|
|
2465
1632
|
core = require_mode();
|
|
2466
1633
|
}
|
|
2467
1634
|
module.exports = isexe;
|
|
2468
|
-
isexe.sync =
|
|
1635
|
+
isexe.sync = sync2;
|
|
2469
1636
|
function isexe(path4, options, cb) {
|
|
2470
1637
|
if (typeof options === "function") {
|
|
2471
1638
|
cb = options;
|
|
@@ -2475,12 +1642,12 @@ var require_isexe = __commonJS({
|
|
|
2475
1642
|
if (typeof Promise !== "function") {
|
|
2476
1643
|
throw new TypeError("callback not provided");
|
|
2477
1644
|
}
|
|
2478
|
-
return new Promise(function(
|
|
1645
|
+
return new Promise(function(resolve3, reject) {
|
|
2479
1646
|
isexe(path4, options || {}, function(er, is) {
|
|
2480
1647
|
if (er) {
|
|
2481
1648
|
reject(er);
|
|
2482
1649
|
} else {
|
|
2483
|
-
|
|
1650
|
+
resolve3(is);
|
|
2484
1651
|
}
|
|
2485
1652
|
});
|
|
2486
1653
|
});
|
|
@@ -2496,7 +1663,7 @@ var require_isexe = __commonJS({
|
|
|
2496
1663
|
});
|
|
2497
1664
|
}
|
|
2498
1665
|
__name(isexe, "isexe");
|
|
2499
|
-
function
|
|
1666
|
+
function sync2(path4, options) {
|
|
2500
1667
|
try {
|
|
2501
1668
|
return core.sync(path4, options || {});
|
|
2502
1669
|
} catch (er) {
|
|
@@ -2507,7 +1674,7 @@ var require_isexe = __commonJS({
|
|
|
2507
1674
|
}
|
|
2508
1675
|
}
|
|
2509
1676
|
}
|
|
2510
|
-
__name(
|
|
1677
|
+
__name(sync2, "sync");
|
|
2511
1678
|
}
|
|
2512
1679
|
});
|
|
2513
1680
|
|
|
@@ -2548,27 +1715,27 @@ var require_which = __commonJS({
|
|
|
2548
1715
|
opt = {};
|
|
2549
1716
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2550
1717
|
const found = [];
|
|
2551
|
-
const step = /* @__PURE__ */ __name((i) => new Promise((
|
|
1718
|
+
const step = /* @__PURE__ */ __name((i) => new Promise((resolve3, reject) => {
|
|
2552
1719
|
if (i === pathEnv.length)
|
|
2553
|
-
return opt.all && found.length ?
|
|
1720
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
2554
1721
|
const ppRaw = pathEnv[i];
|
|
2555
1722
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2556
1723
|
const pCmd = path4.join(pathPart, cmd);
|
|
2557
1724
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2558
|
-
|
|
1725
|
+
resolve3(subStep(p, i, 0));
|
|
2559
1726
|
}), "step");
|
|
2560
|
-
const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((
|
|
1727
|
+
const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve3, reject) => {
|
|
2561
1728
|
if (ii === pathExt.length)
|
|
2562
|
-
return
|
|
1729
|
+
return resolve3(step(i + 1));
|
|
2563
1730
|
const ext = pathExt[ii];
|
|
2564
1731
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
2565
1732
|
if (!er && is) {
|
|
2566
1733
|
if (opt.all)
|
|
2567
1734
|
found.push(p + ext);
|
|
2568
1735
|
else
|
|
2569
|
-
return
|
|
1736
|
+
return resolve3(p + ext);
|
|
2570
1737
|
}
|
|
2571
|
-
return
|
|
1738
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
2572
1739
|
});
|
|
2573
1740
|
}), "subStep");
|
|
2574
1741
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -2938,40 +2105,597 @@ var require_merge_stream = __commonJS({
|
|
|
2938
2105
|
});
|
|
2939
2106
|
|
|
2940
2107
|
// src/common/utils/paths.ts
|
|
2941
|
-
import { join, relative, resolve, sep } from "node:path";
|
|
2108
|
+
import { join, relative as relative2, resolve as resolve2, sep as sep2 } from "node:path";
|
|
2942
2109
|
|
|
2943
2110
|
// ../node_modules/tinyglobby/dist/index.mjs
|
|
2944
|
-
|
|
2945
|
-
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
2111
|
+
import nativeFs2 from "fs";
|
|
2946
2112
|
import path, { posix } from "path";
|
|
2113
|
+
import { fileURLToPath } from "url";
|
|
2114
|
+
|
|
2115
|
+
// ../node_modules/tinyglobby/node_modules/fdir/dist/index.mjs
|
|
2116
|
+
import { createRequire } from "module";
|
|
2117
|
+
import { basename, dirname, normalize, relative, resolve, sep } from "path";
|
|
2118
|
+
import * as nativeFs from "fs";
|
|
2119
|
+
var __require2 = createRequire(import.meta.url);
|
|
2120
|
+
function cleanPath(path4) {
|
|
2121
|
+
let normalized = normalize(path4);
|
|
2122
|
+
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
2123
|
+
return normalized;
|
|
2124
|
+
}
|
|
2125
|
+
__name(cleanPath, "cleanPath");
|
|
2126
|
+
var SLASHES_REGEX = /[\\/]/g;
|
|
2127
|
+
function convertSlashes(path4, separator) {
|
|
2128
|
+
return path4.replace(SLASHES_REGEX, separator);
|
|
2129
|
+
}
|
|
2130
|
+
__name(convertSlashes, "convertSlashes");
|
|
2131
|
+
var WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
2132
|
+
function isRootDirectory(path4) {
|
|
2133
|
+
return path4 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path4);
|
|
2134
|
+
}
|
|
2135
|
+
__name(isRootDirectory, "isRootDirectory");
|
|
2136
|
+
function normalizePath(path4, options) {
|
|
2137
|
+
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
|
2138
|
+
const pathNeedsCleaning = process.platform === "win32" && path4.includes("/") || path4.startsWith(".");
|
|
2139
|
+
if (resolvePaths) path4 = resolve(path4);
|
|
2140
|
+
if (normalizePath$1 || pathNeedsCleaning) path4 = cleanPath(path4);
|
|
2141
|
+
if (path4 === ".") return "";
|
|
2142
|
+
const needsSeperator = path4[path4.length - 1] !== pathSeparator;
|
|
2143
|
+
return convertSlashes(needsSeperator ? path4 + pathSeparator : path4, pathSeparator);
|
|
2144
|
+
}
|
|
2145
|
+
__name(normalizePath, "normalizePath");
|
|
2146
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
2147
|
+
return directoryPath + filename;
|
|
2148
|
+
}
|
|
2149
|
+
__name(joinPathWithBasePath, "joinPathWithBasePath");
|
|
2150
|
+
function joinPathWithRelativePath(root, options) {
|
|
2151
|
+
return function(filename, directoryPath) {
|
|
2152
|
+
const sameRoot = directoryPath.startsWith(root);
|
|
2153
|
+
if (sameRoot) return directoryPath.slice(root.length) + filename;
|
|
2154
|
+
else return convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
__name(joinPathWithRelativePath, "joinPathWithRelativePath");
|
|
2158
|
+
function joinPath(filename) {
|
|
2159
|
+
return filename;
|
|
2160
|
+
}
|
|
2161
|
+
__name(joinPath, "joinPath");
|
|
2162
|
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
2163
|
+
return directoryPath + filename + separator;
|
|
2164
|
+
}
|
|
2165
|
+
__name(joinDirectoryPath, "joinDirectoryPath");
|
|
2166
|
+
function build$7(root, options) {
|
|
2167
|
+
const { relativePaths, includeBasePath } = options;
|
|
2168
|
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
2169
|
+
}
|
|
2170
|
+
__name(build$7, "build$7");
|
|
2171
|
+
function pushDirectoryWithRelativePath(root) {
|
|
2172
|
+
return function(directoryPath, paths) {
|
|
2173
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
__name(pushDirectoryWithRelativePath, "pushDirectoryWithRelativePath");
|
|
2177
|
+
function pushDirectoryFilterWithRelativePath(root) {
|
|
2178
|
+
return function(directoryPath, paths, filters) {
|
|
2179
|
+
const relativePath = directoryPath.substring(root.length) || ".";
|
|
2180
|
+
if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
|
|
2181
|
+
};
|
|
2182
|
+
}
|
|
2183
|
+
__name(pushDirectoryFilterWithRelativePath, "pushDirectoryFilterWithRelativePath");
|
|
2184
|
+
var pushDirectory = /* @__PURE__ */ __name((directoryPath, paths) => {
|
|
2185
|
+
paths.push(directoryPath || ".");
|
|
2186
|
+
}, "pushDirectory");
|
|
2187
|
+
var pushDirectoryFilter = /* @__PURE__ */ __name((directoryPath, paths, filters) => {
|
|
2188
|
+
const path4 = directoryPath || ".";
|
|
2189
|
+
if (filters.every((filter) => filter(path4, true))) paths.push(path4);
|
|
2190
|
+
}, "pushDirectoryFilter");
|
|
2191
|
+
var empty$2 = /* @__PURE__ */ __name(() => {
|
|
2192
|
+
}, "empty$2");
|
|
2193
|
+
function build$6(root, options) {
|
|
2194
|
+
const { includeDirs, filters, relativePaths } = options;
|
|
2195
|
+
if (!includeDirs) return empty$2;
|
|
2196
|
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
2197
|
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
2198
|
+
}
|
|
2199
|
+
__name(build$6, "build$6");
|
|
2200
|
+
var pushFileFilterAndCount = /* @__PURE__ */ __name((filename, _paths, counts, filters) => {
|
|
2201
|
+
if (filters.every((filter) => filter(filename, false))) counts.files++;
|
|
2202
|
+
}, "pushFileFilterAndCount");
|
|
2203
|
+
var pushFileFilter = /* @__PURE__ */ __name((filename, paths, _counts, filters) => {
|
|
2204
|
+
if (filters.every((filter) => filter(filename, false))) paths.push(filename);
|
|
2205
|
+
}, "pushFileFilter");
|
|
2206
|
+
var pushFileCount = /* @__PURE__ */ __name((_filename, _paths, counts, _filters) => {
|
|
2207
|
+
counts.files++;
|
|
2208
|
+
}, "pushFileCount");
|
|
2209
|
+
var pushFile = /* @__PURE__ */ __name((filename, paths) => {
|
|
2210
|
+
paths.push(filename);
|
|
2211
|
+
}, "pushFile");
|
|
2212
|
+
var empty$1 = /* @__PURE__ */ __name(() => {
|
|
2213
|
+
}, "empty$1");
|
|
2214
|
+
function build$5(options) {
|
|
2215
|
+
const { excludeFiles, filters, onlyCounts } = options;
|
|
2216
|
+
if (excludeFiles) return empty$1;
|
|
2217
|
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
2218
|
+
else if (onlyCounts) return pushFileCount;
|
|
2219
|
+
else return pushFile;
|
|
2220
|
+
}
|
|
2221
|
+
__name(build$5, "build$5");
|
|
2222
|
+
var getArray = /* @__PURE__ */ __name((paths) => {
|
|
2223
|
+
return paths;
|
|
2224
|
+
}, "getArray");
|
|
2225
|
+
var getArrayGroup = /* @__PURE__ */ __name(() => {
|
|
2226
|
+
return [""].slice(0, 0);
|
|
2227
|
+
}, "getArrayGroup");
|
|
2228
|
+
function build$4(options) {
|
|
2229
|
+
return options.group ? getArrayGroup : getArray;
|
|
2230
|
+
}
|
|
2231
|
+
__name(build$4, "build$4");
|
|
2232
|
+
var groupFiles = /* @__PURE__ */ __name((groups, directory, files) => {
|
|
2233
|
+
groups.push({
|
|
2234
|
+
directory,
|
|
2235
|
+
files,
|
|
2236
|
+
dir: directory
|
|
2237
|
+
});
|
|
2238
|
+
}, "groupFiles");
|
|
2239
|
+
var empty = /* @__PURE__ */ __name(() => {
|
|
2240
|
+
}, "empty");
|
|
2241
|
+
function build$3(options) {
|
|
2242
|
+
return options.group ? groupFiles : empty;
|
|
2243
|
+
}
|
|
2244
|
+
__name(build$3, "build$3");
|
|
2245
|
+
var resolveSymlinksAsync = /* @__PURE__ */ __name(function(path4, state, callback$1) {
|
|
2246
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
2247
|
+
queue.enqueue();
|
|
2248
|
+
fs.realpath(path4, (error, resolvedPath) => {
|
|
2249
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
2250
|
+
fs.stat(resolvedPath, (error$1, stat) => {
|
|
2251
|
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
2252
|
+
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state)) return queue.dequeue(null, state);
|
|
2253
|
+
callback$1(stat, resolvedPath);
|
|
2254
|
+
queue.dequeue(null, state);
|
|
2255
|
+
});
|
|
2256
|
+
});
|
|
2257
|
+
}, "resolveSymlinksAsync");
|
|
2258
|
+
var resolveSymlinks = /* @__PURE__ */ __name(function(path4, state, callback$1) {
|
|
2259
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
2260
|
+
queue.enqueue();
|
|
2261
|
+
try {
|
|
2262
|
+
const resolvedPath = fs.realpathSync(path4);
|
|
2263
|
+
const stat = fs.statSync(resolvedPath);
|
|
2264
|
+
if (stat.isDirectory() && isRecursive(path4, resolvedPath, state)) return;
|
|
2265
|
+
callback$1(stat, resolvedPath);
|
|
2266
|
+
} catch (e) {
|
|
2267
|
+
if (!suppressErrors) throw e;
|
|
2268
|
+
}
|
|
2269
|
+
}, "resolveSymlinks");
|
|
2270
|
+
function build$2(options, isSynchronous) {
|
|
2271
|
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
2272
|
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
2273
|
+
}
|
|
2274
|
+
__name(build$2, "build$2");
|
|
2275
|
+
function isRecursive(path4, resolved, state) {
|
|
2276
|
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
2277
|
+
let parent = dirname(path4);
|
|
2278
|
+
let depth = 1;
|
|
2279
|
+
while (parent !== state.root && depth < 2) {
|
|
2280
|
+
const resolvedPath = state.symlinks.get(parent);
|
|
2281
|
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
2282
|
+
if (isSameRoot) depth++;
|
|
2283
|
+
else parent = dirname(parent);
|
|
2284
|
+
}
|
|
2285
|
+
state.symlinks.set(path4, resolved);
|
|
2286
|
+
return depth > 1;
|
|
2287
|
+
}
|
|
2288
|
+
__name(isRecursive, "isRecursive");
|
|
2289
|
+
function isRecursiveUsingRealPaths(resolved, state) {
|
|
2290
|
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
2291
|
+
}
|
|
2292
|
+
__name(isRecursiveUsingRealPaths, "isRecursiveUsingRealPaths");
|
|
2293
|
+
var onlyCountsSync = /* @__PURE__ */ __name((state) => {
|
|
2294
|
+
return state.counts;
|
|
2295
|
+
}, "onlyCountsSync");
|
|
2296
|
+
var groupsSync = /* @__PURE__ */ __name((state) => {
|
|
2297
|
+
return state.groups;
|
|
2298
|
+
}, "groupsSync");
|
|
2299
|
+
var defaultSync = /* @__PURE__ */ __name((state) => {
|
|
2300
|
+
return state.paths;
|
|
2301
|
+
}, "defaultSync");
|
|
2302
|
+
var limitFilesSync = /* @__PURE__ */ __name((state) => {
|
|
2303
|
+
return state.paths.slice(0, state.options.maxFiles);
|
|
2304
|
+
}, "limitFilesSync");
|
|
2305
|
+
var onlyCountsAsync = /* @__PURE__ */ __name((state, error, callback$1) => {
|
|
2306
|
+
report(error, callback$1, state.counts, state.options.suppressErrors);
|
|
2307
|
+
return null;
|
|
2308
|
+
}, "onlyCountsAsync");
|
|
2309
|
+
var defaultAsync = /* @__PURE__ */ __name((state, error, callback$1) => {
|
|
2310
|
+
report(error, callback$1, state.paths, state.options.suppressErrors);
|
|
2311
|
+
return null;
|
|
2312
|
+
}, "defaultAsync");
|
|
2313
|
+
var limitFilesAsync = /* @__PURE__ */ __name((state, error, callback$1) => {
|
|
2314
|
+
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
2315
|
+
return null;
|
|
2316
|
+
}, "limitFilesAsync");
|
|
2317
|
+
var groupsAsync = /* @__PURE__ */ __name((state, error, callback$1) => {
|
|
2318
|
+
report(error, callback$1, state.groups, state.options.suppressErrors);
|
|
2319
|
+
return null;
|
|
2320
|
+
}, "groupsAsync");
|
|
2321
|
+
function report(error, callback$1, output, suppressErrors) {
|
|
2322
|
+
if (error && !suppressErrors) callback$1(error, output);
|
|
2323
|
+
else callback$1(null, output);
|
|
2324
|
+
}
|
|
2325
|
+
__name(report, "report");
|
|
2326
|
+
function build$1(options, isSynchronous) {
|
|
2327
|
+
const { onlyCounts, group, maxFiles } = options;
|
|
2328
|
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
2329
|
+
else if (group) return isSynchronous ? groupsSync : groupsAsync;
|
|
2330
|
+
else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
2331
|
+
else return isSynchronous ? defaultSync : defaultAsync;
|
|
2332
|
+
}
|
|
2333
|
+
__name(build$1, "build$1");
|
|
2334
|
+
var readdirOpts = { withFileTypes: true };
|
|
2335
|
+
var walkAsync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
2336
|
+
state.queue.enqueue();
|
|
2337
|
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
2338
|
+
const { fs } = state;
|
|
2339
|
+
state.visited.push(crawlPath);
|
|
2340
|
+
state.counts.directories++;
|
|
2341
|
+
fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
|
2342
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
2343
|
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
2344
|
+
});
|
|
2345
|
+
}, "walkAsync");
|
|
2346
|
+
var walkSync = /* @__PURE__ */ __name((state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
|
2347
|
+
const { fs } = state;
|
|
2348
|
+
if (currentDepth < 0) return;
|
|
2349
|
+
state.visited.push(crawlPath);
|
|
2350
|
+
state.counts.directories++;
|
|
2351
|
+
let entries = [];
|
|
2352
|
+
try {
|
|
2353
|
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
2354
|
+
} catch (e) {
|
|
2355
|
+
if (!state.options.suppressErrors) throw e;
|
|
2356
|
+
}
|
|
2357
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
2358
|
+
}, "walkSync");
|
|
2359
|
+
function build(isSynchronous) {
|
|
2360
|
+
return isSynchronous ? walkSync : walkAsync;
|
|
2361
|
+
}
|
|
2362
|
+
__name(build, "build");
|
|
2363
|
+
var Queue = class {
|
|
2364
|
+
static {
|
|
2365
|
+
__name(this, "Queue");
|
|
2366
|
+
}
|
|
2367
|
+
count = 0;
|
|
2368
|
+
constructor(onQueueEmpty) {
|
|
2369
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
2370
|
+
}
|
|
2371
|
+
enqueue() {
|
|
2372
|
+
this.count++;
|
|
2373
|
+
return this.count;
|
|
2374
|
+
}
|
|
2375
|
+
dequeue(error, output) {
|
|
2376
|
+
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
|
2377
|
+
this.onQueueEmpty(error, output);
|
|
2378
|
+
if (error) {
|
|
2379
|
+
output.controller.abort();
|
|
2380
|
+
this.onQueueEmpty = void 0;
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2383
|
+
}
|
|
2384
|
+
};
|
|
2385
|
+
var Counter = class {
|
|
2386
|
+
static {
|
|
2387
|
+
__name(this, "Counter");
|
|
2388
|
+
}
|
|
2389
|
+
_files = 0;
|
|
2390
|
+
_directories = 0;
|
|
2391
|
+
set files(num) {
|
|
2392
|
+
this._files = num;
|
|
2393
|
+
}
|
|
2394
|
+
get files() {
|
|
2395
|
+
return this._files;
|
|
2396
|
+
}
|
|
2397
|
+
set directories(num) {
|
|
2398
|
+
this._directories = num;
|
|
2399
|
+
}
|
|
2400
|
+
get directories() {
|
|
2401
|
+
return this._directories;
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* @deprecated use `directories` instead
|
|
2405
|
+
*/
|
|
2406
|
+
/* c8 ignore next 3 */
|
|
2407
|
+
get dirs() {
|
|
2408
|
+
return this._directories;
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
var Aborter = class {
|
|
2412
|
+
static {
|
|
2413
|
+
__name(this, "Aborter");
|
|
2414
|
+
}
|
|
2415
|
+
aborted = false;
|
|
2416
|
+
abort() {
|
|
2417
|
+
this.aborted = true;
|
|
2418
|
+
}
|
|
2419
|
+
};
|
|
2420
|
+
var Walker = class {
|
|
2421
|
+
static {
|
|
2422
|
+
__name(this, "Walker");
|
|
2423
|
+
}
|
|
2424
|
+
root;
|
|
2425
|
+
isSynchronous;
|
|
2426
|
+
state;
|
|
2427
|
+
joinPath;
|
|
2428
|
+
pushDirectory;
|
|
2429
|
+
pushFile;
|
|
2430
|
+
getArray;
|
|
2431
|
+
groupFiles;
|
|
2432
|
+
resolveSymlink;
|
|
2433
|
+
walkDirectory;
|
|
2434
|
+
callbackInvoker;
|
|
2435
|
+
constructor(root, options, callback$1) {
|
|
2436
|
+
this.isSynchronous = !callback$1;
|
|
2437
|
+
this.callbackInvoker = build$1(options, this.isSynchronous);
|
|
2438
|
+
this.root = normalizePath(root, options);
|
|
2439
|
+
this.state = {
|
|
2440
|
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
2441
|
+
paths: [""].slice(0, 0),
|
|
2442
|
+
groups: [],
|
|
2443
|
+
counts: new Counter(),
|
|
2444
|
+
options,
|
|
2445
|
+
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
|
2446
|
+
symlinks: /* @__PURE__ */ new Map(),
|
|
2447
|
+
visited: [""].slice(0, 0),
|
|
2448
|
+
controller: new Aborter(),
|
|
2449
|
+
fs: options.fs || nativeFs
|
|
2450
|
+
};
|
|
2451
|
+
this.joinPath = build$7(this.root, options);
|
|
2452
|
+
this.pushDirectory = build$6(this.root, options);
|
|
2453
|
+
this.pushFile = build$5(options);
|
|
2454
|
+
this.getArray = build$4(options);
|
|
2455
|
+
this.groupFiles = build$3(options);
|
|
2456
|
+
this.resolveSymlink = build$2(options, this.isSynchronous);
|
|
2457
|
+
this.walkDirectory = build(this.isSynchronous);
|
|
2458
|
+
}
|
|
2459
|
+
start() {
|
|
2460
|
+
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
|
2461
|
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
2462
|
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
2463
|
+
}
|
|
2464
|
+
walk = /* @__PURE__ */ __name((entries, directoryPath, depth) => {
|
|
2465
|
+
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
2466
|
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
2467
|
+
const files = this.getArray(this.state.paths);
|
|
2468
|
+
for (let i = 0; i < entries.length; ++i) {
|
|
2469
|
+
const entry = entries[i];
|
|
2470
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
2471
|
+
const filename = this.joinPath(entry.name, directoryPath);
|
|
2472
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
2473
|
+
} else if (entry.isDirectory()) {
|
|
2474
|
+
let path4 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
2475
|
+
if (exclude && exclude(entry.name, path4)) continue;
|
|
2476
|
+
this.pushDirectory(path4, paths, filters);
|
|
2477
|
+
this.walkDirectory(this.state, path4, path4, depth - 1, this.walk);
|
|
2478
|
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
2479
|
+
let path4 = joinPathWithBasePath(entry.name, directoryPath);
|
|
2480
|
+
this.resolveSymlink(path4, this.state, (stat, resolvedPath) => {
|
|
2481
|
+
if (stat.isDirectory()) {
|
|
2482
|
+
resolvedPath = normalizePath(resolvedPath, this.state.options);
|
|
2483
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path4 + pathSeparator)) return;
|
|
2484
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path4 + pathSeparator, depth - 1, this.walk);
|
|
2485
|
+
} else {
|
|
2486
|
+
resolvedPath = useRealPaths ? resolvedPath : path4;
|
|
2487
|
+
const filename = basename(resolvedPath);
|
|
2488
|
+
const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
|
|
2489
|
+
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
2490
|
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
2491
|
+
}
|
|
2492
|
+
});
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
2496
|
+
}, "walk");
|
|
2497
|
+
};
|
|
2498
|
+
function promise(root, options) {
|
|
2499
|
+
return new Promise((resolve$1, reject) => {
|
|
2500
|
+
callback(root, options, (err, output) => {
|
|
2501
|
+
if (err) return reject(err);
|
|
2502
|
+
resolve$1(output);
|
|
2503
|
+
});
|
|
2504
|
+
});
|
|
2505
|
+
}
|
|
2506
|
+
__name(promise, "promise");
|
|
2507
|
+
function callback(root, options, callback$1) {
|
|
2508
|
+
let walker = new Walker(root, options, callback$1);
|
|
2509
|
+
walker.start();
|
|
2510
|
+
}
|
|
2511
|
+
__name(callback, "callback");
|
|
2512
|
+
function sync(root, options) {
|
|
2513
|
+
const walker = new Walker(root, options);
|
|
2514
|
+
return walker.start();
|
|
2515
|
+
}
|
|
2516
|
+
__name(sync, "sync");
|
|
2517
|
+
var APIBuilder = class {
|
|
2518
|
+
static {
|
|
2519
|
+
__name(this, "APIBuilder");
|
|
2520
|
+
}
|
|
2521
|
+
constructor(root, options) {
|
|
2522
|
+
this.root = root;
|
|
2523
|
+
this.options = options;
|
|
2524
|
+
}
|
|
2525
|
+
withPromise() {
|
|
2526
|
+
return promise(this.root, this.options);
|
|
2527
|
+
}
|
|
2528
|
+
withCallback(cb) {
|
|
2529
|
+
callback(this.root, this.options, cb);
|
|
2530
|
+
}
|
|
2531
|
+
sync() {
|
|
2532
|
+
return sync(this.root, this.options);
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
var pm = null;
|
|
2536
|
+
try {
|
|
2537
|
+
__require2.resolve("picomatch");
|
|
2538
|
+
pm = __require2("picomatch");
|
|
2539
|
+
} catch {
|
|
2540
|
+
}
|
|
2541
|
+
var Builder = class {
|
|
2542
|
+
static {
|
|
2543
|
+
__name(this, "Builder");
|
|
2544
|
+
}
|
|
2545
|
+
globCache = {};
|
|
2546
|
+
options = {
|
|
2547
|
+
maxDepth: Infinity,
|
|
2548
|
+
suppressErrors: true,
|
|
2549
|
+
pathSeparator: sep,
|
|
2550
|
+
filters: []
|
|
2551
|
+
};
|
|
2552
|
+
globFunction;
|
|
2553
|
+
constructor(options) {
|
|
2554
|
+
this.options = {
|
|
2555
|
+
...this.options,
|
|
2556
|
+
...options
|
|
2557
|
+
};
|
|
2558
|
+
this.globFunction = this.options.globFunction;
|
|
2559
|
+
}
|
|
2560
|
+
group() {
|
|
2561
|
+
this.options.group = true;
|
|
2562
|
+
return this;
|
|
2563
|
+
}
|
|
2564
|
+
withPathSeparator(separator) {
|
|
2565
|
+
this.options.pathSeparator = separator;
|
|
2566
|
+
return this;
|
|
2567
|
+
}
|
|
2568
|
+
withBasePath() {
|
|
2569
|
+
this.options.includeBasePath = true;
|
|
2570
|
+
return this;
|
|
2571
|
+
}
|
|
2572
|
+
withRelativePaths() {
|
|
2573
|
+
this.options.relativePaths = true;
|
|
2574
|
+
return this;
|
|
2575
|
+
}
|
|
2576
|
+
withDirs() {
|
|
2577
|
+
this.options.includeDirs = true;
|
|
2578
|
+
return this;
|
|
2579
|
+
}
|
|
2580
|
+
withMaxDepth(depth) {
|
|
2581
|
+
this.options.maxDepth = depth;
|
|
2582
|
+
return this;
|
|
2583
|
+
}
|
|
2584
|
+
withMaxFiles(limit) {
|
|
2585
|
+
this.options.maxFiles = limit;
|
|
2586
|
+
return this;
|
|
2587
|
+
}
|
|
2588
|
+
withFullPaths() {
|
|
2589
|
+
this.options.resolvePaths = true;
|
|
2590
|
+
this.options.includeBasePath = true;
|
|
2591
|
+
return this;
|
|
2592
|
+
}
|
|
2593
|
+
withErrors() {
|
|
2594
|
+
this.options.suppressErrors = false;
|
|
2595
|
+
return this;
|
|
2596
|
+
}
|
|
2597
|
+
withSymlinks({ resolvePaths = true } = {}) {
|
|
2598
|
+
this.options.resolveSymlinks = true;
|
|
2599
|
+
this.options.useRealPaths = resolvePaths;
|
|
2600
|
+
return this.withFullPaths();
|
|
2601
|
+
}
|
|
2602
|
+
withAbortSignal(signal) {
|
|
2603
|
+
this.options.signal = signal;
|
|
2604
|
+
return this;
|
|
2605
|
+
}
|
|
2606
|
+
normalize() {
|
|
2607
|
+
this.options.normalizePath = true;
|
|
2608
|
+
return this;
|
|
2609
|
+
}
|
|
2610
|
+
filter(predicate) {
|
|
2611
|
+
this.options.filters.push(predicate);
|
|
2612
|
+
return this;
|
|
2613
|
+
}
|
|
2614
|
+
onlyDirs() {
|
|
2615
|
+
this.options.excludeFiles = true;
|
|
2616
|
+
this.options.includeDirs = true;
|
|
2617
|
+
return this;
|
|
2618
|
+
}
|
|
2619
|
+
exclude(predicate) {
|
|
2620
|
+
this.options.exclude = predicate;
|
|
2621
|
+
return this;
|
|
2622
|
+
}
|
|
2623
|
+
onlyCounts() {
|
|
2624
|
+
this.options.onlyCounts = true;
|
|
2625
|
+
return this;
|
|
2626
|
+
}
|
|
2627
|
+
crawl(root) {
|
|
2628
|
+
return new APIBuilder(root || ".", this.options);
|
|
2629
|
+
}
|
|
2630
|
+
withGlobFunction(fn) {
|
|
2631
|
+
this.globFunction = fn;
|
|
2632
|
+
return this;
|
|
2633
|
+
}
|
|
2634
|
+
/**
|
|
2635
|
+
* @deprecated Pass options using the constructor instead:
|
|
2636
|
+
* ```ts
|
|
2637
|
+
* new fdir(options).crawl("/path/to/root");
|
|
2638
|
+
* ```
|
|
2639
|
+
* This method will be removed in v7.0
|
|
2640
|
+
*/
|
|
2641
|
+
/* c8 ignore next 4 */
|
|
2642
|
+
crawlWithOptions(root, options) {
|
|
2643
|
+
this.options = {
|
|
2644
|
+
...this.options,
|
|
2645
|
+
...options
|
|
2646
|
+
};
|
|
2647
|
+
return new APIBuilder(root || ".", this.options);
|
|
2648
|
+
}
|
|
2649
|
+
glob(...patterns) {
|
|
2650
|
+
if (this.globFunction) return this.globWithOptions(patterns);
|
|
2651
|
+
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
|
2652
|
+
}
|
|
2653
|
+
globWithOptions(patterns, ...options) {
|
|
2654
|
+
const globFn = this.globFunction || pm;
|
|
2655
|
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
2656
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
2657
|
+
if (!isMatch) {
|
|
2658
|
+
isMatch = globFn(patterns, ...options);
|
|
2659
|
+
this.globCache[patterns.join("\0")] = isMatch;
|
|
2660
|
+
}
|
|
2661
|
+
this.options.filters.push((path4) => isMatch(path4));
|
|
2662
|
+
return this;
|
|
2663
|
+
}
|
|
2664
|
+
};
|
|
2665
|
+
|
|
2666
|
+
// ../node_modules/tinyglobby/dist/index.mjs
|
|
2667
|
+
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
2668
|
+
var isReadonlyArray = Array.isArray;
|
|
2669
|
+
var isWin = process.platform === "win32";
|
|
2947
2670
|
var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
2948
|
-
function getPartialMatcher(patterns, options) {
|
|
2671
|
+
function getPartialMatcher(patterns, options = {}) {
|
|
2949
2672
|
const patternsCount = patterns.length;
|
|
2950
2673
|
const patternsParts = Array(patternsCount);
|
|
2951
|
-
const
|
|
2674
|
+
const matchers = Array(patternsCount);
|
|
2675
|
+
const globstarEnabled = !options.noglobstar;
|
|
2952
2676
|
for (let i = 0; i < patternsCount; i++) {
|
|
2953
2677
|
const parts = splitPattern(patterns[i]);
|
|
2954
2678
|
patternsParts[i] = parts;
|
|
2955
2679
|
const partsCount = parts.length;
|
|
2956
|
-
const
|
|
2957
|
-
for (let j = 0; j < partsCount; j++)
|
|
2958
|
-
|
|
2680
|
+
const partMatchers = Array(partsCount);
|
|
2681
|
+
for (let j = 0; j < partsCount; j++) partMatchers[j] = (0, import_picomatch.default)(parts[j], options);
|
|
2682
|
+
matchers[i] = partMatchers;
|
|
2959
2683
|
}
|
|
2960
2684
|
return (input) => {
|
|
2961
2685
|
const inputParts = input.split("/");
|
|
2962
2686
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
2963
2687
|
for (let i = 0; i < patterns.length; i++) {
|
|
2964
2688
|
const patternParts = patternsParts[i];
|
|
2965
|
-
const
|
|
2689
|
+
const matcher = matchers[i];
|
|
2966
2690
|
const inputPatternCount = inputParts.length;
|
|
2967
2691
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
2968
2692
|
let j = 0;
|
|
2969
2693
|
while (j < minParts) {
|
|
2970
2694
|
const part = patternParts[j];
|
|
2971
2695
|
if (part.includes("/")) return true;
|
|
2972
|
-
const match =
|
|
2696
|
+
const match = matcher[j](inputParts[j]);
|
|
2973
2697
|
if (!match) break;
|
|
2974
|
-
if (part === "**") return true;
|
|
2698
|
+
if (globstarEnabled && part === "**") return true;
|
|
2975
2699
|
j++;
|
|
2976
2700
|
}
|
|
2977
2701
|
if (j === inputPatternCount) return true;
|
|
@@ -2980,6 +2704,38 @@ function getPartialMatcher(patterns, options) {
|
|
|
2980
2704
|
};
|
|
2981
2705
|
}
|
|
2982
2706
|
__name(getPartialMatcher, "getPartialMatcher");
|
|
2707
|
+
var WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
2708
|
+
var isRoot = isWin ? (p) => WIN32_ROOT_DIR.test(p) : (p) => p === "/";
|
|
2709
|
+
function buildFormat(cwd, root, absolute) {
|
|
2710
|
+
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
2711
|
+
if (absolute) {
|
|
2712
|
+
const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
2713
|
+
return (p, isDir) => p.slice(start, isDir ? -1 : void 0) || ".";
|
|
2714
|
+
}
|
|
2715
|
+
const prefix = root.slice(cwd.length + 1);
|
|
2716
|
+
if (prefix) return (p, isDir) => {
|
|
2717
|
+
if (p === ".") return prefix;
|
|
2718
|
+
const result = `${prefix}/${p}`;
|
|
2719
|
+
return isDir ? result.slice(0, -1) : result;
|
|
2720
|
+
};
|
|
2721
|
+
return (p, isDir) => isDir && p !== "." ? p.slice(0, -1) : p;
|
|
2722
|
+
}
|
|
2723
|
+
if (absolute) return (p) => posix.relative(cwd, p) || ".";
|
|
2724
|
+
return (p) => posix.relative(cwd, `${root}/${p}`) || ".";
|
|
2725
|
+
}
|
|
2726
|
+
__name(buildFormat, "buildFormat");
|
|
2727
|
+
function buildRelative(cwd, root) {
|
|
2728
|
+
if (root.startsWith(`${cwd}/`)) {
|
|
2729
|
+
const prefix = root.slice(cwd.length + 1);
|
|
2730
|
+
return (p) => `${prefix}/${p}`;
|
|
2731
|
+
}
|
|
2732
|
+
return (p) => {
|
|
2733
|
+
const result = posix.relative(cwd, `${root}/${p}`);
|
|
2734
|
+
if (p.endsWith("/") && result !== "") return `${result}/`;
|
|
2735
|
+
return result || ".";
|
|
2736
|
+
};
|
|
2737
|
+
}
|
|
2738
|
+
__name(buildRelative, "buildRelative");
|
|
2983
2739
|
var splitPatternOptions = { parts: true };
|
|
2984
2740
|
function splitPattern(path$1) {
|
|
2985
2741
|
var _result$parts;
|
|
@@ -2987,7 +2743,6 @@ function splitPattern(path$1) {
|
|
|
2987
2743
|
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
2988
2744
|
}
|
|
2989
2745
|
__name(splitPattern, "splitPattern");
|
|
2990
|
-
var isWin = process.platform === "win32";
|
|
2991
2746
|
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
2992
2747
|
var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
2993
2748
|
var escapePosixPath = /* @__PURE__ */ __name((path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), "escapePosixPath");
|
|
@@ -3045,14 +2800,13 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
3045
2800
|
}
|
|
3046
2801
|
props.depthOffset = newCommonPath.length;
|
|
3047
2802
|
props.commonPath = newCommonPath;
|
|
3048
|
-
props.root = newCommonPath.length > 0 ?
|
|
2803
|
+
props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
|
|
3049
2804
|
}
|
|
3050
2805
|
return result;
|
|
3051
2806
|
}
|
|
3052
2807
|
__name(normalizePattern, "normalizePattern");
|
|
3053
|
-
function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
|
|
2808
|
+
function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories = true }, cwd, props) {
|
|
3054
2809
|
if (typeof patterns === "string") patterns = [patterns];
|
|
3055
|
-
else if (!patterns) patterns = ["**/*"];
|
|
3056
2810
|
if (typeof ignore === "string") ignore = [ignore];
|
|
3057
2811
|
const matchPatterns = [];
|
|
3058
2812
|
const ignorePatterns = [];
|
|
@@ -3071,69 +2825,90 @@ function processPatterns({ patterns, ignore = [], expandDirectories = true }, cw
|
|
|
3071
2825
|
};
|
|
3072
2826
|
}
|
|
3073
2827
|
__name(processPatterns, "processPatterns");
|
|
3074
|
-
function
|
|
3075
|
-
return posix.relative(cwd, `${root}/${path$1}`) || ".";
|
|
3076
|
-
}
|
|
3077
|
-
__name(getRelativePath, "getRelativePath");
|
|
3078
|
-
function processPath(path$1, cwd, root, isDirectory, absolute) {
|
|
3079
|
-
const relativePath = absolute ? path$1.slice(root === "/" ? 1 : root.length + 1) || "." : path$1;
|
|
3080
|
-
if (root === cwd) return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
|
|
3081
|
-
return getRelativePath(relativePath, cwd, root);
|
|
3082
|
-
}
|
|
3083
|
-
__name(processPath, "processPath");
|
|
3084
|
-
function formatPaths(paths, cwd, root) {
|
|
2828
|
+
function formatPaths(paths, relative3) {
|
|
3085
2829
|
for (let i = paths.length - 1; i >= 0; i--) {
|
|
3086
2830
|
const path$1 = paths[i];
|
|
3087
|
-
paths[i] =
|
|
2831
|
+
paths[i] = relative3(path$1);
|
|
3088
2832
|
}
|
|
3089
2833
|
return paths;
|
|
3090
2834
|
}
|
|
3091
2835
|
__name(formatPaths, "formatPaths");
|
|
3092
|
-
function
|
|
3093
|
-
if (process.
|
|
3094
|
-
if (
|
|
3095
|
-
|
|
2836
|
+
function normalizeCwd(cwd) {
|
|
2837
|
+
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
2838
|
+
if (cwd instanceof URL) return fileURLToPath(cwd).replace(BACKSLASHES, "/");
|
|
2839
|
+
return path.resolve(cwd).replace(BACKSLASHES, "/");
|
|
2840
|
+
}
|
|
2841
|
+
__name(normalizeCwd, "normalizeCwd");
|
|
2842
|
+
function getCrawler(patterns, inputOptions = {}) {
|
|
2843
|
+
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
2844
|
+
...inputOptions,
|
|
2845
|
+
debug: true
|
|
2846
|
+
} : inputOptions;
|
|
2847
|
+
const cwd = normalizeCwd(options.cwd);
|
|
2848
|
+
if (options.debug) log("globbing with:", {
|
|
2849
|
+
patterns,
|
|
2850
|
+
options,
|
|
2851
|
+
cwd
|
|
2852
|
+
});
|
|
2853
|
+
if (Array.isArray(patterns) && patterns.length === 0) return [{
|
|
2854
|
+
sync: /* @__PURE__ */ __name(() => [], "sync"),
|
|
2855
|
+
withPromise: /* @__PURE__ */ __name(async () => [], "withPromise")
|
|
2856
|
+
}, false];
|
|
3096
2857
|
const props = {
|
|
3097
2858
|
root: cwd,
|
|
3098
2859
|
commonPath: null,
|
|
3099
2860
|
depthOffset: 0
|
|
3100
2861
|
};
|
|
3101
|
-
const processed = processPatterns(
|
|
3102
|
-
|
|
2862
|
+
const processed = processPatterns({
|
|
2863
|
+
...options,
|
|
2864
|
+
patterns
|
|
2865
|
+
}, cwd, props);
|
|
3103
2866
|
if (options.debug) log("internal processing patterns:", processed);
|
|
3104
|
-
const
|
|
2867
|
+
const matchOptions = {
|
|
3105
2868
|
dot: options.dot,
|
|
3106
|
-
|
|
2869
|
+
nobrace: options.braceExpansion === false,
|
|
2870
|
+
nocase: options.caseSensitiveMatch === false,
|
|
2871
|
+
noextglob: options.extglob === false,
|
|
2872
|
+
noglobstar: options.globstar === false,
|
|
2873
|
+
posix: true
|
|
2874
|
+
};
|
|
2875
|
+
const matcher = (0, import_picomatch.default)(processed.match, {
|
|
2876
|
+
...matchOptions,
|
|
3107
2877
|
ignore: processed.ignore
|
|
3108
2878
|
});
|
|
3109
|
-
const ignore = (0, import_picomatch.default)(processed.ignore,
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
const partialMatcher = getPartialMatcher(processed.match, {
|
|
3114
|
-
dot: options.dot,
|
|
3115
|
-
nocase
|
|
3116
|
-
});
|
|
2879
|
+
const ignore = (0, import_picomatch.default)(processed.ignore, matchOptions);
|
|
2880
|
+
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
2881
|
+
const format = buildFormat(cwd, props.root, options.absolute);
|
|
2882
|
+
const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
|
|
3117
2883
|
const fdirOptions = {
|
|
3118
2884
|
filters: [options.debug ? (p, isDirectory) => {
|
|
3119
|
-
const path$1 =
|
|
2885
|
+
const path$1 = format(p, isDirectory);
|
|
3120
2886
|
const matches = matcher(path$1);
|
|
3121
2887
|
if (matches) log(`matched ${path$1}`);
|
|
3122
2888
|
return matches;
|
|
3123
|
-
} : (p, isDirectory) => matcher(
|
|
2889
|
+
} : (p, isDirectory) => matcher(format(p, isDirectory))],
|
|
3124
2890
|
exclude: options.debug ? (_, p) => {
|
|
3125
|
-
const relativePath =
|
|
2891
|
+
const relativePath = formatExclude(p, true);
|
|
3126
2892
|
const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3127
2893
|
if (skipped) log(`skipped ${p}`);
|
|
3128
2894
|
else log(`crawling ${p}`);
|
|
3129
2895
|
return skipped;
|
|
3130
2896
|
} : (_, p) => {
|
|
3131
|
-
const relativePath =
|
|
2897
|
+
const relativePath = formatExclude(p, true);
|
|
3132
2898
|
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3133
2899
|
},
|
|
2900
|
+
fs: options.fs ? {
|
|
2901
|
+
readdir: options.fs.readdir || nativeFs2.readdir,
|
|
2902
|
+
readdirSync: options.fs.readdirSync || nativeFs2.readdirSync,
|
|
2903
|
+
realpath: options.fs.realpath || nativeFs2.realpath,
|
|
2904
|
+
realpathSync: options.fs.realpathSync || nativeFs2.realpathSync,
|
|
2905
|
+
stat: options.fs.stat || nativeFs2.stat,
|
|
2906
|
+
statSync: options.fs.statSync || nativeFs2.statSync
|
|
2907
|
+
} : void 0,
|
|
3134
2908
|
pathSeparator: "/",
|
|
3135
2909
|
relativePaths: true,
|
|
3136
|
-
resolveSymlinks: true
|
|
2910
|
+
resolveSymlinks: true,
|
|
2911
|
+
signal: options.signal
|
|
3137
2912
|
};
|
|
3138
2913
|
if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
3139
2914
|
if (options.absolute) {
|
|
@@ -3152,19 +2927,18 @@ function crawl(options, cwd, sync) {
|
|
|
3152
2927
|
props.root = props.root.replace(BACKSLASHES, "");
|
|
3153
2928
|
const root = props.root;
|
|
3154
2929
|
if (options.debug) log("internal properties:", props);
|
|
3155
|
-
const
|
|
3156
|
-
|
|
3157
|
-
return sync ? formatPaths(api.sync(), cwd, root) : api.withPromise().then((paths) => formatPaths(paths, cwd, root));
|
|
2930
|
+
const relative3 = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
|
|
2931
|
+
return [new Builder(fdirOptions).crawl(root), relative3];
|
|
3158
2932
|
}
|
|
3159
|
-
__name(
|
|
2933
|
+
__name(getCrawler, "getCrawler");
|
|
3160
2934
|
function globSync(patternsOrOptions, options) {
|
|
3161
2935
|
if (patternsOrOptions && (options === null || options === void 0 ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
return
|
|
2936
|
+
const isModern = isReadonlyArray(patternsOrOptions) || typeof patternsOrOptions === "string";
|
|
2937
|
+
const opts = isModern ? options : patternsOrOptions;
|
|
2938
|
+
const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
|
|
2939
|
+
const [crawler, relative3] = getCrawler(patterns, opts);
|
|
2940
|
+
if (!relative3) return crawler.sync();
|
|
2941
|
+
return formatPaths(crawler.sync(), relative3);
|
|
3168
2942
|
}
|
|
3169
2943
|
__name(globSync, "globSync");
|
|
3170
2944
|
|
|
@@ -3214,8 +2988,8 @@ error searching for lock file: ${e}
|
|
|
3214
2988
|
`);
|
|
3215
2989
|
}
|
|
3216
2990
|
try {
|
|
3217
|
-
const [basePath, rest] = __dirname.split(`${
|
|
3218
|
-
if (rest && !basePath.includes(`${
|
|
2991
|
+
const [basePath, rest] = __dirname.split(`${sep2}node_modules${sep2}`, 2);
|
|
2992
|
+
if (rest && !basePath.includes(`${sep2}npm-cache${sep2}`) && !relative2(basePath, process.cwd()).startsWith("..")) {
|
|
3219
2993
|
projectRoot = basePath;
|
|
3220
2994
|
return projectRoot;
|
|
3221
2995
|
}
|
|
@@ -3237,19 +3011,19 @@ var findFilesUp = /* @__PURE__ */ __name((matchers, baseDir = process.cwd()) =>
|
|
|
3237
3011
|
}
|
|
3238
3012
|
return matchingFiles;
|
|
3239
3013
|
}, "findFilesUp");
|
|
3240
|
-
var nodePathsToArray = /* @__PURE__ */ __name((nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) =>
|
|
3014
|
+
var nodePathsToArray = /* @__PURE__ */ __name((nodePath) => nodePath.split(process.platform === "win32" ? ";" : ":").filter(Boolean).map((p) => resolve2("./", p)), "nodePathsToArray");
|
|
3241
3015
|
var relativePattern = /^\.{1,2}([/\\]|$)/;
|
|
3242
3016
|
function normalizeStoryPath(filename) {
|
|
3243
3017
|
if (relativePattern.test(filename)) {
|
|
3244
3018
|
return filename;
|
|
3245
3019
|
}
|
|
3246
|
-
return `.${
|
|
3020
|
+
return `.${sep2}${filename}`;
|
|
3247
3021
|
}
|
|
3248
3022
|
__name(normalizeStoryPath, "normalizeStoryPath");
|
|
3249
3023
|
|
|
3250
3024
|
// src/common/utils/envs.ts
|
|
3251
3025
|
async function loadEnvs(options = {}) {
|
|
3252
|
-
const { getEnvironment } = await import("./lib-
|
|
3026
|
+
const { getEnvironment } = await import("./lib-IT6OBSID.js");
|
|
3253
3027
|
const defaultNodeEnv = options.production ? "production" : "development";
|
|
3254
3028
|
const env = {
|
|
3255
3029
|
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
@@ -3330,7 +3104,7 @@ __name(stripFinalNewline, "stripFinalNewline");
|
|
|
3330
3104
|
// node_modules/npm-run-path/index.js
|
|
3331
3105
|
import process2 from "node:process";
|
|
3332
3106
|
import path2 from "node:path";
|
|
3333
|
-
import { fileURLToPath } from "node:url";
|
|
3107
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3334
3108
|
|
|
3335
3109
|
// node_modules/path-key/index.js
|
|
3336
3110
|
function pathKey(options = {}) {
|
|
@@ -3353,7 +3127,7 @@ var npmRunPath = /* @__PURE__ */ __name(({
|
|
|
3353
3127
|
execPath = process2.execPath,
|
|
3354
3128
|
addExecPath = true
|
|
3355
3129
|
} = {}) => {
|
|
3356
|
-
const cwdString = cwd instanceof URL ?
|
|
3130
|
+
const cwdString = cwd instanceof URL ? fileURLToPath2(cwd) : cwd;
|
|
3357
3131
|
const cwdPath = path2.resolve(cwdString);
|
|
3358
3132
|
const result = [];
|
|
3359
3133
|
if (preferLocal) {
|
|
@@ -3373,7 +3147,7 @@ var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
|
|
|
3373
3147
|
}
|
|
3374
3148
|
}, "applyPreferLocal");
|
|
3375
3149
|
var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
|
|
3376
|
-
const execPathString = execPath instanceof URL ?
|
|
3150
|
+
const execPathString = execPath instanceof URL ? fileURLToPath2(execPath) : execPath;
|
|
3377
3151
|
result.push(path2.resolve(cwdPath, execPathString, ".."));
|
|
3378
3152
|
}, "applyExecPath");
|
|
3379
3153
|
var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
|
|
@@ -4237,7 +4011,7 @@ var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIG
|
|
|
4237
4011
|
return spawnedPromise;
|
|
4238
4012
|
}
|
|
4239
4013
|
let timeoutId;
|
|
4240
|
-
const timeoutPromise = new Promise((
|
|
4014
|
+
const timeoutPromise = new Promise((resolve3, reject) => {
|
|
4241
4015
|
timeoutId = setTimeout(() => {
|
|
4242
4016
|
timeoutKill(spawned, killSignal, reject);
|
|
4243
4017
|
}, timeout);
|
|
@@ -4605,15 +4379,15 @@ var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
|
4605
4379
|
property,
|
|
4606
4380
|
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
4607
4381
|
]);
|
|
4608
|
-
var mergePromise = /* @__PURE__ */ __name((spawned,
|
|
4382
|
+
var mergePromise = /* @__PURE__ */ __name((spawned, promise2) => {
|
|
4609
4383
|
for (const [property, descriptor] of descriptors) {
|
|
4610
|
-
const value = typeof
|
|
4384
|
+
const value = typeof promise2 === "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
|
|
4611
4385
|
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
4612
4386
|
}
|
|
4613
4387
|
}, "mergePromise");
|
|
4614
|
-
var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((
|
|
4388
|
+
var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve3, reject) => {
|
|
4615
4389
|
spawned.on("exit", (exitCode, signal) => {
|
|
4616
|
-
|
|
4390
|
+
resolve3({ exitCode, signal });
|
|
4617
4391
|
});
|
|
4618
4392
|
spawned.on("error", (error) => {
|
|
4619
4393
|
reject(error);
|