nitropack-nightly 2.10.0-28638494.93d002b7 → 3.0.0-beta-28638629.b32e0831-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.
- package/README.md +1 -1
- package/cli.d.ts +1 -1
- package/config.d.ts +1 -1
- package/core.d.ts +1 -1
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.mjs +1 -18
- package/dist/config/index.d.mts +1 -6
- package/dist/config/index.d.ts +1 -6
- package/dist/config/index.mjs +1 -5
- package/dist/core/index.d.mts +1 -69
- package/dist/core/index.d.ts +1 -69
- package/dist/core/index.mjs +1 -2435
- package/dist/kit/index.d.mts +1 -44
- package/dist/kit/index.d.ts +1 -44
- package/dist/kit/index.mjs +1 -71
- package/dist/meta/index.d.mts +1 -3
- package/dist/meta/index.d.ts +1 -3
- package/dist/meta/index.mjs +1 -3
- package/dist/presets/index.d.mts +1 -1
- package/dist/presets/index.d.ts +1 -2
- package/dist/presets/index.mjs +1 -1
- package/dist/rollup/index.d.mts +1 -5
- package/dist/rollup/index.d.ts +1 -5
- package/dist/rollup/index.mjs +1 -2033
- package/dist/runtime/index.d.mts +1 -0
- package/dist/runtime/index.d.ts +1 -12
- package/dist/runtime/index.mjs +1 -17
- package/dist/types/index.d.mts +1 -260
- package/dist/types/index.d.ts +1 -260
- package/dist/types/index.mjs +1 -1
- package/kit.d.ts +1 -1
- package/meta.d.ts +1 -1
- package/package.json +6 -172
- package/presets.d.ts +1 -1
- package/rollup.d.ts +1 -1
- package/runtime-meta.d.ts +1 -4
- package/runtime-meta.mjs +1 -30
- package/runtime.d.ts +1 -1
- package/types.d.ts +1 -1
- package/dist/cli/build.mjs +0 -47
- package/dist/cli/common.mjs +0 -13
- package/dist/cli/dev.mjs +0 -63
- package/dist/cli/index2.mjs +0 -14
- package/dist/cli/list.mjs +0 -28
- package/dist/cli/prepare.mjs +0 -21
- package/dist/cli/run.mjs +0 -57
- package/dist/presets/_all.gen.d.ts +0 -2
- package/dist/presets/_all.gen.mjs +0 -52
- package/dist/presets/_nitro/base-worker.d.ts +0 -2
- package/dist/presets/_nitro/base-worker.mjs +0 -25
- package/dist/presets/_nitro/nitro-dev.d.ts +0 -2
- package/dist/presets/_nitro/nitro-dev.mjs +0 -19
- package/dist/presets/_nitro/nitro-prerender.d.ts +0 -2
- package/dist/presets/_nitro/nitro-prerender.mjs +0 -17
- package/dist/presets/_nitro/preset.d.ts +0 -2
- package/dist/presets/_nitro/preset.mjs +0 -5
- package/dist/presets/_nitro/runtime/nitro-dev.d.ts +0 -1
- package/dist/presets/_nitro/runtime/nitro-dev.mjs +0 -86
- package/dist/presets/_nitro/runtime/nitro-prerenderer.d.ts +0 -3
- package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +0 -7
- package/dist/presets/_nitro/runtime/service-worker.d.ts +0 -1
- package/dist/presets/_nitro/runtime/service-worker.mjs +0 -31
- package/dist/presets/_nitro/service-worker.d.ts +0 -2
- package/dist/presets/_nitro/service-worker.mjs +0 -110
- package/dist/presets/_resolve.d.ts +0 -8
- package/dist/presets/_resolve.mjs +0 -44
- package/dist/presets/_static/preset.d.ts +0 -2
- package/dist/presets/_static/preset.mjs +0 -69
- package/dist/presets/_types.gen.d.ts +0 -16
- package/dist/presets/_types.gen.mjs +0 -0
- package/dist/presets/alwaysdata/preset.d.ts +0 -2
- package/dist/presets/alwaysdata/preset.mjs +0 -14
- package/dist/presets/aws-amplify/preset.d.ts +0 -3
- package/dist/presets/aws-amplify/preset.mjs +0 -27
- package/dist/presets/aws-amplify/runtime/aws-amplify.d.ts +0 -1
- package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +0 -13
- package/dist/presets/aws-amplify/types.d.ts +0 -141
- package/dist/presets/aws-amplify/types.mjs +0 -0
- package/dist/presets/aws-amplify/utils.d.ts +0 -2
- package/dist/presets/aws-amplify/utils.mjs +0 -82
- package/dist/presets/aws-lambda/preset.d.ts +0 -2
- package/dist/presets/aws-lambda/preset.mjs +0 -21
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.ts +0 -15
- package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +0 -53
- package/dist/presets/aws-lambda/runtime/aws-lambda.d.ts +0 -4
- package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +0 -45
- package/dist/presets/azure/preset.d.ts +0 -3
- package/dist/presets/azure/preset.mjs +0 -44
- package/dist/presets/azure/runtime/azure-functions.d.ts +0 -5
- package/dist/presets/azure/runtime/azure-functions.mjs +0 -24
- package/dist/presets/azure/runtime/azure-swa.d.ts +0 -5
- package/dist/presets/azure/runtime/azure-swa.mjs +0 -30
- package/dist/presets/azure/types.d.ts +0 -13
- package/dist/presets/azure/types.mjs +0 -0
- package/dist/presets/azure/utils.d.ts +0 -3
- package/dist/presets/azure/utils.mjs +0 -183
- package/dist/presets/bun/preset.d.ts +0 -2
- package/dist/presets/bun/preset.mjs +0 -17
- package/dist/presets/bun/runtime/bun.d.ts +0 -1
- package/dist/presets/bun/runtime/bun.mjs +0 -32
- package/dist/presets/cleavr/preset.d.ts +0 -2
- package/dist/presets/cleavr/preset.mjs +0 -12
- package/dist/presets/cloudflare/preset.d.ts +0 -3
- package/dist/presets/cloudflare/preset.mjs +0 -145
- package/dist/presets/cloudflare/runtime/cloudflare-module.d.ts +0 -13
- package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +0 -102
- package/dist/presets/cloudflare/runtime/cloudflare-pages.d.ts +0 -20
- package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +0 -55
- package/dist/presets/cloudflare/runtime/cloudflare-worker.d.ts +0 -1
- package/dist/presets/cloudflare/runtime/cloudflare-worker.mjs +0 -63
- package/dist/presets/cloudflare/types.d.ts +0 -89
- package/dist/presets/cloudflare/types.mjs +0 -0
- package/dist/presets/cloudflare/types.wrangler.d.ts +0 -974
- package/dist/presets/cloudflare/types.wrangler.mjs +0 -0
- package/dist/presets/cloudflare/utils.d.ts +0 -3
- package/dist/presets/cloudflare/utils.mjs +0 -163
- package/dist/presets/deno/preset.d.ts +0 -2
- package/dist/presets/deno/preset.mjs +0 -148
- package/dist/presets/deno/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/deno/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/deno/runtime/deno-deploy.d.ts +0 -2
- package/dist/presets/deno/runtime/deno-deploy.mjs +0 -32
- package/dist/presets/deno/runtime/deno-server.d.ts +0 -4
- package/dist/presets/deno/runtime/deno-server.mjs +0 -66
- package/dist/presets/digitalocean/preset.d.ts +0 -2
- package/dist/presets/digitalocean/preset.mjs +0 -11
- package/dist/presets/edgio/preset.d.ts +0 -2
- package/dist/presets/edgio/preset.mjs +0 -95
- package/dist/presets/firebase/preset.d.ts +0 -3
- package/dist/presets/firebase/preset.mjs +0 -51
- package/dist/presets/firebase/runtime/firebase-gen-1.d.ts +0 -2
- package/dist/presets/firebase/runtime/firebase-gen-1.mjs +0 -8
- package/dist/presets/firebase/runtime/firebase-gen-2.d.ts +0 -2
- package/dist/presets/firebase/runtime/firebase-gen-2.mjs +0 -15
- package/dist/presets/firebase/runtime/firebase-gen-default.d.ts +0 -1
- package/dist/presets/firebase/runtime/firebase-gen-default.mjs +0 -1
- package/dist/presets/firebase/types.d.ts +0 -37
- package/dist/presets/firebase/types.mjs +0 -0
- package/dist/presets/firebase/utils.d.ts +0 -3
- package/dist/presets/firebase/utils.mjs +0 -50
- package/dist/presets/flightcontrol/preset.d.ts +0 -2
- package/dist/presets/flightcontrol/preset.mjs +0 -11
- package/dist/presets/heroku/preset.d.ts +0 -2
- package/dist/presets/heroku/preset.mjs +0 -11
- package/dist/presets/iis/preset.d.ts +0 -2
- package/dist/presets/iis/preset.mjs +0 -32
- package/dist/presets/iis/utils.d.ts +0 -3
- package/dist/presets/iis/utils.mjs +0 -159
- package/dist/presets/koyeb/preset.d.ts +0 -2
- package/dist/presets/koyeb/preset.mjs +0 -11
- package/dist/presets/netlify/legacy/preset.d.ts +0 -2
- package/dist/presets/netlify/legacy/preset.mjs +0 -142
- package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/netlify/legacy/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/netlify/legacy/runtime/netlify-builder.d.ts +0 -3
- package/dist/presets/netlify/legacy/runtime/netlify-builder.mjs +0 -5
- package/dist/presets/netlify/legacy/runtime/netlify-edge.d.ts +0 -3
- package/dist/presets/netlify/legacy/runtime/netlify-edge.mjs +0 -26
- package/dist/presets/netlify/legacy/runtime/netlify-lambda.d.ts +0 -4
- package/dist/presets/netlify/legacy/runtime/netlify-lambda.mjs +0 -39
- package/dist/presets/netlify/legacy/runtime/netlify.d.ts +0 -4
- package/dist/presets/netlify/legacy/runtime/netlify.mjs +0 -22
- package/dist/presets/netlify/legacy/utils.d.ts +0 -4
- package/dist/presets/netlify/legacy/utils.mjs +0 -113
- package/dist/presets/netlify/preset.d.ts +0 -3
- package/dist/presets/netlify/preset.mjs +0 -127
- package/dist/presets/netlify/runtime/_deno-env-polyfill.d.ts +0 -0
- package/dist/presets/netlify/runtime/_deno-env-polyfill.mjs +0 -1
- package/dist/presets/netlify/runtime/netlify-edge.d.ts +0 -2
- package/dist/presets/netlify/runtime/netlify-edge.mjs +0 -25
- package/dist/presets/netlify/runtime/netlify.d.ts +0 -4
- package/dist/presets/netlify/runtime/netlify.mjs +0 -54
- package/dist/presets/netlify/types.d.ts +0 -12
- package/dist/presets/netlify/types.mjs +0 -0
- package/dist/presets/netlify/utils.d.ts +0 -5
- package/dist/presets/netlify/utils.mjs +0 -94
- package/dist/presets/node/preset.d.ts +0 -2
- package/dist/presets/node/preset.mjs +0 -49
- package/dist/presets/node/runtime/cli.d.ts +0 -1
- package/dist/presets/node/runtime/cli.mjs +0 -21
- package/dist/presets/node/runtime/cluster.d.ts +0 -1
- package/dist/presets/node/runtime/cluster.mjs +0 -60
- package/dist/presets/node/runtime/node-listener.d.ts +0 -6
- package/dist/presets/node/runtime/node-listener.mjs +0 -15
- package/dist/presets/node/runtime/node-server.d.ts +0 -3
- package/dist/presets/node/runtime/node-server.mjs +0 -44
- package/dist/presets/platform.sh/preset.d.ts +0 -2
- package/dist/presets/platform.sh/preset.mjs +0 -11
- package/dist/presets/render.com/preset.d.ts +0 -2
- package/dist/presets/render.com/preset.mjs +0 -11
- package/dist/presets/stormkit/preset.d.ts +0 -2
- package/dist/presets/stormkit/preset.mjs +0 -15
- package/dist/presets/stormkit/runtime/stormkit.d.ts +0 -21
- package/dist/presets/stormkit/runtime/stormkit.mjs +0 -32
- package/dist/presets/vercel/preset.d.ts +0 -3
- package/dist/presets/vercel/preset.mjs +0 -104
- package/dist/presets/vercel/runtime/vercel-edge.d.ts +0 -2
- package/dist/presets/vercel/runtime/vercel-edge.mjs +0 -22
- package/dist/presets/vercel/runtime/vercel.d.ts +0 -4
- package/dist/presets/vercel/runtime/vercel.mjs +0 -17
- package/dist/presets/vercel/types.d.ts +0 -78
- package/dist/presets/vercel/types.mjs +0 -0
- package/dist/presets/vercel/utils.d.ts +0 -5
- package/dist/presets/vercel/utils.mjs +0 -186
- package/dist/presets/winterjs/preset.d.ts +0 -2
- package/dist/presets/winterjs/preset.mjs +0 -20
- package/dist/presets/winterjs/runtime/winterjs.d.ts +0 -1
- package/dist/presets/winterjs/runtime/winterjs.mjs +0 -69
- package/dist/presets/zeabur/preset.d.ts +0 -2
- package/dist/presets/zeabur/preset.mjs +0 -70
- package/dist/presets/zeabur/runtime/zeabur.d.ts +0 -4
- package/dist/presets/zeabur/runtime/zeabur.mjs +0 -8
- package/dist/runtime/app.d.ts +0 -2
- package/dist/runtime/app.mjs +0 -1
- package/dist/runtime/cache.d.ts +0 -1
- package/dist/runtime/cache.mjs +0 -6
- package/dist/runtime/config.d.ts +0 -1
- package/dist/runtime/config.mjs +0 -1
- package/dist/runtime/context.d.ts +0 -1
- package/dist/runtime/context.mjs +0 -1
- package/dist/runtime/database.d.ts +0 -1
- package/dist/runtime/database.mjs +0 -1
- package/dist/runtime/error.d.ts +0 -1
- package/dist/runtime/error.mjs +0 -1
- package/dist/runtime/internal/app.d.ts +0 -3
- package/dist/runtime/internal/app.mjs +0 -152
- package/dist/runtime/internal/cache.d.ts +0 -8
- package/dist/runtime/internal/cache.mjs +0 -329
- package/dist/runtime/internal/client.d.ts +0 -1
- package/dist/runtime/internal/client.mjs +0 -4
- package/dist/runtime/internal/config.d.ts +0 -6
- package/dist/runtime/internal/config.mjs +0 -58
- package/dist/runtime/internal/context.d.ts +0 -12
- package/dist/runtime/internal/context.mjs +0 -17
- package/dist/runtime/internal/database.d.ts +0 -2
- package/dist/runtime/internal/database.mjs +0 -14
- package/dist/runtime/internal/debug.d.ts +0 -2
- package/dist/runtime/internal/debug.mjs +0 -5
- package/dist/runtime/internal/error.d.ts +0 -4
- package/dist/runtime/internal/error.mjs +0 -71
- package/dist/runtime/internal/index.d.ts +0 -6
- package/dist/runtime/internal/index.mjs +0 -16
- package/dist/runtime/internal/lib/http-graceful-shutdown.d.ts +0 -16
- package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +0 -213
- package/dist/runtime/internal/meta.d.ts +0 -2
- package/dist/runtime/internal/meta.mjs +0 -3
- package/dist/runtime/internal/plugin.d.ts +0 -3
- package/dist/runtime/internal/plugin.mjs +0 -4
- package/dist/runtime/internal/renderer.d.ts +0 -2
- package/dist/runtime/internal/renderer.mjs +0 -38
- package/dist/runtime/internal/route-rules.d.ts +0 -14
- package/dist/runtime/internal/route-rules.mjs +0 -67
- package/dist/runtime/internal/routes/openapi.d.ts +0 -3
- package/dist/runtime/internal/routes/openapi.mjs +0 -85
- package/dist/runtime/internal/routes/scalar.d.ts +0 -2
- package/dist/runtime/internal/routes/scalar.mjs +0 -191
- package/dist/runtime/internal/routes/swagger.d.ts +0 -2
- package/dist/runtime/internal/routes/swagger.mjs +0 -39
- package/dist/runtime/internal/shutdown.d.ts +0 -10
- package/dist/runtime/internal/shutdown.mjs +0 -34
- package/dist/runtime/internal/static.d.ts +0 -2
- package/dist/runtime/internal/static.mjs +0 -89
- package/dist/runtime/internal/storage.d.ts +0 -2
- package/dist/runtime/internal/storage.mjs +0 -5
- package/dist/runtime/internal/task.d.ts +0 -17
- package/dist/runtime/internal/task.mjs +0 -73
- package/dist/runtime/internal/timing.d.ts +0 -2
- package/dist/runtime/internal/timing.mjs +0 -29
- package/dist/runtime/internal/utils.azure.d.ts +0 -2
- package/dist/runtime/internal/utils.azure.mjs +0 -51
- package/dist/runtime/internal/utils.d.ts +0 -23
- package/dist/runtime/internal/utils.env.d.ts +0 -7
- package/dist/runtime/internal/utils.env.mjs +0 -39
- package/dist/runtime/internal/utils.lambda.d.ts +0 -12
- package/dist/runtime/internal/utils.lambda.mjs +0 -30
- package/dist/runtime/internal/utils.mjs +0 -129
- package/dist/runtime/plugin.d.ts +0 -1
- package/dist/runtime/plugin.mjs +0 -1
- package/dist/runtime/storage.d.ts +0 -1
- package/dist/runtime/storage.mjs +0 -1
- package/dist/runtime/task.d.ts +0 -1
- package/dist/runtime/task.mjs +0 -1
- package/dist/runtime/utils.d.ts +0 -1
- package/dist/runtime/utils.mjs +0 -1
- package/dist/shared/nitro.DkCt8MDS.d.mts +0 -588
- package/dist/shared/nitro.DkCt8MDS.d.ts +0 -588
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { HttpsOptions } from "firebase-functions/v2/https";
|
|
2
|
-
import type { RuntimeOptions, region } from "firebase-functions";
|
|
3
|
-
export type FirebaseOptions = FirebaseOptionsGen1 | FirebaseOptionsGen2;
|
|
4
|
-
export interface FirebaseOptionsBase {
|
|
5
|
-
gen: 1 | 2;
|
|
6
|
-
/**
|
|
7
|
-
* Firebase functions node runtime version.
|
|
8
|
-
* @see https://cloud.google.com/functions/docs/concepts/nodejs-runtime
|
|
9
|
-
*/
|
|
10
|
-
nodeVersion?: "20" | "18" | "16";
|
|
11
|
-
/**
|
|
12
|
-
* When deploying multiple apps within the same Firebase project
|
|
13
|
-
* you must give your server a unique name in order to avoid overwriting your functions.
|
|
14
|
-
*
|
|
15
|
-
* @default "server"
|
|
16
|
-
*/
|
|
17
|
-
serverFunctionName?: string;
|
|
18
|
-
}
|
|
19
|
-
export interface FirebaseOptionsGen1 extends FirebaseOptionsBase {
|
|
20
|
-
gen: 1;
|
|
21
|
-
/**
|
|
22
|
-
* Firebase functions 1st generation region passed to `functions.region()`.
|
|
23
|
-
*/
|
|
24
|
-
region?: Parameters<typeof region>[0];
|
|
25
|
-
/**
|
|
26
|
-
* Firebase functions 1st generation runtime options passed to `functions.runWith()`.
|
|
27
|
-
*/
|
|
28
|
-
runtimeOptions?: RuntimeOptions;
|
|
29
|
-
}
|
|
30
|
-
export interface FirebaseOptionsGen2 extends FirebaseOptionsBase {
|
|
31
|
-
gen: 2;
|
|
32
|
-
/**
|
|
33
|
-
* Firebase functions 2nd generation https options passed to `onRequest`.
|
|
34
|
-
* @see https://firebase.google.com/docs/reference/functions/2nd-gen/node/firebase-functions.https.httpsoptions
|
|
35
|
-
*/
|
|
36
|
-
httpsOptions?: HttpsOptions;
|
|
37
|
-
}
|
|
File without changes
|
|
@@ -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,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,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,142 +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
|
-
hooks: {
|
|
86
|
-
"rollup:before": (nitro) => {
|
|
87
|
-
deprecateSWR(nitro);
|
|
88
|
-
},
|
|
89
|
-
async compiled(nitro) {
|
|
90
|
-
await writeHeaders(nitro);
|
|
91
|
-
await writeRedirects(nitro);
|
|
92
|
-
const manifest = {
|
|
93
|
-
version: 1,
|
|
94
|
-
functions: [
|
|
95
|
-
{
|
|
96
|
-
path: "/*",
|
|
97
|
-
name: "nitro server handler",
|
|
98
|
-
function: "server",
|
|
99
|
-
generator: `${nitro.options.framework.name}@${nitro.options.framework.version}`
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
};
|
|
103
|
-
const manifestPath = join(
|
|
104
|
-
nitro.options.rootDir,
|
|
105
|
-
".netlify/edge-functions/manifest.json"
|
|
106
|
-
);
|
|
107
|
-
await fsp.mkdir(dirname(manifestPath), { recursive: true });
|
|
108
|
-
await fsp.writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "netlify-edge",
|
|
114
|
-
url: import.meta.url
|
|
115
|
-
}
|
|
116
|
-
);
|
|
117
|
-
const netlifyStatic = defineNitroPreset(
|
|
118
|
-
{
|
|
119
|
-
extends: "static",
|
|
120
|
-
output: {
|
|
121
|
-
publicDir: "{{ rootDir }}/dist"
|
|
122
|
-
},
|
|
123
|
-
commands: {
|
|
124
|
-
preview: "npx serve ./static"
|
|
125
|
-
},
|
|
126
|
-
hooks: {
|
|
127
|
-
"rollup:before": (nitro) => {
|
|
128
|
-
deprecateSWR(nitro);
|
|
129
|
-
},
|
|
130
|
-
async compiled(nitro) {
|
|
131
|
-
await writeHeaders(nitro);
|
|
132
|
-
await writeRedirects(nitro);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: "netlify-static",
|
|
138
|
-
url: import.meta.url,
|
|
139
|
-
static: true
|
|
140
|
-
}
|
|
141
|
-
);
|
|
142
|
-
export default [netlify, netlifyBuilder, netlifyEdge, netlifyStatic];
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.assign(process.env, Deno.env.toObject());
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import "#nitro-internal-pollyfills";
|
|
2
|
-
import "./_deno-env-polyfill";
|
|
3
|
-
import { useNitroApp } from "nitropack/runtime";
|
|
4
|
-
import { isPublicAssetURL } from "#nitro-internal-virtual/public-assets";
|
|
5
|
-
const nitroApp = useNitroApp();
|
|
6
|
-
export default async function netlifyEdge(request, _context) {
|
|
7
|
-
const url = new URL(request.url);
|
|
8
|
-
if (isPublicAssetURL(url.pathname)) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
if (!request.headers.has("x-forwarded-proto") && url.protocol === "https:") {
|
|
12
|
-
request.headers.set("x-forwarded-proto", "https");
|
|
13
|
-
}
|
|
14
|
-
let body;
|
|
15
|
-
if (request.body) {
|
|
16
|
-
body = await request.arrayBuffer();
|
|
17
|
-
}
|
|
18
|
-
return nitroApp.localFetch(url.pathname + url.search, {
|
|
19
|
-
host: url.hostname,
|
|
20
|
-
protocol: url.protocol,
|
|
21
|
-
headers: request.headers,
|
|
22
|
-
method: request.method,
|
|
23
|
-
redirect: request.redirect,
|
|
24
|
-
body
|
|
25
|
-
});
|
|
26
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import "#nitro-internal-pollyfills";
|
|
2
|
-
import "./_deno-env-polyfill";
|
|
3
|
-
import { useNitroApp } from "nitropack/runtime";
|
|
4
|
-
import {
|
|
5
|
-
normalizeCookieHeader,
|
|
6
|
-
normalizeLambdaIncomingHeaders,
|
|
7
|
-
normalizeLambdaOutgoingBody,
|
|
8
|
-
normalizeLambdaOutgoingHeaders
|
|
9
|
-
} from "nitropack/runtime/internal";
|
|
10
|
-
import { withQuery } from "ufo";
|
|
11
|
-
const nitroApp = useNitroApp();
|
|
12
|
-
export async function lambda(event, context) {
|
|
13
|
-
const query = {
|
|
14
|
-
...event.queryStringParameters,
|
|
15
|
-
...event.multiValueQueryStringParameters
|
|
16
|
-
};
|
|
17
|
-
const url = withQuery(event.path, query);
|
|
18
|
-
const method = event.httpMethod || "get";
|
|
19
|
-
const r = await nitroApp.localCall({
|
|
20
|
-
event,
|
|
21
|
-
url,
|
|
22
|
-
context,
|
|
23
|
-
headers: normalizeLambdaIncomingHeaders(event.headers),
|
|
24
|
-
method,
|
|
25
|
-
query,
|
|
26
|
-
body: event.isBase64Encoded ? Buffer.from(event.body || "", "base64") : event.body
|
|
27
|
-
});
|
|
28
|
-
const cookies = normalizeCookieHeader(String(r.headers["set-cookie"]));
|
|
29
|
-
const awsBody = await normalizeLambdaOutgoingBody(r.body, r.headers);
|
|
30
|
-
return {
|
|
31
|
-
statusCode: r.status,
|
|
32
|
-
headers: normalizeLambdaOutgoingHeaders(r.headers, true),
|
|
33
|
-
body: awsBody.body,
|
|
34
|
-
isBase64Encoded: awsBody.type === "binary",
|
|
35
|
-
...cookies.length > 0 && {
|
|
36
|
-
multiValueHeaders: { "set-cookie": cookies }
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import "#nitro-internal-pollyfills";
|
|
2
|
-
import "./_deno-env-polyfill";
|
|
3
|
-
import { getRouteRulesForPath } from "nitropack/runtime/internal";
|
|
4
|
-
import { withQuery } from "ufo";
|
|
5
|
-
import { lambda } from "./netlify-lambda.mjs";
|
|
6
|
-
export const handler = async function handler2(event, context) {
|
|
7
|
-
const query = {
|
|
8
|
-
...event.queryStringParameters,
|
|
9
|
-
...event.multiValueQueryStringParameters
|
|
10
|
-
};
|
|
11
|
-
const url = withQuery(event.path, query);
|
|
12
|
-
const routeRules = getRouteRulesForPath(url);
|
|
13
|
-
if (routeRules.isr) {
|
|
14
|
-
const builder = await import("@netlify/functions").then(
|
|
15
|
-
(r) => r.builder || r.default.builder
|
|
16
|
-
);
|
|
17
|
-
const ttl = typeof routeRules.isr === "number" ? routeRules.isr : false;
|
|
18
|
-
const builderHandler = ttl ? (event2, context2) => lambda(event2, context2).then((r) => ({ ...r, ttl })) : lambda;
|
|
19
|
-
return builder(builderHandler)(event, context);
|
|
20
|
-
}
|
|
21
|
-
return lambda(event, context);
|
|
22
|
-
};
|