@live-change/server 0.1.19 → 0.1.20

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/lib/Services.js CHANGED
@@ -4,6 +4,8 @@ const path = require('path')
4
4
  const resolve = require('util').promisify(require('resolve'))
5
5
  const app = require("@live-change/framework").app()
6
6
 
7
+ const debug = require('debug')('framework')
8
+
7
9
  class Services {
8
10
  constructor(configPath) {
9
11
  if(!configPath) throw new Error("services config parameter is required")
@@ -18,12 +20,12 @@ class Services {
18
20
 
19
21
  async resolve(file) {
20
22
  const path = await resolve(file, { basedir: this.servicesDir })
21
- console.log("PATH RESOLVE", file, "IN", this.servicesDir, "=>", path)
23
+ debug("PATH RESOLVE", file, "IN", this.servicesDir, "=>", path)
22
24
  return path
23
25
  }
24
26
  async getServiceEntryFile(config) {
25
27
  const path = await resolve(config.path, { basedir: this.servicesDir })
26
- console.log("PATH RESOLVE", config.path, "IN", this.servicesDir, "=>", path)
28
+ debug("PATH RESOLVE", config.path, "IN", this.servicesDir, "=>", path)
27
29
  return path
28
30
  }
29
31
 
@@ -39,14 +41,14 @@ class Services {
39
41
  if(this.config.plugins) {
40
42
  for(const plugin of this.config.plugins) {
41
43
  const entryFile = await this.getServiceEntryFile(plugin)
42
- console.log("PLUGIN", plugin, 'ENTRY FILE', entryFile)
44
+ debug("PLUGIN", plugin, 'ENTRY FILE', entryFile)
43
45
  this.plugins.push(require(entryFile))
44
46
  }
45
47
  }
46
48
  if(this.config.services) {
47
49
  for(const service of this.config.services) {
48
50
  const entryFile = await this.getServiceEntryFile(service)
49
- console.log("SERVICE", service, 'ENTRY FILE', entryFile)
51
+ debug("SERVICE", service, 'ENTRY FILE', entryFile)
50
52
  const definition = require(entryFile)
51
53
  if(definition.name != service.name) {
52
54
  console.error("SERVICE", service, "NAME", service.name, "MISMATCH", definition.name)
package/lib/setupApp.js CHANGED
@@ -4,12 +4,14 @@ const setupDbServer = require('./setupDbServer.js')
4
4
  const setupDbClient = require('./setupDbClient.js')
5
5
  const createLoopbackDao = require('./createLoopbackDao.js')
6
6
 
7
+ const debug = require('debug')('server:app')
8
+
7
9
  async function setupApp(settings, env = process.env) {
8
10
  const app = require("@live-change/framework").app()
9
11
  app.instanceId = encodeNumber(hashCode(
10
12
  `app${process.pid}${require("os").hostname()} ${process.cwd()}/${process.argv.join(' ')}`))
11
13
  app.uidGenerator = uidGenerator(app.instanceId, 1, settings.uidBorders)
12
- console.log("SETUP APP", settings)
14
+ debug("SETUP APP", settings)
13
15
  let dbServer
14
16
  if(settings.withDb) {
15
17
  dbServer = await setupDbServer(settings)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/server",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "Live Change Framework - server",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@live-change/dao": "^0.3.12",
25
25
  "@live-change/dao-sockjs": "^0.2.1",
26
- "@live-change/db-server": "^0.4.82",
26
+ "@live-change/db-server": "^0.5.3",
27
27
  "@live-change/framework": "^0.5.10",
28
28
  "@live-change/vue3-ssr": "^0.1.7",
29
29
  "@live-change/uid": "^0.1.4",