nitro-nightly 4.0.0-20251010-091516-7cafddba → 4.0.0-20251030-091344-d4418b98

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 (195) hide show
  1. package/dist/{_chunks/build2.mjs → _build/build.mjs} +108 -58
  2. package/dist/_build/build2.mjs +556 -0
  3. package/dist/_build/info.mjs +1002 -0
  4. package/dist/_build/prepare.mjs +1511 -0
  5. package/dist/_build/snapshot.mjs +185 -0
  6. package/dist/{_chunks/plugin.mjs → _build/vite.mjs} +295 -296
  7. package/dist/_build/vite2.mjs +149 -0
  8. package/dist/_chunks/_deps/@jridgewell/gen-mapping.mjs +189 -0
  9. package/dist/_chunks/_deps/@jridgewell/remapping.mjs +137 -0
  10. package/dist/_chunks/_deps/@jridgewell/resolve-uri.mjs +231 -0
  11. package/dist/_chunks/_deps/@jridgewell/sourcemap-codec.mjs +173 -0
  12. package/dist/_chunks/_deps/@jridgewell/trace-mapping.mjs +170 -0
  13. package/dist/_chunks/_deps/@pi0/vite-plugin-fullstack.mjs +575 -0
  14. package/dist/_chunks/_deps/@rollup/plugin-alias.mjs +89 -0
  15. package/dist/_chunks/_deps/@rollup/plugin-commonjs.mjs +2376 -0
  16. package/dist/_chunks/{index2.mjs → _deps/@rollup/plugin-inject.mjs} +5 -90
  17. package/dist/_chunks/_deps/@rollup/plugin-json.mjs +37 -0
  18. package/dist/_chunks/_deps/@rollup/plugin-node-resolve.mjs +1386 -0
  19. package/dist/_chunks/_deps/@rollup/plugin-replace.mjs +133 -0
  20. package/dist/_chunks/_deps/@rollup/pluginutils.mjs +346 -0
  21. package/dist/_chunks/_deps/acorn.mjs +6225 -0
  22. package/dist/_chunks/_deps/c12.mjs +510 -0
  23. package/dist/_chunks/_deps/chokidar.mjs +1428 -0
  24. package/dist/_chunks/_deps/citty.mjs +460 -0
  25. package/dist/_chunks/_deps/commondir.mjs +77 -0
  26. package/dist/_chunks/_deps/compatx.mjs +76 -0
  27. package/dist/_chunks/_deps/confbox.mjs +300 -0
  28. package/dist/_chunks/_deps/debug.mjs +885 -0
  29. package/dist/_chunks/_deps/deepmerge.mjs +147 -0
  30. package/dist/_chunks/_deps/depd.mjs +550 -0
  31. package/dist/_chunks/_deps/dot-prop.mjs +282 -0
  32. package/dist/_chunks/_deps/dotenv.mjs +555 -0
  33. package/dist/_chunks/_deps/duplexer.mjs +1 -0
  34. package/dist/_chunks/_deps/ee-first.mjs +104 -0
  35. package/dist/_chunks/_deps/encodeurl.mjs +69 -0
  36. package/dist/_chunks/_deps/escape-html.mjs +87 -0
  37. package/dist/_chunks/_deps/escape-string-regexp.mjs +13 -0
  38. package/dist/_chunks/_deps/estree-walker.mjs +433 -0
  39. package/dist/_chunks/_deps/etag.mjs +147 -0
  40. package/dist/_chunks/_deps/exsolve.mjs +1416 -0
  41. package/dist/_chunks/_deps/fdir.mjs +569 -0
  42. package/dist/_chunks/_deps/fresh.mjs +145 -0
  43. package/dist/_chunks/_deps/function-bind.mjs +106 -0
  44. package/dist/_chunks/{index4.mjs → _deps/giget.mjs} +21 -776
  45. package/dist/_chunks/_deps/gzip-size.mjs +19 -0
  46. package/dist/_chunks/_deps/hasown.mjs +19 -0
  47. package/dist/_chunks/_deps/http-errors.mjs +307 -0
  48. package/dist/_chunks/_deps/httpxy.mjs +580 -0
  49. package/dist/_chunks/_deps/inherits.mjs +57 -0
  50. package/dist/_chunks/_deps/is-core-module.mjs +596 -0
  51. package/dist/_chunks/_deps/is-module.mjs +25 -0
  52. package/dist/_chunks/_deps/is-reference.mjs +31 -0
  53. package/dist/_chunks/_deps/js-tokens.mjs +411 -0
  54. package/dist/_chunks/_deps/klona.mjs +137 -0
  55. package/dist/_chunks/_deps/knitwork.mjs +172 -0
  56. package/dist/_chunks/_deps/local-pkg.mjs +163 -0
  57. package/dist/_chunks/_deps/magic-string.mjs +1296 -0
  58. package/dist/_chunks/_deps/mime-db.mjs +11685 -0
  59. package/dist/_chunks/_deps/mime-types.mjs +287 -0
  60. package/dist/_chunks/_deps/mime.mjs +1172 -0
  61. package/dist/_chunks/_deps/mlly.mjs +2413 -0
  62. package/dist/_chunks/_deps/ms.mjs +172 -0
  63. package/dist/_chunks/_deps/node-fetch-native.mjs +3 -0
  64. package/dist/_chunks/_deps/nypm.mjs +219 -0
  65. package/dist/_chunks/_deps/on-finished.mjs +246 -0
  66. package/dist/_chunks/_deps/parseurl.mjs +168 -0
  67. package/dist/_chunks/_deps/path-parse.mjs +85 -0
  68. package/dist/_chunks/{pathe.M-eThtNZ.mjs → _deps/pathe.mjs} +48 -1
  69. package/dist/_chunks/_deps/perfect-debounce.mjs +88 -0
  70. package/dist/_chunks/_deps/picomatch.mjs +2144 -0
  71. package/dist/_chunks/_deps/pkg-types.mjs +247 -0
  72. package/dist/_chunks/{snapshot.mjs → _deps/pretty-bytes.mjs} +1 -105
  73. package/dist/_chunks/_deps/quansync.mjs +99 -0
  74. package/dist/_chunks/_deps/range-parser.mjs +171 -0
  75. package/dist/_chunks/_deps/rc9.mjs +219 -0
  76. package/dist/_chunks/_deps/readdirp.mjs +245 -0
  77. package/dist/_chunks/_deps/resolve.mjs +1260 -0
  78. package/dist/_chunks/_deps/rou3.mjs +326 -0
  79. package/dist/_chunks/_deps/send.mjs +1022 -0
  80. package/dist/_chunks/_deps/serve-static.mjs +228 -0
  81. package/dist/_chunks/_deps/setprototypeof.mjs +26 -0
  82. package/dist/_chunks/_deps/statuses.mjs +457 -0
  83. package/dist/_chunks/_deps/std-env.mjs +3 -0
  84. package/dist/_chunks/_deps/strip-literal.mjs +67 -0
  85. package/dist/_chunks/_deps/supports-color.mjs +44 -0
  86. package/dist/_chunks/_deps/tinyexec.mjs +552 -0
  87. package/dist/_chunks/_deps/tinyglobby.mjs +293 -0
  88. package/dist/_chunks/_deps/toidentifier.mjs +41 -0
  89. package/dist/_chunks/_deps/ultrahtml.mjs +3 -0
  90. package/dist/_chunks/_deps/unimport.mjs +2267 -0
  91. package/dist/_chunks/_deps/unplugin-utils.mjs +65 -0
  92. package/dist/_chunks/_deps/unplugin.mjs +1294 -0
  93. package/dist/_chunks/_deps/untyped.mjs +375 -0
  94. package/dist/_chunks/{info.mjs → _deps/unwasm.mjs} +8 -4206
  95. package/dist/_chunks/_deps/webpack-virtual-modules.mjs +360 -0
  96. package/dist/_chunks/_presets/_all.mjs +59 -0
  97. package/dist/_chunks/_presets/_nitro.mjs +74 -0
  98. package/dist/_chunks/_presets/_resolve.mjs +64 -0
  99. package/dist/_chunks/_presets/_static.mjs +69 -0
  100. package/dist/_chunks/_presets/_types.mjs +3 -0
  101. package/dist/_chunks/_presets/_utils.mjs +31 -0
  102. package/dist/_chunks/_presets/alwaysdata.mjs +17 -0
  103. package/dist/_chunks/_presets/aws-amplify.mjs +111 -0
  104. package/dist/_chunks/_presets/aws-lambda.mjs +23 -0
  105. package/dist/_chunks/_presets/azure.mjs +162 -0
  106. package/dist/_chunks/_presets/bun.mjs +19 -0
  107. package/dist/_chunks/_presets/cleavr.mjs +15 -0
  108. package/dist/_chunks/_presets/cloudflare.mjs +608 -0
  109. package/dist/_chunks/_presets/deno.mjs +196 -0
  110. package/dist/_chunks/_presets/digitalocean.mjs +14 -0
  111. package/dist/_chunks/_presets/firebase.mjs +47 -0
  112. package/dist/_chunks/_presets/flightcontrol.mjs +14 -0
  113. package/dist/_chunks/_presets/genezio.mjs +13 -0
  114. package/dist/_chunks/_presets/heroku.mjs +14 -0
  115. package/dist/_chunks/_presets/iis.mjs +194 -0
  116. package/dist/_chunks/_presets/index.mjs +62 -0
  117. package/dist/_chunks/_presets/koyeb.mjs +14 -0
  118. package/dist/_chunks/_presets/netlify.mjs +241 -0
  119. package/dist/_chunks/_presets/node.mjs +54 -0
  120. package/dist/_chunks/_presets/platform.mjs +14 -0
  121. package/dist/_chunks/_presets/render.mjs +14 -0
  122. package/dist/_chunks/_presets/standard.mjs +23 -0
  123. package/dist/_chunks/_presets/stormkit.mjs +18 -0
  124. package/dist/_chunks/_presets/vercel.mjs +375 -0
  125. package/dist/_chunks/_presets/winterjs.mjs +22 -0
  126. package/dist/_chunks/_presets/zeabur.mjs +69 -0
  127. package/dist/_chunks/_presets/zerops.mjs +27 -0
  128. package/dist/_chunks/app.mjs +9 -19206
  129. package/dist/_chunks/{index3.mjs → builder.mjs} +560 -970
  130. package/dist/_chunks/server.mjs +6 -4
  131. package/dist/{cli → _cli}/build.mjs +3 -8
  132. package/dist/{cli → _cli}/dev.mjs +38 -12
  133. package/dist/{cli/index2.mjs → _cli/index.mjs} +1 -2
  134. package/dist/{cli → _cli}/list.mjs +3 -4
  135. package/dist/{cli → _cli}/prepare.mjs +3 -4
  136. package/dist/{cli → _cli}/run.mjs +3 -4
  137. package/dist/{index.d.mts → builder.d.mts} +11 -11
  138. package/dist/builder.mjs +117 -0
  139. package/dist/cli/index.mjs +7 -464
  140. package/dist/node_modules/@speed-highlight/core/dist/index.js +1 -1
  141. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +1 -1
  142. package/dist/node_modules/@speed-highlight/core/package.json +7 -3
  143. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  144. package/dist/node_modules/cookie-es/package.json +37 -0
  145. package/dist/node_modules/hookable/dist/index.mjs +243 -266
  146. package/dist/node_modules/hookable/package.json +29 -26
  147. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  148. package/dist/node_modules/rendu/package.json +47 -0
  149. package/dist/presets/_nitro/runtime/nitro-dev.mjs +4 -7
  150. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +5 -4
  151. package/dist/presets/azure/runtime/azure-swa.mjs +1 -1
  152. package/dist/presets/cloudflare/runtime/_module-handler.mjs +7 -6
  153. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +4 -5
  154. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +7 -10
  155. package/dist/presets/cloudflare/runtime/shims/workers.dev.d.mts +21 -0
  156. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  157. package/dist/presets/node/runtime/node-server.mjs +1 -1
  158. package/dist/runtime/index.d.mts +1 -1
  159. package/dist/runtime/index.mjs +1 -1
  160. package/dist/runtime/internal/app.d.mts +3 -1
  161. package/dist/runtime/internal/app.mjs +90 -64
  162. package/dist/runtime/internal/error/prod.d.mts +3 -2
  163. package/dist/runtime/internal/error/prod.mjs +9 -13
  164. package/dist/runtime/internal/renderer.mjs +4 -4
  165. package/dist/runtime/internal/routes/dev-tasks.d.mts +30 -2
  166. package/dist/runtime/internal/shutdown.d.mts +1 -2
  167. package/dist/runtime/internal/shutdown.mjs +3 -2
  168. package/dist/runtime/internal/task.mjs +1 -2
  169. package/dist/types/index.d.mts +1603 -10
  170. package/dist/vite.d.mts +5 -0
  171. package/dist/vite.mjs +94 -30
  172. package/lib/index.mjs +1 -0
  173. package/lib/indexd.mts +1 -0
  174. package/lib/runtime/meta.mjs +35 -0
  175. package/package.json +40 -41
  176. package/dist/_chunks/build.mjs +0 -84
  177. package/dist/_chunks/build3.mjs +0 -6452
  178. package/dist/_chunks/detect-acorn.mjs +0 -503
  179. package/dist/_chunks/index.mjs +0 -22242
  180. package/dist/_chunks/json5.mjs +0 -68
  181. package/dist/_chunks/jsonc.mjs +0 -51
  182. package/dist/_chunks/toml.mjs +0 -259
  183. package/dist/_chunks/yaml.mjs +0 -86
  184. package/dist/index.mjs +0 -55
  185. package/dist/node_modules/klona/dist/index.mjs +0 -81
  186. package/dist/node_modules/klona/full/index.mjs +0 -53
  187. package/dist/node_modules/klona/package.json +0 -74
  188. package/dist/node_modules/std-env/dist/index.mjs +0 -1
  189. package/dist/node_modules/std-env/package.json +0 -46
  190. package/dist/presets.mjs +0 -2460
  191. package/dist/runtime/internal/debug.d.mts +0 -2
  192. package/dist/runtime/internal/debug.mjs +0 -5
  193. package/lib/runtime-meta.mjs +0 -38
  194. /package/dist/{cli → _cli}/common.mjs +0 -0
  195. /package/lib/{runtime-meta.d.mts → runtime/meta.d.mts} +0 -0
