update to esm from @std/esm
parent
5a0af4d75e
commit
78bcf3009a
|
@ -1,3 +1,4 @@
|
|||
/node_modules/
|
||||
/coverage/
|
||||
/syncd/
|
||||
yarn.lock
|
||||
|
|
|
@ -39,8 +39,6 @@ mqtt.socket.mqtt.registerPacketProcessor(process.bind(mqtt))
|
|||
|
||||
console.log(await mqtt.init())
|
||||
|
||||
// process.kill(process.pid, 'SIGTERM')
|
||||
|
||||
})().catch(err => {
|
||||
console.error('FATAL: UNABLE TO START SYSTEM!\n',err)
|
||||
process.kill(process.pid, 'SIGTERM')
|
18
package.json
18
package.json
|
@ -1,14 +1,14 @@
|
|||
{
|
||||
"name": "@uci/base",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.4",
|
||||
"description": "Mutli Level/Transport Message/Event Classes",
|
||||
"main": "src/base",
|
||||
"scripts": {
|
||||
"deve": "./node_modules/.bin/nodemon -r @std/esm -e mjs examples/four-in-one",
|
||||
"fio": "node -r @std/esm examples/four-in-one",
|
||||
"mqtt": "node -r @std/esm examples/mqtt",
|
||||
"testw": "mocha -r @std/esm test/*.test.mjs --watch --recurse --watch-extensions mjs",
|
||||
"test": "mocha -r @std/esm test/*.test.mjs",
|
||||
"deve": "./node_modules/.bin/nodemon -r esm examples/four-in-one",
|
||||
"fio": "node -r esm examples/four-in-one",
|
||||
"mqtt": "node -r esm examples/mqtt",
|
||||
"testw": "mocha -r esm test/*.test.mjs --watch --recurse --watch-extensions mjs",
|
||||
"test": "mocha -r esm test/*.test.mjs",
|
||||
"testci": "istanbul cover ./node_modules/.bin/_mocha --report lcovonly -- -R spec --recursive && codecov || true"
|
||||
},
|
||||
"author": "David Kebler",
|
||||
|
@ -27,18 +27,18 @@
|
|||
"url": "https://github.com/uCOMmandIt/message/issues"
|
||||
},
|
||||
"homepage": "https://github.com/uCOMmandIt/message#readme",
|
||||
"@std/esm": "cjs",
|
||||
"devDependencies": {
|
||||
"@std/esm": "^0.22.0",
|
||||
"chai": "^4.1.2",
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"codecov": "^3.0.0",
|
||||
"esm": "^3.0.22",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^5.0.1",
|
||||
"nodemon": "^1.14.12"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uci/mqtt": "0.0.1",
|
||||
"@uci/logger": "^0.0.3",
|
||||
"@uci/mqtt": "^0.0.5",
|
||||
"@uci/socket": "^0.1.1",
|
||||
"@uci/utils": "^0.1.1"
|
||||
}
|
||||
|
|
|
@ -1,26 +1,19 @@
|
|||
import UCISocket from '@uci/socket'
|
||||
import MQTT from '@uci/mqtt'
|
||||
// import MQTT from '../../uci-mqtt/src/client'
|
||||
import EventEmitter from 'events'
|
||||
import { bindFuncs } from '@uci/utils/src/function'
|
||||
|
||||
import { processor, commands, namespaces } from './processing.mjs'
|
||||
import { processor, commands, namespaces } from './processing'
|
||||
|
||||
import logger from '@uci/logger'
|
||||
let log = {}
|
||||
const LOG_OPTS = {
|
||||
repo:'uci-base',
|
||||
npm:'@uci/base',
|
||||
file:'src/base.mjs',
|
||||
class:'Base',
|
||||
id:this.id,
|
||||
instance_created:new Date().getTime()
|
||||
}
|
||||
|
||||
export default class Base extends EventEmitter {
|
||||
constructor(opts={}) {
|
||||
super()
|
||||
log = logger.child(LOG_OPTS)
|
||||
this.id = opts.id || opts.name || 'uci-base:'+ new Date().getTime()
|
||||
log = logger({name:'base',id:this.id})
|
||||
this.desc = opts.desc // additional details for humans
|
||||
this.socket={}
|
||||
this._processors = { _default: processor }
|
Loading…
Reference in New Issue