@farming-labs/theme 0.0.27 → 0.0.29
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/dist/_virtual/_rolldown/runtime.mjs +1 -26
- package/dist/ai-search-dialog.mjs +1 -1
- package/dist/code-block-copy-wrapper.d.mts +1 -1
- package/dist/docs-layout.d.mts +1 -1
- package/dist/docs-layout.mjs +4 -4
- package/dist/docs-page-client.mjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/mdx.d.mts +1 -1
- package/dist/mdx.mjs +1 -1
- package/dist/page-actions.mjs +1 -1
- package/package.json +2 -2
- package/dist/get-app-dir.d.mts +0 -9
- package/dist/get-app-dir.test.d.mts +0 -1
- package/dist/get-app-dir.test.mjs +0 -41
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +0 -77
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.mjs +0 -1356
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.mjs +0 -1119
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.mjs +0 -1091
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.mjs +0 -4
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.mjs +0 -3
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.mjs +0 -1821
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.mjs +0 -171
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.mjs +0 -124
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.mjs +0 -1334
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.mjs +0 -105
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.mjs +0 -118
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.mjs +0 -455
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.mjs +0 -168
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.mjs +0 -3087
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.mjs +0 -384
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.mjs +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.mjs +0 -16
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.mjs +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.mjs +0 -15
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.mjs +0 -13
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.mjs +0 -34
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.mjs +0 -12
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.mjs +0 -122
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.mjs +0 -39
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.mjs +0 -99
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.mjs +0 -25
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.mjs +0 -14
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.mjs +0 -21
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.mjs +0 -5
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.mjs +0 -12
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.mjs +0 -18
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.mjs +0 -25
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.mjs +0 -8
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.mjs +0 -30
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +0 -939
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +0 -81
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs +0 -51
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.mjs +0 -81
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.mjs +0 -9
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.mjs +0 -125
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.mjs +0 -8
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.mjs +0 -50
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.XdZDrNZV.mjs +0 -48
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.mjs +0 -2613
- package/dist/serialize-icon.d.mts +0 -4
package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
|
-
function normalizeWindowsPath(input = "") {
|
|
4
|
-
if (!input) return input;
|
|
5
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
6
|
-
}
|
|
7
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
8
|
-
function cwd() {
|
|
9
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
10
|
-
return "/";
|
|
11
|
-
}
|
|
12
|
-
const resolve = function(...arguments_) {
|
|
13
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
14
|
-
let resolvedPath = "";
|
|
15
|
-
let resolvedAbsolute = false;
|
|
16
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
17
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
18
|
-
if (!path || path.length === 0) continue;
|
|
19
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
20
|
-
resolvedAbsolute = isAbsolute(path);
|
|
21
|
-
}
|
|
22
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
23
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
24
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
25
|
-
};
|
|
26
|
-
function normalizeString(path, allowAboveRoot) {
|
|
27
|
-
let res = "";
|
|
28
|
-
let lastSegmentLength = 0;
|
|
29
|
-
let lastSlash = -1;
|
|
30
|
-
let dots = 0;
|
|
31
|
-
let char = null;
|
|
32
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
33
|
-
if (index < path.length) char = path[index];
|
|
34
|
-
else if (char === "/") break;
|
|
35
|
-
else char = "/";
|
|
36
|
-
if (char === "/") {
|
|
37
|
-
if (lastSlash === index - 1 || dots === 1);
|
|
38
|
-
else if (dots === 2) {
|
|
39
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
40
|
-
if (res.length > 2) {
|
|
41
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
42
|
-
if (lastSlashIndex === -1) {
|
|
43
|
-
res = "";
|
|
44
|
-
lastSegmentLength = 0;
|
|
45
|
-
} else {
|
|
46
|
-
res = res.slice(0, lastSlashIndex);
|
|
47
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
48
|
-
}
|
|
49
|
-
lastSlash = index;
|
|
50
|
-
dots = 0;
|
|
51
|
-
continue;
|
|
52
|
-
} else if (res.length > 0) {
|
|
53
|
-
res = "";
|
|
54
|
-
lastSegmentLength = 0;
|
|
55
|
-
lastSlash = index;
|
|
56
|
-
dots = 0;
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
if (allowAboveRoot) {
|
|
61
|
-
res += res.length > 0 ? "/.." : "..";
|
|
62
|
-
lastSegmentLength = 2;
|
|
63
|
-
}
|
|
64
|
-
} else {
|
|
65
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
66
|
-
else res = path.slice(lastSlash + 1, index);
|
|
67
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
68
|
-
}
|
|
69
|
-
lastSlash = index;
|
|
70
|
-
dots = 0;
|
|
71
|
-
} else if (char === "." && dots !== -1) ++dots;
|
|
72
|
-
else dots = -1;
|
|
73
|
-
}
|
|
74
|
-
return res;
|
|
75
|
-
}
|
|
76
|
-
const isAbsolute = function(p) {
|
|
77
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { resolve };
|
package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { __toESM } from "../../../../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
-
import { require_js_tokens } from "../../../../js-tokens@9.0.1/node_modules/js-tokens/index.mjs";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
|
|
5
|
-
var import_js_tokens = /* @__PURE__ */ __toESM(require_js_tokens(), 1);
|
|
6
|
-
const FILL_COMMENT = " ";
|
|
7
|
-
function stripLiteralFromToken(token, fillChar, filter) {
|
|
8
|
-
if (token.type === "SingleLineComment") return FILL_COMMENT.repeat(token.value.length);
|
|
9
|
-
if (token.type === "MultiLineComment") return token.value.replace(/[^\n]/g, FILL_COMMENT);
|
|
10
|
-
if (token.type === "StringLiteral") {
|
|
11
|
-
if (!token.closed) return token.value;
|
|
12
|
-
const body = token.value.slice(1, -1);
|
|
13
|
-
if (filter(body)) return token.value[0] + fillChar.repeat(body.length) + token.value[token.value.length - 1];
|
|
14
|
-
}
|
|
15
|
-
if (token.type === "NoSubstitutionTemplate") {
|
|
16
|
-
const body = token.value.slice(1, -1);
|
|
17
|
-
if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\``;
|
|
18
|
-
}
|
|
19
|
-
if (token.type === "RegularExpressionLiteral") {
|
|
20
|
-
const body = token.value;
|
|
21
|
-
if (filter(body)) return body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${fillChar.repeat($1.length)}/${$2}`);
|
|
22
|
-
}
|
|
23
|
-
if (token.type === "TemplateHead") {
|
|
24
|
-
const body = token.value.slice(1, -2);
|
|
25
|
-
if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
26
|
-
}
|
|
27
|
-
if (token.type === "TemplateTail") {
|
|
28
|
-
const body = token.value.slice(0, -2);
|
|
29
|
-
if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\``;
|
|
30
|
-
}
|
|
31
|
-
if (token.type === "TemplateMiddle") {
|
|
32
|
-
const body = token.value.slice(1, -2);
|
|
33
|
-
if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
34
|
-
}
|
|
35
|
-
return token.value;
|
|
36
|
-
}
|
|
37
|
-
function optionsWithDefaults(options) {
|
|
38
|
-
return {
|
|
39
|
-
fillChar: options?.fillChar ?? " ",
|
|
40
|
-
filter: options?.filter ?? (() => true)
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
function stripLiteral(code, options) {
|
|
44
|
-
let result = "";
|
|
45
|
-
const _options = optionsWithDefaults(options);
|
|
46
|
-
for (const token of (0, import_js_tokens.default)(code, { jsx: false })) result += stripLiteralFromToken(token, _options.fillChar, _options.filter);
|
|
47
|
-
return result;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
//#endregion
|
|
51
|
-
export { stripLiteral };
|
package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.mjs
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
|
|
2
|
-
var h = Object.entries({
|
|
3
|
-
reset: [0, 0],
|
|
4
|
-
bold: [
|
|
5
|
-
1,
|
|
6
|
-
22,
|
|
7
|
-
"\x1B[22m\x1B[1m"
|
|
8
|
-
],
|
|
9
|
-
dim: [
|
|
10
|
-
2,
|
|
11
|
-
22,
|
|
12
|
-
"\x1B[22m\x1B[2m"
|
|
13
|
-
],
|
|
14
|
-
italic: [3, 23],
|
|
15
|
-
underline: [4, 24],
|
|
16
|
-
inverse: [7, 27],
|
|
17
|
-
hidden: [8, 28],
|
|
18
|
-
strikethrough: [9, 29],
|
|
19
|
-
black: [30, 39],
|
|
20
|
-
red: [31, 39],
|
|
21
|
-
green: [32, 39],
|
|
22
|
-
yellow: [33, 39],
|
|
23
|
-
blue: [34, 39],
|
|
24
|
-
magenta: [35, 39],
|
|
25
|
-
cyan: [36, 39],
|
|
26
|
-
white: [37, 39],
|
|
27
|
-
gray: [90, 39],
|
|
28
|
-
bgBlack: [40, 49],
|
|
29
|
-
bgRed: [41, 49],
|
|
30
|
-
bgGreen: [42, 49],
|
|
31
|
-
bgYellow: [43, 49],
|
|
32
|
-
bgBlue: [44, 49],
|
|
33
|
-
bgMagenta: [45, 49],
|
|
34
|
-
bgCyan: [46, 49],
|
|
35
|
-
bgWhite: [47, 49],
|
|
36
|
-
blackBright: [90, 39],
|
|
37
|
-
redBright: [91, 39],
|
|
38
|
-
greenBright: [92, 39],
|
|
39
|
-
yellowBright: [93, 39],
|
|
40
|
-
blueBright: [94, 39],
|
|
41
|
-
magentaBright: [95, 39],
|
|
42
|
-
cyanBright: [96, 39],
|
|
43
|
-
whiteBright: [97, 39],
|
|
44
|
-
bgBlackBright: [100, 49],
|
|
45
|
-
bgRedBright: [101, 49],
|
|
46
|
-
bgGreenBright: [102, 49],
|
|
47
|
-
bgYellowBright: [103, 49],
|
|
48
|
-
bgBlueBright: [104, 49],
|
|
49
|
-
bgMagentaBright: [105, 49],
|
|
50
|
-
bgCyanBright: [106, 49],
|
|
51
|
-
bgWhiteBright: [107, 49]
|
|
52
|
-
});
|
|
53
|
-
function a(n) {
|
|
54
|
-
return String(n);
|
|
55
|
-
}
|
|
56
|
-
a.open = "";
|
|
57
|
-
a.close = "";
|
|
58
|
-
function C(n = !1) {
|
|
59
|
-
let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
|
|
60
|
-
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
61
|
-
}
|
|
62
|
-
function p(n = !1) {
|
|
63
|
-
let e = C(n), i = (r, t, c, o) => {
|
|
64
|
-
let l = "", s = 0;
|
|
65
|
-
do
|
|
66
|
-
l += r.substring(s, o) + c, s = o + t.length, o = r.indexOf(t, s);
|
|
67
|
-
while (~o);
|
|
68
|
-
return l + r.substring(s);
|
|
69
|
-
}, g = (r, t, c = r) => {
|
|
70
|
-
let o = (l) => {
|
|
71
|
-
let s = String(l), b = s.indexOf(t, r.length);
|
|
72
|
-
return ~b ? r + i(s, t, c, b) + t : r + s + t;
|
|
73
|
-
};
|
|
74
|
-
return o.open = r, o.close = t, o;
|
|
75
|
-
}, u = { isColorSupported: e }, d = (r) => `\x1B[${r}m`;
|
|
76
|
-
for (let [r, t] of h) u[r] = e ? g(d(t[0]), d(t[1]), t[2]) : a;
|
|
77
|
-
return u;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
//#endregion
|
|
81
|
-
export { p };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { p } from "./chunk-BVHSVHOK.mjs";
|
|
2
|
-
import { isatty } from "tty";
|
|
3
|
-
|
|
4
|
-
//#region ../../node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js
|
|
5
|
-
var r = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
6
|
-
var u = p(r);
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
export { u };
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js
|
|
2
|
-
function S(e, t) {
|
|
3
|
-
if (!e) throw new Error(t);
|
|
4
|
-
}
|
|
5
|
-
function f(e, t) {
|
|
6
|
-
return typeof t === e;
|
|
7
|
-
}
|
|
8
|
-
function w(e) {
|
|
9
|
-
return e instanceof Promise;
|
|
10
|
-
}
|
|
11
|
-
function u(e, t, r) {
|
|
12
|
-
Object.defineProperty(e, t, r);
|
|
13
|
-
}
|
|
14
|
-
function l(e, t, r) {
|
|
15
|
-
u(e, t, {
|
|
16
|
-
value: r,
|
|
17
|
-
configurable: !0,
|
|
18
|
-
writable: !0
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
var y = Symbol.for("tinyspy:spy");
|
|
22
|
-
var x = /* @__PURE__ */ new Set(), h = (e) => {
|
|
23
|
-
e.called = !1, e.callCount = 0, e.calls = [], e.results = [], e.resolves = [], e.next = [];
|
|
24
|
-
}, k = (e) => (u(e, y, { value: { reset: () => h(e[y]) } }), e[y]), T = (e) => e[y] || k(e);
|
|
25
|
-
function R(e) {
|
|
26
|
-
S(f("function", e) || f("undefined", e), "cannot spy on a non-function value");
|
|
27
|
-
let t = function(...s) {
|
|
28
|
-
let n = T(t);
|
|
29
|
-
n.called = !0, n.callCount++, n.calls.push(s);
|
|
30
|
-
let d = n.next.shift();
|
|
31
|
-
if (d) {
|
|
32
|
-
n.results.push(d);
|
|
33
|
-
let [a, i] = d;
|
|
34
|
-
if (a === "ok") return i;
|
|
35
|
-
throw i;
|
|
36
|
-
}
|
|
37
|
-
let o, c = "ok", p = n.results.length;
|
|
38
|
-
if (n.impl) try {
|
|
39
|
-
new.target ? o = Reflect.construct(n.impl, s, new.target) : o = n.impl.apply(this, s), c = "ok";
|
|
40
|
-
} catch (a) {
|
|
41
|
-
throw o = a, c = "error", n.results.push([c, a]), a;
|
|
42
|
-
}
|
|
43
|
-
let g = [c, o];
|
|
44
|
-
return w(o) && o.then((a) => n.resolves[p] = ["ok", a], (a) => n.resolves[p] = ["error", a]), n.results.push(g), o;
|
|
45
|
-
};
|
|
46
|
-
l(t, "_isMockFunction", !0), l(t, "length", e ? e.length : 0), l(t, "name", e && e.name || "spy");
|
|
47
|
-
let r = T(t);
|
|
48
|
-
return r.reset(), r.impl = e, t;
|
|
49
|
-
}
|
|
50
|
-
function v(e) {
|
|
51
|
-
return !!e && e._isMockFunction === !0;
|
|
52
|
-
}
|
|
53
|
-
var b = (e, t) => {
|
|
54
|
-
let r = Object.getOwnPropertyDescriptor(e, t);
|
|
55
|
-
if (r) return [e, r];
|
|
56
|
-
let s = Object.getPrototypeOf(e);
|
|
57
|
-
for (; s !== null;) {
|
|
58
|
-
let n = Object.getOwnPropertyDescriptor(s, t);
|
|
59
|
-
if (n) return [s, n];
|
|
60
|
-
s = Object.getPrototypeOf(s);
|
|
61
|
-
}
|
|
62
|
-
}, P = (e, t) => {
|
|
63
|
-
t != null && typeof t == "function" && t.prototype != null && Object.setPrototypeOf(e.prototype, t.prototype);
|
|
64
|
-
};
|
|
65
|
-
function M(e, t, r) {
|
|
66
|
-
S(!f("undefined", e), "spyOn could not find an object to spy upon"), S(f("object", e) || f("function", e), "cannot spyOn on a primitive value");
|
|
67
|
-
let [s, n] = (() => {
|
|
68
|
-
if (!f("object", t)) return [t, "value"];
|
|
69
|
-
if ("getter" in t && "setter" in t) throw new Error("cannot spy on both getter and setter");
|
|
70
|
-
if ("getter" in t) return [t.getter, "get"];
|
|
71
|
-
if ("setter" in t) return [t.setter, "set"];
|
|
72
|
-
throw new Error("specify getter or setter to spy on");
|
|
73
|
-
})(), [d, o] = b(e, s) || [];
|
|
74
|
-
S(o || s in e, `${String(s)} does not exist`);
|
|
75
|
-
let c = !1;
|
|
76
|
-
n === "value" && o && !o.value && o.get && (n = "get", c = !0, r = o.get());
|
|
77
|
-
let p;
|
|
78
|
-
o ? p = o[n] : n !== "value" ? p = () => e[s] : p = e[s], p && j(p) && (p = p[y].getOriginal());
|
|
79
|
-
let g = (I) => {
|
|
80
|
-
let { value: F, ...O } = o || {
|
|
81
|
-
configurable: !0,
|
|
82
|
-
writable: !0
|
|
83
|
-
};
|
|
84
|
-
n !== "value" && delete O.writable, O[n] = I, u(e, s, O);
|
|
85
|
-
}, a = () => {
|
|
86
|
-
d !== e ? Reflect.deleteProperty(e, s) : o && !p ? u(e, s, o) : g(p);
|
|
87
|
-
};
|
|
88
|
-
r || (r = p);
|
|
89
|
-
let i = E(R(r), r);
|
|
90
|
-
n === "value" && P(i, p);
|
|
91
|
-
let m = i[y];
|
|
92
|
-
return l(m, "restore", a), l(m, "getOriginal", () => c ? p() : p), l(m, "willCall", (I) => (m.impl = I, i)), g(c ? () => (P(i, r), i) : i), x.add(i), i;
|
|
93
|
-
}
|
|
94
|
-
var K = /* @__PURE__ */ new Set([
|
|
95
|
-
"length",
|
|
96
|
-
"name",
|
|
97
|
-
"prototype"
|
|
98
|
-
]);
|
|
99
|
-
function D(e) {
|
|
100
|
-
let t = /* @__PURE__ */ new Set(), r = {};
|
|
101
|
-
for (; e && e !== Object.prototype && e !== Function.prototype;) {
|
|
102
|
-
let s = [...Object.getOwnPropertyNames(e), ...Object.getOwnPropertySymbols(e)];
|
|
103
|
-
for (let n of s) r[n] || K.has(n) || (t.add(n), r[n] = Object.getOwnPropertyDescriptor(e, n));
|
|
104
|
-
e = Object.getPrototypeOf(e);
|
|
105
|
-
}
|
|
106
|
-
return {
|
|
107
|
-
properties: t,
|
|
108
|
-
descriptors: r
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
function E(e, t) {
|
|
112
|
-
if (!t || y in t) return e;
|
|
113
|
-
let { properties: r, descriptors: s } = D(t);
|
|
114
|
-
for (let n of r) {
|
|
115
|
-
let d = s[n];
|
|
116
|
-
b(e, n) || u(e, n, d);
|
|
117
|
-
}
|
|
118
|
-
return e;
|
|
119
|
-
}
|
|
120
|
-
function j(e) {
|
|
121
|
-
return v(e) && "getOriginal" in e[y];
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
export { M, T };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
2
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3
|
-
function getDefaultExportFromCjs(x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { commonjsGlobal, getDefaultExportFromCjs };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
2
|
-
const RealDate = Date;
|
|
3
|
-
let now = null;
|
|
4
|
-
var MockDate = class MockDate extends RealDate {
|
|
5
|
-
constructor(y, m, d, h, M, s, ms) {
|
|
6
|
-
super();
|
|
7
|
-
let date;
|
|
8
|
-
switch (arguments.length) {
|
|
9
|
-
case 0:
|
|
10
|
-
if (now !== null) date = new RealDate(now.valueOf());
|
|
11
|
-
else date = new RealDate();
|
|
12
|
-
break;
|
|
13
|
-
case 1:
|
|
14
|
-
date = new RealDate(y);
|
|
15
|
-
break;
|
|
16
|
-
default:
|
|
17
|
-
d = typeof d === "undefined" ? 1 : d;
|
|
18
|
-
h = h || 0;
|
|
19
|
-
M = M || 0;
|
|
20
|
-
s = s || 0;
|
|
21
|
-
ms = ms || 0;
|
|
22
|
-
date = new RealDate(y, m, d, h, M, s, ms);
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
Object.setPrototypeOf(date, MockDate.prototype);
|
|
26
|
-
return date;
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
MockDate.UTC = RealDate.UTC;
|
|
30
|
-
MockDate.now = function() {
|
|
31
|
-
return new MockDate().valueOf();
|
|
32
|
-
};
|
|
33
|
-
MockDate.parse = function(dateString) {
|
|
34
|
-
return RealDate.parse(dateString);
|
|
35
|
-
};
|
|
36
|
-
MockDate.toString = function() {
|
|
37
|
-
return RealDate.toString();
|
|
38
|
-
};
|
|
39
|
-
function mockDate(date) {
|
|
40
|
-
const dateObj = new RealDate(date.valueOf());
|
|
41
|
-
if (Number.isNaN(dateObj.getTime())) throw new TypeError(`mockdate: The time set is an invalid date: ${date}`);
|
|
42
|
-
globalThis.Date = MockDate;
|
|
43
|
-
now = dateObj.valueOf();
|
|
44
|
-
}
|
|
45
|
-
function resetDate() {
|
|
46
|
-
globalThis.Date = RealDate;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
//#endregion
|
|
50
|
-
export { RealDate, mockDate, resetDate };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { getSafeTimers } from "../../../../../@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.mjs";
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
4
|
-
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
5
|
-
function getWorkerState() {
|
|
6
|
-
const workerState = globalThis[NAME_WORKER_STATE];
|
|
7
|
-
if (!workerState) throw new Error("Vitest failed to access its internal state.\n\nOne of the following is possible:\n- \"vitest\" is imported directly without running \"vitest\" command\n- \"vitest\" is imported inside \"globalSetup\" (to fix this, use \"setupFiles\" instead, because \"globalSetup\" runs in a different context)\n- \"vitest\" is imported inside Vite / Vitest config file\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n");
|
|
8
|
-
return workerState;
|
|
9
|
-
}
|
|
10
|
-
function getCurrentEnvironment() {
|
|
11
|
-
return getWorkerState()?.environment.name;
|
|
12
|
-
}
|
|
13
|
-
function isChildProcess() {
|
|
14
|
-
return typeof process !== "undefined" && !!process.send;
|
|
15
|
-
}
|
|
16
|
-
function resetModules(modules, resetMocks = false) {
|
|
17
|
-
const skipPaths = [
|
|
18
|
-
/\/vitest\/dist\//,
|
|
19
|
-
/\/vite-node\/dist\//,
|
|
20
|
-
/vitest-virtual-\w+\/dist/,
|
|
21
|
-
/@vitest\/dist/,
|
|
22
|
-
...!resetMocks ? [/^mock:/] : []
|
|
23
|
-
];
|
|
24
|
-
modules.forEach((mod, path) => {
|
|
25
|
-
if (skipPaths.some((re) => re.test(path))) return;
|
|
26
|
-
modules.invalidateModule(mod);
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
function waitNextTick() {
|
|
30
|
-
const { setTimeout } = getSafeTimers();
|
|
31
|
-
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
32
|
-
}
|
|
33
|
-
async function waitForImportsToResolve() {
|
|
34
|
-
await waitNextTick();
|
|
35
|
-
const state = getWorkerState();
|
|
36
|
-
const promises = [];
|
|
37
|
-
let resolvingCount = 0;
|
|
38
|
-
for (const mod of state.moduleCache.values()) {
|
|
39
|
-
if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
40
|
-
if (mod.resolving) resolvingCount++;
|
|
41
|
-
}
|
|
42
|
-
if (!promises.length && !resolvingCount) return;
|
|
43
|
-
await Promise.allSettled(promises);
|
|
44
|
-
await waitForImportsToResolve();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { getCurrentEnvironment, getWorkerState, isChildProcess, resetModules, waitForImportsToResolve };
|