@nuxt/nitro-server-nightly 5.0.0-2610272000-c73c4e1 → 5.0.0-2610272224-68dcc5c

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 (2) hide show
  1. package/dist/index.mjs +28 -2
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -34,7 +34,7 @@ import { colors } from "consola/utils";
34
34
  import { createUnplugin } from "unplugin";
35
35
  import { parseSync } from "rolldown/utils";
36
36
  // package.json
37
- var version = "5.0.0-2610272000-c73c4e1";
37
+ var version = "5.0.0-2610272224-68dcc5c";
38
38
  // src/utils.ts
39
39
  /**
40
40
  * Compile-time constants the server bundle needs which Nitro does not inject itself.
@@ -1386,6 +1386,30 @@ function foldRouteRules(routeRules) {
1386
1386
  function isObject(value) {
1387
1387
  return value !== null && typeof value === "object";
1388
1388
  }
1389
+ function withRequestBases(layers, path) {
1390
+ return layers.map((layer) => {
1391
+ const entries = (Array.isArray(layer.data) ? layer.data : layer.data.rules).map((entry) => {
1392
+ if (entry.name !== "redirect" && entry.name !== "proxy") return entry;
1393
+ const options = entry.options;
1394
+ if (!isObject(options) || typeof options.base !== "string" || !options.base || /[:*()\\]/.test(options.base)) return entry;
1395
+ const base = path.split("/", options.base.split("/").length).join("/");
1396
+ return base === options.base ? entry : {
1397
+ ...entry,
1398
+ options: {
1399
+ ...options,
1400
+ base
1401
+ }
1402
+ };
1403
+ });
1404
+ return {
1405
+ ...layer,
1406
+ data: Array.isArray(layer.data) ? entries : {
1407
+ ...layer.data,
1408
+ rules: entries
1409
+ }
1410
+ };
1411
+ });
1412
+ }
1389
1413
  const ROUTING_ID = "#nitro/virtual/routing";
1390
1414
  const FIND_ROUTE_RULES_EXPORT = "export const findRouteRules = ";
1391
1415
  /**
@@ -1416,10 +1440,12 @@ function routeRulesCaseFoldPlugin(getNitro) {
1416
1440
  `const findFoldedRouteRules = ${compileFindRouteRules(rules, options)}`,
1417
1441
  `const foldRouteCase = ${foldRouteCase.toString()}`,
1418
1442
  `const foldRouteRulePath = ${foldRouteRulePath.toString()}`,
1443
+ `const isObject = ${isObject.toString()}`,
1444
+ `const withRequestBases = ${withRequestBases.toString()}`,
1419
1445
  `export const findRouteRules = (method, path) => {`,
1420
1446
  ` const sensitive = findSensitiveRouteRules(method, path)`,
1421
1447
  ` const folded = findFoldedRouteRules(method, foldRouteRulePath(path))`,
1422
- ` return folded.length > sensitive.length ? folded : sensitive`,
1448
+ ` return folded.length > sensitive.length ? withRequestBases(folded, path) : sensitive`,
1423
1449
  `}`
1424
1450
  ].join("\n");
1425
1451
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/nitro-server-nightly",
3
- "version": "5.0.0-2610272000-c73c4e1",
3
+ "version": "5.0.0-2610272224-68dcc5c",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/nuxt/nuxt.git",
@@ -36,7 +36,7 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@ampproject/remapping": "^2.3.0",
39
- "@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-2610272000-c73c4e1",
39
+ "@nuxt/kit": "npm:@nuxt/kit-nightly@5.0.0-2610272224-68dcc5c",
40
40
  "@unhead/vue": "^3.4.3",
41
41
  "consola": "^3.4.2",
42
42
  "defu": "^6.1.7",
@@ -74,7 +74,7 @@
74
74
  "@babel/plugin-proposal-decorators": "^7.25.0 || ^8.0.0",
75
75
  "@babel/plugin-syntax-typescript": "^7.25.0 || ^8.0.0",
76
76
  "@rollup/plugin-babel": "^6.0.0 || ^7.0.0",
77
- "nuxt": "npm:nuxt-nightly@5.0.0-2610272000-c73c4e1"
77
+ "nuxt": "npm:nuxt-nightly@5.0.0-2610272224-68dcc5c"
78
78
  },
79
79
  "peerDependenciesMeta": {
80
80
  "@babel/plugin-proposal-decorators": {
@@ -90,11 +90,11 @@
90
90
  "devDependencies": {
91
91
  "@babel/plugin-proposal-decorators": "8.0.2",
92
92
  "@babel/plugin-syntax-typescript": "8.0.3",
93
- "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-2610272000-c73c4e1",
93
+ "@nuxt/schema": "npm:@nuxt/schema-nightly@5.0.0-2610272224-68dcc5c",
94
94
  "@rollup/plugin-babel": "7.1.0",
95
95
  "h3": "^2.0.1-rc.32",
96
96
  "hookable": "^6.1.2",
97
- "nuxt": "npm:nuxt-nightly@5.0.0-2610272000-c73c4e1",
97
+ "nuxt": "npm:nuxt-nightly@5.0.0-2610272224-68dcc5c",
98
98
  "tsdown": "0.23.2",
99
99
  "vitest": "5.0.3"
100
100
  },