From dff29779f0f2df55a1fcca7db53ba68f8f6cbe0b Mon Sep 17 00:00:00 2001 From: "kebler.net" Date: Sat, 24 Apr 2021 18:36:55 -0700 Subject: [PATCH] 0.3.0 move to native esm --- package.json | 18 +++++++++--------- src/byte.js | 13 ++++++------- test/array.test.js | 2 +- test/byte.test.js | 4 ++-- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index fc13653..ddf8982 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,12 @@ { "name": "@uci-utils/byte", - "version": "0.2.3", + "version": "0.3.0", "description": "Byte Class and related functions", "main": "src/byte.js", + "type": "module", "scripts": { - "test": "./node_modules/.bin/mocha -r esm --timeout 30000", - "testd": "UCI_ENV=dev ./node_modules/.bin/nodemon --exec './node_modules/.bin/mocha -r esm --timeout 30000' || exit 0", + "test": "./node_modules/.bin/mocha --timeout 30000", + "testd": "UCI_ENV=dev ./node_modules/.bin/nodemon --exec './node_modules/.bin/mocha --timeout 30000' || exit 0", "testdd": "UCI_LOG_LEVEL='trace' npm run testd", "testde": "UCI_LOG_LEVEL='warn' npm run testd", "testl": "UCI_ENV=pro UCI_LOG_PATH=./test/test.log 0 npm run test || exit 0" @@ -28,13 +29,12 @@ }, "homepage": "https://github.com/uCOMmandIt/uci-utils#readme", "dependencies": { - "@uci-utils/logger": "^0.0.15", - "bitwise": "^2.0.3" + "@uci-utils/logger": "^0.1.0", + "bitwise": "^2.1.0" }, "devDependencies": { - "chai": "^4.2.0", - "esm": "^3.2.25", - "mocha": "^6.2.0", - "nodemon": "^1.19.1" + "chai": "^4.3.4", + "mocha": "^8.3.2", + "nodemon": "^2.0.7" } } diff --git a/src/byte.js b/src/byte.js index 20c2f29..8ff3a8b 100644 --- a/src/byte.js +++ b/src/byte.js @@ -1,12 +1,11 @@ // third party modules -import bits from 'bitwise/bits' -import toBits from 'bitwise/string/to-bits' -import readUInt from 'bitwise/buffer/read-u-int' -import createBuffer from 'bitwise/buffer/create' -import readByte from 'bitwise/byte/read' -import writeByte from 'bitwise/byte/write' +import bits from 'bitwise/bits/index.js' +import { toBits } from 'bitwise/string/index.js' +import { readUInt } from 'bitwise/buffer/index.js' +import { create as createBuffer } from 'bitwise/buffer/index.js' +import { read as readByte, write as writeByte } from 'bitwise/byte/index.js' //local -import * as array from './array' +import * as array from './array.js' import logger from '@uci-utils/logger' diff --git a/test/array.test.js b/test/array.test.js index cd74c6c..02f0858 100644 --- a/test/array.test.js +++ b/test/array.test.js @@ -2,7 +2,7 @@ let date = new Date(Date.now()) console.log('run:', date.getMinutes(), ':', date.getSeconds()) import { expect } from 'chai' -import * as _ from '../src/array' +import * as _ from '../src/array.js' describe('Array Library - ', function () { diff --git a/test/byte.test.js b/test/byte.test.js index 74fc8fc..94e69b7 100644 --- a/test/byte.test.js +++ b/test/byte.test.js @@ -2,7 +2,7 @@ let date = new Date(Date.now()) console.log('run:', date.getMinutes(), ':', date.getSeconds()) import { expect } from 'chai' -import * as _ from '../src/byte' +import * as _ from '../src/byte.js' describe('Byte Library - ', function () { @@ -21,7 +21,7 @@ describe('Byte Library - ', function () { // console.log('input', ifmt, byte) _.BYTE_FORMATS.forEach((ofmt, o) => { fmt.out = ofmt - // console.log(fmt.out, _.byteFormat(byte, fmt)) + // console.log('output', fmt.out, _.byteFormat(byte, fmt)) expect(_.byteFormat(byte, fmt)).deep.equal(results[o]) }) })