primate 0.31.0 → 0.31.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primate",
3
- "version": "0.31.0",
3
+ "version": "0.31.2",
4
4
  "description": "Polymorphic development platform",
5
5
  "homepage": "https://primatejs.com",
6
6
  "bugs": "https://github.com/primatejs/primate/issues",
@@ -19,7 +19,7 @@
19
19
  "directory": "packages/primate"
20
20
  },
21
21
  "dependencies": {
22
- "rcompat": "^0.11.0"
22
+ "rcompat": "^0.11.1"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=18"
@@ -31,7 +31,7 @@ const get_layouts = async (layouts, request) => {
31
31
  const stop_at = layouts.findIndex(({ recursive }) => recursive === false);
32
32
  return Promise.all(layouts
33
33
  .slice(stop_at === -1 ? 0 : stop_at)
34
- .map(layout => layout.default(request)));
34
+ .map(layout => layout(request)));
35
35
  };
36
36
  // last handler, preserve final request form
37
37
  const last = handler => async request => {
@@ -24,6 +24,9 @@ const post = async app => {
24
24
  // copy static files to build/server/static
25
25
  await app.stage(_static, FS.File.join(location.server, location.static));
26
26
 
27
+ // copy static files to build/client/static
28
+ await app.stage(_static, FS.File.join(location.client, location.static));
29
+
27
30
  // publish JavaScript and CSS files
28
31
  const imports = await FS.File.collect(_static, /\.(?:css)$/u);
29
32
  await Promise.all(imports.map(async file => {
@@ -41,7 +41,7 @@ export default app => {
41
41
  const local_parse_body = route.file.body?.parse ?? $request_body_parse;
42
42
  const body = local_parse_body ? await parse_body(original, url) : null;
43
43
  const { guards = [], errors = [], layouts = [] } = o.map(route.specials,
44
- ([key, value]) => [`${key}s`, value.default]);
44
+ ([key, value]) => [`${key}s`, value.map(i => i.default)]);
45
45
  const handler = route.file.default[original.method.toLowerCase()];
46
46
 
47
47
  return { body, path, guards, errors, layouts, handler };