upgrade to esm from @std/esm
parent
6f633159a3
commit
ec2e1451a6
|
@ -1,3 +1,4 @@
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/coverage/
|
/coverage/
|
||||||
/syncd/
|
/syncd/
|
||||||
|
yarn.lock
|
||||||
|
|
|
@ -2,3 +2,4 @@ tests/
|
||||||
test/
|
test/
|
||||||
*.test.js
|
*.test.js
|
||||||
testing/
|
testing/
|
||||||
|
yarn.lock
|
||||||
|
|
13
package.json
13
package.json
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "@uci/i2c-device",
|
"name": "@uci/i2c-device",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"description": "Device Classes for I2C Interfacing",
|
"description": "Device Classes for I2C Interfacing",
|
||||||
"main": "src/device-packet.mjs",
|
"main": "src/device-packet",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"tscan": "node -r @std/esm examples/tcp-scan || true",
|
"tscan": "node -r esmexamples/tcp-scan || true",
|
||||||
"iscan": "node -r @std/esm examples/ipc-scan || true",
|
"iscan": "node -r esmexamples/ipc-scan || true",
|
||||||
"testw": "./node_modules/.bin/mocha --reporter list --recursive --watch",
|
"testw": "./node_modules/.bin/mocha --reporter list --recursive --watch",
|
||||||
"test": "istanbul cover ./node_modules/.bin/_mocha test/ --report lcovonly -- -R spec --recursive && codecov || true"
|
"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",
|
"homepage": "https://github.com/uCOMmandIt/i2c#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@uci/base": "^0.1.1",
|
"@uci/base": "^0.1.1",
|
||||||
"@uci/logger": "0.0.1"
|
"@uci/logger": "^0.0.2"
|
||||||
},
|
},
|
||||||
"@std/esm": "cjs",
|
|
||||||
"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"
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,15 +4,6 @@ import commands from './bus-device-commands'
|
||||||
// import logger from '../../uci-logger/src/logger'
|
// import logger from '../../uci-logger/src/logger'
|
||||||
import logger from '@uci/logger'
|
import logger from '@uci/logger'
|
||||||
let log = {}
|
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 {
|
export default class Device extends Base {
|
||||||
constructor(opts) {
|
constructor(opts) {
|
||||||
|
@ -27,8 +18,8 @@ export default class Device extends Base {
|
||||||
opts.sockets = (opts.sockets ? (opts.sockets + ',') : '') + 'bus#c>n'
|
opts.sockets = (opts.sockets ? (opts.sockets + ',') : '') + 'bus#c>n'
|
||||||
}
|
}
|
||||||
super(opts)
|
super(opts)
|
||||||
console.log('created i2c device with these options\n', opts)
|
// console.log('created i2c device with these options\n', opts)
|
||||||
log = logger.child(LOG_OPTS(this.id))
|
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' )
|
if (!opts.address) log.fatal({opts:opts},'no i2c bus address supplied' )
|
||||||
this.address = opts.address
|
this.address = opts.address
|
||||||
this._channel = opts.channel // if using TAC9546A channel number on which device is attached
|
this._channel = opts.channel // if using TAC9546A channel number on which device is attached
|
Loading…
Reference in New Issue