@ossy/platform 1.23.1 → 1.24.0
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/package.json +4 -4
- package/src/server.js +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/platform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.0",
|
|
4
4
|
"description": "Ossy application server runtime",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"author": "Ossy <yourfriends@ossy.se> (https://ossy.se)",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ossy/router": "^1.
|
|
27
|
-
"@ossy/sdk": "^1.
|
|
26
|
+
"@ossy/router": "^1.25.0",
|
|
27
|
+
"@ossy/sdk": "^1.25.0",
|
|
28
28
|
"cookie-parser": "^1.4.7",
|
|
29
29
|
"dotenv": ">=16.0.0 <18.0.0",
|
|
30
30
|
"express": ">=5.0.0 <6.0.0",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"src",
|
|
35
35
|
"Dockerfile"
|
|
36
36
|
],
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9b116b6a4fadd570c1e6c0c6d9a4867448f7410c"
|
|
38
38
|
}
|
package/src/server.js
CHANGED
|
@@ -42,6 +42,8 @@ export function loadManifest (buildDir) {
|
|
|
42
42
|
const pages = entries.filter((e) => e.type === 'page' && validRoutable(e))
|
|
43
43
|
const apis = entries.filter((e) => e.type === 'api' && validRoutable(e))
|
|
44
44
|
const tasks = entries.filter((e) => e.type === 'task')
|
|
45
|
+
const components = Array.isArray(manifest.components) ? manifest.components : []
|
|
46
|
+
const resourceTemplates = Array.isArray(manifest.resourceTemplates) ? manifest.resourceTemplates : []
|
|
45
47
|
for (const e of entries) {
|
|
46
48
|
if ((e.type === 'page' || e.type === 'api') && !validRoutable(e)) {
|
|
47
49
|
console.warn(`[@ossy/platform][server] Skipping ${e.type} "${e.id}" — manifest entry has no path.`)
|
|
@@ -52,6 +54,8 @@ export function loadManifest (buildDir) {
|
|
|
52
54
|
pages,
|
|
53
55
|
apis,
|
|
54
56
|
tasks,
|
|
57
|
+
components,
|
|
58
|
+
resourceTemplates,
|
|
55
59
|
config: manifest.config || {},
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -158,11 +162,12 @@ export async function startServer (options = {}) {
|
|
|
158
162
|
...(req.userAppSettings || {}),
|
|
159
163
|
theme: req.userAppSettings?.theme || cloneSerializable(config?.theme),
|
|
160
164
|
themes: cloneSerializable(config?.themes),
|
|
161
|
-
resourceTemplates: cloneSerializable(
|
|
165
|
+
resourceTemplates: cloneSerializable(manifest.resourceTemplates),
|
|
162
166
|
url: requestUrl,
|
|
163
167
|
isAuthenticated: !!req.isAuthenticated,
|
|
164
168
|
pages: manifest.pages.map((page) => ({ id: page.id, path: page.path })),
|
|
165
169
|
pageId: pageRoute.id,
|
|
170
|
+
componentEntries: manifest.components,
|
|
166
171
|
}
|
|
167
172
|
const html = await mod.render(props)
|
|
168
173
|
res.status(200).type('html').send(html)
|