@kasperpeulen/vitest-plugin-nextjs 0.0.0-alpha.0 → 0.1.0-alpha.0

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 (250) hide show
  1. package/README.md +249 -2
  2. package/dist/_virtual/_rolldown/runtime.js +14 -0
  3. package/dist/action-ids.d.ts +18 -0
  4. package/dist/action-ids.js +44 -0
  5. package/dist/adapter.d.ts +8 -0
  6. package/dist/adapter.js +12 -0
  7. package/dist/app-requests.d.ts +63 -0
  8. package/dist/app-requests.js +253 -0
  9. package/dist/browser-context.d.ts +24 -0
  10. package/dist/browser-context.js +157 -0
  11. package/dist/build-output.d.ts +68 -0
  12. package/dist/build-output.js +216 -0
  13. package/dist/build.d.ts +26 -0
  14. package/dist/build.js +39 -0
  15. package/dist/built-files.d.ts +9 -0
  16. package/dist/built-files.js +22 -0
  17. package/dist/cache.d.ts +44 -0
  18. package/dist/cache.js +99 -0
  19. package/dist/client-components.d.ts +3 -0
  20. package/dist/client-components.js +4 -0
  21. package/dist/client-file-key.d.ts +5 -0
  22. package/dist/client-file-key.js +5 -0
  23. package/dist/client-files.d.ts +83 -0
  24. package/dist/client-files.js +186 -0
  25. package/dist/client-graph.d.ts +94 -0
  26. package/dist/client-graph.js +266 -0
  27. package/dist/client-modules.d.ts +10 -0
  28. package/dist/client-modules.js +43 -0
  29. package/dist/client.d.ts +42 -0
  30. package/dist/client.js +263 -0
  31. package/dist/commonjs.d.ts +44 -0
  32. package/dist/commonjs.js +111 -0
  33. package/dist/compat/browser/client.d.ts +19 -0
  34. package/dist/compat/browser/client.js +13 -0
  35. package/dist/compat/build.d.ts +145 -0
  36. package/dist/compat/build.js +149 -0
  37. package/dist/compat/checks.d.ts +16 -0
  38. package/dist/compat/checks.js +148 -0
  39. package/dist/compat/patches.d.ts +13 -0
  40. package/dist/compat/patches.js +30 -0
  41. package/dist/compat/paths.d.ts +74 -0
  42. package/dist/compat/paths.js +160 -0
  43. package/dist/compat/rsc/handlers.d.ts +2 -0
  44. package/dist/compat/rsc/handlers.js +2 -0
  45. package/dist/compat/rsc/prerender.d.ts +10 -0
  46. package/dist/compat/rsc/prerender.js +9 -0
  47. package/dist/compat/server/headers.d.ts +3 -0
  48. package/dist/compat/server/headers.js +3 -0
  49. package/dist/compat/ssr/build-output.d.ts +4 -0
  50. package/dist/compat/ssr/build-output.js +3 -0
  51. package/dist/compat/ssr/cache.d.ts +6 -0
  52. package/dist/compat/ssr/cache.js +6 -0
  53. package/dist/compat/ssr/handler.d.ts +8 -0
  54. package/dist/compat/ssr/handler.js +8 -0
  55. package/dist/compat/ssr/node-server.d.ts +5 -0
  56. package/dist/compat/ssr/node-server.js +4 -0
  57. package/dist/compat/ssr/render-errors.d.ts +4 -0
  58. package/dist/compat/ssr/render-errors.js +4 -0
  59. package/dist/compat/ssr/senders.d.ts +6 -0
  60. package/dist/compat/ssr/senders.js +6 -0
  61. package/dist/compat/types.d.ts +8 -0
  62. package/dist/compat/types.js +1 -0
  63. package/dist/compile.d.ts +31 -0
  64. package/dist/compile.js +140 -0
  65. package/dist/disk.d.ts +16 -0
  66. package/dist/disk.js +13 -0
  67. package/dist/document-loads.d.ts +15 -0
  68. package/dist/document-loads.js +53 -0
  69. package/dist/document.d.ts +79 -0
  70. package/dist/document.js +328 -0
  71. package/dist/downloads.d.ts +15 -0
  72. package/dist/downloads.js +71 -0
  73. package/dist/esm-require.d.ts +11 -0
  74. package/dist/esm-require.js +32 -0
  75. package/dist/fast-crypto/index.js +1093 -0
  76. package/dist/fast-crypto.d.ts +20 -0
  77. package/dist/fast-crypto.js +151 -0
  78. package/dist/flight.d.ts +19 -0
  79. package/dist/flight.js +42 -0
  80. package/dist/form-submission.d.ts +15 -0
  81. package/dist/form-submission.js +27 -0
  82. package/dist/from-page.d.ts +5 -0
  83. package/dist/from-page.js +44 -0
  84. package/dist/globals.d.ts +1 -0
  85. package/dist/globals.js +197 -0
  86. package/dist/host-document.d.ts +26 -0
  87. package/dist/host-document.js +34 -0
  88. package/dist/index.d.ts +280 -0
  89. package/dist/index.js +281 -0
  90. package/dist/internal.d.ts +2 -0
  91. package/dist/internal.js +3 -0
  92. package/dist/leftovers.d.ts +11 -0
  93. package/dist/leftovers.js +55 -0
  94. package/dist/mode.d.ts +169 -0
  95. package/dist/mode.js +31 -0
  96. package/dist/node/LICENSES.md +3540 -0
  97. package/dist/node/assert/strict.js +29 -0
  98. package/dist/node/assert.js +3044 -0
  99. package/dist/node/buffer.js +1499 -0
  100. package/dist/node/child_process.js +45 -0
  101. package/dist/node/cluster.js +85 -0
  102. package/dist/node/console.js +96 -0
  103. package/dist/node/constants.js +495 -0
  104. package/dist/node/crypto.js +1388 -0
  105. package/dist/node/dgram.js +78 -0
  106. package/dist/node/diagnostics_channel.js +122 -0
  107. package/dist/node/dns/promises.js +129 -0
  108. package/dist/node/dns.js +137 -0
  109. package/dist/node/domain.js +43 -0
  110. package/dist/node/events.js +1155 -0
  111. package/dist/node/fs/promises.js +40 -0
  112. package/dist/node/fs.js +10375 -0
  113. package/dist/node/http.js +326 -0
  114. package/dist/node/http2.js +305 -0
  115. package/dist/node/https.js +57 -0
  116. package/dist/node/inspector/promises.js +66 -0
  117. package/dist/node/inspector.js +76 -0
  118. package/dist/node/module.js +205 -0
  119. package/dist/node/net.js +392 -0
  120. package/dist/node/os.js +259 -0
  121. package/dist/node/path/posix.js +25 -0
  122. package/dist/node/path/win32.js +25 -0
  123. package/dist/node/path.js +384 -0
  124. package/dist/node/perf_hooks.js +313 -0
  125. package/dist/node/process.js +452 -0
  126. package/dist/node/punycode.js +178 -0
  127. package/dist/node/querystring.js +934 -0
  128. package/dist/node/readline/promises.js +71 -0
  129. package/dist/node/readline.js +56 -0
  130. package/dist/node/repl.js +44 -0
  131. package/dist/node/sqlite.js +22 -0
  132. package/dist/node/stream/consumers.js +47 -0
  133. package/dist/node/stream/promises.js +6 -0
  134. package/dist/node/stream/web.js +52 -0
  135. package/dist/node/stream.js +4323 -0
  136. package/dist/node/string_decoder.js +276 -0
  137. package/dist/node/sys.js +6 -0
  138. package/dist/node/timers/promises.js +71 -0
  139. package/dist/node/timers.js +133 -0
  140. package/dist/node/tls.js +122 -0
  141. package/dist/node/trace_events.js +23 -0
  142. package/dist/node/tty.js +69 -0
  143. package/dist/node/url.js +1426 -0
  144. package/dist/node/util/types.js +1456 -0
  145. package/dist/node/util.js +4807 -0
  146. package/dist/node/v8.js +160 -0
  147. package/dist/node/vm.js +88 -0
  148. package/dist/node/wasi.js +16 -0
  149. package/dist/node/worker_threads.js +123 -0
  150. package/dist/node/zlib.js +1396 -0
  151. package/dist/node-builtins.d.ts +40 -0
  152. package/dist/node-builtins.js +74 -0
  153. package/dist/node-on-page.d.ts +46 -0
  154. package/dist/node-on-page.js +101 -0
  155. package/dist/node-platform.d.ts +36 -0
  156. package/dist/node-platform.js +152 -0
  157. package/dist/node-rendered.d.ts +21 -0
  158. package/dist/node-rendered.js +26 -0
  159. package/dist/node-server.d.ts +46 -0
  160. package/dist/node-server.js +193 -0
  161. package/dist/optimizer-cache-key.d.ts +26 -0
  162. package/dist/optimizer-cache-key.js +73 -0
  163. package/dist/own-package.d.ts +1 -0
  164. package/dist/own-package.js +6 -0
  165. package/dist/page-store.d.ts +33 -0
  166. package/dist/page-store.js +80 -0
  167. package/dist/page-timers.d.ts +22 -0
  168. package/dist/page-timers.js +47 -0
  169. package/dist/page.d.ts +112 -0
  170. package/dist/page.js +549 -0
  171. package/dist/paths.d.ts +13 -0
  172. package/dist/paths.js +47 -0
  173. package/dist/plugin.d.ts +22 -0
  174. package/dist/plugin.js +995 -0
  175. package/dist/prerender-verdict.d.ts +8 -0
  176. package/dist/prerender-verdict.js +67 -0
  177. package/dist/project/context.d.ts +546 -0
  178. package/dist/project/context.js +111 -0
  179. package/dist/project/entries.d.ts +42 -0
  180. package/dist/project/entries.js +189 -0
  181. package/dist/project/env-worker.d.ts +1 -0
  182. package/dist/project/env-worker.js +9 -0
  183. package/dist/project/env.d.ts +36 -0
  184. package/dist/project/env.js +82 -0
  185. package/dist/project/layers.d.ts +31 -0
  186. package/dist/project/layers.js +150 -0
  187. package/dist/project/loaders.d.ts +71 -0
  188. package/dist/project/loaders.js +300 -0
  189. package/dist/project/metadata.d.ts +8 -0
  190. package/dist/project/metadata.js +34 -0
  191. package/dist/project/module-exports.d.ts +29 -0
  192. package/dist/project/module-exports.js +77 -0
  193. package/dist/project/routes.d.ts +19 -0
  194. package/dist/project/routes.js +92 -0
  195. package/dist/project/routing.d.ts +46 -0
  196. package/dist/project/routing.js +280 -0
  197. package/dist/project/transform.d.ts +8 -0
  198. package/dist/project/transform.js +110 -0
  199. package/dist/project/webpack.d.ts +46 -0
  200. package/dist/project/webpack.js +160 -0
  201. package/dist/project.d.ts +264 -0
  202. package/dist/project.js +58 -0
  203. package/dist/registry-global.d.ts +5 -0
  204. package/dist/registry-global.js +5 -0
  205. package/dist/registry.d.ts +241 -0
  206. package/dist/registry.js +30 -0
  207. package/dist/route-chunks.d.ts +13 -0
  208. package/dist/route-chunks.js +32 -0
  209. package/dist/route-lookup.d.ts +34 -0
  210. package/dist/route-lookup.js +207 -0
  211. package/dist/routes-ahead-shared.d.ts +17 -0
  212. package/dist/routes-ahead-shared.js +9 -0
  213. package/dist/routes-ahead.d.ts +10 -0
  214. package/dist/routes-ahead.js +54 -0
  215. package/dist/rsc.d.ts +19 -0
  216. package/dist/rsc.js +171 -0
  217. package/dist/server-action.d.ts +9 -0
  218. package/dist/server-action.js +15 -0
  219. package/dist/server-code.d.ts +176 -0
  220. package/dist/server-code.js +357 -0
  221. package/dist/server-in-front.d.ts +37 -0
  222. package/dist/server-in-front.js +90 -0
  223. package/dist/server-layers.d.ts +22 -0
  224. package/dist/server-layers.js +33 -0
  225. package/dist/setup-browser.d.ts +1 -0
  226. package/dist/setup-browser.js +8 -0
  227. package/dist/setup-node.d.ts +1 -0
  228. package/dist/setup-node.js +6 -0
  229. package/dist/setup.d.ts +8 -0
  230. package/dist/setup.js +62 -0
  231. package/dist/speed-features.d.ts +13 -0
  232. package/dist/speed-features.js +95 -0
  233. package/dist/ssr.d.ts +70 -0
  234. package/dist/ssr.js +480 -0
  235. package/dist/static-build.d.ts +36 -0
  236. package/dist/static-build.js +92 -0
  237. package/dist/storage.d.ts +31 -0
  238. package/dist/storage.js +94 -0
  239. package/dist/styles-shared.d.ts +137 -0
  240. package/dist/styles-shared.js +124 -0
  241. package/dist/styles.d.ts +102 -0
  242. package/dist/styles.js +730 -0
  243. package/dist/stylesheet-versions.d.ts +17 -0
  244. package/dist/stylesheet-versions.js +43 -0
  245. package/dist/tester.html +10 -0
  246. package/dist/use-cache.d.ts +15 -0
  247. package/dist/use-cache.js +93 -0
  248. package/dist/vitest-version.d.ts +6 -0
  249. package/dist/vitest-version.js +12 -0
  250. package/package.json +125 -4
