Skip to content

Commit

Permalink
update contributing guides
Browse files Browse the repository at this point in the history
  • Loading branch information
fkhadra committed Nov 24, 2024
1 parent a7d47d6 commit 6580d69
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 28 deletions.
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
**Before submitting a pull request,** please make sure the following is done:

1. Fork [the repository](https://github.com/fkhadra/react-toastify) and create your branch from `master`.
2. Run `yarn` in the repository root.
1. Fork [the repository](https://github.com/fkhadra/react-toastify) and create your branch from `main`.
2. Run `pnpm` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`).
5. Run `yarn start` to test your changes in the playground.
4. Ensure the test suite passes (`pnpm test`).
5. Run `pnpm start` to test your changes in the playground.
6. Update the readme is needed
7. Update the typescript definition is needed
8. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier-all`).
9. Make sure your code lints (`yarn lint:fix`).
8. Format your code with [prettier](https://github.com/prettier/prettier) (`pnpm prettier`).
9. Make sure your code lints (`pnpm lint:fix`).

**Learn more about contributing [here](https://github.com/fkhadra/react-toastify/blob/master/CONTRIBUTING.md)**
30 changes: 9 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Please note we have a code of conduct, please follow it in all your interactions
- Ensure that nothing get broke. You can use the playground for that
- If applicable, update the [documentation](https://github.com/fkhadra/react-toastify-doc)
- Use prettier before committing 😭
- When solving a bug, please provide the steps to reproduce it(codesandbox is our best friend for that)
- When solving a bug, please provide the steps to reproduce it(codesandbox or stackblitz are our best friends for that)
- Tchill 👌

## Setup

### Pre-requisites

- *Node:* `^16.0.0`
- *Node:* `^18.0.0`
- *Yarn*

### Install
Expand All @@ -37,43 +37,31 @@ git checkout -b my-branch
Install dependencies:

```sh
yarn install
pnpm install
// then
yarn setup
pnpm setup
```

## Developing

How it works ? The library don't use a state management library like redux or mobx to dispatch the notifications. Instead it uses a dead simple pubsub.


```sh
# launch the playground
yarn start
pnpm start

# Run tests 💩
yarn test
pnpm test

# Prettify all the things
yarn prettier
pnpm prettier
```

### Project structure

#### Scss

All the style rules lives in the `scss` directory. The filename are self-explanatory about their content.

#### Example dir
### Playground dir

The playground let you test your changes, it's like the demo of react-toastify. Most of the time you don't need to modify it unless you add new features.

#### Src
### Src

- [toast:](https://github.com/fkhadra/react-toastify/blob/main/src/core/toast.ts) Contain the exposed api (`toast.success...`).

- [eventManager:](https://github.com/fkhadra/react-toastify/blob/main/src/core/eventManager.ts)
This is the glue between `toast` and `ToastContainer`. In fact, it is just a dead simple pubsub.

## License
By contributing, you agree that your contributions will be licensed under its [MIT License](https://github.com/fkhadra/react-toastify/blob/main/LICENSE).
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ $ yarn add react-toastify
import React from 'react';

import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

function App(){
const notify = () => toast("Wow so easy!");
Expand Down

0 comments on commit 6580d69

Please sign in to comment.