chore: add standard-version and release script

This commit adds the `standard-version` module for managing releases.
When running `npm run release` the following steps are taken.

1. Retreive the current version of your repository by looking at package.json.
2. Bump the version in package.json based on the commits.
3. Prepends to the CHANGELOG based on the commits (uses conventional-changelog under the hood).
4. Create a new commit including the package.json and updated CHANGELOG.
5. Create a new tag with the new version number.

This works best if all commits follow the Conventional Commits specification.
https://www.conventionalcommits.org/en/v1.0.0/

Fixes: https://github.com/cloudevents/sdk-javascript/issues/56

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2020-04-27 16:33:56 -04:00 committed by Fabio José
parent e0878055a2
commit f47bca4ff0
4 changed files with 1618 additions and 61 deletions

View File

@ -14,6 +14,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Removed support for Node.js 6, 7 and 8 - all of which are EOL at this point. Travis CI modified to test on Node.js 10 and 12.
### Added
- Added support for standard-version and conventional-changelog
## [1.0.0]
### Added

View File

@ -14,8 +14,20 @@ ahead of `master`.
## Changelog
Always update the [CHANGELOG.md](./CHANGELOG.md), following
[this semantics](https://keepachangelog.com/en/1.0.0/).
The [CHANGELOG.md](./CHANGELOG.md) will be updated with your commits if you format
your commit messages following the
[Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/#summary).
If you are unsure what prefix to use for a commit, you can consult the
[package.json](https://github.com/cloudevents/sdk-javascript/blob/master/package.json) file
in this repository. In the `standard-version.types` section, you can see all of the commit
types that will be committed to the changelog based on the prefix in the first line of
your commit message. For example, the commit message:
```log
fix: removed a bug that was causing the rotation of the earth to change
```
will show up in the "Bug Fixes" section of the changelog for a given release.
## Pull Requests
@ -23,6 +35,14 @@ Guidelines about how to perform pull requests.
- before submit the PR, open an issue and link them
### Commit Messages
Please follow the Conventional Commits specification noted above. the first line of
your commit should be prefixed with a type, be a single sentence with no period, and
succinctly indicate what this commit changes.
All commit message lines should be kept to fewer than 80 characters if possible.
### PR to `develop`
- fixes in the documentation (readme, contributors)

1586
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,57 @@
"test": "mocha test/**/*.js",
"coverage": "nyc --reporter=lcov --reporter=text npm run test",
"precoverage-publish": "npm run coverage",
"coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | sh -s report -l JavaScript -r coverage/lcov.info"
"coverage-publish": "wget -qO - https://coverage.codacy.com/get.sh | sh -s report -l JavaScript -r coverage/lcov.info",
"release": "standard-version"
},
"standard-version": {
"types": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "docs",
"section": "Documentation",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": false
},
{
"type": "src",
"section": "Miscellaneous",
"hidden": false
},
{
"type": "style",
"section": "Miscellaneous",
"hidden": false
},
{
"type": "refactor",
"section": "Miscellaneous",
"hidden": false
},
{
"type": "perf",
"section": "Performance",
"hidden": false
},
{
"type": "test",
"section": "Tests",
"hidden": false
}
]
},
"repository": {
"type": "git",
@ -23,11 +73,13 @@
"cncf"
],
"author": "cloudevents.io",
"contributors": {
"contributors": [
{
"name": "Fábio José de Moraes",
"email": "fabiojose@gmail.com",
"url": "https://github.com/fabiojose"
},
}
],
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/cloudevents/sdk-javascript/issues"
@ -46,7 +98,8 @@
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"standardx": "^5.0.0"
"standardx": "^5.0.0",
"standard-version": "^7.1.0"
},
"publishConfig": {
"access": "public"