Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 3.02 KB

CONTRIBUTING.md

File metadata and controls

56 lines (44 loc) · 3.02 KB

Contributing

Layout

src/        the package @sqlane/core: the queue, the SQL of each dialect, migrations, adapters; unit tests next to the code
types/      its declarations: generated from the JSDoc of src/ (`pnpm build:types`), committed
test/       integration tests (MySQL, MariaDB and PostgreSQL in Docker, testcontainers), type tests, test databases
examples/   usage examples; examples/quickstart: runs with the published package (CI: with the packed one)
bench/      the benchmarks
docs/       api, adapters, comparison, comparison-performance, design, benchmarks, cpu-cost, releasing
scripts/    CI scripts

test/mikro-orm-6 has its own package.json and lockfile, which install MikroORM 6 for the tests. A separate install is needed because its drivers take @mikro-orm/core as a peer, and an npm alias in the root would give them core 7. pnpm install at the root also installs this folder, through pnpm:devPreinstall.

Setup

You need mise and Docker to work on sqlane. mise installs the tools that mise.toml lists: Node.js, pnpm, hk, betterleaks, typos, actionlint and zizmor.

mise install
pnpm install
hk install --global --mise   # Git hooks, also for GUI Git clients: lint, format, type check, secrets, typos, Conventional Commits

Commands

Command Does
pnpm test Run the tests (Vitest)
pnpm lint Lint, including formatting (oxlint, @stylistic)
pnpm lint:fix Fix lint and formatting
pnpm format Format the other files: JSON, YAML, Markdown, TOML (oxfmt)
pnpm lint:package Check the package that npm would publish (publint)
pnpm typecheck Type-check the JSDoc (tsc, no emit)
pnpm build:types Generate types/ from the JSDoc of src/
pnpm check Run all hook checks on all files (hk check --all)
pnpm bench Run the benchmarks (Docker)
pnpm bench:cpu Measure the CPU cost per job vs main
pnpm bench:compare Run the comparison with other queues

Commits and changesets

Commit messages follow Conventional Commits. A change of what npm publishes (src/, types/, README.md, LICENSE, package.json beyond dev dependencies and scripts) adds a changeset (pnpm changeset); see releasing.

Pull requests

  • For a larger change, open an issue first, so that we can agree on the approach.
  • Run pnpm check and pnpm test before you push.
  • The title of the pull request follows Conventional Commits, because a squash merge uses it as the commit message.
  • A change of what npm publishes adds a changeset, as described above.