@ossy/app 0.7.1 → 0.7.2
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/cli/server.js +10 -9
- package/package.json +7 -7
package/cli/server.js
CHANGED
|
@@ -33,6 +33,9 @@ const middleware = [
|
|
|
33
33
|
req.headers.workspaceId = userSettings.workspaceId
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
// Check for auth cookie
|
|
37
|
+
req.isAuthenticated = !!req.signedCookies?.auth
|
|
38
|
+
|
|
36
39
|
next()
|
|
37
40
|
},
|
|
38
41
|
...(Middleware || []),
|
|
@@ -56,7 +59,13 @@ app.all('*all', (req, res) => {
|
|
|
56
59
|
|
|
57
60
|
const userAppSettings = req.userAppSettings || {}
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
const appConfig = {
|
|
63
|
+
url: req.url,
|
|
64
|
+
theme: userAppSettings.theme || 'light',
|
|
65
|
+
isAuthenticated: req.isAuthenticated || false,
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
renderToString(App, appConfig)
|
|
60
69
|
.then(html => { res.send(html) })
|
|
61
70
|
.catch(err => { res.send(err) })
|
|
62
71
|
|
|
@@ -66,14 +75,6 @@ app.listen(3000, () => {
|
|
|
66
75
|
console.log('[@ossy/app][server] Running on http://localhost:3000');
|
|
67
76
|
});
|
|
68
77
|
|
|
69
|
-
async function renderToSteam(App, config) {
|
|
70
|
-
|
|
71
|
-
return prerenderToNodeStream(createElement(App, config), {
|
|
72
|
-
bootstrapModules: ['/static/index.js']
|
|
73
|
-
})
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
78
|
async function renderToString(App, config) {
|
|
78
79
|
|
|
79
80
|
const { prelude } = await prerenderToNodeStream(createElement(App, config), {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@ossy/sdk": ">=0.5.0 <1.0.0",
|
|
30
30
|
"@ossy/sdk-react": ">=0.5.0 <1.0.0",
|
|
31
31
|
"@ossy/themes": ">=0.5.0 <1.0.0",
|
|
32
|
-
"@rollup/plugin-alias": "^
|
|
33
|
-
"@rollup/plugin-babel": "6.0
|
|
32
|
+
"@rollup/plugin-alias": "^6.0.0",
|
|
33
|
+
"@rollup/plugin-babel": "6.1.0",
|
|
34
34
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
35
35
|
"@rollup/plugin-inject": "^5.0.5",
|
|
36
36
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@rollup/plugin-terser": "0.4.4",
|
|
40
40
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
41
41
|
"arg": "^5.0.2",
|
|
42
|
-
"babel-loader": "^
|
|
42
|
+
"babel-loader": "^10.0.0",
|
|
43
43
|
"cookie-parser": "^1.4.7",
|
|
44
44
|
"express": ">=5.0.0 <6.0.0",
|
|
45
45
|
"morgan": ">=1.10.1 <2.0.0",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"react-dom": ">=19.0.0 <20.0.0",
|
|
48
48
|
"rollup": "^4.24.3",
|
|
49
49
|
"rollup-plugin-copy": "^3.5.0",
|
|
50
|
-
"rollup-plugin-delete": "^
|
|
50
|
+
"rollup-plugin-delete": "^3.0.2",
|
|
51
51
|
"rollup-plugin-dts": "^6.1.0",
|
|
52
|
-
"rollup-plugin-node-externals": "^
|
|
52
|
+
"rollup-plugin-node-externals": "^8.1.2",
|
|
53
53
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
54
54
|
"rollup-plugin-postcss-modules": "^2.1.1",
|
|
55
55
|
"rollup-plugin-preserve-directives": "^0.4.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"/cli",
|
|
59
59
|
"README.md"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "542a2da440731d12392f8720bd8c09d5af651d8e"
|
|
62
62
|
}
|