Skip to content

Commit

Permalink
Merge pull request #6 from uglow/feature/update-readme-and-support-bl…
Browse files Browse the repository at this point in the history
…ank-values

chore(build): upgrade build to use latest Confit (eslint, coverage, readme)
  • Loading branch information
uglow authored Dec 17, 2016
2 parents 8bf0381 + 6efd13b commit 1ab6726
Show file tree
Hide file tree
Showing 13 changed files with 322 additions and 206 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ sudo: false
language: node_js
node_js:
- "4"
- "5.11.0"
- "6"
- "7"

# Need to specify a GCC compiler now!
# https://docs.travis-ci.com/user/languages/javascript-with-nodejs#Node.js-v4-(or-io.js-v3)-compiler-requirements
Expand All @@ -18,6 +18,7 @@ addons:
- g++-4.8

before_install:
- if [[ `npm -v` != 3* ]]; then npm i -g [email protected]; fi
- npm prune
- npm set progress=false

Expand All @@ -30,6 +31,7 @@ script:
- npm run pre-release

after_success:
- npm run upload-coverage
- npm run semantic-release

branches:
Expand Down
10 changes: 6 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Welcome! This document explains how you can contribute to making **cz-customizab

```
git clone <this repo>
npm install -g semantic-release-cli
npm install -g commitizen
npm install -g semantic-release-cli
npm install
```

Expand Down Expand Up @@ -97,7 +97,7 @@ Command | Description
Command | Description
:------ | :----------
<pre>npm test</pre> | Alias for `npm run test:unit` task
<pre>npm run test:coverage</pre> | Run instrumented unit tests then verify coverage meets defined thresholds<ul><li>Returns non-zero exit code when coverage does not meet thresholds (as defined in istanbul.yml)</li></ul>
<pre>npm run test:coverage</pre> | Run instrumented unit tests then verify coverage meets defined thresholds<ul><li>Returns non-zero exit code when coverage does not meet thresholds (as defined in istanbul.js)</li></ul>
<pre>npm run test:unit</pre> | Run unit tests whenever JS source or tests change<ul><li>Uses Mocha</li><li>Code coverage</li><li>Runs continuously (best to run in a separate window)</li></ul>
<pre>npm run test:unit:once</pre> | Run unit tests once<ul><li>Uses Mocha</li><li>Code coverage</li></ul>

Expand All @@ -112,6 +112,7 @@ Command | Description
:------ | :----------
<pre>npm run verify</pre> | Verify code style and syntax<ul><li>Verifies source *and test code* aginst customisable rules (unlike Webpack loaders)</li></ul>
<pre>npm run verify:js</pre> | Verify Javascript code style and syntax
<pre>npm run verify:js:fix</pre> | Verify Javascript code style and syntax and fix any errors that can be fixed automatically
<pre>npm run verify:js:watch</pre> | Verify Javascript code style and syntax and watch files for changes
<pre>npm run verify:watch</pre> | Runs verify task whenever JS or CSS code is changed

Expand Down Expand Up @@ -144,6 +145,7 @@ the `semantic-release` task.
for each release (which appears in the "Releases" section in GitHub) and
publishes the package to NPM (when all the tests are successful) with a semantic version number.
</li></ul>
<pre>npm run upload-coverage</pre> | Uploads code-coverage metrics to Coveralls.io<ul><li>Setup - https://coveralls.zendesk.com/hc/en-us/articles/201347419-Coveralls-currently-supports</li><li>Define an environment variable called COVERALLS_REPO_TOKEN in your build environment with the repo token from https://coveralls.io/github/<repo-name>/settings</li></ul>



Expand All @@ -155,7 +157,7 @@ publishes the package to NPM (when all the tests are successful) with a semantic

There are 3 ways you can change the build-tool configuration for this project:

