@rstest/core 0.7.3 → 0.7.4

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.
@@ -1,83 +1,12 @@
1
1
  import 'module';
2
2
  /*#__PURE__*/ import.meta.url;
3
- import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
4
- import * as __rspack_external_node_os_74b4b876 from "node:os";
5
- import * as __rspack_external_node_path_c5b9b54f from "node:path";
6
- import * as __rspack_external_node_tty_c64aab7e from "node:tty";
7
- import * as __rspack_external_node_util_1b29d436 from "node:util";
8
3
  import { __webpack_require__ } from "./rslib-runtime.js";
9
- import node_process from "node:process";
10
4
  import { fileURLToPath } from "url";
11
5
  import { createRequire } from "module";
12
6
  import promises, { lstat, readdir, realpath, stat as promises_stat, writeFile } from "node:fs/promises";
13
- import { createRequire as external_node_module_createRequire, isBuiltin } from "node:module";
7
+ import { createRequire as external_node_module_createRequire } from "./664.js";
8
+ import { normalize, isAbsolute, posix, join, parse } from "./278.js";
14
9
  __webpack_require__.add({
15
- "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
16
- let p = process || {}, argv = p.argv || [], env = p.env || {};
17
- 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);
18
- let formatter = (open, close, replace = open)=>(input)=>{
19
- let string = "" + input, index = string.indexOf(close, open.length);
20
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
21
- };
22
- let replaceClose = (string, close, replace, index)=>{
23
- let result = "", cursor = 0;
24
- do {
25
- result += string.substring(cursor, index) + replace;
26
- cursor = index + close.length;
27
- index = string.indexOf(close, cursor);
28
- }while (~index);
29
- return result + string.substring(cursor);
30
- };
31
- let createColors = (enabled = isColorSupported)=>{
32
- let f = enabled ? formatter : ()=>String;
33
- return {
34
- isColorSupported: enabled,
35
- reset: f("\x1b[0m", "\x1b[0m"),
36
- bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
37
- dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
38
- italic: f("\x1b[3m", "\x1b[23m"),
39
- underline: f("\x1b[4m", "\x1b[24m"),
40
- inverse: f("\x1b[7m", "\x1b[27m"),
41
- hidden: f("\x1b[8m", "\x1b[28m"),
42
- strikethrough: f("\x1b[9m", "\x1b[29m"),
43
- black: f("\x1b[30m", "\x1b[39m"),
44
- red: f("\x1b[31m", "\x1b[39m"),
45
- green: f("\x1b[32m", "\x1b[39m"),
46
- yellow: f("\x1b[33m", "\x1b[39m"),
47
- blue: f("\x1b[34m", "\x1b[39m"),
48
- magenta: f("\x1b[35m", "\x1b[39m"),
49
- cyan: f("\x1b[36m", "\x1b[39m"),
50
- white: f("\x1b[37m", "\x1b[39m"),
51
- gray: f("\x1b[90m", "\x1b[39m"),
52
- bgBlack: f("\x1b[40m", "\x1b[49m"),
53
- bgRed: f("\x1b[41m", "\x1b[49m"),
54
- bgGreen: f("\x1b[42m", "\x1b[49m"),
55
- bgYellow: f("\x1b[43m", "\x1b[49m"),
56
- bgBlue: f("\x1b[44m", "\x1b[49m"),
57
- bgMagenta: f("\x1b[45m", "\x1b[49m"),
58
- bgCyan: f("\x1b[46m", "\x1b[49m"),
59
- bgWhite: f("\x1b[47m", "\x1b[49m"),
60
- blackBright: f("\x1b[90m", "\x1b[39m"),
61
- redBright: f("\x1b[91m", "\x1b[39m"),
62
- greenBright: f("\x1b[92m", "\x1b[39m"),
63
- yellowBright: f("\x1b[93m", "\x1b[39m"),
64
- blueBright: f("\x1b[94m", "\x1b[39m"),
65
- magentaBright: f("\x1b[95m", "\x1b[39m"),
66
- cyanBright: f("\x1b[96m", "\x1b[39m"),
67
- whiteBright: f("\x1b[97m", "\x1b[39m"),
68
- bgBlackBright: f("\x1b[100m", "\x1b[49m"),
69
- bgRedBright: f("\x1b[101m", "\x1b[49m"),
70
- bgGreenBright: f("\x1b[102m", "\x1b[49m"),
71
- bgYellowBright: f("\x1b[103m", "\x1b[49m"),
72
- bgBlueBright: f("\x1b[104m", "\x1b[49m"),
73
- bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
74
- bgCyanBright: f("\x1b[106m", "\x1b[49m"),
75
- bgWhiteBright: f("\x1b[107m", "\x1b[49m")
76
- };
77
- };
78
- module.exports = createColors();
79
- module.exports.createColors = createColors;
80
- },
81
10
  "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
82
11
  const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js");
83
12
  const utils = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/utils.js");
@@ -1483,767 +1412,10 @@ __webpack_require__.add({
1483
1412
  if ('' === last) return segs[segs.length - 2];
1484
1413
  return last;
1485
1414
  };
1486
- },
1487
- "node:fs" (module) {
1488
- module.exports = __rspack_external_node_fs_5ea92f0c;
1489
- },
1490
- "node:os" (module) {
1491
- module.exports = __rspack_external_node_os_74b4b876;
1492
- },
1493
- path (module) {
1494
- module.exports = __rspack_external_node_path_c5b9b54f;
1495
- },
1496
- "node:tty" (module) {
1497
- module.exports = __rspack_external_node_tty_c64aab7e;
1498
- },
1499
- "node:util" (module) {
1500
- module.exports = __rspack_external_node_util_1b29d436;
1501
1415
  }
