Contributing
Contributions are welcome. Please open an issue before submitting a pull request for non-trivial changes.
git clone https://github.com/mkafonso/pgshiftcd pgshiftnpm installnpm run buildProject structure
Section titled “Project structure”packages/ # Public modules — @pgshift/search, @pgshift/cache, @pgshift/queueadapters/ # Internal adapters — search-postgres, cache-postgres, queue-postgresexamples/ # Runnable examples__tests__/ # Unit and integration testsapps/docs/ # This documentation sitetooling/ # Shared tsconfig and lint configRunning examples
Section titled “Running examples”npm run dev --workspace=examples/search-basicnpm run dev --workspace=examples/cache-basicnpm run dev --workspace=examples/queue-basicRunning tests
Section titled “Running tests”# Unit tests onlynpm run test:unit --workspace=__tests__
# Integration tests (requires Docker)npm run test:integration --workspace=__tests__
# All testsnpm run test --workspace=__tests__Adding a new adapter
Section titled “Adding a new adapter”- Create
adapters/{module}-{backend}/following the structure of an existing adapter - Implement the adapter contract from
@pgshift/core - Export a factory function as the only public API
- Add an example under
examples/ - Open a pull request
Adding a new module
Section titled “Adding a new module”- Define the adapter contract in
packages/core/source/types.ts - Add the module to
PgShiftConfigandPgShiftClient - Create the public package under
packages/ - Implement at least one adapter under
adapters/
Code style
Section titled “Code style”PgShift uses Biome for formatting and linting.
npm run format