From 8eacb3ffba37db36dc028d02e5bf5f133a5558d5 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Fri, 11 Dec 2015 18:57:26 -0600 Subject: [PATCH] refactor: Move lib to src and add lint/babel --- .babelrc | 3 +++ .gitignore | 2 ++ .npmignore | 1 + .nvmrc | 1 + package.json | 28 ++++++++++++++++++++++++---- {lib => src}/haxfred-slack.js | 0 {lib => src}/onError.js | 0 {lib => src}/onMessage.js | 0 {lib => src}/onOpen.js | 0 test/mocha.opts | 7 ++----- 10 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 .babelrc create mode 100644 .npmignore create mode 100644 .nvmrc rename {lib => src}/haxfred-slack.js (100%) rename {lib => src}/onError.js (100%) rename {lib => src}/onMessage.js (100%) rename {lib => src}/onOpen.js (100%) diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..c13c5f6 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015"] +} diff --git a/.gitignore b/.gitignore index 3c3629e..45f7222 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +*.log +lib diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..8eba6c8 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +src/ diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +4 diff --git a/package.json b/package.json index fc9a4b9..07c3b39 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,13 @@ { "name": "haxfred-slack", - "version": "0.0.1", + "version": "0.1.0", "description": "Integration between Haxfred and Slack", "main": "./lib/haxfred-slack", "scripts": { - "test": "mocha" + "test": "npm run lint && mocha", + "prepublish": "npm test && npm run build", + "build": "babel src --out-dir lib", + "lint": "standard --verbose | snazzy" }, "repository": { "type": "git", @@ -23,12 +26,29 @@ "slack-client": "^1.4.0" }, "devDependencies": { - "babel": "^5.5.6", + "babel-cli": "^6.3.17", + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.3.13", "chai": "^2.2.0", "haxfred": "haxiom/haxfred", "mocha": "^2.2.4", "rewire": "^2.3.4", "sinon": "^1.14.1", - "sinon-chai": "^2.7.0" + "sinon-chai": "^2.7.0", + "snazzy": "^2.0.1", + "standard": "^5.4.1" + }, + "standard": { + "globals": [ + "describe", + "context", + "before", + "beforeEach", + "after", + "afterEach", + "it", + "expect", + "sandbox" + ] } } diff --git a/lib/haxfred-slack.js b/src/haxfred-slack.js similarity index 100% rename from lib/haxfred-slack.js rename to src/haxfred-slack.js diff --git a/lib/onError.js b/src/onError.js similarity index 100% rename from lib/onError.js rename to src/onError.js diff --git a/lib/onMessage.js b/src/onMessage.js similarity index 100% rename from lib/onMessage.js rename to src/onMessage.js diff --git a/lib/onOpen.js b/src/onOpen.js similarity index 100% rename from lib/onOpen.js rename to src/onOpen.js diff --git a/test/mocha.opts b/test/mocha.opts index 2f6ae99..ee59cd6 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1,10 +1,7 @@ --colors --reporter spec ---timeout 8000 ---growl ---debug ---compilers js:babel/register --check-leaks +--compilers js:babel-register --require ./test/helpers/globals --globals sandbox ---recursive +--recursive