@primate/go 0.1.4 → 0.1.5

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/go",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Primate Go backend",
5
5
  "homepage": "https://primatejs.com/modules/go",
6
6
  "bugs": "https://github.com/primatejs/primate/issues",
@@ -26,10 +26,10 @@
26
26
  "@rcompat/runtime": "^0.1.0",
27
27
  "@rcompat/stdio": "^0.5.0",
28
28
  "@rcompat/string": "^0.4.0",
29
- "@primate/core": "^0.1.9"
29
+ "@primate/core": "^0.1.10"
30
30
  },
31
31
  "peerDependencies": {
32
- "primate": "^0.32.5"
32
+ "primate": "^0.32.6"
33
33
  },
34
34
  "type": "module",
35
35
  "imports": {
@@ -1,4 +1,4 @@
1
- import faulty_route from "#error/faulty-route";
1
+ import route_error from "#error/route-error";
2
2
  import pkgname from "#pkgname";
3
3
  import log from "@primate/core/log";
4
4
  import dim from "@rcompat/cli/color/dim";
@@ -9,7 +9,7 @@ import execute from "@rcompat/stdio/execute";
9
9
  import upperfirst from "@rcompat/string/upperfirst";
10
10
  import verbs from "@primate/core/http/verbs";
11
11
 
12
- const command = "go";
12
+ const command = (await execute("which go")).replaceAll("\n", "");
13
13
  const run = (wasm, go, includes = "request.go") =>
14
14
  `${command} build -o ${wasm} ${go} ${includes}`;
15
15
  const verbs_string = verbs.map(upperfirst).join("|");
@@ -167,7 +167,7 @@ export default ({ extension }) => (app, next) => {
167
167
  await execute(run(wasm, go, includes.join(" ")),
168
168
  { cwd, env: { HOME: user.HOME, ...env } });
169
169
  } catch (error) {
170
- faulty_route(file, error);
170
+ route_error(file, error);
171
171
  }
172
172
  });
173
173
 
@@ -6,5 +6,6 @@ export default (...params) => log.error({
6
6
  params,
7
7
  name: file(import.meta.url).base,
8
8
  module: pkgname,
9
- message: "the Go route {0} contains the following error\n {1}",
9
+ message: "error in Go route {0}",
10
+ fix: "fix route error:\n{1}",
10
11
  });