From a8cc363b7f725cbc151d62866e20fd42f5c74f38 Mon Sep 17 00:00:00 2001 From: Mark Carver Date: Wed, 10 May 2017 12:26:48 -0500 Subject: [PATCH 1/3] chore: Add commitizen x-ref: #116 --- package.json | 8 ++++++++ scripts/commit.js | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 scripts/commit.js diff --git a/package.json b/package.json index e074ac8..33b109d 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,17 @@ "url": "https://github.com/truckingsim/Ajax-Bootstrap-Select.git" }, "scripts": { + "commit": "node ./scripts/commit", "test": "grunt travis --verbose" }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } + }, "devDependencies": { + "commitizen": "^2.9.6", + "cz-conventional-changelog": "^2.0.0", "grunt": "^1.0.1", "grunt-contrib-clean": "^1.0.0", "grunt-contrib-concat": "^1.0.1", diff --git a/scripts/commit.js b/scripts/commit.js new file mode 100644 index 0000000..07ef839 --- /dev/null +++ b/scripts/commit.js @@ -0,0 +1,2 @@ +process.on('uncaughtException', (err) => console.error(err.message)); +require('commitizen/bin/git-cz'); From 37ec401e18a4e92cb7a3a8dfe0c15ac17e3d9410 Mon Sep 17 00:00:00 2001 From: Mark Carver Date: Wed, 10 May 2017 12:30:47 -0500 Subject: [PATCH 2/3] docs: Add CONTRIBUTING.md and PULL_REQUEST_TEMPLATE.md x-ref: #116 --- CONTRIBUTING.md | 70 ++++++++++++++++++++++++++++++++++++++++ PULL_REQUEST_TEMPLATE.md | 24 ++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 PULL_REQUEST_TEMPLATE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b143142 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,70 @@ +# Contribution guide + +## Prerequisites + +- [Node.JS] +- [Grunt.js] (install the global CLI tool) + +## Setup + +Install the [Node.js] modules by running `npm install` inside this cloned +repository. Note: this may take a while depending on your computer. + +## Grunt commands + +- `grunt` - Main grunt command will build the entire project. +- `grunt docs` - Builds just the documentation. + +## Distribution + +After everything is built, there will be a `dist` folder where the distribution +files (CSS and JS) will be located. These files are what can be used in the +browser. + +## Committing Changes + +All commits must follow the [AngularJS Git Commit Message Conventions]. + +While one can manually construct a proper commit message based on aforementioned +conventions, this project utilizes [Commitizen CLI] to commit changes in a +consistent manner and help eliminate human error. + +The preferred method is to use the helper script bundled with this project which +runs the internal dependency script installed via [Node.js]. This is preferred +because it is specific to this project and will have the most consistency for +all individuals involved: +```bash +npm run commit +``` + +Optionally, if you instead have the [Commitizen CLI] installed globally, you +should also be able to execute the following command from the root of the +project: + +```bash +git cz +``` + +To assist with all of these variations across projects, it is recommended that +you can create a single and dedicated `commit` command alias in your +`.bash_profile` file. This will run all of these commands for you and fall back +as necessary: + +```bash +alias commit='npm run commit 2>/dev/null || git cz 2>/dev/null || git commit'; +``` + +## Pull Request Requirements + +The following are required for a pull request to be considered "valid": + +* JavaScript **MUST** use 4 space indentation. +* JavaScript **MUST** be written using ES2015 (ES6) features. +* Features and bug fixes **MUST** covered by test cases. +* All commits **MUST** follow the [AngularJS Git Commit Message Conventions]. + + +[Node.js]: https://nodejs.org +[Grunt.js]: https://gruntjs.com/getting-started#installing-the-cli +[AngularJS Git Commit Message Conventions]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit# +[Commitizen CLI]: http://commitizen.github.io/cz-cli/ diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e9e08ce --- /dev/null +++ b/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,24 @@ +## Description (required) + +Describe here what this pull request is intending to solve. + +## Screenshots (optional) + +If this pull request affects any visual or UI aspects of this project +then you should place them here, preferably in a before/after format. + +## Closes Issue (optional) +Closes # + +## Related Issue(s) (optional) + +- X-ref # + +## Merge checklist (required, for maintainers only) + +This pull request adheres to the following requirements: + +- [] JavaScript follows 4 space indentation conventions. +- [] JavaScript was written using ES2015 (ES6) features. +- [] Features and bug fixes are covered by test cases. +- [] All commits follow the _AngularJS Git Commit Message Conventions_. From 764878dac17305621381d30f0ec1e110e1e41d8b Mon Sep 17 00:00:00 2001 From: Mark Carver Date: Wed, 10 May 2017 12:52:20 -0500 Subject: [PATCH 3/3] build(npm): Bump node.js minimum version to 6 and tests for 6 & 7 --- .travis.yml | 3 ++- package.json | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4d5c98a..82a691e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: node_js sudo: false node_js: - - 0.10 + - 7 + - 6 before_script: - npm install -g grunt-cli diff --git a/package.json b/package.json index 33b109d..32a04dd 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "title": "Ajax Bootstrap Select", "description": "Extends existing [Bootstrap Select] implementations by adding the ability to search via AJAX requests as you type. Originally for CROSCON.", "version": "1.3.8", + "engines": { + "node": ">=6" + }, "author": { "name": "Adam Heim", "url": "https://github.com/truckingsim"