Thank you for your interest in contributing to @stainless-code/react-custom-events! Your contributions are greatly appreciated, whether it's fixing a bug, adding a feature, improving documentation, or providing feedback.
-
Fork the repository on GitHub: https://github.com/stainless-code/react-custom-events
-
Clone your fork locally:
git clone https://github.com/<your-username>/react-custom-events.git cd react-custom-events
-
Install dependencies:
bun install
Make sure you have Bun installed, or use an alternative package manager (
npm
,yarn
, orpnpm
).
Run the build process to compile the library:
bun run build
This will generate the compiled output in the dist
directory.
To watch for changes and rebuild automatically during development:
bun run dev
The following scripts are available in the package.json
file:
Script | Command | Description |
---|---|---|
build |
tsup |
Builds the project. |
clean |
rimraf dist node_modules |
Cleans the output and dependencies. |
dev |
tsup --watch |
Starts a development build watcher. |
format |
prettier . --write |
Formats code using Prettier. |
format:check |
prettier . --check |
Checks code formatting without modifying files. |
lint |
eslint . |
Lints the project for code quality. |
lint:fix |
eslint . --fix |
Fixes linting issues automatically. |
test |
vitest run |
Runs all tests using Vitest. |
typecheck |
tsc |
Verifies TypeScript type definitions. |
release |
changeset publish |
Publishes a new release. |
version |
changeset version |
Prepares a version update with Changesets. |
We use Vitest for testing. To run the tests:
bun run test
To run tests in watch mode:
bun run test -- --watch
Please ensure all tests pass before submitting a pull request.
We follow strict coding standards enforced by Prettier and ESLint.
- Run
bun run lint
to check for linting issues. - Run
bun run lint:fix
to automatically fix issues. - Run
bun run format
to format the codebase.
Before submitting your changes, ensure your code passes linting and formatting checks.
-
Create a feature branch:
git checkout -b my-feature-branch
-
Make your changes and commit them:
git add . git commit -m "feat: add my feature"
-
Push your changes to your fork:
git push origin my-feature-branch
-
Open a pull request on GitHub to the
main
branch of the upstream repository: https://github.com/stainless-code/react-custom-events/pulls
Your contributions are valued and appreciated! If you encounter any issues or need guidance, feel free to open an issue or contact us at [email protected].