@carats/ssr 0.0.6 → 0.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/index.d.ts +5 -7
- package/dist/index.js +2 -2
- package/package.json +22 -22
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CaratsRequest,
|
|
1
|
+
import { CaratsRequest, Culet } from '@carats/core';
|
|
2
2
|
import { Facets } from '@carats/render';
|
|
3
3
|
|
|
4
4
|
interface CaratsServerEntry {
|
|
@@ -8,11 +8,9 @@ interface CaratsServerEntry {
|
|
|
8
8
|
}>;
|
|
9
9
|
getServerProps: <T = any>(req: CaratsRequest) => Promise<T> | T;
|
|
10
10
|
facets: Facets;
|
|
11
|
-
|
|
11
|
+
culets: Record<string, Culet>;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
declare function defineServerEntry(facets: Facets, hallmarks: Record<string, HallmarkModule>): CaratsServerEntry;
|
|
13
|
+
declare function culet(route: string, culet: Culet): void;
|
|
14
|
+
declare function defineServerEntry(facets: Facets): CaratsServerEntry;
|
|
17
15
|
|
|
18
|
-
export { type CaratsServerEntry, defineServerEntry
|
|
16
|
+
export { type CaratsServerEntry, culet, defineServerEntry };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{getPageComponent as
|
|
2
|
-
<script>window.ssp=${JSON.stringify({for:
|
|
1
|
+
import{getPageComponent as l,renderPage as C}from"@carats/render";import{parseUrl as d}from"@carats/url";import{init as f,transpile as P}from"jjsx";var a={};function w(r,s){a[r]=s}function E(r){f();async function s(t,c){let{component:o,params:i,route:e}=c||l.call(r,t.url.replace("/culet",""));return a[e]?await a[e]({...t,params:i}):o.defaultProps}async function p(t){let{suspense:{error:c}}=r,o=l.call(r,t.url),{path:i}=d(t.url),e=await s(t,o),{component:u}=o,n=u.head||"";n+=`
|
|
2
|
+
<script>window.ssp=${JSON.stringify({for:i,data:e})}</script>`,n=n.trim();let m=await C.call(r,u,e);try{return{html:m,head:n}}catch(g){return{html:P(c(g)),head:n}}}return{render:p,getServerProps:s,facets:r,culets:a}}export{w as culet,E as defineServerEntry};
|
package/package.json
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@carats/ssr",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "SSR module for Carats",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"files": ["dist"],
|
|
8
|
-
"type": "module",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"prepublishOnly": "npm run build",
|
|
11
|
-
"build": "tsup ./src/index.ts --config ../../tsup.config.ts"
|
|
12
|
-
},
|
|
13
|
-
"publishConfig": {
|
|
14
|
-
"access": "public"
|
|
15
|
-
},
|
|
16
|
-
"peerDependencies": {
|
|
17
|
-
"@carats/core": "^0.0.
|
|
18
|
-
"@carats/render": "^0.0.
|
|
19
|
-
"jjsx": "^3.3.0",
|
|
20
|
-
"vite": "^8.0.2"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@carats/ssr",
|
|
3
|
+
"version": "0.0.8",
|
|
4
|
+
"description": "SSR module for Carats",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"type": "module",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"prepublishOnly": "npm run build",
|
|
11
|
+
"build": "tsup ./src/index.ts --config ../../tsup.config.ts"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@carats/core": "^0.0.13",
|
|
18
|
+
"@carats/render": "^0.0.6",
|
|
19
|
+
"jjsx": "^3.3.0",
|
|
20
|
+
"vite": "^8.0.2"
|
|
21
|
+
}
|
|
22
|
+
}
|