storybook 10.0.0-beta.4 → 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/Color-KPLIACXP.js +1569 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-YY5GICNT.js → chunk-6E2SHJSL.js} +175 -32
- package/dist/_browser-chunks/{chunk-MZNYTCNT.js → chunk-AM4PZYVQ.js} +10 -63
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YWDKX534.js → chunk-FA42P6MO.js} +49 -4
- package/dist/_browser-chunks/chunk-G33S6YM3.js +521 -0
- package/dist/_browser-chunks/chunk-GJ67EE65.js +67 -0
- package/dist/_browser-chunks/{chunk-4QPX7WIQ.js → chunk-JJZMHC3A.js} +57 -166
- package/dist/_browser-chunks/{chunk-MD2FTHCZ.js → chunk-JVSKG4YS.js} +3 -16
- package/dist/_browser-chunks/{chunk-E7VLET3C.js → chunk-KSCAWCCE.js} +3947 -4291
- package/dist/_browser-chunks/chunk-QK3L5AXO.js +372 -0
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +20 -0
- package/dist/_browser-chunks/{chunk-T7RCAJIX.js → chunk-Y3M7TW6K.js} +43 -47
- package/dist/_browser-chunks/{chunk-PYK5ZTFK.js → chunk-YQV3EGQ5.js} +5 -5
- package/dist/_browser-chunks/{syntaxhighlighter-YYAA4CS4.js → syntaxhighlighter-RJW7FE3A.js} +3 -2
- package/dist/_node-chunks/{builder-manager-IKHPPPFE.js → builder-manager-V33CQT2M.js} +26 -151
- package/dist/_node-chunks/camelcase-BZ55OCHI.js +18 -0
- package/dist/_node-chunks/{chunk-5OILJTZE.js → chunk-2DMFI367.js} +7 -7
- package/dist/_node-chunks/{chunk-DCHFG5TX.js → chunk-4TOI4VSK.js} +7 -7
- package/dist/_node-chunks/{chunk-XA4TAMUS.js → chunk-55VWKF63.js} +710 -935
- package/dist/_node-chunks/{chunk-N3GFXZDP.js → chunk-5IEY46LQ.js} +7 -7
- package/dist/_node-chunks/{chunk-YRPXGWKW.js → chunk-6PTV7XGR.js} +8 -8
- package/dist/_node-chunks/{chunk-4FMOVB65.js → chunk-7NJGTQ3W.js} +223 -243
- package/dist/_node-chunks/{chunk-4VGW2SQA.js → chunk-7WH7AGOR.js} +7 -7
- package/dist/_node-chunks/{camelcase-O2O7JODG.js → chunk-A7CUP23N.js} +9 -8
- package/dist/_node-chunks/{chunk-XT6O5CVI.js → chunk-B3AMFGAL.js} +30 -21
- package/dist/_node-chunks/{chunk-IB5AEYPX.js → chunk-BNOZ3EKF.js} +7 -7
- package/dist/_node-chunks/{chunk-TTQRDWDJ.js → chunk-DC7OWBHB.js} +12 -12
- package/dist/_node-chunks/{chunk-3J7DQ6TI.js → chunk-E6TLN2J2.js} +7 -7
- package/dist/_node-chunks/{chunk-JP4LEAXM.js → chunk-EAOPWIKA.js} +623 -750
- package/dist/_node-chunks/{chunk-YJHXEN7U.js → chunk-EY5PTUZL.js} +583 -180
- package/dist/_node-chunks/{chunk-JSSBBVU5.js → chunk-F3PO67U3.js} +7 -7
- package/dist/_node-chunks/chunk-FDDJHDCE.js +62 -0
- package/dist/_node-chunks/{chunk-6COBULLV.js → chunk-HEBHWRWL.js} +162 -103
- package/dist/_node-chunks/{chunk-USDZSU5L.js → chunk-HPFXREVG.js} +7 -7
- package/dist/_node-chunks/{chunk-JECCFKKM.js → chunk-IINJT47N.js} +7 -7
- package/dist/_node-chunks/{chunk-OL2HWCBH.js → chunk-JNHUDBJL.js} +7 -7
- package/dist/_node-chunks/{chunk-NF3GXIEK.js → chunk-JOXYGIZK.js} +9 -9
- package/dist/_node-chunks/{chunk-NOSGJ5PL.js → chunk-MLBTKECD.js} +7 -7
- package/dist/_node-chunks/{chunk-TYGVOW7L.js → chunk-NJXBURX7.js} +8 -8
- package/dist/_node-chunks/{chunk-AXFNB3AN.js → chunk-NKZ4UPPV.js} +7 -7
- package/dist/_node-chunks/{chunk-HAVE6SGK.js → chunk-NUVGSFQI.js} +7 -7
- package/dist/_node-chunks/chunk-R5DIBOM6.js +18 -0
- package/dist/_node-chunks/{chunk-AC3BNULF.js → chunk-RIPA4LFD.js} +22 -22
- package/dist/_node-chunks/{chunk-TBAIXCHN.js → chunk-TJIMCNYJ.js} +8 -8
- package/dist/_node-chunks/{chunk-SF2IETZ2.js → chunk-UYKQJMQY.js} +36 -23
- package/dist/_node-chunks/{chunk-7IIAUEWB.js → chunk-VQH4ZFTS.js} +8 -8
- package/dist/_node-chunks/{chunk-FWFQ2GU7.js → chunk-VSC6LSCQ.js} +6 -6
- package/dist/_node-chunks/{chunk-MOO2Y4GI.js → chunk-XZTBG2TG.js} +6 -6
- package/dist/_node-chunks/{dist-BMKSKYDI.js → dist-CGGAYWME.js} +9 -9
- package/dist/_node-chunks/{globby-DASPUXWI.js → globby-3IFB7BJC.js} +17 -13
- package/dist/_node-chunks/{lib-L6BIH4EV.js → lib-IT6OBSID.js} +36 -12
- package/dist/_node-chunks/{mdx-N42X6CFJ-2COTUDSL.js → mdx-N42X6CFJ-WM36SSZ6.js} +8 -8
- package/dist/_node-chunks/{p-limit-HVR3I7TJ.js → p-limit-3V5XIKA7.js} +7 -7
- package/dist/_node-chunks/{plugin-FZOHPRK7.js → plugin-3YREMMJJ.js} +10 -10
- package/dist/_node-chunks/{plugin-2XPSFYWZ.js → plugin-GJUBUKCT.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-FGQM2EPC.js → webpack-inject-mocker-runtime-plugin-DCJQFJQ5.js} +1307 -847
- package/dist/_node-chunks/{webpack-mock-plugin-4HOAIYSX.js → webpack-mock-plugin-XJNFAHBI.js} +9 -9
- package/dist/babel/index.d.ts +1 -1
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +638 -187
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +8 -8
- package/dist/cli/index.d.ts +61 -74
- package/dist/cli/index.js +56 -44
- package/dist/common/index.js +21 -21
- package/dist/components/index.js +27 -23
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.js +4545 -4115
- package/dist/core-server/presets/common-manager.js +507 -747
- 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/index.js +6 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +4 -4
- package/dist/instrumenter/index.js +1 -1
- package/dist/manager/globals-runtime.js +9164 -18083
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +12967 -11396
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +303 -64
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +1136 -661
- package/dist/preview/runtime.js +12068 -21585
- package/dist/preview-api/index.d.ts +68 -67
- package/dist/preview-api/index.js +6 -6
- package/dist/router/index.js +2 -2
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +1872 -4023
- package/dist/theming/index.d.ts +2 -2
- package/dist/theming/index.js +6 -6
- package/dist/types/index.d.ts +4 -0
- package/package.json +7 -6
- package/dist/_browser-chunks/Color-SFYJJKWL.js +0 -605
- package/dist/_browser-chunks/chunk-DHO2SA6L.js +0 -12
- package/dist/_browser-chunks/chunk-WPHPDNUA.js +0 -974
- package/dist/_node-chunks/chunk-CHJLO2LV.js +0 -62
- package/dist/_node-chunks/chunk-MNG223PY.js +0 -18
- package/dist/_node-chunks/default-browser-id-J4OIAAJ5.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({
|
|
@@ -759,6 +104,7 @@ var require_constants = __commonJS({
|
|
|
759
104
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
760
105
|
// Replace globs with equivalent patterns to reduce parsing time.
|
|
761
106
|
REPLACEMENTS: {
|
|
107
|
+
__proto__: null,
|
|
762
108
|
"***": "*",
|
|
763
109
|
"**/**": "**",
|
|
764
110
|
"**/**/**": "**"
|
|
@@ -875,7 +221,7 @@ var require_constants = __commonJS({
|
|
|
875
221
|
});
|
|
876
222
|
|
|
877
223
|
// ../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js
|
|
878
|
-
var
|
|
224
|
+
var require_utils = __commonJS({
|
|
879
225
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports) {
|
|
880
226
|
"use strict";
|
|
881
227
|
var {
|
|
@@ -942,7 +288,7 @@ var require_utils2 = __commonJS({
|
|
|
942
288
|
var require_scan = __commonJS({
|
|
943
289
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js"(exports, module) {
|
|
944
290
|
"use strict";
|
|
945
|
-
var utils =
|
|
291
|
+
var utils = require_utils();
|
|
946
292
|
var {
|
|
947
293
|
CHAR_ASTERISK,
|
|
948
294
|
/* * */
|
|
@@ -1273,7 +619,7 @@ var require_parse = __commonJS({
|
|
|
1273
619
|
"../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js"(exports, module) {
|
|
1274
620
|
"use strict";
|
|
1275
621
|
var constants3 = require_constants();
|
|
1276
|
-
var utils =
|
|
622
|
+
var utils = require_utils();
|
|
1277
623
|
var {
|
|
1278
624
|
MAX_LENGTH,
|
|
1279
625
|
POSIX_REGEX_SOURCE,
|
|
@@ -2042,7 +1388,7 @@ var require_picomatch = __commonJS({
|
|
|
2042
1388
|
"use strict";
|
|
2043
1389
|
var scan = require_scan();
|
|
2044
1390
|
var parse = require_parse();
|
|
2045
|
-
var utils =
|
|
1391
|
+
var utils = require_utils();
|
|
2046
1392
|
var constants3 = require_constants();
|
|
2047
1393
|
var isObject = /* @__PURE__ */ __name((val) => val && typeof val === "object" && !Array.isArray(val), "isObject");
|
|
2048
1394
|
var picomatch2 = /* @__PURE__ */ __name((glob, options, returnState = false) => {
|
|
@@ -2181,7 +1527,7 @@ var require_picomatch2 = __commonJS({
|
|
|
2181
1527
|
"../node_modules/tinyglobby/node_modules/picomatch/index.js"(exports, module) {
|
|
2182
1528
|
"use strict";
|
|
2183
1529
|
var pico = require_picomatch();
|
|
2184
|
-
var utils =
|
|
1530
|
+
var utils = require_utils();
|
|
2185
1531
|
function picomatch2(glob, options, returnState = false) {
|
|
2186
1532
|
if (options && (options.windows === null || options.windows === void 0)) {
|
|
2187
1533
|
options = { ...options, windows: utils.isWindows() };
|
|
@@ -2194,189 +1540,11 @@ var require_picomatch2 = __commonJS({
|
|
|
2194
1540
|
}
|
|
2195
1541
|
});
|
|
2196
1542
|
|
|
2197
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js
|
|
2198
|
-
var require_builder = __commonJS({
|
|
2199
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js"(exports) {
|
|
2200
|
-
"use strict";
|
|
2201
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2202
|
-
exports.Builder = void 0;
|
|
2203
|
-
var path_1 = __require("path");
|
|
2204
|
-
var api_builder_1 = require_api_builder();
|
|
2205
|
-
var pm = null;
|
|
2206
|
-
try {
|
|
2207
|
-
__require.resolve("picomatch");
|
|
2208
|
-
pm = require_picomatch2();
|
|
2209
|
-
} catch (_e) {
|
|
2210
|
-
}
|
|
2211
|
-
var Builder = class {
|
|
2212
|
-
static {
|
|
2213
|
-
__name(this, "Builder");
|
|
2214
|
-
}
|
|
2215
|
-
globCache = {};
|
|
2216
|
-
options = {
|
|
2217
|
-
maxDepth: Infinity,
|
|
2218
|
-
suppressErrors: true,
|
|
2219
|
-
pathSeparator: path_1.sep,
|
|
2220
|
-
filters: []
|
|
2221
|
-
};
|
|
2222
|
-
globFunction;
|
|
2223
|
-
constructor(options) {
|
|
2224
|
-
this.options = { ...this.options, ...options };
|
|
2225
|
-
this.globFunction = this.options.globFunction;
|
|
2226
|
-
}
|
|
2227
|
-
group() {
|
|
2228
|
-
this.options.group = true;
|
|
2229
|
-
return this;
|
|
2230
|
-
}
|
|
2231
|
-
withPathSeparator(separator) {
|
|
2232
|
-
this.options.pathSeparator = separator;
|
|
2233
|
-
return this;
|
|
2234
|
-
}
|
|
2235
|
-
withBasePath() {
|
|
2236
|
-
this.options.includeBasePath = true;
|
|
2237
|
-
return this;
|
|
2238
|
-
}
|
|
2239
|
-
withRelativePaths() {
|
|
2240
|
-
this.options.relativePaths = true;
|
|
2241
|
-
return this;
|
|
2242
|
-
}
|
|
2243
|
-
withDirs() {
|
|
2244
|
-
this.options.includeDirs = true;
|
|
2245
|
-
return this;
|
|
2246
|
-
}
|
|
2247
|
-
withMaxDepth(depth) {
|
|
2248
|
-
this.options.maxDepth = depth;
|
|
2249
|
-
return this;
|
|
2250
|
-
}
|
|
2251
|
-
withMaxFiles(limit) {
|
|
2252
|
-
this.options.maxFiles = limit;
|
|
2253
|
-
return this;
|
|
2254
|
-
}
|
|
2255
|
-
withFullPaths() {
|
|
2256
|
-
this.options.resolvePaths = true;
|
|
2257
|
-
this.options.includeBasePath = true;
|
|
2258
|
-
return this;
|
|
2259
|
-
}
|
|
2260
|
-
withErrors() {
|
|
2261
|
-
this.options.suppressErrors = false;
|
|
2262
|
-
return this;
|
|
2263
|
-
}
|
|
2264
|
-
withSymlinks({ resolvePaths = true } = {}) {
|
|
2265
|
-
this.options.resolveSymlinks = true;
|
|
2266
|
-
this.options.useRealPaths = resolvePaths;
|
|
2267
|
-
return this.withFullPaths();
|
|
2268
|
-
}
|
|
2269
|
-
withAbortSignal(signal) {
|
|
2270
|
-
this.options.signal = signal;
|
|
2271
|
-
return this;
|
|
2272
|
-
}
|
|
2273
|
-
normalize() {
|
|
2274
|
-
this.options.normalizePath = true;
|
|
2275
|
-
return this;
|
|
2276
|
-
}
|
|
2277
|
-
filter(predicate) {
|
|
2278
|
-
this.options.filters.push(predicate);
|
|
2279
|
-
return this;
|
|
2280
|
-
}
|
|
2281
|
-
onlyDirs() {
|
|
2282
|
-
this.options.excludeFiles = true;
|
|
2283
|
-
this.options.includeDirs = true;
|
|
2284
|
-
return this;
|
|
2285
|
-
}
|
|
2286
|
-
exclude(predicate) {
|
|
2287
|
-
this.options.exclude = predicate;
|
|
2288
|
-
return this;
|
|
2289
|
-
}
|
|
2290
|
-
onlyCounts() {
|
|
2291
|
-
this.options.onlyCounts = true;
|
|
2292
|
-
return this;
|
|
2293
|
-
}
|
|
2294
|
-
crawl(root) {
|
|
2295
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
2296
|
-
}
|
|
2297
|
-
withGlobFunction(fn) {
|
|
2298
|
-
this.globFunction = fn;
|
|
2299
|
-
return this;
|
|
2300
|
-
}
|
|
2301
|
-
/**
|
|
2302
|
-
* @deprecated Pass options using the constructor instead:
|
|
2303
|
-
* ```ts
|
|
2304
|
-
* new fdir(options).crawl("/path/to/root");
|
|
2305
|
-
* ```
|
|
2306
|
-
* This method will be removed in v7.0
|
|
2307
|
-
*/
|
|
2308
|
-
/* c8 ignore next 4 */
|
|
2309
|
-
crawlWithOptions(root, options) {
|
|
2310
|
-
this.options = { ...this.options, ...options };
|
|
2311
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
2312
|
-
}
|
|
2313
|
-
glob(...patterns) {
|
|
2314
|
-
if (this.globFunction) {
|
|
2315
|
-
return this.globWithOptions(patterns);
|
|
2316
|
-
}
|
|
2317
|
-
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
|
2318
|
-
}
|
|
2319
|
-
globWithOptions(patterns, ...options) {
|
|
2320
|
-
const globFn = this.globFunction || pm;
|
|
2321
|
-
if (!globFn) {
|
|
2322
|
-
throw new Error("Please specify a glob function to use glob matching.");
|
|
2323
|
-
}
|
|
2324
|
-
var isMatch = this.globCache[patterns.join("\0")];
|
|
2325
|
-
if (!isMatch) {
|
|
2326
|
-
isMatch = globFn(patterns, ...options);
|
|
2327
|
-
this.globCache[patterns.join("\0")] = isMatch;
|
|
2328
|
-
}
|
|
2329
|
-
this.options.filters.push((path4) => isMatch(path4));
|
|
2330
|
-
return this;
|
|
2331
|
-
}
|
|
2332
|
-
};
|
|
2333
|
-
exports.Builder = Builder;
|
|
2334
|
-
}
|
|
2335
|
-
});
|
|
2336
|
-
|
|
2337
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/types.js
|
|
2338
|
-
var require_types = __commonJS({
|
|
2339
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/types.js"(exports) {
|
|
2340
|
-
"use strict";
|
|
2341
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2342
|
-
}
|
|
2343
|
-
});
|
|
2344
|
-
|
|
2345
|
-
// ../node_modules/tinyglobby/node_modules/fdir/dist/index.js
|
|
2346
|
-
var require_dist = __commonJS({
|
|
2347
|
-
"../node_modules/tinyglobby/node_modules/fdir/dist/index.js"(exports) {
|
|
2348
|
-
"use strict";
|
|
2349
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2350
|
-
if (k2 === void 0) k2 = k;
|
|
2351
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2352
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2353
|
-
desc = { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2354
|
-
return m[k];
|
|
2355
|
-
}, "get") };
|
|
2356
|
-
}
|
|
2357
|
-
Object.defineProperty(o, k2, desc);
|
|
2358
|
-
} : function(o, m, k, k2) {
|
|
2359
|
-
if (k2 === void 0) k2 = k;
|
|
2360
|
-
o[k2] = m[k];
|
|
2361
|
-
});
|
|
2362
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports2) {
|
|
2363
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
2364
|
-
};
|
|
2365
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2366
|
-
exports.fdir = void 0;
|
|
2367
|
-
var builder_1 = require_builder();
|
|
2368
|
-
Object.defineProperty(exports, "fdir", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2369
|
-
return builder_1.Builder;
|
|
2370
|
-
}, "get") });
|
|
2371
|
-
__exportStar(require_types(), exports);
|
|
2372
|
-
}
|
|
2373
|
-
});
|
|
2374
|
-
|
|
2375
1543
|
// ../node_modules/isexe/windows.js
|
|
2376
1544
|
var require_windows = __commonJS({
|
|
2377
1545
|
"../node_modules/isexe/windows.js"(exports, module) {
|
|
2378
1546
|
module.exports = isexe;
|
|
2379
|
-
isexe.sync =
|
|
1547
|
+
isexe.sync = sync2;
|
|
2380
1548
|
var fs = __require("fs");
|
|
2381
1549
|
function checkPathExt(path4, options) {
|
|
2382
1550
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
@@ -2409,10 +1577,10 @@ var require_windows = __commonJS({
|
|
|
2409
1577
|
});
|
|
2410
1578
|
}
|
|
2411
1579
|
__name(isexe, "isexe");
|
|
2412
|
-
function
|
|
1580
|
+
function sync2(path4, options) {
|
|
2413
1581
|
return checkStat(fs.statSync(path4), path4, options);
|
|
2414
1582
|
}
|
|
2415
|
-
__name(
|
|
1583
|
+
__name(sync2, "sync");
|
|
2416
1584
|
}
|
|
2417
1585
|
});
|
|
2418
1586
|
|
|
@@ -2420,7 +1588,7 @@ var require_windows = __commonJS({
|
|
|
2420
1588
|
var require_mode = __commonJS({
|
|
2421
1589
|
"../node_modules/isexe/mode.js"(exports, module) {
|
|
2422
1590
|
module.exports = isexe;
|
|
2423
|
-
isexe.sync =
|
|
1591
|
+
isexe.sync = sync2;
|
|
2424
1592
|
var fs = __require("fs");
|
|
2425
1593
|
function isexe(path4, options, cb) {
|
|
2426
1594
|
fs.stat(path4, function(er, stat) {
|
|
@@ -2428,10 +1596,10 @@ var require_mode = __commonJS({
|
|
|
2428
1596
|
});
|
|
2429
1597
|
}
|
|
2430
1598
|
__name(isexe, "isexe");
|
|
2431
|
-
function
|
|
1599
|
+
function sync2(path4, options) {
|
|
2432
1600
|
return checkStat(fs.statSync(path4), options);
|
|
2433
1601
|
}
|
|
2434
|
-
__name(
|
|
1602
|
+
__name(sync2, "sync");
|
|
2435
1603
|
function checkStat(stat, options) {
|
|
2436
1604
|
return stat.isFile() && checkMode(stat, options);
|
|
2437
1605
|
}
|
|
@@ -2464,7 +1632,7 @@ var require_isexe = __commonJS({
|
|
|
2464
1632
|
core = require_mode();
|
|
2465
1633
|
}
|
|
2466
1634
|
module.exports = isexe;
|
|
2467
|
-
isexe.sync =
|
|
1635
|
+
isexe.sync = sync2;
|
|
2468
1636
|
function isexe(path4, options, cb) {
|
|
2469
1637
|
if (typeof options === "function") {
|
|
2470
1638
|
cb = options;
|
|
@@ -2474,12 +1642,12 @@ var require_isexe = __commonJS({
|
|
|
2474
1642
|
if (typeof Promise !== "function") {
|
|
2475
1643
|
throw new TypeError("callback not provided");
|
|
2476
1644
|
}
|
|
2477
|
-
return new Promise(function(
|
|
1645
|
+
return new Promise(function(resolve3, reject) {
|
|
2478
1646
|
isexe(path4, options || {}, function(er, is) {
|
|
2479
1647
|
if (er) {
|
|
2480
1648
|
reject(er);
|
|
2481
1649
|
} else {
|
|
2482
|
-
|
|
1650
|
+
resolve3(is);
|
|
2483
1651
|
}
|
|
2484
1652
|
});
|
|
2485
1653
|
});
|
|
@@ -2495,7 +1663,7 @@ var require_isexe = __commonJS({
|
|
|
2495
1663
|
});
|
|
2496
1664
|
}
|
|
2497
1665
|
__name(isexe, "isexe");
|
|
2498
|
-
function
|
|
1666
|
+
function sync2(path4, options) {
|
|
2499
1667
|
try {
|
|
2500
1668
|
return core.sync(path4, options || {});
|
|
2501
1669
|
} catch (er) {
|
|
@@ -2506,7 +1674,7 @@ var require_isexe = __commonJS({
|
|
|
2506
1674
|
}
|
|
2507
1675
|
}
|
|
2508
1676
|
}
|
|
2509
|
-
__name(
|
|
1677
|
+
__name(sync2, "sync");
|
|
2510
1678
|
}
|
|
2511
1679
|
});
|
|
2512
1680
|
|
|
@@ -2547,27 +1715,27 @@ var require_which = __commonJS({
|
|
|
2547
1715
|
opt = {};
|
|
2548
1716
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
2549
1717
|
const found = [];
|
|
2550
|
-
const step = /* @__PURE__ */ __name((i) => new Promise((
|
|
1718
|
+
const step = /* @__PURE__ */ __name((i) => new Promise((resolve3, reject) => {
|
|
2551
1719
|
if (i === pathEnv.length)
|
|
2552
|
-
return opt.all && found.length ?
|
|
1720
|
+
return opt.all && found.length ? resolve3(found) : reject(getNotFoundError(cmd));
|
|
2553
1721
|
const ppRaw = pathEnv[i];
|
|
2554
1722
|
const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
|
|
2555
1723
|
const pCmd = path4.join(pathPart, cmd);
|
|
2556
1724
|
const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
|
|
2557
|
-
|
|
1725
|
+
resolve3(subStep(p, i, 0));
|
|
2558
1726
|
}), "step");
|
|
2559
|
-
const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((
|
|
1727
|
+
const subStep = /* @__PURE__ */ __name((p, i, ii) => new Promise((resolve3, reject) => {
|
|
2560
1728
|
if (ii === pathExt.length)
|
|
2561
|
-
return
|
|
1729
|
+
return resolve3(step(i + 1));
|
|
2562
1730
|
const ext = pathExt[ii];
|
|
2563
1731
|
isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
|
|
2564
1732
|
if (!er && is) {
|
|
2565
1733
|
if (opt.all)
|
|
2566
1734
|
found.push(p + ext);
|
|
2567
1735
|
else
|
|
2568
|
-
return
|
|
1736
|
+
return resolve3(p + ext);
|
|
2569
1737
|
}
|
|
2570
|
-
return
|
|
1738
|
+
return resolve3(subStep(p, i, ii + 1));
|
|
2571
1739
|
});
|
|
2572
1740
|
}), "subStep");
|
|
2573
1741
|
return cb ? step(0).then((res) => cb(null, res), cb) : step(0);
|
|
@@ -2937,40 +2105,597 @@ var require_merge_stream = __commonJS({
|
|
|
2937
2105
|
});
|
|
2938
2106
|
|
|
2939
2107
|
// src/common/utils/paths.ts
|
|
2940
|
-
import { join, relative, resolve, sep } from "node:path";
|
|
2108
|
+
import { join, relative as relative2, resolve as resolve2, sep as sep2 } from "node:path";
|
|
2941
2109
|
|
|
2942
2110
|
// ../node_modules/tinyglobby/dist/index.mjs
|
|
2943
|
-
|
|
2944
|
-
var import_picomatch = __toESM(require_picomatch2(), 1);
|
|
2111
|
+
import nativeFs2 from "fs";
|
|
2945
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";
|
|
2946
2670
|
var ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
2947
|
-
function getPartialMatcher(patterns, options) {
|
|
2671
|
+
function getPartialMatcher(patterns, options = {}) {
|
|
2948
2672
|
const patternsCount = patterns.length;
|
|
2949
2673
|
const patternsParts = Array(patternsCount);
|
|
2950
|
-
const
|
|
2674
|
+
const matchers = Array(patternsCount);
|
|
2675
|
+
const globstarEnabled = !options.noglobstar;
|
|
2951
2676
|
for (let i = 0; i < patternsCount; i++) {
|
|
2952
2677
|
const parts = splitPattern(patterns[i]);
|
|
2953
2678
|
patternsParts[i] = parts;
|
|
2954
2679
|
const partsCount = parts.length;
|
|
2955
|
-
const
|
|
2956
|
-
for (let j = 0; j < partsCount; j++)
|
|
2957
|
-
|
|
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;
|
|
2958
2683
|
}
|
|
2959
2684
|
return (input) => {
|
|
2960
2685
|
const inputParts = input.split("/");
|
|
2961
2686
|
if (inputParts[0] === ".." && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
2962
2687
|
for (let i = 0; i < patterns.length; i++) {
|
|
2963
2688
|
const patternParts = patternsParts[i];
|
|
2964
|
-
const
|
|
2689
|
+
const matcher = matchers[i];
|
|
2965
2690
|
const inputPatternCount = inputParts.length;
|
|
2966
2691
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
2967
2692
|
let j = 0;
|
|
2968
2693
|
while (j < minParts) {
|
|
2969
2694
|
const part = patternParts[j];
|
|
2970
2695
|
if (part.includes("/")) return true;
|
|
2971
|
-
const match =
|
|
2696
|
+
const match = matcher[j](inputParts[j]);
|
|
2972
2697
|
if (!match) break;
|
|
2973
|
-
if (part === "**") return true;
|
|
2698
|
+
if (globstarEnabled && part === "**") return true;
|
|
2974
2699
|
j++;
|
|
2975
2700
|
}
|
|
2976
2701
|
if (j === inputPatternCount) return true;
|
|
@@ -2979,6 +2704,38 @@ function getPartialMatcher(patterns, options) {
|
|
|
2979
2704
|
};
|
|
2980
2705
|
}
|
|
2981
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");
|
|
2982
2739
|
var splitPatternOptions = { parts: true };
|
|
2983
2740
|
function splitPattern(path$1) {
|
|
2984
2741
|
var _result$parts;
|
|
@@ -2986,7 +2743,6 @@ function splitPattern(path$1) {
|
|
|
2986
2743
|
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
|
|
2987
2744
|
}
|
|
2988
2745
|
__name(splitPattern, "splitPattern");
|
|
2989
|
-
var isWin = process.platform === "win32";
|
|
2990
2746
|
var POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
2991
2747
|
var WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
2992
2748
|
var escapePosixPath = /* @__PURE__ */ __name((path$1) => path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&"), "escapePosixPath");
|
|
@@ -3044,14 +2800,13 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
|
|
|
3044
2800
|
}
|
|
3045
2801
|
props.depthOffset = newCommonPath.length;
|
|
3046
2802
|
props.commonPath = newCommonPath;
|
|
3047
|
-
props.root = newCommonPath.length > 0 ?
|
|
2803
|
+
props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
|
|
3048
2804
|
}
|
|
3049
2805
|
return result;
|
|
3050
2806
|
}
|
|
3051
2807
|
__name(normalizePattern, "normalizePattern");
|
|
3052
|
-
function processPatterns({ patterns, ignore = [], expandDirectories = true }, cwd, props) {
|
|
2808
|
+
function processPatterns({ patterns = ["**/*"], ignore = [], expandDirectories = true }, cwd, props) {
|
|
3053
2809
|
if (typeof patterns === "string") patterns = [patterns];
|
|
3054
|
-
else if (!patterns) patterns = ["**/*"];
|
|
3055
2810
|
if (typeof ignore === "string") ignore = [ignore];
|
|
3056
2811
|
const matchPatterns = [];
|
|
3057
2812
|
const ignorePatterns = [];
|
|
@@ -3070,69 +2825,90 @@ function processPatterns({ patterns, ignore = [], expandDirectories = true }, cw
|
|
|
3070
2825
|
};
|
|
3071
2826
|
}
|
|
3072
2827
|
__name(processPatterns, "processPatterns");
|
|
3073
|
-
function
|
|
3074
|
-
return posix.relative(cwd, `${root}/${path$1}`) || ".";
|
|
3075
|
-
}
|
|
3076
|
-
__name(getRelativePath, "getRelativePath");
|
|
3077
|
-
function processPath(path$1, cwd, root, isDirectory, absolute) {
|
|
3078
|
-
const relativePath = absolute ? path$1.slice(root === "/" ? 1 : root.length + 1) || "." : path$1;
|
|
3079
|
-
if (root === cwd) return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
|
|
3080
|
-
return getRelativePath(relativePath, cwd, root);
|
|
3081
|
-
}
|
|
3082
|
-
__name(processPath, "processPath");
|
|
3083
|
-
function formatPaths(paths, cwd, root) {
|
|
2828
|
+
function formatPaths(paths, relative3) {
|
|
3084
2829
|
for (let i = paths.length - 1; i >= 0; i--) {
|
|
3085
2830
|
const path$1 = paths[i];
|
|
3086
|
-
paths[i] =
|
|
2831
|
+
paths[i] = relative3(path$1);
|
|
3087
2832
|
}
|
|
3088
2833
|
return paths;
|
|
3089
2834
|
}
|
|
3090
2835
|
__name(formatPaths, "formatPaths");
|
|
3091
|
-
function
|
|
3092
|
-
if (process.
|
|
3093
|
-
if (
|
|
3094
|
-
|
|
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];
|
|
3095
2857
|
const props = {
|
|
3096
2858
|
root: cwd,
|
|
3097
2859
|
commonPath: null,
|
|
3098
2860
|
depthOffset: 0
|
|
3099
2861
|
};
|
|
3100
|
-
const processed = processPatterns(
|
|
3101
|
-
|
|
2862
|
+
const processed = processPatterns({
|
|
2863
|
+
...options,
|
|
2864
|
+
patterns
|
|
2865
|
+
}, cwd, props);
|
|
3102
2866
|
if (options.debug) log("internal processing patterns:", processed);
|
|
3103
|
-
const
|
|
2867
|
+
const matchOptions = {
|
|
3104
2868
|
dot: options.dot,
|
|
3105
|
-
|
|
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,
|
|
3106
2877
|
ignore: processed.ignore
|
|
3107
2878
|
});
|
|
3108
|
-
const ignore = (0, import_picomatch.default)(processed.ignore,
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
const partialMatcher = getPartialMatcher(processed.match, {
|
|
3113
|
-
dot: options.dot,
|
|
3114
|
-
nocase
|
|
3115
|
-
});
|
|
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);
|
|
3116
2883
|
const fdirOptions = {
|
|
3117
2884
|
filters: [options.debug ? (p, isDirectory) => {
|
|
3118
|
-
const path$1 =
|
|
2885
|
+
const path$1 = format(p, isDirectory);
|
|
3119
2886
|
const matches = matcher(path$1);
|
|
3120
2887
|
if (matches) log(`matched ${path$1}`);
|
|
3121
2888
|
return matches;
|
|
3122
|
-
} : (p, isDirectory) => matcher(
|
|
2889
|
+
} : (p, isDirectory) => matcher(format(p, isDirectory))],
|
|
3123
2890
|
exclude: options.debug ? (_, p) => {
|
|
3124
|
-
const relativePath =
|
|
2891
|
+
const relativePath = formatExclude(p, true);
|
|
3125
2892
|
const skipped = relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3126
2893
|
if (skipped) log(`skipped ${p}`);
|
|
3127
2894
|
else log(`crawling ${p}`);
|
|
3128
2895
|
return skipped;
|
|
3129
2896
|
} : (_, p) => {
|
|
3130
|
-
const relativePath =
|
|
2897
|
+
const relativePath = formatExclude(p, true);
|
|
3131
2898
|
return relativePath !== "." && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3132
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,
|
|
3133
2908
|
pathSeparator: "/",
|
|
3134
2909
|
relativePaths: true,
|
|
3135
|
-
resolveSymlinks: true
|
|
2910
|
+
resolveSymlinks: true,
|
|
2911
|
+
signal: options.signal
|
|
3136
2912
|
};
|
|
3137
2913
|
if (options.deep !== void 0) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
3138
2914
|
if (options.absolute) {
|
|
@@ -3151,19 +2927,18 @@ function crawl(options, cwd, sync) {
|
|
|
3151
2927
|
props.root = props.root.replace(BACKSLASHES, "");
|
|
3152
2928
|
const root = props.root;
|
|
3153
2929
|
if (options.debug) log("internal properties:", props);
|
|
3154
|
-
const
|
|
3155
|
-
|
|
3156
|
-
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];
|
|
3157
2932
|
}
|
|
3158
|
-
__name(
|
|
2933
|
+
__name(getCrawler, "getCrawler");
|
|
3159
2934
|
function globSync(patternsOrOptions, options) {
|
|
3160
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");
|
|
3161
|
-
const
|
|
3162
|
-
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
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);
|
|
3167
2942
|
}
|
|
3168
2943
|
__name(globSync, "globSync");
|
|
3169
2944
|
|
|
@@ -3213,8 +2988,8 @@ error searching for lock file: ${e}
|
|
|
3213
2988
|
`);
|
|
3214
2989
|
}
|
|
3215
2990
|
try {
|
|
3216
|
-
const [basePath, rest] = __dirname.split(`${
|
|
3217
|
-
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("..")) {
|
|
3218
2993
|
projectRoot = basePath;
|
|
3219
2994
|
return projectRoot;
|
|
3220
2995
|
}
|
|
@@ -3236,19 +3011,19 @@ var findFilesUp = /* @__PURE__ */ __name((matchers, baseDir = process.cwd()) =>
|
|
|
3236
3011
|
}
|
|
3237
3012
|
return matchingFiles;
|
|
3238
3013
|
}, "findFilesUp");
|
|
3239
|
-
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");
|
|
3240
3015
|
var relativePattern = /^\.{1,2}([/\\]|$)/;
|
|
3241
3016
|
function normalizeStoryPath(filename) {
|
|
3242
3017
|
if (relativePattern.test(filename)) {
|
|
3243
3018
|
return filename;
|
|
3244
3019
|
}
|
|
3245
|
-
return `.${
|
|
3020
|
+
return `.${sep2}${filename}`;
|
|
3246
3021
|
}
|
|
3247
3022
|
__name(normalizeStoryPath, "normalizeStoryPath");
|
|
3248
3023
|
|
|
3249
3024
|
// src/common/utils/envs.ts
|
|
3250
3025
|
async function loadEnvs(options = {}) {
|
|
3251
|
-
const { getEnvironment } = await import("./lib-
|
|
3026
|
+
const { getEnvironment } = await import("./lib-IT6OBSID.js");
|
|
3252
3027
|
const defaultNodeEnv = options.production ? "production" : "development";
|
|
3253
3028
|
const env = {
|
|
3254
3029
|
// eslint-disable-next-line @typescript-eslint/dot-notation
|
|
@@ -3329,7 +3104,7 @@ __name(stripFinalNewline, "stripFinalNewline");
|
|
|
3329
3104
|
// node_modules/npm-run-path/index.js
|
|
3330
3105
|
import process2 from "node:process";
|
|
3331
3106
|
import path2 from "node:path";
|
|
3332
|
-
import { fileURLToPath } from "node:url";
|
|
3107
|
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
3333
3108
|
|
|
3334
3109
|
// node_modules/path-key/index.js
|
|
3335
3110
|
function pathKey(options = {}) {
|
|
@@ -3352,7 +3127,7 @@ var npmRunPath = /* @__PURE__ */ __name(({
|
|
|
3352
3127
|
execPath = process2.execPath,
|
|
3353
3128
|
addExecPath = true
|
|
3354
3129
|
} = {}) => {
|
|
3355
|
-
const cwdString = cwd instanceof URL ?
|
|
3130
|
+
const cwdString = cwd instanceof URL ? fileURLToPath2(cwd) : cwd;
|
|
3356
3131
|
const cwdPath = path2.resolve(cwdString);
|
|
3357
3132
|
const result = [];
|
|
3358
3133
|
if (preferLocal) {
|
|
@@ -3372,7 +3147,7 @@ var applyPreferLocal = /* @__PURE__ */ __name((result, cwdPath) => {
|
|
|
3372
3147
|
}
|
|
3373
3148
|
}, "applyPreferLocal");
|
|
3374
3149
|
var applyExecPath = /* @__PURE__ */ __name((result, execPath, cwdPath) => {
|
|
3375
|
-
const execPathString = execPath instanceof URL ?
|
|
3150
|
+
const execPathString = execPath instanceof URL ? fileURLToPath2(execPath) : execPath;
|
|
3376
3151
|
result.push(path2.resolve(cwdPath, execPathString, ".."));
|
|
3377
3152
|
}, "applyExecPath");
|
|
3378
3153
|
var npmRunPathEnv = /* @__PURE__ */ __name(({ env = process2.env, ...options } = {}) => {
|
|
@@ -4236,7 +4011,7 @@ var setupTimeout = /* @__PURE__ */ __name((spawned, { timeout, killSignal = "SIG
|
|
|
4236
4011
|
return spawnedPromise;
|
|
4237
4012
|
}
|
|
4238
4013
|
let timeoutId;
|
|
4239
|
-
const timeoutPromise = new Promise((
|
|
4014
|
+
const timeoutPromise = new Promise((resolve3, reject) => {
|
|
4240
4015
|
timeoutId = setTimeout(() => {
|
|
4241
4016
|
timeoutKill(spawned, killSignal, reject);
|
|
4242
4017
|
}, timeout);
|
|
@@ -4604,15 +4379,15 @@ var descriptors = ["then", "catch", "finally"].map((property) => [
|
|
|
4604
4379
|
property,
|
|
4605
4380
|
Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
|
|
4606
4381
|
]);
|
|
4607
|
-
var mergePromise = /* @__PURE__ */ __name((spawned,
|
|
4382
|
+
var mergePromise = /* @__PURE__ */ __name((spawned, promise2) => {
|
|
4608
4383
|
for (const [property, descriptor] of descriptors) {
|
|
4609
|
-
const value = typeof
|
|
4384
|
+
const value = typeof promise2 === "function" ? (...args) => Reflect.apply(descriptor.value, promise2(), args) : descriptor.value.bind(promise2);
|
|
4610
4385
|
Reflect.defineProperty(spawned, property, { ...descriptor, value });
|
|
4611
4386
|
}
|
|
4612
4387
|
}, "mergePromise");
|
|
4613
|
-
var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((
|
|
4388
|
+
var getSpawnedPromise = /* @__PURE__ */ __name((spawned) => new Promise((resolve3, reject) => {
|
|
4614
4389
|
spawned.on("exit", (exitCode, signal) => {
|
|
4615
|
-
|
|
4390
|
+
resolve3({ exitCode, signal });
|
|
4616
4391
|
});
|
|
4617
4392
|
spawned.on("error", (error) => {
|
|
4618
4393
|
reject(error);
|