Skip to content

Development and docs

Use the Node and pnpm versions from .node-version and package.json. The project uses TypeScript and Vite+ for checking, tests, and packaging.

Terminal window
pnpm install --frozen-lockfile
pnpm check:tags
pnpm check
pnpm exec playwright install chromium firefox webkit
pnpm test
pnpm test:package

pnpm build generates the ESM entries, declarations, and IIFE under dist/. pnpm pack creates an installable archive. The runtime test suite covers signals in Node and native DOM behavior in three browser engines. Package tests exercise the built library in a separate consumer.

Terminal window
pnpm docs:dev

Open http://localhost:4321/ for English or http://localhost:4321/ru/ for Russian. Use a production build to preview the Pagefind search index.

Terminal window
pnpm docs:build
pnpm docs:preview

With Playwright Chromium installed, check the built site in a separate terminal.

Terminal window
pnpm docs:test

English pages are in docs/src/content/docs/. Russian pages use the same relative paths under docs/src/content/docs/ru/. Keep paired page slugs so the language selector can open the corresponding article. The example modules live in docs/src/examples/ and are type-checked with the project. The interactive preview and View source use the same module.

The docs build prepares an offline HTML and JavaScript archive, then generates the static site and Pagefind index in docs/dist/. Pass the deployed site’s URL to pnpm docs:test to run the same checks against Cloudflare.

Connect the repository with the Cloudflare Pages GitHub integration and set main as the production branch. Run pnpm docs:build from the repository root and publish docs/dist. Set PNPM_VERSION to the version pinned in package.json. Pages reads the Node version from .node-version. Cloudflare Pages GitHub integration

The Documentation workflow checks the site and its examples in GitHub Actions. The published English site uses the domain root, and the Russian site uses /ru/.