diff --git a/.gitignore b/.gitignore index 24c853d..ba63714 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules/ /coverage/ /syncd/ +yarn.lock diff --git a/examples/four-in-one.mjs b/examples/four-in-one.js similarity index 100% rename from examples/four-in-one.mjs rename to examples/four-in-one.js diff --git a/examples/mqtt.mjs b/examples/mqtt.js similarity index 96% rename from examples/mqtt.mjs rename to examples/mqtt.js index 3e2399d..9a106e3 100644 --- a/examples/mqtt.mjs +++ b/examples/mqtt.js @@ -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') diff --git a/package.json b/package.json index 5d7193d..11b5ef0 100644 --- a/package.json +++ b/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" } diff --git a/src/base.mjs b/src/base.js similarity index 96% rename from src/base.mjs rename to src/base.js index 2ad988e..bbf624a 100644 --- a/src/base.mjs +++ b/src/base.js @@ -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 } diff --git a/src/processing.mjs b/src/processing.js similarity index 100% rename from src/processing.mjs rename to src/processing.js diff --git a/test/base.test.mjs b/test/base.test.js similarity index 100% rename from test/base.test.mjs rename to test/base.test.js