upgrade to esm from @std/esm

master
David Kebler 2018-05-16 07:11:28 -07:00
parent 6f633159a3
commit ec2e1451a6
7 changed files with 10 additions and 18 deletions

1
.gitignore vendored
View File

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

View File

@ -2,3 +2,4 @@ tests/
test/
*.test.js
testing/
yarn.lock

View File

@ -1,11 +1,11 @@
{
"name": "@uci/i2c-device",
"version": "0.1.1",
"version": "0.1.3",
"description": "Device Classes for I2C Interfacing",
"main": "src/device-packet.mjs",
"main": "src/device-packet",
"scripts": {
"tscan": "node -r @std/esm examples/tcp-scan || true",
"iscan": "node -r @std/esm examples/ipc-scan || true",
"tscan": "node -r esmexamples/tcp-scan || true",
"iscan": "node -r esmexamples/ipc-scan || true",
"testw": "./node_modules/.bin/mocha --reporter list --recursive --watch",
"test": "istanbul cover ./node_modules/.bin/_mocha test/ --report lcovonly -- -R spec --recursive && codecov || true"
},
@ -27,14 +27,13 @@
"homepage": "https://github.com/uCOMmandIt/i2c#readme",
"dependencies": {
"@uci/base": "^0.1.1",
"@uci/logger": "0.0.1"
"@uci/logger": "^0.0.2"
},
"@std/esm": "cjs",
"devDependencies": {
"@std/esm": "^0.18.0",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"codecov": "^1.0.1",
"esm": "^3.0.21",
"istanbul": "^0.4.5",
"mocha": "^3.2.0"
}

View File

@ -4,15 +4,6 @@ import commands from './bus-device-commands'
// import logger from '../../uci-logger/src/logger'
import logger from '@uci/logger'
let log = {}
const LOG_OPTS = (id) => {
return {
repo:'uci-i2c-device',
npm:'@uci/i2c-device',
file:'src/device-packet.mjs',
class:'Device',
id:id,
instance_created:new Date().getTime()
}}
export default class Device extends Base {
constructor(opts) {
@ -27,8 +18,8 @@ export default class Device extends Base {
opts.sockets = (opts.sockets ? (opts.sockets + ',') : '') + 'bus#c>n'
}
super(opts)
console.log('created i2c device with these options\n', opts)
log = logger.child(LOG_OPTS(this.id))
// console.log('created i2c device with these options\n', opts)
log = logger({file:'src/device-packet.js',class:'Device',name:'i2c-device',id:this.id})
if (!opts.address) log.fatal({opts:opts},'no i2c bus address supplied' )
this.address = opts.address
this._channel = opts.channel // if using TAC9546A channel number on which device is attached