Development Workflow
Purpose
This guide describes the common development workflow for working inside the Nrgy.js monorepo.
Repository Layout
packages/*: publishable packages.docs/*: project, package, and developer-facing documentation.benchmarks/*: local benchmark scenarios.
Common Commands
bash
npm installbash
npm run formatbash
npm run checkbash
npm run testbash
npm run buildExpected Flow for Source Changes
- Update the source file and colocated tests.
- Update colocated documentation for the changed module.
- Update the package
README.mdif the public API or usage story changed. - Run
npm run check. - Run
npm run testfor behavioral changes.
Documentation Workflow
- Source module docs live next to source files.
- Package overviews live in package-level
README.mdfiles. - Russian translations use the
.ru.mdsuffix. index.tsfiles must be documented through package README files rather than standaloneindex.mdpages.
Documentation Website Workflow
- The source of truth for product and contributor docs is the repository
docs/*tree, notwebsite/docs/content/*. - The website content under
website/docs/content/*andwebsite/docs/ru/content/*is generated by website/scripts/generate-content.mjs. - When editing documentation, update the source files in
docs/*first and keep the matching*.ru.mdfiles in sync.
Website Commands
Run commands from website/package.json:
bash
cd website
npm run devbash
cd website
npm run builddevregenerateswebsite/docs/content/*and starts the local VitePress server.buildregenerates content and verifies that the site builds successfully.
When Website Config Must Be Updated
- If the documentation structure changes, update the sidebar and navigation in website/docs/.vitepress/config.ts.
- If docs move between sections, verify that generated routes under
website/docs/content/docs/*still match the configured links. - If public assets are added for the site, place them in
docs/assets/*orwebsite/docs/public/*depending on whether they should be copied by the content generator.
Release-Relevant Files
- Root CHANGELOG.md records project-level changes.
- Package
CHANGELOG.mdfiles track package-level releases. - Package names and install commands must come from current
package.jsonfiles.
Release Workflow
The release process is driven from the repository root through the scripts in package.json and the versioning rules in lerna.json.
Release Preparation
- Make sure the working tree contains the intended changes only.
- Run
npm run check. - Run
npm run test. - Run
npm run build. - Verify that the relevant docs and changelog entries are up to date.
Versioning
Use the dry run first:
bash
npm run preview:new-versionCreate versions only after the dry run looks correct:
bash
npm run new-versionpreview:new-versionrunslerna version --dry-run.new-versionrunslerna versionwith conventional commits enabled.- Before versioning, the
preversionhook runsnpm run check,npm run build, andnpm run test, then stages all changes withgit add --all.
Publishing
After the packages are versioned and the release commit is ready, publish from the already versioned packages:
bash
npm run new-publishnew-publishrunslerna publish from-package.- Package releases are based on the versions already written into the package manifests.
Release Notes and Validation
- Review the root
CHANGELOG.mdand the packageCHANGELOG.mdfiles after versioning. - Confirm that generated docs and package READMEs still match the released API.
- If the website docs changed, run the site build from website/package.json before publishing.