diff --git a/.travis.yml b/.travis.yml index 08a31ec..7b1424b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: node_js node_js: -- '4' -- '5' -- '6' -before_install: npm install -g grunt-cli -install: npm install -script: "npm run-script ci" + - '4' + - '5' + - '6' +after_success: + - npm run coveralls notifications: slack: secure: dsz+D/TuylEi+6zqdB5dVqyMlpbpafaBBcAwYIijTK6LuG8KdIdGNSFVX1ro6o3bJFwMvtfxNeK1eFrMy8l6VHZQL0dkXWRmCl/pxLhEntUiYTDwDOtiqy1QLZtv5AqtsdSr1qLiOJtgF6gXk66xipnV2UzjLVVoxzSrdOSnX4U= diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8d7a9bf..1bd221c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,6 +13,24 @@ Current milestone Pull Requests will receive priority review for merging. 3. Write corresponding tests and code (only what is needed to satisfy the issue and tests please) * Include your tests in the 'test' directory in an appropriate test file * Write code to satisfy the tests - * Run tests using ```grunt test``` + * Run tests using ```npm test``` 5. Ensure automated tests pass -6. Submit a new Pull Request applying your feature/fix branch to the develop branch of the SparkPost SDK +6. Submit a new Pull Request applying your feature/fix branch to the develop branch of the SparkPost client library + +## Releases +If you are a collaborator, when you want release a new version, follow these steps. + +1. Make sure all the changes are merged into master +2. Make sure all changes have passed [Travis CI build][1] +3. Determine type of release. We use [Semantic Versioning](http://semver.org/). +4. Update [CHANGELOG.md](CHANGELOG.md) with release notes and commit +5. Run `npm version` command to increment `package.json` version, commit changes, tag changes, and push to upstream. + - Patch -> `npm version patch` + - Minor -> `npm version minor` + - Major -> `npm version major` +6. Once [Travis CI build][1] (from tag) has completed, make sure you're working directory is clean and run `npm publish` + while in the project root. +7. Create a new [Github Release](https://github.com/SparkPost/node-sparkpost/releases) using the new tag. Copy release + notes from the [CHANGELOG.md](CHANGELOG.md). + +[1]: https://travis-ci.org/SparkPost/node-sparkpost diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index b03bf6a..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,74 +0,0 @@ -var matchdep = require('matchdep') - , gruntTimer = require('time-grunt') - , path = require('path'); - -module.exports = function(grunt) { - // Dynamically load any preexisting grunt tasks/modules - matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks); - - // Pretty timing on grunt commands - gruntTimer(grunt); - - var config = { - binPath: path.join('.', 'node_modules', '.bin'), - }; - - var reporter = grunt.option('reporter') || 'xunit-file'; - - // Configure existing grunt tasks and create custom ones - grunt.initConfig({ - config: config, - pkg: grunt.file.readJSON('package.json'), - bump: { - options: { - files: [ 'package.json' ] - , updateConfigs: [ 'pkg' ] - , commit: true - , commitMessage: 'Release %VERSION%' - , commitFiles: [ 'package.json', 'CHANGELOG.md' ] - , createTag: true - , tagName: '%VERSION%' - , tagMessage: '%VERSION%' - , push: true - , pushTo: 'upstream' - , gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' - } - }, - shell: { - lint: { - command: 'npm run lint' - }, - coverage: { - command : path.join(config.binPath, 'istanbul') + ' cover --report lcov --dir test/reports/ node_modules/mocha/bin/_mocha test/spec -- --reporter ' + reporter, - options : { - stdout : true, - failOnError : true - } - }, - test: { - command: path.join(config.binPath, '_mocha') + ' test/spec' - } - }, - coveralls: { - options: { - force: true - }, - grunt_coveralls_coverage: { - src: 'test/reports/lcov.info' - } - } - }); - - // grunt lint - leverages grunt-contrib-jshint command, lints our code - grunt.registerTask('lint', [ 'shell:lint' ]); - - // grunt test - runs linting and then our unit tests - grunt.registerTask('test', [ - 'lint', - 'shell:test', - 'shell:coverage' - ]); - - // register default grunt command as grunt test - grunt.registerTask('default', [ 'test' ]); -}; diff --git a/README.md b/README.md index dc45c9c..6a0574b 100644 --- a/README.md +++ b/README.md @@ -148,17 +148,15 @@ Click on the desired API to see usage and more information ## Development ### Setup -We use [Grunt](http://gruntjs.com/) for our task runner, so you will also have to install Grunt globally `npm install -g grunt-cli` - Run `npm install` inside the repository to install all the dev dependencies. ### Testing -Once all the dependencies are installed, you can execute the unit tests using `grunt test` +Once all the dependencies are installed, you can execute the unit tests using `npm test` ### Contributing -[Guidelines for adding issues](docs/ADDING_ISSUES.markdown) +[Guidelines for adding issues](docs/ADDING_ISSUES.md) -[Our coding standards](docs/CODE_STYLE_GUIDE.markdown) +[Our coding standards](docs/CODE_STYLE_GUIDE.md) [Submitting pull requests](CONTRIBUTING.md) diff --git a/docs/ADDING_ISSUES.markdown b/docs/ADDING_ISSUES.md similarity index 100% rename from docs/ADDING_ISSUES.markdown rename to docs/ADDING_ISSUES.md diff --git a/docs/CODE_STYLE_GUIDE.markdown b/docs/CODE_STYLE_GUIDE.md similarity index 100% rename from docs/CODE_STYLE_GUIDE.markdown rename to docs/CODE_STYLE_GUIDE.md diff --git a/package.json b/package.json index 96c442c..c7f62dc 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "description": "A Node.js wrapper for interfacing with your favorite SparkPost APIs", "main": "./lib/sparkpost.js", "scripts": { - "lint": "eslint --fix lib/**", - "test": "grunt", - "ci": "grunt && grunt coveralls:grunt_coveralls_coverage" + "coveralls": "cat ./test/reports/lcov.info | coveralls", + "pretest": "eslint lib/**", + "test": "istanbul cover --report lcov --dir test/reports/ _mocha --recursive ./test/spec --grep ./test/**/*.spec.js -- --colors --reporter spec", + "postversion": "git push upstream && git push --tags upstream" }, "keywords": [ "email", @@ -24,21 +25,14 @@ "homepage": "https://github.com/SparkPost/node-sparkpost", "devDependencies": { "chai": "1.9.1", + "coveralls": "^2.11.12", "eslint": "^3.3.1", "eslint-config-sparkpost": "^1.0.1", - "grunt": "0.4.5", - "grunt-bump": "^0.3.1", - "grunt-coveralls": "^1.0.0", - "grunt-shell": "1.1.1", - "istanbul": "0.3.2", - "matchdep": "0.3.0", - "mocha": "1.21.4", + "istanbul": "^0.4.5", + "mocha": "^3.0.2", "nock": "^7.2.2", - "proxyquire": "1.0.1", "sinon": "^1.14.1", - "sinon-chai": "2.5.0", - "time-grunt": "1.0.0", - "xunit-file": "0.0.5" + "sinon-chai": "2.5.0" }, "dependencies": { "json-pointer": "^0.5.0",