Thank you for your interest in contributing to dataqueue! Your help is greatly appreciated. This guide will help you get started with contributing to the monorepo, from setting up your environment to submitting your first pull request.
- Monorepo Structure
- Getting Started
- Development Workflow
- Coding Standards
- Testing
- Submitting Changes
- Reporting Issues
- Code of Conduct
packages/dataqueue: The main library package.apps/docs: The documentation site.apps/demo: Example Next.js app using the library.
-
Fork the repository on GitHub and clone your fork locally:
git clone https://github.com/your-username/dataqueue.git cd dataqueue -
Install dependencies (using pnpm):
pnpm install
-
Set up your environment:
- Copy
env.exampleto.envand update the variables as needed (e.g.,DATABASE_URL). - Make sure you have a PostgreSQL instance running and accessible. You can use the docker-compose file in the root of the monorepo to start a PostgreSQL instance:
docker-compose up
- Copy
-
Run the demo app:
pnpm dev
This wil run three things: the demo Next.js app, the library in watch mode, and the cron job to trigger the jobs processing, reclaim stuck jobs, and cleanup old jobs.
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bugfix - Run
pnpm devfrom the root of the monorepo to start the demo app and the library in watch mode. - Make your changes, following the coding standards below.
- Add or update tests as needed.
- Run the test suite to ensure everything works:
cd packages/dataqueue && pnpm test
- To build the library:
cd packages/dataqueue && pnpm build
- To run the demo app:
pnpm dev
- Commit your changes with a clear, descriptive message.
- Push your branch and open a pull request (PR) against the
mainbranch.
- Use TypeScript for all code.
- Follow the existing code style. We use Prettier for formatting.
- Run
pnpm formatbefore submitting your PR. - Write clear, concise comments and documentation.
- Avoid using the
anytype; prefer strict typing. - Group related code (components, hooks, utils) together for easier maintenance.
- The documentation is using Fumadocs and written in MDX format.
- The documentation is written in the
apps/docs/content/docsdirectory. - Create or update the documentation for the changes you made.
- Run
pnpm devin theapps/docsdirectory to preview the documentation.
- All new features and bug fixes should include relevant tests.
- First run
docker-compose upto start the PostgreSQL container which will be used for testing. - Run the test suite with:
cd packages/dataqueue && pnpm test
- Add tests in the
src/directory of the package with the name*.test.ts, following the existing test structure. - Tests should be deterministic and not depend on external state.
- In this project, the tests don't mock the database. They use the real postgres database. That's why you need to run
docker-compose upbefore running the tests. Before each test, a new schema in the PostgreSQL database will be created. The code will be executed in the context of the new schema. See the existing tests for reference.
- Ensure your branch is up to date with
mainbefore opening a PR. - Provide a clear description of your changes in the PR.
- Reference any related issues (e.g.,
Resolves #123). - Be responsive to feedback and make requested changes promptly.
- PRs should pass all CI checks before merging.
- Publishing: All publishable packages (
@nicnocquee/dataqueue,@nicnocquee/dataqueue-react,@nicnocquee/dataqueue-dashboard) are published to npm automatically when a GitHub Release is created.
- Production release: Create a new GitHub Release. All publishable packages are published to npm automatically by CI.
- Beta release: Every push to
mainautomatically publishes a beta pre-release to npm under thebetadist-tag.
If you find a bug or have a feature request:
- Search existing issues to avoid duplicates.
- Open a new issue with a clear title and detailed description.
- Include steps to reproduce, expected behavior, and relevant logs or screenshots.
- Be respectful and inclusive in all interactions.
- Provide constructive feedback and be open to feedback on your contributions.
- See Contributor Covenant for general guidelines.
Thank you for helping make dataqueue better!