Skip to content

Commit

Permalink
Merge pull request #159 from webpack/d3viant0ne-changelog
Browse files Browse the repository at this point in the history
Adds project changelog
  • Loading branch information
MikaAK authored Aug 5, 2016
2 parents 68ff1d5 + 0d3a370 commit 3ceeb93
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 6 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<a name="1.7.0"></a>
# [1.7.0](https://github.com/webpack/karma-webpack/compare/v1.6.0...v1.7.0) (2015-07-31)



<a name="1.6.0"></a>
# [1.6.0](https://github.com/webpack/karma-webpack/compare/v1.5.1...v1.6.0) (2015-07-14)


### Bug Fixes

* Drop karma as a peerDependency. ([84ce696](https://github.com/webpack/karma-webpack/commit/84ce696))



<a name="1.5.1"></a>
## 1.5.1 (2015-05-04)
86 changes: 80 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ work is not in vain.

Most of the time, if webpack is not working correctly for you it is a simple configuration issue.

If you are having difficulty, please search the [StackOverflow with the webpack tag](http://stackoverflow.com/tags/webpack) for questions related
to the `karma-webpack`. If you can find an answer to your issue, please post a question in [StackOverflow](http://stackoverflow.com/tags/webpack) or
the [webpack Gitter](https://gitter.im/webpack/webpack) and include both your webpack, karma & karma-webpack versions.
If you are having difficulty, please search the [StackOverflow with the webpack tag][stackwebpack] for questions related
to the `karma-webpack`. If you can find an answer to your issue, please post a question in [StackOverflow][stackwebpack] or
the [webpack Gitter][webpackgitter] and include both your webpack, karma & karma-webpack versions.

**If you have discovered a bug or have a feature suggestion, feel free to create an issue on Github.**

## Setup
### Setup

```bash
git clone https://github.com/webpack/karma-webpack.git
Expand All @@ -29,7 +29,7 @@ To run the entire test suite use:
npm test
```

## Submitting Changes
### Submitting Changes

After getting some feedback, push to your fork and submit a pull request. We
may suggest some changes or improvements or alternatives, but for small changes
Expand All @@ -39,4 +39,78 @@ Some things that will increase the chance that your pull request is accepted:

* Write tests
* Follow the existing Webpack coding style defined in the eslint and editor config rules.
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

### Required `global` npm packages
We use [conventional changelog][conventionalchangelog] & the [commitizen][cz] adapter to generate our release notes using Angular's commit message convention.

*This requires commitizen to be installed globally.*

- `npm install commitizen -g`
- Now, simply use `git cz` instead of `git commit` when committing.

*If you're not working in a Commitizen friendly repository, then `git cz` will work just the same as `git commit`.*

### Commit Message Format (Commitizen handles this formatting for you)
Each commit message consists of a **header**, a **body** and a **footer**. The header has a special
format that includes a **type**, a **scope** and a **subject**:

```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```

The **header** is mandatory and the **scope** of the header is optional.

Any line of the commit message cannot be longer 100 characters! This allows the message to be easier
to read on GitHub as well as in various git tools.

### Revert
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of
the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is
the SHA of the commit being reverted.

### Type
Must be one of the following:

* **feat**: A new feature
* **fix**: A bug fix
* **docs**: Documentation only changes
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, extra semi-colons, etc)
* **refactor**: A code change that neither fixes a bug nor adds a feature
* **perf**: A code change that improves performance
* **test**: Adding missing tests or correcting existing tests
* **build**: Changes that affect the build system, CI configuration or external dependencies
* **chore**: Other changes that don't modify `src` or `test` files

### Scope
The scope could be anything specifying place of the commit change. For example
`datepicker`, `dialog`, etc.

### Subject
The subject contains succinct description of the change:

* use the imperative, present tense: "change" not "changed" nor "changes"
* don't capitalize first letter
* no dot (.) at the end

### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.

### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.

**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.
The rest of the commit message is then used for this.

A detailed explanation can be found in this [google document][google-commit].

[stackwebpack]: http://stackoverflow.com/tags/webpack
[webpackgitter]: https://gitter.im/webpack/webpack
[conventionalchangelog]: https://github.com/conventional-changelog/conventional-changelog
[cz]: https://github.com/commitizen/cz-cli
[google-commit]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/preview
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"test.unit": "mocha --compilers js:babel-register --full-trace --check-leaks test/unit",
"test.integration": "npm run build && karma start --single-run",
"travis": "npm run test.unit && npm run test.integration",
"generate.changelog": "node scripts/release/generate-changelog.js",
"build": "webpack"
},
"repository": {
Expand All @@ -30,6 +31,7 @@
"webpack-dev-middleware": "^1.0.11"
},
"devDependencies": {
"add-stream": "^1.0.0",
"babel-cli": "^6.11.4",
"babel-core": "^6.11.4",
"babel-loader": "^6.2.4",
Expand All @@ -40,7 +42,9 @@
"babel-register": "^6.11.6",
"chai": "^3.5.0",
"chai-as-promised": "^5.3.0",
"conventional-changelog": "^1.1.0",
"cross-env": "^2.0.0",
"cz-conventional-changelog": "^1.1.6",
"eslint": "^3.1.1",
"eslint-plugin-babel": "^3.3.0",
"istanbul": "^0.4.4",
Expand All @@ -51,5 +55,10 @@
"karma-spec-reporter": "~0.0.22",
"mocha": "^2.5.3",
"webpack": "^2.1.0-beta.20"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
40 changes: 40 additions & 0 deletions scripts/release/generate-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
var fs = require('fs')
var addStream = require('add-stream')
var cl = require('conventional-changelog')

const inStream = fs.createReadStream('CHANGELOG.md')
const isForce = process.argv.indexOf('--force') !== -1

/**
* Creates and prepends the changelog from the latest tag to head.
* Passing the arg `--force` will rewrite the entire changelog.
*/

inStream.on('error', function(err) {
console.error(`Error: failed to read the previous changelog file.
If this is the initial run, use the --force flag. ${err}`)
process.exit(1)
})

let config = {
preset: 'angular',
releaseCount: isForce ? 0 : 1
}

const getOutputStream = () => {
return fs.createWriteStream('CHANGELOG.md')
}

let stream = cl(config)
.on('error', function(err) {
console.error(`An error occurred while generating the changelog: ${err}`)
})
.pipe(!isForce && addStream(inStream) || getOutputStream())

if (!isForce) {
inStream.on('end', function() {
stream.pipe(getOutputStream())
})
}

/*eslint no-console: ["error", { allow: ["warn", "error"] }] */

0 comments on commit 3ceeb93

Please sign in to comment.