nitro-nightly 3.0.1-20251116-134446-b005d480 → 3.0.1-20251116-145822-c2b81c72

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.
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/knitwork@1.2.0/node_modules/knitwork/dist/index.mjs
1
+ //#region node_modules/.pnpm/knitwork@1.3.0/node_modules/knitwork/dist/index.mjs
2
2
  function genString(input, options = {}) {
3
3
  const str = JSON.stringify(input);
4
4
  if (!options.singleQuotes) return str;
@@ -68,6 +68,7 @@ const reservedNames = /* @__PURE__ */ new Set([
68
68
  "with",
69
69
  "yield"
70
70
  ]);
71
+ const VALID_IDENTIFIER_RE = /^[$_]?([A-Z_a-z]\w*|\d)$/;
71
72
  function _genStatement(type, specifier, names, options = {}) {
72
73
  const specifierString = genString(specifier, options);
73
74
  if (!names) return `${type} ${specifierString};`;
@@ -96,7 +97,6 @@ function wrapInDelimiters(lines, indent = "", delimiters = "{}", withComma = tru
96
97
  ` + lines.join(withComma ? ",\n" : "\n") + `
97
98
  ${indent}${end}`;
98
99
  }
99
- const VALID_IDENTIFIER_RE = /^[$_]?([A-Z_a-z]\w*|\d)$/;
100
100
  function genObjectKey(key) {
101
101
  return VALID_IDENTIFIER_RE.test(key) ? key : genString(key);
102
102
  }
package/dist/_presets.mjs CHANGED
@@ -1420,6 +1420,16 @@ function generateBuildConfig(nitro, o11Routes) {
1420
1420
  if (routeRules.headers) route = defu(route, { headers: routeRules.headers });
1421
1421
  return route;
1422
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
+ }] : [],
1423
1433
  ...nitro.options.publicAssets.filter((asset) => !asset.fallthrough).map((asset) => joinURL(nitro.options.baseURL, asset.baseURL || "/")).map((baseURL) => ({
1424
1434
  src: baseURL + "(.*)",
1425
1435
  headers: { "cache-control": "public,max-age=31536000,immutable" },
@@ -1548,6 +1558,7 @@ async function writePrerenderConfig(filename, isrConfig, bypassToken) {
1548
1558
  const vercel = defineNitroPreset({
1549
1559
  entry: "./vercel/runtime/vercel.{format}",
1550
1560
  manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
1561
+ vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
1551
1562
  output: {
1552
1563
  dir: "{{ rootDir }}/.vercel/output",
1553
1564
  serverDir: "{{ output.dir }}/functions/__server.func",
@@ -1582,6 +1593,7 @@ const vercel = defineNitroPreset({
1582
1593
  const vercelStatic = defineNitroPreset({
1583
1594
  extends: "static",
1584
1595
  manifest: { deploymentId: process.env.VERCEL_DEPLOYMENT_ID },
1596
+ vercel: { skewProtection: !!process.env.VERCEL_SKEW_PROTECTION_ENABLED },
1585
1597
  output: {
1586
1598
  dir: "{{ rootDir }}/.vercel/output",
1587
1599
  publicDir: "{{ output.dir }}/static/{{ baseURL }}"
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nitro-nightly",
3
- "version": "3.0.1-20251116-134446-b005d480",
3
+ "version": "3.0.1-20251116-145822-c2b81c72",
4
4
  "description": "Build and Deploy Universal JavaScript Servers",
5
5
  "homepage": "https://nitro.build",
6
6
  "repository": "nitrojs/nitro",
@@ -76,7 +76,7 @@
76
76
  "devDependencies": {
77
77
  "@azure/functions": "^3.5.1",
78
78
  "@azure/static-web-apps-cli": "^2.0.7",
79
- "@cloudflare/workers-types": "^4.20251109.0",
79
+ "@cloudflare/workers-types": "^4.20251115.0",
80
80
  "@deno/types": "^0.0.1",
81
81
  "rollup": "^4.53.2",
82
82
  "@hiogawa/vite-plugin-fullstack": "npm:@pi0/vite-plugin-fullstack@0.0.5-pr-1297",
@@ -98,7 +98,7 @@
98
98
  "@types/node-fetch": "^2.6.13",
99
99
  "@types/semver": "^7.7.1",
100
100
  "@types/xml2js": "^0.4.14",
101
- "@vitest/coverage-v8": "^4.0.8",
101
+ "@vitest/coverage-v8": "^4.0.9",
102
102
  "automd": "^0.4.2",
103
103
  "c12": "^3.3.1",
104
104
  "changelogen": "^0.6.2",
@@ -125,10 +125,10 @@
125
125
  "hookable": "6.0.0-rc.1",
126
126
  "httpxy": "^0.1.7",
127
127
  "klona": "^2.0.6",
128
- "knitwork": "^1.2.0",
128
+ "knitwork": "^1.3.0",
129
129
  "magic-string": "^0.30.21",
130
130
  "mime": "^4.1.0",
131
- "miniflare": "^4.20251105.0",
131
+ "miniflare": "^4.20251109.1",
132
132
  "mlly": "^1.8.0",
133
133
  "nypm": "^0.6.2",
134
134
  "obuild": "^0.4.1",
@@ -157,7 +157,7 @@
157
157
  "unimport": "^5.5.0",
158
158
  "untyped": "^2.0.0",
159
159
  "unwasm": "^0.5.0",
160
- "vitest": "^4.0.8",
160
+ "vitest": "^4.0.9",
161
161
  "wrangler": "^4.46.0",
162
162
  "xml2js": "^0.6.2",
163
163
  "youch": "^4.1.0-beta.12",