1502
1416
  });
1503
- const external_node_os_ = __webpack_require__("node:os");
1504
- const external_node_tty_ = __webpack_require__("node:tty");
1505
- function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : node_process.argv) {
1506
- const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
1507
- const position = argv.indexOf(prefix + flag);
1508
- const terminatorPosition = argv.indexOf('--');
1509
- return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
1510
- }
1511
- const { env: env } = node_process;
1512
- let flagForceColor;
1513
- if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
1514
- else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
1515
- function envForceColor() {
1516
- if (!('FORCE_COLOR' in env)) return;
1517
- if ('true' === env.FORCE_COLOR) return 1;
1518
- if ('false' === env.FORCE_COLOR) return 0;
1519
- if (0 === env.FORCE_COLOR.length) return 1;
1520
- const level = Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1521
- if (![
1522
- 0,
1523
- 1,
1524
- 2,
1525
- 3
1526
- ].includes(level)) return;
1527
- return level;
1528
- }
1529
- function translateLevel(level) {
1530
- if (0 === level) return false;
1531
- return {
1532
- level,
1533
- hasBasic: true,
1534
- has256: level >= 2,
1535
- has16m: level >= 3
1536
- };
1537
- }
1538
- function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1539
- const noFlagForceColor = envForceColor();
1540
- if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
1541
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1542
- if (0 === forceColor) return 0;
1543
- if (sniffFlags) {
1544
- if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
1545
- if (hasFlag('color=256')) return 2;
1546
- }
1547
- if ('TF_BUILD' in env && 'AGENT_NAME' in env) return 1;
1548
- if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
1549
- const min = forceColor || 0;
1550
- if ('dumb' === env.TERM) return min;
1551
- if ('win32' === node_process.platform) {
1552
- const osRelease = external_node_os_["default"].release().split('.');
1553
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
1554
- return 1;
1555
- }
1556
- if ('CI' in env) {
1557
- if ([
1558
- 'GITHUB_ACTIONS',
1559
- 'GITEA_ACTIONS',
1560
- 'CIRCLECI'
1561
- ].some((key)=>key in env)) return 3;
1562
- if ([
1563
- 'TRAVIS',
1564
- 'APPVEYOR',
1565
- 'GITLAB_CI',
1566
- 'BUILDKITE',
1567
- 'DRONE'
1568
- ].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
1569
- return min;
1570
- }
1571
- if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1572
- if ('truecolor' === env.COLORTERM) return 3;
1573
- if ('xterm-kitty' === env.TERM) return 3;
1574
- if ('xterm-ghostty' === env.TERM) return 3;
1575
- if ('wezterm' === env.TERM) return 3;
1576
- if ('TERM_PROGRAM' in env) {
1577
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1578
- switch(env.TERM_PROGRAM){
1579
- case 'iTerm.app':
1580
- return version >= 3 ? 3 : 2;
1581
- case 'Apple_Terminal':
1582
- return 2;
1583
- }
1584
- }
1585
- if (/-256(color)?$/i.test(env.TERM)) return 2;
1586
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
1587
- if ('COLORTERM' in env) return 1;
1588
- return min;
1589
- }
1590
- function createSupportsColor(stream, options = {}) {
1591
- const level = _supportsColor(stream, {
1592
- streamIsTTY: stream && stream.isTTY,
1593
- ...options
1594
- });
1595
- return translateLevel(level);
1596
- }
1597
- const supportsColor = {
1598
- stdout: createSupportsColor({
1599
- isTTY: external_node_tty_["default"].isatty(1)
1600
- }),
1601
- stderr: createSupportsColor({
1602
- isTTY: external_node_tty_["default"].isatty(2)
1603
- })
1604
- };
1605
- const supports_color = supportsColor;
1606
- const colorLevel = supports_color.stdout ? supports_color.stdout.level : 0;
1607
- let errorStackRegExp = /at [^\r\n]{0,200}:\d+:\d+[\s\)]*$/;
1608
- let anonymousErrorStackRegExp = /at [^\r\n]{0,200}\(<anonymous>\)$/;
1609
- let indexErrorStackRegExp = /at [^\r\n]{0,200}\(index\s\d+\)$/;
1610
- let isErrorStackMessage = (message)=>errorStackRegExp.test(message) || anonymousErrorStackRegExp.test(message) || indexErrorStackRegExp.test(message);
1611
- let formatter = (open, close, replace = open)=>colorLevel >= 2 ? (input)=>{
1612
- let string = '' + input;
1613
- let index = string.indexOf(close, open.length);
1614
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
1615
- } : String;
1616
- let replaceClose = (string, close, replace, index)=>{
1617
- let start = string.substring(0, index) + replace;
1618
- let end = string.substring(index + close.length);
1619
- let nextIndex = end.indexOf(close);
1620
- return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
1621
- };
1622
- const bold = formatter('\x1b[1m', '\x1b[22m', '\x1b[22m\x1b[1m');
1623
- const red = formatter('\x1b[31m', '\x1b[39m');
1624
- const green = formatter('\x1b[32m', '\x1b[39m');
1625
- const yellow = formatter('\x1b[33m', '\x1b[39m');
1626
- const magenta = formatter('\x1b[35m', '\x1b[39m');
1627
- const cyan = formatter('\x1b[36m', '\x1b[39m');
1628
- const gray = formatter('\x1b[90m', '\x1b[39m');
1629
- let startColor = [
1630
- 189,
1631
- 255,
1632
- 243
1633
- ];
1634
- let endColor = [
1635
- 74,
1636
- 194,
1637
- 154
1638
- ];
1639
- let isWord = (char)=>!/[\s\n]/.test(char);
1640
- let gradient = (message)=>{
1641
- if (colorLevel < 3) return 2 === colorLevel ? bold(cyan(message)) : message;
1642
- let chars = [
1643
- ...message
1644
- ];
1645
- let steps = chars.filter(isWord).length;
1646
- let r = startColor[0];
1647
- let g = startColor[1];
1648
- let b = startColor[2];
1649
- let rStep = (endColor[0] - r) / steps;
1650
- let gStep = (endColor[1] - g) / steps;
1651
- let bStep = (endColor[2] - b) / steps;
1652
- let output = '';
1653
- for (let char of chars){
1654
- if (isWord(char)) {
1655
- r += rStep;
1656
- g += gStep;
1657
- b += bStep;
1658
- }
1659
- output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
1660
- }
1661
- return bold(output);
1662
- };
1663
- let LOG_LEVEL = {
1664
- silent: -1,
1665
- error: 0,
1666
- warn: 1,
1667
- info: 2,
1668
- log: 2,
1669
- verbose: 3
1670
- };
1671
- let LOG_TYPES = {
1672
- error: {
1673
- label: 'error',
1674
- level: 'error',
1675
- color: red
1676
- },
1677
- warn: {
1678
- label: 'warn',
1679
- level: 'warn',
1680
- color: yellow
1681
- },
1682
- info: {
1683
- label: 'info',
1684
- level: 'info',
1685
- color: cyan
1686
- },
1687
- start: {
1688
- label: 'start',
1689
- level: 'info',
1690
- color: cyan
1691
- },
1692
- ready: {
1693
- label: 'ready',
1694
- level: 'info',
1695
- color: green
1696
- },
1697
- success: {
1698
- label: 'success',
1699
- level: 'info',
1700
- color: green
1701
- },
1702
- log: {
1703
- level: 'info'
1704
- },
1705
- debug: {
1706
- label: 'debug',
1707
- level: 'verbose',
1708
- color: magenta
1709
- }
1710
- };
1711
- const normalizeErrorMessage = (err)=>{
1712
- if (err.stack) {
1713
- let [name, ...rest] = err.stack.split('\n');
1714
- if (name.startsWith('Error: ')) name = name.slice(7);
1715
- return `${name}\n${gray(rest.join('\n'))}`;
1716
- }
1717
- return err.message;
1718
- };
1719
- let createLogger = (options = {})=>{
1720
- let maxLevel = options.level || 'info';
1721
- let log = (type, message, ...args)=>{
1722
- let logType = LOG_TYPES[type];
1723
- const { level } = logType;
1724
- if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
1725
- if (null == message) return console.log();
1726
- let label = '';
1727
- let text = '';
1728
- if ('label' in logType) {
1729
- label = (logType.label || '').padEnd(7);
1730
- label = bold(logType.color ? logType.color(label) : label);
1731
- }
1732
- if (message instanceof Error) {
1733
- text += normalizeErrorMessage(message);
1734
- const { cause } = message;
1735
- if (cause) {
1736
- text += yellow('\n [cause]: ');
1737
- text += cause instanceof Error ? normalizeErrorMessage(cause) : String(cause);
1738
- }
1739
- } else if ('error' === level && 'string' == typeof message) {
1740
- let lines = message.split('\n');
1741
- text = lines.map((line)=>isErrorStackMessage(line) ? gray(line) : line).join('\n');
1742
- } else text = `${message}`;
1743
- const method = 'error' === level || 'warn' === level ? level : 'log';
1744
- console[method](label.length ? `${label} ${text}` : text, ...args);
1745
- };
1746
- let logger = {
1747
- greet: (message)=>log('log', gradient(message))
1748
- };
1749
- Object.keys(LOG_TYPES).forEach((key)=>{
1750
- logger[key] = (...args)=>log(key, ...args);
1751
- });
1752
- Object.defineProperty(logger, 'level', {
1753
- get: ()=>maxLevel,
1754
- set (val) {
1755
- maxLevel = val;
1756
- }
1757
- });
1758
- logger.override = (customLogger)=>{
1759
- Object.assign(logger, customLogger);
1760
- };
1761
- return logger;
1762
- };
1763
- let src_logger = createLogger();
1764
1417
  const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
