Contributing to dgkit
July 24, 2026 · View on GitHub
Thanks for your interest in improving dgkit! This guide covers the local workflow, conventions and the release process.
Prerequisites
- Node.js
^20.19 || ^22.12 || ^24— runnvm useto match.nvmrc(24.13.0). - Yarn
>=4(Berry) — provisioned bycorepack enable.
git clone <your-fork-url> dgkit
cd dgkit
nvm use
yarn install
Everyday commands
yarn build # build all packages
yarn test # Vitest + coverage (all packages)
yarn lint # ESLint (type-aware)
yarn typecheck # tsc --noEmit
yarn format # Prettier --write
yarn verify # everything CI runs, locally
Scope any target to one project with Nx, e.g. yarn nx test resize-observer.
Nx caches results and yarn nx affected -t build test lint only runs what your
changes touched.
Project conventions
- Standalone + signals only. No
NgModules, no deprecated APIs. - Strict everything — strict TypeScript, strict Angular templates, type-aware
ESLint. Fix issues; do not leave
TODOs or disable rules without a reason. - SSR-safe — never touch browser globals in field initializers; guard with
isPlatformBrowserand feature detection. - Every package is tested with Vitest (Angular packages via the Analog
plugin; framework-free packages run plain). See
resize-observerfor the signal-API + directive pattern. - Coverage thresholds: statements 95%, branches 90%, functions 95%, lines 95%.
Adding a package
yarn new:package <name> "<one-line description>" # Angular package
yarn new:package <name> "<description>" --pure # no Angular peers
Then implement it, document it in its README.md, and add it to the table in the
root README.
Commits
We use Conventional Commits:
feat(resize-observer): add device-pixel-content-box support
fix(resize-observer): normalize NaN debounce to zero
docs: clarify initial emission semantics
test(resize-observer): cover teardown edge cases
ci: run vitest coverage on pull requests
chore: bump nx to 23.1.0
Changesets & releasing
Every PR that changes a published package must include a changeset:
yarn changeset
Choose the package(s) and bump (patch/minor/major) and write a short summary.
Maintainers release by merging the automated “Version Packages” PR (created by the
release workflow), which runs changeset version and then changeset publish
with npm provenance.
Pull requests
- Branch off
main. - Keep changes focused; add/adjust tests.
- Run
yarn verifylocally. - Include a changeset when applicable.
- Open the PR — CI must be green before review.
By contributing you agree your work is licensed under the MIT License.