1. BEST: Modify the Confit configuration file ([confit.json](confit.json)) by hand, then re-run `yo confit` and tell it to use the existing configuration.
1. BEST: Modify the Confit configuration file ([confit.yml](confit.yml)) by hand, then re-run `yo confit` and tell it to use the existing configuration.
1. OK: Re-run `yo confit` and provide new answers to the questions. **Confit will attempt to overwrite your existing configuration (it will prompt for confirmation), so make sure you have committed your code to a source control (e.g. git) first**.
There are certain configuration settings which can **only** be specified by hand, in which case the first approach is still best.
1. RISKY: Modify the generated build-tool config by hand. Be aware that if you re-run `yo confit` it will attempt to overwrite your changes. So commit your changes to source control first.
Expand All @@ -165,7 +167,7 @@ Additionally, the **currently-generated** configuration can be extended in the f
- The task configuration is defined in [package.json](package.json). It is possible to change the task definitions to add your own sub-tasks.
You can also use the `pre...` and `post...` script-name prefixes to run commands before (pre) and after (post) the generated commands.

- The `entryPoint.entryPoints` string in [confit.json](confit.json) is designed to be edited manually. It represents the starting-point(s) of the application (like a `main()` function). A NodeJS application has one entry point. E.g. `src/index.js`.
- The `entryPoint.entryPoints` string in [confit.yml](confit.yml) is designed to be edited manually. It represents the starting-point(s) of the application (like a `main()` function). A NodeJS application has one entry point. E.g. `src/index.js`



Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
# cz-customizable-ghooks

