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/.npmignore b/.npmignore new file mode 100644 index 0000000..09d6466 --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +.gitignore +.codeclimate.yml +coverage +.travis.yml diff --git a/package.json b/package.json index 487565f..ead7fdd 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "description": "Parses a DOM Node for tags and executes the matching constructor on each element.", "main": "dist/assembler.js", "scripts": { - "postinstall": "npm run build", + "prepublish": "npm run build", "build": "browserify src/assembler.js -o dist/assembler.js --standalone reduct.assembler -t [ babelify --presets [ es2015 ] ]", "lint": "xo src/**/*.js", - "mocha": "export TEST=true && find ./src -name '*.spec.js' | xargs istanbul cover -x *.spec.js _mocha -- -R spec --compilers js:babel/register", + "mocha": "export TEST=true && find ./src -name '*.spec.js' | xargs istanbul cover -x *.spec.js _mocha -- -R spec --compilers js:babel-register", "test": "npm run lint && npm run mocha && npm run build", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, @@ -49,15 +49,20 @@ }, "homepage": "https://github.com/reduct/assembler", "devDependencies": { - "@inkdpixels/commit-analyzer": "0.0.2", - "@inkdpixels/release-notes-generator": "0.0.2", - "babel": "^5.8.34", + "@inkdpixels/commit-analyzer": "^0.0.4", + "@inkdpixels/release-notes-generator": "^0.0.4", + "@reduct/logger": "^1.1.0", + "babel-polyfill": "^6.3.14", + "babel-preset-es2015": "^6.3.13", + "babel-register": "^6.3.13", + "babelify": "^7.2.0", + "browserify": "^12.0.1", "chai": "^3.4.1", - "istanbul": "^0.4.0", - "jsdom": "^7.0.2", - "mocha": "^2.3.3", + "istanbul": "^0.4.1", + "jsdom": "^7.2.2", + "mocha": "^2.3.4", "semantic-release": "^4.3.5", - "xo": "^0.11.0" + "xo": "^0.12.1" }, "xo": { "esnext": true, @@ -71,11 +76,5 @@ "release": { "analyzeCommits": "@inkdpixels/commit-analyzer", "generateNotes": "@inkdpixels/release-notes-generator" - }, - "dependencies": { - "@reduct/logger": "^1.0.2", - "babel-preset-es2015": "^6.1.18", - "babelify": "^7.2.0", - "browserify": "^12.0.1" } } diff --git a/src/assembler.mocha-polyfill.js b/src/assembler.mocha-polyfill.js new file mode 100644 index 0000000..81f8301 --- /dev/null +++ b/src/assembler.mocha-polyfill.js @@ -0,0 +1,3 @@ +require('babel-polyfill'); + +module.exports = require('./assembler.js'); diff --git a/src/assembler.spec.js b/src/assembler.spec.js index 6735c6c..50312c4 100644 --- a/src/assembler.spec.js +++ b/src/assembler.spec.js @@ -1,4 +1,4 @@ -import assembler from './assembler.js'; +import assembler from './assembler.mocha-polyfill.js'; import chai from 'chai'; import {DOM} from './utils/'; @@ -15,9 +15,7 @@ describe('The "Assembler"', () => { `; - beforeEach(done => { - return DOM.create(mock, done); - }); + beforeEach(done => DOM.create(mock, done)); it('should be able to create an app', done => { const app = assembler(); diff --git a/src/utils/index.js b/src/utils/index.js index cd0b105..0f8ba47 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ import DOM from './dom.js'; -export default { +export { DOM };