nitropack-nightly 2.10.0-28638117.48423122 → 3.0.0-beta-28638602.1fe7b893-nitro-nightly-mirror

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 (281) hide show
  1. package/README.md +3 -0
  2. package/cli.d.ts +1 -1
  3. package/config.d.ts +1 -1
  4. package/core.d.ts +1 -1
  5. package/dist/cli/index.d.mts +1 -1
  6. package/dist/cli/index.d.ts +1 -1
  7. package/dist/cli/index.mjs +1 -18
  8. package/dist/config/index.d.mts +1 -6
  9. package/dist/config/index.d.ts +1 -6
  10. package/dist/config/index.mjs +1 -5
  11. package/dist/core/index.d.mts +1 -69
  12. package/dist/core/index.d.ts +1 -69
  13. package/dist/core/index.mjs +1 -2436
  14. package/dist/kit/index.d.mts +1 -44
  15. package/dist/kit/index.d.ts +1 -44
  16. package/dist/kit/index.mjs +1 -71
  17. package/dist/meta/index.d.mts +1 -3
  18. package/dist/meta/index.d.ts +1 -3
  19. package/dist/meta/index.mjs +1 -3
  20. package/dist/presets/index.d.mts +1 -1
  21. package/dist/presets/index.d.ts +1 -2
  22. package/dist/presets/index.mjs +1 -1
  23. package/dist/rollup/index.d.mts +1 -5
  24. package/dist/rollup/index.d.ts +1 -5
  25. package/dist/rollup/index.mjs +1 -2033
  26. package/dist/runtime/index.d.mts +1 -0
  27. package/dist/runtime/index.d.ts +1 -12
  28. package/dist/runtime/index.mjs +1 -17
  29. package/dist/types/index.d.mts +1 -260
  30. package/dist/types/index.d.ts +1 -260
  31. package/dist/types/index.mjs +1 -1
  32. package/kit.d.ts +1 -1
  33. package/meta.d.ts +1 -1
  34. package/package.json +6 -172
  35. package/presets.d.ts +1 -1
  36. package/rollup.d.ts +1 -1
  37. package/runtime-meta.d.ts +1 -4
  38. package/runtime-meta.mjs +1 -30
  39. package/runtime.d.ts +1 -1
  40. package/types.d.ts +1 -1
  41. package/dist/cli/build.mjs +0 -47
  42. package/dist/cli/common.mjs +0 -13
  43. package/dist/cli/dev.mjs +0 -63
  44. package/dist/cli/index2.mjs +0 -14
  45. package/dist/cli/list.mjs +0 -28
  46. package/dist/cli/prepare.mjs +0 -21
  47. package/dist/cli/run.mjs +0 -57
  48. package/dist/presets/_all.gen.d.ts +0 -2
  49. package/dist/presets/_all.gen.mjs +0 -52
  50. package/dist/presets/_nitro/base-worker.d.ts +0 -2
  51. package/dist/presets/_nitro/base-worker.mjs +0 -25
  52. package/dist/presets/_nitro/nitro-dev.d.ts +0 -2
  53. package/dist/presets/_nitro/nitro-dev.mjs +0 -19
  54. package/dist/presets/_nitro/nitro-prerender.d.ts +0 -2
  55. package/dist/presets/_nitro/nitro-prerender.mjs +0 -17
  56. package/dist/presets/_nitro/preset.d.ts +0 -2
  57. package/dist/presets/_nitro/preset.mjs +0 -5
  58. package/dist/presets/_nitro/runtime/nitro-dev.d.ts +0 -1
  59. package/dist/presets/_nitro/runtime/nitro-dev.mjs +0 -86
  60. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.ts +0 -3
  61. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +0 -7
  62. package/dist/presets/_nitro/runtime/service-worker.d.ts +0 -1
  63. package/dist/presets/_nitro/runtime/service-worker.mjs +0 -31
  64. package/dist/presets/_nitro/service-worker.d.ts +0 -2
  65. package/dist/presets/_nitro/service-worker.mjs +0 -110
  66. package/dist/presets/_resolve.d.ts +0 -8
  67. package/dist/presets/_resolve.mjs +0 -44
  68. package/dist/presets/_static/preset.d.ts +0 -2
  69. package/dist/presets/_static/preset.mjs +0 -69
  70. package/dist/presets/_types.gen.d.ts +0 -16
  71. package/dist/presets/_types.gen.mjs +0 -0
  72. package/dist/presets/alwaysdata/preset.d.ts +0 -2
  73. package/dist/presets/alwaysdata/preset.mjs +0 -14
  74. package/dist/presets/aws-amplify/preset.d.ts +0 -3
  75. package/dist/presets/aws-amplify/preset.mjs +0 -27
  76. package/dist/presets/aws-amplify/runtime/aws-amplify.d.ts +0 -1
  77. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +0 -13
  78. package/dist/presets/aws-amplify/types.d.ts +0 -141
  79. package/dist/presets/aws-amplify/types.mjs +0 -0
  80. package/dist/presets/aws-amplify/utils.d.ts +0 -2
  81. package/dist/presets/aws-amplify/utils.mjs +0 -82
  82. package/dist/presets/aws-lambda/preset.d.ts +0 -2
  83. package/dist/presets/aws-lambda/preset.mjs +0 -21
  84. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.ts +0 -15
  85. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +0 -53
  86. package/dist/presets/aws-lambda/runtime/aws-lambda.d.ts +0 -4
  87. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +0 -45
  88. package/dist/presets/azure/preset.d.ts +0 -3
  89. package/dist/presets/azure/preset.mjs +0 -44
  90. package/dist/presets/azure/runtime/azure-functions.d.ts +0 -5
  91. package/dist/presets/azure/runtime/azure-functions.mjs +0 -22
  92. package/dist/presets/azure/runtime/azure-swa.d.ts +0 -5
  93. package/dist/presets/azure/runtime/azure-swa.mjs +0 -28
  94. package/dist/presets/azure/types.d.ts +0 -13
  95. package/dist/presets/azure/types.mjs +0 -0
  96. package/dist/presets/azure/utils.d.ts +0 -3
  97. package/dist/presets/azure/utils.mjs +0 -183
  98. package/dist/presets/bun/preset.d.ts +0 -2
  99. package/dist/presets/bun/preset.mjs +0 -17
  100. package/dist/presets/bun/runtime/bun.d.ts +0 -1
  101. package/dist/presets/bun/runtime/bun.mjs +0 -32
  102. package/dist/presets/cleavr/preset.d.ts +0 -2
  103. package/dist/presets/cleavr/preset.mjs +0 -12
  104. package/dist/presets/cloudflare/preset.d.ts +0 -3
  105. package/dist/presets/cloudflare/preset.mjs +0 -145
  106. package/dist/presets/cloudflare/runtime/cloudflare-module.d.ts +0 -13
  107. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +0 -104
  108. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.ts +0 -20
  109. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +0 -56
  110. package/dist/presets/cloudflare/runtime/cloudflare-worker.d.ts +0 -1
  111. package/dist/presets/cloudflare/runtime/cloudflare-worker.mjs +0 -64
  112. package/dist/presets/cloudflare/types.d.ts +0 -89
  113. package/dist/presets/cloudflare/types.mjs +0 -0
  114. package/dist/presets/cloudflare/types.wrangler.d.ts +0 -974
  115. package/dist/presets/cloudflare/types.wrangler.mjs +0 -0
  116. package/dist/presets/cloudflare/utils.d.ts +0 -3
  117. package/dist/presets/cloudflare/utils.mjs +0 -163
  118. package/dist/presets/deno/preset.d.ts +0 -2
  119. package/dist/presets/deno/preset.mjs +0 -151
  120. package/dist/presets/deno/runtime/deno-deploy.d.ts +0 -1
  121. package/dist/presets/deno/runtime/deno-deploy.mjs +0 -31
  122. package/dist/presets/deno/runtime/deno-server.d.ts +0 -3
  123. package/dist/presets/deno/runtime/deno-server.mjs +0 -65
  124. package/dist/presets/digitalocean/preset.d.ts +0 -2
  125. package/dist/presets/digitalocean/preset.mjs +0 -11
  126. package/dist/presets/edgio/preset.d.ts +0 -2
  127. package/dist/presets/edgio/preset.mjs +0 -95
  128. package/dist/presets/firebase/preset.d.ts +0 -3
  129. package/dist/presets/firebase/preset.mjs +0 -51
  130. package/dist/presets/firebase/runtime/firebase-gen-1.d.ts +0 -2
  131. package/dist/presets/firebase/runtime/firebase-gen-1.mjs +0 -8
  132. package/dist/presets/firebase/runtime/firebase-gen-2.d.ts +0 -2
  133. package/dist/presets/firebase/runtime/firebase-gen-2.mjs +0 -15
  134. package/dist/presets/firebase/runtime/firebase-gen-default.d.ts +0 -1
  135. package/dist/presets/firebase/runtime/firebase-gen-default.mjs +0 -1
  136. package/dist/presets/firebase/types.d.ts +0 -37
  137. package/dist/presets/firebase/types.mjs +0 -0
  138. package/dist/presets/firebase/utils.d.ts +0 -3
  139. package/dist/presets/firebase/utils.mjs +0 -50
  140. package/dist/presets/flightcontrol/preset.d.ts +0 -2
  141. package/dist/presets/flightcontrol/preset.mjs +0 -11
  142. package/dist/presets/heroku/preset.d.ts +0 -2
  143. package/dist/presets/heroku/preset.mjs +0 -11
  144. package/dist/presets/iis/preset.d.ts +0 -2
  145. package/dist/presets/iis/preset.mjs +0 -32
  146. package/dist/presets/iis/utils.d.ts +0 -3
  147. package/dist/presets/iis/utils.mjs +0 -159
  148. package/dist/presets/koyeb/preset.d.ts +0 -2
  149. package/dist/presets/koyeb/preset.mjs +0 -11
  150. package/dist/presets/netlify/legacy/preset.d.ts +0 -2
  151. package/dist/presets/netlify/legacy/preset.mjs +0 -145
  152. package/dist/presets/netlify/legacy/runtime/netlify-builder.d.ts +0 -2
  153. package/dist/presets/netlify/legacy/runtime/netlify-builder.mjs +0 -4
  154. package/dist/presets/netlify/legacy/runtime/netlify-edge.d.ts +0 -2
  155. package/dist/presets/netlify/legacy/runtime/netlify-edge.mjs +0 -25
  156. package/dist/presets/netlify/legacy/runtime/netlify-lambda.d.ts +0 -3
  157. package/dist/presets/netlify/legacy/runtime/netlify-lambda.mjs +0 -38
  158. package/dist/presets/netlify/legacy/runtime/netlify.d.ts +0 -3
  159. package/dist/presets/netlify/legacy/runtime/netlify.mjs +0 -21
  160. package/dist/presets/netlify/legacy/utils.d.ts +0 -4
  161. package/dist/presets/netlify/legacy/utils.mjs +0 -113
  162. package/dist/presets/netlify/preset.d.ts +0 -3
  163. package/dist/presets/netlify/preset.mjs +0 -130
  164. package/dist/presets/netlify/runtime/netlify-edge.d.ts +0 -2
  165. package/dist/presets/netlify/runtime/netlify-edge.mjs +0 -25
  166. package/dist/presets/netlify/runtime/netlify.d.ts +0 -3
  167. package/dist/presets/netlify/runtime/netlify.mjs +0 -53
  168. package/dist/presets/netlify/types.d.ts +0 -12
  169. package/dist/presets/netlify/types.mjs +0 -0
  170. package/dist/presets/netlify/utils.d.ts +0 -5
  171. package/dist/presets/netlify/utils.mjs +0 -94
  172. package/dist/presets/node/preset.d.ts +0 -2
  173. package/dist/presets/node/preset.mjs +0 -49
  174. package/dist/presets/node/runtime/cli.d.ts +0 -1
  175. package/dist/presets/node/runtime/cli.mjs +0 -21
  176. package/dist/presets/node/runtime/cluster.d.ts +0 -1
  177. package/dist/presets/node/runtime/cluster.mjs +0 -58
  178. package/dist/presets/node/runtime/node-listener.d.ts +0 -6
  179. package/dist/presets/node/runtime/node-listener.mjs +0 -13
  180. package/dist/presets/node/runtime/node-server.d.ts +0 -3
  181. package/dist/presets/node/runtime/node-server.mjs +0 -43
  182. package/dist/presets/platform.sh/preset.d.ts +0 -2
  183. package/dist/presets/platform.sh/preset.mjs +0 -11
  184. package/dist/presets/render.com/preset.d.ts +0 -2
  185. package/dist/presets/render.com/preset.mjs +0 -11
  186. package/dist/presets/stormkit/preset.d.ts +0 -2
  187. package/dist/presets/stormkit/preset.mjs +0 -15
  188. package/dist/presets/stormkit/runtime/stormkit.d.ts +0 -21
  189. package/dist/presets/stormkit/runtime/stormkit.mjs +0 -32
  190. package/dist/presets/vercel/preset.d.ts +0 -3
  191. package/dist/presets/vercel/preset.mjs +0 -104
  192. package/dist/presets/vercel/runtime/vercel-edge.d.ts +0 -2
  193. package/dist/presets/vercel/runtime/vercel-edge.mjs +0 -22
  194. package/dist/presets/vercel/runtime/vercel.d.ts +0 -4
  195. package/dist/presets/vercel/runtime/vercel.mjs +0 -17
  196. package/dist/presets/vercel/types.d.ts +0 -78
  197. package/dist/presets/vercel/types.mjs +0 -0
  198. package/dist/presets/vercel/utils.d.ts +0 -5
  199. package/dist/presets/vercel/utils.mjs +0 -186
  200. package/dist/presets/winterjs/preset.d.ts +0 -2
  201. package/dist/presets/winterjs/preset.mjs +0 -20
  202. package/dist/presets/winterjs/runtime/winterjs.d.ts +0 -1
  203. package/dist/presets/winterjs/runtime/winterjs.mjs +0 -69
  204. package/dist/presets/zeabur/preset.d.ts +0 -2
  205. package/dist/presets/zeabur/preset.mjs +0 -70
  206. package/dist/presets/zeabur/runtime/zeabur.d.ts +0 -4
  207. package/dist/presets/zeabur/runtime/zeabur.mjs +0 -8
  208. package/dist/runtime/app.d.ts +0 -2
  209. package/dist/runtime/app.mjs +0 -1
  210. package/dist/runtime/cache.d.ts +0 -1
  211. package/dist/runtime/cache.mjs +0 -6
  212. package/dist/runtime/config.d.ts +0 -1
  213. package/dist/runtime/config.mjs +0 -1
  214. package/dist/runtime/context.d.ts +0 -1
  215. package/dist/runtime/context.mjs +0 -1
  216. package/dist/runtime/database.d.ts +0 -1
  217. package/dist/runtime/database.mjs +0 -1
  218. package/dist/runtime/error.d.ts +0 -1
  219. package/dist/runtime/error.mjs +0 -1
  220. package/dist/runtime/internal/app.d.ts +0 -3
  221. package/dist/runtime/internal/app.mjs +0 -152
  222. package/dist/runtime/internal/cache.d.ts +0 -8
  223. package/dist/runtime/internal/cache.mjs +0 -329
  224. package/dist/runtime/internal/client.d.ts +0 -1
  225. package/dist/runtime/internal/client.mjs +0 -4
  226. package/dist/runtime/internal/config.d.ts +0 -6
  227. package/dist/runtime/internal/config.mjs +0 -58
  228. package/dist/runtime/internal/context.d.ts +0 -12
  229. package/dist/runtime/internal/context.mjs +0 -17
  230. package/dist/runtime/internal/database.d.ts +0 -2
  231. package/dist/runtime/internal/database.mjs +0 -14
  232. package/dist/runtime/internal/debug.d.ts +0 -2
  233. package/dist/runtime/internal/debug.mjs +0 -5
  234. package/dist/runtime/internal/error.d.ts +0 -4
  235. package/dist/runtime/internal/error.mjs +0 -71
  236. package/dist/runtime/internal/lib/http-graceful-shutdown.d.ts +0 -16
  237. package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +0 -213
  238. package/dist/runtime/internal/meta.d.ts +0 -2
  239. package/dist/runtime/internal/meta.mjs +0 -3
  240. package/dist/runtime/internal/plugin.d.ts +0 -3
  241. package/dist/runtime/internal/plugin.mjs +0 -4
  242. package/dist/runtime/internal/polyfill/deno-env.d.ts +0 -0
  243. package/dist/runtime/internal/polyfill/deno-env.mjs +0 -1
  244. package/dist/runtime/internal/renderer.d.ts +0 -2
  245. package/dist/runtime/internal/renderer.mjs +0 -38
  246. package/dist/runtime/internal/route-rules.d.ts +0 -14
  247. package/dist/runtime/internal/route-rules.mjs +0 -67
  248. package/dist/runtime/internal/routes/openapi.d.ts +0 -3
  249. package/dist/runtime/internal/routes/openapi.mjs +0 -85
  250. package/dist/runtime/internal/routes/scalar.d.ts +0 -2
  251. package/dist/runtime/internal/routes/scalar.mjs +0 -191
  252. package/dist/runtime/internal/routes/swagger.d.ts +0 -2
  253. package/dist/runtime/internal/routes/swagger.mjs +0 -39
  254. package/dist/runtime/internal/shutdown.d.ts +0 -10
  255. package/dist/runtime/internal/shutdown.mjs +0 -34
  256. package/dist/runtime/internal/static.d.ts +0 -2
  257. package/dist/runtime/internal/static.mjs +0 -89
  258. package/dist/runtime/internal/storage.d.ts +0 -2
  259. package/dist/runtime/internal/storage.mjs +0 -5
  260. package/dist/runtime/internal/task.d.ts +0 -17
  261. package/dist/runtime/internal/task.mjs +0 -73
  262. package/dist/runtime/internal/timing.d.ts +0 -2
  263. package/dist/runtime/internal/timing.mjs +0 -29
  264. package/dist/runtime/internal/utils.azure.d.ts +0 -2
  265. package/dist/runtime/internal/utils.azure.mjs +0 -51
  266. package/dist/runtime/internal/utils.d.ts +0 -23
  267. package/dist/runtime/internal/utils.env.d.ts +0 -7
  268. package/dist/runtime/internal/utils.env.mjs +0 -39
  269. package/dist/runtime/internal/utils.lambda.d.ts +0 -12
  270. package/dist/runtime/internal/utils.lambda.mjs +0 -30
  271. package/dist/runtime/internal/utils.mjs +0 -129
  272. package/dist/runtime/plugin.d.ts +0 -1
  273. package/dist/runtime/plugin.mjs +0 -1
  274. package/dist/runtime/storage.d.ts +0 -1
  275. package/dist/runtime/storage.mjs +0 -1
  276. package/dist/runtime/task.d.ts +0 -1
  277. package/dist/runtime/task.mjs +0 -1
  278. package/dist/runtime/utils.d.ts +0 -1
  279. package/dist/runtime/utils.mjs +0 -1
  280. package/dist/shared/nitro.DkCt8MDS.d.mts +0 -588
  281. package/dist/shared/nitro.DkCt8MDS.d.ts +0 -588