Integrate cz-customizable config with ghooks to use a single configuration for commit message generation AND commit message hooks.
Integrate [cz-customizable](https://github.com/leonardoanalista/cz-customizable) config with [ghooks](https://github.com/gtramontina/ghooks) to use a single configuration for commit message generation AND commit message hooks.

[![NPM](https://nodei.co/npm/cz-customizable-ghooks.png?downloads=true)](https://npmjs.org/package/cz-customizable-ghooks)

[![NPM Version](https://img.shields.io/npm/v/cz-customizable-ghooks.svg?style=flat-square)](http://npm.im/cz-customizable-ghooks)
[![Build Status](https://travis-ci.org/uglow/cz-customizable-ghooks.svg?branch=master)](https://travis-ci.org/uglow/cz-customizable-ghooks)
<!--[RM_BADGES]-->
[![NPM Version](https://img.shields.io/npm/v/cz-customizable-ghooks.svg?style=flat-square)](http://npm.im/cz-customizable-ghooks)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Coverage Status](https://coveralls.io/repos/github/uglow/cz-customizable-ghooks/badge.svg?branch=master)](https://coveralls.io/github/uglow/cz-customizable-ghooks?branch=master)
[![Dependencies status](https://david-dm.org/uglow/cz-customizable-ghooks/status.svg?theme=shields.io)](https://david-dm.org/uglow/cz-customizable-ghooks#info=dependencies)
[![Dev Dependencies status](https://david-dm.org/uglow/cz-customizable-ghooks/dev-status.svg?theme=shields.io)](https://david-dm.org/uglow/cz-customizable-ghooks#info=devDependencies)
[![Dev-dependencies status](https://david-dm.org/uglow/cz-customizable-ghooks/dev-status.svg?theme=shields.io)](https://david-dm.org/uglow/cz-customizable-ghooks#info=devDependencies)


<!--[]-->


## Prerequisites

- git
- Node >= 4.x
- cz-customizable
- ghooks
- [cz-customizable](https://github.com/leonardoanalista/cz-customizable)
- [ghooks](https://github.com/gtramontina/ghooks)

Make sure you have a git repository (`git init`) BEFORE installing ghooks, otherwise you have to take extra steps if you install ghooks before running `git init`.

Expand Down
4 changes: 2 additions & 2 deletions config/release/commitMessageConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ module.exports = {
*/

allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix']

allowBreakingChanges: ['feat', 'fix'],
appendBranchNameToCommitMessage: false
};
34 changes: 34 additions & 0 deletions config/testUnit/istanbul.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Use JS to support loading of threshold data from external file
var coverageConfig = {
instrumentation: {
root: 'lib/'
},
check: require('./thresholds.json'),
reporting: {
print: 'both',
dir: 'reports/coverage/',
reports: [
'cobertura',
'html',
'lcovonly',
'html',
'json'
],
'report-config': {
cobertura: {
file: 'cobertura/coverage.xml'
},
json: {
file: 'json/coverage.json'
},
lcovonly: {
file: 'lcov/lcov.info'
},
text: {
file: null
}
}
}
};

module.exports = coverageConfig;
14 changes: 14 additions & 0 deletions config/testUnit/thresholds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"global": {
"statements": 80,
"branches": 80,
"functions": 60,
"lines": 80
},
"each": {
"statements": 40,
"branches": 50,
"functions": 20,
"lines": 40
}
}
59 changes: 47 additions & 12 deletions config/verify/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,59 @@
# START_CONFIT_GENERATED_CONTENT
extends: defaults/configurations/google
confit:
extends: &confit-extends
- google
- plugin:node/recommended

env:
jasmine: true
node: true
browser: true
commonjs: true # For Webpack, CommonJS
protractor: true
es6: true
plugins: &confit-plugins
- node

env: &confit-env
commonjs: true # For Webpack, CommonJS
node: true
mocha: true
es6: true

confit-globals: &confit-globals
globals: &confit-globals {}
parser: &confit-parser espree

ecmaFeatures:
modules: true
parserOptions: &confit-parserOptions
ecmaVersion: 6
sourceType: module
ecmaFeatures:
globalReturn: false
impliedStrict: true
jsx: false

# END_CONFIT_GENERATED_CONTENT

# Customise this section to meet your needs...

extends: *confit-extends
# Uncomment this next line if you need to add more items to the array, and remove the "*confit-extends" from the line above
# <<: *confit-extends

plugins: *confit-plugins
# Uncomment this next line if you need to add more items to the array, and remove the "*confit-plugins" from the line above
# <<: *confit-extends

env:
<<: *confit-env

globals:
<<: *confit-globals

parser: *confit-parser

parserOptions:
<<: *confit-parserOptions

rules:
max-len:
- 2 # Warning
- warn
- 200 # Line Length

require-jsdoc:
- off

prefer-rest-params: #not supported on Node 4
- off
60 changes: 0 additions & 60 deletions confit.json

This file was deleted.

49 changes: 49 additions & 0 deletions confit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
generator-confit:
app:
_version: f02196cc5cb7941ca46ec46d23bd6aef0dfcaca0
buildProfile: Latest
copyrightOwner: Brett Uglow
license: MIT
projectType: node
publicRepository: true
repositoryType: GitHub
paths:
_version: 7f33e41600b34cd6867478d8f2b3d6b2bbd42508
config:
configDir: config/
input:
libDir: lib/
srcDir: lib/
unitTestDir: test/
output:
prodDir: dist/
reportDir: reports/
buildJS:
_version: df428a706d926204228c5d9ebdbd7b49908926d9
framework: []
frameworkScripts: []
outputFormat: ES6
sourceFormat: ES6
entryPoint:
_version: de20402bf85c703080ef6daf21e35325a3b9d604
entryPoints:
main:
- lib/index.js
testUnit:
_version: 4472a6d59b434226f463992d3c1914c77a6a115d
testDependencies: []
verify:
_version: 30ae86c5022840a01fc08833e238a82c683fa1c7
jsCodingStandard: Google
release:
_version: 47f220593935b502abf17cb34a396f692e453c49
checkCodeCoverage: true
commitMessageFormat: Conventional
useSemantic: true
sampleApp:
_version: 00c0a2c6fc0ed17fcccce2d548d35896121e58ba
createSampleApp: false
zzfinish: {}
documentation:
_version: b1658da3278b16d1982212f5e8bc05348af20e0b
generateDocs: false
Loading

0 comments on commit 1ab6726

Please sign in to comment.