Skip to content

Build: Introduce sematic-release with commitizen #29

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

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
6 changes: 6 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"branch": "master",
"analyzeCommits": {
"preset": "eslint"
}
}
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@ language: node_js
sudo: false
cache:
directories:
- ~/.npm
- node_modules
notifications:
email: false
node_js:
- "node"
- '10'
- '9'
- '8'
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.9.4
- export PATH="$HOME/.yarn/bin:$PATH"
- yarn global add babel-cli
after_success:
- npm run travis-deploy-once "npm run semantic-release"
branches:
except:
- /^v\d+\.\d+\.\d+$/
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
<a href="https://github.com/prettier/prettier">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square">
</a>
<a href="https://github.com/semantic-release/semantic-release">
<img alt="We are using semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square">
</a>
<a href="https://twitter.com/friendsofreact">
<img alt="Follow friends of react on Twitter" src="https://img.shields.io/twitter/follow/friendsofreact.svg?label=follow+friendsofreact&style=flat-square">
</a>
Expand Down Expand Up @@ -192,6 +195,28 @@ The returned component accepts a `theme`, `composeTheme`, `innerRef` and `mapThe
- [`composeTheme = 'deeply'`] *(String)* allows to customize the way themes are merged or to disable merging completely. The accepted values are `deeply` to deeply merge themes, `softly` to softly merge themes and `false` to disable theme merging.
- [`mapThemrProps = (props, theme) => ({ ref, theme })`] *(Function)* allows to customize how properties are passed down to the decorated component. By default, themr extracts all own properties passing down just `innerRef` as `ref` and the generated theme as `theme`. If you are decorating a component that needs to map the reference or any other custom property, this function is called with *all* properties given to the component plus the generated `theme` in the second parameter. It should return the properties you want to pass.

## Contribution

Contributions are always welcome. We try to make it as easy as possible.
We are using semantic-release to have more time to concentrate on important stuff
instead of struggling in the dependency or release hell.

Therefore the first rule is to follow the [eslint commit message guideline](https://github.com/conventional-changelog-archived-repos/conventional-changelog-eslint/blob/master/convention.md).
When you always commit via `yarn commit` this is really easy. Commitizen will guide you.

### Development commands

We have some yarn scripts that should make live easier. The deployment scripts are just for
semantic-release and travis, but the following will help you.

| Command | Description |
| --------------- | ------------------------------ |
| `yarn build` | Runs the development build. |
| `yarn lint` | Executes linter, we use prettier with eslint. |
| `yarn test` | Executes the jest test on all source files. |
| `yarn test:watch` | Perfect while writing tests is the watcher for test. |
| `yarn commit` | Executes commitizen to guide you for the correct commit message. |

## About

The project is originally authored by [Javi Velasco](https://twitter.com/javivelasco) as an effort of providing a better customization experience for [React Toolbox](http://react-toolbox.io). Any comments, improvements or feedback is highly appreciated.
Expand Down
19 changes: 16 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "Javi Velasco <javier.velasco86@gmail.com> (http://javivelasco.com/)",
"repository": {
"type": "git",
"url": "git+https://github.com/FriendsOfReactJS/react-css-themr.git"
"url": "https://github.com/FriendsOfReactJS/react-css-themr.git"
},
"bugs": {
"url": "https://github.com/FriendsOfReactJS/react-css-themr/issues"
Expand All @@ -33,6 +33,9 @@
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"commitizen": "^2.10.1",
"conventional-changelog-eslint": "^3.0.0",
"cz-adapter-eslint": "^0.1.2",
"eslint": "^5.3.0",
"eslint-config-prettier": "^3.0.0",
"eslint-plugin-prettier": "^2.6.2",
Expand All @@ -45,7 +48,9 @@
"react": "^16.4.2",
"react-dom": "^16.4.2",
"rimraf": "^2.6.2",
"sinon": "^6.1.4"
"semantic-release": "^15.9.8",
"sinon": "^6.1.4",
"travis-deploy-once": "^5.0.2"
},
"files": [
"index.d.ts",
Expand All @@ -58,7 +63,10 @@
"lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check",
"prepublish": "rimraf lib && npm run build",
"test": "jest",
"test:watch": "npm test -- --watch"
"test:watch": "npm test -- --watch",
"travis-deploy-once": "travis-deploy-once",
"semantic-release": "semantic-release",
"commit": "git-cz"
},
"license": "MIT",
"peerDependencies": {
Expand All @@ -72,5 +80,10 @@
"jest": {
"verbose": true,
"testURL": "http://localhost/"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-adapter-eslint"
}
}
}
Loading