@rpcbase/server 0.58.0 → 0.61.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/cli/run_agent.js CHANGED
@@ -2,9 +2,6 @@
2
2
  const path = require("path")
3
3
  const fs = require("fs")
4
4
 
5
- // const get_runtime = require("./get_runtime")
6
- // const run_docker = require("./run_docker")
7
- // const run_native = require("./run_native")
8
5
  const {run} = require("@rpcbase/agent")
9
6
 
10
7
  const run_agent = async() => {
@@ -12,22 +9,7 @@ const run_agent = async() => {
12
9
  const proj_parent_dir = path.join(cwd, "../../")
13
10
  const proj_prefix = path.basename(proj_parent_dir)
14
11
 
15
- console.log("RUN AGENT", proj_prefix)
16
12
  run(proj_prefix)
17
- // const infrastructure_dir = path.join(process.cwd(), "../infrastructure")
18
- //
19
- // // prefix
20
- // const proj_parent_dir = path.join(infrastructure_dir, "../../")
21
- // const proj_prefix = path.basename(proj_parent_dir)
22
- //
23
- // const runtime = get_runtime()
24
- //
25
- // if (runtime === "native") {
26
- // run_native(infrastructure_dir, proj_prefix)
27
- // } else {
28
- // run_docker(infrastructure_dir, proj_prefix)
29
- // }
30
-
31
13
  }
32
14
 
33
15
  module.exports = run_agent
@@ -0,0 +1,12 @@
1
+ /* @flow */
2
+
3
+ const is_production = process.env.NODE_ENV === "production"
4
+
5
+
6
+ module.exports = (app) => {
7
+
8
+ app.post("/api/__dev_save_coverage", (req, res) => {
9
+ console.log(global.__coverage__)
10
+ console.log("WOW save coverage")
11
+ })
12
+ }
package/express/index.js CHANGED
@@ -3,6 +3,7 @@ const cors = require("cors")
3
3
  const express = require("express")
4
4
  const body_parser = require("body-parser")
5
5
 
6
+ const dev_save_coverage = require("./dev_save_coverage")
6
7
  const session_middleware = require("./session_middleware")
7
8
 
8
9
  const is_production = process.env.IS_PRODUCTION === "yes"
@@ -39,7 +40,8 @@ module.exports = () => {
39
40
  [
40
41
  `http://localhost:${CLIENT_PORT}`,
41
42
  // WARNING: hardcoded port
42
- "http://localhost:8090", // TMP: used by client of admin
43
+ "http://localhost:8090", // TMP: used by inspected app from admin
44
+ "http://localhost:9292", // TMP
43
45
  "localhost",
44
46
  ]
45
47
 
@@ -54,6 +56,8 @@ module.exports = () => {
54
56
 
55
57
  app.get("/api/ping", (req, res) => res.json({message: "pong"}))
56
58
  app.post("/api/ping", (req, res) => res.json({message: "pong"}))
59
+ console.log("WITH COVERAGE WOW")
60
+ dev_save_coverage(app)
57
61
 
58
62
  return app
59
63
  }
@@ -61,6 +61,7 @@ setTimeout(async() => {
61
61
  resave: false,
62
62
  })
63
63
 
64
+ // TODO: is this still necessary
64
65
  }, 300)
65
66
 
66
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.58.0",
3
+ "version": "0.61.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -10,7 +10,7 @@
10
10
  "test": "echo \"Error: no test specified\" && exit 0"
11
11
  },
12
12
  "dependencies": {
13
- "@rpcbase/agent": "0.4.0",
13
+ "@rpcbase/agent": "0.6.0",
14
14
  "body-parser": "1.20.0",
15
15
  "connect-redis": "6.1.3",
16
16
  "cors": "2.8.5",