bun-plugin-stx 0.2.150 → 0.2.152
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/serve.js +3 -2
- package/package.json +1 -1
package/dist/serve.js
CHANGED
|
@@ -8757,7 +8757,7 @@ function extractServerScriptsFromTemplate(content) {
|
|
|
8757
8757
|
return { serverScripts, templateContent: retained.join("") };
|
|
8758
8758
|
}
|
|
8759
8759
|
function buildDynamicRouteRegexes(fileRouteBase) {
|
|
8760
|
-
const toPattern = (p) => p.replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
|
|
8760
|
+
const toPattern = (p) => p.replace(/\[\.\.\.([^\]]+)\]/g, "(.+)").replace(/\[([^\]]+)\]/g, "([^/]+)").replace(/\//g, "\\/");
|
|
8761
8761
|
const patterns = [new RegExp(`^${toPattern(fileRouteBase)}$`)];
|
|
8762
8762
|
const noIndex = fileRouteBase.replace(/\/index$/, "");
|
|
8763
8763
|
if (noIndex !== fileRouteBase)
|
|
@@ -9216,6 +9216,7 @@ After installing: bun add bun-plugin-stx`);
|
|
|
9216
9216
|
const ip = reqCtx ? reqCtx.ip : activeServeIp;
|
|
9217
9217
|
context.__stxServeSearch = search;
|
|
9218
9218
|
globalThis.__stxServeSearch = search;
|
|
9219
|
+
context.query = Object.fromEntries(new URLSearchParams(search ?? ""));
|
|
9219
9220
|
if (host)
|
|
9220
9221
|
context.host = host;
|
|
9221
9222
|
context.cookies = cookies;
|
|
@@ -9708,7 +9709,7 @@ After installing: bun add bun-plugin-stx`);
|
|
|
9708
9709
|
for (const regex of regexPatterns) {
|
|
9709
9710
|
const match = normalizedPath.match(regex);
|
|
9710
9711
|
if (match) {
|
|
9711
|
-
const paramNames = [...fileRouteBase.matchAll(/\[([^\]]+)\]/g)].map((m) => m[1]);
|
|
9712
|
+
const paramNames = [...fileRouteBase.matchAll(/\[([^\]]+)\]/g)].map((m) => m[1].replace(/^\.\.\./, ""));
|
|
9712
9713
|
const paramValues = match.slice(1);
|
|
9713
9714
|
const output = await processTemplateDynamic(filePath, paramNames, paramValues, normalizedPath, reqCtx);
|
|
9714
9715
|
routes.set(requestPath, output);
|
package/package.json
CHANGED