First of all, thanks for your interest in contributing to the {library-name}! 🎉
PRs are the preferred way to spike ideas and address issues, if you have time. If you plan on contributing frequently, please feel free to ask to become a maintainer; the more the merrier. 🤙
This library uses following libraries for development:
- typescript for typed JavaScript and transpilation
- jest for unit testing
- run
yarn test:watchduring development
- run
- rollup for creating UMD bundles
- yarn for package management
- npm scripts for executing tasks
Test are written and run via Jest 💪
# Run whole test suite once
yarn test
# Run test in watch mode
yarn test:watch
# Ged code coverage
yarn test:coverageStyle guides are enforced by robots (I meant prettier and tslint of course 🤖 ), so they'll let you know if you screwed something, but most of the time, they'll autofix things for you. Magic right ?
Lint and format codebase via npm-script:
#Format and fix lint errors
yarn ts:style:fix- this is preferred way how to create conventional-changelog valid commits
- if you prefer your custom tool we provide a commit hook linter which will error out, it you provide invalid commit message
- if you are in rush and just wanna skip commit message validation just prefix your message with
WIP: something done( if you do this please squash your work when you're done with proper commit message so standard-version can create Changelog and bump version of your library appropriately )
# invoke [commitizen CLI](https://github.com/commitizen/cz-cli)
yarn commityarn docsIf you've never submitted a Pull request before please visit http://makeapullrequest.com/ to learn everything you need to know.
-
Fork the repo.
-
git cloneyour fork. -
Make a
git checkout -b branch-namebranch for your change. -
Run
yarn install --ignore-scripts(make sure you have node and yarn installed first) Updates -
Make sure to add unit tests
-
If there is a
*.spec.tsfile, update it to include a test for your change, if needed. If this file doesn't exist, please create it. -
Run
yarn testoryarn test:watchto make sure all tests are working, regardless if a test was added.
releases are handled by awesome standard-version
you have to create npm account and register token on your machine 👉
npm adduserIf you are using scope (you definitely should 👌) don't forget to
--scope
Execute yarn release which will handle following tasks:
- bump package version and git tag
- update/(create if it doesn't exist) CHANGELOG.md
- push to github master branch + push tags
- publish build packages to npm
releases are handled by awesome standard-version
yarn release --first-release- To get from
1.1.2to1.1.2-0:
yarn release --prerelease
- Alpha: To get from
1.1.2to1.1.2-alpha.0:
yarn release --prerelease alpha
- Beta: To get from
1.1.2to1.1.2-beta.0:
yarn release --prerelease beta
# See what next release version would be with updated changelog
yarn standard-version --dry-run# check what files are gonna be published to npm
yarn release:preflightBy contributing your code to the {library-name} GitHub Repository, you agree to license your contribution under the MIT license.