nitro-nightly 3.0.1-20251113-100129-fde97b54 → 3.0.1-20251116-142138-25872617
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/dist/_presets.mjs +19 -0
- package/dist/types/index.d.mts +10 -0
- package/package.json +1 -1
package/dist/_presets.mjs
CHANGED
|
@@ -199,6 +199,7 @@ async function writeAmplifyFiles(nitro) {
|
|
|
199
199
|
//#region src/presets/aws-amplify/preset.ts
|
|
200
200
|
const awsAmplify = defineNitroPreset({
|
|
201
201
|
entry: "./aws-amplify/runtime/aws-amplify",
|
|
202
|
+
manifest: { deploymentId: process.env.AWS_JOB_ID },
|
|
202
203
|
serveStatic: true,
|
|
203
204
|
output: {
|
|
204
205
|
dir: "{{ rootDir }}/.amplify-hosting",
|
|
@@ -858,6 +859,7 @@ const unenvDeno = {
|
|
|
858
859
|
//#region src/presets/deno/preset.ts
|
|
859
860
|
const denoDeploy = defineNitroPreset({
|
|
860
861
|
entry: "./deno/runtime/deno-deploy",
|
|
862
|
+
manifest: { deploymentId: process.env.DENO_DEPLOYMENT_ID },
|
|
861
863
|
exportConditions: ["deno"],
|
|
862
864
|
node: false,
|
|
863
865
|
noExternals: true,
|
|
@@ -1181,6 +1183,7 @@ function getGeneratorString(nitro) {
|
|
|
1181
1183
|
//#region src/presets/netlify/preset.ts
|
|
1182
1184
|
const netlify = defineNitroPreset({
|
|
1183
1185
|
entry: "./netlify/runtime/netlify",
|
|
1186
|
+
manifest: { deploymentId: process.env.DEPLOY_ID },
|
|
1184
1187
|
output: {
|
|
1185
1188
|
dir: "{{ rootDir }}/.netlify/functions-internal",
|
|
1186
1189
|
publicDir: "{{ rootDir }}/dist/{{ baseURL }}"
|
|
@@ -1204,6 +1207,7 @@ const netlify = defineNitroPreset({
|
|
|
1204
1207
|
const netlifyEdge = defineNitroPreset({
|
|
1205
1208
|
extends: "base-worker",
|
|
1206
1209
|
entry: "./netlify/runtime/netlify-edge",
|
|
1210
|
+
manifest: { deploymentId: process.env.DEPLOY_ID },
|
|
1207
1211
|
exportConditions: ["netlify"],
|
|
1208
1212
|
output: {
|
|
1209
1213
|
serverDir: "{{ rootDir }}/.netlify/edge-functions/server",
|
|
@@ -1235,6 +1239,7 @@ const netlifyEdge = defineNitroPreset({
|
|
|
1235
1239
|
}, { name: "netlify-edge" });
|
|
1236
1240
|
const netlifyStatic = defineNitroPreset({
|
|
1237
1241
|
extends: "static",
|
|
1242
|
+
manifest: { deploymentId: process.env.DEPLOY_ID },
|
|
1238
1243
|
output: {
|
|
1239
1244
|
dir: "{{ rootDir }}/dist",
|
|
1240
1245
|
publicDir: "{{ rootDir }}/dist/{{ baseURL }}"
|
|
@@ -1415,6 +1420,16 @@ function generateBuildConfig(nitro, o11Routes) {
|
|
|
1415
1420
|
if (routeRules.headers) route = defu(route, { headers: routeRules.headers });
|
|
1416
1421
|
return route;
|
|
1417
1422
|
}),
|
|
1423
|
+
...nitro.options.vercel?.skewProtection && nitro.options.manifest?.deploymentId ? [{
|
|
1424
|
+
src: "/.*",
|
|
1425
|
+
has: [{
|
|
1426
|
+
type: "header",
|
|
1427
|
+
key: "Sec-Fetch-Dest",
|
|
1428
|
+
value: "document"
|
|
1429
|
+
}],
|
|
1430
|
+
headers: { "Set-Cookie": `__vdpl=${nitro.options.manifest.deploymentId}; Path=${nitro.options.baseURL}; SameSite=Strict; Secure; HttpOnly` },
|
|
1431
|
+
continue: true
|
|
1432
|
+
}] : [],
|
|
1418
1433
|
...nitro.options.publicAssets.filter((asset) => !asset.fallthrough).map((asset) => joinURL(nitro.options.baseURL, asset.baseURL || "/")).map((baseURL) => ({
|
|
1419
1434
|
src: baseURL + "(.*)",
|
|
1420
1435
|
headers: { "cache-control": "public,max-age=31536000,immutable" },
|
|
@@ -1542,6 +1557,8 @@ async function writePrerenderConfig(filename, isrConfig, bypassToken) {
|
|
|
1542
1557
|
//#region src/presets/vercel/preset.ts
|
|
1543
1558
|
const vercel = defineNitroPreset({
|
|
1544
1559
|
entry: "./vercel/runtime/vercel.{format}",
|
|
1560
|
+
manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
|
|
1561
|
+
vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
|
|
1545
1562
|
output: {
|
|
1546
1563
|
dir: "{{ rootDir }}/.vercel/output",
|
|
1547
1564
|
serverDir: "{{ output.dir }}/functions/__server.func",
|
|
@@ -1575,6 +1592,8 @@ const vercel = defineNitroPreset({
|
|
|
1575
1592
|
});
|
|
1576
1593
|
const vercelStatic = defineNitroPreset({
|
|
1577
1594
|
extends: "static",
|
|
1595
|
+
manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
|
|
1596
|
+
vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
|
|
1578
1597
|
output: {
|
|
1579
1598
|
dir: "{{ rootDir }}/.vercel/output",
|
|
1580
1599
|
publicDir: "{{ output.dir }}/static/{{ baseURL }}"
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1780,6 +1780,13 @@ interface VercelServerlessFunctionConfig {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
interface VercelOptions {
|
|
1782
1782
|
config: VercelBuildConfigV3;
|
|
1783
|
+
/**
|
|
1784
|
+
* If you have enabled skew protection in the Vercel dashboard, it will
|
|
1785
|
+
* be enabled by default.
|
|
1786
|
+
*
|
|
1787
|
+
* You can disable the Nitro integration by setting this option to `false`.
|
|
1788
|
+
*/
|
|
1789
|
+
skewProtection?: boolean;
|
|
1783
1790
|
/**
|
|
1784
1791
|
* If you are using `vercel-edge`, you can specify the region(s) for your edge function.
|
|
1785
1792
|
* @see https://vercel.com/docs/concepts/functions/edge-functions#edge-function-regions
|
|
@@ -2851,6 +2858,9 @@ interface NitroOptions extends PresetOptions {
|
|
|
2851
2858
|
ssrRoutes: string[];
|
|
2852
2859
|
serveStatic: boolean | "node" | "deno" | "inline";
|
|
2853
2860
|
noPublicDir: boolean;
|
|
2861
|
+
manifest?: {
|
|
2862
|
+
deploymentId?: string;
|
|
2863
|
+
};
|
|
2854
2864
|
features: {
|
|
2855
2865
|
/**
|
|
2856
2866
|
* Enable runtime hooks for request and response.
|
package/package.json
CHANGED