nitro-nightly 3.1.0-20251027-223403-81bd673d → 3.1.0-20251027-232908-e0bb18f2
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/_chunks/index.mjs +8 -25
- package/dist/types/index.d.mts +0 -2
- package/package.json +11 -13
package/dist/_chunks/index.mjs
CHANGED
|
@@ -20217,27 +20217,21 @@ async function snapshotStorage(nitro) {
|
|
|
20217
20217
|
return data;
|
|
20218
20218
|
}
|
|
20219
20219
|
|
|
20220
|
-
//#region src/object.ts
|
|
20221
20220
|
const NullProtoObj = /* @__PURE__ */ (() => {
|
|
20222
20221
|
const e = function() {};
|
|
20223
20222
|
return e.prototype = Object.create(null), Object.freeze(e.prototype), e;
|
|
20224
20223
|
})();
|
|
20225
20224
|
|
|
20226
|
-
//#endregion
|
|
20227
|
-
//#region src/context.ts
|
|
20228
20225
|
/**
|
|
20229
20226
|
* Create a new router context.
|
|
20230
20227
|
*/
|
|
20231
20228
|
function createRouter() {
|
|
20232
|
-
|
|
20229
|
+
return {
|
|
20233
20230
|
root: { key: "" },
|
|
20234
20231
|
static: new NullProtoObj()
|
|
20235
20232
|
};
|
|
20236
|
-
return ctx;
|
|
20237
20233
|
}
|
|
20238
20234
|
|
|
20239
|
-
//#endregion
|
|
20240
|
-
//#region src/operations/_utils.ts
|
|
20241
20235
|
function splitPath(path) {
|
|
20242
20236
|
const [_, ...s] = path.split("/");
|
|
20243
20237
|
return s[s.length - 1] === "" ? s.slice(0, -1) : s;
|
|
@@ -20255,8 +20249,6 @@ function getMatchParams(segments, paramsMap) {
|
|
|
20255
20249
|
return params;
|
|
20256
20250
|
}
|
|
20257
20251
|
|
|
20258
|
-
//#endregion
|
|
20259
|
-
//#region src/operations/add.ts
|
|
20260
20252
|
/**
|
|
20261
20253
|
* Add a route to the router context.
|
|
20262
20254
|
*/
|
|
@@ -20325,11 +20317,9 @@ function addRoute(ctx, method = "", path, data) {
|
|
|
20325
20317
|
}
|
|
20326
20318
|
function getParamRegexp(segment) {
|
|
20327
20319
|
const regex = segment.replace(/:(\w+)/g, (_, id) => `(?<${id}>[^/]+)`).replace(/\./g, "\\.");
|
|
20328
|
-
return new RegExp(`^${regex}$`);
|
|
20320
|
+
return /* @__PURE__ */ new RegExp(`^${regex}$`);
|
|
20329
20321
|
}
|
|
20330
20322
|
|
|
20331
|
-
//#endregion
|
|
20332
|
-
//#region src/operations/find.ts
|
|
20333
20323
|
/**
|
|
20334
20324
|
* Find a route by path.
|
|
20335
20325
|
*/
|
|
@@ -20368,7 +20358,7 @@ function _lookupTree(ctx, node, method, segments, index) {
|
|
|
20368
20358
|
if (pMap?.[pMap?.length - 1]?.[2]) return match;
|
|
20369
20359
|
}
|
|
20370
20360
|
}
|
|
20371
|
-
return
|
|
20361
|
+
return;
|
|
20372
20362
|
}
|
|
20373
20363
|
const segment = segments[index];
|
|
20374
20364
|
if (node.static) {
|
|
@@ -20389,11 +20379,8 @@ function _lookupTree(ctx, node, method, segments, index) {
|
|
|
20389
20379
|
}
|
|
20390
20380
|
}
|
|
20391
20381
|
if (node.wildcard && node.wildcard.methods) return node.wildcard.methods[method] || node.wildcard.methods[""];
|
|
20392
|
-
return;
|
|
20393
20382
|
}
|
|
20394
20383
|
|
|
20395
|
-
//#endregion
|
|
20396
|
-
//#region src/operations/find-all.ts
|
|
20397
20384
|
/**
|
|
20398
20385
|
* Find all route patterns that match the given path.
|
|
20399
20386
|
*/
|
|
@@ -20433,7 +20420,6 @@ function _findAll(ctx, node, method, segments, index, matches = []) {
|
|
|
20433
20420
|
return matches;
|
|
20434
20421
|
}
|
|
20435
20422
|
|
|
20436
|
-
//#region src/compiler.ts
|
|
20437
20423
|
/**
|
|
20438
20424
|
* Compiles the router instance into a faster route-matching function.
|
|
20439
20425
|
*
|
|
@@ -20464,17 +20450,16 @@ function _findAll(ctx, node, method, segments, index, matches = []) {
|
|
|
20464
20450
|
* // "const findRoute=(m, p) => {}"
|
|
20465
20451
|
*/
|
|
20466
20452
|
function compileRouterToString(router, functionName, opts) {
|
|
20467
|
-
const
|
|
20453
|
+
const compiled = `(m,p)=>{${compileRouteMatch({
|
|
20468
20454
|
opts: opts || {},
|
|
20469
20455
|
router,
|
|
20470
20456
|
deps: void 0
|
|
20471
|
-
}
|
|
20472
|
-
const compiled = `(m,p)=>{${compileRouteMatch(ctx)}}`;
|
|
20457
|
+
})}}`;
|
|
20473
20458
|
return functionName ? `const ${functionName}=${compiled};` : compiled;
|
|
20474
20459
|
}
|
|
20475
20460
|
function compileRouteMatch(ctx) {
|
|
20476
20461
|
let code = "";
|
|
20477
|
-
const staticNodes = new Set();
|
|
20462
|
+
const staticNodes = /* @__PURE__ */ new Set();
|
|
20478
20463
|
for (const key in ctx.router.static) {
|
|
20479
20464
|
const node = ctx.router.static[key];
|
|
20480
20465
|
if (node?.methods) {
|
|
@@ -20505,8 +20490,7 @@ function compileFinalMatch(ctx, data, currentIdx, params) {
|
|
|
20505
20490
|
const conditions = [];
|
|
20506
20491
|
const { paramsMap, paramsRegexp } = data;
|
|
20507
20492
|
if (paramsMap && paramsMap.length > 0) {
|
|
20508
|
-
|
|
20509
|
-
if (required) conditions.push(`l>=${currentIdx}`);
|
|
20493
|
+
if (!paramsMap[paramsMap.length - 1][2] && currentIdx !== -1) conditions.push(`l>=${currentIdx}`);
|
|
20510
20494
|
for (let i = 0; i < paramsRegexp.length; i++) {
|
|
20511
20495
|
const regexp = paramsRegexp[i];
|
|
20512
20496
|
if (!regexp) continue;
|
|
@@ -20519,9 +20503,8 @@ function compileFinalMatch(ctx, data, currentIdx, params) {
|
|
|
20519
20503
|
}
|
|
20520
20504
|
ret += "}";
|
|
20521
20505
|
}
|
|
20522
|
-
const code = (conditions.length > 0 ? `if(${conditions.join("&&")})` : "") + (ctx.opts?.matchAll ? `r.unshift(${ret}});` : `return ${ret}};`);
|
|
20523
20506
|
return {
|
|
20524
|
-
code,
|
|
20507
|
+
code: (conditions.length > 0 ? `if(${conditions.join("&&")})` : "") + (ctx.opts?.matchAll ? `r.unshift(${ret}});` : `return ${ret}};`),
|
|
20525
20508
|
weight: conditions.length
|
|
20526
20509
|
};
|
|
20527
20510
|
}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -3800,8 +3800,6 @@ interface PrerenderRoute {
|
|
|
3800
3800
|
/** @deprecated Internal type will be removed in future versions */
|
|
3801
3801
|
type PrerenderGenerateRoute = PrerenderRoute;
|
|
3802
3802
|
|
|
3803
|
-
//#endregion
|
|
3804
|
-
//#region src/compiler.d.ts
|
|
3805
3803
|
interface RouterCompilerOptions<T = any> {
|
|
3806
3804
|
matchAll?: boolean;
|
|
3807
3805
|
serialize?: (data: T) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nitro-nightly",
|
|
3
|
-
"version": "3.1.0-20251027-
|
|
3
|
+
"version": "3.1.0-20251027-232908-e0bb18f2",
|
|
4
4
|
"description": "Build and Deploy Universal JavaScript Servers",
|
|
5
5
|
"homepage": "https://nitro.build",
|
|
6
6
|
"repository": "nitrojs/nitro",
|
|
@@ -58,17 +58,17 @@
|
|
|
58
58
|
"db0": "^0.3.4",
|
|
59
59
|
"esbuild": "^0.25.11",
|
|
60
60
|
"fetchdts": "^0.1.7",
|
|
61
|
-
"h3": "
|
|
61
|
+
"h3": "2.0.1-rc.5",
|
|
62
62
|
"jiti": "^2.6.1",
|
|
63
|
-
"nf3": "^0.1.
|
|
63
|
+
"nf3": "^0.1.3",
|
|
64
64
|
"ofetch": "^1.4.1",
|
|
65
65
|
"ohash": "^2.0.11",
|
|
66
66
|
"rendu": "^0.0.6",
|
|
67
67
|
"rollup": "^4.52.5",
|
|
68
68
|
"srvx": "^0.9.1",
|
|
69
69
|
"undici": "^7.16.0",
|
|
70
|
-
"unenv": "
|
|
71
|
-
"unstorage": "
|
|
70
|
+
"unenv": "2.0.0-rc.22",
|
|
71
|
+
"unstorage": "2.0.0-alpha.3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@azure/functions": "^3.5.1",
|
|
@@ -86,7 +86,6 @@
|
|
|
86
86
|
"@rollup/plugin-replace": "^6.0.2",
|
|
87
87
|
"@rollup/plugin-terser": "^0.4.4",
|
|
88
88
|
"@scalar/api-reference": "^1.38.1",
|
|
89
|
-
"@types/archiver": "^6.0.4",
|
|
90
89
|
"@types/aws-lambda": "^8.10.156",
|
|
91
90
|
"@types/estree": "^1.0.8",
|
|
92
91
|
"@types/etag": "^1.8.4",
|
|
@@ -95,9 +94,9 @@
|
|
|
95
94
|
"@types/node": "^24.9.1",
|
|
96
95
|
"@types/node-fetch": "^2.6.13",
|
|
97
96
|
"@types/semver": "^7.7.1",
|
|
98
|
-
"@types/serve-static": "^
|
|
97
|
+
"@types/serve-static": "^2.2.0",
|
|
99
98
|
"@types/xml2js": "^0.4.14",
|
|
100
|
-
"@vitest/coverage-v8": "^4.0.
|
|
99
|
+
"@vitest/coverage-v8": "^4.0.4",
|
|
101
100
|
"automd": "^0.4.2",
|
|
102
101
|
"c12": "^3.3.1",
|
|
103
102
|
"changelogen": "^0.6.2",
|
|
@@ -120,12 +119,11 @@
|
|
|
120
119
|
"fs-extra": "^11.3.2",
|
|
121
120
|
"get-port-please": "^3.2.0",
|
|
122
121
|
"gzip-size": "^7.0.0",
|
|
123
|
-
"hookable": "
|
|
122
|
+
"hookable": "6.0.0-rc.1",
|
|
124
123
|
"httpxy": "^0.1.7",
|
|
125
124
|
"klona": "^2.0.6",
|
|
126
125
|
"knitwork": "^1.2.0",
|
|
127
126
|
"magic-string": "^0.30.21",
|
|
128
|
-
"magicast": "^0.3.5",
|
|
129
127
|
"mime": "^4.1.0",
|
|
130
128
|
"miniflare": "^4.20251011.1",
|
|
131
129
|
"mlly": "^1.8.0",
|
|
@@ -135,8 +133,8 @@
|
|
|
135
133
|
"prettier": "^3.6.2",
|
|
136
134
|
"pretty-bytes": "^7.1.0",
|
|
137
135
|
"react": "^19.2.0",
|
|
138
|
-
"rolldown": "1.0.0-beta.
|
|
139
|
-
"rou3": "^0.7.
|
|
136
|
+
"rolldown": "1.0.0-beta.45",
|
|
137
|
+
"rou3": "^0.7.9",
|
|
140
138
|
"scule": "^1.3.0",
|
|
141
139
|
"semver": "^7.7.3",
|
|
142
140
|
"serve-placeholder": "^2.0.2",
|
|
@@ -154,7 +152,7 @@
|
|
|
154
152
|
"unplugin-utils": "^0.3.1",
|
|
155
153
|
"untyped": "^2.0.0",
|
|
156
154
|
"unwasm": "^0.3.11",
|
|
157
|
-
"vitest": "^4.0.
|
|
155
|
+
"vitest": "^4.0.4",
|
|
158
156
|
"wrangler": "^4.45.0",
|
|
159
157
|
"xml2js": "^0.6.2",
|
|
160
158
|
"youch": "4.1.0-beta.11",
|