Skip to content

Commit 009dd8e

Browse files
committed
fix(usb): user-config-json-to-bin compile
1 parent 7ab55e9 commit 009dd8e

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

packages/usb/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"build": "tsc"
99
},
1010
"devDependencies": {
11-
"@types/node": "8.0.28"
11+
"@types/node": "8.0.28",
12+
"typescript": "2.5.3"
1213
},
1314
"dependencies": {
1415
"chalk": "2.1.0",

packages/usb/tsconfig.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"compileOnSave": false,
3+
"compilerOptions": {
4+
"sourceMap": true,
5+
"declaration": false,
6+
"module": "commonjs",
7+
"moduleResolution": "node",
8+
"emitDecoratorMetadata": true,
9+
"experimentalDecorators": true,
10+
"target": "es2016",
11+
"typeRoots": [
12+
"node_modules/@types"
13+
],
14+
"lib": [
15+
"es2015.iterable",
16+
"es2016",
17+
"dom",
18+
"dom.iterable"
19+
]
20+
}
21+
}

packages/usb/user-config-json-to-bin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { UhkBuffer, UserConfiguration } from '../uhk-common/src/config-serializer/index';
1+
import { UhkBuffer, UserConfiguration } from 'uhk-common';
22
import * as fs from 'fs';
33

44
const inputFile = process.argv[2];
55
console.log(inputFile);
66
const outputFile = process.argv[3];
77

8-
const config1Js = JSON.parse(fs.readFileSync(inputFile));
8+
const config1Js = JSON.parse(fs.readFileSync(inputFile).toString());
99
const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js);
1010
const config1Buffer = new UhkBuffer();
1111
config1Ts.toBinary(config1Buffer);

0 commit comments

Comments
 (0)