@rstest/core
Version:
The Rsbuild-based test tool.
1,063 lines (1,062 loc) • 173 kB
JavaScript
import __rslib_shim_module__ from 'module';
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
import node_process from "node:process";
import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
import * as __WEBPACK_EXTERNAL_MODULE_birpc__ from "birpc";
import * as __WEBPACK_EXTERNAL_MODULE_node_events_0a6aefe7__ from "node:events";
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__ from "node:fs/promises";
import * as __WEBPACK_EXTERNAL_MODULE_node_inspector_dd9822d6__ from "node:inspector";
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
import * as __WEBPACK_EXTERNAL_MODULE_node_tty_c64aab7e__ from "node:tty";
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
import * as __WEBPACK_EXTERNAL_MODULE_node_util_1b29d436__ from "node:util";
import * as __WEBPACK_EXTERNAL_MODULE_node_v8_d0df5498__ from "node:v8";
import * as __WEBPACK_EXTERNAL_MODULE_pathe__ from "pathe";
import * as __WEBPACK_EXTERNAL_MODULE_std_env_1c7b8267__ from "std-env";
import * as __WEBPACK_EXTERNAL_MODULE_tinypool__ from "tinypool";
import { EventEmitter } from "events";
var __webpack_modules__ = {
"../../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__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.callback = exports.promise = void 0;
const walker_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
function promise(root, options) {
return new Promise((resolve, reject)=>{
callback(root, options, (err, output)=>{
if (err) return reject(err);
resolve(output);
});
});
}
exports.promise = promise;
function callback(root, options, callback) {
let walker = new walker_1.Walker(root, options, callback);
walker.start();
}
exports.callback = callback;
},
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js": function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Counter = void 0;
class Counter {
_files = 0;
_directories = 0;
set files(num) {
this._files = num;
}
get files() {
return this._files;
}
set directories(num) {
this._directories = num;
}
get directories() {
return this._directories;
}
get dirs() {
return this._directories;
}
}
exports.Counter = Counter;
},
"../../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) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const getArray = (paths)=>paths;
const getArrayGroup = ()=>[
""
].slice(0, 0);
function build(options) {
return options.group ? getArrayGroup : getArray;
}
exports.build = build;
},
"../../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) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const groupFiles = (groups, directory, files)=>{
groups.push({
directory,
files,
dir: directory
});
};
const empty = ()=>{};
function build(options) {
return options.group ? groupFiles : empty;
}
exports.build = build;
},
"../../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) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const onlyCountsSync = (state)=>state.counts;
const groupsSync = (state)=>state.groups;
const defaultSync = (state)=>state.paths;
const limitFilesSync = (state)=>state.paths.slice(0, state.options.maxFiles);
const onlyCountsAsync = (state, error, callback)=>{
report(error, callback, state.counts, state.options.suppressErrors);
return null;
};
const defaultAsync = (state, error, callback)=>{
report(error, callback, state.paths, state.options.suppressErrors);
return null;
};
const limitFilesAsync = (state, error, callback)=>{
report(error, callback, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
return null;
};
const groupsAsync = (state, error, callback)=>{
report(error, callback, state.groups, state.options.suppressErrors);
return null;
};
function report(error, callback, output, suppressErrors) {
callback(error && !suppressErrors ? error : null, output);
}
function build(options, isSynchronous) {
const { onlyCounts, group, maxFiles } = options;
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
if (group) return isSynchronous ? groupsSync : groupsAsync;
if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
return isSynchronous ? defaultSync : defaultAsync;
}
exports.build = build;
},
"../../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__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = exports.joinDirectoryPath = exports.joinPathWithBasePath = void 0;
const path_1 = __webpack_require__("node:path");
const utils_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
function joinPathWithBasePath(filename, directoryPath) {
return directoryPath + filename;
}
exports.joinPathWithBasePath = joinPathWithBasePath;
function joinPathWithRelativePath(root, options) {
return function(filename, directoryPath) {
const sameRoot = directoryPath.startsWith(root);
if (sameRoot) return directoryPath.replace(root, "") + filename;
return (0, utils_1.convertSlashes)((0, path_1.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
};
}
function joinPath(filename) {
return filename;
}
function joinDirectoryPath(filename, directoryPath, separator) {
return directoryPath + filename + separator;
}
exports.joinDirectoryPath = joinDirectoryPath;
function build(root, options) {
const { relativePaths, includeBasePath } = options;
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
}
exports.build = build;
},
"../../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) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
function pushDirectoryWithRelativePath(root) {
return function(directoryPath, paths) {
paths.push(directoryPath.substring(root.length) || ".");
};
}
function pushDirectoryFilterWithRelativePath(root) {
return function(directoryPath, paths, filters) {
const relativePath = directoryPath.substring(root.length) || ".";
if (filters.every((filter)=>filter(relativePath, true))) paths.push(relativePath);
};
}
const pushDirectory = (directoryPath, paths)=>{
paths.push(directoryPath || ".");
};
const pushDirectoryFilter = (directoryPath, paths, filters)=>{
const path = directoryPath || ".";
if (filters.every((filter)=>filter(path, true))) paths.push(path);
};
const empty = ()=>{};
function build(root, options) {
const { includeDirs, filters, relativePaths } = options;
if (!includeDirs) return empty;
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
}
exports.build = build;
},
"../../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) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const pushFileFilterAndCount = (filename, _paths, counts, filters)=>{
if (filters.every((filter)=>filter(filename, false))) counts.files++;
};
const pushFileFilter = (filename, paths, _counts, filters)=>{
if (filters.every((filter)=>filter(filename, false))) paths.push(filename);
};
const pushFileCount = (_filename, _paths, counts, _filters)=>{
counts.files++;
};
const pushFile = (filename, paths)=>{
paths.push(filename);
};
const empty = ()=>{};
function build(options) {
const { excludeFiles, filters, onlyCounts } = options;
if (excludeFiles) return empty;
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
if (onlyCounts) return pushFileCount;
return pushFile;
}
exports.build = build;
},
"../../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__) {
var __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const fs_1 = __importDefault(__webpack_require__("fs"));
const path_1 = __webpack_require__("node:path");
const resolveSymlinksAsync = function(path, state, callback) {
const { queue, options: { suppressErrors } } = state;
queue.enqueue();
fs_1.default.realpath(path, (error, resolvedPath)=>{
if (error) return queue.dequeue(suppressErrors ? null : error, state);
fs_1.default.stat(resolvedPath, (error, stat)=>{
if (error) return queue.dequeue(suppressErrors ? null : error, state);
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
callback(stat, resolvedPath);
queue.dequeue(null, state);
});
});
};
const resolveSymlinks = function(path, state, callback) {
const { queue, options: { suppressErrors } } = state;
queue.enqueue();
try {
const resolvedPath = fs_1.default.realpathSync(path);
const stat = fs_1.default.statSync(resolvedPath);
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
callback(stat, resolvedPath);
} catch (e) {
if (!suppressErrors) throw e;
}
};
function build(options, isSynchronous) {
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
}
exports.build = build;
function isRecursive(path, resolved, state) {
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
let parent = (0, path_1.dirname)(path);
let depth = 1;
while(parent !== state.root && depth < 2){
const resolvedPath = state.symlinks.get(parent);
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
if (isSameRoot) depth++;
else parent = (0, path_1.dirname)(parent);
}
state.symlinks.set(path, resolved);
return depth > 1;
}
function isRecursiveUsingRealPaths(resolved, state) {
return state.visited.includes(resolved + state.options.pathSeparator);
}
},
"../../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__) {
var __importDefault = this && this.__importDefault || function(mod) {
return mod && mod.__esModule ? mod : {
default: mod
};
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.build = void 0;
const fs_1 = __importDefault(__webpack_require__("fs"));
const readdirOpts = {
withFileTypes: true
};
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
if (currentDepth < 0) return state.queue.dequeue(null, state);
state.visited.push(crawlPath);
state.counts.directories++;
state.queue.enqueue();
fs_1.default.readdir(crawlPath || ".", readdirOpts, (error, entries = [])=>{
callback(entries, directoryPath, currentDepth);
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
});
};
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback)=>{
if (currentDepth < 0) return;
state.visited.push(crawlPath);
state.counts.directories++;
let entries = [];
try {
entries = fs_1.default.readdirSync(crawlPath || ".", readdirOpts);
} catch (e) {
if (!state.options.suppressErrors) throw e;
}
callback(entries, directoryPath, currentDepth);
};
function build(isSynchronous) {
return isSynchronous ? walkSync : walkAsync;
}
exports.build = build;
},
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js": function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Queue = void 0;
class Queue {
onQueueEmpty;
count = 0;
constructor(onQueueEmpty){
this.onQueueEmpty = onQueueEmpty;
}
enqueue() {
this.count++;
}
dequeue(error, output) {
if (--this.count <= 0 || error) this.onQueueEmpty(error, output);
}
}
exports.Queue = Queue;
},
"../../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__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.sync = void 0;
const walker_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/walker.js");
function sync(root, options) {
const walker = new walker_1.Walker(root, options);
return walker.start();
}
exports.sync = sync;
},
"../../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__) {
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
if (void 0 === k2) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
enumerable: true,
get: function() {
return m[k];
}
};
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (void 0 === k2) k2 = k;
o[k2] = m[k];
});
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
Object.defineProperty(o, "default", {
enumerable: true,
value: v
});
} : function(o, v) {
o["default"] = v;
});
var __importStar = this && this.__importStar || function(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (null != mod) {
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
}
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Walker = void 0;
const path_1 = __webpack_require__("node:path");
const utils_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js");
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"));
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"));
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"));
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"));
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"));
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"));
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"));
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"));
const queue_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/queue.js");
const counter_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/counter.js");
class Walker {
root;
isSynchronous;
state;
joinPath;
pushDirectory;
pushFile;
getArray;
groupFiles;
resolveSymlink;
walkDirectory;
callbackInvoker;
constructor(root, options, callback){
this.isSynchronous = !callback;
this.callbackInvoker = invokeCallback.build(options, this.isSynchronous);
this.root = (0, utils_1.normalizePath)(root, options);
this.state = {
root: (0, utils_1.isRootDirectory)(this.root) ? this.root : this.root.slice(0, -1),
paths: [
""
].slice(0, 0),
groups: [],
counts: new counter_1.Counter(),
options,
queue: new queue_1.Queue((error, state)=>this.callbackInvoker(state, error, callback)),
symlinks: new Map(),
visited: [
""
].slice(0, 0)
};
this.joinPath = joinPath.build(this.root, options);
this.pushDirectory = pushDirectory.build(this.root, options);
this.pushFile = pushFile.build(options);
this.getArray = getArray.build(options);
this.groupFiles = groupFiles.build(options);
this.resolveSymlink = resolveSymlink.build(options, this.isSynchronous);
this.walkDirectory = walkDirectory.build(this.isSynchronous);
}
start() {
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
}
walk = (entries, directoryPath, depth)=>{
const { paths, options: { filters, resolveSymlinks, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator } } = this.state;
if (signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
this.pushDirectory(directoryPath, paths, filters);
const files = this.getArray(this.state.paths);
for(let i = 0; i < entries.length; ++i){
const entry = entries[i];
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks && !excludeSymlinks) {
const filename = this.joinPath(entry.name, directoryPath);
this.pushFile(filename, files, this.state.counts, filters);
} else if (entry.isDirectory()) {
let path = joinPath.joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
if (exclude && exclude(entry.name, path)) continue;
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
} else if (entry.isSymbolicLink() && this.resolveSymlink) {
let path = joinPath.joinPathWithBasePath(entry.name, directoryPath);
this.resolveSymlink(path, this.state, (stat, resolvedPath)=>{
if (stat.isDirectory()) {
resolvedPath = (0, utils_1.normalizePath)(resolvedPath, this.state.options);
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
} else {
resolvedPath = useRealPaths ? resolvedPath : path;
const filename = (0, path_1.basename)(resolvedPath);
const directoryPath = (0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath), this.state.options);
resolvedPath = this.joinPath(filename, directoryPath);
this.pushFile(resolvedPath, files, this.state.counts, filters);
}
});
}
}
this.groupFiles(this.state.groups, directoryPath, files);
};
}
exports.Walker = Walker;
},
"../../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__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.APIBuilder = void 0;
const async_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/async.js");
const sync_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/api/sync.js");
class APIBuilder {
root;
options;
constructor(root, options){
this.root = root;
this.options = options;
}
withPromise() {
return (0, async_1.promise)(this.root, this.options);
}
withCallback(cb) {
(0, async_1.callback)(this.root, this.options, cb);
}
sync() {
return (0, sync_1.sync)(this.root, this.options);
}
}
exports.APIBuilder = APIBuilder;
},
"../../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__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Builder = void 0;
const path_1 = __webpack_require__("node:path");
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");
var pm = null;
try {
require.resolve("picomatch");
pm = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js");
} catch (_e) {}
class Builder {
globCache = {};
options = {
maxDepth: 1 / 0,
suppressErrors: true,
pathSeparator: path_1.sep,
filters: []
};
globFunction;
constructor(options){
this.options = {
...this.options,
...options
};
this.globFunction = this.options.globFunction;
}
group() {
this.options.group = true;
return this;
}
withPathSeparator(separator) {
this.options.pathSeparator = separator;
return this;
}
withBasePath() {
this.options.includeBasePath = true;
return this;
}
withRelativePaths() {
this.options.relativePaths = true;
return this;
}
withDirs() {
this.options.includeDirs = true;
return this;
}
withMaxDepth(depth) {
this.options.maxDepth = depth;
return this;
}
withMaxFiles(limit) {
this.options.maxFiles = limit;
return this;
}
withFullPaths() {
this.options.resolvePaths = true;
this.options.includeBasePath = true;
return this;
}
withErrors() {
this.options.suppressErrors = false;
return this;
}
withSymlinks({ resolvePaths = true } = {}) {
this.options.resolveSymlinks = true;
this.options.useRealPaths = resolvePaths;
return this.withFullPaths();
}
withAbortSignal(signal) {
this.options.signal = signal;
return this;
}
normalize() {
this.options.normalizePath = true;
return this;
}
filter(predicate) {
this.options.filters.push(predicate);
return this;
}
onlyDirs() {
this.options.excludeFiles = true;
this.options.includeDirs = true;
return this;
}
exclude(predicate) {
this.options.exclude = predicate;
return this;
}
onlyCounts() {
this.options.onlyCounts = true;
return this;
}
crawl(root) {
return new api_builder_1.APIBuilder(root || ".", this.options);
}
withGlobFunction(fn) {
this.globFunction = fn;
return this;
}
crawlWithOptions(root, options) {
this.options = {
...this.options,
...options
};
return new api_builder_1.APIBuilder(root || ".", this.options);
}
glob(...patterns) {
if (this.globFunction) return this.globWithOptions(patterns);
return this.globWithOptions(patterns, {
dot: true
});
}
globWithOptions(patterns, ...options) {
const globFn = this.globFunction || pm;
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
var isMatch = this.globCache[patterns.join("\0")];
if (!isMatch) {
isMatch = globFn(patterns, ...options);
this.globCache[patterns.join("\0")] = isMatch;
}
this.options.filters.push((path)=>isMatch(path));
return this;
}
}
exports.Builder = Builder;
},
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
if (void 0 === k2) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
enumerable: true,
get: function() {
return m[k];
}
};
Object.defineProperty(o, k2, desc);
} : function(o, m, k, k2) {
if (void 0 === k2) k2 = k;
o[k2] = m[k];
});
var __exportStar = this && this.__exportStar || function(m, exports) {
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.fdir = void 0;
const builder_1 = __webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/builder/index.js");
Object.defineProperty(exports, "fdir", {
enumerable: true,
get: function() {
return builder_1.Builder;
}
});
__exportStar(__webpack_require__("../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/types.js"), exports);
},
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/types.js": function(__unused_webpack_module, exports) {
Object.defineProperty(exports, "__esModule", {
value: true
});
},
"../../node_modules/.pnpm/fdir@6.4.4_picomatch@4.0.2/node_modules/fdir/dist/utils.js": function(__unused_webpack_module, exports, __webpack_require__) {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.normalizePath = exports.isRootDirectory = exports.convertSlashes = exports.cleanPath = void 0;
const path_1 = __webpack_require__("node:path");
function cleanPath(path) {
let normalized = (0, path_1.normalize)(path);
if (normalized.length > 1 && normalized[normalized.length - 1] === path_1.sep) normalized = normalized.substring(0, normalized.length - 1);
return normalized;
}
exports.cleanPath = cleanPath;
const SLASHES_REGEX = /[\\/]/g;
function convertSlashes(path, separator) {
return path.replace(SLASHES_REGEX, separator);
}
exports.convertSlashes = convertSlashes;
function isRootDirectory(path) {
return "/" === path || /^[a-z]:\\$/i.test(path);
}
exports.isRootDirectory = isRootDirectory;
function normalizePath(path, options) {
const { resolvePaths, normalizePath, pathSeparator } = options;
const pathNeedsCleaning = "win32" === process.platform && path.includes("/") || path.startsWith(".");
if (resolvePaths) path = (0, path_1.resolve)(path);
if (normalizePath || pathNeedsCleaning) path = cleanPath(path);
if ("." === path) return "";
const needsSeperator = path[path.length - 1] !== pathSeparator;
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
}
exports.normalizePath = normalizePath;
},
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js": function(module) {
let p = process || {}, argv = p.argv || [], env = p.env || {};
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);
let formatter = (open, close, replace = open)=>(input)=>{
let string = "" + input, index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
let replaceClose = (string, close, replace, index)=>{
let result = "", cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
}while (~index);
return result + string.substring(cursor);
};
let createColors = (enabled = isColorSupported)=>{
let f = enabled ? formatter : ()=>String;
return {
isColorSupported: enabled,
reset: f("\x1b[0m", "\x1b[0m"),
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
italic: f("\x1b[3m", "\x1b[23m"),
underline: f("\x1b[4m", "\x1b[24m"),
inverse: f("\x1b[7m", "\x1b[27m"),
hidden: f("\x1b[8m", "\x1b[28m"),
strikethrough: f("\x1b[9m", "\x1b[29m"),
black: f("\x1b[30m", "\x1b[39m"),
red: f("\x1b[31m", "\x1b[39m"),
green: f("\x1b[32m", "\x1b[39m"),
yellow: f("\x1b[33m", "\x1b[39m"),
blue: f("\x1b[34m", "\x1b[39m"),
magenta: f("\x1b[35m", "\x1b[39m"),
cyan: f("\x1b[36m", "\x1b[39m"),
white: f("\x1b[37m", "\x1b[39m"),
gray: f("\x1b[90m", "\x1b[39m"),
bgBlack: f("\x1b[40m", "\x1b[49m"),
bgRed: f("\x1b[41m", "\x1b[49m"),
bgGreen: f("\x1b[42m", "\x1b[49m"),
bgYellow: f("\x1b[43m", "\x1b[49m"),
bgBlue: f("\x1b[44m", "\x1b[49m"),
bgMagenta: f("\x1b[45m", "\x1b[49m"),
bgCyan: f("\x1b[46m", "\x1b[49m"),
bgWhite: f("\x1b[47m", "\x1b[49m"),
blackBright: f("\x1b[90m", "\x1b[39m"),
redBright: f("\x1b[91m", "\x1b[39m"),
greenBright: f("\x1b[92m", "\x1b[39m"),
yellowBright: f("\x1b[93m", "\x1b[39m"),
blueBright: f("\x1b[94m", "\x1b[39m"),
magentaBright: f("\x1b[95m", "\x1b[39m"),
cyanBright: f("\x1b[96m", "\x1b[39m"),
whiteBright: f("\x1b[97m", "\x1b[39m"),
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
bgRedBright: f("\x1b[101m", "\x1b[49m"),
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
};
};
module.exports = createColors();
module.exports.createColors = createColors;
},
"../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/picomatch.js");
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
function picomatch(glob, options, returnState = false) {
if (options && (null === options.windows || void 0 === options.windows)) options = {
...options,
windows: utils.isWindows()
};
return pico(glob, options, returnState);
}
Object.assign(picomatch, pico);
module.exports = picomatch;
},
"../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js": function(module) {
const WIN_SLASH = '\\\\/';
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
const DOT_LITERAL = '\\.';
const PLUS_LITERAL = '\\+';
const QMARK_LITERAL = '\\?';
const SLASH_LITERAL = '\\/';
const ONE_CHAR = '(?=.)';
const QMARK = '[^/]';
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
const NO_DOT = `(?!${DOT_LITERAL})`;
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
const STAR = `${QMARK}*?`;
const SEP = '/';
const POSIX_CHARS = {
DOT_LITERAL,
PLUS_LITERAL,
QMARK_LITERAL,
SLASH_LITERAL,
ONE_CHAR,
QMARK,
END_ANCHOR,
DOTS_SLASH,
NO_DOT,
NO_DOTS,
NO_DOT_SLASH,
NO_DOTS_SLASH,
QMARK_NO_DOT,
STAR,
START_ANCHOR,
SEP
};
const WINDOWS_CHARS = {
...POSIX_CHARS,
SLASH_LITERAL: `[${WIN_SLASH}]`,
QMARK: WIN_NO_SLASH,
STAR: `${WIN_NO_SLASH}*?`,
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
NO_DOT: `(?!${DOT_LITERAL})`,
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
SEP: '\\'
};
const POSIX_REGEX_SOURCE = {
alnum: 'a-zA-Z0-9',
alpha: 'a-zA-Z',
ascii: '\\x00-\\x7F',
blank: ' \\t',
cntrl: '\\x00-\\x1F\\x7F',
digit: '0-9',
graph: '\\x21-\\x7E',
lower: 'a-z',
print: '\\x20-\\x7E ',
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
space: ' \\t\\r\\n\\v\\f',
upper: 'A-Z',
word: 'A-Za-z0-9_',
xdigit: 'A-Fa-f0-9'
};
module.exports = {
MAX_LENGTH: 65536,
POSIX_REGEX_SOURCE,
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
REPLACEMENTS: {
'***': '*',
'**/**': '**',
'**/**/**': '**'
},
CHAR_0: 48,
CHAR_9: 57,
CHAR_UPPERCASE_A: 65,
CHAR_LOWERCASE_A: 97,
CHAR_UPPERCASE_Z: 90,
CHAR_LOWERCASE_Z: 122,
CHAR_LEFT_PARENTHESES: 40,
CHAR_RIGHT_PARENTHESES: 41,
CHAR_ASTERISK: 42,
CHAR_AMPERSAND: 38,
CHAR_AT: 64,
CHAR_BACKWARD_SLASH: 92,
CHAR_CARRIAGE_RETURN: 13,
CHAR_CIRCUMFLEX_ACCENT: 94,
CHAR_COLON: 58,
CHAR_COMMA: 44,
CHAR_DOT: 46,
CHAR_DOUBLE_QUOTE: 34,
CHAR_EQUAL: 61,
CHAR_EXCLAMATION_MARK: 33,
CHAR_FORM_FEED: 12,
CHAR_FORWARD_SLASH: 47,
CHAR_GRAVE_ACCENT: 96,
CHAR_HASH: 35,
CHAR_HYPHEN_MINUS: 45,
CHAR_LEFT_ANGLE_BRACKET: 60,
CHAR_LEFT_CURLY_BRACE: 123,
CHAR_LEFT_SQUARE_BRACKET: 91,
CHAR_LINE_FEED: 10,
CHAR_NO_BREAK_SPACE: 160,
CHAR_PERCENT: 37,
CHAR_PLUS: 43,
CHAR_QUESTION_MARK: 63,
CHAR_RIGHT_ANGLE_BRACKET: 62,
CHAR_RIGHT_CURLY_BRACE: 125,
CHAR_RIGHT_SQUARE_BRACKET: 93,
CHAR_SEMICOLON: 59,
CHAR_SINGLE_QUOTE: 39,
CHAR_SPACE: 32,
CHAR_TAB: 9,
CHAR_UNDERSCORE: 95,
CHAR_VERTICAL_LINE: 124,
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
extglobChars (chars) {
return {
'!': {
type: 'negate',
open: '(?:(?!(?:',
close: `))${chars.STAR})`
},
'?': {
type: 'qmark',
open: '(?:',
close: ')?'
},
'+': {
type: 'plus',
open: '(?:',
close: ')+'
},
'*': {
type: 'star',
open: '(?:',
close: ')*'
},
'@': {
type: 'at',
open: '(?:',
close: ')'
}
};
},
globChars (win32) {
return true === win32 ? WINDOWS_CHARS : POSIX_CHARS;
}
};
},
"../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/parse.js": function(module, __unused_webpack_exports, __webpack_require__) {
const constants = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/constants.js");
const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js");
const { MAX_LENGTH, POSIX_REGEX_SOURCE, REGEX_NON_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_BACKREF, REPLACEMENTS } = constants;
const expandRange = (args, options)=>{
if ('function' == typeof options.expandRange) return options.expandRange(...args, options);
args.sort();
const value = `[${args.join('-')}]`;
try {
new RegExp(value);
} catch (ex) {
return args.map((v)=>utils.escapeRegex(v)).join('..');
}
return value;
};
const syntaxError = (type, char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
const parse = (input, options)=>{
if ('string' != typeof input) throw new TypeError('Expected a string');
input = REPLACEMENTS[input] || input;
const opts = {
...options
};
const max = 'number' == typeof opts.maxLength ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
let len = input.length;
if (len > max) throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
const bos = {
type: 'bos',
value: '',
output: opts.prepend || ''
};
const tokens = [
bos
];
const capture = opts.capture ? '' : '?:';
const PLATFORM_CHARS = constants.globChars(opts.windows);
const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS);
const { DOT_LITERAL, PLUS_LITERAL, SLASH_LITERAL, ONE_CHAR, DOTS_SLASH, NO_DOT, NO_DOT_SLASH, NO_DOTS_SLASH, QMARK, QMARK_NO_DOT, STAR, START_ANCHOR } = PLATFORM_CHARS;
const globstar = (opts)=>`(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
const nodot = opts.dot ? '' : NO_DOT;
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
let star = true === opts.bash ? globstar(opts) : STAR;
if (opts.capture) star = `(${star})`;
if ('boolean' == typeof opts.noext) opts.noextglob = opts.noext;
const state = {
input,
index: -1,
start: 0,
dot: true === opts.dot,
consumed: '',
output: '',
prefix: '',
backtrack: false,
negated: false,
brackets: 0,
braces: 0,
parens: 0,
quotes: 0,
globstar: false,
tokens
};
input = utils.removePrefix(input, state);
len = input.length;
const extglobs = [];
const braces = [];
const stack = [];
let prev = bos;
let value;
const eos = ()=>state.index === len - 1;
const peek = state.peek = (n = 1)=>input[state.index + n];
const advance = state.advance = ()=>input[++state.index] || '';
const remaining = ()=>input.slice(state.index + 1);
const consume = (value = '', num = 0)=>{
state.consumed += value;
state.index += num;
};
const append = (token)=>{
state.output += null != token.output ? token.output : token.value;
consume(token.value);
};
const negate = ()=>{
let count = 1;
while('!' === peek() && ('(' !== peek(2) || '?' === peek(3))){
advance();
state.start++;
count++;
}
if (count % 2 === 0) return false;
state.negated = true;
state.start++;
return true;
};
const increment = (type)=>{
state[type]++;
stack.push(type);
};
const decrement = (type)=>{
state[type]--;
stack.pop();
};
const push = (tok)=>{
if ('globstar' === prev.type) {
const isBrace = state.braces > 0 && ('comma' === tok.type || 'brace' === tok.type);
const isExtglob = true === tok.extglob || extglobs.length && ('pipe' === tok.type || 'paren' === tok.type);
if ('slash' !== tok.type && 'paren' !== tok.type && !isBrace && !isExtglob) {
state.output = state.output.slice(0, -prev.output.length);
prev.type = 'star';
prev.value = '*';
prev.output = star;
state.output += prev.output;
}
}
if (extglobs.length && 'paren' !== tok.type) extglobs[extglobs.length - 1].inner += tok.value;
if (tok.value || tok.output) append(tok);
if (prev && 'text' === prev.type && 'text' === tok.type) {
prev.output = (prev.output || prev.value) + tok.value;
prev.value += tok.value;