Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add commitizen and documentation changes #118

Merged
merged 3 commits into from
May 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
sudo: false
node_js:
- 0.10
- 7
- 6
before_script:
- npm install -g grunt-cli
70 changes: 70 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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/
24 changes: 24 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -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_.
11 changes: 11 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -28,9 +31,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",
Expand Down
2 changes: 2 additions & 0 deletions scripts/commit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
process.on('uncaughtException', (err) => console.error(err.message));
require('commitizen/bin/git-cz');