upgrade to esm from @std/esm

master
David Kebler 2018-05-16 07:09:52 -07:00
parent d22e3ad785
commit 10acb39693
9 changed files with 13 additions and 21 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
/node_modules/ /node_modules/
/coverage/ /coverage/
/syncd/ /syncd/
*.lock

View File

@ -1,16 +1,16 @@
{ {
"name": "@uci/i2c-bus", "name": "@uci/i2c-bus",
"version": "0.1.2", "version": "0.1.5",
"description": "I2c Bus Classes for Communication to I2C bus via socket or direct call", "description": "I2c Bus Classes for Communication to I2C bus via socket or direct call",
"main": "src/bus-packet.mjs", "main": "src/bus-packet",
"scripts": { "scripts": {
"irelay": "node --require @std/esm examples/ipc-relay", "irelay": "node --require esm examples/ipc-relay",
"iscan": "node --require @std/esm examples/ipc-scan || true", "iscan": "node --require esm examples/ipc-scan || true",
"tscan": "node --require @std/esm examples/tcp-scan || true", "tscan": "node --require esm examples/tcp-scan || true",
"bus": "node --require @std/esm examples/bus", "bus": "node --require esm examples/bus",
"busl": "DEBUG=true node --require @std/esm examples/bus", "busl": "DEBUG=true node --require esm examples/bus",
"test": "mocha -r @std/esm test/*.test.mjs", "test": "mocha -r esm test/*.test.js",
"testw": "mocha -r @std/esm test/*.test.mjs --watch --recurse --watch-extensions mjs", "testw": "mocha -r esm test/*.test.js --watch --recurse",
"testci": "istanbul cover ./node_modules/.bin/_mocha test/ --report lcovonly -- -R spec --recursive && codecov || true" "testci": "istanbul cover ./node_modules/.bin/_mocha test/ --report lcovonly -- -R spec --recursive && codecov || true"
}, },
"author": "David Kebler", "author": "David Kebler",
@ -29,21 +29,20 @@
"url": "https://github.com/uCOMmandIt/i2c/issues" "url": "https://github.com/uCOMmandIt/i2c/issues"
}, },
"homepage": "https://github.com/uCOMmandIt/i2c#readme", "homepage": "https://github.com/uCOMmandIt/i2c#readme",
"@std/esm": "cjs",
"optionalDependencies": { "optionalDependencies": {
"i2c-bus": "^1.x" "i2c-bus": "^1.x"
}, },
"dependencies": { "dependencies": {
"@uci/base": "^0.1.0", "@uci/base": "^0.1.0",
"@uci/logger": "0.0.1", "@uci/logger": "^0.0.2",
"better-try-catch": "^0.6.2", "better-try-catch": "^0.6.2",
"pify": "^3.0.0" "pify": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@std/esm": "^0.18.0",
"chai": "^3.5.0", "chai": "^3.5.0",
"chai-as-promised": "^6.0.0", "chai-as-promised": "^6.0.0",
"codecov": "^1.0.1", "codecov": "^1.0.1",
"esm": "^3.0.21",
"istanbul": "^0.4.5", "istanbul": "^0.4.5",
"mocha": "^3.2.0", "mocha": "^3.2.0",
"nodemon": "^1.14.12" "nodemon": "^1.14.12"

View File

@ -6,18 +6,10 @@ import Base from '@uci/base'
import logger from '@uci/logger' import logger from '@uci/logger'
let log = {} let log = {}
const LOG_OPTS = {
repo:'uci-i2c-bus',
npm:'@uci/i2c-bus',
file:'src/bus-packet.mjs',
class:'Bus',
id:this.id,
instance_created:new Date().getTime()
}
export default class Bus extends Base { export default class Bus extends Base {
constructor(opts) { constructor(opts) {
log = logger.child(LOG_OPTS) log = logger({name:'i2c-bus',id:opts.id,file:'src/bus-packet.js',class:'Bus'})
if (opts.path) opts.ns ={path:opts.path} if (opts.path) opts.ns ={path:opts.path}
if(!opts.ns) opts.ns = {path:'i2c-bus'} if(!opts.ns) opts.ns = {path:'i2c-bus'}
opts.sockets = (opts.sockets ? (opts.sockets+',') : '') + 'ns#s>n' opts.sockets = (opts.sockets ? (opts.sockets+',') : '') + 'ns#s>n'