@live-change/cli 0.1.15 → 0.1.16

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/bin/lcli.js +19 -2
  2. package/package.json +2 -2
package/bin/lcli.js CHANGED
@@ -63,6 +63,10 @@ function startOptions(yargs) {
63
63
  type: 'boolean',
64
64
  description: 'create database if not exists'
65
65
  })
66
+ yargs.option('dbAccess', {
67
+ type: 'boolean',
68
+ description: 'give database access to frontend(only for development and db-admin)'
69
+ })
66
70
  }
67
71
 
68
72
  function apiServerOptions(yargs) {
@@ -181,6 +185,19 @@ const argv = require('yargs') // eslint-disable-line
181
185
  await setupApp({ ...argv, uidBorders: '[]' })
182
186
  await ssrServer({ ...argv, uidBorders: '[]' }, true)
183
187
  })
188
+ .command('localDev', 'shortcut for dev --withDb --createDb', (yargs) => {
189
+ ssrServerOptions(yargs)
190
+ apiServerOptions(yargs)
191
+ startOptions(yargs)
192
+ }, async (argv) => {
193
+ argv = {
194
+ ...argv,
195
+ withApi: true, withServices: true, updateServices: true,
196
+ withDb: true, createDb: true
197
+ }
198
+ await setupApp({ ...argv, uidBorders: '[]' })
199
+ await ssrServer({ ...argv, uidBorders: '[]' }, true)
200
+ })
184
201
  .option('verbose', {
185
202
  alias: 'v',
186
203
  type: 'boolean',
@@ -228,8 +245,8 @@ async function ssrServer(argv, dev) {
228
245
 
229
246
  if(argv.createDb) {
230
247
  const list = await app.dao.get(['database', 'databasesList'])
231
- console.log("EXISTING DATABASES", list)
232
- console.log("CREATE DATABASE!")
248
+ console.log("existing databases:", list.join(', '))
249
+ console.log("creating database", app.databaseName)
233
250
  await app.dao.request(['database', 'createDatabase'], app.databaseName, {
234
251
  storage: { noMetaSync: true, noSync: true }
235
252
  }).catch(err => 'exists')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "Live Change Framework - command line interface",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -29,7 +29,7 @@
29
29
  "@live-change/dao-websocket": "^0.3.2",
30
30
  "@live-change/db-server": "^0.4.82",
31
31
  "@live-change/framework": "^0.5.10",
32
- "@live-change/server": "^0.1.17",
32
+ "@live-change/server": "^0.1.21",
33
33
  "@live-change/vue3-ssr": "^0.1.7",
34
34
  "dotenv": "^10.0.0",
35
35
  "express": "^4.17.1",