Contributing to TiLiE#

TiLiE is a pnpm TypeScript workspace with a Svelte 5 application and a separate Python server. The application is an early alpha that arranges, inspects, opens and saves workspaces but does not yet load sources through the server, so contributions should preserve the package boundaries and document exactly what a new behavior proves.

Setup#

Install Node.js 22.18 or newer, pnpm 12.10.1, Python 3.11 or newer, and uv.

The five application packages that use the schema, core, layout, writers, arranger and editor, take it from the @timetoalign/timetoshare package on npm (^0.2.0). To try a schema change before it is released, replace that range in the five package manifests with a link: to the js/ directory of a TimeToShare checkout beside this repository (link:../../../../TimeToShare/js), built there with pnpm build; the repository is never published in that state (AGENTS.md, “Dependency Policy”). Until schema 0.2.0 is published on npm, the five package manifests carry that link: in place of ^0.2.0, so clone TimeToShare beside this repository and run pnpm install and pnpm build in its js/ directory before installing here; the link: gives way to ^0.2.0 once 0.2.0 is on npm. pnpm dev may read a linked package’s directory, so the editor still loads its bundled fonts.

The server declares timetoalign>=1.2.0, but its measure-maps route needs timetoalign’s measure-map expansion (timetoalign.timelines.structure.MeasureMap), which no release carries yet. Until one does, server/pyproject.toml adds a uv source for the timetoalign checkout beside this repository ([tool.uv.sources], path = "../../timetoalign"), so clone timetoalign there as you clone TimeToShare, on a branch that carries the expansion (currently development); uv sync in server/ then installs it editable. A checkout whose requirements differ from the lockfile fails uv sync --locked; uv lock refreshes the lockfile. Published metadata does not see the source, and the repository is never published in that state (AGENTS.md, “Dependency Policy”); the source gives way to a range naming the release that carries the expansion. A server whose timetoalign lacks the expansion still starts, and its measure-maps route answers 501 (“the installed timetoalign cannot expand measure maps”).

timetoalign reads links and schemes through the timetoshare Python package, which it requires by a git reference to TimeToShare’s main. Until a timetoshare release carries schema 0.2.0, server/pyproject.toml replaces that requirement in the lockfile ([tool.uv] override-dependencies = ["timetoshare>=0.2.0,<1"]) and takes the package from the TimeToShare checkout you cloned for the schema package ([tool.uv.sources], path = "../../TimeToShare/python"), which uv sync installs editable; without the override the lockfile would follow timetoalign’s git reference, and uv takes no package from two places. The server itself imports nothing from timetoshare and does not list it among its requirements, and published metadata sees neither the override nor the source (AGENTS.md, “Dependency Policy”).

CI lays the repositories out the same way. Every job that installs the app checks out TimeToShare at main beside this repository and builds its js/ package first (.github/actions/install-app); the server job and the release build check out timetoalign at the commit server/uv.lock was locked against, named in .github/workflows/ci.yml and .github/workflows/release.yml, and the server job checks out TimeToShare at main too, for timetoshare. A lockfile refreshed against another timetoalign commit moves that commit in both workflows.

From the repository root, prepare both parts of the repository:

cd app
pnpm install
cd ../server
uv sync

Run, Test, and Build#

Run application commands from app/:

pnpm lint
pnpm typecheck
pnpm test
pnpm test:budget
pnpm test:build
pnpm build
pnpm build:embed
pnpm dev

pnpm test:budget runs the workspace store’s timing budgets alone, one file at a time, and pnpm test:build the tests that make a production build; pnpm test excludes both. pnpm build:embed builds the embeddable editor into app/packages/editor/dist-embed/ (embedding); the wheel bundles only dist/.

