Welcome to CONTRIBUTING zone. If you are reading this, you probably want to contribute to Open Source projects. That's great! Contributing to an open source project is a great opportunity to learn, sharpen your skills and help others. Luckily, date-utils is a free and open source project and we always welcome new contributors. Its mission is to help developers
date-utils aims to be a community-driven project. So we hope to see your contributions to make date-utils a favorite library for developers when it comes to testing.
We appreciated any help. There is not a thing as a small contribution. If you see a typo, send us a PR. If you experience a bug, please open an issue. If you have a suggestion, let us know. Below are some ways you can contribute to date-utils:
- Submit bugs or issues: Software is full of bugs. date-utils is no exception. If you use date-utils and find a bug, please open an issue at date-utils's issues
- Docs: We have a documentation site at here, it's very easier to contribute to the documentation by using
Edit this page
button at the bottom of each page. If you see a typo, an unclear page or incorrect grammar, please send us a PR. - Fix bugs: We are tracking bugs at Issues. Please claim an issue then open a PR to fix a bug.
- Add new features: Do you use date-utils for your projects and find out date-utils is missing a feature? Please open an issue to discuss it. And it's great if you can help to implement that feature.
- Answer questions and discussions on GitHub and Discord: GitHub discussions and Discord
If not sure what to contribute, but you still want to contribute something, let us know in Discord (channel #contributors)
There are some labels worth looking at for a new contributor:
- good first issue: Some issues to help you get your feet wet with date-utils
- help wanted: If you have specific knowledge in one domain, working on these issues can make your expertise shine.
If you want to work on any of these issues, just drop a message such as "I'd like to work on this". Depending on the difficulty of the issue, it can take a few days or a week to implement the feature/ bug fix. It's great if you can send a PR within seven days. If you need more time on a specific issue, please let us know. After that, we can delegate the issue to someone else if you are not available.
date-utils repository has some npm scripts to help you develop efficiently.
npm install
: install all dependenciesnpm run build.watch
: builddate-utils
and rebuild it when changes are madenpm run types
: emit types, usually only need to run only oncenpm run test
: run Jest at__tests__/index.test.ts
(you will work with this file most of the time)
Install dependencies:
npm install
Run the real demo app:
npm run dev
Run jest tests and date-utils server simultaneously:
npm run test
However, it's recommended to run jest tests and date-utils server separately:
npm run test # Run jest
Following are brief descriptions of the repository architecture:
- src: contains most of the code of date-utils such as
getKeyMonthFromToDate
function,getPageMonth
function, all types, etc.S - dist: Distribution code, which is bundled and processed by Rollup (previously: Vite Library Mode).
So you have decided to contribute code back to upstream by opening a pull request. You've invested a good chunk of time, and we appreciate it. We will do our best to work with you and get the PR looked at.
There are a few things when you open a PR:
- Make sure CI passes
- Prefer atomic commits
- Prefer rebase over merge: If you create a new branch from
master
and work on it for a while. There is a chance thatmaster
will be updated and there will be a conflict betweenmaster
and your branch. We would love to have you rebase your branch on top ofmaster
instead of merging it when your PR is ready.
We would love to have you on the list of contributors and thank you for your contribution. Happy coding!