Contributing
Repository layout, everyday commands and how to write and preview pages for the Birch UI documentation.
Birch UI is a TypeScript monorepo with npm workspaces. Every package follows the engineering standard (in the repository at docs/ENGINEERING.md), which covers package boundaries, public API rules, runtime rules, performance budgets, accessibility, CSS and testing. Read it before opening a pull request.
Repository layout#
packages/
core/ @birchui/core MIT grid engine: data pipeline, virtualization, DOM renderer, a11y, editing
license/ @birchui/license MIT offline key verification, watermark, key-signing CLI
grid-pro/ @birchui/grid-pro commercial grouping, aggregation, tree, pivot, range, clipboard, fill, master/detail, status bar
excel/ @birchui/excel commercial xlsx writer and reader
scheduler/ @birchui/scheduler commercial resource timeline built on core and the time axis
element/ @birchui/element MIT <birchui-grid> and <birchui-scheduler> custom elements
react/ vue/ angular/ svelte/ solid/ MIT framework adapters around the shared widget contract
apps/
docs/ this documentation site and its build engine
demo/ standalone demos
docs/
ENGINEERING.md the engineering standardPackages import each other only by their public names, such as @birchui/core, never by relative paths into another package's sources. The dependency direction is fixed: license and core depend on nothing, the product packages depend on core and license, and the adapters depend on core plus optional product peers behind /scheduler subpath entries.
Everyday commands#
Run these from the repository root:
| Command | What it does |
|---|---|
npm test |
Runs every package test suite with Vitest and happy-dom |
npx vitest run packages/core |
Runs the tests for one package |
npm run check |
Format check, lint, typecheck and tests; this is what CI runs |
npm run lint:fix |
ESLint with autofix |
npm run format |
Prettier, writing changes |
npm run build |
Builds every workspace in dependency order |
npx changeset |
Records a user-facing change for the release notes |
Use conventional commits, for example feat(grid-pro): pivot totals or fix(core): keep focus after sorting.
Documentation commands#
| Command | What it does |
|---|---|
npm run build --prefix apps/docs |
Builds the static site into apps/docs/dist |
npm run dev --prefix apps/docs |
Starts a local server at http://localhost:4321 that rebuilds and reloads the page when content, demos or package sources change |
npm run check --prefix apps/docs |
Builds the site and fails on any broken internal link or anchor |
npx vitest run --config apps/docs/vitest.config.ts |
Runs the documentation engine tests |
The build never fails because a package is still under construction. A demo that cannot be bundled renders a placeholder, and an API page for a package without exports says so; both print a warning in the terminal.
Writing pages#
Pages are Markdown files in apps/docs/content/<section>/<page>.md. The file path becomes the URL: content/grid/sorting.md is published at /grid/sorting/, with a plain-text twin at /grid/sorting.md.
Frontmatter#
Every page starts with a frontmatter block:
---
title: Sorting
description: Sort by one or more columns, with custom comparators and a sort model you can save.
section: Birch UI Grid
order: 4
badge: Pro
navTitle: Sorting
---| Field | Required | Purpose |
|---|---|---|
title |
Yes | Page heading, browser title and sidebar label |
description |
Yes | One sentence for the page lead, search results, meta tags and llms.txt |
section |
Yes | Sidebar section, such as Getting started, Birch UI Grid, Grid Pro, Excel Engine, Scheduler, Frameworks or Contributing |
order |
Yes | Position within the section |
badge |
No | Pro, Scheduler, Excel or MIT, shown next to the title and in the sidebar |
navTitle |
No | A shorter sidebar label |
Start the body with ## headings; the title is rendered from frontmatter. Every ## and ### heading gets a GitHub-style anchor and appears in the "On this page" list. Add {#custom-id} at the end of a heading to choose its anchor.
Callouts#
:::note
Plain information that helps but is not essential.
:::
:::tip Faster updates
Use applyTransaction for streaming data.
:::
:::warning
Something that can lose data or surprise users.
:::
:::pro
Marks a paid feature and links to pricing. The default label is "Grid Pro";
write `:::pro Scheduler` or `:::pro Excel Engine` for other products.
::: :::danger is also available. The text after the callout name replaces the default title.
Framework tabs#
Wrap fenced code blocks in :::tabs. The words after the language become the tab label, and the chosen framework is remembered across pages:
:::tabs
```tsx React title="OrdersGrid.tsx"
<BirchGrid columns={columns} rows={orders} />
```
```vue Vue
<BirchGrid :columns="columns" :rows="orders" />
```
:::Use the labels React, Vue, Angular, Svelte, Solid, Web Component and JavaScript for framework examples, and npm, pnpm and yarn for install commands.
Live demos and API tables#
:::demo grouping-aggregation height=520
:::api GridOptions
:::api core:GridApi only=setRows,applyTransaction :::demo embeds a live example from apps/docs/demos/<name>.ts with a "View source" toggle. A demo module exports a default mount(element) function that returns a cleanup function, and it imports packages by their public names.
:::api inserts a table generated from the TypeScript source of the package entry points. Prefix the symbol with a package name when two packages export the same name, and use only= to show selected members. The full reference for each package is generated at /api/<package>/.
Links#
Link to other pages with absolute paths and a trailing slash, such as /grid/filtering/#quick-filter. Relative links to .md files also work. npm run check --prefix apps/docs reports every broken link and missing anchor.
Style#
- Write for the developer using the component, in plain, direct sentences and sentence-case headings.
- Use realistic data in examples: orders, customers, regions, revenue, technicians and work orders.
- Every code example should run as written once its imports are in place. Prefer complete examples over fragments.
- Document only what the package exports. If something is planned but not exported yet, leave it out.
Pull requests#
Before you open a pull request:
npm run checkpasses.- New behaviour has tests, and bug fixes have a regression test.
- Public API changes are exported from the package's
src/index.ts, typed generically and documented inapps/docs/content. npm run check --prefix apps/docspasses if you changed documentation.- A changeset is added for published packages.
The engineering standard has the complete definition of done.