Contributing
June 7, 2024 ยท View on GitHub
Thank you for your interest in contributing to the zsa project. We appreciate your support and welcome any contributions that can help improve the project. Please take a moment to review this document before submitting your first pull request.
About this repository
This repository is a monorepo that includes the following packages:
tests/jest: A Next.js project with atestsfolder that stores all the tests.examples/showcase: A package that deploys to zsa.vercel.app and stores documentation and examples.packages/zsa: The corezsapackage.packages/zsa-react: The Reactzsapackage.packages/zsa-openapi: The OpenAPI package.packages/zsa-react-query: The React Query package.
We use the following tools for development and package management:
- Turborepo as our build system.
- Changesets for managing releases.
- npm for package management.
Development
To get started with development, follow these steps:
-
Fork the repository by clicking the "Fork" button in the top right corner of the GitHub page.
-
Clone your forked repository to your local machine:
git clone https://github.com/your-username/zsa.git -
Navigate to the project directory:
cd zsa -
Create a new branch for your changes:
git checkout -b my-new-branch -
Install the dependencies:
npm install -
Start the development server:
npm run devThis command puts everything in dev mode. You can go to
localhost:3000to see the showcase. When you change a file in any package in dev mode, it will automatically rebuild for you, and you will have access to the new types. -
Run the tests:
npm run testNOTE: The Jest tests are in the
__tests__folder. NOTE: The Playwright tests are in thee2efolder.This command will run the test package and all the tests inside.
Getting Hands Dirty with the Project
If you want to make changes to any of the packages in the project, you can test your changes in two ways:
Assuming npm run dev is running
-
Write a new test case:
- Navigate to the
tests/jestpackage. - Create a new test file or modify an existing one to cover your changes.
- Run
npm run testto execute the tests and ensure your changes are working as expected.
- Navigate to the
-
Create UI components in the showcase:
- Navigate to the
examples/showcasepackage. - Add a new example component in the
ExampleComponentfile or create a new file for your example. - Inject your example into a content page or component where you want to test it.
- Make sure the dev server is running, navigate to where you placed the component, and see the changes.
- Navigate to the
Feel free to explore the codebase and make changes to any of the packages. Remember to keep the tests updated and provide clear examples in the showcase to demonstrate your changes.
Pull Request Process
-
Ensure that your changes adhere to the project's coding conventions and have been thoroughly tested.
-
Create a pull request from your branch to the
mainbranch of the main repository. -
Provide a clear and descriptive title for your pull request, summarizing the changes made.
-
In the pull request description, include a detailed explanation of the changes, along with any relevant information or examples.
-
If your pull request addresses an open issue, please reference it in the description using the
Fixes #issue-numbersyntax. -
Be responsive to feedback and be prepared to make changes to your pull request if requested by the maintainers.
Reporting Issues
If you encounter any bugs, have feature requests, or want to discuss potential improvements, please open an issue on the GitHub repository. When creating an issue, provide a clear and concise description of the problem or suggestion, along with any relevant information or examples.
We appreciate your contributions and look forward to collaborating with you to make the zsa project even better!