next-ws 0.0.0-beta-20251219054558 → 0.0.0-beta-20260111002257
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/cli.cjs +2 -2
- package/dist/server/index.cjs +19 -5
- package/package.json +2 -2
package/dist/cli.cjs
CHANGED
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
var import_minimist = __toESM(require("minimist"));
|
|
28
28
|
|
|
29
29
|
// package.json
|
|
30
|
-
var version = "0.0.0-beta-
|
|
30
|
+
var version = "0.0.0-beta-20260111002257";
|
|
31
31
|
|
|
32
32
|
// src/commands/helpers/define.ts
|
|
33
33
|
function defineCommandGroup(definition) {
|
|
@@ -842,7 +842,7 @@ var patchCookies2 = definePatchStep({
|
|
|
842
842
|
});
|
|
843
843
|
var patch_2_default = definePatch({
|
|
844
844
|
name: "patch-2",
|
|
845
|
-
versions: ">=15.0.0 <=16.1.
|
|
845
|
+
versions: ">=15.0.0 <=16.1.1",
|
|
846
846
|
steps: [
|
|
847
847
|
patchNextNodeServer,
|
|
848
848
|
patchRouterServer,
|
package/dist/server/index.cjs
CHANGED
|
@@ -112,14 +112,28 @@ function findMatchingRoute(nextServer, requestPathname) {
|
|
|
112
112
|
// @ts-expect-error - getAppPathRoutes is protected
|
|
113
113
|
...nextServer.getAppPathRoutes()
|
|
114
114
|
};
|
|
115
|
-
|
|
116
|
-
for (const [routePath, [filePath]] of
|
|
117
|
-
if (!
|
|
115
|
+
const sortedRoutes = Object.entries(appPathRoutes).filter(([routePath, file]) => routePath && file?.length).sort(([a], [b]) => scoreRoute(b) - scoreRoute(a));
|
|
116
|
+
for (const [routePath, [filePath]] of sortedRoutes) {
|
|
117
|
+
if (!filePath) continue;
|
|
118
118
|
const realPath = `${basePath}${routePath}`;
|
|
119
119
|
const routeParams = getRouteParams(realPath, requestPathname);
|
|
120
|
-
if (routeParams)
|
|
120
|
+
if (routeParams) {
|
|
121
|
+
return { filename: filePath, params: routeParams };
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return void 0;
|
|
125
|
+
}
|
|
126
|
+
function scoreRoute(routePath) {
|
|
127
|
+
const parts = routePath.split("/").filter(Boolean);
|
|
128
|
+
let score = 0;
|
|
129
|
+
if (parts.length === 0) score = Infinity;
|
|
130
|
+
for (const part of parts) {
|
|
131
|
+
if (part.startsWith("[[...")) score += -1;
|
|
132
|
+
else if (part.startsWith("[...")) score += 0;
|
|
133
|
+
else if (part.startsWith("[")) score += 2;
|
|
134
|
+
else score += 3;
|
|
121
135
|
}
|
|
122
|
-
return
|
|
136
|
+
return score + parts.length;
|
|
123
137
|
}
|
|
124
138
|
|
|
125
139
|
// src/server/helpers/module.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-ws",
|
|
3
|
-
"version": "0.0.0-beta-
|
|
3
|
+
"version": "0.0.0-beta-20260111002257",
|
|
4
4
|
"description": "Add support for WebSockets in the Next.js app directory",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@types/ws": "^8.18.1",
|
|
60
60
|
"chalk": "^5.6.0",
|
|
61
61
|
"husky": "^9.1.7",
|
|
62
|
-
"next": "16.1.
|
|
62
|
+
"next": "16.1.1",
|
|
63
63
|
"pinst": "^3.0.0",
|
|
64
64
|
"react": "19.1.1",
|
|
65
65
|
"react-dom": "19.1.1",
|