Thanks for your willingness to contribute. It takes a lot of courage to even visit this section. I sincerely appreciate it. Please follow the guidelines in this document to get you started with the repo and codebase.
Make sure to do a quick search on the closed issues before opening a new issue or a pull request. We have discussed about a few topics already so you may find your answer in some of the issues.
I love to get feature requests or bug fixes in the PRs, but please open an issue first before opening the pull request. This will allow me to assess the work needed to fulfill the request or fix the bug.
No format is required for branch name or commit messages, I personally don't think that's relevant in any way. Your contribution is very valuable and will be taken into account in whatever shape it comes.
The codebase is written in TypeScript so you will need at least a bit of familiriaty with the language. This library implements the MVC pattern in the following way:
notyf.ts
: The Controller. Exposes the main API and manages the creation and destruction of the entities (toasts).notyf.model.ts
: The Model. Represents the state of a Notyf instance by storing the array of active toasts.notyf.view.ts
: The View. Interacts with the DOM to create and destroy the toasts elements.
Ensure that all tests are passing before opening the pull request. To do this, run npm run test:dev
and then click on notyf_spec.js
to run the suite.
You'll also need to add unit tests for the features or fixes implemented in your PR. Don't be discouraged by this if you don't feel confident about it. Just open the PR and I will guide you through the process of creating tests for it.
I haven't set up a good hot reload strategy yet so the dev experience is not great now. Follow the next steps to spin up and test the project locally:
- Fork the repo
- Clone the repo
git clone <your-fork-url>
- Install dependencies:
npm i
- Run the dev server:
npm run dev
- Open the browser at
localhost:8080
- Play with the UI controls and the code at
demo/scripts/script-demo.js
. That's your playground to try new configurations or features. - Edit the source code within
/src
- Compile:
npm run build
. This will output a new minified bundle; lite-server will listen and refresh the browser. - Go to step 5.