@solidjs/start 1.0.6 → 1.0.8
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/router/lazyRoute.d.ts +1 -1
- package/dist/router/routes.js +1 -1
- package/dist/server/fetchEvent.js +4 -4
- package/env.d.ts +3 -3
- package/package.json +6 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Component } from "solid-js";
|
|
2
|
-
export default function lazyRoute<T
|
|
2
|
+
export default function lazyRoute<T extends Record<string, any>>(component: any, clientManifest: any, serverManifest: any, exported?: string): Component<T> & {
|
|
3
3
|
preload: () => Promise<{
|
|
4
4
|
default: Component<T>;
|
|
5
5
|
}>;
|
package/dist/router/routes.js
CHANGED
|
@@ -38,7 +38,7 @@ const router = createRouter({
|
|
|
38
38
|
routes: fileRoutes.reduce((memo, route) => {
|
|
39
39
|
if (!containsHTTP(route))
|
|
40
40
|
return memo;
|
|
41
|
-
let path = route.path.replace(/\/\([^)/]+\)/g, "").replace(/\([^)/]+\)/g, "").replace(/\*([^/]*)/g, (_, m) => `**:${m}`);
|
|
41
|
+
let path = route.path.replace(/\/\([^)/]+\)/g, "").replace(/\([^)/]+\)/g, "").replace(/\*([^/]*)/g, (_, m) => `**:${m}`).split('/').map(s => (s.startsWith(':') || s.startsWith('*')) ? s : encodeURIComponent(s)).join('/');
|
|
42
42
|
if (/:[^/]*\?/g.test(path)) {
|
|
43
43
|
throw new Error(`Optional parameters are not supported in API routes: ${path}`);
|
|
44
44
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { appendResponseHeader, getRequestIP, getResponseHeader, getResponseHeaders, getResponseStatus, getResponseStatusText, getWebRequest, removeResponseHeader, setResponseHeader, setResponseStatus } from "vinxi/http";
|
|
2
|
-
const
|
|
2
|
+
const fetchEventContext = "solidFetchEvent";
|
|
3
3
|
export function createFetchEvent(event) {
|
|
4
4
|
return {
|
|
5
5
|
request: getWebRequest(event),
|
|
@@ -15,11 +15,11 @@ export function cloneEvent(fetchEvent) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export function getFetchEvent(h3Event) {
|
|
18
|
-
if (!h3Event[
|
|
18
|
+
if (!h3Event.context[fetchEventContext]) {
|
|
19
19
|
const fetchEvent = createFetchEvent(h3Event);
|
|
20
|
-
h3Event[
|
|
20
|
+
h3Event.context[fetchEventContext] = fetchEvent;
|
|
21
21
|
}
|
|
22
|
-
return h3Event[
|
|
22
|
+
return h3Event.context[fetchEventContext];
|
|
23
23
|
}
|
|
24
24
|
export function mergeResponseHeaders(h3Event, headers) {
|
|
25
25
|
for (const [key, value] of headers.entries()) {
|
package/env.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ interface ImportMetaEnv extends Record<`VITE_${string}`, any>, SolidStartMetaEnv
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
interface SolidStartMetaEnv {
|
|
16
|
-
START_SSR:
|
|
17
|
-
START_ISLANDS:
|
|
18
|
-
START_DEV_OVERLAY:
|
|
16
|
+
START_SSR: boolean;
|
|
17
|
+
START_ISLANDS: boolean;
|
|
18
|
+
START_DEV_OVERLAY: boolean;
|
|
19
19
|
SERVER_BASE_URL: string;
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/start",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
@@ -55,14 +55,14 @@
|
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"solid-js": "^1.
|
|
59
|
-
"vinxi": "^0.4.
|
|
58
|
+
"solid-js": "^1.9.1",
|
|
59
|
+
"vinxi": "^0.4.3",
|
|
60
60
|
"typescript": "^5.4.2"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@vinxi/plugin-directives": "^0.4.
|
|
64
|
-
"@vinxi/server-components": "^0.4.
|
|
65
|
-
"@vinxi/server-functions": "^0.4.
|
|
63
|
+
"@vinxi/plugin-directives": "^0.4.3",
|
|
64
|
+
"@vinxi/server-components": "^0.4.3",
|
|
65
|
+
"@vinxi/server-functions": "^0.4.3",
|
|
66
66
|
"defu": "^6.1.2",
|
|
67
67
|
"error-stack-parser": "^2.1.4",
|
|
68
68
|
"glob": "^10.3.10",
|
|
@@ -73,7 +73,6 @@
|
|
|
73
73
|
"shikiji": "^0.9.12",
|
|
74
74
|
"source-map-js": "^1.0.2",
|
|
75
75
|
"terracotta": "^1.0.4",
|
|
76
|
-
"vite-plugin-inspect": "^0.7.33",
|
|
77
76
|
"vite-plugin-solid": "^2.10.2"
|
|
78
77
|
},
|
|
79
78
|
"scripts": {
|