@live-change/cli 0.9.2 → 0.9.3

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.
Files changed (2) hide show
  1. package/lib/starter.js +17 -6
  2. package/package.json +8 -8
package/lib/starter.js CHANGED
@@ -36,6 +36,16 @@ process.on('uncaughtException', function (err) {
36
36
  console.error(err.stack)
37
37
  })
38
38
 
39
+ let argsDefaults = {
40
+ apiHost: process.env.API_SERVER_HOST || '0.0.0.0',
41
+ apiPort: process.env.API_SERVER_PORT || 8002,
42
+
43
+ ssrHost: process.env.SSR_SERVER_HOST || '0.0.0.0',
44
+ ssrPort: process.env.SSR_SERVER_PORT || 8001,
45
+
46
+ sessionCookieDomain: process.env.SESSION_COOKIE_DOMAIN
47
+ }
48
+
39
49
  function startOptions(yargs) {
40
50
  yargs.option('withServices', {
41
51
  type: 'boolean',
@@ -77,12 +87,12 @@ function apiServerOptions(yargs) {
77
87
  yargs.option('apiPort', {
78
88
  describe: 'api server port',
79
89
  type: 'number',
80
- default: process.env.API_SERVER_PORT || 8002
90
+ default: argsDefaults.apiPort
81
91
  })
82
92
  yargs.option('apiHost', {
83
93
  describe: 'api server bind host',
84
94
  type: 'string',
85
- default: process.env.API_SERVER_HOST || '0.0.0.0'
95
+ default: argsDefaults.apiHost
86
96
  })
87
97
  yargs.option('services', {
88
98
  describe: 'services config',
@@ -104,12 +114,12 @@ function ssrServerOptions(yargs) {
104
114
  yargs.option('ssrPort', {
105
115
  describe: 'port to bind on',
106
116
  type: 'number',
107
- default: process.env.SSR_SERVER_PORT || 8001
117
+ default: argsDefaults.ssrPort
108
118
  })
109
119
  yargs.option('ssrHost', {
110
120
  describe: 'bind host',
111
121
  type: 'string',
112
- default: process.env.SSR_SERVER_HOST || '0.0.0.0'
122
+ default: argsDefaults.ssrHost
113
123
  })
114
124
  yargs.option('withApi', {
115
125
  describe: 'start internal api server',
@@ -146,13 +156,14 @@ function ssrServerOptions(yargs) {
146
156
  yargs.option('sessionCookieDomain', {
147
157
  describe: 'domain for session cookie',
148
158
  type: 'string',
149
- default: process.env.SESSION_COOKIE_DOMAIN
159
+ default: argsDefaults.sessionCookieDomain
150
160
  })
151
161
  }
152
162
 
153
163
  let globalServicesConfig
154
164
 
155
- export default function starter(servicesConfig = null) {
165
+ export default function starter(servicesConfig = null, args = {}) {
166
+ argsDefaults = { ...argsDefaults, ...args }
156
167
  globalServicesConfig = servicesConfig
157
168
  yargs(process.argv.slice(2))
158
169
  .command('apiServer', 'start server', (yargs) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/cli",
3
- "version": "0.9.2",
3
+ "version": "0.9.3",
4
4
  "description": "Live Change Framework - command line interface",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,12 +25,12 @@
25
25
  "type": "module",
26
26
  "homepage": "https://github.com/live-change/live-change-stack",
27
27
  "dependencies": {
28
- "@live-change/dao": "^0.9.2",
29
- "@live-change/dao-sockjs": "^0.9.2",
30
- "@live-change/dao-websocket": "^0.9.2",
31
- "@live-change/db-server": "^0.9.2",
32
- "@live-change/framework": "^0.9.2",
33
- "@live-change/server": "^0.9.2",
28
+ "@live-change/dao": "^0.9.3",
29
+ "@live-change/dao-sockjs": "^0.9.3",
30
+ "@live-change/dao-websocket": "^0.9.3",
31
+ "@live-change/db-server": "^0.9.3",
32
+ "@live-change/framework": "^0.9.3",
33
+ "@live-change/server": "^0.9.3",
34
34
  "dotenv": "^16.4.4",
35
35
  "express": "^4.18.2",
36
36
  "http-proxy-middleware": "2.0.6",
@@ -40,5 +40,5 @@
40
40
  "websocket": "^1.0.34",
41
41
  "yargs": "^17.7.2"
42
42
  },
43
- "gitHead": "353f5aa8d66fec68587825db5ba09f63b08f4dee"
43
+ "gitHead": "79f98e67cb1a52a38ced5deb20b0d62d395313cb"
44
44
  }