Skip to content

Commit

Permalink
build(build): build using semantic-release and its dependencies (#45)
Browse files Browse the repository at this point in the history
Added semantic-release, commitizen as well as targets for npm in preparation of releasing the first
version of our npm package
  • Loading branch information
therapon authored May 9, 2017
1 parent 72186c7 commit 77e3d05
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 16 deletions.
16 changes: 16 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
# Use `npm pack` to create a tgz file. View the contents of the .tgz to test your .npmignore
docs
ion-tests
tests
.baseDir*
.travis.yml
_config.yml
.nojekyll
.gitmodules
.tscache
.idea
browser
src
*.map
Gruntfile.js
24 changes: 17 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@

language: node_js

node_js:
- "node"

script: grunt all

cache:
directories:
- node_modules
notifications:
email: false
node_js:
- '7'
before_script:
- npm prune
script:
- npm run test
after_success:
- 'if [ "$TRAVIS_BRANCH" == "master" -a "$TRAVIS_PULL_REQUEST" == "false" ]; then npm run semantic-release; fi'
- 'if [ "$TRAVIS_BRANCH" != "master" ]; then exit 0; fi'
branches:
except:
- /^v\d+\.\d+\.\d+$/
14 changes: 14 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ module.exports = function(grunt) {
module: "amd",
declaration: true
}
},
'commonjs-es6': {
src: ['src/**/*.ts'],
outDir: 'dist/commonjs/es6',
options: {
target: "es6",
module: "commonjs",
declaration: true
}
}
},
/**
Expand Down Expand Up @@ -116,12 +125,17 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('remap-istanbul');
grunt.loadNpmTasks('intern');

grunt.registerTask('build', ['clean', 'ts:amd-es6', 'ts:commonjs-es6','copy:main']);
grunt.registerTask('build', ['clean', 'ts:amd-es6','copy:main']);
grunt.registerTask('toES5', ['build', 'babel']);
grunt.registerTask('test', ['build', 'intern:es6']);
grunt.registerTask('doc', ['test', 'typedoc']);
grunt.registerTask('coverage', ['doc', 'remapIstanbul']);
grunt.registerTask('all', ['coverage']);


// NPM
grunt.registerTask('build:npm', ['ts:commonjs-es6']);

grunt.registerTask('default', ['test']);
};
25 changes: 16 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
{
"name": "ion-js",
"version": "0.9.0",
"version": "0.0.0-development",
"description": "A JavaScript implementation of the Ion data interchange format",
"main": "dist/amd/ed6/Ion.js",
"types": "dist/amd/ed6/Ion.d.ts",
"directories": {
"test": "test"
},
"main": "dist/commonjs/es6/Ion.js",
"types": "dist/commonjs/es6/Ion.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"commit": "git-cz",
"test": "grunt test",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"repository": {
"type": "git",
"url": "git+https://github.com/amzn/ion-js.git"
"url": "https://github.com/amzn/ion-js.git"
},
"keywords": [
"ion",
Expand All @@ -25,9 +24,16 @@
"url": "https://github.com/amzn/ion-js/issues"
},
"homepage": "https://github.com/amzn/ion-js#readme",
"config": {
"commitizen": {
"path": "node_modules/cz-conventional-changelog"
}
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"commitizen": "^2.9.6",
"cz-conventional-changelog": "^2.0.0",
"grunt": "^1.0.1",
"grunt-babel": "^6.0.0",
"grunt-cli": "^1.2.0",
Expand All @@ -39,6 +45,7 @@
"intern": "^3.4.1",
"remap-istanbul": "^0.9.1",
"typedoc": "^0.5.8",
"typescript": "^2.2.1"
"typescript": "^2.2.1",
"semantic-release": "^6.3.6"
}
}

0 comments on commit 77e3d05

Please sign in to comment.