@voidzero-dev/vite-plus-core 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/LICENSE +36 -120
  2. package/dist/rolldown/cli.d.mts +1 -1
  3. package/dist/rolldown/cli.mjs +11 -8
  4. package/dist/rolldown/config.d.mts +22 -10
  5. package/dist/rolldown/config.mjs +2 -2
  6. package/dist/rolldown/experimental-index.d.mts +164 -155
  7. package/dist/rolldown/experimental-index.mjs +23 -14
  8. package/dist/rolldown/experimental-runtime-types.d.ts +111 -41
  9. package/dist/rolldown/filter-index.d.mts +6 -5
  10. package/dist/rolldown/get-log-filter.d.mts +2 -2
  11. package/dist/rolldown/index.d.mts +4 -4
  12. package/dist/rolldown/index.mjs +10 -4
  13. package/dist/rolldown/parallel-plugin-worker.d.mts +1 -1
  14. package/dist/rolldown/parallel-plugin-worker.mjs +2 -2
  15. package/dist/rolldown/parallel-plugin.d.mts +3 -4
  16. package/dist/rolldown/parse-ast-index.d.mts +19 -20
  17. package/dist/rolldown/parse-ast-index.mjs +2 -2
  18. package/dist/rolldown/plugins-index.d.mts +27 -28
  19. package/dist/rolldown/plugins-index.mjs +2 -2
  20. package/dist/rolldown/shared/{binding-B1q9aYT-.d.mts → binding-Dbbi0RbO.d.mts} +49 -25
  21. package/dist/rolldown/shared/{binding-BmkJW3Wy.mjs → binding-Dby9rwGk.mjs} +26 -26
  22. package/dist/rolldown/shared/{bindingify-input-options-Cmm60vfj.mjs → bindingify-input-options-DVQ4K-zY.mjs} +11 -13
  23. package/dist/rolldown/shared/{constructors-2i1T9YcF.d.mts → constructors-CSWbNgBZ.d.mts} +9 -10
  24. package/dist/rolldown/shared/{constructors-CE6zZSUt.mjs → constructors-CuGa75s-.mjs} +1 -1
  25. package/dist/rolldown/shared/define-config-B-IDOhDz.d.mts +4003 -0
  26. package/dist/rolldown/shared/dist-DX3cAjHx.mjs +154 -0
  27. package/dist/rolldown/shared/{error-BlQ0-ek7.mjs → error-DFGNOCle.mjs} +1 -1
  28. package/dist/rolldown/shared/get-log-filter-AjBknEEO.d.mts +34 -0
  29. package/dist/rolldown/shared/{load-config-CVVMWSlg.mjs → load-config-R0z2olkB.mjs} +19 -2
  30. package/dist/rolldown/shared/{logging-BSNejiLS.d.mts → logging-xuHO4mAy.d.mts} +6 -6
  31. package/dist/rolldown/shared/{logs-aMKUxRpj.mjs → logs-ZGEh6uhb.mjs} +6 -1
  32. package/dist/rolldown/shared/{normalize-string-or-regex-BYkbbGqQ.mjs → normalize-string-or-regex-SiXbePVH.mjs} +2 -2
  33. package/dist/rolldown/shared/{parse-Dphnedsw.mjs → parse-D5dkElpf.mjs} +2 -2
  34. package/dist/rolldown/shared/{prompt-Bgj-uEyc.mjs → prompt-pZFoa1TT.mjs} +59 -17
  35. package/dist/rolldown/shared/{resolve-tsconfig-CdIAR1Eb.mjs → resolve-tsconfig-2TXRF_zr.mjs} +2 -2
  36. package/dist/rolldown/shared/{rolldown-Bnp916iM.mjs → rolldown-BnV7isAX.mjs} +1 -1
  37. package/dist/rolldown/shared/{rolldown-build-Cs2iVJuw.mjs → rolldown-build-BGXNOfvH.mjs} +33 -13
  38. package/dist/rolldown/shared/transform-Cs2bUDRH.d.mts +148 -0
  39. package/dist/rolldown/shared/{watch-ECGr-_QS.mjs → watch-DVucf-VG.mjs} +5 -5
  40. package/dist/rolldown/utils-index.d.mts +29 -30
  41. package/dist/rolldown/utils-index.mjs +9 -9
  42. package/dist/tsdown/{build-B_nvJe4A-CvbtVBxy.js → build-oq13wECG-Bymq3jT5.js} +210 -1229
  43. package/dist/tsdown/debug-BntVTkRq-BGIoAiTa.js +159 -0
  44. package/dist/tsdown/{detect-B97OSl92-BJPZyIKJ.js → detect-DGhJGEqb-S-tkSzpt.js} +13 -2
  45. package/dist/tsdown/dist-CxIM8o7n.js +2613 -0
  46. package/dist/tsdown/dist-DCMiHFrJ.js +1061 -0
  47. package/dist/tsdown/index-types.d.ts +2106 -1895
  48. package/dist/tsdown/index.js +7 -4
  49. package/dist/tsdown/internal-C7ewSPAZ.js +3 -0
  50. package/dist/tsdown/load-tsc-BKULZsrs-BFmeD6Bu.js +18 -0
  51. package/dist/tsdown/{main-BlTcyuFi.js → main-BdzlWPt6.js} +214 -9
  52. package/dist/tsdown/npm_entry_picomatch.cjs +44 -15
  53. package/dist/tsdown/{resolver-DtsKFXi2-B8Z3WwZh.js → resolver-cwLsPb2o-oj1hqxK6.js} +4 -3
  54. package/dist/tsdown/run.js +4 -4
  55. package/dist/tsdown/{src-CISfE_A0.js → src-BV-UJr_R.js} +5 -5
  56. package/dist/tsdown/target-CNxIDvSz-eoHNdJNs.js +576 -0
  57. package/dist/tsdown/{tsc-context-CX_GXdyS.js → tsc-context-CA76SkkZ.js} +2 -2
  58. package/dist/tsdown/{tsc-CdZE7QwS.js → tsc-zcbB6ZVY.js} +58 -117
  59. package/dist/tsdown/tsdown-css.js +74 -23
  60. package/dist/tsdown/tsdown-exe.js +129 -876
  61. package/dist/vite/client/client.mjs +5 -5
  62. package/dist/vite/node/chunks/build.js +204 -94
  63. package/dist/vite/node/chunks/dist2.js +1 -1
  64. package/dist/vite/node/chunks/lib.js +1 -1
  65. package/dist/vite/node/chunks/moduleRunnerTransport.d.ts +25 -26
  66. package/dist/vite/node/chunks/node.js +552 -104
  67. package/dist/vite/node/chunks/postcss-import.js +11 -11
  68. package/dist/vite/node/cli.js +3 -4
  69. package/dist/vite/node/index.d.ts +1284 -1285
  70. package/dist/vite/node/index.js +1 -2
  71. package/dist/vite/node/module-runner.d.ts +76 -77
  72. package/dist/vite/node/module-runner.js +6 -7
  73. package/package.json +20 -18
  74. package/dist/rolldown/shared/define-config-BBz954-q.d.mts +0 -3901
  75. package/dist/rolldown/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
  76. package/dist/rolldown/shared/transform-CEmFsvJW.d.mts +0 -149
  77. package/dist/tsdown/debug-DLdR-9XB-DQZ6QLC0.js +0 -250
  78. package/dist/tsdown/dist-CZtGyfn3.js +0 -200
  79. package/dist/tsdown/dist-CqbVlnVq.js +0 -32057
  80. package/dist/tsdown/general-Cp4NiJNK-CbyrS9q1.js +0 -97
  81. package/dist/tsdown/internal-bfoxcI4F.js +0 -3
  82. package/dist/tsdown/npm_cjs_chunk_range.cjs +0 -474
  83. package/dist/tsdown/npm_cjs_chunk_semver.cjs +0 -357
  84. package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +0 -52
  85. package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +0 -19
  86. package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +0 -46
  87. package/dist/tsdown/target-CqeSqtms-FAqYuGyB.js +0 -79
  88. package/dist/vite/node/chunks/logger.js +0 -361
