diff --git a/packages/usb/package.json b/packages/usb/package.json index 9e3aade4..2e87cd33 100644 --- a/packages/usb/package.json +++ b/packages/usb/package.json @@ -8,7 +8,8 @@ "build": "tsc" }, "devDependencies": { - "@types/node": "8.0.28" + "@types/node": "8.0.28", + "typescript": "2.5.3" }, "dependencies": { "chalk": "2.1.0", diff --git a/packages/usb/tsconfig.json b/packages/usb/tsconfig.json new file mode 100644 index 00000000..3206d971 --- /dev/null +++ b/packages/usb/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "sourceMap": true, + "declaration": false, + "module": "commonjs", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es2016", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2015.iterable", + "es2016", + "dom", + "dom.iterable" + ] + } +} diff --git a/packages/usb/user-config-json-to-bin.ts b/packages/usb/user-config-json-to-bin.ts index 60e42f67..a7f37cd0 100644 --- a/packages/usb/user-config-json-to-bin.ts +++ b/packages/usb/user-config-json-to-bin.ts @@ -1,11 +1,11 @@ -import { UhkBuffer, UserConfiguration } from '../uhk-common/src/config-serializer/index'; +import { UhkBuffer, UserConfiguration } from 'uhk-common'; import * as fs from 'fs'; const inputFile = process.argv[2]; console.log(inputFile); const outputFile = process.argv[3]; -const config1Js = JSON.parse(fs.readFileSync(inputFile)); +const config1Js = JSON.parse(fs.readFileSync(inputFile).toString()); const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js); const config1Buffer = new UhkBuffer(); config1Ts.toBinary(config1Buffer);