@apex-stack/core 0.1.18 → 0.1.19
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/{build-DXLV2X5C.js → build-J47A3B4Y.js} +1 -1
- package/dist/{chunk-VALQEQD3.js → chunk-XSN6NDWP.js} +26 -3
- package/dist/cli.js +3 -3
- package/dist/{dev-W3D2FCEP.js → dev-OCVQRCCE.js} +1 -1
- package/dist/{server-VYF5SRVI.js → server-L3V34B5X.js} +1 -1
- package/dist/{start-254YG2BY.js → start-AUJJ7HAY.js} +1 -1
- package/package.json +2 -2
|
@@ -89,14 +89,17 @@ function scanPages(root) {
|
|
|
89
89
|
const parts = rel.replace(/\.alpine$/, "").split("/");
|
|
90
90
|
if (parts[parts.length - 1] === "index") parts.pop();
|
|
91
91
|
const segments = parts.map((p) => {
|
|
92
|
+
const catchAll = /^\[\.\.\.(.+)\]$/.exec(p);
|
|
93
|
+
if (catchAll) return { catchAll: catchAll[1] };
|
|
92
94
|
const m = /^\[(.+)\]$/.exec(p);
|
|
93
95
|
return m ? { param: m[1] } : { literal: p };
|
|
94
96
|
});
|
|
95
|
-
const isDynamic = segments.some((s) => s.param !== void 0);
|
|
96
|
-
const pattern = `/${segments.map((s) => s.param ? `:${s.param}` : s.literal).join("/")}`;
|
|
97
|
+
const isDynamic = segments.some((s) => s.param !== void 0 || s.catchAll !== void 0);
|
|
98
|
+
const pattern = `/${segments.map((s) => s.catchAll ? `:${s.catchAll}*` : s.param ? `:${s.param}` : s.literal).join("/")}`;
|
|
97
99
|
return { pageId, pattern, segments, isDynamic };
|
|
98
100
|
});
|
|
99
|
-
|
|
101
|
+
const rank = (r) => r.segments.some((s) => s.catchAll) ? 2 : r.isDynamic ? 1 : 0;
|
|
102
|
+
return routes.sort((a, b) => rank(a) - rank(b));
|
|
100
103
|
}
|
|
101
104
|
function pathSegments(url) {
|
|
102
105
|
const path = url.split("?")[0] ?? "/";
|
|
@@ -105,6 +108,26 @@ function pathSegments(url) {
|
|
|
105
108
|
function matchRoute(routes, url) {
|
|
106
109
|
const segs = pathSegments(url);
|
|
107
110
|
for (const route of routes) {
|
|
111
|
+
const last = route.segments[route.segments.length - 1];
|
|
112
|
+
const isCatchAll = Boolean(last?.catchAll);
|
|
113
|
+
if (isCatchAll) {
|
|
114
|
+
const lead = route.segments.slice(0, -1);
|
|
115
|
+
if (segs.length < lead.length + 1) continue;
|
|
116
|
+
const params2 = {};
|
|
117
|
+
let ok2 = true;
|
|
118
|
+
for (let i = 0; i < lead.length; i++) {
|
|
119
|
+
const rs = lead[i];
|
|
120
|
+
const value = segs[i];
|
|
121
|
+
if (rs.param) params2[rs.param] = decodeURIComponent(value);
|
|
122
|
+
else if (rs.literal !== value) {
|
|
123
|
+
ok2 = false;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (!ok2) continue;
|
|
128
|
+
params2[last?.catchAll] = segs.slice(lead.length).map(decodeURIComponent).join("/");
|
|
129
|
+
return { pageId: route.pageId, params: params2 };
|
|
130
|
+
}
|
|
108
131
|
if (route.segments.length !== segs.length) continue;
|
|
109
132
|
const params = {};
|
|
110
133
|
let ok = true;
|
package/dist/cli.js
CHANGED
|
@@ -109,9 +109,9 @@ var main = defineCommand2({
|
|
|
109
109
|
},
|
|
110
110
|
subCommands: {
|
|
111
111
|
new: newCommand,
|
|
112
|
-
dev: () => import("./dev-
|
|
113
|
-
build: () => import("./build-
|
|
114
|
-
start: () => import("./start-
|
|
112
|
+
dev: () => import("./dev-OCVQRCCE.js").then((m) => m.devCommand),
|
|
113
|
+
build: () => import("./build-J47A3B4Y.js").then((m) => m.buildCommand),
|
|
114
|
+
start: () => import("./start-AUJJ7HAY.js").then((m) => m.startCommand),
|
|
115
115
|
make: () => import("./make-JAW22LQZ.js").then((m) => m.makeCommand),
|
|
116
116
|
migrate: () => import("./migrate-NOGFOFV2.js").then((m) => m.migrateCommand),
|
|
117
117
|
mcp: () => import("./mcp-DL4J6JFJ.js").then((m) => m.mcpCommand)
|
|
@@ -20,7 +20,7 @@ var devCommand = defineCommand({
|
|
|
20
20
|
process.stdout.write(banner());
|
|
21
21
|
const sp = spinner(`Starting dev server${args.islands ? " (islands mode)" : ""}\u2026`);
|
|
22
22
|
try {
|
|
23
|
-
const { startDevServer } = await import("./server-
|
|
23
|
+
const { startDevServer } = await import("./server-L3V34B5X.js");
|
|
24
24
|
const { port: actual } = await startDevServer({ root, port, islands: Boolean(args.islands) });
|
|
25
25
|
sp.succeed("Dev server ready");
|
|
26
26
|
ready([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apex-stack/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "The full-stack meta-framework for Alpine.js — CLI and runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"h3": "^1.13.0",
|
|
46
46
|
"vite": "^6.0.7",
|
|
47
47
|
"zod": "^4.4.3",
|
|
48
|
-
"@apex-stack/kit": "0.1.
|
|
48
|
+
"@apex-stack/kit": "0.1.5",
|
|
49
49
|
"@apex-stack/vite": "0.1.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|