primate 0.31.4 → 0.31.6

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.4",
3
+ "version": "0.31.6",
4
4
  "description": "Polymorphic development platform",
5
5
  "homepage": "https://primatejs.com",
6
6
  "bugs": "https://github.com/primatejs/primate/issues",
package/src/app.js CHANGED
@@ -106,14 +106,15 @@ export default async (log, root, config) => {
106
106
  const regexs = paths.map(file => globify(file));
107
107
  const target_base = this.runpath(directory);
108
108
 
109
+ await source.copy(target_base);
110
+
109
111
  await Promise.all((await source.collect(filter)).map(async path => {
110
112
  const debased = path.debase(this.root).path.slice(1);
111
113
  const filename = FS.File.join(directory, path.debase(source));
112
114
  const target = await target_base.join(filename.debase(directory));
113
115
  await target.directory.create();
114
- await (regexs.some(regex => regex.test(debased))
115
- ? target.write(mapper(await path.text()))
116
- : path.copy(target));
116
+ regexs.some(regex => regex.test(debased))
117
+ ?? target.write(mapper(await path.text()));
117
118
  }));
118
119
  },
119
120
  async compile(component) {
@@ -20,7 +20,7 @@ const guard = (app, guards) => async (request, next) => {
20
20
  return next(request);
21
21
  } catch (error) {
22
22
  if (error.type === guard_error) {
23
- return { response: respond(error.result)(app) };
23
+ return { request, response: respond(error.result)(app) };
24
24
  }
25
25
  // rethrow if not guard error
26
26
  throw error;
package/src/start.js CHANGED
@@ -20,7 +20,7 @@ const publish = async app => {
20
20
  const type = path.extension === ".css" ? "style" : "module";
21
21
  await app.publish({ src, type });
22
22
  if (path.extension === ".js") {
23
- const imports = { app: FS.File.join(http.static.root, src).path };
23
+ const imports = { app: FS.File.join(http.static.root, src).webpath() };
24
24
  await app.publish({
25
25
  inline: true,
26
26
  code: JSON.stringify({ imports }, null, 2),