From 91fa259ac8dfd1c8bb844020884559be25e874d1 Mon Sep 17 00:00:00 2001 From: Mark Andrus Roberts Date: Thu, 12 Jan 2017 09:28:52 -0800 Subject: [PATCH] Add build steps This commit adds two new commands, `npm run generate` and `npm run build`. The former runs the commands for auto-generating Flow, JSDoc, and TypeScript type declarations. The latter runs the auto-generation commands, typechecks the source according to the auto-generated type declarations, and finally generates JSDoc documentation. --- .travis.yml | 3 ++- package.json | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6e5919de..c3bf7296 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: - - "0.10" + - 6 +script: npm run build diff --git a/package.json b/package.json index 6c98f6e3..8e3e21e5 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,14 @@ "jsdoc": "^3.4.3", "jsondiffpatch": "0.1.43", "mocha": "3.0.2", + "rimraf": "^2.5.4", "typescript": "^2.1.4" }, "scripts": { + "build": "npm run clean && npm run generate && npm run typecheck && npm test && npm run docs", + "clean": "rimraf decls index.d.ts lib/types.js", "docs": "jsdoc -p -r lib -t ./node_modules/docdash -R README.md", + "generate": "npm run generate-flow && npm run generate-jsdoc && npm run generate-typescript", "generate-flow": "node scripts/flow.js webidl2.idl decls", "generate-jsdoc": "node scripts/jsdoc.js webidl2.idl >lib/types.js", "generate-typescript": "node scripts/typescript.js webidl2.idl >index.d.ts",