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

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 (256) 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 +39 -0
  64. package/dist/compile.js +175 -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 +330 -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/host-return-shared.d.ts +5 -0
  89. package/dist/host-return-shared.js +5 -0
  90. package/dist/host-return.d.ts +5 -0
  91. package/dist/host-return.js +16 -0
  92. package/dist/index.d.ts +280 -0
  93. package/dist/index.js +281 -0
  94. package/dist/internal.d.ts +2 -0
  95. package/dist/internal.js +3 -0
  96. package/dist/leftovers.d.ts +11 -0
  97. package/dist/leftovers.js +55 -0
  98. package/dist/mode.d.ts +169 -0
  99. package/dist/mode.js +31 -0
  100. package/dist/node/LICENSES.md +3540 -0
  101. package/dist/node/assert/strict.js +29 -0
  102. package/dist/node/assert.js +3044 -0
  103. package/dist/node/buffer.js +1499 -0
  104. package/dist/node/child_process.js +45 -0
  105. package/dist/node/cluster.js +85 -0
  106. package/dist/node/console.js +96 -0
  107. package/dist/node/constants.js +495 -0
  108. package/dist/node/crypto.js +1388 -0
  109. package/dist/node/dgram.js +78 -0
  110. package/dist/node/diagnostics_channel.js +122 -0
  111. package/dist/node/dns/promises.js +129 -0
  112. package/dist/node/dns.js +137 -0
  113. package/dist/node/domain.js +43 -0
  114. package/dist/node/events.js +1155 -0
  115. package/dist/node/fs/promises.js +40 -0
  116. package/dist/node/fs.js +10375 -0
  117. package/dist/node/http.js +326 -0
  118. package/dist/node/http2.js +305 -0
  119. package/dist/node/https.js +57 -0
  120. package/dist/node/inspector/promises.js +66 -0
  121. package/dist/node/inspector.js +76 -0
  122. package/dist/node/module.js +205 -0
  123. package/dist/node/net.js +392 -0
  124. package/dist/node/os.js +259 -0
  125. package/dist/node/path/posix.js +25 -0
  126. package/dist/node/path/win32.js +25 -0
  127. package/dist/node/path.js +384 -0
  128. package/dist/node/perf_hooks.js +313 -0
  129. package/dist/node/process.js +452 -0
  130. package/dist/node/punycode.js +178 -0
  131. package/dist/node/querystring.js +934 -0
  132. package/dist/node/readline/promises.js +71 -0
  133. package/dist/node/readline.js +56 -0
  134. package/dist/node/repl.js +44 -0
  135. package/dist/node/sqlite.js +22 -0
  136. package/dist/node/stream/consumers.js +47 -0
  137. package/dist/node/stream/promises.js +6 -0
  138. package/dist/node/stream/web.js +52 -0
  139. package/dist/node/stream.js +4323 -0
  140. package/dist/node/string_decoder.js +276 -0
  141. package/dist/node/sys.js +6 -0
  142. package/dist/node/timers/promises.js +71 -0
  143. package/dist/node/timers.js +133 -0
  144. package/dist/node/tls.js +122 -0
  145. package/dist/node/trace_events.js +23 -0
  146. package/dist/node/tty.js +69 -0
  147. package/dist/node/url.js +1426 -0
  148. package/dist/node/util/types.js +1456 -0
  149. package/dist/node/util.js +4807 -0
  150. package/dist/node/v8.js +160 -0
  151. package/dist/node/vm.js +88 -0
  152. package/dist/node/wasi.js +16 -0
  153. package/dist/node/worker_threads.js +123 -0
  154. package/dist/node/zlib.js +1396 -0
  155. package/dist/node-builtins.d.ts +40 -0
  156. package/dist/node-builtins.js +74 -0
  157. package/dist/node-on-page.d.ts +46 -0
  158. package/dist/node-on-page.js +101 -0
  159. package/dist/node-platform.d.ts +36 -0
  160. package/dist/node-platform.js +152 -0
  161. package/dist/node-rendered.d.ts +21 -0
  162. package/dist/node-rendered.js +26 -0
  163. package/dist/node-server.d.ts +46 -0
  164. package/dist/node-server.js +193 -0
  165. package/dist/not-found-page.d.ts +19 -0
  166. package/dist/not-found-page.js +74 -0
  167. package/dist/optimizer-cache-key.d.ts +26 -0
  168. package/dist/optimizer-cache-key.js +73 -0
  169. package/dist/own-package.d.ts +1 -0
  170. package/dist/own-package.js +6 -0
  171. package/dist/page-store.d.ts +33 -0
  172. package/dist/page-store.js +80 -0
  173. package/dist/page-timers.d.ts +22 -0
  174. package/dist/page-timers.js +47 -0
  175. package/dist/page.d.ts +112 -0
  176. package/dist/page.js +549 -0
  177. package/dist/paths.d.ts +13 -0
  178. package/dist/paths.js +47 -0
  179. package/dist/plugin.d.ts +23 -0
  180. package/dist/plugin.js +1006 -0
  181. package/dist/prerender-verdict.d.ts +8 -0
  182. package/dist/prerender-verdict.js +67 -0
  183. package/dist/project/context.d.ts +546 -0
  184. package/dist/project/context.js +111 -0
  185. package/dist/project/entries.d.ts +42 -0
  186. package/dist/project/entries.js +189 -0
  187. package/dist/project/env-worker.d.ts +1 -0
  188. package/dist/project/env-worker.js +9 -0
  189. package/dist/project/env.d.ts +36 -0
  190. package/dist/project/env.js +82 -0
  191. package/dist/project/layers.d.ts +31 -0
  192. package/dist/project/layers.js +150 -0
  193. package/dist/project/loaders.d.ts +71 -0
  194. package/dist/project/loaders.js +300 -0
  195. package/dist/project/metadata.d.ts +8 -0
  196. package/dist/project/metadata.js +34 -0
  197. package/dist/project/module-exports.d.ts +29 -0
  198. package/dist/project/module-exports.js +77 -0
  199. package/dist/project/routes.d.ts +19 -0
  200. package/dist/project/routes.js +92 -0
  201. package/dist/project/routing.d.ts +46 -0
  202. package/dist/project/routing.js +280 -0
  203. package/dist/project/transform.d.ts +8 -0
  204. package/dist/project/transform.js +110 -0
  205. package/dist/project/webpack.d.ts +65 -0
  206. package/dist/project/webpack.js +191 -0
  207. package/dist/project.d.ts +269 -0
  208. package/dist/project.js +58 -0
  209. package/dist/registry-global.d.ts +5 -0
  210. package/dist/registry-global.js +5 -0
  211. package/dist/registry.d.ts +241 -0
  212. package/dist/registry.js +30 -0
  213. package/dist/route-chunks.d.ts +13 -0
  214. package/dist/route-chunks.js +32 -0
  215. package/dist/route-lookup.d.ts +34 -0
  216. package/dist/route-lookup.js +207 -0
  217. package/dist/routes-ahead-shared.d.ts +17 -0
  218. package/dist/routes-ahead-shared.js +9 -0
  219. package/dist/routes-ahead.d.ts +10 -0
  220. package/dist/routes-ahead.js +54 -0
  221. package/dist/rsc.d.ts +19 -0
  222. package/dist/rsc.js +171 -0
  223. package/dist/server-action.d.ts +9 -0
  224. package/dist/server-action.js +15 -0
  225. package/dist/server-code.d.ts +176 -0
  226. package/dist/server-code.js +357 -0
  227. package/dist/server-in-front.d.ts +37 -0
  228. package/dist/server-in-front.js +90 -0
  229. package/dist/server-layers.d.ts +22 -0
  230. package/dist/server-layers.js +33 -0
  231. package/dist/setup-browser.d.ts +1 -0
  232. package/dist/setup-browser.js +8 -0
  233. package/dist/setup-node.d.ts +1 -0
  234. package/dist/setup-node.js +6 -0
  235. package/dist/setup.d.ts +8 -0
  236. package/dist/setup.js +62 -0
  237. package/dist/speed-features.d.ts +13 -0
  238. package/dist/speed-features.js +95 -0
  239. package/dist/ssr.d.ts +70 -0
  240. package/dist/ssr.js +480 -0
  241. package/dist/static-build.d.ts +36 -0
  242. package/dist/static-build.js +92 -0
  243. package/dist/storage.d.ts +31 -0
  244. package/dist/storage.js +94 -0
  245. package/dist/styles-shared.d.ts +137 -0
  246. package/dist/styles-shared.js +124 -0
  247. package/dist/styles.d.ts +102 -0
  248. package/dist/styles.js +730 -0
  249. package/dist/stylesheet-versions.d.ts +17 -0
  250. package/dist/stylesheet-versions.js +43 -0
  251. package/dist/tester.html +10 -0
  252. package/dist/use-cache.d.ts +15 -0
  253. package/dist/use-cache.js +93 -0
  254. package/dist/vitest-version.d.ts +6 -0
  255. package/dist/vitest-version.js +12 -0
  256. package/package.json +125 -3
