@rstest/core 0.3.4 → 0.4.1
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/LICENSE.md +1 -13
- package/dist/{465.js → 0~120.js} +11 -11
- package/dist/{223.js → 0~223.js} +6 -2
- package/dist/{33.js → 0~33.js} +62 -0
- package/dist/0~414.js +16 -0
- package/dist/{607.js → 0~493.js} +27 -44
- package/dist/0~603.js +50 -0
- package/dist/{655.js → 0~655.js} +5 -5
- package/dist/{263.js → 0~669.js} +18 -17
- package/dist/0~691.js +38 -0
- package/dist/0~836.js +26 -0
- package/dist/{85.js → 0~85.js} +3 -16
- package/dist/{755.js → 0~873.js} +25 -16
- package/dist/{928.js → 0~928.js} +2 -10
- package/dist/{985.js → 0~938.js} +33 -16
- package/dist/{967.js → 0~967.js} +5 -2
- package/dist/{969.js → 0~969.js} +1 -1
- package/dist/{971.js → 0~971.js} +1 -1
- package/dist/index.js +971 -1137
- package/dist/worker.js +83 -40
- package/dist-types/index.d.ts +112 -9
- package/dist-types/worker.d.ts +85 -9
- package/package.json +9 -7
- /package/dist/{171.js → 0~171.js} +0 -0
- /package/dist/{350.js → 0~350.js} +0 -0
- /package/dist/{655.js.LICENSE.txt → 0~655.js.LICENSE.txt} +0 -0
- /package/dist/{711.js → 0~711.js} +0 -0
- /package/dist/{928.js.LICENSE.txt → 0~928.js.LICENSE.txt} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,713 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import node_process from "node:process";
|
|
1
|
+
import 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_birpc__ from "birpc";
|
|
6
4
|
import * as __WEBPACK_EXTERNAL_MODULE_events__ from "events";
|
|
7
|
-
import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_400951f8__ from "fs/promises";
|
|
8
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_events_0a6aefe7__ from "node:events";
|
|
9
5
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
10
6
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/promises";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__ from "node:inspector";
|
|
12
7
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
13
8
|
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
14
9
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
15
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_stream_444d1c2b__ from "node:stream";
|
|
16
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
|
|
17
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
|
|
18
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
|
|
19
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_v8_d0df5498__ from "node:v8";
|
|
20
11
|
import * as __WEBPACK_EXTERNAL_MODULE_pathe__ from "pathe";
|
|
21
|
-
import * as
|
|
22
|
-
import * as
|
|
12
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__ from "node:process";
|
|
13
|
+
import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
|
|
14
|
+
import * as __WEBPACK_EXTERNAL_MODULE_module__ from "module";
|
|
23
15
|
var __webpack_modules__ = {
|
|
24
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/async.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports.callback = exports.promise = void 0;
|
|
29
|
-
const walker_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
|
|
30
|
-
function promise(root, options) {
|
|
31
|
-
return new Promise((resolve, reject)=>{
|
|
32
|
-
callback(root, options, (err, output)=>{
|
|
33
|
-
if (err) return reject(err);
|
|
34
|
-
resolve(output);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
exports.promise = promise;
|
|
39
|
-
function callback(root, options, callback) {
|
|
40
|
-
let walker = new walker_1.Walker(root, options, callback);
|
|
41
|
-
walker.start();
|
|
42
|
-
}
|
|
43
|
-
exports.callback = callback;
|
|
44
|
-
},
|
|
45
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js": function(__unused_webpack_module, exports) {
|
|
46
|
-
Object.defineProperty(exports, "__esModule", {
|
|
47
|
-
value: true
|
|
48
|
-
});
|
|
49
|
-
exports.Counter = void 0;
|
|
50
|
-
class Counter {
|
|
51
|
-
_files = 0;
|
|
52
|
-
_directories = 0;
|
|
53
|
-
set files(num) {
|
|
54
|
-
this._files = num;
|
|
55
|
-
}
|
|
56
|
-
get files() {
|
|
57
|
-
return this._files;
|
|
58
|
-
}
|
|
59
|
-
set directories(num) {
|
|
60
|
-
this._directories = num;
|
|
61
|
-
}
|
|
62
|
-
get directories() {
|
|
63
|
-
return this._directories;
|
|
64
|
-
}
|
|
65
|
-
get dirs() {
|
|
66
|
-
return this._directories;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.Counter = Counter;
|
|
70
|
-
},
|
|
71
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/get-array.js": function(__unused_webpack_module, exports) {
|
|
72
|
-
Object.defineProperty(exports, "__esModule", {
|
|
73
|
-
value: true
|
|
74
|
-
});
|
|
75
|
-
exports.build = void 0;
|
|
76
|
-
const getArray = (paths)=>paths;
|
|
77
|
-
const getArrayGroup = ()=>[
|
|
78
|
-
""
|
|
79
|
-
].slice(0, 0);
|
|
80
|
-
function build(options) {
|
|
81
|
-
return options.group ? getArrayGroup : getArray;
|
|
82
|
-
}
|
|
83
|
-
exports.build = build;
|
|
84
|
-
},
|
|
85
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/group-files.js": function(__unused_webpack_module, exports) {
|
|
86
|
-
Object.defineProperty(exports, "__esModule", {
|
|
87
|
-
value: true
|
|
88
|
-
});
|
|
89
|
-
exports.build = void 0;
|
|
90
|
-
const groupFiles = (groups, directory, files)=>{
|
|
91
|
-
groups.push({
|
|
92
|
-
directory,
|
|
93
|
-
files,
|
|
94
|
-
dir: directory
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
const empty = ()=>{};
|
|
98
|
-
function build(options) {
|
|
99
|
-
return options.group ? groupFiles : empty;
|
|
100
|
-
}
|
|
101
|
-
exports.build = build;
|
|
102
|
-
},
|
|
103
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/invoke-callback.js": function(__unused_webpack_module, exports) {
|
|
104
|
-
Object.defineProperty(exports, "__esModule", {
|
|
105
|
-
value: true
|
|
106
|
-
});
|
|
107
|
-
exports.build = void 0;
|
|
108
|
-
const onlyCountsSync = (state)=>state.counts;
|
|
109
|
-
const groupsSync = (state)=>state.groups;
|
|
110
|
-
const defaultSync = (state)=>state.paths;
|
|
111
|
-
const limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles);
|
|
112
|
-
const onlyCountsAsync = (state, error, callback)=>{
|
|
113
|
-
report(error, callback, state.counts, state.options.suppressErrors);
|
|
114
|
-
return null;
|
|
115
|
-
};
|
|
116
|
-
const defaultAsync = (state, error, callback)=>{
|
|
117
|
-
report(error, callback, state.paths, state.options.suppressErrors);
|
|
118
|
-
return null;
|
|
119
|
-
};
|
|
120
|
-
const limitFilesAsync = (state, error, callback)=>{
|
|
121
|
-
report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
122
|
-
return null;
|
|
123
|
-
};
|
|
124
|
-
const groupsAsync = (state, error, callback)=>{
|
|
125
|
-
report(error, callback, state.groups, state.options.suppressErrors);
|
|
126
|
-
return null;
|
|
127
|
-
};
|
|
128
|
-
function report(error, callback, output, suppressErrors) {
|
|
129
|
-
callback(error && !suppressErrors ? error : null, output);
|
|
130
|
-
}
|
|
131
|
-
function build(options, isSynchronous) {
|
|
132
|
-
const { onlyCounts, group, maxFiles } = options;
|
|
133
|
-
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
134
|
-
if (group) return isSynchronous ? groupsSync : groupsAsync;
|
|
135
|
-
if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
136
|
-
return isSynchronous ? defaultSync : defaultAsync;
|
|
137
|
-
}
|
|
138
|
-
exports.build = build;
|
|
139
|
-
},
|
|
140
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/join-path.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
141
|
-
Object.defineProperty(exports, "__esModule", {
|
|
142
|
-
value: true
|
|
143
|
-
});
|
|
144
|
-
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
|
|
145
|
-
const path_1 = __webpack_require__("node:path");
|
|
146
|
-
const utils_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
|
|
147
|
-
function joinPathWithBasePath(filename, directoryPath) {
|
|
148
|
-
return directoryPath + filename;
|
|
149
|
-
}
|
|
150
|
-
exports.joinPathWithBasePath = joinPathWithBasePath;
|
|
151
|
-
function joinPathWithRelativePath(root, options) {
|
|
152
|
-
return function(filename, directoryPath) {
|
|
153
|
-
const sameRoot = directoryPath.startsWith(root);
|
|
154
|
-
if (sameRoot) return directoryPath.replace(root, "") + filename;
|
|
155
|
-
return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
function joinPath(filename) {
|
|
159
|
-
return filename;
|
|
160
|
-
}
|
|
161
|
-
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
162
|
-
return directoryPath + filename + separator;
|
|
163
|
-
}
|
|
164
|
-
exports.joinDirectoryPath = joinDirectoryPath;
|
|
165
|
-
function build(root, options) {
|
|
166
|
-
const { relativePaths, includeBasePath } = options;
|
|
167
|
-
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
168
|
-
}
|
|
169
|
-
exports.build = build;
|
|
170
|
-
},
|
|
171
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-directory.js": function(__unused_webpack_module, exports) {
|
|
172
|
-
Object.defineProperty(exports, "__esModule", {
|
|
173
|
-
value: true
|
|
174
|
-
});
|
|
175
|
-
exports.build = void 0;
|
|
176
|
-
function pushDirectoryWithRelativePath(root) {
|
|
177
|
-
return function(directoryPath, paths) {
|
|
178
|
-
paths.push(directoryPath.substring(root.length) || ".");
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
|
-
function pushDirectoryFilterWithRelativePath(root) {
|
|
182
|
-
return function(directoryPath, paths, filters) {
|
|
183
|
-
const relativePath = directoryPath.substring(root.length) || ".";
|
|
184
|
-
if (filters.every((filter)=>filter(relativePath, true))) paths.push(relativePath);
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
const pushDirectory = (directoryPath, paths)=>{
|
|
188
|
-
paths.push(directoryPath || ".");
|
|
189
|
-
};
|
|
190
|
-
const pushDirectoryFilter = (directoryPath, paths, filters)=>{
|
|
191
|
-
const path = directoryPath || ".";
|
|
192
|
-
if (filters.every((filter)=>filter(path, true))) paths.push(path);
|
|
193
|
-
};
|
|
194
|
-
const empty = ()=>{};
|
|
195
|
-
function build(root, options) {
|
|
196
|
-
const { includeDirs, filters, relativePaths } = options;
|
|
197
|
-
if (!includeDirs) return empty;
|
|
198
|
-
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
199
|
-
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
200
|
-
}
|
|
201
|
-
exports.build = build;
|
|
202
|
-
},
|
|
203
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-file.js": function(__unused_webpack_module, exports) {
|
|
204
|
-
Object.defineProperty(exports, "__esModule", {
|
|
205
|
-
value: true
|
|
206
|
-
});
|
|
207
|
-
exports.build = void 0;
|
|
208
|
-
const pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
|
|
209
|
-
if (filters.every((filter)=>filter(filename, false))) counts.files++;
|
|
210
|
-
};
|
|
211
|
-
const pushFileFilter = (filename, paths, _counts, filters)=>{
|
|
212
|
-
if (filters.every((filter)=>filter(filename, false))) paths.push(filename);
|
|
213
|
-
};
|
|
214
|
-
const pushFileCount = (_filename, _paths, counts, _filters)=>{
|
|
215
|
-
counts.files++;
|
|
216
|
-
};
|
|
217
|
-
const pushFile = (filename, paths)=>{
|
|
218
|
-
paths.push(filename);
|
|
219
|
-
};
|
|
220
|
-
const empty = ()=>{};
|
|
221
|
-
function build(options) {
|
|
222
|
-
const { excludeFiles, filters, onlyCounts } = options;
|
|
223
|
-
if (excludeFiles) return empty;
|
|
224
|
-
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
225
|
-
if (onlyCounts) return pushFileCount;
|
|
226
|
-
return pushFile;
|
|
227
|
-
}
|
|
228
|
-
exports.build = build;
|
|
229
|
-
},
|
|
230
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/resolve-symlink.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
231
|
-
var __importDefault = this && this.__importDefault || function(mod) {
|
|
232
|
-
return mod && mod.__esModule ? mod : {
|
|
233
|
-
default: mod
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
Object.defineProperty(exports, "__esModule", {
|
|
237
|
-
value: true
|
|
238
|
-
});
|
|
239
|
-
exports.build = void 0;
|
|
240
|
-
const fs_1 = __importDefault(__webpack_require__("node:fs"));
|
|
241
|
-
const path_1 = __webpack_require__("node:path");
|
|
242
|
-
const resolveSymlinksAsync = function(path, state, callback) {
|
|
243
|
-
const { queue, options: { suppressErrors } } = state;
|
|
244
|
-
queue.enqueue();
|
|
245
|
-
fs_1.default.realpath(path, (error, resolvedPath)=>{
|
|
246
|
-
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
247
|
-
fs_1.default.stat(resolvedPath, (error, stat)=>{
|
|
248
|
-
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
249
|
-
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
250
|
-
callback(stat, resolvedPath);
|
|
251
|
-
queue.dequeue(null, state);
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
const resolveSymlinks = function(path, state, callback) {
|
|
256
|
-
const { queue, options: { suppressErrors } } = state;
|
|
257
|
-
queue.enqueue();
|
|
258
|
-
try {
|
|
259
|
-
const resolvedPath = fs_1.default.realpathSync(path);
|
|
260
|
-
const stat = fs_1.default.statSync(resolvedPath);
|
|
261
|
-
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
262
|
-
callback(stat, resolvedPath);
|
|
263
|
-
} catch (e) {
|
|
264
|
-
if (!suppressErrors) throw e;
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
function build(options, isSynchronous) {
|
|
268
|
-
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
269
|
-
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
270
|
-
}
|
|
271
|
-
exports.build = build;
|
|
272
|
-
function isRecursive(path, resolved, state) {
|
|
273
|
-
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
274
|
-
let parent = (0, path_1.dirname)(path);
|
|
275
|
-
let depth = 1;
|
|
276
|
-
while(parent !== state.root && depth < 2){
|
|
277
|
-
const resolvedPath = state.symlinks.get(parent);
|
|
278
|
-
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
279
|
-
if (isSameRoot) depth++;
|
|
280
|
-
else parent = (0, path_1.dirname)(parent);
|
|
281
|
-
}
|
|
282
|
-
state.symlinks.set(path, resolved);
|
|
283
|
-
return depth > 1;
|
|
284
|
-
}
|
|
285
|
-
function isRecursiveUsingRealPaths(resolved, state) {
|
|
286
|
-
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/walk-directory.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
290
|
-
var __importDefault = this && this.__importDefault || function(mod) {
|
|
291
|
-
return mod && mod.__esModule ? mod : {
|
|
292
|
-
default: mod
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
Object.defineProperty(exports, "__esModule", {
|
|
296
|
-
value: true
|
|
297
|
-
});
|
|
298
|
-
exports.build = void 0;
|
|
299
|
-
const fs_1 = __importDefault(__webpack_require__("node:fs"));
|
|
300
|
-
const readdirOpts = {
|
|
301
|
-
withFileTypes: true
|
|
302
|
-
};
|
|
303
|
-
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
|
|
304
|
-
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
305
|
-
state.visited.push(crawlPath);
|
|
306
|
-
state.counts.directories++;
|
|
307
|
-
state.queue.enqueue();
|
|
308
|
-
fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
|
|
309
|
-
callback(entries, directoryPath, currentDepth);
|
|
310
|
-
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
311
|
-
});
|
|
312
|
-
};
|
|
313
|
-
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
|
|
314
|
-
if (currentDepth < 0) return;
|
|
315
|
-
state.visited.push(crawlPath);
|
|
316
|
-
state.counts.directories++;
|
|
317
|
-
let entries = [];
|
|
318
|
-
try {
|
|
319
|
-
entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
|
|
320
|
-
} catch (e) {
|
|
321
|
-
if (!state.options.suppressErrors) throw e;
|
|
322
|
-
}
|
|
323
|
-
callback(entries, directoryPath, currentDepth);
|
|
324
|
-
};
|
|
325
|
-
function build(isSynchronous) {
|
|
326
|
-
return isSynchronous ? walkSync : walkAsync;
|
|
327
|
-
}
|
|
328
|
-
exports.build = build;
|
|
329
|
-
},
|
|
330
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js": function(__unused_webpack_module, exports) {
|
|
331
|
-
Object.defineProperty(exports, "__esModule", {
|
|
332
|
-
value: true
|
|
333
|
-
});
|
|
334
|
-
exports.Queue = void 0;
|
|
335
|
-
class Queue {
|
|
336
|
-
onQueueEmpty;
|
|
337
|
-
count = 0;
|
|
338
|
-
constructor(onQueueEmpty){
|
|
339
|
-
this.onQueueEmpty = onQueueEmpty;
|
|
340
|
-
}
|
|
341
|
-
enqueue() {
|
|
342
|
-
this.count++;
|
|
343
|
-
}
|
|
344
|
-
dequeue(error, output) {
|
|
345
|
-
if (--this.count <= 0 || error) this.onQueueEmpty(error, output);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
exports.Queue = Queue;
|
|
349
|
-
},
|
|
350
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/sync.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
351
|
-
Object.defineProperty(exports, "__esModule", {
|
|
352
|
-
value: true
|
|
353
|
-
});
|
|
354
|
-
exports.sync = void 0;
|
|
355
|
-
const walker_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
|
|
356
|
-
function sync(root, options) {
|
|
357
|
-
const walker = new walker_1.Walker(root, options);
|
|
358
|
-
return walker.start();
|
|
359
|
-
}
|
|
360
|
-
exports.sync = sync;
|
|
361
|
-
},
|
|
362
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
363
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
364
|
-
if (void 0 === k2) k2 = k;
|
|
365
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
366
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
367
|
-
enumerable: true,
|
|
368
|
-
get: function() {
|
|
369
|
-
return m[k];
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
Object.defineProperty(o, k2, desc);
|
|
373
|
-
} : function(o, m, k, k2) {
|
|
374
|
-
if (void 0 === k2) k2 = k;
|
|
375
|
-
o[k2] = m[k];
|
|
376
|
-
});
|
|
377
|
-
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
378
|
-
Object.defineProperty(o, "default", {
|
|
379
|
-
enumerable: true,
|
|
380
|
-
value: v
|
|
381
|
-
});
|
|
382
|
-
} : function(o, v) {
|
|
383
|
-
o["default"] = v;
|
|
384
|
-
});
|
|
385
|
-
var __importStar = this && this.__importStar || function(mod) {
|
|
386
|
-
if (mod && mod.__esModule) return mod;
|
|
387
|
-
var result = {};
|
|
388
|
-
if (null != mod) {
|
|
389
|
-
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
390
|
-
}
|
|
391
|
-
__setModuleDefault(result, mod);
|
|
392
|
-
return result;
|
|
393
|
-
};
|
|
394
|
-
Object.defineProperty(exports, "__esModule", {
|
|
395
|
-
value: true
|
|
396
|
-
});
|
|
397
|
-
exports.Walker = void 0;
|
|
398
|
-
const path_1 = __webpack_require__("node:path");
|
|
399
|
-
const utils_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
|
|
400
|
-
const joinPath = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/join-path.js"));
|
|
401
|
-
const pushDirectory = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-directory.js"));
|
|
402
|
-
const pushFile = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/push-file.js"));
|
|
403
|
-
const getArray = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/get-array.js"));
|
|
404
|
-
const groupFiles = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/group-files.js"));
|
|
405
|
-
const resolveSymlink = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/resolve-symlink.js"));
|
|
406
|
-
const invokeCallback = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/invoke-callback.js"));
|
|
407
|
-
const walkDirectory = __importStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/functions/walk-directory.js"));
|
|
408
|
-
const queue_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js");
|
|
409
|
-
const counter_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js");
|
|
410
|
-
class Walker {
|
|
411
|
-
root;
|
|
412
|
-
isSynchronous;
|
|
413
|
-
state;
|
|
414
|
-
joinPath;
|
|
415
|
-
pushDirectory;
|
|
416
|
-
pushFile;
|
|
417
|
-
getArray;
|
|
418
|
-
groupFiles;
|
|
419
|
-
resolveSymlink;
|
|
420
|
-
walkDirectory;
|
|
421
|
-
callbackInvoker;
|
|
422
|
-
constructor(root, options, callback){
|
|
423
|
-
this.isSynchronous = !callback;
|
|
424
|
-
this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
|
|
425
|
-
this.root = (0, utils_1.normalizePath)(root, options);
|
|
426
|
-
this.state = {
|
|
427
|
-
root: (0, utils_1.isRootDirectory)(this.root) ? this.root : this.root.slice(0, -1),
|
|
428
|
-
paths: [
|
|
429
|
-
""
|
|
430
|
-
].slice(0, 0),
|
|
431
|
-
groups: [],
|
|
432
|
-
counts: new counter_1.Counter(),
|
|
433
|
-
options,
|
|
434
|
-
queue: new queue_1.Queue((error, state)=>this.callbackInvoker(state, error, callback)),
|
|
435
|
-
symlinks: new Map(),
|
|
436
|
-
visited: [
|
|
437
|
-
""
|
|
438
|
-
].slice(0, 0)
|
|
439
|
-
};
|
|
440
|
-
this.joinPath = joinPath.build(this.root, options);
|
|
441
|
-
this.pushDirectory = pushDirectory.build(this.root, options);
|
|
442
|
-
this.pushFile = pushFile.build(options);
|
|
443
|
-
this.getArray = getArray.build(options);
|
|
444
|
-
this.groupFiles = groupFiles.build(options);
|
|
445
|
-
this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
|
|
446
|
-
this.walkDirectory = walkDirectory.build(this.isSynchronous);
|
|
447
|
-
}
|
|
448
|
-
start() {
|
|
449
|
-
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
450
|
-
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
451
|
-
}
|
|
452
|
-
walk = (entries, directoryPath, depth)=>{
|
|
453
|
-
const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator } } = this.state;
|
|
454
|
-
if (signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
455
|
-
this.pushDirectory(directoryPath, paths, filters);
|
|
456
|
-
const files = this.getArray(this.state.paths);
|
|
457
|
-
for(let i = 0; i < entries.length; ++i){
|
|
458
|
-
const entry = entries[i];
|
|
459
|
-
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
|
|
460
|
-
const filename = this.joinPath(entry.name, directoryPath);
|
|
461
|
-
this.pushFile(filename, files, this.state.counts, filters);
|
|
462
|
-
} else if (entry.isDirectory()) {
|
|
463
|
-
let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
464
|
-
if (exclude && exclude(entry.name, path)) continue;
|
|
465
|
-
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
466
|
-
} else if (entry.isSymbolicLink() && this.resolveSymlink) {
|
|
467
|
-
let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
|
|
468
|
-
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
|
|
469
|
-
if (stat.isDirectory()) {
|
|
470
|
-
resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
|
|
471
|
-
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
472
|
-
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
473
|
-
} else {
|
|
474
|
-
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
475
|
-
const filename = (0, path_1.basename)(resolvedPath);
|
|
476
|
-
const directoryPath = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
|
|
477
|
-
resolvedPath = this.joinPath(filename, directoryPath);
|
|
478
|
-
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
479
|
-
}
|
|
480
|
-
});
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
this.groupFiles(this.state.groups, directoryPath, files);
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
exports.Walker = Walker;
|
|
487
|
-
},
|
|
488
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/builder/api-builder.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
489
|
-
Object.defineProperty(exports, "__esModule", {
|
|
490
|
-
value: true
|
|
491
|
-
});
|
|
492
|
-
exports.APIBuilder = void 0;
|
|
493
|
-
const async_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/async.js");
|
|
494
|
-
const sync_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/sync.js");
|
|
495
|
-
class APIBuilder {
|
|
496
|
-
root;
|
|
497
|
-
options;
|
|
498
|
-
constructor(root, options){
|
|
499
|
-
this.root = root;
|
|
500
|
-
this.options = options;
|
|
501
|
-
}
|
|
502
|
-
withPromise() {
|
|
503
|
-
return (0, async_1.promise)(this.root, this.options);
|
|
504
|
-
}
|
|
505
|
-
withCallback(cb) {
|
|
506
|
-
(0, async_1.callback)(this.root, this.options, cb);
|
|
507
|
-
}
|
|
508
|
-
sync() {
|
|
509
|
-
return (0, sync_1.sync)(this.root, this.options);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
exports.APIBuilder = APIBuilder;
|
|
513
|
-
},
|
|
514
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/builder/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
515
|
-
Object.defineProperty(exports, "__esModule", {
|
|
516
|
-
value: true
|
|
517
|
-
});
|
|
518
|
-
exports.Builder = void 0;
|
|
519
|
-
const path_1 = __webpack_require__("node:path");
|
|
520
|
-
const api_builder_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/builder/api-builder.js");
|
|
521
|
-
var pm = null;
|
|
522
|
-
try {
|
|
523
|
-
require.resolve("picomatch");
|
|
524
|
-
pm = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js");
|
|
525
|
-
} catch (_e) {}
|
|
526
|
-
class Builder {
|
|
527
|
-
globCache = {};
|
|
528
|
-
options = {
|
|
529
|
-
maxDepth: 1 / 0,
|
|
530
|
-
suppressErrors: true,
|
|
531
|
-
pathSeparator: path_1.sep,
|
|
532
|
-
filters: []
|
|
533
|
-
};
|
|
534
|
-
globFunction;
|
|
535
|
-
constructor(options){
|
|
536
|
-
this.options = {
|
|
537
|
-
...this.options,
|
|
538
|
-
...options
|
|
539
|
-
};
|
|
540
|
-
this.globFunction = this.options.globFunction;
|
|
541
|
-
}
|
|
542
|
-
group() {
|
|
543
|
-
this.options.group = true;
|
|
544
|
-
return this;
|
|
545
|
-
}
|
|
546
|
-
withPathSeparator(separator) {
|
|
547
|
-
this.options.pathSeparator = separator;
|
|
548
|
-
return this;
|
|
549
|
-
}
|
|
550
|
-
withBasePath() {
|
|
551
|
-
this.options.includeBasePath = true;
|
|
552
|
-
return this;
|
|
553
|
-
}
|
|
554
|
-
withRelativePaths() {
|
|
555
|
-
this.options.relativePaths = true;
|
|
556
|
-
return this;
|
|
557
|
-
}
|
|
558
|
-
withDirs() {
|
|
559
|
-
this.options.includeDirs = true;
|
|
560
|
-
return this;
|
|
561
|
-
}
|
|
562
|
-
withMaxDepth(depth) {
|
|
563
|
-
this.options.maxDepth = depth;
|
|
564
|
-
return this;
|
|
565
|
-
}
|
|
566
|
-
withMaxFiles(limit) {
|
|
567
|
-
this.options.maxFiles = limit;
|
|
568
|
-
return this;
|
|
569
|
-
}
|
|
570
|
-
withFullPaths() {
|
|
571
|
-
this.options.resolvePaths = true;
|
|
572
|
-
this.options.includeBasePath = true;
|
|
573
|
-
return this;
|
|
574
|
-
}
|
|
575
|
-
withErrors() {
|
|
576
|
-
this.options.suppressErrors = false;
|
|
577
|
-
return this;
|
|
578
|
-
}
|
|
579
|
-
withSymlinks({ resolvePaths = true } = {}) {
|
|
580
|
-
this.options.resolveSymlinks = true;
|
|
581
|
-
this.options.useRealPaths = resolvePaths;
|
|
582
|
-
return this.withFullPaths();
|
|
583
|
-
}
|
|
584
|
-
withAbortSignal(signal) {
|
|
585
|
-
this.options.signal = signal;
|
|
586
|
-
return this;
|
|
587
|
-
}
|
|
588
|
-
normalize() {
|
|
589
|
-
this.options.normalizePath = true;
|
|
590
|
-
return this;
|
|
591
|
-
}
|
|
592
|
-
filter(predicate) {
|
|
593
|
-
this.options.filters.push(predicate);
|
|
594
|
-
return this;
|
|
595
|
-
}
|
|
596
|
-
onlyDirs() {
|
|
597
|
-
this.options.excludeFiles = true;
|
|
598
|
-
this.options.includeDirs = true;
|
|
599
|
-
return this;
|
|
600
|
-
}
|
|
601
|
-
exclude(predicate) {
|
|
602
|
-
this.options.exclude = predicate;
|
|
603
|
-
return this;
|
|
604
|
-
}
|
|
605
|
-
onlyCounts() {
|
|
606
|
-
this.options.onlyCounts = true;
|
|
607
|
-
return this;
|
|
608
|
-
}
|
|
609
|
-
crawl(root) {
|
|
610
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
611
|
-
}
|
|
612
|
-
withGlobFunction(fn) {
|
|
613
|
-
this.globFunction = fn;
|
|
614
|
-
return this;
|
|
615
|
-
}
|
|
616
|
-
crawlWithOptions(root, options) {
|
|
617
|
-
this.options = {
|
|
618
|
-
...this.options,
|
|
619
|
-
...options
|
|
620
|
-
};
|
|
621
|
-
return new api_builder_1.APIBuilder(root || ".", this.options);
|
|
622
|
-
}
|
|
623
|
-
glob(...patterns) {
|
|
624
|
-
if (this.globFunction) return this.globWithOptions(patterns);
|
|
625
|
-
return this.globWithOptions(patterns, {
|
|
626
|
-
dot: true
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
globWithOptions(patterns, ...options) {
|
|
630
|
-
const globFn = this.globFunction || pm;
|
|
631
|
-
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
632
|
-
var isMatch = this.globCache[patterns.join("\0")];
|
|
633
|
-
if (!isMatch) {
|
|
634
|
-
isMatch = globFn(patterns, ...options);
|
|
635
|
-
this.globCache[patterns.join("\0")] = isMatch;
|
|
636
|
-
}
|
|
637
|
-
this.options.filters.push((path)=>isMatch(path));
|
|
638
|
-
return this;
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
exports.Builder = Builder;
|
|
642
|
-
},
|
|
643
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
644
|
-
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
645
|
-
if (void 0 === k2) k2 = k;
|
|
646
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
647
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
648
|
-
enumerable: true,
|
|
649
|
-
get: function() {
|
|
650
|
-
return m[k];
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
Object.defineProperty(o, k2, desc);
|
|
654
|
-
} : function(o, m, k, k2) {
|
|
655
|
-
if (void 0 === k2) k2 = k;
|
|
656
|
-
o[k2] = m[k];
|
|
657
|
-
});
|
|
658
|
-
var __exportStar = this && this.__exportStar || function(m, exports) {
|
|
659
|
-
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
660
|
-
};
|
|
661
|
-
Object.defineProperty(exports, "__esModule", {
|
|
662
|
-
value: true
|
|
663
|
-
});
|
|
664
|
-
exports.fdir = void 0;
|
|
665
|
-
const builder_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/builder/index.js");
|
|
666
|
-
Object.defineProperty(exports, "fdir", {
|
|
667
|
-
enumerable: true,
|
|
668
|
-
get: function() {
|
|
669
|
-
return builder_1.Builder;
|
|
670
|
-
}
|
|
671
|
-
});
|
|
672
|
-
__exportStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/types.js"), exports);
|
|
673
|
-
},
|
|
674
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/types.js": function(__unused_webpack_module, exports) {
|
|
675
|
-
Object.defineProperty(exports, "__esModule", {
|
|
676
|
-
value: true
|
|
677
|
-
});
|
|
678
|
-
},
|
|
679
|
-
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
680
|
-
Object.defineProperty(exports, "__esModule", {
|
|
681
|
-
value: true
|
|
682
|
-
});
|
|
683
|
-
exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
|
|
684
|
-
const path_1 = __webpack_require__("node:path");
|
|
685
|
-
function cleanPath(path) {
|
|
686
|
-
let normalized = (0, path_1.normalize)(path);
|
|
687
|
-
if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
688
|
-
return normalized;
|
|
689
|
-
}
|
|
690
|
-
exports.cleanPath = cleanPath;
|
|
691
|
-
const SLASHES_REGEX = /[\\/]/g;
|
|
692
|
-
function convertSlashes(path, separator) {
|
|
693
|
-
return path.replace(SLASHES_REGEX, separator);
|
|
694
|
-
}
|
|
695
|
-
exports.convertSlashes = convertSlashes;
|
|
696
|
-
function isRootDirectory(path) {
|
|
697
|
-
return "/" === path || /^[a-z]:\\$/i.test(path);
|
|
698
|
-
}
|
|
699
|
-
exports.isRootDirectory = isRootDirectory;
|
|
700
|
-
function normalizePath(path, options) {
|
|
701
|
-
const { resolvePaths, normalizePath, pathSeparator } = options;
|
|
702
|
-
const pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
|
|
703
|
-
if (resolvePaths) path = (0, path_1.resolve)(path);
|
|
704
|
-
if (normalizePath || pathNeedsCleaning) path = cleanPath(path);
|
|
705
|
-
if ("." === path) return "";
|
|
706
|
-
const needsSeperator = path[path.length - 1] !== pathSeparator;
|
|
707
|
-
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
|
708
|
-
}
|
|
709
|
-
exports.normalizePath = normalizePath;
|
|
710
|
-
},
|
|
711
16
|
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
|
|
712
17
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
713
18
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
@@ -774,9 +79,9 @@ var __webpack_modules__ = {
|
|
|
774
79
|
module.exports = createColors();
|
|
775
80
|
module.exports.createColors = createColors;
|
|
776
81
|
},
|
|
777
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
778
|
-
const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
779
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
82
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
83
|
+
const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js");
|
|
84
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
|
|
780
85
|
function picomatch(glob, options, returnState = false) {
|
|
781
86
|
if (options && (null === options.windows || void 0 === options.windows)) options = {
|
|
782
87
|
...options,
|
|
@@ -787,7 +92,7 @@ var __webpack_modules__ = {
|
|
|
787
92
|
Object.assign(picomatch, pico);
|
|
788
93
|
module.exports = picomatch;
|
|
789
94
|
},
|
|
790
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
95
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js": function(module) {
|
|
791
96
|
const WIN_SLASH = '\\\\/';
|
|
792
97
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
793
98
|
const DOT_LITERAL = '\\.';
|
|
@@ -865,6 +170,7 @@ var __webpack_modules__ = {
|
|
|
865
170
|
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
866
171
|
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
867
172
|
REPLACEMENTS: {
|
|
173
|
+
__proto__: null,
|
|
868
174
|
'***': '*',
|
|
869
175
|
'**/**': '**',
|
|
870
176
|
'**/**/**': '**'
|
|
@@ -946,9 +252,9 @@ var __webpack_modules__ = {
|
|
|
946
252
|
}
|
|
947
253
|
};
|
|
948
254
|
},
|
|
949
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
950
|
-
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
951
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
255
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
256
|
+
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
|
|
257
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
|
|
952
258
|
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
|
|
953
259
|
const expandRange = (args, options)=>{
|
|
954
260
|
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
|
|
@@ -1734,11 +1040,11 @@ var __webpack_modules__ = {
|
|
|
1734
1040
|
};
|
|
1735
1041
|
module.exports = parse;
|
|
1736
1042
|
},
|
|
1737
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
1738
|
-
const scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1739
|
-
const parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1740
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1741
|
-
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1043
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1044
|
+
const scan = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js");
|
|
1045
|
+
const parse = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/parse.js");
|
|
1046
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
|
|
1047
|
+
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
|
|
1742
1048
|
const isObject = (val)=>val && 'object' == typeof val && !Array.isArray(val);
|
|
1743
1049
|
const picomatch = (glob, options, returnState = false)=>{
|
|
1744
1050
|
if (Array.isArray(glob)) {
|
|
@@ -1867,9 +1173,9 @@ var __webpack_modules__ = {
|
|
|
1867
1173
|
picomatch.constants = constants;
|
|
1868
1174
|
module.exports = picomatch;
|
|
1869
1175
|
},
|
|
1870
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
1871
|
-
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1872
|
-
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1176
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/scan.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1177
|
+
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
|
|
1178
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
|
|
1873
1179
|
const isPathSeparator = (code)=>code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
1874
1180
|
const depth = (token)=>{
|
|
1875
1181
|
if (true !== token.isPrefix) token.depth = token.isGlobstar ? 1 / 0 : 1;
|
|
@@ -2135,8 +1441,8 @@ var __webpack_modules__ = {
|
|
|
2135
1441
|
};
|
|
2136
1442
|
module.exports = scan;
|
|
2137
1443
|
},
|
|
2138
|
-
"../../node_modules/.pnpm/picomatch@4.0.
|
|
2139
|
-
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.
|
|
1444
|
+
"../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
1445
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/constants.js");
|
|
2140
1446
|
exports.isObject = (val)=>null !== val && 'object' == typeof val && !Array.isArray(val);
|
|
2141
1447
|
exports.hasRegexChars = (str)=>REGEX_SPECIAL_CHARS.test(str);
|
|
2142
1448
|
exports.isRegexChar = (str)=>1 === str.length && exports.hasRegexChars(str);
|
|
@@ -2677,7 +1983,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2677
1983
|
const applyCommonOptions = (cli)=>{
|
|
2678
1984
|
cli.option('-c, --config <config>', 'Specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'Specify the loader to load the config file, can be `jiti` or `native`', {
|
|
2679
1985
|
default: 'jiti'
|
|
2680
|
-
}).option('-r, --root <root>', 'Specify the project root directory, can be an absolute path or a path relative to cwd').option('--globals', 'Provide global APIs').option('--isolate', 'Run tests in an isolated environment').option('--include <include>', 'Match test files').option('--exclude <exclude>', 'Exclude files from test').option('-u, --update', 'Update snapshot files').option('--project <name>', 'Run only projects that match the name, can be a full name or wildcards pattern').option('--passWithNoTests', 'Allows the test suite to pass when no files are found').option('--printConsoleTrace', 'Print console traces when calling any console method').option('--disableConsoleIntercept', 'Disable console intercept').option('--slowTestThreshold <value>', 'The number of milliseconds after which a test or suite is considered slow').option('--reporter <reporter>', 'Specify the reporter to use').option('-t, --testNamePattern <value>', 'Run only tests with a name that matches the regex').option('--testEnvironment <name>', 'The environment that will be used for testing').option('--testTimeout <value>', 'Timeout of a test in milliseconds').option('--hookTimeout <value>', 'Timeout of hook in milliseconds').option('--retry <retry>', 'Number of times to retry a test if it fails').option('--maxConcurrency <value>', 'Maximum number of concurrent tests').option('--clearMocks', 'Automatically clear mock calls, instances, contexts and results before every test').option('--resetMocks', 'Automatically reset mock state before every test').option('--restoreMocks', 'Automatically restore mock state and implementation before every test').option('--unstubGlobals', 'Restores all global variables that were changed with `rstest.stubGlobal` before every test').option('--unstubEnvs', 'Restores all `process.env` values that were changed with `rstest.stubEnv` before every test');
|
|
1986
|
+
}).option('-r, --root <root>', 'Specify the project root directory, can be an absolute path or a path relative to cwd').option('--globals', 'Provide global APIs').option('--isolate', 'Run tests in an isolated environment').option('--include <include>', 'Match test files').option('--exclude <exclude>', 'Exclude files from test').option('-u, --update', 'Update snapshot files').option('--coverage', 'Enable code coverage collection').option('--project <name>', 'Run only projects that match the name, can be a full name or wildcards pattern').option('--passWithNoTests', 'Allows the test suite to pass when no files are found').option('--printConsoleTrace', 'Print console traces when calling any console method').option('--disableConsoleIntercept', 'Disable console intercept').option('--slowTestThreshold <value>', 'The number of milliseconds after which a test or suite is considered slow').option('--reporter <reporter>', 'Specify the reporter to use').option('-t, --testNamePattern <value>', 'Run only tests with a name that matches the regex').option('--testEnvironment <name>', 'The environment that will be used for testing').option('--testTimeout <value>', 'Timeout of a test in milliseconds').option('--hookTimeout <value>', 'Timeout of hook in milliseconds').option('--retry <retry>', 'Number of times to retry a test if it fails').option('--maxConcurrency <value>', 'Maximum number of concurrent tests').option('--clearMocks', 'Automatically clear mock calls, instances, contexts and results before every test').option('--resetMocks', 'Automatically reset mock state before every test').option('--restoreMocks', 'Automatically restore mock state and implementation before every test').option('--unstubGlobals', 'Restores all global variables that were changed with `rstest.stubGlobal` before every test').option('--unstubEnvs', 'Restores all `process.env` values that were changed with `rstest.stubEnv` before every test');
|
|
2681
1987
|
};
|
|
2682
1988
|
const runRest = async ({ options, filters, command })=>{
|
|
2683
1989
|
let rstest;
|
|
@@ -2685,8 +1991,8 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2685
1991
|
const { initCli } = await __webpack_require__.e("223").then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
|
|
2686
1992
|
const { config, configFilePath, projects } = await initCli(options);
|
|
2687
1993
|
const { createRstest } = await Promise.all([
|
|
2688
|
-
__webpack_require__.e("
|
|
2689
|
-
__webpack_require__.e("
|
|
1994
|
+
__webpack_require__.e("120"),
|
|
1995
|
+
__webpack_require__.e("669")
|
|
2690
1996
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
|
|
2691
1997
|
rstest = createRstest({
|
|
2692
1998
|
config,
|
|
@@ -2712,7 +2018,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2712
2018
|
function setupCommands() {
|
|
2713
2019
|
const cli = dist('rstest');
|
|
2714
2020
|
cli.help();
|
|
2715
|
-
cli.version("0.
|
|
2021
|
+
cli.version("0.4.1");
|
|
2716
2022
|
applyCommonOptions(cli);
|
|
2717
2023
|
cli.command('[...filters]', 'run tests').option('-w, --watch', 'Run tests in watch mode').action(async (filters, options)=>{
|
|
2718
2024
|
(0, prepare.N)();
|
|
@@ -2748,8 +2054,8 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2748
2054
|
const { initCli } = await __webpack_require__.e("223").then(__webpack_require__.bind(__webpack_require__, "./src/cli/init.ts"));
|
|
2749
2055
|
const { config, configFilePath, projects } = await initCli(options);
|
|
2750
2056
|
const { createRstest } = await Promise.all([
|
|
2751
|
-
__webpack_require__.e("
|
|
2752
|
-
__webpack_require__.e("
|
|
2057
|
+
__webpack_require__.e("120"),
|
|
2058
|
+
__webpack_require__.e("669")
|
|
2753
2059
|
]).then(__webpack_require__.bind(__webpack_require__, "./src/core/index.ts"));
|
|
2754
2060
|
const rstest = createRstest({
|
|
2755
2061
|
config,
|
|
@@ -2785,7 +2091,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2785
2091
|
if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
|
|
2786
2092
|
}
|
|
2787
2093
|
function showRstest() {
|
|
2788
|
-
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.
|
|
2094
|
+
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.greet(" Rstest v0.4.1");
|
|
2789
2095
|
_utils_logger__WEBPACK_IMPORTED_MODULE_0__.vF.log('');
|
|
2790
2096
|
}
|
|
2791
2097
|
},
|
|
@@ -2795,7 +2101,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2795
2101
|
Z9: ()=>loadConfig,
|
|
2796
2102
|
wX: ()=>withDefaultConfig
|
|
2797
2103
|
});
|
|
2798
|
-
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("
|
|
2104
|
+
var node_fs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("fs");
|
|
2799
2105
|
var _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@rsbuild/core");
|
|
2800
2106
|
var pathe__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("pathe");
|
|
2801
2107
|
var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/utils/index.ts");
|
|
@@ -2868,7 +2174,30 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2868
2174
|
unstubEnvs: false,
|
|
2869
2175
|
maxConcurrency: 5,
|
|
2870
2176
|
printConsoleTrace: false,
|
|
2871
|
-
disableConsoleIntercept: false
|
|
2177
|
+
disableConsoleIntercept: false,
|
|
2178
|
+
coverage: {
|
|
2179
|
+
exclude: [
|
|
2180
|
+
'**/node_modules/**',
|
|
2181
|
+
'**/dist/**',
|
|
2182
|
+
'**/test/**',
|
|
2183
|
+
'**/__tests__/**',
|
|
2184
|
+
'**/__mocks__/**',
|
|
2185
|
+
'**/*.{test,spec}.[jt]s',
|
|
2186
|
+
'**/*.{test,spec}.[c|m][jt]s',
|
|
2187
|
+
'**/*.{test,spec}.[jt]sx',
|
|
2188
|
+
'**/*.{test,spec}.[c|m][jt]sx'
|
|
2189
|
+
],
|
|
2190
|
+
enabled: false,
|
|
2191
|
+
provider: 'istanbul',
|
|
2192
|
+
reporters: [
|
|
2193
|
+
'text',
|
|
2194
|
+
'html',
|
|
2195
|
+
'clover',
|
|
2196
|
+
'json'
|
|
2197
|
+
],
|
|
2198
|
+
reportsDirectory: './coverage',
|
|
2199
|
+
clean: true
|
|
2200
|
+
}
|
|
2872
2201
|
});
|
|
2873
2202
|
const withDefaultConfig = (config)=>{
|
|
2874
2203
|
const merged = mergeRstestConfig(createDefaultConfig(), config);
|
|
@@ -2877,6 +2206,10 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2877
2206
|
_utils__WEBPACK_IMPORTED_MODULE_3__.EJ
|
|
2878
2207
|
]);
|
|
2879
2208
|
merged.reporters = config.reporters ?? merged.reporters;
|
|
2209
|
+
merged.coverage ??= {};
|
|
2210
|
+
merged.coverage.reporters = config.coverage?.reporters ?? merged.coverage?.reporters;
|
|
2211
|
+
const reportsDirectory = merged.coverage.reportsDirectory;
|
|
2212
|
+
merged.coverage.reportsDirectory = (0, pathe__WEBPACK_IMPORTED_MODULE_2__.isAbsolute)(reportsDirectory) ? reportsDirectory : (0, pathe__WEBPACK_IMPORTED_MODULE_2__.resolve)(merged.root, reportsDirectory);
|
|
2880
2213
|
merged.pool = 'string' == typeof config.pool ? {
|
|
2881
2214
|
type: config.pool
|
|
2882
2215
|
} : merged.pool;
|
|
@@ -2889,11 +2222,9 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2889
2222
|
WB: ()=>TS_CONFIG_FILE,
|
|
2890
2223
|
kv: ()=>DEFAULT_CONFIG_EXTENSIONS,
|
|
2891
2224
|
t: ()=>DEFAULT_CONFIG_NAME,
|
|
2892
|
-
vO: ()=>TEST_DELIMITER,
|
|
2893
2225
|
zZ: ()=>TEMP_RSTEST_OUTPUT_DIR
|
|
2894
2226
|
});
|
|
2895
2227
|
const DEFAULT_CONFIG_NAME = 'rstest.config';
|
|
2896
|
-
const TEST_DELIMITER = '>';
|
|
2897
2228
|
const TEMP_RSTEST_OUTPUT_DIR = 'dist/.rstest-temp';
|
|
2898
2229
|
const TEMP_RSTEST_OUTPUT_DIR_GLOB = '**/dist/.rstest-temp';
|
|
2899
2230
|
const DEFAULT_CONFIG_EXTENSIONS = [
|
|
@@ -2923,7 +2254,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2923
2254
|
var pathe__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("pathe");
|
|
2924
2255
|
var picocolors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
2925
2256
|
var picocolors__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_2__);
|
|
2926
|
-
|
|
2257
|
+
__webpack_require__("./src/utils/constants.ts");
|
|
2927
2258
|
function getAbsolutePath(base, filepath) {
|
|
2928
2259
|
return (0, pathe__WEBPACK_IMPORTED_MODULE_0__.isAbsolute)(filepath) ? filepath : (0, pathe__WEBPACK_IMPORTED_MODULE_0__.join)(base, filepath);
|
|
2929
2260
|
}
|
|
@@ -2970,7 +2301,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
2970
2301
|
return time;
|
|
2971
2302
|
};
|
|
2972
2303
|
const getTaskNames = (test)=>(test.parentNames || []).concat(test.name).filter(Boolean);
|
|
2973
|
-
const getTaskNameWithPrefix = (test, delimiter =
|
|
2304
|
+
const getTaskNameWithPrefix = (test, delimiter = ">")=>getTaskNames(test).join(` ${delimiter} `);
|
|
2974
2305
|
const REGEXP_FLAG_PREFIX = 'RSTEST_REGEXP:';
|
|
2975
2306
|
const wrapRegex = (value)=>`${REGEXP_FLAG_PREFIX}${value.toString()}`;
|
|
2976
2307
|
const serializableConfig = (normalizedConfig)=>{
|
|
@@ -3069,7 +2400,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3069
2400
|
zZ: ()=>constants.zZ,
|
|
3070
2401
|
fN: ()=>helper.fN,
|
|
3071
2402
|
vF: ()=>logger.vF,
|
|
3072
|
-
vO: ()=>
|
|
2403
|
+
vO: ()=>">",
|
|
3073
2404
|
tG: ()=>getTestEntries,
|
|
3074
2405
|
FI: ()=>helper.FI,
|
|
3075
2406
|
kv: ()=>constants.kv,
|
|
@@ -3090,11 +2421,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3090
2421
|
var constants = __webpack_require__("./src/utils/constants.ts");
|
|
3091
2422
|
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
3092
2423
|
var logger = __webpack_require__("./src/utils/logger.ts");
|
|
3093
|
-
var external_node_fs_ = __webpack_require__("
|
|
2424
|
+
var external_node_fs_ = __webpack_require__("fs");
|
|
3094
2425
|
var promises_ = __webpack_require__("node:fs/promises");
|
|
3095
2426
|
var external_node_module_ = __webpack_require__("node:module");
|
|
3096
2427
|
var external_pathe_ = __webpack_require__("pathe");
|
|
3097
|
-
var dist = __webpack_require__("../../node_modules/.pnpm/tinyglobby@0.2.
|
|
2428
|
+
var dist = __webpack_require__("../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs");
|
|
3098
2429
|
const filterFiles = (testFiles, filters, dir)=>{
|
|
3099
2430
|
if (!filters.length) return testFiles;
|
|
3100
2431
|
const fileFilters = 'win32' === process.platform ? filters.map((f)=>f.split(external_pathe_["default"].sep).join('/')) : filters;
|
|
@@ -3185,393 +2516,851 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3185
2516
|
];
|
|
3186
2517
|
throw err;
|
|
3187
2518
|
}
|
|
3188
|
-
}));
|
|
3189
|
-
const prettyTestPath = (testPath)=>{
|
|
3190
|
-
const { dir, base } = (0, helper.P2)(testPath);
|
|
3191
|
-
return `${'.' !== dir ? helper.yW.gray(`${dir}/`) : ''}${helper.yW.cyan(base)}`;
|
|
2519
|
+
}));
|
|
2520
|
+
const prettyTestPath = (testPath)=>{
|
|
2521
|
+
const { dir, base } = (0, helper.P2)(testPath);
|
|
2522
|
+
return `${'.' !== dir ? helper.yW.gray(`${dir}/`) : ''}${helper.yW.cyan(base)}`;
|
|
2523
|
+
};
|
|
2524
|
+
const formatTestPath = (root, testFilePath)=>{
|
|
2525
|
+
let testPath = testFilePath;
|
|
2526
|
+
if (external_pathe_["default"].isAbsolute(testPath) && testPath.includes(root)) testPath = external_pathe_["default"].relative(root, testPath);
|
|
2527
|
+
return prettyTestPath(testPath);
|
|
2528
|
+
};
|
|
2529
|
+
},
|
|
2530
|
+
"./src/utils/logger.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
2531
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2532
|
+
_o: ()=>isDebug,
|
|
2533
|
+
mT: ()=>clearScreen,
|
|
2534
|
+
vF: ()=>src_logger
|
|
2535
|
+
});
|
|
2536
|
+
var external_node_os_ = __webpack_require__("node:os");
|
|
2537
|
+
var external_node_tty_ = __webpack_require__("node:tty");
|
|
2538
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"].argv) {
|
|
2539
|
+
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
2540
|
+
const position = argv.indexOf(prefix + flag);
|
|
2541
|
+
const terminatorPosition = argv.indexOf('--');
|
|
2542
|
+
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
2543
|
+
}
|
|
2544
|
+
const { env } = __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"];
|
|
2545
|
+
let flagForceColor;
|
|
2546
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
2547
|
+
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
2548
|
+
function envForceColor() {
|
|
2549
|
+
if (!('FORCE_COLOR' in env)) return;
|
|
2550
|
+
if ('true' === env.FORCE_COLOR) return 1;
|
|
2551
|
+
if ('false' === env.FORCE_COLOR) return 0;
|
|
2552
|
+
if (0 === env.FORCE_COLOR.length) return 1;
|
|
2553
|
+
const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
2554
|
+
if (![
|
|
2555
|
+
0,
|
|
2556
|
+
1,
|
|
2557
|
+
2,
|
|
2558
|
+
3
|
|
2559
|
+
].includes(level)) return;
|
|
2560
|
+
return level;
|
|
2561
|
+
}
|
|
2562
|
+
function translateLevel(level) {
|
|
2563
|
+
if (0 === level) return false;
|
|
2564
|
+
return {
|
|
2565
|
+
level,
|
|
2566
|
+
hasBasic: true,
|
|
2567
|
+
has256: level >= 2,
|
|
2568
|
+
has16m: level >= 3
|
|
2569
|
+
};
|
|
2570
|
+
}
|
|
2571
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
2572
|
+
const noFlagForceColor = envForceColor();
|
|
2573
|
+
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
2574
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
2575
|
+
if (0 === forceColor) return 0;
|
|
2576
|
+
if (sniffFlags) {
|
|
2577
|
+
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
|
|
2578
|
+
if (hasFlag('color=256')) return 2;
|
|
2579
|
+
}
|
|
2580
|
+
if ('TF_BUILD' in env && 'AGENT_NAME' in env) return 1;
|
|
2581
|
+
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
2582
|
+
const min = forceColor || 0;
|
|
2583
|
+
if ('dumb' === env.TERM) return min;
|
|
2584
|
+
if ('win32' === __WEBPACK_EXTERNAL_MODULE_node_process_786449bf__["default"].platform) {
|
|
2585
|
+
const osRelease = external_node_os_["default"].release().split('.');
|
|
2586
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
2587
|
+
return 1;
|
|
2588
|
+
}
|
|
2589
|
+
if ('CI' in env) {
|
|
2590
|
+
if ([
|
|
2591
|
+
'GITHUB_ACTIONS',
|
|
2592
|
+
'GITEA_ACTIONS',
|
|
2593
|
+
'CIRCLECI'
|
|
2594
|
+
].some((key)=>key in env)) return 3;
|
|
2595
|
+
if ([
|
|
2596
|
+
'TRAVIS',
|
|
2597
|
+
'APPVEYOR',
|
|
2598
|
+
'GITLAB_CI',
|
|
2599
|
+
'BUILDKITE',
|
|
2600
|
+
'DRONE'
|
|
2601
|
+
].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
|
|
2602
|
+
return min;
|
|
2603
|
+
}
|
|
2604
|
+
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
2605
|
+
if ('truecolor' === env.COLORTERM) return 3;
|
|
2606
|
+
if ('xterm-kitty' === env.TERM) return 3;
|
|
2607
|
+
if ('xterm-ghostty' === env.TERM) return 3;
|
|
2608
|
+
if ('TERM_PROGRAM' in env) {
|
|
2609
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
2610
|
+
switch(env.TERM_PROGRAM){
|
|
2611
|
+
case 'iTerm.app':
|
|
2612
|
+
return version >= 3 ? 3 : 2;
|
|
2613
|
+
case 'Apple_Terminal':
|
|
2614
|
+
return 2;
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
2618
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
2619
|
+
if ('COLORTERM' in env) return 1;
|
|
2620
|
+
return min;
|
|
2621
|
+
}
|
|
2622
|
+
function createSupportsColor(stream, options = {}) {
|
|
2623
|
+
const level = _supportsColor(stream, {
|
|
2624
|
+
streamIsTTY: stream && stream.isTTY,
|
|
2625
|
+
...options
|
|
2626
|
+
});
|
|
2627
|
+
return translateLevel(level);
|
|
2628
|
+
}
|
|
2629
|
+
const supportsColor = {
|
|
2630
|
+
stdout: createSupportsColor({
|
|
2631
|
+
isTTY: external_node_tty_["default"].isatty(1)
|
|
2632
|
+
}),
|
|
2633
|
+
stderr: createSupportsColor({
|
|
2634
|
+
isTTY: external_node_tty_["default"].isatty(2)
|
|
2635
|
+
})
|
|
2636
|
+
};
|
|
2637
|
+
const supports_color = supportsColor;
|
|
2638
|
+
const colorLevel = supports_color.stdout ? supports_color.stdout.level : 0;
|
|
2639
|
+
let errorStackRegExp = /at\s.*:\d+:\d+[\s\)]*$/;
|
|
2640
|
+
let anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/;
|
|
2641
|
+
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
|
2642
|
+
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
2643
|
+
let string = '' + input;
|
|
2644
|
+
let index = string.indexOf(close, open.length);
|
|
2645
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
2646
|
+
} : String;
|
|
2647
|
+
let replaceClose = (string, close, replace, index)=>{
|
|
2648
|
+
let start = string.substring(0, index) + replace;
|
|
2649
|
+
let end = string.substring(index + close.length);
|
|
2650
|
+
let nextIndex = end.indexOf(close);
|
|
2651
|
+
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
2652
|
+
};
|
|
2653
|
+
const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
|
|
2654
|
+
const red = formatter('\x1b[31m', '\x1b[39m');
|
|
2655
|
+
const green = formatter('\x1b[32m', '\x1b[39m');
|
|
2656
|
+
const yellow = formatter('\x1b[33m', '\x1b[39m');
|
|
2657
|
+
const magenta = formatter('\x1b[35m', '\x1b[39m');
|
|
2658
|
+
const cyan = formatter('\x1b[36m', '\x1b[39m');
|
|
2659
|
+
const gray = formatter('\x1b[90m', '\x1b[39m');
|
|
2660
|
+
let startColor = [
|
|
2661
|
+
189,
|
|
2662
|
+
255,
|
|
2663
|
+
243
|
|
2664
|
+
];
|
|
2665
|
+
let endColor = [
|
|
2666
|
+
74,
|
|
2667
|
+
194,
|
|
2668
|
+
154
|
|
2669
|
+
];
|
|
2670
|
+
let isWord = (char)=>!/[\s\n]/.test(char);
|
|
2671
|
+
let gradient = (message)=>{
|
|
2672
|
+
if (colorLevel < 3) return 2 === colorLevel ? bold(cyan(message)) : message;
|
|
2673
|
+
let chars = [
|
|
2674
|
+
...message
|
|
2675
|
+
];
|
|
2676
|
+
let steps = chars.filter(isWord).length;
|
|
2677
|
+
let r = startColor[0];
|
|
2678
|
+
let g = startColor[1];
|
|
2679
|
+
let b = startColor[2];
|
|
2680
|
+
let rStep = (endColor[0] - r) / steps;
|
|
2681
|
+
let gStep = (endColor[1] - g) / steps;
|
|
2682
|
+
let bStep = (endColor[2] - b) / steps;
|
|
2683
|
+
let output = '';
|
|
2684
|
+
for (let char of chars){
|
|
2685
|
+
if (isWord(char)) {
|
|
2686
|
+
r += rStep;
|
|
2687
|
+
g += gStep;
|
|
2688
|
+
b += bStep;
|
|
2689
|
+
}
|
|
2690
|
+
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
2691
|
+
}
|
|
2692
|
+
return bold(output);
|
|
2693
|
+
};
|
|
2694
|
+
let LOG_LEVEL = {
|
|
2695
|
+
silent: -1,
|
|
2696
|
+
error: 0,
|
|
2697
|
+
warn: 1,
|
|
2698
|
+
info: 2,
|
|
2699
|
+
log: 2,
|
|
2700
|
+
verbose: 3
|
|
2701
|
+
};
|
|
2702
|
+
let LOG_TYPES = {
|
|
2703
|
+
error: {
|
|
2704
|
+
label: 'error',
|
|
2705
|
+
level: 'error',
|
|
2706
|
+
color: red
|
|
2707
|
+
},
|
|
2708
|
+
warn: {
|
|
2709
|
+
label: 'warn',
|
|
2710
|
+
level: 'warn',
|
|
2711
|
+
color: yellow
|
|
2712
|
+
},
|
|
2713
|
+
info: {
|
|
2714
|
+
label: 'info',
|
|
2715
|
+
level: 'info',
|
|
2716
|
+
color: cyan
|
|
2717
|
+
},
|
|
2718
|
+
start: {
|
|
2719
|
+
label: 'start',
|
|
2720
|
+
level: 'info',
|
|
2721
|
+
color: cyan
|
|
2722
|
+
},
|
|
2723
|
+
ready: {
|
|
2724
|
+
label: 'ready',
|
|
2725
|
+
level: 'info',
|
|
2726
|
+
color: green
|
|
2727
|
+
},
|
|
2728
|
+
success: {
|
|
2729
|
+
label: 'success',
|
|
2730
|
+
level: 'info',
|
|
2731
|
+
color: green
|
|
2732
|
+
},
|
|
2733
|
+
log: {
|
|
2734
|
+
level: 'info'
|
|
2735
|
+
},
|
|
2736
|
+
debug: {
|
|
2737
|
+
label: 'debug',
|
|
2738
|
+
level: 'verbose',
|
|
2739
|
+
color: magenta
|
|
2740
|
+
}
|
|
2741
|
+
};
|
|
2742
|
+
let createLogger = (options = {})=>{
|
|
2743
|
+
let maxLevel = options.level || 'info';
|
|
2744
|
+
let log = (type, message, ...args)=>{
|
|
2745
|
+
if (LOG_LEVEL[LOG_TYPES[type].level] > LOG_LEVEL[maxLevel]) return;
|
|
2746
|
+
if (null == message) return console.log();
|
|
2747
|
+
let logType = LOG_TYPES[type];
|
|
2748
|
+
let label = '';
|
|
2749
|
+
let text = '';
|
|
2750
|
+
if ('label' in logType) {
|
|
2751
|
+
label = (logType.label || '').padEnd(7);
|
|
2752
|
+
label = bold(logType.color ? logType.color(label) : label);
|
|
2753
|
+
}
|
|
2754
|
+
if (message instanceof Error) if (message.stack) {
|
|
2755
|
+
let [name, ...rest] = message.stack.split('\n');
|
|
2756
|
+
if (name.startsWith('Error: ')) name = name.slice(7);
|
|
2757
|
+
text = `${name}\n${gray(rest.join('\n'))}`;
|
|
2758
|
+
} else text = message.message;
|
|
2759
|
+
else if ('error' === logType.level && 'string' == typeof message) {
|
|
2760
|
+
let lines = message.split('\n');
|
|
2761
|
+
text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
|
|
2762
|
+
} else text = `${message}`;
|
|
2763
|
+
console.log(label.length ? `${label} ${text}` : text, ...args);
|
|
2764
|
+
};
|
|
2765
|
+
let logger = {
|
|
2766
|
+
greet: (message)=>log('log', gradient(message))
|
|
2767
|
+
};
|
|
2768
|
+
Object.keys(LOG_TYPES).forEach((key)=>{
|
|
2769
|
+
logger[key] = (...args)=>log(key, ...args);
|
|
2770
|
+
});
|
|
2771
|
+
Object.defineProperty(logger, 'level', {
|
|
2772
|
+
get: ()=>maxLevel,
|
|
2773
|
+
set (val) {
|
|
2774
|
+
maxLevel = val;
|
|
2775
|
+
}
|
|
2776
|
+
});
|
|
2777
|
+
logger.override = (customLogger)=>{
|
|
2778
|
+
Object.assign(logger, customLogger);
|
|
2779
|
+
};
|
|
2780
|
+
return logger;
|
|
3192
2781
|
};
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
2782
|
+
let src_logger = createLogger();
|
|
2783
|
+
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
2784
|
+
const isDebug = ()=>{
|
|
2785
|
+
if (!process.env.DEBUG) return false;
|
|
2786
|
+
const values = process.env.DEBUG.toLocaleLowerCase().split(',');
|
|
2787
|
+
return [
|
|
2788
|
+
'rstest',
|
|
2789
|
+
'rsbuild',
|
|
2790
|
+
'builder',
|
|
2791
|
+
'*'
|
|
2792
|
+
].some((key)=>values.includes(key));
|
|
2793
|
+
};
|
|
2794
|
+
if (isDebug()) src_logger.level = 'verbose';
|
|
2795
|
+
function getTime() {
|
|
2796
|
+
const now = new Date();
|
|
2797
|
+
const hours = String(now.getHours()).padStart(2, '0');
|
|
2798
|
+
const minutes = String(now.getMinutes()).padStart(2, '0');
|
|
2799
|
+
const seconds = String(now.getSeconds()).padStart(2, '0');
|
|
2800
|
+
return `${hours}:${minutes}:${seconds}`;
|
|
2801
|
+
}
|
|
2802
|
+
src_logger.override({
|
|
2803
|
+
debug: (message, ...args)=>{
|
|
2804
|
+
if ('verbose' !== src_logger.level) return;
|
|
2805
|
+
const time = helper.yW.gray(getTime());
|
|
2806
|
+
console.log(` ${helper.yW.magenta('rstest')} ${time} ${message}`, ...args);
|
|
2807
|
+
}
|
|
2808
|
+
});
|
|
2809
|
+
const clearScreen = (force = false)=>{
|
|
2810
|
+
if (!isDebug() || force) console.log('\x1Bc');
|
|
3197
2811
|
};
|
|
3198
2812
|
},
|
|
3199
|
-
"
|
|
2813
|
+
"@rsbuild/core": function(module) {
|
|
2814
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__;
|
|
2815
|
+
},
|
|
2816
|
+
events: function(module) {
|
|
2817
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_events__;
|
|
2818
|
+
},
|
|
2819
|
+
fs: function(module) {
|
|
2820
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__;
|
|
2821
|
+
},
|
|
2822
|
+
"node:fs/promises": function(module) {
|
|
2823
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__;
|
|
2824
|
+
},
|
|
2825
|
+
"node:module": function(module) {
|
|
2826
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__;
|
|
2827
|
+
},
|
|
2828
|
+
"node:os": function(module) {
|
|
2829
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__;
|
|
2830
|
+
},
|
|
2831
|
+
"node:path": function(module) {
|
|
2832
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__;
|
|
2833
|
+
},
|
|
2834
|
+
"node:tty": function(module) {
|
|
2835
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__;
|
|
2836
|
+
},
|
|
2837
|
+
pathe: function(module) {
|
|
2838
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_pathe__;
|
|
2839
|
+
},
|
|
2840
|
+
"../../node_modules/.pnpm/tinyglobby@0.2.15/node_modules/tinyglobby/dist/index.mjs": function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
3200
2841
|
__webpack_require__.d(__webpack_exports__, {
|
|
3201
|
-
|
|
3202
|
-
|
|
3203
|
-
vF: ()=>src_logger
|
|
2842
|
+
ey: ()=>isDynamicPattern,
|
|
2843
|
+
glob: ()=>glob
|
|
3204
2844
|
});
|
|
3205
|
-
var
|
|
3206
|
-
var
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
return
|
|
2845
|
+
var external_node_fs_ = __webpack_require__("fs");
|
|
2846
|
+
var external_node_path_ = __webpack_require__("node:path");
|
|
2847
|
+
var __require = /* @__PURE__ */ (0, __WEBPACK_EXTERNAL_MODULE_module__.createRequire)(import.meta.url);
|
|
2848
|
+
function cleanPath(path) {
|
|
2849
|
+
let normalized = (0, external_node_path_.normalize)(path);
|
|
2850
|
+
if (normalized.length > 1 && normalized[normalized.length - 1] === external_node_path_.sep) normalized = normalized.substring(0, normalized.length - 1);
|
|
2851
|
+
return normalized;
|
|
3212
2852
|
}
|
|
3213
|
-
const
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
3217
|
-
function envForceColor() {
|
|
3218
|
-
if (!('FORCE_COLOR' in env)) return;
|
|
3219
|
-
if ('true' === env.FORCE_COLOR) return 1;
|
|
3220
|
-
if ('false' === env.FORCE_COLOR) return 0;
|
|
3221
|
-
if (0 === env.FORCE_COLOR.length) return 1;
|
|
3222
|
-
const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
3223
|
-
if (![
|
|
3224
|
-
0,
|
|
3225
|
-
1,
|
|
3226
|
-
2,
|
|
3227
|
-
3
|
|
3228
|
-
].includes(level)) return;
|
|
3229
|
-
return level;
|
|
2853
|
+
const SLASHES_REGEX = /[\\/]/g;
|
|
2854
|
+
function convertSlashes(path, separator) {
|
|
2855
|
+
return path.replace(SLASHES_REGEX, separator);
|
|
3230
2856
|
}
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
return
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
2857
|
+
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
|
2858
|
+
function isRootDirectory(path) {
|
|
2859
|
+
return "/" === path || WINDOWS_ROOT_DIR_REGEX.test(path);
|
|
2860
|
+
}
|
|
2861
|
+
function normalizePath(path, options) {
|
|
2862
|
+
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
|
2863
|
+
const pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
|
|
2864
|
+
if (resolvePaths) path = (0, external_node_path_.resolve)(path);
|
|
2865
|
+
if (normalizePath$1 || pathNeedsCleaning) path = cleanPath(path);
|
|
2866
|
+
if ("." === path) return "";
|
|
2867
|
+
const needsSeperator = path[path.length - 1] !== pathSeparator;
|
|
2868
|
+
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
|
2869
|
+
}
|
|
2870
|
+
function joinPathWithBasePath(filename, directoryPath) {
|
|
2871
|
+
return directoryPath + filename;
|
|
2872
|
+
}
|
|
2873
|
+
function joinPathWithRelativePath(root, options) {
|
|
2874
|
+
return function(filename, directoryPath) {
|
|
2875
|
+
const sameRoot = directoryPath.startsWith(root);
|
|
2876
|
+
if (sameRoot) return directoryPath.slice(root.length) + filename;
|
|
2877
|
+
return convertSlashes((0, external_node_path_.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
|
3238
2878
|
};
|
|
3239
2879
|
}
|
|
3240
|
-
function
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
if (
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
2880
|
+
function joinPath(filename) {
|
|
2881
|
+
return filename;
|
|
2882
|
+
}
|
|
2883
|
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
|
2884
|
+
return directoryPath + filename + separator;
|
|
2885
|
+
}
|
|
2886
|
+
function build$7(root, options) {
|
|
2887
|
+
const { relativePaths, includeBasePath } = options;
|
|
2888
|
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
|
2889
|
+
}
|
|
2890
|
+
function pushDirectoryWithRelativePath(root) {
|
|
2891
|
+
return function(directoryPath, paths) {
|
|
2892
|
+
paths.push(directoryPath.substring(root.length) || ".");
|
|
2893
|
+
};
|
|
2894
|
+
}
|
|
2895
|
+
function pushDirectoryFilterWithRelativePath(root) {
|
|
2896
|
+
return function(directoryPath, paths, filters) {
|
|
2897
|
+
const relativePath = directoryPath.substring(root.length) || ".";
|
|
2898
|
+
if (filters.every((filter)=>filter(relativePath, true))) paths.push(relativePath);
|
|
2899
|
+
};
|
|
2900
|
+
}
|
|
2901
|
+
const pushDirectory = (directoryPath, paths)=>{
|
|
2902
|
+
paths.push(directoryPath || ".");
|
|
2903
|
+
};
|
|
2904
|
+
const pushDirectoryFilter = (directoryPath, paths, filters)=>{
|
|
2905
|
+
const path = directoryPath || ".";
|
|
2906
|
+
if (filters.every((filter)=>filter(path, true))) paths.push(path);
|
|
2907
|
+
};
|
|
2908
|
+
const empty$2 = ()=>{};
|
|
2909
|
+
function build$6(root, options) {
|
|
2910
|
+
const { includeDirs, filters, relativePaths } = options;
|
|
2911
|
+
if (!includeDirs) return empty$2;
|
|
2912
|
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
|
2913
|
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
|
2914
|
+
}
|
|
2915
|
+
const pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
|
|
2916
|
+
if (filters.every((filter)=>filter(filename, false))) counts.files++;
|
|
2917
|
+
};
|
|
2918
|
+
const pushFileFilter = (filename, paths, _counts, filters)=>{
|
|
2919
|
+
if (filters.every((filter)=>filter(filename, false))) paths.push(filename);
|
|
2920
|
+
};
|
|
2921
|
+
const pushFileCount = (_filename, _paths, counts, _filters)=>{
|
|
2922
|
+
counts.files++;
|
|
2923
|
+
};
|
|
2924
|
+
const pushFile = (filename, paths)=>{
|
|
2925
|
+
paths.push(filename);
|
|
2926
|
+
};
|
|
2927
|
+
const empty$1 = ()=>{};
|
|
2928
|
+
function build$5(options) {
|
|
2929
|
+
const { excludeFiles, filters, onlyCounts } = options;
|
|
2930
|
+
if (excludeFiles) return empty$1;
|
|
2931
|
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
|
2932
|
+
if (onlyCounts) return pushFileCount;
|
|
2933
|
+
return pushFile;
|
|
2934
|
+
}
|
|
2935
|
+
const getArray = (paths)=>paths;
|
|
2936
|
+
const getArrayGroup = ()=>[
|
|
2937
|
+
""
|
|
2938
|
+
].slice(0, 0);
|
|
2939
|
+
function build$4(options) {
|
|
2940
|
+
return options.group ? getArrayGroup : getArray;
|
|
2941
|
+
}
|
|
2942
|
+
const groupFiles = (groups, directory, files)=>{
|
|
2943
|
+
groups.push({
|
|
2944
|
+
directory,
|
|
2945
|
+
files,
|
|
2946
|
+
dir: directory
|
|
2947
|
+
});
|
|
2948
|
+
};
|
|
2949
|
+
const empty = ()=>{};
|
|
2950
|
+
function build$3(options) {
|
|
2951
|
+
return options.group ? groupFiles : empty;
|
|
2952
|
+
}
|
|
2953
|
+
const resolveSymlinksAsync = function(path, state, callback$1) {
|
|
2954
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
2955
|
+
queue.enqueue();
|
|
2956
|
+
fs.realpath(path, (error, resolvedPath)=>{
|
|
2957
|
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
|
2958
|
+
fs.stat(resolvedPath, (error$1, stat)=>{
|
|
2959
|
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
|
2960
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
|
2961
|
+
callback$1(stat, resolvedPath);
|
|
2962
|
+
queue.dequeue(null, state);
|
|
2963
|
+
});
|
|
2964
|
+
});
|
|
2965
|
+
};
|
|
2966
|
+
const resolveSymlinks = function(path, state, callback$1) {
|
|
2967
|
+
const { queue, fs, options: { suppressErrors } } = state;
|
|
2968
|
+
queue.enqueue();
|
|
2969
|
+
try {
|
|
2970
|
+
const resolvedPath = fs.realpathSync(path);
|
|
2971
|
+
const stat = fs.statSync(resolvedPath);
|
|
2972
|
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
|
2973
|
+
callback$1(stat, resolvedPath);
|
|
2974
|
+
} catch (e) {
|
|
2975
|
+
if (!suppressErrors) throw e;
|
|
3285
2976
|
}
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
if (
|
|
3289
|
-
return
|
|
2977
|
+
};
|
|
2978
|
+
function build$2(options, isSynchronous) {
|
|
2979
|
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
|
2980
|
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
|
3290
2981
|
}
|
|
3291
|
-
function
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
2982
|
+
function isRecursive(path, resolved, state) {
|
|
2983
|
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
|
2984
|
+
let parent = (0, external_node_path_.dirname)(path);
|
|
2985
|
+
let depth = 1;
|
|
2986
|
+
while(parent !== state.root && depth < 2){
|
|
2987
|
+
const resolvedPath = state.symlinks.get(parent);
|
|
2988
|
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
|
2989
|
+
if (isSameRoot) depth++;
|
|
2990
|
+
else parent = (0, external_node_path_.dirname)(parent);
|
|
2991
|
+
}
|
|
2992
|
+
state.symlinks.set(path, resolved);
|
|
2993
|
+
return depth > 1;
|
|
3297
2994
|
}
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
2995
|
+
function isRecursiveUsingRealPaths(resolved, state) {
|
|
2996
|
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
|
2997
|
+
}
|
|
2998
|
+
const onlyCountsSync = (state)=>state.counts;
|
|
2999
|
+
const groupsSync = (state)=>state.groups;
|
|
3000
|
+
const defaultSync = (state)=>state.paths;
|
|
3001
|
+
const limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles);
|
|
3002
|
+
const onlyCountsAsync = (state, error, callback$1)=>{
|
|
3003
|
+
report(error, callback$1, state.counts, state.options.suppressErrors);
|
|
3004
|
+
return null;
|
|
3305
3005
|
};
|
|
3306
|
-
const
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
let anonymousErrorStackRegExp = /at\s.*\(<anonymous>\)$/;
|
|
3310
|
-
let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message);
|
|
3311
|
-
let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
|
|
3312
|
-
let string = '' + input;
|
|
3313
|
-
let index = string.indexOf(close, open.length);
|
|
3314
|
-
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
3315
|
-
} : String;
|
|
3316
|
-
let replaceClose = (string, close, replace, index)=>{
|
|
3317
|
-
let start = string.substring(0, index) + replace;
|
|
3318
|
-
let end = string.substring(index + close.length);
|
|
3319
|
-
let nextIndex = end.indexOf(close);
|
|
3320
|
-
return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
|
|
3006
|
+
const defaultAsync = (state, error, callback$1)=>{
|
|
3007
|
+
report(error, callback$1, state.paths, state.options.suppressErrors);
|
|
3008
|
+
return null;
|
|
3321
3009
|
};
|
|
3322
|
-
const
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
const
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3010
|
+
const limitFilesAsync = (state, error, callback$1)=>{
|
|
3011
|
+
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
|
3012
|
+
return null;
|
|
3013
|
+
};
|
|
3014
|
+
const groupsAsync = (state, error, callback$1)=>{
|
|
3015
|
+
report(error, callback$1, state.groups, state.options.suppressErrors);
|
|
3016
|
+
return null;
|
|
3017
|
+
};
|
|
3018
|
+
function report(error, callback$1, output, suppressErrors) {
|
|
3019
|
+
callback$1(error && !suppressErrors ? error : null, output);
|
|
3020
|
+
}
|
|
3021
|
+
function build$1(options, isSynchronous) {
|
|
3022
|
+
const { onlyCounts, group, maxFiles } = options;
|
|
3023
|
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
|
3024
|
+
if (group) return isSynchronous ? groupsSync : groupsAsync;
|
|
3025
|
+
if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
|
3026
|
+
return isSynchronous ? defaultSync : defaultAsync;
|
|
3027
|
+
}
|
|
3028
|
+
const readdirOpts = {
|
|
3029
|
+
withFileTypes: true
|
|
3030
|
+
};
|
|
3031
|
+
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
3032
|
+
state.queue.enqueue();
|
|
3033
|
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
|
3034
|
+
const { fs } = state;
|
|
3035
|
+
state.visited.push(crawlPath);
|
|
3036
|
+
state.counts.directories++;
|
|
3037
|
+
fs.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
|
|
3038
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
3039
|
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
|
3040
|
+
});
|
|
3041
|
+
};
|
|
3042
|
+
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1)=>{
|
|
3043
|
+
const { fs } = state;
|
|
3044
|
+
if (currentDepth < 0) return;
|
|
3045
|
+
state.visited.push(crawlPath);
|
|
3046
|
+
state.counts.directories++;
|
|
3047
|
+
let entries = [];
|
|
3048
|
+
try {
|
|
3049
|
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
|
3050
|
+
} catch (e) {
|
|
3051
|
+
if (!state.options.suppressErrors) throw e;
|
|
3052
|
+
}
|
|
3053
|
+
callback$1(entries, directoryPath, currentDepth);
|
|
3054
|
+
};
|
|
3055
|
+
function build(isSynchronous) {
|
|
3056
|
+
return isSynchronous ? walkSync : walkAsync;
|
|
3057
|
+
}
|
|
3058
|
+
var Queue = class {
|
|
3059
|
+
count = 0;
|
|
3060
|
+
constructor(onQueueEmpty){
|
|
3061
|
+
this.onQueueEmpty = onQueueEmpty;
|
|
3062
|
+
}
|
|
3063
|
+
enqueue() {
|
|
3064
|
+
this.count++;
|
|
3065
|
+
return this.count;
|
|
3066
|
+
}
|
|
3067
|
+
dequeue(error, output) {
|
|
3068
|
+
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
|
3069
|
+
this.onQueueEmpty(error, output);
|
|
3070
|
+
if (error) {
|
|
3071
|
+
output.controller.abort();
|
|
3072
|
+
this.onQueueEmpty = void 0;
|
|
3073
|
+
}
|
|
3358
3074
|
}
|
|
3359
|
-
output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
|
|
3360
3075
|
}
|
|
3361
|
-
return bold(output);
|
|
3362
3076
|
};
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3077
|
+
var Counter = class {
|
|
3078
|
+
_files = 0;
|
|
3079
|
+
_directories = 0;
|
|
3080
|
+
set files(num) {
|
|
3081
|
+
this._files = num;
|
|
3082
|
+
}
|
|
3083
|
+
get files() {
|
|
3084
|
+
return this._files;
|
|
3085
|
+
}
|
|
3086
|
+
set directories(num) {
|
|
3087
|
+
this._directories = num;
|
|
3088
|
+
}
|
|
3089
|
+
get directories() {
|
|
3090
|
+
return this._directories;
|
|
3091
|
+
}
|
|
3092
|
+
get dirs() {
|
|
3093
|
+
return this._directories;
|
|
3094
|
+
}
|
|
3370
3095
|
};
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
color: red
|
|
3376
|
-
},
|
|
3377
|
-
warn: {
|
|
3378
|
-
label: 'warn',
|
|
3379
|
-
level: 'warn',
|
|
3380
|
-
color: yellow
|
|
3381
|
-
},
|
|
3382
|
-
info: {
|
|
3383
|
-
label: 'info',
|
|
3384
|
-
level: 'info',
|
|
3385
|
-
color: cyan
|
|
3386
|
-
},
|
|
3387
|
-
start: {
|
|
3388
|
-
label: 'start',
|
|
3389
|
-
level: 'info',
|
|
3390
|
-
color: cyan
|
|
3391
|
-
},
|
|
3392
|
-
ready: {
|
|
3393
|
-
label: 'ready',
|
|
3394
|
-
level: 'info',
|
|
3395
|
-
color: green
|
|
3396
|
-
},
|
|
3397
|
-
success: {
|
|
3398
|
-
label: 'success',
|
|
3399
|
-
level: 'info',
|
|
3400
|
-
color: green
|
|
3401
|
-
},
|
|
3402
|
-
log: {
|
|
3403
|
-
level: 'info'
|
|
3404
|
-
},
|
|
3405
|
-
debug: {
|
|
3406
|
-
label: 'debug',
|
|
3407
|
-
level: 'verbose',
|
|
3408
|
-
color: magenta
|
|
3096
|
+
var Aborter = class {
|
|
3097
|
+
aborted = false;
|
|
3098
|
+
abort() {
|
|
3099
|
+
this.aborted = true;
|
|
3409
3100
|
}
|
|
3410
3101
|
};
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3102
|
+
var Walker = class {
|
|
3103
|
+
root;
|
|
3104
|
+
isSynchronous;
|
|
3105
|
+
state;
|
|
3106
|
+
joinPath;
|
|
3107
|
+
pushDirectory;
|
|
3108
|
+
pushFile;
|
|
3109
|
+
getArray;
|
|
3110
|
+
groupFiles;
|
|
3111
|
+
resolveSymlink;
|
|
3112
|
+
walkDirectory;
|
|
3113
|
+
callbackInvoker;
|
|
3114
|
+
constructor(root, options, callback$1){
|
|
3115
|
+
this.isSynchronous = !callback$1;
|
|
3116
|
+
this.callbackInvoker = build$1(options, this.isSynchronous);
|
|
3117
|
+
this.root = normalizePath(root, options);
|
|
3118
|
+
this.state = {
|
|
3119
|
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
|
3120
|
+
paths: [
|
|
3121
|
+
""
|
|
3122
|
+
].slice(0, 0),
|
|
3123
|
+
groups: [],
|
|
3124
|
+
counts: new Counter(),
|
|
3125
|
+
options,
|
|
3126
|
+
queue: new Queue((error, state)=>this.callbackInvoker(state, error, callback$1)),
|
|
3127
|
+
symlinks: /* @__PURE__ */ new Map(),
|
|
3128
|
+
visited: [
|
|
3129
|
+
""
|
|
3130
|
+
].slice(0, 0),
|
|
3131
|
+
controller: new Aborter(),
|
|
3132
|
+
fs: options.fs || external_node_fs_
|
|
3133
|
+
};
|
|
3134
|
+
this.joinPath = build$7(this.root, options);
|
|
3135
|
+
this.pushDirectory = build$6(this.root, options);
|
|
3136
|
+
this.pushFile = build$5(options);
|
|
3137
|
+
this.getArray = build$4(options);
|
|
3138
|
+
this.groupFiles = build$3(options);
|
|
3139
|
+
this.resolveSymlink = build$2(options, this.isSynchronous);
|
|
3140
|
+
this.walkDirectory = build(this.isSynchronous);
|
|
3141
|
+
}
|
|
3142
|
+
start() {
|
|
3143
|
+
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
|
3144
|
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
|
3145
|
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
|
3146
|
+
}
|
|
3147
|
+
walk = (entries, directoryPath, depth)=>{
|
|
3148
|
+
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
|
3149
|
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
|
3150
|
+
const files = this.getArray(this.state.paths);
|
|
3151
|
+
for(let i = 0; i < entries.length; ++i){
|
|
3152
|
+
const entry = entries[i];
|
|
3153
|
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
|
3154
|
+
const filename = this.joinPath(entry.name, directoryPath);
|
|
3155
|
+
this.pushFile(filename, files, this.state.counts, filters);
|
|
3156
|
+
} else if (entry.isDirectory()) {
|
|
3157
|
+
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
|
3158
|
+
if (exclude && exclude(entry.name, path)) continue;
|
|
3159
|
+
this.pushDirectory(path, paths, filters);
|
|
3160
|
+
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
|
3161
|
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
|
3162
|
+
let path = joinPathWithBasePath(entry.name, directoryPath);
|
|
3163
|
+
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
|
|
3164
|
+
if (stat.isDirectory()) {
|
|
3165
|
+
resolvedPath = normalizePath(resolvedPath, this.state.options);
|
|
3166
|
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
|
3167
|
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
|
3168
|
+
} else {
|
|
3169
|
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
|
3170
|
+
const filename = (0, external_node_path_.basename)(resolvedPath);
|
|
3171
|
+
const directoryPath$1 = normalizePath((0, external_node_path_.dirname)(resolvedPath), this.state.options);
|
|
3172
|
+
resolvedPath = this.joinPath(filename, directoryPath$1);
|
|
3173
|
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
}
|
|
3444
3177
|
}
|
|
3445
|
-
|
|
3446
|
-
logger.override = (customLogger)=>{
|
|
3447
|
-
Object.assign(logger, customLogger);
|
|
3178
|
+
this.groupFiles(this.state.groups, directoryPath, files);
|
|
3448
3179
|
};
|
|
3449
|
-
return logger;
|
|
3450
|
-
};
|
|
3451
|
-
let src_logger = createLogger();
|
|
3452
|
-
var helper = __webpack_require__("./src/utils/helper.ts");
|
|
3453
|
-
const isDebug = ()=>{
|
|
3454
|
-
if (!process.env.DEBUG) return false;
|
|
3455
|
-
const values = process.env.DEBUG.toLocaleLowerCase().split(',');
|
|
3456
|
-
return [
|
|
3457
|
-
'rstest',
|
|
3458
|
-
'rsbuild',
|
|
3459
|
-
'builder',
|
|
3460
|
-
'*'
|
|
3461
|
-
].some((key)=>values.includes(key));
|
|
3462
3180
|
};
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3181
|
+
function promise(root, options) {
|
|
3182
|
+
return new Promise((resolve$1, reject)=>{
|
|
3183
|
+
callback(root, options, (err, output)=>{
|
|
3184
|
+
if (err) return reject(err);
|
|
3185
|
+
resolve$1(output);
|
|
3186
|
+
});
|
|
3187
|
+
});
|
|
3470
3188
|
}
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3189
|
+
function callback(root, options, callback$1) {
|
|
3190
|
+
let walker = new Walker(root, options, callback$1);
|
|
3191
|
+
walker.start();
|
|
3192
|
+
}
|
|
3193
|
+
function sync(root, options) {
|
|
3194
|
+
const walker = new Walker(root, options);
|
|
3195
|
+
return walker.start();
|
|
3196
|
+
}
|
|
3197
|
+
var APIBuilder = class {
|
|
3198
|
+
constructor(root, options){
|
|
3199
|
+
this.root = root;
|
|
3200
|
+
this.options = options;
|
|
3201
|
+
}
|
|
3202
|
+
withPromise() {
|
|
3203
|
+
return promise(this.root, this.options);
|
|
3204
|
+
}
|
|
3205
|
+
withCallback(cb) {
|
|
3206
|
+
callback(this.root, this.options, cb);
|
|
3207
|
+
}
|
|
3208
|
+
sync() {
|
|
3209
|
+
return sync(this.root, this.options);
|
|
3476
3210
|
}
|
|
3477
|
-
});
|
|
3478
|
-
const clearScreen = (force = false)=>{
|
|
3479
|
-
if (!isDebug() || force) console.log('\x1Bc');
|
|
3480
3211
|
};
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
|
|
3511
|
-
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3542
|
-
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3546
|
-
|
|
3212
|
+
let pm = null;
|
|
3213
|
+
try {
|
|
3214
|
+
__require.resolve("picomatch");
|
|
3215
|
+
pm = __require("picomatch");
|
|
3216
|
+
} catch {}
|
|
3217
|
+
var Builder = class {
|
|
3218
|
+
globCache = {};
|
|
3219
|
+
options = {
|
|
3220
|
+
maxDepth: 1 / 0,
|
|
3221
|
+
suppressErrors: true,
|
|
3222
|
+
pathSeparator: external_node_path_.sep,
|
|
3223
|
+
filters: []
|
|
3224
|
+
};
|
|
3225
|
+
globFunction;
|
|
3226
|
+
constructor(options){
|
|
3227
|
+
this.options = {
|
|
3228
|
+
...this.options,
|
|
3229
|
+
...options
|
|
3230
|
+
};
|
|
3231
|
+
this.globFunction = this.options.globFunction;
|
|
3232
|
+
}
|
|
3233
|
+
group() {
|
|
3234
|
+
this.options.group = true;
|
|
3235
|
+
return this;
|
|
3236
|
+
}
|
|
3237
|
+
withPathSeparator(separator) {
|
|
3238
|
+
this.options.pathSeparator = separator;
|
|
3239
|
+
return this;
|
|
3240
|
+
}
|
|
3241
|
+
withBasePath() {
|
|
3242
|
+
this.options.includeBasePath = true;
|
|
3243
|
+
return this;
|
|
3244
|
+
}
|
|
3245
|
+
withRelativePaths() {
|
|
3246
|
+
this.options.relativePaths = true;
|
|
3247
|
+
return this;
|
|
3248
|
+
}
|
|
3249
|
+
withDirs() {
|
|
3250
|
+
this.options.includeDirs = true;
|
|
3251
|
+
return this;
|
|
3252
|
+
}
|
|
3253
|
+
withMaxDepth(depth) {
|
|
3254
|
+
this.options.maxDepth = depth;
|
|
3255
|
+
return this;
|
|
3256
|
+
}
|
|
3257
|
+
withMaxFiles(limit) {
|
|
3258
|
+
this.options.maxFiles = limit;
|
|
3259
|
+
return this;
|
|
3260
|
+
}
|
|
3261
|
+
withFullPaths() {
|
|
3262
|
+
this.options.resolvePaths = true;
|
|
3263
|
+
this.options.includeBasePath = true;
|
|
3264
|
+
return this;
|
|
3265
|
+
}
|
|
3266
|
+
withErrors() {
|
|
3267
|
+
this.options.suppressErrors = false;
|
|
3268
|
+
return this;
|
|
3269
|
+
}
|
|
3270
|
+
withSymlinks({ resolvePaths = true } = {}) {
|
|
3271
|
+
this.options.resolveSymlinks = true;
|
|
3272
|
+
this.options.useRealPaths = resolvePaths;
|
|
3273
|
+
return this.withFullPaths();
|
|
3274
|
+
}
|
|
3275
|
+
withAbortSignal(signal) {
|
|
3276
|
+
this.options.signal = signal;
|
|
3277
|
+
return this;
|
|
3278
|
+
}
|
|
3279
|
+
normalize() {
|
|
3280
|
+
this.options.normalizePath = true;
|
|
3281
|
+
return this;
|
|
3282
|
+
}
|
|
3283
|
+
filter(predicate) {
|
|
3284
|
+
this.options.filters.push(predicate);
|
|
3285
|
+
return this;
|
|
3286
|
+
}
|
|
3287
|
+
onlyDirs() {
|
|
3288
|
+
this.options.excludeFiles = true;
|
|
3289
|
+
this.options.includeDirs = true;
|
|
3290
|
+
return this;
|
|
3291
|
+
}
|
|
3292
|
+
exclude(predicate) {
|
|
3293
|
+
this.options.exclude = predicate;
|
|
3294
|
+
return this;
|
|
3295
|
+
}
|
|
3296
|
+
onlyCounts() {
|
|
3297
|
+
this.options.onlyCounts = true;
|
|
3298
|
+
return this;
|
|
3299
|
+
}
|
|
3300
|
+
crawl(root) {
|
|
3301
|
+
return new APIBuilder(root || ".", this.options);
|
|
3302
|
+
}
|
|
3303
|
+
withGlobFunction(fn) {
|
|
3304
|
+
this.globFunction = fn;
|
|
3305
|
+
return this;
|
|
3306
|
+
}
|
|
3307
|
+
crawlWithOptions(root, options) {
|
|
3308
|
+
this.options = {
|
|
3309
|
+
...this.options,
|
|
3310
|
+
...options
|
|
3311
|
+
};
|
|
3312
|
+
return new APIBuilder(root || ".", this.options);
|
|
3313
|
+
}
|
|
3314
|
+
glob(...patterns) {
|
|
3315
|
+
if (this.globFunction) return this.globWithOptions(patterns);
|
|
3316
|
+
return this.globWithOptions(patterns, {
|
|
3317
|
+
dot: true
|
|
3318
|
+
});
|
|
3319
|
+
}
|
|
3320
|
+
globWithOptions(patterns, ...options) {
|
|
3321
|
+
const globFn = this.globFunction || pm;
|
|
3322
|
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
|
3323
|
+
var isMatch = this.globCache[patterns.join("\0")];
|
|
3324
|
+
if (!isMatch) {
|
|
3325
|
+
isMatch = globFn(patterns, ...options);
|
|
3326
|
+
this.globCache[patterns.join("\0")] = isMatch;
|
|
3327
|
+
}
|
|
3328
|
+
this.options.filters.push((path)=>isMatch(path));
|
|
3329
|
+
return this;
|
|
3330
|
+
}
|
|
3331
|
+
};
|
|
3332
|
+
var picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js");
|
|
3333
|
+
const isReadonlyArray = Array.isArray;
|
|
3334
|
+
const isWin = "win32" === process.platform;
|
|
3547
3335
|
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
|
|
3548
|
-
function getPartialMatcher(patterns, options) {
|
|
3336
|
+
function getPartialMatcher(patterns, options = {}) {
|
|
3549
3337
|
const patternsCount = patterns.length;
|
|
3550
3338
|
const patternsParts = Array(patternsCount);
|
|
3551
|
-
const
|
|
3339
|
+
const matchers = Array(patternsCount);
|
|
3340
|
+
const globstarEnabled = !options.noglobstar;
|
|
3552
3341
|
for(let i = 0; i < patternsCount; i++){
|
|
3553
3342
|
const parts = splitPattern(patterns[i]);
|
|
3554
3343
|
patternsParts[i] = parts;
|
|
3555
3344
|
const partsCount = parts.length;
|
|
3556
|
-
const
|
|
3557
|
-
for(let j = 0; j < partsCount; j++)
|
|
3558
|
-
|
|
3345
|
+
const partMatchers = Array(partsCount);
|
|
3346
|
+
for(let j = 0; j < partsCount; j++)partMatchers[j] = picomatch(parts[j], options);
|
|
3347
|
+
matchers[i] = partMatchers;
|
|
3559
3348
|
}
|
|
3560
3349
|
return (input)=>{
|
|
3561
3350
|
const inputParts = input.split("/");
|
|
3562
3351
|
if (".." === inputParts[0] && ONLY_PARENT_DIRECTORIES.test(input)) return true;
|
|
3563
3352
|
for(let i = 0; i < patterns.length; i++){
|
|
3564
3353
|
const patternParts = patternsParts[i];
|
|
3565
|
-
const
|
|
3354
|
+
const matcher = matchers[i];
|
|
3566
3355
|
const inputPatternCount = inputParts.length;
|
|
3567
3356
|
const minParts = Math.min(inputPatternCount, patternParts.length);
|
|
3568
3357
|
let j = 0;
|
|
3569
3358
|
while(j < minParts){
|
|
3570
3359
|
const part = patternParts[j];
|
|
3571
3360
|
if (part.includes("/")) return true;
|
|
3572
|
-
const match =
|
|
3361
|
+
const match = matcher[j](inputParts[j]);
|
|
3573
3362
|
if (!match) break;
|
|
3574
|
-
if ("**" === part) return true;
|
|
3363
|
+
if (globstarEnabled && "**" === part) return true;
|
|
3575
3364
|
j++;
|
|
3576
3365
|
}
|
|
3577
3366
|
if (j === inputPatternCount) return true;
|
|
@@ -3579,17 +3368,46 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3579
3368
|
return false;
|
|
3580
3369
|
};
|
|
3581
3370
|
}
|
|
3371
|
+
const WIN32_ROOT_DIR = /^[A-Z]:\/$/i;
|
|
3372
|
+
const isRoot = isWin ? (p)=>WIN32_ROOT_DIR.test(p) : (p)=>"/" === p;
|
|
3373
|
+
function buildFormat(cwd, root, absolute) {
|
|
3374
|
+
if (cwd === root || root.startsWith(`${cwd}/`)) {
|
|
3375
|
+
if (absolute) {
|
|
3376
|
+
const start = isRoot(cwd) ? cwd.length : cwd.length + 1;
|
|
3377
|
+
return (p, isDir)=>p.slice(start, isDir ? -1 : void 0) || ".";
|
|
3378
|
+
}
|
|
3379
|
+
const prefix = root.slice(cwd.length + 1);
|
|
3380
|
+
if (prefix) return (p, isDir)=>{
|
|
3381
|
+
if ("." === p) return prefix;
|
|
3382
|
+
const result = `${prefix}/${p}`;
|
|
3383
|
+
return isDir ? result.slice(0, -1) : result;
|
|
3384
|
+
};
|
|
3385
|
+
return (p, isDir)=>isDir && "." !== p ? p.slice(0, -1) : p;
|
|
3386
|
+
}
|
|
3387
|
+
if (absolute) return (p)=>external_node_path_.posix.relative(cwd, p) || ".";
|
|
3388
|
+
return (p)=>external_node_path_.posix.relative(cwd, `${root}/${p}`) || ".";
|
|
3389
|
+
}
|
|
3390
|
+
function buildRelative(cwd, root) {
|
|
3391
|
+
if (root.startsWith(`${cwd}/`)) {
|
|
3392
|
+
const prefix = root.slice(cwd.length + 1);
|
|
3393
|
+
return (p)=>`${prefix}/${p}`;
|
|
3394
|
+
}
|
|
3395
|
+
return (p)=>{
|
|
3396
|
+
const result = external_node_path_.posix.relative(cwd, `${root}/${p}`);
|
|
3397
|
+
if (p.endsWith("/") && "" !== result) return `${result}/`;
|
|
3398
|
+
return result || ".";
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3582
3401
|
const splitPatternOptions = {
|
|
3583
3402
|
parts: true
|
|
3584
3403
|
};
|
|
3585
3404
|
function splitPattern(path$1) {
|
|
3586
3405
|
var _result$parts;
|
|
3587
|
-
const result =
|
|
3406
|
+
const result = picomatch.scan(path$1, splitPatternOptions);
|
|
3588
3407
|
return (null == (_result$parts = result.parts) ? void 0 : _result$parts.length) ? result.parts : [
|
|
3589
3408
|
path$1
|
|
3590
3409
|
];
|
|
3591
3410
|
}
|
|
3592
|
-
const isWin = "win32" === process.platform;
|
|
3593
3411
|
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
|
|
3594
3412
|
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
3595
3413
|
const escapePosixPath = (path$1)=>path$1.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
|
|
@@ -3597,11 +3415,11 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3597
3415
|
const escapePath = isWin ? escapeWin32Path : escapePosixPath;
|
|
3598
3416
|
function isDynamicPattern(pattern, options) {
|
|
3599
3417
|
if ((null == options ? void 0 : options.caseSensitiveMatch) === false) return true;
|
|
3600
|
-
const scan =
|
|
3418
|
+
const scan = picomatch.scan(pattern);
|
|
3601
3419
|
return scan.isGlob || scan.negated;
|
|
3602
3420
|
}
|
|
3603
3421
|
function log(...tasks) {
|
|
3604
|
-
console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`, ...tasks);
|
|
3422
|
+
console.log(`[tinyglobby ${/* @__PURE__ */ new Date().toLocaleTimeString("es")}]`, ...tasks);
|
|
3605
3423
|
}
|
|
3606
3424
|
const PARENT_DIRECTORY = /^(\/?\.\.)+/;
|
|
3607
3425
|
const ESCAPING_BACKSLASHES = /\\(?=[()[\]{}!*+?@|])/g;
|
|
@@ -3611,7 +3429,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3611
3429
|
if (pattern.endsWith("/")) result = pattern.slice(0, -1);
|
|
3612
3430
|
if (!result.endsWith("*") && expandDirectories) result += "/**";
|
|
3613
3431
|
const escapedCwd = escapePath(cwd);
|
|
3614
|
-
result =
|
|
3432
|
+
result = external_node_path_["default"].isAbsolute(result.replace(ESCAPING_BACKSLASHES, "")) ? external_node_path_.posix.relative(escapedCwd, result) : external_node_path_.posix.normalize(result);
|
|
3615
3433
|
const parentDirectoryMatch = PARENT_DIRECTORY.exec(result);
|
|
3616
3434
|
const parts = splitPattern(result);
|
|
3617
3435
|
if (null == parentDirectoryMatch ? void 0 : parentDirectoryMatch[0]) {
|
|
@@ -3622,7 +3440,7 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3622
3440
|
result = result.slice(0, (n - i - 1) * 3) + result.slice((n - i) * 3 + parts[i + n].length + 1) || ".";
|
|
3623
3441
|
i++;
|
|
3624
3442
|
}
|
|
3625
|
-
const potentialRoot =
|
|
3443
|
+
const potentialRoot = external_node_path_.posix.join(cwd, parentDirectoryMatch[0].slice(3 * i));
|
|
3626
3444
|
if (!potentialRoot.startsWith(".") && props.root.length > potentialRoot.length) {
|
|
3627
3445
|
props.root = potentialRoot;
|
|
3628
3446
|
props.depthOffset = -n + i;
|
|
@@ -3643,17 +3461,16 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3643
3461
|
}
|
|
3644
3462
|
props.depthOffset = newCommonPath.length;
|
|
3645
3463
|
props.commonPath = newCommonPath;
|
|
3646
|
-
props.root = newCommonPath.length > 0 ?
|
|
3464
|
+
props.root = newCommonPath.length > 0 ? external_node_path_.posix.join(cwd, ...newCommonPath) : cwd;
|
|
3647
3465
|
}
|
|
3648
3466
|
return result;
|
|
3649
3467
|
}
|
|
3650
|
-
function processPatterns({ patterns
|
|
3468
|
+
function processPatterns({ patterns = [
|
|
3469
|
+
"**/*"
|
|
3470
|
+
], ignore = [], expandDirectories = true }, cwd, props) {
|
|
3651
3471
|
if ("string" == typeof patterns) patterns = [
|
|
3652
3472
|
patterns
|
|
3653
3473
|
];
|
|
3654
|
-
else if (!patterns) patterns = [
|
|
3655
|
-
"**/*"
|
|
3656
|
-
];
|
|
3657
3474
|
if ("string" == typeof ignore) ignore = [
|
|
3658
3475
|
ignore
|
|
3659
3476
|
];
|
|
@@ -3671,67 +3488,92 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3671
3488
|
ignore: ignorePatterns
|
|
3672
3489
|
};
|
|
3673
3490
|
}
|
|
3674
|
-
function
|
|
3675
|
-
return path__WEBPACK_IMPORTED_MODULE_0__.posix.relative(cwd, `${root}/${path$1}`) || ".";
|
|
3676
|
-
}
|
|
3677
|
-
function processPath(path$1, cwd, root, isDirectory, absolute) {
|
|
3678
|
-
const relativePath = absolute ? path$1.slice("/" === root ? 1 : root.length + 1) || "." : path$1;
|
|
3679
|
-
if (root === cwd) return isDirectory && "." !== relativePath ? relativePath.slice(0, -1) : relativePath;
|
|
3680
|
-
return getRelativePath(relativePath, cwd, root);
|
|
3681
|
-
}
|
|
3682
|
-
function formatPaths(paths, cwd, root) {
|
|
3491
|
+
function formatPaths(paths, relative) {
|
|
3683
3492
|
for(let i = paths.length - 1; i >= 0; i--){
|
|
3684
3493
|
const path$1 = paths[i];
|
|
3685
|
-
paths[i] =
|
|
3494
|
+
paths[i] = relative(path$1);
|
|
3686
3495
|
}
|
|
3687
3496
|
return paths;
|
|
3688
3497
|
}
|
|
3689
|
-
function
|
|
3690
|
-
if (process.
|
|
3691
|
-
if (
|
|
3692
|
-
|
|
3498
|
+
function normalizeCwd(cwd) {
|
|
3499
|
+
if (!cwd) return process.cwd().replace(BACKSLASHES, "/");
|
|
3500
|
+
if (cwd instanceof URL) return (0, __WEBPACK_EXTERNAL_MODULE_url__.fileURLToPath)(cwd).replace(BACKSLASHES, "/");
|
|
3501
|
+
return external_node_path_["default"].resolve(cwd).replace(BACKSLASHES, "/");
|
|
3502
|
+
}
|
|
3503
|
+
function getCrawler(patterns, inputOptions = {}) {
|
|
3504
|
+
const options = process.env.TINYGLOBBY_DEBUG ? {
|
|
3505
|
+
...inputOptions,
|
|
3506
|
+
debug: true
|
|
3507
|
+
} : inputOptions;
|
|
3508
|
+
const cwd = normalizeCwd(options.cwd);
|
|
3509
|
+
if (options.debug) log("globbing with:", {
|
|
3510
|
+
patterns,
|
|
3511
|
+
options,
|
|
3512
|
+
cwd
|
|
3513
|
+
});
|
|
3514
|
+
if (Array.isArray(patterns) && 0 === patterns.length) return [
|
|
3515
|
+
{
|
|
3516
|
+
sync: ()=>[],
|
|
3517
|
+
withPromise: async ()=>[]
|
|
3518
|
+
},
|
|
3519
|
+
false
|
|
3520
|
+
];
|
|
3693
3521
|
const props = {
|
|
3694
3522
|
root: cwd,
|
|
3695
3523
|
commonPath: null,
|
|
3696
3524
|
depthOffset: 0
|
|
3697
3525
|
};
|
|
3698
|
-
const processed = processPatterns(
|
|
3699
|
-
|
|
3526
|
+
const processed = processPatterns({
|
|
3527
|
+
...options,
|
|
3528
|
+
patterns
|
|
3529
|
+
}, cwd, props);
|
|
3700
3530
|
if (options.debug) log("internal processing patterns:", processed);
|
|
3701
|
-
const
|
|
3531
|
+
const matchOptions = {
|
|
3702
3532
|
dot: options.dot,
|
|
3703
|
-
|
|
3533
|
+
nobrace: false === options.braceExpansion,
|
|
3534
|
+
nocase: false === options.caseSensitiveMatch,
|
|
3535
|
+
noextglob: false === options.extglob,
|
|
3536
|
+
noglobstar: false === options.globstar,
|
|
3537
|
+
posix: true
|
|
3538
|
+
};
|
|
3539
|
+
const matcher = picomatch(processed.match, {
|
|
3540
|
+
...matchOptions,
|
|
3704
3541
|
ignore: processed.ignore
|
|
3705
3542
|
});
|
|
3706
|
-
const ignore =
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
const partialMatcher = getPartialMatcher(processed.match, {
|
|
3711
|
-
dot: options.dot,
|
|
3712
|
-
nocase
|
|
3713
|
-
});
|
|
3543
|
+
const ignore = picomatch(processed.ignore, matchOptions);
|
|
3544
|
+
const partialMatcher = getPartialMatcher(processed.match, matchOptions);
|
|
3545
|
+
const format = buildFormat(cwd, props.root, options.absolute);
|
|
3546
|
+
const formatExclude = options.absolute ? format : buildFormat(cwd, props.root, true);
|
|
3714
3547
|
const fdirOptions = {
|
|
3715
3548
|
filters: [
|
|
3716
3549
|
options.debug ? (p, isDirectory)=>{
|
|
3717
|
-
const path$1 =
|
|
3550
|
+
const path$1 = format(p, isDirectory);
|
|
3718
3551
|
const matches = matcher(path$1);
|
|
3719
3552
|
if (matches) log(`matched ${path$1}`);
|
|
3720
3553
|
return matches;
|
|
3721
|
-
} : (p, isDirectory)=>matcher(
|
|
3554
|
+
} : (p, isDirectory)=>matcher(format(p, isDirectory))
|
|
3722
3555
|
],
|
|
3723
3556
|
exclude: options.debug ? (_, p)=>{
|
|
3724
|
-
const relativePath =
|
|
3557
|
+
const relativePath = formatExclude(p, true);
|
|
3725
3558
|
const skipped = "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3726
3559
|
skipped ? log(`skipped ${p}`) : log(`crawling ${p}`);
|
|
3727
3560
|
return skipped;
|
|
3728
3561
|
} : (_, p)=>{
|
|
3729
|
-
const relativePath =
|
|
3562
|
+
const relativePath = formatExclude(p, true);
|
|
3730
3563
|
return "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
|
|
3731
3564
|
},
|
|
3565
|
+
fs: options.fs ? {
|
|
3566
|
+
readdir: options.fs.readdir || external_node_fs_["default"].readdir,
|
|
3567
|
+
readdirSync: options.fs.readdirSync || external_node_fs_["default"].readdirSync,
|
|
3568
|
+
realpath: options.fs.realpath || external_node_fs_["default"].realpath,
|
|
3569
|
+
realpathSync: options.fs.realpathSync || external_node_fs_["default"].realpathSync,
|
|
3570
|
+
stat: options.fs.stat || external_node_fs_["default"].stat,
|
|
3571
|
+
statSync: options.fs.statSync || external_node_fs_["default"].statSync
|
|
3572
|
+
} : void 0,
|
|
3732
3573
|
pathSeparator: "/",
|
|
3733
3574
|
relativePaths: true,
|
|
3734
|
-
resolveSymlinks: true
|
|
3575
|
+
resolveSymlinks: true,
|
|
3576
|
+
signal: options.signal
|
|
3735
3577
|
};
|
|
3736
3578
|
if (void 0 !== options.deep) fdirOptions.maxDepth = Math.round(options.deep - props.depthOffset);
|
|
3737
3579
|
if (options.absolute) {
|
|
@@ -3750,18 +3592,20 @@ ${section.body}` : section.body).join("\n\n"));
|
|
|
3750
3592
|
props.root = props.root.replace(BACKSLASHES, "");
|
|
3751
3593
|
const root = props.root;
|
|
3752
3594
|
if (options.debug) log("internal properties:", props);
|
|
3753
|
-
const
|
|
3754
|
-
|
|
3755
|
-
|
|
3595
|
+
const relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
|
|
3596
|
+
return [
|
|
3597
|
+
new Builder(fdirOptions).crawl(root),
|
|
3598
|
+
relative
|
|
3599
|
+
];
|
|
3756
3600
|
}
|
|
3757
3601
|
async function glob(patternsOrOptions, options) {
|
|
3758
3602
|
if (patternsOrOptions && (null == options ? void 0 : options.patterns)) throw new Error("Cannot pass patterns as both an argument and an option");
|
|
3759
|
-
const
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
return
|
|
3603
|
+
const isModern = isReadonlyArray(patternsOrOptions) || "string" == typeof patternsOrOptions;
|
|
3604
|
+
const opts = isModern ? options : patternsOrOptions;
|
|
3605
|
+
const patterns = isModern ? patternsOrOptions : patternsOrOptions.patterns;
|
|
3606
|
+
const [crawler, relative] = getCrawler(patterns, opts);
|
|
3607
|
+
if (!relative) return crawler.withPromise();
|
|
3608
|
+
return formatPaths(await crawler.withPromise(), relative);
|
|
3765
3609
|
}
|
|
3766
3610
|
}
|
|
3767
3611
|
};
|
|
@@ -3772,7 +3616,7 @@ function __webpack_require__(moduleId) {
|
|
|
3772
3616
|
var module = __webpack_module_cache__[moduleId] = {
|
|
3773
3617
|
exports: {}
|
|
3774
3618
|
};
|
|
3775
|
-
__webpack_modules__[moduleId]
|
|
3619
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
3776
3620
|
return module.exports;
|
|
3777
3621
|
}
|
|
3778
3622
|
__webpack_require__.m = __webpack_modules__;
|
|
@@ -3801,21 +3645,11 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
3801
3645
|
}, []));
|
|
3802
3646
|
})();
|
|
3803
3647
|
(()=>{
|
|
3804
|
-
__webpack_require__.u = (chunkId)=>"" + chunkId + ".js";
|
|
3648
|
+
__webpack_require__.u = (chunkId)=>"0~" + chunkId + ".js";
|
|
3805
3649
|
})();
|
|
3806
3650
|
(()=>{
|
|
3807
3651
|
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
3808
3652
|
})();
|
|
3809
|
-
(()=>{
|
|
3810
|
-
__webpack_require__.r = (exports)=>{
|
|
3811
|
-
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
3812
|
-
value: 'Module'
|
|
3813
|
-
});
|
|
3814
|
-
Object.defineProperty(exports, '__esModule', {
|
|
3815
|
-
value: true
|
|
3816
|
-
});
|
|
3817
|
-
};
|
|
3818
|
-
})();
|
|
3819
3653
|
(()=>{
|
|
3820
3654
|
var installedChunks = {
|
|
3821
3655
|
410: 0
|