@@ -1,35 +0,0 @@
1
- import { a as RolldownLog } from "./logging-BSNejiLS.mjs";
2
-
3
- //#region src/get-log-filter.d.ts
4
- /**
5
- * @param filters A list of log filters to apply
6
- * @returns A function that tests whether a log should be output
7
- *
8
- * @category Config
9
- */
10
- type GetLogFilter = (filters: string[]) => (log: RolldownLog) => boolean;
11
- /**
12
- * A helper function to generate log filters using the same syntax as the CLI.
13
- *
14
- * @example
15
- * ```ts
16
- * import { defineConfig } from 'rolldown';
17
- * import { getLogFilter } from 'rolldown/getLogFilter';
18
- *
19
- * const logFilter = getLogFilter(['code:FOO', 'code:BAR']);
20
- *
21
- * export default defineConfig({
22
- * input: 'main.js',
23
- * onLog(level, log, handler) {
24
- * if (logFilter(log)) {
25
- * handler(level, log);
26
- * }
27
- * }
28
- * });
29
- * ```
30
- *
31
- * @category Config
32
- */
33
- declare const getLogFilter: GetLogFilter;
34
- //#endregion
35
- export { getLogFilter as n, GetLogFilter as t };
@@ -1,149 +0,0 @@
1
- import { a as RolldownLog } from "./logging-BSNejiLS.mjs";
2
- import { F as MinifyResult$1, H as SourceMap, L as ParseResult$1, P as MinifyOptions$1, R as ParserOptions$1, W as TsconfigCache$1, a as BindingEnhancedTransformOptions, o as BindingEnhancedTransformResult, v as BindingTsconfigResult } from "./binding-B1q9aYT-.mjs";
3
-
4
- //#region src/utils/resolve-tsconfig.d.ts
5
- /**
6
- * Cache for tsconfig resolution to avoid redundant file system operations.
7
- *
8
- * The cache stores resolved tsconfig configurations keyed by their file paths.
9
- * When transforming multiple files in the same project, tsconfig lookups are
10
- * deduplicated, improving performance.
11
- *
12
- * @category Utilities
13
- * @experimental
14
- */
15
- declare class TsconfigCache extends TsconfigCache$1 {
16
- constructor();
17
- }
18
- /** @hidden This is only expected to be used by Vite */
19
- declare function resolveTsconfig(filename: string, cache?: TsconfigCache | null): BindingTsconfigResult | null;
20
- //#endregion
21
- //#region src/utils/parse.d.ts
22
- /**
23
- * Result of parsing a code
24
- *
25
- * @category Utilities
26
- */
27
- interface ParseResult extends ParseResult$1 {}
28
- /**
29
- * Options for parsing a code
30
- *
31
- * @category Utilities
32
- */
33
- interface ParserOptions extends ParserOptions$1 {}
34
- /**
35
- * Parse JS/TS source asynchronously on a separate thread.
36
- *
37
- * Note that not all of the workload can happen on a separate thread.
38
- * Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
39
- * has to happen on current thread. This synchronous deserialization work typically outweighs
40
- * the asynchronous parsing by a factor of between 3 and 20.
41
- *
42
- * i.e. the majority of the workload cannot be parallelized by using this method.
43
- *
44
- * Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
45
- * If you need to parallelize parsing multiple files, it is recommended to use worker threads.
46
- *
47
- * @category Utilities
48
- */
49
- declare function parse(filename: string, sourceText: string, options?: ParserOptions | null): Promise<ParseResult>;
50
- /**
51
- * Parse JS/TS source synchronously on current thread.
52
- *
53
- * This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
54
- * of spawning a thread, and the majority of the workload cannot be parallelized anyway
55
- * (see {@linkcode parse} documentation for details).
56
- *
57
- * If you need to parallelize parsing multiple files, it is recommended to use worker threads
58
- * with {@linkcode parseSync} rather than using {@linkcode parse}.
59
- *
60
- * @category Utilities
61
- */
62
- declare function parseSync(filename: string, sourceText: string, options?: ParserOptions | null): ParseResult;
63
- //#endregion
64
- //#region src/utils/minify.d.ts
65
- /**
66
- * Options for minification.
67
- *
68
- * @category Utilities
69
- */
70
- interface MinifyOptions extends MinifyOptions$1 {
71
- inputMap?: SourceMap;
72
- }
73
- /**
74
- * The result of minification.
75
- *
76
- * @category Utilities
77
- */
78
- interface MinifyResult extends MinifyResult$1 {}
79
- /**
80
- * Minify asynchronously.
81
- *
82
- * Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
83
- *
84
- * @category Utilities
85
- * @experimental
86
- */
87
- declare function minify(filename: string, sourceText: string, options?: MinifyOptions | null): Promise<MinifyResult>;
88
- /**
89
- * Minify synchronously.
90
- *
91
- * @category Utilities
92
- * @experimental
93
- */
94
- declare function minifySync(filename: string, sourceText: string, options?: MinifyOptions | null): MinifyResult;
95
- //#endregion
96
- //#region src/utils/transform.d.ts
97
- /**
98
- * Options for transforming a code.
99
- *
100
- * @category Utilities
101
- */
102
- interface TransformOptions extends BindingEnhancedTransformOptions {}
103
- /**
104
- * Result of transforming a code.
105
- *
106
- * @category Utilities
107
- */
108
- type TransformResult = Omit<BindingEnhancedTransformResult, "errors" | "warnings"> & {
109
- errors: Error[];
110
- warnings: RolldownLog[];
111
- };
112
- /**
113
- * Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
114
- *
115
- * Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
116
- *
117
- * @param filename The name of the file being transformed. If this is a
118
- * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
119
- * @param sourceText The source code to transform.
120
- * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
121
- * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
122
- * Only used when `options.tsconfig` is `true`.
123
- *
124
- * @returns a promise that resolves to an object containing the transformed code,
125
- * source maps, and any errors that occurred during parsing or transformation.
126
- *
127
- * @category Utilities
128
- * @experimental
129
- */
130
- declare function transform(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): Promise<TransformResult>;
131
- /**
132
- * Transpile a JavaScript or TypeScript into a target ECMAScript version.
133
- *
134
- * @param filename The name of the file being transformed. If this is a
135
- * relative path, consider setting the {@linkcode TransformOptions#cwd} option.
136
- * @param sourceText The source code to transform.
137
- * @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
138
- * @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
139
- * Only used when `options.tsconfig` is `true`.
140
- *
141
- * @returns an object containing the transformed code, source maps, and any errors
142
- * that occurred during parsing or transformation.
143
- *
144
- * @category Utilities
145
- * @experimental
146
- */
147
- declare function transformSync(filename: string, sourceText: string, options?: TransformOptions | null, cache?: TsconfigCache | null): TransformResult;
148
- //#endregion
149
- export { MinifyOptions as a, minifySync as c, parse as d, parseSync as f, transformSync as i, ParseResult as l, resolveTsconfig as m, TransformResult as n, MinifyResult as o, TsconfigCache as p, transform as r, minify as s, TransformOptions as t, ParserOptions as u };
@@ -1,250 +0,0 @@
1
- import { d as __commonJSMin, i as noop, m as __toESM, s as resolveComma, u as toArray } from "./general-Cp4NiJNK-CbyrS9q1.js";
2
- import { a as namespaces, i as enable, r as createDebug } from "./main-BlTcyuFi.js";
3
- import process from "node:process";
4
- import readline from "node:readline";
5
- const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, link, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
6
- let e, { defineProperty: r, getPrototypeOf: t, setPrototypeOf: n, create: o, keys: l } = Object, i = "", { round: f, max: s } = Math, u = (e) => {
7
- let r = /([a-f\d]{3,6})/i.exec(e)?.[0], t = r?.length, n = "0x" + (6 ^ t ? 3 ^ t ? "0" : r[0] + r[0] + r[1] + r[1] + r[2] + r[2] : r) | 0;
8
- return [
9
- n >> 16,
10
- n >> 8 & 255,
11
- 255 & n
12
- ];
13
- }, a = (e) => {
14
- if (8 > e) return 30 + e;
15
- if (16 > e) return 82 + e;
16
- if (e > 231) return e > 243 ? 37 : 30;
17
- let r = (e -= 16) % 36, t = e / 36 | 0, n = r / 6 | 0, o = r % 6;
18
- return 30 + (t > 2 | (n > 2) << 1 | (o > 2) << 2) + (s(t, n, o) > 4 ? 60 : 0);
19
- }, c = {
20
- open: i,
21
- close: i
22
- }, g = (e, { open: r = "", close: o = "", f: l }) => {
23
- let f = (e.open || i) + r, s = o + (e.close || i), u = (e, ...t) => {
24
- if (!e) {
25
- if (!o) return r;
26
- if ((e ?? i) === i) return i;
27
- }
28
- let n, a = l ? l(e, ...t) : e.raw ? String.raw({ raw: e }, ...t) : i + e, c = u;
29
- if (a.includes("\x1B")) for (; c = c.p;) {
30
- let { t: e, o: r } = c, t = r.length, o = i, l = 0;
31
- if (t) for (; ~(n = a.indexOf(r, l)); l = n + t) o += a.slice(l, n) + e;
32
- a = o + a.slice(l);
33
- }
34
- return f + (a.includes("\n") ? a.replace(/(\r?\n)/g, s + "$1" + f) : a) + s;
35
- };
36
- return n(u, t(e)).p = {
37
- t: r,
38
- o,
39
- p: e.p
40
- }, u.open = f, u.close = s, u;
41
- };
42
- const d = new function t(s = globalThis) {
43
- let d = "number" == typeof s ? s : ((r) => {
44
- let t = r.process ?? {}, n = t.argv ?? [], o = t.env ?? {}, i = 0;
45
- try {
46
- i = ((r, t, n) => (e = t.TERM, {
47
- "24bit": 3,
48
- truecolor: 3,
49
- ansi256: 2,
50
- ansi: 1
51
- }[t.COLORTERM] || (t.CI ? /,GITHUB/.test(n) ? 3 : 1 : (t.PM2_HOME || /edge/.test(t.NEXT_RUNTIME) || r.stdout?.isTTY) && "dumb" !== e ? "win32" === r.platform ? 3 : /-256/.test(e) ? 2 : 1 : 0)))(t, o, "," + l(o).join(","));
52
- } catch (e) {
53
- o = {};
54
- }
55
- let f, s = i || 1, u = "FORCE_COLOR", a = {
56
- false: 0,
57
- 0: 0,
58
- 1: 1,
59
- 2: 2,
60
- 3: 3
61
- }[o[u]] ?? s, c = -1;
62
- for (f of n) /^--color=?(true|always)?$/.test(f) && (c = s), /^--(no-color|color=(false|never))$/.test(f) && (c = 0);
63
- return r.window?.chrome ? 3 : u in o ? a : ~c ? c : o.NO_COLOR ? 0 : i;
64
- })(s), b = {}, p = {
65
- Ansis: t,
66
- level: d,
67
- isSupported: () => m,
68
- strip: (e) => e.replace(/][^]*|[›][[()#;?]*(?:\d+(?:;\d*)*)?[\dA-ORZcf-nqry=><]/g, i),
69
- extend(e) {
70
- for (let r in e) {
71
- let t = e[r];
72
- "s" === (typeof t)[0] && (h(w(r), A(...u(t))), t = P(...u(t))), h(r, t);
73
- }
74
- return n(p, o({}, b));
75
- }
76
- }, h = (e, t) => {
77
- b[e] = { get() {
78
- return r(this, e, { value: t.call ? (...e) => g(this, t(...e)) : g(this, t) })[e];
79
- } };
80
- }, y = 1 ^ d, $ = d > 2, m = d > 0, O = (e, r) => m ? {
81
- open: `[${e}m`,
82
- close: r ? `[${r}m` : i
83
- } : c, w = (e) => "bg" + e[0].toUpperCase() + e.slice(1), v = (e) => (r) => e(...u(r)), x = (e, r) => (t, n, o) => O(`${e}8;2;${t};${n};${o}`, r), _ = (e) => (r, t, n) => e(((e, r, t) => e ^ r | r ^ t ? 16 + 36 * f(e / 51) + 6 * f(r / 51) + f(t / 51) : 8 > e ? 16 : e > 248 ? 231 : f(24 * (e - 8) / 247) + 232)(r, t, n)), k = (e) => O(y ? "38;5;" + e : a(e), 39), R = (e) => O(y ? "48;5;" + e : a(e) + 10, 49), P = $ ? x(3, 39) : _(k), A = $ ? x(4, 49) : _(R), B = {
84
- fg: k,
85
- bg: R,
86
- rgb: P,
87
- bgRgb: A,
88
- hex: v(P),
89
- bgHex: v(A),
90
- visible: c,
91
- reset: O(0, i),
92
- bold: O(1, 22),
93
- dim: O(2, 22),
94
- italic: O(3, 23),
95
- underline: O(4, 24),
96
- inverse: O(7, 27),
97
- hidden: O(8, 28),
98
- strikethrough: O(9, 29),
99
- link: { f: (e, r = e) => m ? `]8;;${e}${r}]8;;` : r != e ? r + ` (​${e}​)` : e }
100
- }, C = (e, r) => {
101
- B[e] = O(r, 39), B[w(e)] = O(r + 10, 49);
102
- };
103
- return "gray,black,red,green,yellow,blue,magenta,cyan,white".split(",").map(((e, r) => {
104
- r ? C(e + "Bright", 89 + r) : r = 61, C(e, 29 + r);
105
- })), p.extend(B);
106
- }();
107
- module.exports = d.default = d;
108
- })))(), 1)).default;
109
- //#endregion
110
- //#region ../../node_modules/.pnpm/tsdown@0.22.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.3_@tsdown+exe@0.22.3_@type_b3805a6765df28d505319221a7193e18/node_modules/tsdown/dist/logger-BxuhTmAE.mjs
111
- const LogLevels = {
112
- silent: 0,
113
- error: 1,
114
- warn: 2,
115
- info: 3
116
- };
117
- function format(msgs) {
118
- return msgs.filter((arg) => arg !== void 0 && arg !== false).join(" ");
119
- }
120
- function clearScreen() {
121
- const repeatCount = process.stdout.rows - 2;
122
- const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
123
- console.info(blank);
124
- readline.cursorTo(process.stdout, 0, 0);
125
- readline.clearScreenDown(process.stdout);
126
- }
127
- const warnedMessages = /* @__PURE__ */ new Set();
128
- function createLogger(level = "info", options = {}) {
129
- const resolvedOptions = {
130
- allowClearScreen: true,
131
- failOnWarn: false,
132
- console: globalThis.console,
133
- ...options
134
- };
135
- const { allowClearScreen, console, customLogger, failOnWarn } = resolvedOptions;
136
- if (customLogger) return customLogger;
137
- function output(type, msg) {
138
- if (LogLevels[logger.level] < LogLevels[type]) return;
139
- console[type === "info" ? "log" : type](msg);
140
- }
141
- const clear = allowClearScreen && process.stdout.isTTY && !process.env.CI ? clearScreen : () => {};
142
- const isWindowsTerminal = !!process.env.WT_SESSION;
143
- const emojiDivier = " ".repeat(isWindowsTerminal ? 2 : 1);
144
- const logger = {
145
- level,
146
- options: resolvedOptions,
147
- info(...msgs) {
148
- output("info", `${blue`ℹ`}${emojiDivier}${format(msgs)}`);
149
- },
150
- warn(...msgs) {
151
- if (failOnWarn) return this.error(...msgs);
152
- const message = format(msgs);
153
- warnedMessages.add(message);
154
- output("warn", `${bold(yellow`warn:`)} ${message}`);
155
- },
156
- warnOnce(...msgs) {
157
- const message = format(msgs);
158
- if (failOnWarn) return this.error(...msgs);
159
- if (warnedMessages.has(message)) return;
160
- warnedMessages.add(message);
161
- output("warn", `${bold(yellow`warn:`)} ${message}`);
162
- },
163
- error(...msgs) {
164
- output("error", `${bold(red`error:`)} ${format(msgs).replace(/^([A-Za-z]*Error):\s*/, "")}`);
165
- process.exitCode = 1;
166
- },
167
- success(...msgs) {
168
- output("info", `${green`✔`}${emojiDivier}${format(msgs)}`);
169
- },
170
- clearScreen(type) {
171
- if (LogLevels[logger.level] >= LogLevels[type]) clear();
172
- }
173
- };
174
- return logger;
175
- }
176
- const globalLogger = createLogger();
177
- function getNameLabel(ansis, name) {
178
- if (!name) return void 0;
179
- return ansis(`[${name}]`);
180
- }
181
- function prettyFormat(format) {
182
- const formatColor = format === "es" ? blue : format === "cjs" ? yellow : noop;
183
- let formatText;
184
- switch (format) {
185
- case "es":
186
- formatText = "ESM";
187
- break;
188
- default:
189
- formatText = format.toUpperCase();
190
- break;
191
- }
192
- return formatColor(`[${formatText}]`);
193
- }
194
- const colors = /* @__PURE__ */ new Map();
195
- function generateColor(name = "default") {
196
- if (colors.has(name)) return colors.get(name);
197
- let color;
198
- if (name === "default") color = blue;
199
- else {
200
- let hash = 0;
201
- for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash);
202
- color = rgb(...hslToRgb(hash % 360, 35, 55));
203
- }
204
- colors.set(name, color);
205
- return color;
206
- }
207
- function hslToRgb(h, s, l) {
208
- h = h % 360;
209
- h /= 360;
210
- s /= 100;
211
- l /= 100;
212
- let r, g, b;
213
- if (s === 0) r = g = b = l;
214
- else {
215
- const q = l < .5 ? l * (1 + s) : l + s - l * s;
216
- const p = 2 * l - q;
217
- r = hue2rgb(p, q, h + 1 / 3);
218
- g = hue2rgb(p, q, h);
219
- b = hue2rgb(p, q, h - 1 / 3);
220
- }
221
- return [
222
- Math.max(0, Math.round(r * 255)),
223
- Math.max(0, Math.round(g * 255)),
224
- Math.max(0, Math.round(b * 255))
225
- ];
226
- }
227
- function hue2rgb(p, q, t) {
228
- if (t < 0) t += 1;
229
- if (t > 1) t -= 1;
230
- if (t < 1 / 6) return p + (q - p) * 6 * t;
231
- if (t < 1 / 2) return q;
232
- if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
233
- return p;
234
- }
235
- //#endregion
236
- //#region ../../node_modules/.pnpm/tsdown@0.22.3_@arethetypeswrong+core@0.18.2_@tsdown+css@0.22.3_@tsdown+exe@0.22.3_@type_b3805a6765df28d505319221a7193e18/node_modules/tsdown/dist/debug-DLdR-9XB.mjs
237
- var version = "0.22.3";
238
- const debugLog = createDebug("tsdown:debug");
239
- function enableDebug(debug) {
240
- if (!debug) return;
241
- let namespace;
242
- if (debug === true) namespace = "tsdown:*";
243
- else namespace = resolveComma(toArray(debug)).map((v) => `tsdown:${v}`).join(",");
244
- const ns = namespaces();
245
- if (ns) namespace += `,${ns}`;
246
- enable(namespace);
247
- debugLog("Debugging enabled", namespace);
248
- }
249
- //#endregion
250
- export { generateColor as a, prettyFormat as c, dim as d, green as f, yellow as g, underline as h, createLogger as i, blue as l, red as m, version as n, getNameLabel as o, hex as p, LogLevels as r, globalLogger as s, enableDebug as t, bold as u };
@@ -1,200 +0,0 @@
1
- //#region ../../node_modules/.pnpm/birpc@4.0.0/node_modules/birpc/dist/index.mjs
2
- const TYPE_REQUEST = "q";
3
- const TYPE_RESPONSE = "s";
4
- function createPromiseWithResolvers() {
5
- let resolve;
6
- let reject;
7
- return {
8
- promise: new Promise((res, rej) => {
9
- resolve = res;
10
- reject = rej;
11
- }),
12
- resolve,
13
- reject
14
- };
15
- }
16
- const random = Math.random.bind(Math);
17
- const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
18
- function nanoid(size = 21) {
19
- let id = "";
20
- let i = size;
21
- while (i--) id += urlAlphabet[random() * 64 | 0];
22
- return id;
23
- }
24
- const DEFAULT_TIMEOUT = 6e4;
25
- const defaultSerialize = (i) => i;
26
- const defaultDeserialize = defaultSerialize;
27
- const { clearTimeout, setTimeout } = globalThis;
28
- function createBirpc($functions, options) {
29
- const { post, on, off = () => {}, eventNames = [], serialize = defaultSerialize, deserialize = defaultDeserialize, resolver, bind = "rpc", timeout = DEFAULT_TIMEOUT, proxify = true } = options;
30
- let $closed = false;
31
- const _rpcPromiseMap = /* @__PURE__ */ new Map();
32
- let _promiseInit;
33
- let rpc;
34
- async function _call(method, args, event, optional) {
35
- if ($closed) throw new Error(`[birpc] rpc is closed, cannot call "${method}"`);
36
- const req = {
37
- m: method,
38
- a: args,
39
- t: TYPE_REQUEST
40
- };
41
- if (optional) req.o = true;
42
- const send = async (_req) => post(serialize(_req));
43
- if (event) {
44
- await send(req);
45
- return;
46
- }
47
- if (_promiseInit) try {
48
- await _promiseInit;
49
- } finally {
50
- _promiseInit = void 0;
51
- }
52
- let { promise, resolve, reject } = createPromiseWithResolvers();
53
- const id = nanoid();
54
- req.i = id;
55
- let timeoutId;
56
- async function handler(newReq = req) {
57
- if (timeout >= 0) {
58
- timeoutId = setTimeout(() => {
59
- try {
60
- if (options.onTimeoutError?.call(rpc, method, args) !== true) throw new Error(`[birpc] timeout on calling "${method}"`);
61
- } catch (e) {
62
- reject(e);
63
- }
64
- _rpcPromiseMap.delete(id);
65
- }, timeout);
66
- if (typeof timeoutId === "object") timeoutId = timeoutId.unref?.();
67
- }
68
- _rpcPromiseMap.set(id, {
69
- resolve,
70
- reject,
71
- timeoutId,
72
- method
73
- });
74
- await send(newReq);
75
- return promise;
76
- }
77
- try {
78
- if (options.onRequest) await options.onRequest.call(rpc, req, handler, resolve);
79
- else await handler();
80
- } catch (e) {
81
- if (options.onGeneralError?.call(rpc, e) !== true) throw e;
82
- return;
83
- } finally {
84
- clearTimeout(timeoutId);
85
- _rpcPromiseMap.delete(id);
86
- }
87
- return promise;
88
- }
89
- const builtinMethods = {
90
- $call: (method, ...args) => _call(method, args, false),
91
- $callOptional: (method, ...args) => _call(method, args, false, true),
92
- $callEvent: (method, ...args) => _call(method, args, true),
93
- $callRaw: (options$1) => _call(options$1.method, options$1.args, options$1.event, options$1.optional),
94
- $rejectPendingCalls,
95
- get $closed() {
96
- return $closed;
97
- },
98
- get $meta() {
99
- return options.meta;
100
- },
101
- $close,
102
- $functions
103
- };
104
- if (proxify) rpc = new Proxy({}, { get(_, method) {
105
- if (Object.prototype.hasOwnProperty.call(builtinMethods, method)) return builtinMethods[method];
106
- if (method === "then" && !eventNames.includes("then") && !("then" in $functions)) return void 0;
107
- const sendEvent = (...args) => _call(method, args, true);
108
- if (eventNames.includes(method)) {
109
- sendEvent.asEvent = sendEvent;
110
- return sendEvent;
111
- }
112
- const sendCall = (...args) => _call(method, args, false);
113
- sendCall.asEvent = sendEvent;
114
- return sendCall;
115
- } });
116
- else rpc = builtinMethods;
117
- function $close(customError) {
118
- $closed = true;
119
- _rpcPromiseMap.forEach(({ reject, method }) => {
120
- const error = /* @__PURE__ */ new Error(`[birpc] rpc is closed, cannot call "${method}"`);
121
- if (customError) {
122
- customError.cause ??= error;
123
- return reject(customError);
124
- }
125
- reject(error);
126
- });
127
- _rpcPromiseMap.clear();
128
- off(onMessage);
129
- }
130
- function $rejectPendingCalls(handler) {
131
- const handlerResults = Array.from(_rpcPromiseMap.values()).map(({ method, reject }) => {
132
- if (!handler) return reject(/* @__PURE__ */ new Error(`[birpc]: rejected pending call "${method}".`));
133
- return handler({
134
- method,
135
- reject
136
- });
137
- });
138
- _rpcPromiseMap.clear();
139
- return handlerResults;
140
- }
141
- async function onMessage(data, ...extra) {
142
- let msg;
143
- try {
144
- msg = deserialize(data);
145
- } catch (e) {
146
- if (options.onGeneralError?.call(rpc, e) !== true) throw e;
147
- return;
148
- }
149
- if (msg.t === TYPE_REQUEST) {
150
- const { m: method, a: args, o: optional } = msg;
151
- let result, error;
152
- let fn = await (resolver ? resolver.call(rpc, method, $functions[method]) : $functions[method]);
153
- if (optional) fn ||= () => void 0;
154
- if (!fn) error = /* @__PURE__ */ new Error(`[birpc] function "${method}" not found`);
155
- else try {
156
- result = await fn.apply(bind === "rpc" ? rpc : $functions, args);
157
- } catch (e) {
158
- error = e;
159
- }
160
- if (msg.i) {
161
- if (error && options.onFunctionError) {
162
- if (options.onFunctionError.call(rpc, error, method, args) === true) return;
163
- }
164
- if (!error) try {
165
- await post(serialize({
166
- t: TYPE_RESPONSE,
167
- i: msg.i,
168
- r: result
169
- }), ...extra);
170
- return;
171
- } catch (e) {
172
- error = e;
173
- if (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;
174
- }
175
- try {
176
- await post(serialize({
177
- t: TYPE_RESPONSE,
178
- i: msg.i,
179
- e: error
180
- }), ...extra);
181
- } catch (e) {
182
- if (options.onGeneralError?.call(rpc, e, method, args) !== true) throw e;
183
- }
184
- }
185
- } else {
186
- const { i: ack, r: result, e: error } = msg;
187
- const promise = _rpcPromiseMap.get(ack);
188
- if (promise) {
189
- clearTimeout(promise.timeoutId);
190
- if (error) promise.reject(error);
191
- else promise.resolve(result);
192
- }
193
- _rpcPromiseMap.delete(ack);
194
- }
195
- }
196
- _promiseInit = on(onMessage);
197
- return rpc;
198
- }
199
- //#endregion
200
- export { createBirpc };