pnpm dev passes /api on to a server at 127.0.0.1:$TILIE_PORT (8000 when TILIE_PORT is unset), replacing the development page’s own Origin with the server’s, since the server refuses every origin but its own; any other Origin is passed on for the server to refuse. Start one from server/ with uv run tilie --port 8000 --no-browser (8000 is tilie’s default port too, but without --port it moves to a free port while 8000 is taken, where pnpm dev does not look), which prints the page’s URL with a #token=… fragment, and open the development server’s page with that fragment appended; the flag and the stamp tabs then show the values of the conversion maps that read a measure map, Show matches reads MatchClaim tables, and Open…, Import manifest… and Save as… use the editor’s file dialog over the files below the server’s root folder (--root <folder>, by default your home folder). Without a server, every conversion map that reads a measure map has no value in the flag and the stamp tabs, which say why instead, no MatchClaim table is read, and files go through the browser’s pickers and downloads. The public mode and the container image are tried as A public instance describes.

Run server commands from server/:

uv run ruff check .
uv run ruff format --check .
uv run pytest
uv build
uv run tilie --check --no-browser

Build the application before building a distributable server wheel. The server build hook copies app/packages/editor/dist into the wheel; the CI workflow verifies this and runs the installed wheel’s self-check. For a development build, run uv run tilie --check --static-dir ../app/packages/editor/dist from server/.

The writers’ compile test runs every review drawing through lualatex, which needs TikZ, the standalone class, and fontspec (on Ubuntu: texlive-luatex, texlive-latex-recommended, texlive-latex-extra, and texlive-pictures). It uses the DejaVu Sans and Noto Music files bundled by TimeToShare, Noto Music a fallback of DejaVu Sans for every code point DejaVu Sans does not map; no system font is needed. Without lualatex the test is skipped; set TILIE_REQUIRE_LUALATEX=1 to make its absence a failure, as the tikz CI job does.

The SVG and TikZ fixtures that pin a drawing belong to TimeToShare. There is no drawing schema, and a drawing’s JSON form is internal to TiLiE. The source of truth for layout and writer behavior is TimeToShare’s drawing specification.

Review drawing changes with rsvg-convert installed:

pnpm -C app/packages/writers review

The command draws every manifest fixture of the installed schema version except the corpus ones and the minimal twins, together with resized and restyled cases, writes their SVG and PNG files under app/packages/writers/review/, and lists them in review/index.html. It rasterizes at twice the size (rsvg-convert --zoom 2) with fontconfig restricted to TimeToShare’s bundled DejaVuSans.ttf and NotoMusic-Regular.ttf, and refuses to continue if another font is visible or rsvg-convert fails.

End-to-end tests#

The canvas is tested in real browsers with Playwright. Every run happens inside the official Playwright image of the locked @playwright/test version (mcr.microsoft.com/playwright:v<version>-noble), which carries Chromium, Firefox and WebKit with their system libraries and fonts, so the browsers are the same on every machine. Locally, e2e/run.ts starts that image through rootless podman with the app/ directory mounted and the host network; install podman and pull the image once. In CI the job already runs inside the image, and the script starts Playwright directly.

cd app
pnpm e2e                  # Chromium only, the quick run
pnpm e2e:all              # Chromium, Firefox, WebKit and the touch project, as in CI
pnpm e2e:budget           # the canvas timing budgets, Chromium only
pnpm e2e:visual           # the zero-tolerance screenshots; local only, never in CI
pnpm e2e:visual:update    # re-create the screenshot baselines
pnpm e2e:fixtures:check   # the committed test workspaces equal their generator's output

Each run builds the editor with the test hook (VITE_TILIE_TEST_HOOK=1) into app/packages/editor/dist-e2e, never into the dist folder the wheel bundles, and serves it on 127.0.0.1:4317. Runs share that port and the output folder app/e2e/test-results/, so run one at a time. A spec file name runs that spec alone (pnpm e2e resize.spec.ts); TILIE_E2E_WORKERS sets the number of workers (a positive integer, default 4) and is passed into the container. Screenshot baselines are valid only when made inside the image; review every changed image before committing it. When a schema release changes the manifest fixtures, regenerate the test workspaces with pnpm e2e:fixtures; never edit them by hand. For debugging, Chromium and Firefox also run natively with pnpm exec playwright test --project=chromium --headed after pnpm exec playwright install chromium; WebKit’s Linux build needs the image’s libraries on hosts other than Ubuntu and Debian. In pnpm dev the header’s Fixture menu offers, for trying the canvas by hand, every manifest fixture of the installed schema version (corpus fixtures and minimal twins included), the manifest of every warning case and any of these workspaces, as the Examples menu offers its examples: a manifest is imported as one more block into the open workspace, as Import manifest… adds a file, and a workspace replaces the open one after the question New and Open ask about unsaved changes; it offers no rejection case and no drawing. app/e2e/README.md states what each spec proves and the exact values it expects.

