Contributing
React Simple Chatbot is open source, and contributions are welcome: bug reports, feature ideas, code and documentation. The code lives at github.com/LucasBassetti/react-simple-chatbot. Please follow the code of conduct in every interaction.
Open an issue
Section titled “Open an issue”Open an issue to report a bug or propose a feature.
- Bugs: describe the steps to reproduce the problem, what happened and what you expected. Include the versions of react-simple-chatbot, React, styled-components and your browser.
- Features: explain what the feature does, why it is useful and how you would use it. Parts you are unsure about are fine to leave open for discussion.
Contribute code
Section titled “Contribute code”The library is written in TypeScript with React function components and hooks. For big changes, open an issue first so the approach can be discussed before you spend time on it.
-
Fork the repository on GitHub, clone your fork and create a branch for your change. Avoid working on
masterdirectly.Terminal window git clone https://github.com/YOUR_USERNAME/react-simple-chatbot.gitcd react-simple-chatbotgit checkout -b fix/my-change -
Install the dependencies:
Terminal window npm install -
Run the example app while you work.
npm startserves the app inexample/with Vite athttp://localhost:5173:Terminal window npm start -
Make your change and add tests that cover it. Before pushing, check that everything passes:
Terminal window npm testnpm run lintnpm run typechecknpm run build -
Push your branch to your fork and open a pull request against the
masterbranch of the main repository.
Commands
Section titled “Commands”| Command | What it does |
|---|---|
npm start |
Runs the example app (example/) with Vite. |
npm test |
Runs the tests with Vitest and Testing Library. |
npm run test:watch |
Runs the tests in watch mode. |
npm run test:coverage |
Runs the tests with a coverage report. |
npm run lint |
Checks the code with ESLint and Prettier. |
npm run typecheck |
Checks the types with TypeScript. |
npm run build |
Builds dist/: the ES module and UMD builds and the type declarations. |
Pull request title
Section titled “Pull request title”The pull request title must follow Conventional Commits:
<type>(<optional scope>)!: <short summary in the imperative mood>The type is one of:
| Type | Use it for |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only |
style |
Formatting, no code change |
refactor |
A code change that neither fixes a bug nor adds a feature |
perf |
A performance improvement |
test |
Adding or fixing tests |
build |
The build system or dependencies |
ci |
The CI configuration |
chore |
Other changes that don’t modify the source or the tests |
revert |
Reverting a previous commit |
Add ! after the type or scope for a breaking change. For example:
feat: add a typing indicator to custom stepsfix(cache): restore options without valuefeat!: drop React 17 supportPull request description
Section titled “Pull request description”Fill in the pull request template. It asks for:
- a description of what the change does and why,
- the related issue, if there is one,
- the type of change,
- how you tested it (tests, browsers, React versions, the example app),
- for breaking changes, what breaks and how to migrate.
Contribute to these docs
Section titled “Contribute to these docs”Every page has an Edit page link at the bottom that opens its source on GitHub. For small fixes, that is the fastest way to propose a change.
The site is built with Astro Starlight and lives in the website/ folder of the gh-pages branch. The pages are MDX files in website/src/content/docs/, and the live examples are in website/src/examples/.
-
Check out the
gh-pagesbranch of your fork and start the development server:Terminal window git checkout gh-pagescd websitenpm installnpm run dev -
Edit the pages and check them in the browser.
-
Type-check and build the site. The build also validates the internal links:
Terminal window npm run checknpm run build -
Commit the changes in
website/and open a pull request againstgh-pages. After the merge, the Site workflow rebuilds the published site in the root of the branch, which GitHub Pages serves.