@@ -0,0 +1,392 @@
1
+ import { EventEmitter } from "node:events";
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 mergeFns(...functions) {
5
+ return function(...args) {
6
+ for (const fn of functions) fn(...args);
7
+ };
8
+ }
9
+ /* @__NO_SIDE_EFFECTS__ */
10
+ function createNotImplementedError(name) {
11
+ return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
12
+ }
13
+ /* @__NO_SIDE_EFFECTS__ */
14
+ function notImplemented(name) {
15
+ const fn = () => {
16
+ throw /* @__PURE__ */ createNotImplementedError(name);
17
+ };
18
+ return Object.assign(fn, { __unenv__: true });
19
+ }
20
+ /* @__NO_SIDE_EFFECTS__ */
21
+ function notImplementedClass(name) {
22
+ return class {
23
+ __unenv__ = true;
24
+ constructor() {
25
+ throw new Error(`[unenv] ${name} is not implemented yet!`);
26
+ }
27
+ };
28
+ }
29
+ //#endregion
30
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/stream/readable.mjs
31
+ var _Readable = class _Readable extends EventEmitter {
32
+ __unenv__ = true;
33
+ readableEncoding = null;
34
+ readableEnded = true;
35
+ readableFlowing = false;
36
+ readableHighWaterMark = 0;
37
+ readableLength = 0;
38
+ readableObjectMode = false;
39
+ readableAborted = false;
40
+ readableDidRead = false;
41
+ closed = false;
42
+ errored = null;
43
+ readable = false;
44
+ destroyed = false;
45
+ static from(_iterable, options) {
46
+ return new _Readable(options);
47
+ }
48
+ constructor(_opts) {
49
+ super();
50
+ }
51
+ _read(_size) {}
52
+ read(_size) {}
53
+ setEncoding(_encoding) {
54
+ return this;
55
+ }
56
+ pause() {
57
+ return this;
58
+ }
59
+ resume() {
60
+ return this;
61
+ }
62
+ isPaused() {
63
+ return true;
64
+ }
65
+ unpipe(_destination) {
66
+ return this;
67
+ }
68
+ unshift(_chunk, _encoding) {}
69
+ wrap(_oldStream) {
70
+ return this;
71
+ }
72
+ push(_chunk, _encoding) {
73
+ return false;
74
+ }
75
+ _destroy(_error, _callback) {
76
+ this.removeAllListeners();
77
+ }
78
+ destroy(error) {
79
+ this.destroyed = true;
80
+ this._destroy(error);
81
+ return this;
82
+ }
83
+ pipe(_destenition, _options) {
84
+ return {};
85
+ }
86
+ compose(stream, options) {
87
+ throw new Error("[unenv] Method not implemented.");
88
+ }
89
+ [Symbol.asyncDispose]() {
90
+ this.destroy();
91
+ return Promise.resolve();
92
+ }
93
+ async *[Symbol.asyncIterator]() {
94
+ throw /* @__PURE__ */ createNotImplementedError("Readable.asyncIterator");
95
+ }
96
+ iterator(options) {
97
+ throw /* @__PURE__ */ createNotImplementedError("Readable.iterator");
98
+ }
99
+ map(fn, options) {
100
+ throw /* @__PURE__ */ createNotImplementedError("Readable.map");
101
+ }
102
+ filter(fn, options) {
103
+ throw /* @__PURE__ */ createNotImplementedError("Readable.filter");
104
+ }
105
+ forEach(fn, options) {
106
+ throw /* @__PURE__ */ createNotImplementedError("Readable.forEach");
107
+ }
108
+ reduce(fn, initialValue, options) {
109
+ throw /* @__PURE__ */ createNotImplementedError("Readable.reduce");
110
+ }
111
+ find(fn, options) {
112
+ throw /* @__PURE__ */ createNotImplementedError("Readable.find");
113
+ }
114
+ findIndex(fn, options) {
115
+ throw /* @__PURE__ */ createNotImplementedError("Readable.findIndex");
116
+ }
117
+ some(fn, options) {
118
+ throw /* @__PURE__ */ createNotImplementedError("Readable.some");
119
+ }
120
+ toArray(options) {
121
+ throw /* @__PURE__ */ createNotImplementedError("Readable.toArray");
122
+ }
123
+ every(fn, options) {
124
+ throw /* @__PURE__ */ createNotImplementedError("Readable.every");
125
+ }
126
+ flatMap(fn, options) {
127
+ throw /* @__PURE__ */ createNotImplementedError("Readable.flatMap");
128
+ }
129
+ drop(limit, options) {
130
+ throw /* @__PURE__ */ createNotImplementedError("Readable.drop");
131
+ }
132
+ take(limit, options) {
133
+ throw /* @__PURE__ */ createNotImplementedError("Readable.take");
134
+ }
135
+ asIndexedPairs(options) {
136
+ throw /* @__PURE__ */ createNotImplementedError("Readable.asIndexedPairs");
137
+ }
138
+ };
139
+ const Readable = globalThis.Readable || _Readable;
140
+ //#endregion
141
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/stream/writable.mjs
142
+ var _Writable = class extends EventEmitter {
143
+ __unenv__ = true;
144
+ writable = true;
145
+ writableEnded = false;
146
+ writableFinished = false;
147
+ writableHighWaterMark = 0;
148
+ writableLength = 0;
149
+ writableObjectMode = false;
150
+ writableCorked = 0;
151
+ closed = false;
152
+ errored = null;
153
+ writableNeedDrain = false;
154
+ destroyed = false;
155
+ _data;
156
+ _encoding = "utf-8";
157
+ constructor(_opts) {
158
+ super();
159
+ }
160
+ pipe(_destenition, _options) {
161
+ return {};
162
+ }
163
+ _write(chunk, encoding, callback) {
164
+ if (this.writableEnded) {
165
+ if (callback) callback();
166
+ return;
167
+ }
168
+ if (this._data === void 0) this._data = chunk;
169
+ else {
170
+ const a = typeof this._data === "string" ? Buffer.from(this._data, this._encoding || encoding || "utf8") : this._data;
171
+ const b = typeof chunk === "string" ? Buffer.from(chunk, encoding || this._encoding || "utf8") : chunk;
172
+ this._data = Buffer.concat([a, b]);
173
+ }
174
+ this._encoding = encoding;
175
+ if (callback) callback();
176
+ }
177
+ _writev(_chunks, _callback) {}
178
+ _destroy(_error, _callback) {}
179
+ _final(_callback) {}
180
+ write(chunk, arg2, arg3) {
181
+ const encoding = typeof arg2 === "string" ? this._encoding : "utf-8";
182
+ const cb = typeof arg2 === "function" ? arg2 : typeof arg3 === "function" ? arg3 : void 0;
183
+ this._write(chunk, encoding, cb);
184
+ return true;
185
+ }
186
+ setDefaultEncoding(_encoding) {
187
+ return this;
188
+ }
189
+ end(arg1, arg2, arg3) {
190
+ const callback = typeof arg1 === "function" ? arg1 : typeof arg2 === "function" ? arg2 : typeof arg3 === "function" ? arg3 : void 0;
191
+ if (this.writableEnded) {
192
+ if (callback) callback();
193
+ return this;
194
+ }
195
+ const data = arg1 === callback ? void 0 : arg1;
196
+ if (data) {
197
+ const encoding = arg2 === callback ? void 0 : arg2;
198
+ this.write(data, encoding, callback);
199
+ }
200
+ this.writableEnded = true;
201
+ this.writableFinished = true;
202
+ this.emit("close");
203
+ this.emit("finish");
204
+ return this;
205
+ }
206
+ cork() {}
207
+ uncork() {}
208
+ destroy(_error) {
209
+ this.destroyed = true;
210
+ delete this._data;
211
+ this.removeAllListeners();
212
+ return this;
213
+ }
214
+ compose(stream, options) {
215
+ throw new Error("[h3] Method not implemented.");
216
+ }
217
+ };
218
+ const Writable = globalThis.Writable || _Writable;
219
+ //#endregion
220
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/stream/duplex.mjs
221
+ const __Duplex = class {
222
+ allowHalfOpen = true;
223
+ _destroy;
224
+ constructor(readable = new Readable(), writable = new Writable()) {
225
+ Object.assign(this, readable);
226
+ Object.assign(this, writable);
227
+ this._destroy = /* @__PURE__ */ mergeFns(readable._destroy, writable._destroy);
228
+ }
229
+ };
230
+ function getDuplex() {
231
+ Object.assign(__Duplex.prototype, Readable.prototype);
232
+ Object.assign(__Duplex.prototype, Writable.prototype);
233
+ return __Duplex;
234
+ }
235
+ const _Duplex = /* @__PURE__ */ getDuplex();
236
+ const Duplex = globalThis.Duplex || _Duplex;
237
+ //#endregion
238
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/net/socket.mjs
239
+ var Socket = class extends Duplex {
240
+ __unenv__ = true;
241
+ bufferSize = 0;
242
+ bytesRead = 0;
243
+ bytesWritten = 0;
244
+ connecting = false;
245
+ destroyed = false;
246
+ pending = false;
247
+ localAddress = "";
248
+ localPort = 0;
249
+ remoteAddress = "";
250
+ remoteFamily = "";
251
+ remotePort = 0;
252
+ autoSelectFamilyAttemptedAddresses = [];
253
+ readyState = "readOnly";
254
+ constructor(_options) {
255
+ super();
256
+ }
257
+ write(_buffer, _arg1, _arg2) {
258
+ return false;
259
+ }
260
+ connect(_arg1, _arg2, _arg3) {
261
+ return this;
262
+ }
263
+ end(_arg1, _arg2, _arg3) {
264
+ return this;
265
+ }
266
+ setEncoding(_encoding) {
267
+ return this;
268
+ }
269
+ pause() {
270
+ return this;
271
+ }
272
+ resume() {
273
+ return this;
274
+ }
275
+ setTimeout(_timeout, _callback) {
276
+ return this;
277
+ }
278
+ setNoDelay(_noDelay) {
279
+ return this;
280
+ }
281
+ setKeepAlive(_enable, _initialDelay) {
282
+ return this;
283
+ }
284
+ address() {
285
+ return {};
286
+ }
287
+ unref() {
288
+ return this;
289
+ }
290
+ ref() {
291
+ return this;
292
+ }
293
+ destroySoon() {
294
+ this.destroy();
295
+ }
296
+ resetAndDestroy() {
297
+ const err = /* @__PURE__ */ new Error("ERR_SOCKET_CLOSED");
298
+ err.code = "ERR_SOCKET_CLOSED";
299
+ this.destroy(err);
300
+ return this;
301
+ }
302
+ };
303
+ var SocketAddress = class {
304
+ __unenv__ = true;
305
+ address;
306
+ family;
307
+ port;
308
+ flowlabel;
309
+ static parse(_address, _port) {}
310
+ constructor(options) {
311
+ this.address = options.address;
312
+ this.family = options.family;
313
+ this.port = options.port;
314
+ this.flowlabel = options.flowlabel;
315
+ }
316
+ };
317
+ //#endregion
318
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/internal/net/server.mjs
319
+ var Server = class extends EventEmitter {
320
+ __unenv__ = true;
321
+ maxConnections = 1;
322
+ connections = 0;
323
+ listening = false;
324
+ constructor(arg1, arg2) {
325
+ super();
326
+ }
327
+ listen() {
328
+ throw /* @__PURE__ */ createNotImplementedError("node:net.Server.listen()");
329
+ }
330
+ close(callback) {
331
+ throw /* @__PURE__ */ createNotImplementedError("node:net.Server.close()");
332
+ }
333
+ address() {
334
+ return null;
335
+ }
336
+ getConnections(cb) {
337
+ cb(null, 0);
338
+ }
339
+ ref() {
340
+ return this;
341
+ }
342
+ unref() {
343
+ return this;
344
+ }
345
+ [Symbol.asyncDispose]() {
346
+ return Promise.resolve();
347
+ }
348
+ };
349
+ //#endregion
350
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/net.mjs
351
+ const createServer = /* @__PURE__ */ notImplemented("net.createServer");
352
+ const BlockList = /* @__PURE__ */ notImplementedClass("net.BlockList");
353
+ const connect = /* @__PURE__ */ notImplemented("net.connect");
354
+ const createConnection = /* @__PURE__ */ notImplemented("net.createConnection");
355
+ const getDefaultAutoSelectFamily = /* @__PURE__ */ notImplemented("net.getDefaultAutoSelectFamily");
356
+ const setDefaultAutoSelectFamily = /* @__PURE__ */ notImplemented("net.setDefaultAutoSelectFamily");
357
+ const getDefaultAutoSelectFamilyAttemptTimeout = /* @__PURE__ */ notImplemented("net.getDefaultAutoSelectFamilyAttemptTimeout");
358
+ const setDefaultAutoSelectFamilyAttemptTimeout = /* @__PURE__ */ notImplemented("net.setDefaultAutoSelectFamilyAttemptTimeout");
359
+ const IPV4Regex = /^(?:\d{1,3}\.){3}\d{1,3}$/;
360
+ const isIPv4 = (host) => IPV4Regex.test(host);
361
+ const IPV6Regex = /^([\dA-Fa-f]{1,4}:){7}[\dA-Fa-f]{1,4}$/;
362
+ const isIPv6 = (host) => IPV6Regex.test(host);
363
+ const isIP = (host) => {
364
+ if (isIPv4(host)) return 4;
365
+ if (isIPv6(host)) return 6;
366
+ return 0;
367
+ };
368
+ const _createServerHandle = /* @__PURE__ */ notImplemented("net._createServerHandle");
369
+ const _normalizeArgs = /* @__PURE__ */ notImplemented("net._normalizeArgs");
370
+ const _setSimultaneousAccepts = /* @__PURE__ */ notImplemented("net._setSimultaneousAccepts");
371
+ const exports = {
372
+ Socket,
373
+ Stream: Socket,
374
+ Server,
375
+ BlockList,
376
+ SocketAddress,
377
+ createServer,
378
+ connect,
379
+ createConnection,
380
+ isIPv4,
381
+ isIPv6,
382
+ isIP,
383
+ getDefaultAutoSelectFamily,
384
+ getDefaultAutoSelectFamilyAttemptTimeout,
385
+ setDefaultAutoSelectFamily,
386
+ setDefaultAutoSelectFamilyAttemptTimeout,
387
+ _createServerHandle,
388
+ _normalizeArgs,
389
+ _setSimultaneousAccepts
390
+ };
391
+ //#endregion
392
+ export { BlockList, Server, Socket, Socket as Stream, SocketAddress, _createServerHandle, _normalizeArgs, _setSimultaneousAccepts, connect, createConnection, createServer, exports as default, getDefaultAutoSelectFamily, getDefaultAutoSelectFamilyAttemptTimeout, isIP, isIPv4, isIPv6, setDefaultAutoSelectFamily, setDefaultAutoSelectFamilyAttemptTimeout };
@@ -0,0 +1,259 @@
1
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/_internal/utils.mjs
2
+ /* @__NO_SIDE_EFFECTS__ */
3
+ function createNotImplementedError(name) {
4
+ return /* @__PURE__ */ new Error(`[unenv] ${name} is not implemented yet!`);
5
+ }
6
+ /* @__NO_SIDE_EFFECTS__ */
7
+ function notImplemented(name) {
8
+ const fn = () => {
9
+ throw /* @__PURE__ */ createNotImplementedError(name);
10
+ };
11
+ return Object.assign(fn, { __unenv__: true });
12
+ }
13
+ //#endregion
14
+ //#region ../../node_modules/.pnpm/unenv@2.0.0-rc.24/node_modules/unenv/dist/runtime/node/os.mjs
15
+ const constants = {
16
+ UV_UDP_REUSEADDR: 4,
17
+ dlopen: {
18
+ RTLD_LAZY: 1,
19
+ RTLD_NOW: 2,
20
+ RTLD_GLOBAL: 256,
21
+ RTLD_LOCAL: 0,
22
+ RTLD_DEEPBIND: 8
23
+ },
24
+ errno: {
25
+ E2BIG: 7,
26
+ EACCES: 13,
27
+ EADDRINUSE: 98,
28
+ EADDRNOTAVAIL: 99,
29
+ EAFNOSUPPORT: 97,
30
+ EAGAIN: 11,
31
+ EALREADY: 114,
32
+ EBADF: 9,
33
+ EBADMSG: 74,
34
+ EBUSY: 16,
35
+ ECANCELED: 125,
36
+ ECHILD: 10,
37
+ ECONNABORTED: 103,
38
+ ECONNREFUSED: 111,
39
+ ECONNRESET: 104,
40
+ EDEADLK: 35,
41
+ EDESTADDRREQ: 89,
42
+ EDOM: 33,
43
+ EDQUOT: 122,
44
+ EEXIST: 17,
45
+ EFAULT: 14,
46
+ EFBIG: 27,
47
+ EHOSTUNREACH: 113,
48
+ EIDRM: 43,
49
+ EILSEQ: 84,
50
+ EINPROGRESS: 115,
51
+ EINTR: 4,
52
+ EINVAL: 22,
53
+ EIO: 5,
54
+ EISCONN: 106,
55
+ EISDIR: 21,
56
+ ELOOP: 40,
57
+ EMFILE: 24,
58
+ EMLINK: 31,
59
+ EMSGSIZE: 90,
60
+ EMULTIHOP: 72,
61
+ ENAMETOOLONG: 36,
62
+ ENETDOWN: 100,
63
+ ENETRESET: 102,
64
+ ENETUNREACH: 101,
65
+ ENFILE: 23,
66
+ ENOBUFS: 105,
67
+ ENODATA: 61,
68
+ ENODEV: 19,
69
+ ENOENT: 2,
70
+ ENOEXEC: 8,
71
+ ENOLCK: 37,
72
+ ENOLINK: 67,
73
+ ENOMEM: 12,
74
+ ENOMSG: 42,
75
+ ENOPROTOOPT: 92,
76
+ ENOSPC: 28,
77
+ ENOSR: 63,
78
+ ENOSTR: 60,
79
+ ENOSYS: 38,
80
+ ENOTCONN: 107,
81
+ ENOTDIR: 20,
82
+ ENOTEMPTY: 39,
83
+ ENOTSOCK: 88,
84
+ ENOTSUP: 95,
85
+ ENOTTY: 25,
86
+ ENXIO: 6,
87
+ EOPNOTSUPP: 95,
88
+ EOVERFLOW: 75,
89
+ EPERM: 1,
90
+ EPIPE: 32,
91
+ EPROTO: 71,
92
+ EPROTONOSUPPORT: 93,
93
+ EPROTOTYPE: 91,
94
+ ERANGE: 34,
95
+ EROFS: 30,
96
+ ESPIPE: 29,
97
+ ESRCH: 3,
98
+ ESTALE: 116,
99
+ ETIME: 62,
100
+ ETIMEDOUT: 110,
101
+ ETXTBSY: 26,
102
+ EWOULDBLOCK: 11,
103
+ EXDEV: 18
104
+ },
105
+ signals: {
106
+ SIGHUP: 1,
107
+ SIGINT: 2,
108
+ SIGQUIT: 3,
109
+ SIGILL: 4,
110
+ SIGTRAP: 5,
111
+ SIGABRT: 6,
112
+ SIGIOT: 6,
113
+ SIGBUS: 7,
114
+ SIGFPE: 8,
115
+ SIGKILL: 9,
116
+ SIGUSR1: 10,
117
+ SIGSEGV: 11,
118
+ SIGUSR2: 12,
119
+ SIGPIPE: 13,
120
+ SIGALRM: 14,
121
+ SIGTERM: 15,
122
+ SIGCHLD: 17,
123
+ SIGSTKFLT: 16,
124
+ SIGCONT: 18,
125
+ SIGSTOP: 19,
126
+ SIGTSTP: 20,
127
+ SIGTTIN: 21,
128
+ SIGTTOU: 22,
129
+ SIGURG: 23,
130
+ SIGXCPU: 24,
131
+ SIGXFSZ: 25,
132
+ SIGVTALRM: 26,
133
+ SIGPROF: 27,
134
+ SIGWINCH: 28,
135
+ SIGIO: 29,
136
+ SIGPOLL: 29,
137
+ SIGPWR: 30,
138
+ SIGSYS: 31
139
+ },
140
+ priority: {
141
+ PRIORITY_LOW: 19,
142
+ PRIORITY_BELOW_NORMAL: 10,
143
+ PRIORITY_NORMAL: 0,
144
+ PRIORITY_ABOVE_NORMAL: -7,
145
+ PRIORITY_HIGH: -14,
146
+ PRIORITY_HIGHEST: -20
147
+ }
148
+ };
149
+ const NUM_CPUS = 8;
150
+ const availableParallelism = () => NUM_CPUS;
151
+ const arch = () => "";
152
+ const machine = () => "";
153
+ const endianness = () => "LE";
154
+ const cpus = () => {
155
+ const info = {
156
+ model: "",
157
+ speed: 0,
158
+ times: {
159
+ user: 0,
160
+ nice: 0,
161
+ sys: 0,
162
+ idle: 0,
163
+ irq: 0
164
+ }
165
+ };
166
+ return Array.from({ length: NUM_CPUS }, () => info);
167
+ };
168
+ const getPriority = () => 0;
169
+ const setPriority = /* @__PURE__ */ notImplemented("os.setPriority");
170
+ const homedir = () => "/";
171
+ const tmpdir = () => "/tmp";
172
+ const devNull = "/dev/null";
173
+ const freemem = () => 0;
174
+ const totalmem = () => 0;
175
+ const loadavg = () => [
176
+ 0,
177
+ 0,
178
+ 0
179
+ ];
180
+ const uptime = () => 0;
181
+ const hostname = () => "";
182
+ const networkInterfaces = () => {
183
+ return { lo0: [
184
+ {
185
+ address: "127.0.0.1",
186
+ netmask: "255.0.0.0",
187
+ family: "IPv4",
188
+ mac: "00:00:00:00:00:00",
189
+ internal: true,
190
+ cidr: "127.0.0.1/8"
191
+ },
192
+ {
193
+ address: "::1",
194
+ netmask: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff",
195
+ family: "IPv6",
196
+ mac: "00:00:00:00:00:00",
197
+ internal: true,
198
+ cidr: "::1/128",
199
+ scopeid: 0
200
+ },
201
+ {
202
+ address: "fe80::1",
203
+ netmask: "ffff:ffff:ffff:ffff::",
204
+ family: "IPv6",
205
+ mac: "00:00:00:00:00:00",
206
+ internal: true,
207
+ cidr: "fe80::1/64",
208
+ scopeid: 1
209
+ }
210
+ ] };
211
+ };
212
+ const platform = () => "linux";
213
+ const type = () => "Linux";
214
+ const release = () => "";
215
+ const version = () => "";
216
+ const userInfo = (opts) => {
217
+ const encode = (str) => {
218
+ if (opts?.encoding) {
219
+ const buff = Buffer.from(str);
220
+ return opts.encoding === "buffer" ? buff : buff.toString(opts.encoding);
221
+ }
222
+ return str;
223
+ };
224
+ return {
225
+ gid: 1e3,
226
+ uid: 1e3,
227
+ homedir: encode("/"),
228
+ shell: encode("/bin/sh"),
229
+ username: encode("root")
230
+ };
231
+ };
232
+ const EOL = "\n";
233
+ var os_default = {
234
+ arch,
235
+ availableParallelism,
236
+ constants,
237
+ cpus,
238
+ EOL: "\n",
239
+ endianness,
240
+ devNull,
241
+ freemem,
242
+ getPriority,
243
+ homedir,
244
+ hostname,
245
+ loadavg,
246
+ machine,
247
+ networkInterfaces,
248
+ platform,
249
+ release,
250
+ setPriority,
251
+ tmpdir,
252
+ totalmem,
253
+ type,
254
+ uptime,
255
+ userInfo,
256
+ version
257
+ };
258
+ //#endregion
259
+ export { EOL, arch, availableParallelism, constants, cpus, os_default as default, devNull, endianness, freemem, getPriority, homedir, hostname, loadavg, machine, networkInterfaces, platform, release, setPriority, tmpdir, totalmem, type, uptime, userInfo, version };
@@ -0,0 +1,25 @@
1
+ import path from "@kasperpeulen/vitest-plugin-nextjs/node/path";
2
+ //#region src/node/path/posix.ts
3
+ const missing = (name) => function() {
4
+ throw new Error(`vitest-plugin-rsc: ${name} of Node.js is not there in the browser`);
5
+ };
6
+ const own = path.posix;
7
+ const basename = own.basename ?? missing("path/posix.basename");
8
+ const dirname = own.dirname ?? missing("path/posix.dirname");
9
+ const extname = own.extname ?? missing("path/posix.extname");
10
+ const format = own.format ?? missing("path/posix.format");
11
+ const isAbsolute = own.isAbsolute ?? missing("path/posix.isAbsolute");
12
+ const join = own.join ?? missing("path/posix.join");
13
+ const normalize = own.normalize ?? missing("path/posix.normalize");
14
+ const parse = own.parse ?? missing("path/posix.parse");
15
+ const relative = own.relative ?? missing("path/posix.relative");
16
+ const resolve = own.resolve ?? missing("path/posix.resolve");
17
+ const toNamespacedPath = own.toNamespacedPath ?? missing("path/posix.toNamespacedPath");
18
+ const sep = own.sep ?? missing("path/posix.sep");
19
+ const delimiter = own.delimiter ?? missing("path/posix.delimiter");
20
+ const posix = own.posix ?? missing("path/posix.posix");
21
+ const win32 = own.win32 ?? missing("path/posix.win32");
22
+ const _makeLong = own._makeLong ?? missing("path/posix._makeLong");
23
+ const matchesGlob = own.matchesGlob ?? missing("path/posix.matchesGlob");
24
+ //#endregion
25
+ export { _makeLong, basename, own as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };
@@ -0,0 +1,25 @@
1
+ import path from "@kasperpeulen/vitest-plugin-nextjs/node/path";
2
+ //#region src/node/path/win32.ts
3
+ const missing = (name) => function() {
4
+ throw new Error(`vitest-plugin-rsc: ${name} of Node.js is not there in the browser`);
5
+ };
6
+ const own = path.win32;
7
+ const basename = own.basename ?? missing("path/win32.basename");
8
+ const dirname = own.dirname ?? missing("path/win32.dirname");
9
+ const extname = own.extname ?? missing("path/win32.extname");
10
+ const format = own.format ?? missing("path/win32.format");
11
+ const isAbsolute = own.isAbsolute ?? missing("path/win32.isAbsolute");
12
+ const join = own.join ?? missing("path/win32.join");
13
+ const normalize = own.normalize ?? missing("path/win32.normalize");
14
+ const parse = own.parse ?? missing("path/win32.parse");
15
+ const relative = own.relative ?? missing("path/win32.relative");
16
+ const resolve = own.resolve ?? missing("path/win32.resolve");
17
+ const toNamespacedPath = own.toNamespacedPath ?? missing("path/win32.toNamespacedPath");
18
+ const sep = own.sep ?? missing("path/win32.sep");
19
+ const delimiter = own.delimiter ?? missing("path/win32.delimiter");
20
+ const posix = own.posix ?? missing("path/win32.posix");
21
+ const win32 = own.win32 ?? missing("path/win32.win32");
22
+ const _makeLong = own._makeLong ?? missing("path/win32._makeLong");
23
+ const matchesGlob = own.matchesGlob ?? missing("path/win32.matchesGlob");
24
+ //#endregion
25
+ export { _makeLong, basename, own as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };