👋 Hey there! We're thrilled that you're interested in contributing to Wedges. Before submitting your contribution, please take a moment to read through this guide.
Our repository is managed with PNPM. Make sure you have PNPM installed to work with this repository.
It is structured as a Turborepo monorepo and it contains two main directories:
-
packages/wedges: This is the heart of our project – the UI library itself. Here you'll find all the components, utilities, TailwindCSS plugin and core functionality of the Wedges UI library.
-
apps/docs: Contains the Next.js documentation site for the Wedges UI library. This is where we maintain the documentation, examples, and guides for using the library.
In the Wedges project, we utilize a variety of tools to ensure code quality, consistency, and smooth development processes.
-
Prettier: for code formatting. Our codebase adheres to the configuration specified in
.prettierrc
. -
ESLint: for code linting. Make sure to check and fix any linting issues before submitting your code.
-
React Testing Library: for testing. We encourage writing tests for new features and bug fixes.
-
Jest Framework: for running tests.
-
husky: for Git hooks. It ensures that linters, and other checks are passed before commits and pushes.
-
tsup: for bundling the library files. We bundle both ESM and CJS versions of the library.
-
Changesets: for changelog generation and release management.
Our project follows the Conventional Commits specification for commit messages.
When preparing your commits for a Pull Request, ensure they adhere to our commit message format: type(scope): description
. The type
and scope
help categorize the commit, making our history readable and organized.
Your commits should fall into one of the following categories:
-
feat
(orfeature
): Introduces new code or functionality to the project. -
fix
: Addresses and resolves a bug. Linking to an issue if available is highly encouraged. -
refactor
: Code changes that neither fix a bug nor add a feature, but improve the existing codebase. -
docs
: Updates or additions to documentation, such as README files, usage guides, etc. -
build
: Changes affecting the build system, including dependency updates and additions. -
test
: Modifications involving tests, including adding new tests or refining existing ones. -
ci
: Adjustments to our continuous integration setup, like GitHub Actions or other CI tools. -
chore
: General maintenance and organizational tasks that don't fit other categories.
For example, a commit message might look like: feat(components): introduce new Button styles
.
-
Develop in dedicated branches, not directly on the
main
branch. -
Use descriptive names for your branches.
-
Ensure GitHub Actions pass before submitting your PR. Run
pnpm lint
andpnpm format
before pushing your branch. -
Ideally add tests for new features or bug fixes.
-
It's okay to have multiple small commits in your PR.
-
We'll squash the commits when merging into
main
. -
Follow our Commit Convention.
-
Provide tests for new features.
-
Discuss new features in an issue or discussion topic before coding.
-
Describe the bug in detail in your PR.
-
Include steps to reproduce or a live demo if possible.
-
Link the issue your PR fixes, using the format
fix #issue_number
.
Remember, clear and detailed PRs help us efficiently review and integrate your contributions!
-
For every code change, especially API modifications or new features, ensure corresponding updates in documentation.
-
You'll find our documentation in the
apps/docs/public/docs
folder. We are using MDX format which allows us to embed JSX components within markdown. -
Wedges components are available to use in the mdx files.
-
Fork and Clone: Begin by forking the main repository and cloning your fork.
-
Branching: Create a new branch off
main
using the format[type/scope]
, likefeat/button-enhancement
ordocs/update-readme
. Thetype
should align with conventional commit types. -
Development: Make your changes and commit them adhering to the commit guidelines. Use
pnpm build
to test your changes. -
Document Changes: Run
pnpm changeset
for a detailed change description. For minor updates (like CI changes), usepnpm changeset add --empty
. -
Prepare for Submission:
- Use
pnpm dev
to start the development server - Use
pnpm build
to run tests and linters and to make sure your code builds without errors. - Ensure your Node version is 16 or higher.
- Use
-
Final Steps:
- Ensure all tests pass and the package builds correctly.
- Push your branch and open a PR to
main
.
-
pnpm dev
: Starts the Next.js development server for the documentation site and tsup in development mode for the library. -
pnpm build
: Creates production builds of the library and documentation site. It also runs linting checks. -
pnpm lint
: Executes ESLint across the entire repository. -
pnpm lint:fix
: Runs ESLint and fixes fixable issues throughout the repository. -
pnpm format
: Executes Prettier for code formatting across the repository. -
pnpm format:fix
: Runs Prettier and fixes format issues across the repository. -
pnpm test
: Executes Jest tests across the repository. -
pnpm clean
: Cleans the project by removingdist
,node_modules
, and other build directories. -
pnpm changeset
: Manages changelog generation and release preparation.
Once your pull request is merged, it becomes a part of the Wedges project! We deeply appreciate your contributions and encourage you to keep participating. Feel free to tackle more issues or suggest new features.
Thank you for making Wedges better! 🎉