Skip to content

Contributing

Setup

Requires Node.js 22 or later (tested on Node 22 LTS and Node 24).

bash
git clone https://github.com/mayanklahiri/datasole.git
cd datasole
npm install
npx playwright install chromium

npm install automatically sets up git hooks via husky.

Quality Gates

The default developer gate is:

bash
npm run gate

It runs the following non-performance pipeline, in order, and stops on the first failure:

StepCommandWhat it checks
1. CleancleanRemove all build artifacts
2. Formatformat:checkPrettier formatting
3. LintlintESLint + TypeScript (tsc --noEmit)
4. Buildbuild:allRoot package + all demo builds
5. Unit teststest --coverageVitest + v8 coverage
6. Core e2etest:e2e:runPlaywright functional e2e (non-benchmark)
7. Integrationtest:e2e:demos:runDemo/integration e2e across all demos
8. Summarygate:summaryPrint pass/fail with statistics

On success, the gate prints a summary with bundle sizes, coverage percentages, and a GATE PASSED status. The exhaustive gate additionally captures docs and metrics.

npm run dist is an alias for npm run gate.

The exhaustive CI/nightly gate is:

bash
npm run gate:full

It runs npm run gate plus:

StepCommandWhat it checks
9. Benchmarkstest:bench:runPlaywright load/performance scenarios
10. Metricscollect-metricsBundle sizes, coverage, e2e, benchmark stats
11. Docsdocs:buildGenerate static documentation site

When the gate runs automatically

TriggerWhat runsHow
Pre-commitStaged format/lint + developer gatelint-staged then npm run gate via husky
Pre-pushDeveloper gatenpm run gate via husky
CIExhaustive gatenpm run gate:full on push/PR to main
NightlyExhaustive gate + bot artifact commitDependency workflow on main
PublishExhaustive gateprepublishOnly hook

Quick commands for development

CommandDescription
npm run buildBuild all targets (no lint/test)
npm testRun unit tests only
npm run test:watchUnit tests in watch mode
npm run test:e2eE2E tests only (builds first)
npm run test:e2e:demosDemo e2e tests (builds + runs all 3 demos)
npm run test:integrationAlias for demo/integration e2e
npm run test:benchPerformance/load benchmarks
npm run lintESLint + type check only
npm run formatAuto-format all files
npm run format:checkCheck formatting without fixing
npm run docs:buildBuild docs site only
npm run docs:previewPreview docs site locally
npm run gateDeveloper gate (non-performance)
npm run gate:fullExhaustive CI/nightly gate

Learning the Codebase

If you're new to datasole:

  1. Read the Tutorials — they show every feature with runnable code
  2. Read the Architecture — the learning path diagram shows how concepts connect
  3. Read the ADRs — they explain why the code is structured this way

Architecture Decisions

All ADRs are in docs/decisions.md. Read them before making structural changes.

If your change involves an architectural decision:

  1. Add a new ADR section to docs/decisions.md
  2. Use the next sequential number (e.g., ADR-016)
  3. Include: Status, Date, Context, Decision, Consequences
  4. Reference the ADR number in your commit message

PR Guidelines

  1. Run npm run gate locally — it must pass before opening a PR
  2. Add/update tests for any new functionality
  3. Update relevant docs/*.md files — especially tutorials and examples if your change adds user-facing features
  4. If your change involves an architectural decision, add an ADR to docs/decisions.md
  5. Include the ADR number in the commit message if applicable
  6. Write commit titles and opening body lines around the intention behind the change, not just the files touched

Git Hooks

Hooks are managed by husky and installed automatically by npm install:

  • pre-commit: Runs lint-staged, then npm run gate — non-performance validation only.
  • pre-push: Runs npm run gate — the same non-performance developer gate.

To bypass hooks in an emergency: git push --no-verify (discouraged).

Documentation Style

When writing or updating docs:

  • Every feature should have at least one runnable example (both server and client code)
  • Examples should be as short as possible while remaining complete and copy-pasteable
  • Cross-reference related tutorials: > **Tutorial:** [Name](tutorials.md#anchor)
  • If adding a new pattern, add it to docs/tutorials.md and the relevant section of docs/developer-guide.md