Development and docs
Develop the library
Section titled “Develop the library”Use the Node and pnpm versions from .node-version and package.json. The project uses TypeScript and Vite+ for checking, tests, and packaging.
pnpm install --frozen-lockfilepnpm check:tagspnpm checkpnpm exec playwright install chromium firefox webkitpnpm testpnpm test:packagepnpm 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.
Edit both languages
Section titled “Edit both languages”pnpm docs:devOpen http://localhost:4321/ for English or http://localhost:4321/ru/ for Russian. Use a production build to preview the Pagefind search index.
pnpm docs:buildpnpm docs:previewWith Playwright Chromium installed, check the built site in a separate terminal.
pnpm docs:testEnglish 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.
Publish to Cloudflare Pages
Section titled “Publish to Cloudflare Pages”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/.