Each package and the server has a tests/README.md. Update the appropriate readme first with the validation logic and exact expected values, then write the test.

Dependencies#

Add an ADR in decisions/ before adding a dependency. The record must use the repository’s MADR structure, compare writing it ourselves, identify the audited version, and set a review date.

Package manifests declare compatible ranges for runtime and peer dependencies, such as fastapi>=0.141,<1 and uvicorn[standard]>=0.53,<1 in the server and svelte ^5.57.1 in app/packages/editor; development dependencies, the npm devDependencies and the server’s dev group, are pinned exactly. The lockfiles, server/uv.lock and app/pnpm-lock.yaml, pin every resolved version. Enter only versions released at least 14 days before they enter a lockfile, and name the audited version in its ADR; the one exception to that window is this project’s own schema package, @timetoalign/timetoshare (minimumReleaseAgeExclude in app/pnpm-workspace.yaml), which is also one of the two exceptions to compatible ranges: while it is consumed at an unreleased schema version it is declared as a committed link:; the other is timetoalign, which, while the server needs an unreleased version of it, is installed from the sibling checkout through a uv source in server/pyproject.toml, its range unchanged; and while timetoalign reads an unreleased schema version, the lockfile takes its timetoshare from the TimeToShare checkout through an override and a uv source, which the server’s own requirements do not name (see Setup). This is the dependency policy; do not treat a compatible manifest range as an error by itself.

Packages#

The ladder is enforced by app/.dependency-cruiser.cjs: core has no workspace dependency; layout and client may depend on core; writers may depend on layout and core; arranger may depend on writers, layout and core; editor may depend on every workspace package. Only arranger and editor may import Svelte.

When adding a package, first establish a present need. Add its permitted edges to the dependency-cruiser configuration and the workspace ladder tests, keep it below the packages that consume it, and write its test readme before behavior tests. Do not put UI, DOM, or transport code into core.

Known Limitations#

The editor’s component tests mount the page and check its headings, the focus on the canvas, the health request with the offline mark, and the inspector drawer with its remembered state. They cover the token taken from the URL fragment and cleared from the address bar, and the absent token (no fragment, so an empty bearer header is sent). They do not verify CSS layout (the drawer’s and the tab’s positions are checked end to end), mobile rendering, or a fragment that carries an empty token (#token=). The File System Access path is tested against stubbed pickers only; the end-to-end tests remove the pickers and take the file-input and download path in every engine. The server static-file tests do not exercise traversal behavior. Treat these gaps as test coverage to improve when their behavior is changed.

Release#

Releases are made by release-please and .github/workflows/release.yml. Write commit messages in the Conventional Commits form; release-please derives the next version and the CHANGELOG.md entry from them. Before 1.0, a feat bumps the patch version and a breaking change the minor version; a commit footer Release-As: X.Y.Z sets a version explicitly.

On every push to main, release-please opens or updates a release pull request that sets the version in server/pyproject.toml, app/package.json and the tilie-server entry of server/uv.lock, and adds the changelog entry. Merging it tags vX.Y.Z and creates the GitHub release. The workflow then checks out timetoalign beside the repository, checks the tag with scripts/check_versions.py, checks out and builds TimeToShare and installs the locked app dependencies as CI does, lints, type-checks, tests and builds the app, installs the locked server dependencies, tests, builds the distributions, verifies that the wheel contains index.html, and publishes them through PyPI OpenID Connect. Do not push version tags by hand.

The workflow needs GitHub Actions to be allowed to create pull requests in this repository, and this PyPI trusted publisher:

Setting

Value

Project name

tilie-server

Owner

TimeToAlign

Repository

TimeLineEditor

Workflow file name

release.yml

Environment name

pypi

The repository does not use a stored PyPI publishing token.