@@ -0,0 +1,360 @@
1
+ import require$$0 from 'constants';
2
+ import { a as getDefaultExportFromCjs } from './commondir.mjs';
3
+ import sysPath__default from 'path';
4
+
5
+ var virtualStats = {};
6
+
7
+ var hasRequiredVirtualStats;
8
+
9
+ function requireVirtualStats () {
10
+ if (hasRequiredVirtualStats) return virtualStats;
11
+ hasRequiredVirtualStats = 1;
12
+ var __importDefault = (virtualStats && virtualStats.__importDefault) || function (mod) {
13
+ return (mod && mod.__esModule) ? mod : { "default": mod };
14
+ };
15
+ Object.defineProperty(virtualStats, "__esModule", { value: true });
16
+ virtualStats.VirtualStats = void 0;
17
+ const constants_1 = __importDefault(require$$0);
18
+ class VirtualStats {
19
+ constructor(config) {
20
+ for (const key in config) {
21
+ if (!Object.prototype.hasOwnProperty.call(config, key)) {
22
+ continue;
23
+ }
24
+ this[key] = config[key];
25
+ }
26
+ }
27
+ _checkModeProperty(property) {
28
+ return (this.mode & constants_1.default.S_IFMT) === property;
29
+ }
30
+ isDirectory() {
31
+ return this._checkModeProperty(constants_1.default.S_IFDIR);
32
+ }
33
+ isFile() {
34
+ return this._checkModeProperty(constants_1.default.S_IFREG);
35
+ }
36
+ isBlockDevice() {
37
+ return this._checkModeProperty(constants_1.default.S_IFBLK);
38
+ }
39
+ isCharacterDevice() {
40
+ return this._checkModeProperty(constants_1.default.S_IFCHR);
41
+ }
42
+ isSymbolicLink() {
43
+ return this._checkModeProperty(constants_1.default.S_IFLNK);
44
+ }
45
+ isFIFO() {
46
+ return this._checkModeProperty(constants_1.default.S_IFIFO);
47
+ }
48
+ isSocket() {
49
+ return this._checkModeProperty(constants_1.default.S_IFSOCK);
50
+ }
51
+ }
52
+ virtualStats.VirtualStats = VirtualStats;
53
+
54
+ return virtualStats;
55
+ }
56
+
57
+ var lib;
58
+ var hasRequiredLib;
59
+
60
+ function requireLib () {
61
+ if (hasRequiredLib) return lib;
62
+ hasRequiredLib = 1;
63
+ var __importDefault = (lib && lib.__importDefault) || function (mod) {
64
+ return (mod && mod.__esModule) ? mod : { "default": mod };
65
+ };
66
+ const path_1 = __importDefault(sysPath__default);
67
+ const virtual_stats_1 = requireVirtualStats();
68
+ let inode = 45000000;
69
+ const ALL = 'all';
70
+ const STATIC = 'static';
71
+ const DYNAMIC = 'dynamic';
72
+ function checkActivation(instance) {
73
+ if (!instance._compiler) {
74
+ throw new Error('You must use this plugin only after creating webpack instance!');
75
+ }
76
+ }
77
+ function getModulePath(filePath, compiler) {
78
+ return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.join(compiler.context, filePath);
79
+ }
80
+ function createWebpackData(result) {
81
+ return (backendOrStorage) => {
82
+ if (backendOrStorage._data) {
83
+ const curLevelIdx = backendOrStorage._currentLevel;
84
+ const curLevel = backendOrStorage._levels[curLevelIdx];
85
+ return {
86
+ result,
87
+ level: curLevel,
88
+ };
89
+ }
90
+ return [null, result];
91
+ };
92
+ }
93
+ function getData(storage, key) {
94
+ if (storage._data instanceof Map) {
95
+ return storage._data.get(key);
96
+ }
97
+ else if (storage._data) {
98
+ return storage.data[key];
99
+ }
100
+ else if (storage.data instanceof Map) {
101
+ return storage.data.get(key);
102
+ }
103
+ else {
104
+ return storage.data[key];
105
+ }
106
+ }
107
+ function setData(backendOrStorage, key, valueFactory) {
108
+ const value = valueFactory(backendOrStorage);
109
+ if (backendOrStorage._data instanceof Map) {
110
+ backendOrStorage._data.set(key, value);
111
+ }
112
+ else if (backendOrStorage._data) {
113
+ backendOrStorage.data[key] = value;
114
+ }
115
+ else if (backendOrStorage.data instanceof Map) {
116
+ backendOrStorage.data.set(key, value);
117
+ }
118
+ else {
119
+ backendOrStorage.data[key] = value;
120
+ }
121
+ }
122
+ function getStatStorage(fileSystem) {
123
+ if (fileSystem._statStorage) {
124
+ return fileSystem._statStorage;
125
+ }
126
+ else if (fileSystem._statBackend) {
127
+ return fileSystem._statBackend;
128
+ }
129
+ else {
130
+ throw new Error("Couldn't find a stat storage");
131
+ }
132
+ }
133
+ function getFileStorage(fileSystem) {
134
+ if (fileSystem._readFileStorage) {
135
+ return fileSystem._readFileStorage;
136
+ }
137
+ else if (fileSystem._readFileBackend) {
138
+ return fileSystem._readFileBackend;
139
+ }
140
+ else {
141
+ throw new Error("Couldn't find a readFileStorage");
142
+ }
143
+ }
144
+ function getReadDirBackend(fileSystem) {
145
+ if (fileSystem._readdirBackend) {
146
+ return fileSystem._readdirBackend;
147
+ }
148
+ else if (fileSystem._readdirStorage) {
149
+ return fileSystem._readdirStorage;
150
+ }
151
+ else {
152
+ throw new Error("Couldn't find a readDirStorage from Webpack Internals");
153
+ }
154
+ }
155
+ function getRealpathBackend(fileSystem) {
156
+ if (fileSystem._realpathBackend) {
157
+ return fileSystem._realpathBackend;
158
+ }
159
+ }
160
+ class VirtualModulesPlugin {
161
+ constructor(modules) {
162
+ this._compiler = null;
163
+ this._watcher = null;
164
+ this._staticModules = modules || null;
165
+ }
166
+ getModuleList(filter = ALL) {
167
+ var _a, _b;
168
+ let modules = {};
169
+ const shouldGetStaticModules = filter === ALL || filter === STATIC;
170
+ const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC;
171
+ if (shouldGetStaticModules) {
172
+ modules = Object.assign(Object.assign({}, modules), this._staticModules);
173
+ }
174
+ if (shouldGetDynamicModules) {
175
+ const finalInputFileSystem = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.inputFileSystem;
176
+ const virtualFiles = (_b = finalInputFileSystem === null || finalInputFileSystem === void 0 ? void 0 : finalInputFileSystem._virtualFiles) !== null && _b !== void 0 ? _b : {};
177
+ const dynamicModules = {};
178
+ Object.keys(virtualFiles).forEach((key) => {
179
+ dynamicModules[key] = virtualFiles[key].contents;
180
+ });
181
+ modules = Object.assign(Object.assign({}, modules), dynamicModules);
182
+ }
183
+ return modules;
184
+ }
185
+ writeModule(filePath, contents) {
186
+ if (!this._compiler) {
187
+ throw new Error(`Plugin has not been initialized`);
188
+ }
189
+ checkActivation(this);
190
+ const len = contents ? contents.length : 0;
191
+ const time = Date.now();
192
+ const date = new Date(time);
193
+ const stats = new virtual_stats_1.VirtualStats({
194
+ dev: 8675309,
195
+ nlink: 0,
196
+ uid: 1000,
197
+ gid: 1000,
198
+ rdev: 0,
199
+ blksize: 4096,
200
+ ino: inode++,
201
+ mode: 33188,
202
+ size: len,
203
+ blocks: Math.floor(len / 4096),
204
+ atime: date,
205
+ mtime: date,
206
+ ctime: date,
207
+ birthtime: date,
208
+ });
209
+ const modulePath = getModulePath(filePath, this._compiler);
210
+ if (process.env.WVM_DEBUG)
211
+ console.log(this._compiler.name, 'Write virtual module:', modulePath, contents);
212
+ let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem;
213
+ while (finalWatchFileSystem && finalWatchFileSystem.wfs) {
214
+ finalWatchFileSystem = finalWatchFileSystem.wfs;
215
+ }
216
+ let finalInputFileSystem = this._compiler.inputFileSystem;
217
+ while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) {
218
+ finalInputFileSystem = finalInputFileSystem._inputFileSystem;
219
+ }
220
+ finalInputFileSystem._writeVirtualFile(modulePath, stats, contents);
221
+ if (finalWatchFileSystem &&
222
+ finalWatchFileSystem.watcher &&
223
+ (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length)) {
224
+ const fileWatchers = finalWatchFileSystem.watcher.fileWatchers instanceof Map
225
+ ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values())
226
+ : finalWatchFileSystem.watcher.fileWatchers;
227
+ for (let fileWatcher of fileWatchers) {
228
+ if ('watcher' in fileWatcher) {
229
+ fileWatcher = fileWatcher.watcher;
230
+ }
231
+ if (fileWatcher.path === modulePath) {
232
+ if (process.env.DEBUG)
233
+ console.log(this._compiler.name, 'Emit file change:', modulePath, time);
234
+ delete fileWatcher.directoryWatcher._cachedTimeInfoEntries;
235
+ fileWatcher.emit('change', time, null);
236
+ }
237
+ }
238
+ }
239
+ }
240
+ apply(compiler) {
241
+ this._compiler = compiler;
242
+ const afterEnvironmentHook = () => {
243
+ let finalInputFileSystem = compiler.inputFileSystem;
244
+ while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) {
245
+ finalInputFileSystem = finalInputFileSystem._inputFileSystem;
246
+ }
247
+ if (!finalInputFileSystem._writeVirtualFile) {
248
+ const originalPurge = finalInputFileSystem.purge;
249
+ finalInputFileSystem.purge = () => {
250
+ originalPurge.apply(finalInputFileSystem, []);
251
+ if (finalInputFileSystem._virtualFiles) {
252
+ Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => {
253
+ const data = finalInputFileSystem._virtualFiles[file];
254
+ finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents);
255
+ });
256
+ }
257
+ };
258
+ finalInputFileSystem._writeVirtualFile = (file, stats, contents) => {
259
+ const statStorage = getStatStorage(finalInputFileSystem);
260
+ const fileStorage = getFileStorage(finalInputFileSystem);
261
+ const readDirStorage = getReadDirBackend(finalInputFileSystem);
262
+ const realPathStorage = getRealpathBackend(finalInputFileSystem);
263
+ finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {};
264
+ finalInputFileSystem._virtualFiles[file] = { stats: stats, contents: contents };
265
+ setData(statStorage, file, createWebpackData(stats));
266
+ setData(fileStorage, file, createWebpackData(contents));
267
+ const segments = file.split(/[\\/]/);
268
+ let count = segments.length - 1;
269
+ const minCount = segments[0] ? 1 : 0;
270
+ while (count > minCount) {
271
+ const dir = segments.slice(0, count).join(path_1.default.sep) || path_1.default.sep;
272
+ try {
273
+ finalInputFileSystem.readdirSync(dir);
274
+ }
275
+ catch (e) {
276
+ const time = Date.now();
277
+ const dirStats = new virtual_stats_1.VirtualStats({
278
+ dev: 8675309,
279
+ nlink: 0,
280
+ uid: 1000,
281
+ gid: 1000,
282
+ rdev: 0,
283
+ blksize: 4096,
284
+ ino: inode++,
285
+ mode: 16877,
286
+ size: stats.size,
287
+ blocks: Math.floor(stats.size / 4096),
288
+ atime: time,
289
+ mtime: time,
290
+ ctime: time,
291
+ birthtime: time,
292
+ });
293
+ setData(readDirStorage, dir, createWebpackData([]));
294
+ if (realPathStorage) {
295
+ setData(realPathStorage, dir, createWebpackData(dir));
296
+ }
297
+ setData(statStorage, dir, createWebpackData(dirStats));
298
+ }
299
+ let dirData = getData(getReadDirBackend(finalInputFileSystem), dir);
300
+ dirData = dirData[1] || dirData.result;
301
+ const filename = segments[count];
302
+ if (dirData.indexOf(filename) < 0) {
303
+ const files = dirData.concat([filename]).sort();
304
+ setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files));
305
+ }
306
+ else {
307
+ break;
308
+ }
309
+ count--;
310
+ }
311
+ };
312
+ }
313
+ };
314
+ const afterResolversHook = () => {
315
+ if (this._staticModules) {
316
+ for (const [filePath, contents] of Object.entries(this._staticModules)) {
317
+ this.writeModule(filePath, contents);
318
+ }
319
+ this._staticModules = null;
320
+ }
321
+ };
322
+ const version = typeof compiler.webpack === 'undefined' ? 4 : 5;
323
+ const watchRunHook = (watcher, callback) => {
324
+ this._watcher = watcher.compiler || watcher;
325
+ const virtualFiles = compiler.inputFileSystem._virtualFiles;
326
+ const fts = compiler.fileTimestamps;
327
+ if (virtualFiles && fts && typeof fts.set === 'function') {
328
+ Object.keys(virtualFiles).forEach((file) => {
329
+ const mtime = +virtualFiles[file].stats.mtime;
330
+ fts.set(file, version === 4
331
+ ? mtime
332
+ : {
333
+ safeTime: mtime,
334
+ timestamp: mtime,
335
+ });
336
+ });
337
+ }
338
+ callback();
339
+ };
340
+ if (compiler.hooks) {
341
+ compiler.hooks.afterEnvironment.tap('VirtualModulesPlugin', afterEnvironmentHook);
342
+ compiler.hooks.afterResolvers.tap('VirtualModulesPlugin', afterResolversHook);
343
+ compiler.hooks.watchRun.tapAsync('VirtualModulesPlugin', watchRunHook);
344
+ }
345
+ else {
346
+ compiler.plugin('after-environment', afterEnvironmentHook);
347
+ compiler.plugin('after-resolvers', afterResolversHook);
348
+ compiler.plugin('watch-run', watchRunHook);
349
+ }
350
+ }
351
+ }
352
+ lib = VirtualModulesPlugin;
353
+
354
+ return lib;
355
+ }
356
+
357
+ var libExports = requireLib();
358
+ const VirtualModulesPlugin = /*@__PURE__*/getDefaultExportFromCjs(libExports);
359
+
360
+ export { VirtualModulesPlugin as V };
@@ -0,0 +1,59 @@
1
+ import { _ as _nitro } from './_nitro.mjs';
2
+ import { _ as _static } from './_static.mjs';
3
+ import { _ as _alwaysdata } from './alwaysdata.mjs';
4
+ import { _ as _awsAmplify } from './aws-amplify.mjs';
5
+ import { _ as _awsLambda } from './aws-lambda.mjs';
6
+ import { _ as _azure } from './azure.mjs';
7
+ import { _ as _bun } from './bun.mjs';
8
+ import { _ as _cleavr } from './cleavr.mjs';
9
+ import { _ as _cloudflare } from './cloudflare.mjs';
10
+ import { _ as _deno } from './deno.mjs';
11
+ import { _ as _digitalocean } from './digitalocean.mjs';
12
+ import { _ as _firebase } from './firebase.mjs';
13
+ import { _ as _flightcontrol } from './flightcontrol.mjs';
14
+ import { _ as _genezio } from './genezio.mjs';
15
+ import { _ as _heroku } from './heroku.mjs';
16
+ import { _ as _iis } from './iis.mjs';
17
+ import { _ as _koyeb } from './koyeb.mjs';
18
+ import { _ as _netlify } from './netlify.mjs';
19
+ import { _ as _node } from './node.mjs';
20
+ import { _ as _platformSh } from './platform.mjs';
21
+ import { _ as _renderCom } from './render.mjs';
22
+ import { _ as _standard } from './standard.mjs';
23
+ import { _ as _stormkit } from './stormkit.mjs';
24
+ import { _ as _vercel } from './vercel.mjs';
25
+ import { _ as _winterjs } from './winterjs.mjs';
26
+ import { _ as _zeabur } from './zeabur.mjs';
27
+ import { _ as _zerops } from './zerops.mjs';
28
+
29
+ const allPresets = [
30
+ ..._nitro,
31
+ ..._static,
32
+ ..._alwaysdata,
33
+ ..._awsAmplify,
34
+ ..._awsLambda,
35
+ ..._azure,
36
+ ..._bun,
37
+ ..._cleavr,
38
+ ..._cloudflare,
39
+ ..._deno,
40
+ ..._digitalocean,
41
+ ..._firebase,
42
+ ..._flightcontrol,
43
+ ..._genezio,
44
+ ..._heroku,
45
+ ..._iis,
46
+ ..._koyeb,
47
+ ..._netlify,
48
+ ..._node,
49
+ ..._platformSh,
50
+ ..._renderCom,
51
+ ..._standard,
52
+ ..._stormkit,
53
+ ..._vercel,
54
+ ..._winterjs,
55
+ ..._zeabur,
56
+ ..._zerops
57
+ ];
58
+
59
+ export { allPresets as a };
@@ -0,0 +1,74 @@
1
+ import { d as defineNitroPreset } from './_utils.mjs';
2
+ import { runtimeDir } from 'nitro/runtime/meta';
3
+ import { j as join } from '../_deps/pathe.mjs';
4
+
5
+ const baseWorker = defineNitroPreset(
6
+ {
7
+ entry: null,
8
+ // Abstract
9
+ node: false,
10
+ minify: true,
11
+ noExternals: true,
12
+ rollupConfig: {
13
+ output: {
14
+ format: "iife",
15
+ generatedCode: {
16
+ symbols: true
17
+ }
18
+ }
19
+ },
20
+ inlineDynamicImports: true
21
+ // iffe does not support code-splitting
22
+ },
23
+ {
24
+ name: "base-worker"
25
+ }
26
+ );
27
+ const worker = [baseWorker];
28
+
29
+ const nitroDev = defineNitroPreset(
30
+ {
31
+ entry: "./_nitro/runtime/nitro-dev",
32
+ output: {
33
+ dir: "{{ buildDir }}/dev",
34
+ serverDir: "{{ buildDir }}/dev",
35
+ publicDir: "{{ buildDir }}/dev"
36
+ },
37
+ handlers: [
38
+ {
39
+ route: "/_nitro/tasks/**",
40
+ lazy: true,
41
+ handler: join(runtimeDir, "internal/routes/dev-tasks")
42
+ }
43
+ ],
44
+ externals: { noTrace: true },
45
+ serveStatic: true,
46
+ inlineDynamicImports: true,
47
+ // externals plugin limitation
48
+ sourceMap: true
49
+ },
50
+ {
51
+ name: "nitro-dev",
52
+ dev: true
53
+ }
54
+ );
55
+ const dev = [nitroDev];
56
+
57
+ const nitroPrerender = defineNitroPreset(
58
+ {
59
+ entry: "./_nitro/runtime/nitro-prerenderer",
60
+ serveStatic: true,
61
+ output: {
62
+ serverDir: "{{ buildDir }}/prerender"
63
+ },
64
+ externals: { noTrace: true }
65
+ },
66
+ {
67
+ name: "nitro-prerender"
68
+ }
69
+ );
70
+ const prerender = [nitroPrerender];
71
+
72
+ const _nitro = [...worker, ...dev, ...prerender];
73
+
74
+ export { _nitro as _ };
@@ -0,0 +1,64 @@
1
+ import { r as resolveCompatibilityDatesFromEnv, f as formatCompatibilityDate } from '../_deps/compatx.mjs';
2
+ import { kebabCase } from 'scule';
3
+ import { p } from '../_deps/std-env.mjs';
4
+ import { a as allPresets } from './_all.mjs';
5
+
6
+ const _stdProviderMap = {
7
+ aws_amplify: "aws",
8
+ azure_static: "azure",
9
+ cloudflare_pages: "cloudflare"
10
+ };
11
+ async function resolvePreset(name, opts = {}) {
12
+ if (name === ".") {
13
+ return void 0;
14
+ }
15
+ const _name = kebabCase(name) || p;
16
+ const _compatDates = opts.compatibilityDate ? resolveCompatibilityDatesFromEnv(opts.compatibilityDate) : false;
17
+ const matches = allPresets.filter((preset2) => {
18
+ const names = [preset2._meta.name, preset2._meta.stdName, ...preset2._meta.aliases || []].filter(Boolean);
19
+ if (!names.includes(_name)) {
20
+ return false;
21
+ }
22
+ if (opts.dev && !preset2._meta.dev || !opts.dev && preset2._meta.dev) {
23
+ return false;
24
+ }
25
+ if (_compatDates) {
26
+ const _date = _compatDates[_stdProviderMap[preset2._meta.stdName]] || _compatDates[preset2._meta.stdName] || _compatDates[preset2._meta.name] || _compatDates.default;
27
+ if (_date && preset2._meta.compatibilityDate && new Date(preset2._meta.compatibilityDate) > new Date(_date)) {
28
+ return false;
29
+ }
30
+ }
31
+ return true;
32
+ }).sort((a, b) => {
33
+ const aDate = new Date(a._meta.compatibilityDate || 0);
34
+ const bDate = new Date(b._meta.compatibilityDate || 0);
35
+ return bDate > aDate ? 1 : -1;
36
+ });
37
+ const preset = matches.find(
38
+ (p) => (p._meta.static || false) === (opts?.static || false)
39
+ ) || matches[0];
40
+ if (typeof preset === "function") {
41
+ return preset();
42
+ }
43
+ if (!name && !preset) {
44
+ return opts?.static ? resolvePreset("static", opts) : resolvePreset("node-server", opts);
45
+ }
46
+ if (name && !preset) {
47
+ const options = allPresets.filter((p) => p._meta.name === name || p._meta.stdName === name || p._meta.aliases?.includes(name)).sort((a, b) => (a._meta.compatibilityDate || 0) > (b._meta.compatibilityDate || 0) ? 1 : -1);
48
+ if (options.length > 0) {
49
+ let msg = `Preset "${name}" cannot be resolved with current compatibilityDate: ${formatCompatibilityDate(_compatDates || "")}.
50
+
51
+ `;
52
+ for (const option of options) {
53
+ msg += `
54
+ - ${option._meta.name} (requires compatibilityDate >= ${option._meta.compatibilityDate})`;
55
+ }
56
+ const err = new Error(msg);
57
+ Error.captureStackTrace?.(err, resolvePreset);
58
+ throw err;
59
+ }
60
+ }
61
+ return preset;
62
+ }
63
+
64
+ export { resolvePreset as r };
@@ -0,0 +1,69 @@
1
+ import fsp from 'node:fs/promises';
2
+ import { d as defineNitroPreset } from './_utils.mjs';
3
+ import { j as join } from '../_deps/pathe.mjs';
4
+
5
+ const _static = defineNitroPreset(
6
+ {
7
+ static: true,
8
+ output: {
9
+ dir: "{{ rootDir }}/.output",
10
+ publicDir: "{{ output.dir }}/public"
11
+ },
12
+ prerender: {
13
+ crawlLinks: true
14
+ },
15
+ commands: {
16
+ preview: "npx serve ./public"
17
+ }
18
+ },
19
+ {
20
+ name: "static",
21
+ static: true
22
+ }
23
+ );
24
+ const githubPages = defineNitroPreset(
25
+ {
26
+ extends: "static",
27
+ commands: {
28
+ deploy: "npx gh-pages --dotfiles -d ./public"
29
+ },
30
+ prerender: {
31
+ routes: [
32
+ "/",
33
+ // https://docs.github.com/en/pages/getting-started-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site
34
+ "/404.html"
35
+ ]
36
+ },
37
+ hooks: {
38
+ async compiled(nitro) {
39
+ await fsp.writeFile(
40
+ join(nitro.options.output.publicDir, ".nojekyll"),
41
+ ""
42
+ );
43
+ }
44
+ }
45
+ },
46
+ {
47
+ name: "github-pages",
48
+ static: true
49
+ }
50
+ );
51
+ const gitlabPages = defineNitroPreset(
52
+ {
53
+ extends: "static",
54
+ prerender: {
55
+ routes: [
56
+ "/",
57
+ // https://docs.gitlab.com/ee/user/project/pages/introduction.html#custom-error-codes-pages
58
+ "/404.html"
59
+ ]
60
+ }
61
+ },
62
+ {
63
+ name: "gitlab-pages",
64
+ static: true
65
+ }
66
+ );
67
+ const _static$1 = [_static, githubPages, gitlabPages];
68
+
69
+ export { _static$1 as _ };
@@ -0,0 +1,3 @@
1
+ const presetsWithConfig = ["awsAmplify", "awsLambda", "azure", "cloudflare", "firebase", "netlify", "vercel"];
2
+
3
+ export { presetsWithConfig as p };
@@ -0,0 +1,31 @@
1
+ import { presetsDir } from 'nitro/runtime/meta';
2
+ import { resolve } from 'node:path';
3
+ import fsp from 'node:fs/promises';
4
+ import consola from 'consola';
5
+ import { colors } from 'consola/utils';
6
+ import { d as dirname, a as relative } from '../_deps/pathe.mjs';
7
+
8
+ function defineNitroPreset(preset, meta) {
9
+ if (typeof preset !== "function" && preset.entry && preset.entry.startsWith(".")) {
10
+ preset.entry = resolve(presetsDir, preset.entry);
11
+ }
12
+ return { ...preset, _meta: meta };
13
+ }
14
+
15
+ function prettyPath(p, highlight = true) {
16
+ p = relative(process.cwd(), p);
17
+ return highlight ? colors.cyan(p) : p;
18
+ }
19
+ async function writeFile(file, contents, log = false) {
20
+ await fsp.mkdir(dirname(file), { recursive: true });
21
+ await fsp.writeFile(
22
+ file,
23
+ contents,
24
+ typeof contents === "string" ? "utf8" : void 0
25
+ );
26
+ if (log) {
27
+ consola.info("Generated", prettyPath(file));
28
+ }
29
+ }
30
+
31
+ export { defineNitroPreset as d, writeFile as w };
@@ -0,0 +1,17 @@
1
+ import { d as defineNitroPreset } from './_utils.mjs';
2
+
3
+ const alwaysdata = defineNitroPreset(
4
+ {
5
+ extends: "node-server",
6
+ serveStatic: true,
7
+ commands: {
8
+ deploy: "rsync -rRt --info=progress2 ./ [account]@ssh-[account].alwaysdata.net:www/my-app"
9
+ }
10
+ },
11
+ {
12
+ name: "alwaysdata"
13
+ }
14
+ );
15
+ const _alwaysdata = [alwaysdata];
16
+
17
+ export { _alwaysdata as _ };