@@ -0,0 +1,276 @@
1
+ import * as m from "buffer";
2
+ //#region \0rolldown/runtime.js
3
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
+ //#endregion
5
+ //#region \0require-as-import:buffer
6
+ var require__require_as_import_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
+ module.exports = m.default;
8
+ }));
9
+ //#endregion
10
+ //#region ../../node_modules/.pnpm/safe-buffer@5.2.1/node_modules/safe-buffer/index.js
11
+ var require_safe_buffer = /* @__PURE__ */ __commonJSMin(((exports, module) => {
12
+ var buffer = require__require_as_import_buffer();
13
+ var Buffer = buffer.Buffer;
14
+ function copyProps(src, dst) {
15
+ for (var key in src) dst[key] = src[key];
16
+ }
17
+ if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) module.exports = buffer;
18
+ else {
19
+ copyProps(buffer, exports);
20
+ exports.Buffer = SafeBuffer;
21
+ }
22
+ function SafeBuffer(arg, encodingOrOffset, length) {
23
+ return Buffer(arg, encodingOrOffset, length);
24
+ }
25
+ SafeBuffer.prototype = Object.create(Buffer.prototype);
26
+ copyProps(Buffer, SafeBuffer);
27
+ SafeBuffer.from = function(arg, encodingOrOffset, length) {
28
+ if (typeof arg === "number") throw new TypeError("Argument must not be a number");
29
+ return Buffer(arg, encodingOrOffset, length);
30
+ };
31
+ SafeBuffer.alloc = function(size, fill, encoding) {
32
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
33
+ var buf = Buffer(size);
34
+ if (fill !== void 0) {
35
+ if (typeof encoding === "string") buf.fill(fill, encoding);
36
+ else buf.fill(fill);
37
+ } else buf.fill(0);
38
+ return buf;
39
+ };
40
+ SafeBuffer.allocUnsafe = function(size) {
41
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
42
+ return Buffer(size);
43
+ };
44
+ SafeBuffer.allocUnsafeSlow = function(size) {
45
+ if (typeof size !== "number") throw new TypeError("Argument must be a number");
46
+ return buffer.SlowBuffer(size);
47
+ };
48
+ }));
49
+ //#endregion
50
+ //#region src/node/string_decoder.ts
51
+ var import_string_decoder = (/* @__PURE__ */ __commonJSMin(((exports) => {
52
+ var Buffer = require_safe_buffer().Buffer;
53
+ var isEncoding = Buffer.isEncoding || function(encoding) {
54
+ encoding = "" + encoding;
55
+ switch (encoding && encoding.toLowerCase()) {
56
+ case "hex":
57
+ case "utf8":
58
+ case "utf-8":
59
+ case "ascii":
60
+ case "binary":
61
+ case "base64":
62
+ case "ucs2":
63
+ case "ucs-2":
64
+ case "utf16le":
65
+ case "utf-16le":
66
+ case "raw": return true;
67
+ default: return false;
68
+ }
69
+ };
70
+ function _normalizeEncoding(enc) {
71
+ if (!enc) return "utf8";
72
+ var retried;
73
+ while (true) switch (enc) {
74
+ case "utf8":
75
+ case "utf-8": return "utf8";
76
+ case "ucs2":
77
+ case "ucs-2":
78
+ case "utf16le":
79
+ case "utf-16le": return "utf16le";
80
+ case "latin1":
81
+ case "binary": return "latin1";
82
+ case "base64":
83
+ case "ascii":
84
+ case "hex": return enc;
85
+ default:
86
+ if (retried) return;
87
+ enc = ("" + enc).toLowerCase();
88
+ retried = true;
89
+ }
90
+ }
91
+ function normalizeEncoding(enc) {
92
+ var nenc = _normalizeEncoding(enc);
93
+ if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
94
+ return nenc || enc;
95
+ }
96
+ exports.StringDecoder = StringDecoder;
97
+ function StringDecoder(encoding) {
98
+ this.encoding = normalizeEncoding(encoding);
99
+ var nb;
100
+ switch (this.encoding) {
101
+ case "utf16le":
102
+ this.text = utf16Text;
103
+ this.end = utf16End;
104
+ nb = 4;
105
+ break;
106
+ case "utf8":
107
+ this.fillLast = utf8FillLast;
108
+ nb = 4;
109
+ break;
110
+ case "base64":
111
+ this.text = base64Text;
112
+ this.end = base64End;
113
+ nb = 3;
114
+ break;
115
+ default:
116
+ this.write = simpleWrite;
117
+ this.end = simpleEnd;
118
+ return;
119
+ }
120
+ this.lastNeed = 0;
121
+ this.lastTotal = 0;
122
+ this.lastChar = Buffer.allocUnsafe(nb);
123
+ }
124
+ StringDecoder.prototype.write = function(buf) {
125
+ if (buf.length === 0) return "";
126
+ var r;
127
+ var i;
128
+ if (this.lastNeed) {
129
+ r = this.fillLast(buf);
130
+ if (r === void 0) return "";
131
+ i = this.lastNeed;
132
+ this.lastNeed = 0;
133
+ } else i = 0;
134
+ if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
135
+ return r || "";
136
+ };
137
+ StringDecoder.prototype.end = utf8End;
138
+ StringDecoder.prototype.text = utf8Text;
139
+ StringDecoder.prototype.fillLast = function(buf) {
140
+ if (this.lastNeed <= buf.length) {
141
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
142
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
143
+ }
144
+ buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
145
+ this.lastNeed -= buf.length;
146
+ };
147
+ function utf8CheckByte(byte) {
148
+ if (byte <= 127) return 0;
149
+ else if (byte >> 5 === 6) return 2;
150
+ else if (byte >> 4 === 14) return 3;
151
+ else if (byte >> 3 === 30) return 4;
152
+ return byte >> 6 === 2 ? -1 : -2;
153
+ }
154
+ function utf8CheckIncomplete(self, buf, i) {
155
+ var j = buf.length - 1;
156
+ if (j < i) return 0;
157
+ var nb = utf8CheckByte(buf[j]);
158
+ if (nb >= 0) {
159
+ if (nb > 0) self.lastNeed = nb - 1;
160
+ return nb;
161
+ }
162
+ if (--j < i || nb === -2) return 0;
163
+ nb = utf8CheckByte(buf[j]);
164
+ if (nb >= 0) {
165
+ if (nb > 0) self.lastNeed = nb - 2;
166
+ return nb;
167
+ }
168
+ if (--j < i || nb === -2) return 0;
169
+ nb = utf8CheckByte(buf[j]);
170
+ if (nb >= 0) {
171
+ if (nb > 0) {
172
+ if (nb === 2) nb = 0;
173
+ else self.lastNeed = nb - 3;
174
+ }
175
+ return nb;
176
+ }
177
+ return 0;
178
+ }
179
+ function utf8CheckExtraBytes(self, buf, p) {
180
+ if ((buf[0] & 192) !== 128) {
181
+ self.lastNeed = 0;
182
+ return "�";
183
+ }
184
+ if (self.lastNeed > 1 && buf.length > 1) {
185
+ if ((buf[1] & 192) !== 128) {
186
+ self.lastNeed = 1;
187
+ return "�";
188
+ }
189
+ if (self.lastNeed > 2 && buf.length > 2) {
190
+ if ((buf[2] & 192) !== 128) {
191
+ self.lastNeed = 2;
192
+ return "�";
193
+ }
194
+ }
195
+ }
196
+ }
197
+ function utf8FillLast(buf) {
198
+ var p = this.lastTotal - this.lastNeed;
199
+ var r = utf8CheckExtraBytes(this, buf, p);
200
+ if (r !== void 0) return r;
201
+ if (this.lastNeed <= buf.length) {
202
+ buf.copy(this.lastChar, p, 0, this.lastNeed);
203
+ return this.lastChar.toString(this.encoding, 0, this.lastTotal);
204
+ }
205
+ buf.copy(this.lastChar, p, 0, buf.length);
206
+ this.lastNeed -= buf.length;
207
+ }
208
+ function utf8Text(buf, i) {
209
+ var total = utf8CheckIncomplete(this, buf, i);
210
+ if (!this.lastNeed) return buf.toString("utf8", i);
211
+ this.lastTotal = total;
212
+ var end = buf.length - (total - this.lastNeed);
213
+ buf.copy(this.lastChar, 0, end);
214
+ return buf.toString("utf8", i, end);
215
+ }
216
+ function utf8End(buf) {
217
+ var r = buf && buf.length ? this.write(buf) : "";
218
+ if (this.lastNeed) return r + "�";
219
+ return r;
220
+ }
221
+ function utf16Text(buf, i) {
222
+ if ((buf.length - i) % 2 === 0) {
223
+ var r = buf.toString("utf16le", i);
224
+ if (r) {
225
+ var c = r.charCodeAt(r.length - 1);
226
+ if (c >= 55296 && c <= 56319) {
227
+ this.lastNeed = 2;
228
+ this.lastTotal = 4;
229
+ this.lastChar[0] = buf[buf.length - 2];
230
+ this.lastChar[1] = buf[buf.length - 1];
231
+ return r.slice(0, -1);
232
+ }
233
+ }
234
+ return r;
235
+ }
236
+ this.lastNeed = 1;
237
+ this.lastTotal = 2;
238
+ this.lastChar[0] = buf[buf.length - 1];
239
+ return buf.toString("utf16le", i, buf.length - 1);
240
+ }
241
+ function utf16End(buf) {
242
+ var r = buf && buf.length ? this.write(buf) : "";
243
+ if (this.lastNeed) {
244
+ var end = this.lastTotal - this.lastNeed;
245
+ return r + this.lastChar.toString("utf16le", 0, end);
246
+ }
247
+ return r;
248
+ }
249
+ function base64Text(buf, i) {
250
+ var n = (buf.length - i) % 3;
251
+ if (n === 0) return buf.toString("base64", i);
252
+ this.lastNeed = 3 - n;
253
+ this.lastTotal = 3;
254
+ if (n === 1) this.lastChar[0] = buf[buf.length - 1];
255
+ else {
256
+ this.lastChar[0] = buf[buf.length - 2];
257
+ this.lastChar[1] = buf[buf.length - 1];
258
+ }
259
+ return buf.toString("base64", i, buf.length - n);
260
+ }
261
+ function base64End(buf) {
262
+ var r = buf && buf.length ? this.write(buf) : "";
263
+ if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
264
+ return r;
265
+ }
266
+ function simpleWrite(buf) {
267
+ return buf.toString(this.encoding);
268
+ }
269
+ function simpleEnd(buf) {
270
+ return buf && buf.length ? this.write(buf) : "";
271
+ }
272
+ })))();
273
+ var string_decoder_default = { StringDecoder: import_string_decoder.StringDecoder };
274
+ //#endregion
275
+ var StringDecoder = import_string_decoder.StringDecoder;
276
+ export { StringDecoder, string_decoder_default as default };
@@ -0,0 +1,6 @@
1
+ import util from "@kasperpeulen/vitest-plugin-nextjs/node/util";
2
+ export * from "@kasperpeulen/vitest-plugin-nextjs/node/util";
3
+ //#region src/node/sys.ts
4
+ var sys_default = util;
5
+ //#endregion
6
+ export { sys_default as default };
@@ -0,0 +1,71 @@
1
+ //#region src/registry-global.ts
2
+ const registryGlobal = "__vitest_plugin_rsc_next__";
3
+ //#endregion
4
+ //#region src/node/timers.ts
5
+ const registry = () => globalThis[registryGlobal];
6
+ const setImmediate$1 = (callback, ...args) => registry().setImmediate(callback, ...args);
7
+ const clearImmediate = (id) => registry().clearImmediate(id);
8
+ const setTimeout$1 = (callback, delay, ...args) => globalThis.setTimeout(callback, delay, ...args);
9
+ const clearTimeout = (id) => globalThis.clearTimeout(id);
10
+ //#endregion
11
+ //#region src/node/timers/promises.ts
12
+ const aborted = (signal) => Object.assign(/* @__PURE__ */ new Error("The operation was aborted"), {
13
+ name: "AbortError",
14
+ code: "ABORT_ERR",
15
+ cause: signal.reason
16
+ });
17
+ const after = (start, clear, value, options) => new Promise((resolve, reject) => {
18
+ const signal = options?.signal;
19
+ if (signal?.aborted) return reject(aborted(signal));
20
+ const abort = () => {
21
+ clear(id);
22
+ reject(aborted(signal));
23
+ };
24
+ const id = start(() => {
25
+ signal?.removeEventListener("abort", abort);
26
+ resolve(value);
27
+ });
28
+ signal?.addEventListener("abort", abort, { once: true });
29
+ });
30
+ const setTimeout = (delay, value, options) => after((done) => setTimeout$1(done, delay), (id) => clearTimeout(id), value, options);
31
+ const setImmediate = (value, options) => after((done) => setImmediate$1(done), clearImmediate, value, options);
32
+ async function* setInterval(delay, value, options) {
33
+ const signal = options?.signal;
34
+ if (signal?.aborted) throw aborted(signal);
35
+ let pending = 0;
36
+ let wake;
37
+ const tick = () => {
38
+ pending++;
39
+ wake?.();
40
+ };
41
+ const id = globalThis.setInterval(tick, delay);
42
+ signal?.addEventListener("abort", tick, { once: true });
43
+ try {
44
+ for (;;) {
45
+ while (pending === 0 && !signal?.aborted) {
46
+ await new Promise((resolve) => {
47
+ wake = resolve;
48
+ });
49
+ wake = void 0;
50
+ }
51
+ if (signal?.aborted) throw aborted(signal);
52
+ pending--;
53
+ yield value;
54
+ }
55
+ } finally {
56
+ globalThis.clearInterval(id);
57
+ signal?.removeEventListener("abort", tick);
58
+ }
59
+ }
60
+ const scheduler = {
61
+ wait: (delay, options) => setTimeout(delay, void 0, options),
62
+ yield: () => setImmediate()
63
+ };
64
+ var promises_default = {
65
+ setTimeout,
66
+ setImmediate,
67
+ setInterval,
68
+ scheduler
69
+ };
70
+ //#endregion
71
+ export { promises_default as default, scheduler, setImmediate, setInterval, setTimeout };
@@ -0,0 +1,133 @@
1
+ import promises from "node:timers/promises";
2
+ //#region src/registry-global.ts
3
+ const registryGlobal = "__vitest_plugin_rsc_next__";
4
+ //#endregion
5
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
6
+ /* @__NO_SIDE_EFFECTS__ */
7
+ function createNotImplementedError(name) {
8
+ return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
9
+ }
10
+ /* @__NO_SIDE_EFFECTS__ */
11
+ function notImplemented(name) {
12
+ const fn = () => {
13
+ throw /* @__PURE__ */ createNotImplementedError(name);
14
+ };
15
+ return Object.assign(fn, { __unenv__: true });
16
+ }
17
+ Object.assign(() => {}, { __unenv__: true });
18
+ //#endregion
19
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/timers/timeout.mjs
20
+ var Timeout = class {
21
+ constructor(callback, args) {
22
+ if (typeof callback === "function") callback(...args);
23
+ }
24
+ close() {
25
+ throw /* @__PURE__ */ createNotImplementedError("node.timers.timeout.close");
26
+ }
27
+ _onTimeout(...args) {
28
+ throw /* @__PURE__ */ createNotImplementedError("node.timers.timeout._onTimeout");
29
+ }
30
+ ref() {
31
+ return this;
32
+ }
33
+ unref() {
34
+ return this;
35
+ }
36
+ hasRef() {
37
+ return false;
38
+ }
39
+ refresh() {
40
+ return this;
41
+ }
42
+ [Symbol.dispose]() {}
43
+ [Symbol.toPrimitive]() {
44
+ return 0;
45
+ }
46
+ };
47
+ //#endregion
48
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/timers/set-timeout.mjs
49
+ function setTimeoutFallbackPromises(delay, value, options) {
50
+ return new Promise((res) => {
51
+ res(value);
52
+ });
53
+ }
54
+ function setTimeoutFallback(callback, ms, ...args) {
55
+ return new Timeout(callback, args);
56
+ }
57
+ setTimeoutFallback.__promisify__ = setTimeoutFallbackPromises;
58
+ //#endregion
59
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/timers/immediate.mjs
60
+ var Immediate = class {
61
+ _onImmediate;
62
+ _timeout;
63
+ constructor(callback, args) {
64
+ this._onImmediate = callback;
65
+ if ("setTimeout" in globalThis) this._timeout = setTimeout(callback, 0, ...args);
66
+ else callback(...args);
67
+ }
68
+ ref() {
69
+ this._timeout?.ref();
70
+ return this;
71
+ }
72
+ unref() {
73
+ this._timeout?.unref();
74
+ return this;
75
+ }
76
+ hasRef() {
77
+ return this._timeout?.hasRef() ?? false;
78
+ }
79
+ [Symbol.dispose]() {
80
+ if ("clearTimeout" in globalThis) clearTimeout(this._timeout);
81
+ }
82
+ };
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/timers/set-immediate.mjs
85
+ function setImmediateFallbackPromises(value) {
86
+ return new Promise((res) => {
87
+ res(value);
88
+ });
89
+ }
90
+ function setImmediateFallback(callback, ...args) {
91
+ return new Immediate(callback, args);
92
+ }
93
+ setImmediateFallback.__promisify__ = setImmediateFallbackPromises;
94
+ //#endregion
95
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/timers/set-interval.mjs
96
+ async function* setIntervalFallbackPromises(delay, value) {
97
+ yield value;
98
+ }
99
+ function setIntervalFallback(callback, ms, ...args) {
100
+ return new Timeout(callback, args);
101
+ }
102
+ setIntervalFallback.__promisify__ = setIntervalFallbackPromises;
103
+ globalThis.clearImmediate?.bind(globalThis);
104
+ globalThis.clearInterval?.bind(globalThis);
105
+ globalThis.clearTimeout?.bind(globalThis);
106
+ globalThis.setImmediate?.bind(globalThis);
107
+ globalThis.setTimeout?.bind(globalThis);
108
+ globalThis.setInterval?.bind(globalThis);
109
+ const active = function active(timeout) {
110
+ timeout?.refresh?.();
111
+ };
112
+ const _unrefActive = active;
113
+ const enroll = /* @__PURE__ */ notImplemented("timers.enroll");
114
+ const unenroll = /* @__PURE__ */ notImplemented("timers.unenroll");
115
+ //#endregion
116
+ //#region src/node/timers.ts
117
+ const registry = () => globalThis[registryGlobal];
118
+ const setImmediate = (callback, ...args) => registry().setImmediate(callback, ...args);
119
+ const clearImmediate = (id) => registry().clearImmediate(id);
120
+ const setTimeout$1 = (callback, delay, ...args) => globalThis.setTimeout(callback, delay, ...args);
121
+ const clearTimeout$1 = (id) => globalThis.clearTimeout(id);
122
+ const setInterval = (callback, delay, ...args) => globalThis.setInterval(callback, delay, ...args);
123
+ const clearInterval = (id) => globalThis.clearInterval(id);
124
+ var timers_default = {
125
+ setImmediate,
126
+ clearImmediate,
127
+ setTimeout: setTimeout$1,
128
+ clearTimeout: clearTimeout$1,
129
+ setInterval,
130
+ clearInterval
131
+ };
132
+ //#endregion
133
+ export { _unrefActive, active, clearImmediate, clearInterval, clearTimeout$1 as clearTimeout, timers_default as default, enroll, promises, setImmediate, setInterval, setTimeout$1 as setTimeout, unenroll };
@@ -0,0 +1,122 @@
1
+ import { Server as Server$1, Socket } from "node:net";
2
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
3
+ /* @__NO_SIDE_EFFECTS__ */
4
+ function createNotImplementedError(name) {
5
+ return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
6
+ }
7
+ /* @__NO_SIDE_EFFECTS__ */
8
+ function notImplemented(name) {
9
+ const fn = () => {
10
+ throw /* @__PURE__ */ createNotImplementedError(name);
11
+ };
12
+ return Object.assign(fn, { __unenv__: true });
13
+ }
14
+ //#endregion
15
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tls/tls-socket.mjs
16
+ var TLSSocket = class extends Socket {
17
+ authorized = false;
18
+ encrypted = true;
19
+ alpnProtocol = null;
20
+ authorizationError = /* @__PURE__ */ new Error("[unenv] TLSSocket.authorizationError is not implemented yet!");
21
+ exportKeyingMaterial() {
22
+ throw /* @__PURE__ */ createNotImplementedError("TLSSocket.exportKeyingMaterial");
23
+ }
24
+ getCipher() {
25
+ throw /* @__PURE__ */ createNotImplementedError("TLSSocket.getCipher");
26
+ }
27
+ getPeerCertificate(_detailed) {
28
+ throw /* @__PURE__ */ createNotImplementedError("TLSSocket.getPeerCertificate");
29
+ }
30
+ getCertificate() {
31
+ return null;
32
+ }
33
+ getEphemeralKeyInfo() {
34
+ return null;
35
+ }
36
+ getFinished() {}
37
+ getPeerFinished() {}
38
+ getProtocol() {
39
+ return null;
40
+ }
41
+ getSession() {}
42
+ getSharedSigalgs() {
43
+ return [];
44
+ }
45
+ getTLSTicket() {}
46
+ isSessionReused() {
47
+ return false;
48
+ }
49
+ renegotiate(options, callback) {
50
+ if (typeof callback === "function") callback(null);
51
+ }
52
+ setMaxSendFragment(size) {
53
+ return false;
54
+ }
55
+ disableRenegotiation() {}
56
+ enableTrace() {}
57
+ getPeerX509Certificate() {}
58
+ getX509Certificate() {}
59
+ };
60
+ //#endregion
61
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tls/server.mjs
62
+ var Server = class extends Server$1 {
63
+ constructor(arg1, arg2) {
64
+ super(arg1, arg2);
65
+ }
66
+ addContext(hostname, context) {}
67
+ setSecureContext(options) {}
68
+ setTicketKeys(_keys) {
69
+ throw /* @__PURE__ */ createNotImplementedError("Server.setTicketKeys");
70
+ }
71
+ getTicketKeys() {
72
+ throw /* @__PURE__ */ createNotImplementedError("Server.getTicketKeys");
73
+ }
74
+ };
75
+ //#endregion
76
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tls/secure-context.mjs
77
+ var SecureContext = class {
78
+ context = {};
79
+ };
80
+ //#endregion
81
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tls/constants.mjs
82
+ const CLIENT_RENEG_LIMIT = 3;
83
+ const CLIENT_RENEG_WINDOW = 600;
84
+ const DEFAULT_CIPHERS = "";
85
+ const DEFAULT_ECDH_CURVE = "auto";
86
+ const DEFAULT_MIN_VERSION = "TLSv1.2";
87
+ const DEFAULT_MAX_VERSION = "TLSv1.3";
88
+ //#endregion
89
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/tls.mjs
90
+ const connect = function connect() {
91
+ return new TLSSocket();
92
+ };
93
+ const createServer = function createServer() {
94
+ return new Server();
95
+ };
96
+ const checkServerIdentity = /* @__PURE__ */ notImplemented("tls.checkServerIdentity");
97
+ const convertALPNProtocols = /* @__PURE__ */ notImplemented("tls.convertALPNProtocols");
98
+ const createSecureContext = /* @__PURE__ */ notImplemented("tls.createSecureContext");
99
+ const createSecurePair = /* @__PURE__ */ notImplemented("tls.createSecurePair");
100
+ const getCiphers = /* @__PURE__ */ notImplemented("tls.getCiphers");
101
+ const rootCertificates = [];
102
+ var tls_default = {
103
+ CLIENT_RENEG_LIMIT: 3,
104
+ CLIENT_RENEG_WINDOW: 600,
105
+ DEFAULT_CIPHERS: "",
106
+ DEFAULT_ECDH_CURVE,
107
+ DEFAULT_MAX_VERSION,
108
+ DEFAULT_MIN_VERSION,
109
+ SecureContext,
110
+ Server,
111
+ TLSSocket,
112
+ checkServerIdentity,
113
+ connect,
114
+ convertALPNProtocols,
115
+ createSecureContext,
116
+ createSecurePair,
117
+ createServer,
118
+ getCiphers,
119
+ rootCertificates
120
+ };
121
+ //#endregion
122
+ export { CLIENT_RENEG_LIMIT, CLIENT_RENEG_WINDOW, DEFAULT_CIPHERS, DEFAULT_ECDH_CURVE, DEFAULT_MAX_VERSION, DEFAULT_MIN_VERSION, SecureContext, Server, TLSSocket, checkServerIdentity, connect, convertALPNProtocols, createSecureContext, createSecurePair, createServer, tls_default as default, getCiphers, rootCertificates };
@@ -0,0 +1,23 @@
1
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/trace_events/tracing.mjs
2
+ var Tracing = class {
3
+ categories = "";
4
+ enabled = false;
5
+ disable() {
6
+ this.enabled = false;
7
+ }
8
+ enable() {
9
+ this.enabled = true;
10
+ }
11
+ };
12
+ //#endregion
13
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/trace_events.mjs
14
+ const createTracing = function() {
15
+ return new Tracing();
16
+ };
17
+ const getEnabledCategories = () => "";
18
+ var trace_events_default = {
19
+ createTracing,
20
+ getEnabledCategories
21
+ };
22
+ //#endregion
23
+ export { createTracing, trace_events_default as default, getEnabledCategories };
@@ -0,0 +1,69 @@
1
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tty/read-stream.mjs
2
+ var ReadStream = class {
3
+ fd;
4
+ isRaw = false;
5
+ isTTY = false;
6
+ constructor(fd) {
7
+ this.fd = fd;
8
+ }
9
+ setRawMode(mode) {
10
+ this.isRaw = mode;
11
+ return this;
12
+ }
13
+ };
14
+ //#endregion
15
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/tty/write-stream.mjs
16
+ var WriteStream = class {
17
+ fd;
18
+ columns = 80;
19
+ rows = 24;
20
+ isTTY = false;
21
+ constructor(fd) {
22
+ this.fd = fd;
23
+ }
24
+ clearLine(dir, callback) {
25
+ callback && callback();
26
+ return false;
27
+ }
28
+ clearScreenDown(callback) {
29
+ callback && callback();
30
+ return false;
31
+ }
32
+ cursorTo(x, y, callback) {
33
+ callback && typeof callback === "function" && callback();
34
+ return false;
35
+ }
36
+ moveCursor(dx, dy, callback) {
37
+ callback && callback();
38
+ return false;
39
+ }
40
+ getColorDepth(env) {
41
+ return 1;
42
+ }
43
+ hasColors(count, env) {
44
+ return false;
45
+ }
46
+ getWindowSize() {
47
+ return [this.columns, this.rows];
48
+ }
49
+ write(str, encoding, cb) {
50
+ if (str instanceof Uint8Array) str = new TextDecoder().decode(str);
51
+ try {
52
+ console.log(str);
53
+ } catch {}
54
+ cb && typeof cb === "function" && cb();
55
+ return false;
56
+ }
57
+ };
58
+ //#endregion
59
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/tty.mjs
60
+ const isatty = function() {
61
+ return false;
62
+ };
63
+ var tty_default = {
64
+ ReadStream,
65
+ WriteStream,
66
+ isatty
67
+ };
68
+ //#endregion
69
+ export { ReadStream, WriteStream, tty_default as default, isatty };