Tonto is organized as an npm workspace monorepo.
Workspaces
| Workspace | Role |
|---|---|
packages/tonto | tonto-cli, grammar, language server services, validators, generators, parser utilities, templates. |
packages/extension | VS Code extension package published as Lenke.tonto. |
packages/tpm | Tonto Package Manager package published as tpm. |
packages/webview | React/Vite webview package for diagram experiences. |
packages/sprotty-vscode | Sprotty VS Code extension-side integration. |
packages/sprotty-vscode-webview | Sprotty webview-side integration. |
packages/tonto-documentation | Next.js documentation application with a GitHub Pages static export. |
Root scripts
Run these from the repository root:
npm run build
npm run test
npm run lint
npm run docs:dev
npm run docs:check
Language generation:
npm run langium:generate
npm run langium:watch
CLI package
The CLI package contains:
- Langium grammar files under
src/language. - Validators under
src/language/validators. - CLI commands under
src/cli/actions/commands. - Generators for JSON, Tonto, PlantUML, and project templates.
- Tonto ontology skill and guidance templates.
Extension package
The extension package contributes:
- VS Code language registrations.
- Commands and status bar actions.
- Webview and diagram commands.
tonto.jsonschema association.- Feature toggle for
.tontodiagram.
Webview package
The webview package contains the React-based diagram editor and supporting UI. It is built with Vite and bundled for the extension.
Documentation package
The documentation package is a Next.js site using Tailwind CSS and shadcn/ui patterns. It remains in the workspace so documentation scripts and dependency locking live with the rest of the project. Existing MDX files and docs.json provide the content and navigation data.
Run:
npm run docs:dev
npm run docs:check
The static build is generated at:
packages/tonto-documentation/out
The GitHub Actions workflow at .github/workflows/documentation.yml publishes this directory to GitHub Pages.
Contributor workflow
Before publishing a change that affects syntax, commands, or generated artifacts:
- Update the code and tests.
- Run
npm run langium:generatewhen grammar changes require generated language files. - Run
npm run test. - Update relevant documentation pages in
packages/tonto-documentation. - Run
npm run docs:check.
Documentation should describe current behavior from source code, not only legacy docs.