File without changes
@@ -1,3 +0,0 @@
1
- import type { Nitro } from "nitropack/types";
2
- export declare function writeFirebaseConfig(nitro: Nitro): Promise<void>;
3
- export declare function updatePackageJSON(nitro: Nitro): Promise<void>;
@@ -1,50 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- import { join, relative } from "pathe";
3
- import { readPackageJSON, writePackageJSON } from "pkg-types";
4
- import { writeFile } from "nitropack/kit";
5
- export async function writeFirebaseConfig(nitro) {
6
- const firebaseConfigPath = join(nitro.options.rootDir, "firebase.json");
7
- if (existsSync(firebaseConfigPath)) {
8
- return;
9
- }
10
- const firebaseConfig = {
11
- functions: {
12
- source: relative(nitro.options.rootDir, nitro.options.output.serverDir)
13
- },
14
- hosting: [
15
- {
16
- site: "<your_project_id>",
17
- public: relative(nitro.options.rootDir, nitro.options.output.publicDir),
18
- cleanUrls: true,
19
- rewrites: [
20
- {
21
- source: "**",
22
- function: "server"
23
- }
24
- ]
25
- }
26
- ]
27
- };
28
- await writeFile(firebaseConfigPath, JSON.stringify(firebaseConfig, null, 2));
29
- }
30
- export async function updatePackageJSON(nitro) {
31
- const packageJSONPath = join(nitro.options.output.serverDir, "package.json");
32
- const packageJSON = await readPackageJSON(packageJSONPath);
33
- await writePackageJSON(packageJSONPath, {
34
- ...packageJSON,
35
- main: "index.mjs",
36
- dependencies: Object.fromEntries(
37
- Object.entries({
38
- // Default to "latest" normally they should be overridden with user versions
39
- "firebase-admin": "latest",
40
- "firebase-functions": "latest",
41
- ...packageJSON.dependencies
42
- }).filter((e) => e[0] !== "fsevents").sort(([a], [b]) => a.localeCompare(b))
43
- ),
44
- engines: {
45
- // https://cloud.google.com/functions/docs/concepts/nodejs-runtime
46
- // const supportedNodeVersions = new Set(["20", "18", "16"]);
47
- node: nitro.options.firebase?.nodeVersion || "18"
48
- }
49
- });
50
- }
@@ -1,2 +0,0 @@
1
- declare const _default: readonly [any];
2
- export default _default;
@@ -1,11 +0,0 @@
1
- import { defineNitroPreset } from "nitropack/kit";
2
- const flightControl = defineNitroPreset(
3
- {
4
- extends: "node-server"
5
- },
6
- {
7
- name: "flight-control",
8
- url: import.meta.url
9
- }
10
- );
11
- export default [flightControl];
@@ -1,2 +0,0 @@
1
- declare const _default: readonly [any];
2
- export default _default;
@@ -1,11 +0,0 @@
1
- import { defineNitroPreset } from "nitropack/kit";
2
- const heroku = defineNitroPreset(
3
- {
4
- extends: "node-server"
5
- },
6
- {
7
- name: "heroku",
8
- url: import.meta.url
9
- }
10
- );
11
- export default [heroku];
@@ -1,2 +0,0 @@
1
- declare const _default: readonly [any, any];
2
- export default _default;
@@ -1,32 +0,0 @@
1
- import { defineNitroPreset } from "nitropack/kit";
2
- import { writeIISFiles, writeIISNodeFiles } from "./utils.mjs";
3
- const iisHandler = defineNitroPreset(
4
- {
5
- extends: "node-server",
6
- hooks: {
7
- async compiled(nitro) {
8
- await writeIISFiles(nitro);
9
- }
10
- }
11
- },
12
- {
13
- name: "iis-handler",
14
- aliases: ["iis"],
15
- url: import.meta.url
16
- }
17
- );
18
- const iisNode = defineNitroPreset(
19
- {
20
- extends: "node-server",
21
- hooks: {
22
- async compiled(nitro) {
23
- await writeIISNodeFiles(nitro);
24
- }
25
- }
26
- },
27
- {
28
- name: "iis-node",
29
- url: import.meta.url
30
- }
31
- );
32
- export default [iisHandler, iisNode];
@@ -1,3 +0,0 @@
1
- import type { Nitro } from "nitropack/types";
2
- export declare function writeIISFiles(nitro: Nitro): Promise<void>;
3
- export declare function writeIISNodeFiles(nitro: Nitro): Promise<void>;
@@ -1,159 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { defu } from "defu";
3
- import { writeFile } from "nitropack/kit";
4
- import { resolve } from "pathe";
5
- import { existsSync } from "node:fs";
6
- export async function writeIISFiles(nitro) {
7
- await writeFile(
8
- resolve(nitro.options.output.dir, "web.config"),
9
- await iisXmlTemplate(nitro)
10
- );
11
- }
12
- export async function writeIISNodeFiles(nitro) {
13
- await writeFile(
14
- resolve(nitro.options.output.dir, "web.config"),
15
- await iisnodeXmlTemplate(nitro)
16
- );
17
- await writeFile(
18
- resolve(nitro.options.output.dir, "index.js"),
19
- /*js */
20
- `
21
- if (process.env.PORT.startsWith('\\\\')) {
22
- process.env.NITRO_UNIX_SOCKET = process.env.PORT
23
- delete process.env.PORT
24
- }
25
- import('./server/index.mjs');
26
- `
27
- );
28
- }
29
- async function iisnodeXmlTemplate(nitro) {
30
- const path = resolve(nitro.options.rootDir, "web.config");
31
- const originalString = (
32
- /* xml */
33
- `<?xml version="1.0" encoding="utf-8"?>
34
- <!--
35
- This configuration file is required if iisnode is used to run node processes behind
36
- IIS or IIS Express. For more information, visit:
37
- https://github.com/Azure/iisnode/blob/master/src/samples/configuration/web.config
38
- -->
39
- <configuration>
40
- <system.webServer>
41
- <!-- Visit http://blogs.msdn.com/b/windowsazure/archive/2013/11/14/introduction-to-websockets-on-windows-azure-web-sites.aspx for more information on WebSocket support -->
42
- <webSocket enabled="false" />
43
- <handlers>
44
- <!-- Indicates that the index.js file is a Node.js site to be handled by the iisnode module -->
45
- <add name="iisnode" path="index.js" verb="*" modules="iisnode" />
46
- </handlers>
47
- <rewrite>
48
- <rules>
49
- <!-- Do not interfere with requests for node-inspector debugging -->
50
- <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
51
- <match url="^index.js/debug[/]?" />
52
- </rule>
53
-
54
- <!-- First we consider whether the incoming URL matches a physical file in the /public folder -->
55
- <rule name="StaticContent">
56
- <action type="Rewrite" url="public{PATH_INFO}" />
57
- </rule>
58
-
59
- <!-- All other URLs are mapped to the Node.js site entrypoint -->
60
- <rule name="DynamicContent">
61
- <conditions>
62
- <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True" />
63
- </conditions>
64
- <action type="Rewrite" url="index.js" />
65
- </rule>
66
- </rules>
67
- </rewrite>
68
-
69
- <!-- 'bin' directory has no special meaning in Node.js and apps can be placed in it -->
70
- <security>
71
- <requestFiltering>
72
- <hiddenSegments>
73
- <remove segment="bin" />
74
- </hiddenSegments>
75
- <requestLimits maxAllowedContentLength="4294967295" />
76
- </requestFiltering>
77
- </security>
78
-
79
- <!-- Make sure error responses are left untouched -->
80
- <httpErrors existingResponse="PassThrough" />
81
-
82
- <!--
83
- You can control how Node is hosted within IIS using the following options:
84
- * watchedFiles: semi-colon separated list of files that will be watched for changes to restart the server
85
- * node_env: will be propagated to node as NODE_ENV environment variable
86
- * debuggingEnabled - controls whether the built-in debugger is enabled
87
- See https://github.com/Azure/iisnode/blob/master/src/samples/configuration/web.config for a full list of options
88
- -->
89
- <iisnode
90
- watchedFiles="index.js"
91
- node_env="production"
92
- debuggingEnabled="false"
93
- loggingEnabled="false"
94
- />
95
- </system.webServer>
96
- </configuration>
97
- `
98
- );
99
- if (existsSync(path)) {
100
- const fileString = await readFile(path, "utf8");
101
- const originalWebConfig = await parseXmlDoc(originalString);
102
- const fileWebConfig = await parseXmlDoc(fileString);
103
- if (nitro.options.iis?.mergeConfig && !nitro.options.iis.overrideConfig) {
104
- return buildNewXmlDoc(defu(fileWebConfig, originalWebConfig));
105
- } else if (nitro.options.iis?.overrideConfig) {
106
- return buildNewXmlDoc({ ...fileWebConfig });
107
- }
108
- }
109
- return originalString;
110
- }
111
- async function iisXmlTemplate(nitro) {
112
- const path = resolve(nitro.options.rootDir, "web.config");
113
- const originalString = (
114
- /* xml */
115
- `<?xml version="1.0" encoding="UTF-8"?>
116
- <configuration>
117
- <system.webServer>
118
- <handlers>
119
- <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" requireAccess="Script" />
120
- </handlers>
121
- <httpPlatform stdoutLogEnabled="true" stdoutLogFile=".\\logs\\node.log" startupTimeLimit="20" processPath="C:\\Program Files\\nodejs\\node.exe" arguments=".\\server\\index.mjs">
122
- <environmentVariables>
123
- <environmentVariable name="PORT" value="%HTTP_PLATFORM_PORT%" />
124
- <environmentVariable name="NODE_ENV" value="Production" />
125
- </environmentVariables>
126
- </httpPlatform>
127
- </system.webServer>
128
- </configuration>
129
- `
130
- );
131
- if (existsSync(path)) {
132
- const fileString = await readFile(path, "utf8");
133
- const originalWebConfig = await parseXmlDoc(originalString);
134
- const fileWebConfig = await parseXmlDoc(fileString);
135
- if (nitro.options.iis?.mergeConfig && !nitro.options.iis.overrideConfig) {
136
- return buildNewXmlDoc(defu(fileWebConfig, originalWebConfig));
137
- } else if (nitro.options.iis?.overrideConfig) {
138
- return buildNewXmlDoc({ ...fileWebConfig });
139
- }
140
- }
141
- return originalString;
142
- }
143
- async function parseXmlDoc(xml) {
144
- const { Parser } = await import("xml2js");
145
- if (xml === void 0 || !xml) {
146
- return {};
147
- }
148
- const parser = new Parser({ explicitArray: false });
149
- let parsedRecord = {};
150
- parser.parseString(xml, (_, r) => {
151
- parsedRecord = r;
152
- });
153
- return parsedRecord;
154
- }
155
- async function buildNewXmlDoc(xmlObj) {
156
- const { Builder } = await import("xml2js");
157
- const builder = new Builder();
158
- return builder.buildObject({ ...xmlObj });
159
- }
@@ -1,2 +0,0 @@
1
- declare const _default: readonly [any];
2
- export default _default;
@@ -1,11 +0,0 @@
1
- import { defineNitroPreset } from "nitropack/kit";
2
- const koyeb = defineNitroPreset(
3
- {
4
- extends: "node-server"
5
- },
6
- {
7
- name: "koyeb",
8
- url: import.meta.url
9
- }
10
- );
11
- export default [koyeb];
@@ -1,2 +0,0 @@
1
- declare const _default: readonly [any, any, any, any];
2
- export default _default;
@@ -1,145 +0,0 @@
1
- import { promises as fsp } from "node:fs";
2
- import { join, dirname } from "pathe";
3
- import { defineNitroPreset } from "nitropack/kit";
4
- import { deprecateSWR, writeHeaders, writeRedirects } from "./utils.mjs";
5
- const netlify = defineNitroPreset(
6
- {
7
- extends: "aws-lambda",
8
- entry: "./runtime/netlify",
9
- output: {
10
- dir: "{{ rootDir }}/.netlify/functions-internal",
11
- publicDir: "{{ rootDir }}/dist"
12
- },
13
- rollupConfig: {
14
- output: {
15
- entryFileNames: "server.mjs"
16
- }
17
- },
18
- hooks: {
19
- "rollup:before": (nitro) => {
20
- deprecateSWR(nitro);
21
- },
22
- async compiled(nitro) {
23
- await writeHeaders(nitro);
24
- await writeRedirects(nitro);
25
- if (nitro.options.netlify) {
26
- const configPath = join(
27
- nitro.options.output.dir,
28
- "../deploy/v1/config.json"
29
- );
30
- await fsp.mkdir(dirname(configPath), { recursive: true });
31
- await fsp.writeFile(
32
- configPath,
33
- JSON.stringify(nitro.options.netlify),
34
- "utf8"
35
- );
36
- }
37
- const functionConfig = {
38
- config: { nodeModuleFormat: "esm" },
39
- version: 1
40
- };
41
- const functionConfigPath = join(
42
- nitro.options.output.serverDir,
43
- "server.json"
44
- );
45
- await fsp.writeFile(functionConfigPath, JSON.stringify(functionConfig));
46
- }
47
- }
48
- },
49
- {
50
- name: "netlify-legacy",
51
- aliases: ["netlify"],
52
- url: import.meta.url
53
- }
54
- );
55
- const netlifyBuilder = defineNitroPreset(
56
- {
57
- extends: "netlify",
58
- entry: "./runtime/netlify-builder",
59
- hooks: {
60
- "rollup:before": (nitro) => {
61
- deprecateSWR(nitro);
62
- }
63
- }
64
- },
65
- {
66
- name: "netlify-builder",
67
- url: import.meta.url
68
- }
69
- );
70
- const netlifyEdge = defineNitroPreset(
71
- {
72
- extends: "base-worker",
73
- entry: "./runtime/netlify-edge",
74
- exportConditions: ["netlify"],
75
- output: {
76
- serverDir: "{{ rootDir }}/.netlify/edge-functions/server",
77
- publicDir: "{{ rootDir }}/dist"
78
- },
79
- rollupConfig: {
80
- output: {
81
- entryFileNames: "server.js",
82
- format: "esm"
83
- }
84
- },
85
- unenv: {
86
- polyfill: ["nitropack/runtime/internal/polyfill/deno-env"]
87
- },
88
- hooks: {
89
- "rollup:before": (nitro) => {
90
- deprecateSWR(nitro);
91
- },
92
- async compiled(nitro) {
93
- await writeHeaders(nitro);
94
- await writeRedirects(nitro);
95
- const manifest = {
96
- version: 1,
97
- functions: [
98
- {
99
- path: "/*",
100
- name: "nitro server handler",
101
- function: "server",
102
- generator: `${nitro.options.framework.name}@${nitro.options.framework.version}`
103
- }
104
- ]
105
- };
106
- const manifestPath = join(
107
- nitro.options.rootDir,
108
- ".netlify/edge-functions/manifest.json"
109
- );
110
- await fsp.mkdir(dirname(manifestPath), { recursive: true });
111
- await fsp.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
112
- }
113
- }
114
- },
115
- {
116
- name: "netlify-edge",
117
- url: import.meta.url
118
- }
119
- );
120
- const netlifyStatic = defineNitroPreset(
121
- {
122
- extends: "static",
123
- output: {
124
- publicDir: "{{ rootDir }}/dist"
125
- },
126
- commands: {
127
- preview: "npx serve ./static"
128
- },
129
- hooks: {
130
- "rollup:before": (nitro) => {
131
- deprecateSWR(nitro);
132
- },
133
- async compiled(nitro) {
134
- await writeHeaders(nitro);
135
- await writeRedirects(nitro);
136
- }
137
- }
138
- },
139
- {
140
- name: "netlify-static",
141
- url: import.meta.url,
142
- static: true
143
- }
144
- );
145
- export default [netlify, netlifyBuilder, netlifyEdge, netlifyStatic];
@@ -1,2 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- export declare const handler: import("@netlify/functions").Handler;
@@ -1,4 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import { builder } from "@netlify/functions";
3
- import { lambda } from "./netlify-lambda.mjs";
4
- export const handler = builder(lambda);
@@ -1,2 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- export default function netlifyEdge(request: Request, _context: any): Promise<any>;
@@ -1,25 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitropack/runtime";
3
- import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
4
- const nitroApp = useNitroApp();
5
- export default async function netlifyEdge(request, _context) {
6
- const url = new URL(request.url);
7
- if (isPublicAssetURL(url.pathname)) {
8
- return;
9
- }
10
- if (!request.headers.has("x-forwarded-proto") && url.protocol === "https:") {
11
- request.headers.set("x-forwarded-proto", "https");
12
- }
13
- let body;
14
- if (request.body) {
15
- body = await request.arrayBuffer();
16
- }
17
- return nitroApp.localFetch(url.pathname + url.search, {
18
- host: url.hostname,
19
- protocol: url.protocol,
20
- headers: request.headers,
21
- method: request.method,
22
- redirect: request.redirect,
23
- body
24
- });
25
- }
@@ -1,3 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import type { HandlerResponse, HandlerContext, HandlerEvent } from "@netlify/functions";
3
- export declare function lambda(event: HandlerEvent, context: HandlerContext): Promise<HandlerResponse>;
@@ -1,38 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import { useNitroApp } from "nitropack/runtime";
3
- import { normalizeCookieHeader } from "nitropack/runtime/internal/utils";
4
- import {
5
- normalizeLambdaIncomingHeaders,
6
- normalizeLambdaOutgoingBody,
7
- normalizeLambdaOutgoingHeaders
8
- } from "nitropack/runtime/internal/utils.lambda";
9
- import { withQuery } from "ufo";
10
- const nitroApp = useNitroApp();
11
- export async function lambda(event, context) {
12
- const query = {
13
- ...event.queryStringParameters,
14
- ...event.multiValueQueryStringParameters
15
- };
16
- const url = withQuery(event.path, query);
17
- const method = event.httpMethod || "get";
18
- const r = await nitroApp.localCall({
19
- event,
20
- url,
21
- context,
22
- headers: normalizeLambdaIncomingHeaders(event.headers),
23
- method,
24
- query,
25
- body: event.isBase64Encoded ? Buffer.from(event.body || "", "base64") : event.body
26
- });
27
- const cookies = normalizeCookieHeader(String(r.headers["set-cookie"]));
28
- const awsBody = await normalizeLambdaOutgoingBody(r.body, r.headers);
29
- return {
30
- statusCode: r.status,
31
- headers: normalizeLambdaOutgoingHeaders(r.headers, true),
32
- body: awsBody.body,
33
- isBase64Encoded: awsBody.type === "binary",
34
- ...cookies.length > 0 && {
35
- multiValueHeaders: { "set-cookie": cookies }
36
- }
37
- };
38
- }
@@ -1,3 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import type { Handler } from "@netlify/functions/dist/main";
3
- export declare const handler: Handler;
@@ -1,21 +0,0 @@
1
- import "#nitro-internal-pollyfills";
2
- import { getRouteRulesForPath } from "nitropack/runtime/internal/route-rules";
3
- import { withQuery } from "ufo";
4
- import { lambda } from "./netlify-lambda.mjs";
5
- export const handler = async function handler2(event, context) {
6
- const query = {
7
- ...event.queryStringParameters,
8
- ...event.multiValueQueryStringParameters
9
- };
10
- const url = withQuery(event.path, query);
11
- const routeRules = getRouteRulesForPath(url);
12
- if (routeRules.isr) {
13
- const builder = await import("@netlify/functions").then(
14
- (r) => r.builder || r.default.builder
15
- );
16
- const ttl = typeof routeRules.isr === "number" ? routeRules.isr : false;
17
- const builderHandler = ttl ? (event2, context2) => lambda(event2, context2).then((r) => ({ ...r, ttl })) : lambda;
18
- return builder(builderHandler)(event, context);
19
- }
20
- return lambda(event, context);
21
- };
@@ -1,4 +0,0 @@
1
- import type { Nitro } from "nitropack/types";
2
- export declare function writeRedirects(nitro: Nitro): Promise<void>;
3
- export declare function writeHeaders(nitro: Nitro): Promise<void>;
4
- export declare function deprecateSWR(nitro: Nitro): void;