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: 🔧switched to standard-version #15

Merged
merged 5 commits into from
May 4, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 2 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## React Boilerplate CRA Template

### ⚠️ Clear this template before you submit (after you read the things below)

Thank you for contributing! Please take a moment to review our [**contributing guidelines**](https://github.com/react-boilerplate/react-boilerplate/blob/master/CONTRIBUTING.md)
to make the process easy and effective for everyone involved.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 15 # Its fine to lint last 15 commits only
- uses: wagoid/commitlint-github-action@v1
6 changes: 0 additions & 6 deletions .np-config.js

This file was deleted.

34 changes: 34 additions & 0 deletions .versionrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const internalSection = `_Internals (This section should NOT concern the template users)_`;
/*
* Used for creating CHANGELOG.md automatically.
* Anything under the internalSection should be boilerplate internals
* and shouldn't interest the end users, meaning that the template shouldn't be effected.
*/

// Check the descriptions of the types -> https://github.com/commitizen/conventional-commit-types/blob/master/index.json
module.exports = {
types: [
{ type: 'feat', section: 'Features', hidden: false },
{ type: 'fix', section: 'Bug Fixes', hidden: false },
{ type: 'docs', section: 'Documentation', hidden: false },
{ type: 'perf', section: 'Performance Updates', hidden: false },

// Other changes that don't modify src or test files
{ type: 'chore', section: internalSection, hidden: false },

// Adding missing tests or correcting existing tests
{ type: 'test', section: internalSection, hidden: false },

// Changes to our CI configuration files and scripts
{ type: 'ci', section: internalSection, hidden: false },

// A code change that neither fixes a bug nor adds a feature
{ type: 'refactor', section: internalSection, hidden: false },

// Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
{ type: 'style', section: internalSection, hidden: false },
],
skip: {
commit: true,
},
};
20 changes: 17 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,25 @@ Since the `master` branch is what people actually use in production, we have a
consider that stable we merge it into the `master` branch and release the
changes for real.

⚠️ **WARNING**
## Commit Messages

This project uses [commitlint](https://github.com/conventional-changelog/commitlint) for formating the commit messages. Check [here](https://www.conventionalcommits.org/en/v1.0.0/) for understanding the commit message format.
This project uses [commitlint](https://github.com/conventional-changelog/commitlint) for formating the commit messages. Check [here](https://www.conventionalcommits.org/en/v1.0.0/) for understanding the commit message format (or take a look at our commit history).

> List of available [commit types](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional#type-enum)
In short commit messages must follow the format

```
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]
```

where `type` can be one of the followings in [.versionrc.js](./.versionrc.js)

Those commits will be used to generate [CHANGELOG.md](./CHANGELOG.md) automatically before the releases.

> More info: [standard-version](https://github.com/conventional-changelog/standard-version)

**IMPORTANT**: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the [MIT License](https://github.com/react-boilerplate/react-boilerplate/blob/master/LICENSE.md).
Expand Down
11 changes: 10 additions & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
// Use types from .versionrc.js so that when generating CHANGELOG there are no inconsistencies
const standardVersionTypes = require('./.versionrc').types;
const typeEnums = standardVersionTypes.map(t => t.type);

module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', typeEnums],
},
};
Loading