1765
1418
  var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
1766
- const isDebug = ()=>{
1767
- if (!process.env.DEBUG) return false;
1768
- const values = process.env.DEBUG.toLocaleLowerCase().split(',');
1769
- return [
1770
- 'rstest',
1771
- 'rsbuild',
1772
- 'builder',
1773
- '*'
1774
- ].some((key)=>values.includes(key));
1775
- };
1776
- if (isDebug()) src_logger.level = 'verbose';
1777
- function getTime() {
1778
- const now = new Date();
1779
- const hours = String(now.getHours()).padStart(2, '0');
1780
- const minutes = String(now.getMinutes()).padStart(2, '0');
1781
- const seconds = String(now.getSeconds()).padStart(2, '0');
1782
- return `${hours}:${minutes}:${seconds}`;
1783
- }
1784
- src_logger.override({
1785
- debug: (message, ...args)=>{
1786
- if ('verbose' !== src_logger.level) return;
1787
- const time = picocolors_default().gray(getTime());
1788
- console.log(` ${picocolors_default().magenta('rstest')} ${time} ${message}`, ...args);
1789
- }
1790
- });
1791
- const clearScreen = (force = false)=>{
1792
- if (!isDebug() || force) console.log('\x1Bc');
1793
- };
1794
- const logger_logger = {
1795
- ...src_logger,
1796
- stderr: (message, ...args)=>{
1797
- console.error(message, ...args);
1798
- }
1799
- };
1800
- let _lazyMatch = ()=>{
1801
- var __lib__ = (()=>{
1802
- var m = Object.defineProperty, V = Object.getOwnPropertyDescriptor, G = Object.getOwnPropertyNames, T = Object.prototype.hasOwnProperty, q = (r, e)=>{
1803
- for(var n in e)m(r, n, {
1804
- get: e[n],
1805
- enumerable: true
1806
- });
1807
- }, H = (r, e, n, a)=>{
1808
- if (e && "object" == typeof e || "function" == typeof e) for (let t of G(e))T.call(r, t) || t === n || m(r, t, {
1809
- get: ()=>e[t],
1810
- enumerable: !(a = V(e, t)) || a.enumerable
1811
- });
1812
- return r;
1813
- }, J = (r)=>H(m({}, "__esModule", {
1814
- value: true
1815
- }), r), w = {};
1816
- q(w, {
1817
- default: ()=>re
1818
- });
1819
- var A = (r)=>Array.isArray(r), d = (r)=>"function" == typeof r, Q = (r)=>0 === r.length, W = (r)=>"number" == typeof r, K = (r)=>"object" == typeof r && null !== r, X = (r)=>r instanceof RegExp, b = (r)=>"string" == typeof r, h = (r)=>void 0 === r, Y = (r)=>{
1820
- const e = new Map;
1821
- return (n)=>{
1822
- const a = e.get(n);
1823
- if (a) return a;
1824
- const t = r(n);
1825
- return e.set(n, t), t;
1826
- };
1827
- }, rr = (r, e, n = {})=>{
1828
- const a = {
1829
- cache: {},
1830
- input: r,
1831
- index: 0,
1832
- indexMax: 0,
1833
- options: n,
1834
- output: []
1835
- };
1836
- if (v(e)(a) && a.index === r.length) return a.output;
1837
- throw new Error(`Failed to parse at index ${a.indexMax}`);
1838
- }, i = (r, e)=>A(r) ? er(r, e) : b(r) ? ar(r, e) : nr(r, e), er = (r, e)=>{
1839
- const n = {};
1840
- for (const a of r){
1841
- if (1 !== a.length) throw new Error(`Invalid character: "${a}"`);
1842
- const t = a.charCodeAt(0);
1843
- n[t] = true;
1844
- }
1845
- return (a)=>{
1846
- const t = a.index, o = a.input;
1847
- for(; a.index < o.length && o.charCodeAt(a.index) in n;)a.index += 1;
1848
- const u = a.index;
1849
- if (u > t) {
1850
- if (!h(e) && !a.options.silent) {
1851
- const s = a.input.slice(t, u), c = d(e) ? e(s, o, String(t)) : e;
1852
- h(c) || a.output.push(c);
1853
- }
1854
- a.indexMax = Math.max(a.indexMax, a.index);
1855
- }
1856
- return true;
1857
- };
1858
- }, nr = (r, e)=>{
1859
- const n = r.source, a = r.flags.replace(/y|$/, "y"), t = new RegExp(n, a);
1860
- return g((o)=>{
1861
- t.lastIndex = o.index;
1862
- const u = t.exec(o.input);
1863
- if (!u) return false;
1864
- if (!h(e) && !o.options.silent) {
1865
- const s = d(e) ? e(...u, o.input, String(o.index)) : e;
1866
- h(s) || o.output.push(s);
1867
- }
1868
- return o.index += u[0].length, o.indexMax = Math.max(o.indexMax, o.index), true;
1869
- });
1870
- }, ar = (r, e)=>(n)=>{
1871
- if (!n.input.startsWith(r, n.index)) return false;
1872
- if (!h(e) && !n.options.silent) {
1873
- const t = d(e) ? e(r, n.input, String(n.index)) : e;
1874
- h(t) || n.output.push(t);
1875
- }
1876
- return n.index += r.length, n.indexMax = Math.max(n.indexMax, n.index), true;
1877
- }, C = (r, e, n, a)=>{
1878
- const t = v(r);
1879
- return g(_(M((o)=>{
1880
- let u = 0;
1881
- for(; u < n;){
1882
- const s = o.index;
1883
- if (!t(o) || (u += 1, o.index === s)) break;
1884
- }
1885
- return u >= e;
1886
- })));
1887
- }, tr = (r, e)=>C(r, 0, 1), f = (r, e)=>C(r, 0, 1 / 0), x = (r, e)=>{
1888
- const n = r.map(v);
1889
- return g(_(M((a)=>{
1890
- for(let t = 0, o = n.length; t < o; t++)if (!n[t](a)) return false;
1891
- return true;
1892
- })));
1893
- }, l = (r, e)=>{
1894
- const n = r.map(v);
1895
- return g(_((a)=>{
1896
- for(let t = 0, o = n.length; t < o; t++)if (n[t](a)) return true;
1897
- return false;
1898
- }));
1899
- }, M = (r, e = false)=>{
1900
- const n = v(r);
1901
- return (a)=>{
1902
- const t = a.index, o = a.output.length, u = n(a);
1903
- return (!u || e) && (a.index = t, a.output.length !== o && (a.output.length = o)), u;
1904
- };
1905
- }, _ = (r, e)=>{
1906
- const n = v(r);
1907
- return n;
1908
- }, g = (()=>{
1909
- let r = 0;
1910
- return (e)=>{
1911
- const n = v(e), a = r += 1;
1912
- return (t)=>{
1913
- var o;
1914
- if (false === t.options.memoization) return n(t);
1915
- const u = t.index, s = (o = t.cache)[a] || (o[a] = new Map), c = s.get(u);
1916
- if (false === c) return false;
1917
- if (W(c)) return t.index = c, true;
1918
- if (c) return t.index = c.index, c.output?.length && t.output.push(...c.output), true;
1919
- {
1920
- const Z = t.output.length;
1921
- if (!n(t)) return s.set(u, false), false;
1922
- {
1923
- const D = t.index, U = t.output.length;
1924
- if (U > Z) {
1925
- const ee = t.output.slice(Z, U);
1926
- s.set(u, {
1927
- index: D,
1928
- output: ee
1929
- });
1930
- } else s.set(u, D);
1931
- return true;
1932
- }
1933
- }
1934
- };
1935
- };
1936
- })(), E = (r)=>{
1937
- let e;
1938
- return (n)=>(e || (e = v(r())), e(n));
1939
- }, v = Y((r)=>{
1940
- if (d(r)) return Q(r) ? E(r) : r;
1941
- if (b(r) || X(r)) return i(r);
1942
- if (A(r)) return x(r);
1943
- if (K(r)) return l(Object.values(r));
1944
- throw new Error("Invalid rule");
1945
- }), P = "abcdefghijklmnopqrstuvwxyz", ir = (r)=>{
1946
- let e = "";
1947
- for(; r > 0;){
1948
- const n = (r - 1) % 26;
1949
- e = P[n] + e, r = Math.floor((r - 1) / 26);
1950
- }
1951
- return e;
1952
- }, O = (r)=>{
1953
- let e = 0;
1954
- for(let n = 0, a = r.length; n < a; n++)e = 26 * e + P.indexOf(r[n]) + 1;
1955
- return e;
1956
- }, S = (r, e)=>{
1957
- if (e < r) return S(e, r);
1958
- const n = [];
1959
- for(; r <= e;)n.push(r++);
1960
- return n;
1961
- }, or = (r, e, n)=>S(r, e).map((a)=>String(a).padStart(n, "0")), R = (r, e)=>S(O(r), O(e)).map(ir), p = (r)=>r, z = (r)=>ur((e)=>rr(e, r, {
1962
- memoization: false
1963
- }).join("")), ur = (r)=>{
1964
- const e = {};
1965
- return (n)=>e[n] ?? (e[n] = r(n));
1966
- }, sr = i(/^\*\*\/\*$/, ".*"), cr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/, (r, e, n)=>`.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}`), lr = i(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/, (r, e, n, a)=>`.*${e ? "" : "(?:^|/)"}${n.replaceAll(".", "\\.")}(?:${a.replaceAll(",", "|").replaceAll(".", "\\.")})`), y = i(/\\./, p), pr = i(/[$.*+?^(){}[\]\|]/, (r)=>`\\${r}`), vr = i(/./, p), hr = i(/^(?:!!)*!(.*)$/, (r, e)=>`(?!^${L(e)}$).*?`), dr = i(/^(!!)+/, ""), fr = l([
1967
- hr,
1968
- dr
1969
- ]), xr = i(/\/(\*\*\/)+/, "(?:/.+/|/)"), gr = i(/^(\*\*\/)+/, "(?:^|.*/)"), mr = i(/\/(\*\*)$/, "(?:/.*|$)"), _r = i(/\*\*/, ".*"), j = l([
1970
- xr,
1971
- gr,
1972
- mr,
1973
- _r
1974
- ]), Sr = i(/\*\/(?!\*\*\/)/, "[^/]*/"), yr = i(/\*/, "[^/]*"), N = l([
1975
- Sr,
1976
- yr
1977
- ]), k = i("?", "[^/]"), $r = i("[", p), wr = i("]", p), Ar = i(/[!^]/, "^/"), br = i(/[a-z]-[a-z]|[0-9]-[0-9]/i, p), Cr = i(/[$.*+?^(){}[\|]/, (r)=>`\\${r}`), Mr = i(/[^\]]/, p), Er = l([
1978
- y,
1979
- Cr,
1980
- br,
1981
- Mr
1982
- ]), B = x([
1983
- $r,
1984
- tr(Ar),
1985
- f(Er),
1986
- wr
1987
- ]), Pr = i("{", "(?:"), Or = i("}", ")"), Rr = i(/(\d+)\.\.(\d+)/, (r, e, n)=>or(+e, +n, Math.min(e.length, n.length)).join("|")), zr = i(/([a-z]+)\.\.([a-z]+)/, (r, e, n)=>R(e, n).join("|")), jr = i(/([A-Z]+)\.\.([A-Z]+)/, (r, e, n)=>R(e.toLowerCase(), n.toLowerCase()).join("|").toUpperCase()), Nr = l([
1988
- Rr,
1989
- zr,
1990
- jr
1991
- ]), I = x([
1992
- Pr,
1993
- Nr,
1994
- Or
1995
- ]), kr = i("{", "(?:"), Br = i("}", ")"), Ir = i(",", "|"), Fr = i(/[$.*+?^(){[\]\|]/, (r)=>`\\${r}`), Lr = i(/[^}]/, p), Zr = E(()=>F), Dr = l([
1996
- j,
1997
- N,
1998
- k,
1999
- B,
2000
- I,
2001
- Zr,
2002
- y,
2003
- Fr,
2004
- Ir,
2005
- Lr
2006
- ]), F = x([
2007
- kr,
2008
- f(Dr),
2009
- Br
2010
- ]), Ur = f(l([
2011
- sr,
2012
- cr,
2013
- lr,
2014
- fr,
2015
- j,
2016
- N,
2017
- k,
2018
- B,
2019
- I,
2020
- F,
2021
- y,
2022
- pr,
2023
- vr
2024
- ])), Vr = Ur, Gr = z(Vr), L = Gr, Tr = i(/\\./, p), qr = i(/./, p), Hr = i(/\*\*\*+/, "*"), Jr = i(/([^/{[(!])\*\*/, (r, e)=>`${e}*`), Qr = i(/(^|.)\*\*(?=[^*/)\]}])/, (r, e)=>`${e}*`), Wr = f(l([
2025
- Tr,
2026
- Hr,
2027
- Jr,
2028
- Qr,
2029
- qr
2030
- ])), Kr = Wr, Xr = z(Kr), Yr = Xr, $ = (r, e)=>{
2031
- const n = Array.isArray(r) ? r : [
2032
- r
2033
- ];
2034
- if (!n.length) return false;
2035
- const a = n.map($.compile), t = n.every((s)=>/(\/(?:\*\*)?|\[\/\])$/.test(s)), o = e.replace(/[\\\/]+/g, "/").replace(/\/$/, t ? "/" : "");
2036
- return a.some((s)=>s.test(o));
2037
- };
2038
- $.compile = (r)=>new RegExp(`^${L(Yr(r))}$`, "s");
2039
- var re = $;
2040
- return J(w);
2041
- })();
2042
- return __lib__.default || __lib__;
2043
- };
2044
- let _match;
2045
- const zeptomatch = (path, pattern)=>{
2046
- if (!_match) {
2047
- _match = _lazyMatch();
2048
- _lazyMatch = null;
2049
- }
2050
- return _match(path, pattern);
2051
- };
2052
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2053
- function normalizeWindowsPath(input = "") {
2054
- if (!input) return input;
2055
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r)=>r.toUpperCase());
2056
- }
2057
- const _UNC_REGEX = /^[/\\]{2}/;
2058
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
2059
- const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
2060
- const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
2061
- const _EXTNAME_RE = /.(\.[^./]+|\.)$/;
2062
- const _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
2063
- const sep = "/";
2064
- const normalize = function(path) {
2065
- if (0 === path.length) return ".";
2066
- path = normalizeWindowsPath(path);
2067
- const isUNCPath = path.match(_UNC_REGEX);
2068
- const isPathAbsolute = isAbsolute(path);
2069
- const trailingSeparator = "/" === path[path.length - 1];
2070
- path = normalizeString(path, !isPathAbsolute);
2071
- if (0 === path.length) {
2072
- if (isPathAbsolute) return "/";
2073
- return trailingSeparator ? "./" : ".";
2074
- }
2075
- if (trailingSeparator) path += "/";
2076
- if (_DRIVE_LETTER_RE.test(path)) path += "/";
2077
- if (isUNCPath) {
2078
- if (!isPathAbsolute) return `//./${path}`;
2079
- return `//${path}`;
2080
- }
2081
- return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
2082
- };
2083
- const join = function(...segments) {
2084
- let path = "";
2085
- for (const seg of segments)if (seg) if (path.length > 0) {
2086
- const pathTrailing = "/" === path[path.length - 1];
2087
- const segLeading = "/" === seg[0];
2088
- const both = pathTrailing && segLeading;
2089
- if (both) path += seg.slice(1);
2090
- else path += pathTrailing || segLeading ? seg : `/${seg}`;
2091
- } else path += seg;
2092
- return normalize(path);
2093
- };
2094
- function pathe_M_eThtNZ_cwd() {
2095
- if ("undefined" != typeof process && "function" == typeof process.cwd) return process.cwd().replace(/\\/g, "/");
2096
- return "/";
2097
- }
2098
- const resolve = function(...arguments_) {
2099
- arguments_ = arguments_.map((argument)=>normalizeWindowsPath(argument));
2100
- let resolvedPath = "";
2101
- let resolvedAbsolute = false;
2102
- for(let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--){
2103
- const path = index >= 0 ? arguments_[index] : pathe_M_eThtNZ_cwd();
2104
- if (path && 0 !== path.length) {
2105
- resolvedPath = `${path}/${resolvedPath}`;
2106
- resolvedAbsolute = isAbsolute(path);
2107
- }
2108
- }
2109
- resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
2110
- if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
2111
- return resolvedPath.length > 0 ? resolvedPath : ".";
2112
- };
2113
- function normalizeString(path, allowAboveRoot) {
2114
- let res = "";
2115
- let lastSegmentLength = 0;
2116
- let lastSlash = -1;
2117
- let dots = 0;
2118
- let char = null;
2119
- for(let index = 0; index <= path.length; ++index){
2120
- if (index < path.length) char = path[index];
2121
- else if ("/" === char) break;
2122
- else char = "/";
2123
- if ("/" === char) {
2124
- if (lastSlash === index - 1 || 1 === dots) ;
2125
- else if (2 === dots) {
2126
- if (res.length < 2 || 2 !== lastSegmentLength || "." !== res[res.length - 1] || "." !== res[res.length - 2]) {
2127
- if (res.length > 2) {
2128
- const lastSlashIndex = res.lastIndexOf("/");
2129
- if (-1 === lastSlashIndex) {
2130
- res = "";
2131
- lastSegmentLength = 0;
2132
- } else {
2133
- res = res.slice(0, lastSlashIndex);
2134
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
2135
- }
2136
- lastSlash = index;
2137
- dots = 0;
2138
- continue;
2139
- } else if (res.length > 0) {
2140
- res = "";
2141
- lastSegmentLength = 0;
2142
- lastSlash = index;
2143
- dots = 0;
2144
- continue;
2145
- }
2146
- }
2147
- if (allowAboveRoot) {
2148
- res += res.length > 0 ? "/.." : "..";
2149
- lastSegmentLength = 2;
2150
- }
2151
- } else {
2152
- if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
2153
- else res = path.slice(lastSlash + 1, index);
2154
- lastSegmentLength = index - lastSlash - 1;
2155
- }
2156
- lastSlash = index;
2157
- dots = 0;
2158
- } else if ("." === char && -1 !== dots) ++dots;
2159
- else dots = -1;
2160
- }
2161
- return res;
2162
- }
2163
- const isAbsolute = function(p) {
2164
- return _IS_ABSOLUTE_RE.test(p);
2165
- };
2166
- const toNamespacedPath = function(p) {
2167
- return normalizeWindowsPath(p);
2168
- };
2169
- const extname = function(p) {
2170
- if (".." === p) return "";
2171
- const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
2172
- return match && match[1] || "";
2173
- };
2174
- const pathe_M_eThtNZ_relative = function(from, to) {
2175
- const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
2176
- const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
2177
- if (":" === _to[0][1] && ":" === _from[0][1] && _from[0] !== _to[0]) return _to.join("/");
2178
- const _fromCopy = [
2179
- ..._from
2180
- ];
2181
- for (const segment of _fromCopy){
2182
- if (_to[0] !== segment) break;
2183
- _from.shift();
2184
- _to.shift();
2185
- }
2186
- return [
2187
- ..._from.map(()=>".."),
2188
- ..._to
2189
- ].join("/");
2190
- };
2191
- const dirname = function(p) {
2192
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
2193
- if (1 === segments.length && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
2194
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
2195
- };
2196
- const pathe_M_eThtNZ_format = function(p) {
2197
- const ext = p.ext ? p.ext.startsWith(".") ? p.ext : `.${p.ext}` : "";
2198
- const segments = [
2199
- p.root,
2200
- p.dir,
2201
- p.base ?? (p.name ?? "") + ext
2202
- ].filter(Boolean);
2203
- return normalizeWindowsPath(p.root ? resolve(...segments) : segments.join("/"));
2204
- };
2205
- const basename = function(p, extension) {
2206
- const segments = normalizeWindowsPath(p).split("/");
2207
- let lastSegment = "";
2208
- for(let i = segments.length - 1; i >= 0; i--){
2209
- const val = segments[i];
2210
- if (val) {
2211
- lastSegment = val;
2212
- break;
2213
- }
2214
- }
2215
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
2216
- };
2217
- const parse = function(p) {
2218
- const root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "";
2219
- const base = basename(p);
2220
- const extension = extname(base);
2221
- return {
2222
- root,
2223
- dir: dirname(p),
2224
- base,
2225
- ext: extension,
2226
- name: base.slice(0, base.length - extension.length)
2227
- };
2228
- };
2229
- const matchesGlob = (path, pattern)=>zeptomatch(pattern, normalize(path));
2230
- const _path = {
2231
- __proto__: null,
2232
- basename: basename,
2233
- dirname: dirname,
2234
- extname: extname,
2235
- format: pathe_M_eThtNZ_format,
2236
- isAbsolute: isAbsolute,
2237
- join: join,
2238
- matchesGlob: matchesGlob,
2239
- normalize: normalize,
2240
- normalizeString: normalizeString,
2241
- parse: parse,
2242
- relative: pathe_M_eThtNZ_relative,
2243
- resolve: resolve,
2244
- sep: sep,
2245
- toNamespacedPath: toNamespacedPath
2246
- };
2247
1419
  const formatRootStr = (rootStr, root)=>rootStr.replace('<rootDir>', normalize(root));
2248
1420
  function getAbsolutePath(base, filepath) {
2249
1421
  return isAbsolute(filepath) ? filepath : join(base, filepath);
@@ -2353,8 +1525,8 @@ const bgColor = (background, str)=>{
2353
1525
  return picocolors_default()[background](picocolors_default().blackBright(picocolors_default().bold(str)));
2354
1526
  };
2355
1527
  const isTTY = (type = 'stdout')=>('stdin' === type ? process.stdin.isTTY : process.stdout.isTTY) && !process.env.CI;
2356
- const external_node_path_ = __webpack_require__("path");
2357
- const external_node_fs_ = __webpack_require__("node:fs");
1528
+ const external_node_path_ = __webpack_require__("node:path");
1529
+ const external_node_fs_ = __webpack_require__("fs");
2358
1530
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
2359
1531
  function cleanPath(path) {
2360
1532
  let normalized = (0, external_node_path_.normalize)(path);
@@ -2928,7 +2100,7 @@ function isDynamicPattern(pattern, options) {
2928
2100
  const scan = picomatch.scan(pattern);
2929
2101
  return scan.isGlob || scan.negated;
2930
2102
  }
2931
- function dist_log(...tasks) {
2103
+ function log(...tasks) {
2932
2104
  console.log(`[tinyglobby ${/* @__PURE__ */ new Date().toLocaleTimeString("es")}]`, ...tasks);
2933
2105
  }
2934
2106
  const PARENT_DIRECTORY = /^(\/?\.\.)+/;
@@ -3016,7 +2188,7 @@ function getCrawler(patterns, inputOptions = {}) {
3016
2188
  debug: true
3017
2189
  } : inputOptions;
3018
2190
  const cwd = normalizeCwd(options.cwd);
3019
- if (options.debug) dist_log("globbing with:", {
2191
+ if (options.debug) log("globbing with:", {
3020
2192
  patterns,
3021
2193
  options,
3022
2194
  cwd
@@ -3037,7 +2209,7 @@ function getCrawler(patterns, inputOptions = {}) {
3037
2209
  ...options,
3038
2210
  patterns
3039
2211
  }, cwd, props);
3040
- if (options.debug) dist_log("internal processing patterns:", processed);
2212
+ if (options.debug) log("internal processing patterns:", processed);
3041
2213
  const matchOptions = {
3042
2214
  dot: options.dot,
3043
2215
  nobrace: false === options.braceExpansion,
@@ -3059,14 +2231,14 @@ function getCrawler(patterns, inputOptions = {}) {
3059
2231
  options.debug ? (p, isDirectory)=>{
3060
2232
  const path$1 = format(p, isDirectory);
3061
2233
  const matches = matcher(path$1);
3062
- if (matches) dist_log(`matched ${path$1}`);
2234
+ if (matches) log(`matched ${path$1}`);
3063
2235
  return matches;
3064
2236
  } : (p, isDirectory)=>matcher(format(p, isDirectory))
3065
2237
  ],
3066
2238
  exclude: options.debug ? (_, p)=>{
3067
2239
  const relativePath = formatExclude(p, true);
3068
2240
  const skipped = "." !== relativePath && !partialMatcher(relativePath) || ignore(relativePath);
3069
- skipped ? dist_log(`skipped ${p}`) : dist_log(`crawling ${p}`);
2241
+ skipped ? log(`skipped ${p}`) : log(`crawling ${p}`);
3070
2242
  return skipped;
3071
2243
  } : (_, p)=>{
3072
2244
  const relativePath = formatExclude(p, true);
@@ -3101,7 +2273,7 @@ function getCrawler(patterns, inputOptions = {}) {
3101
2273
  } else if (false === options.onlyFiles) fdirOptions.includeDirs = true;
3102
2274
  props.root = props.root.replace(BACKSLASHES, "");
3103
2275
  const root = props.root;
3104
- if (options.debug) dist_log("internal properties:", props);
2276
+ if (options.debug) log("internal properties:", props);
3105
2277
  const relative = cwd !== root && !options.absolute && buildRelative(cwd, props.root);
3106
2278
  return [
3107
2279
  new Builder(fdirOptions).crawl(root),
@@ -3145,21 +2317,6 @@ const globalApis = [
3145
2317
  'onTestFailed'
3146
2318
  ];
3147
2319
  const TS_CONFIG_FILE = 'tsconfig.json';
3148
- const dist_delimiter = /* @__PURE__ */ (()=>globalThis.process?.platform === "win32" ? ";" : ":")();
3149
- const _platforms = {
3150
- posix: void 0,
3151
- win32: void 0
3152
- };
3153
- const mix = (del = dist_delimiter)=>new Proxy(_path, {
3154
- get (_, prop) {
3155
- if ("delimiter" === prop) return del;
3156
- if ("posix" === prop) return posix;
3157
- if ("win32" === prop) return win32;
3158
- return _platforms[prop] || _path[prop];
3159
- }
3160
- });
3161
- const posix = /* @__PURE__ */ mix(":");
3162
- const win32 = /* @__PURE__ */ mix(";");
3163
2320
  const filterFiles = (testFiles, filters, dir)=>{
3164
2321
  if (!filters.length) return testFiles;
3165
2322
  const fileFilters = 'win32' === process.platform ? filters.map((f)=>f.split(posix.sep).join('/')) : filters;
@@ -3265,4 +2422,4 @@ const formatTestPath = (root, testFilePath)=>{
3265
2422
  return prettyTestPath(testPath);
3266
2423
  };
3267
2424
  const picomatch = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js");
3268
- export { ADDITIONAL_NODE_BUILTINS, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, ROOT_SUITE_NAME, TEMP_RSTEST_OUTPUT_DIR, TEMP_RSTEST_OUTPUT_DIR_GLOB, TS_CONFIG_FILE, basename, bgColor, castArray, clearScreen, dirname, external_node_module_createRequire, filterProjects, formatError, formatRootStr, formatTestPath, getAbsolutePath, getSetupFiles, getTaskNameWithPrefix, getTestEntries, glob, globalApis, isAbsolute, isBuiltin, isDebug, isDynamicPattern, isObject, isTTY, join, logger_logger, lstat, needFlagExperimentalDetectModule, node_process, normalize, pathe_M_eThtNZ_relative, posix, prettyTestPath, prettyTime, promises_stat, readdir, realpath, resolve, serializableConfig, undoSerializableConfig, writeFile };
2425
+ export { ADDITIONAL_NODE_BUILTINS, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, ROOT_SUITE_NAME, TEMP_RSTEST_OUTPUT_DIR, TEMP_RSTEST_OUTPUT_DIR_GLOB, TS_CONFIG_FILE, bgColor, castArray, filterProjects, formatError, formatRootStr, formatTestPath, getAbsolutePath, getSetupFiles, getTaskNameWithPrefix, getTestEntries, glob, globalApis, isDynamicPattern, isObject, isTTY, lstat, needFlagExperimentalDetectModule, prettyTestPath, prettyTime, promises_stat, readdir, realpath, serializableConfig, undoSerializableConfig, writeFile };