@rpcbase/server 0.62.0 → 0.63.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.
@@ -3,7 +3,6 @@ const os = require("os")
3
3
 
4
4
  const get_runtime = () => {
5
5
  if (os.platform() === "darwin") {
6
- console.warn("warning22222: native mode is tmp disabled")
7
6
  return "native"
8
7
  } else {
9
8
  return "docker"
package/cli/run_docker.js CHANGED
@@ -1,7 +1,9 @@
1
1
  /* @flow */
2
- const {exec} = require("child_process")
2
+ const {spawn} = require("child_process")
3
3
  const path = require("path")
4
4
 
5
+ const chalk = require("chalk")
6
+
5
7
  const is_production = "yes" === process.env.INFRASTRUCTURE_IS_PRODUCTION
6
8
 
7
9
  const run_docker = async(infrastructure_dir, proj_prefix, is_native) => {
@@ -9,28 +11,45 @@ const run_docker = async(infrastructure_dir, proj_prefix, is_native) => {
9
11
  const env_path = path.relative(infrastructure_dir, path.join(process.cwd(), "./.env"))
10
12
 
11
13
  // compose files
12
- const compose_files = ["-f common.yml"]
14
+ const compose_files = ["-f", "common.yml"]
13
15
  if (!is_native) {
14
- compose_files.push("-f native.yml")
16
+ compose_files.push("-f", "native.yml")
15
17
  }
16
18
  if (is_production) {
17
- compose_files.push("-f prod.yml")
19
+ compose_files.push("-f", "prod.yml")
18
20
  }
19
- else compose_files.push("-f dev.yml")
21
+ else compose_files.push("-f", "dev.yml")
20
22
 
21
23
  const opts = ["--build", "--remove-orphans"]
22
24
  if (!is_production) opts.push("--abort-on-container-exit")
23
25
 
24
- const cmd = `docker-compose --env-file ${env_path} -p ${proj_prefix} ${compose_files.join(" ")} up ${opts.join(" ")}`
25
-
26
- console.log(cmd)
26
+ const cmd = "docker-compose"
27
+ // const cmd_args = `--env-file ${env_path} -p ${proj_prefix} ${compose_files.join(" ")} up ${opts.join(" ")}`
28
+ const cmd_args = ["--env-file", env_path, "-p", proj_prefix, ...compose_files, "up", ...opts]
29
+
30
+ console.log(cmd_args.join(" "))
31
+
32
+ const ps = spawn(cmd, cmd_args, {cwd: infrastructure_dir})
33
+ ps.stdout.on("data", (data) => {
34
+ const lines = data.toString().split("\n")
35
+ lines.forEach((line) => {
36
+ if (line.trim() === "") {
37
+ return
38
+ }
39
+ process.stdout.write(`${chalk.cyan("docker")}: ${line}`)
40
+ })
41
+ })
27
42
 
28
- exec(cmd, {stdio: "inherit", cwd: infrastructure_dir}, (err) => {
29
- if (err) {
30
- console.log("GOT ERRR", err)
31
- }
32
- console.log("docker process exited")
43
+ ps.stderr.on("data", (data) => {
44
+ const lines = data.toString().split("\n")
45
+ lines.forEach((line) => {
46
+ if (line.trim() === "") {
47
+ return
48
+ }
49
+ process.stdout.write(`${chalk.cyan("docker")}: ${chalk.yellow(line)}\n`)
50
+ })
33
51
  })
52
+
34
53
  // try {
35
54
  //
36
55
  // } catch (err) {
package/express/index.js CHANGED
@@ -56,7 +56,7 @@ module.exports = () => {
56
56
 
57
57
  app.get("/api/ping", (req, res) => res.json({message: "pong"}))
58
58
  app.post("/api/ping", (req, res) => res.json({message: "pong"}))
59
- console.log("WITH COVERAGE WOW")
59
+
60
60
  dev_save_coverage(app)
61
61
 
62
62
  return app
package/index.js CHANGED
@@ -5,6 +5,7 @@ const express = require("./express")
5
5
  const rpc_router = require("./rpc/rpc_router")
6
6
 
7
7
 
8
+
8
9
  module.exports = {
9
10
  client_router,
10
11
  database,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.62.0",
3
+ "version": "0.63.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {