From eb68bb1a1ac8b4fad674de183ad1a732b5a182cb Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Thu, 23 Nov 2017 12:53:28 +0100 Subject: [PATCH] Set up TypeScript compilation, and make a small start on converting the CLI Change-Type: patch --- .gitignore | 1 + lib/{config.coffee => config.ts} | 0 package.json | 5 +++-- tsconfig.json | 16 ++++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) rename lib/{config.coffee => config.ts} (100%) create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 33a9fd47..db103221 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ build/Release node_modules npm-shrinkwrap.json +package-lock.json .resinconf resinrc.yml diff --git a/lib/config.coffee b/lib/config.ts similarity index 100% rename from lib/config.coffee rename to lib/config.ts diff --git a/package.json b/package.json index 0b5ca32a..138a2d85 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "resin": "./bin/resin" }, "scripts": { - "build": "gulp coffee && npm run doc", + "build": "gulp coffee && tsc && npm run doc", "ci": "npm run build && catch-uncommitted", "doc": "mkdir -p doc/ && coffee extras/capitanodoc/index.coffee > doc/cli.markdown", "watch": "gulp watch", @@ -42,7 +42,8 @@ "gulp-coffee": "^2.2.0", "gulp-coffeelint": "^0.6.0", "gulp-shell": "^0.5.2", - "require-npm4-to-publish": "^1.0.0" + "require-npm4-to-publish": "^1.0.0", + "typescript": "^2.5.3" }, "dependencies": { "@resin.io/valid-email": "^0.1.0", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..fc436833 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "outDir": "build", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "preserveConstEnums": true, + "removeComments": true, + "sourceMap": true + }, + "include": [ + "./lib/**/*.ts" + ] +}