Turborepo Workflows & CLI
Relevant source files
The following files were used as context for generating this wiki page:
The chemd repository is structured as a monorepo utilizing pnpm workspaces and Turborepo for orchestration. This architecture supports the development of a suite of chemistry-focused packages and applications, ensuring consistent build, test, and development lifecycles across the entire project.
The CLI and workflow configuration focus on modularity, where domain logic is implemented in standalone packages (under packages/*) and subsequently integrated into frontend applications (under apps/*). Turborepo manages these dependencies and task executions to optimize performance through caching and parallelization.
Sources: AGENTS.md:10-15, chemd-v0.1-architecture.md:93-107
Monorepo Structure
The project follows a standardized layout that separates core library logic from user-facing applications.
| Category | Path | Description |
|---|---|---|
| Applications | apps/web | The primary UI entry point, built with Next.js 15. |
| Packages | packages/* | Modular domain packages including core, parser, resolver, compiler, and various renderers. |
| Documentation | docs/ | Contains language specifications, architecture notes, and implementation plans. |
| Assets | vision/ | Logos and design assets for the project. |
Sources: AGENTS.md:12-18, chemd-v0.1-architecture.md:95-107
Development CLI Commands
The repository provides a set of standardized commands to be executed from the root directory. These commands leverage Turborepo to handle task orchestration across the workspace.
Core Commands
pnpm install: Installs all dependencies across the workspace.pnpm dev: Starts the local web development environment (@chemd/web) through Turbo.pnpm build: Executes the build and type-checking tasks for all workspaces viaturbo run build.pnpm test: Runs all Vitest suites across the packages and apps.pnpm typecheck: Performs full TypeScript static analysis.
Filtered Execution
For targeted development, commands can be scoped to specific packages using the --filter flag:
pnpm --filter @chemd/<pkg> test: Executes tests only for the specified package (e.g.,@chemd/parser).
Sources: AGENTS.md:21-28, package.json:10-15
Dependency Flow and Pipeline
The build system follows a strict pipeline where packages must be validated before being consumed by applications. Logic is prioritized in packages/* to ensure reusability and testability before integration into the apps/web layer.
This diagram illustrates the directional flow of logic from core utilities to the final web application entry point.
Sources: AGENTS.md:18-19, chemd-v0.1-architecture.md:109-158, apps/web/src/app/page.tsx:1-12
Workflow & Verification Standards
Contributors are required to follow a specific verification sequence to maintain code quality:
- Plan Confirmation: Confirm technical plans before starting non-trivial work.
- Local Validation: Run filtered tests for the changed scope.
- Full Validation: Execute
pnpm testandpnpm typecheckat the repository root before submitting a Pull Request. - UI Verification: Attach "before and after" screenshots for any changes within
apps/web.
Sources: AGENTS.md:31-38
Commit Guidelines
The project enforces a structured commit message format to facilitate automated versioning and changelog generation.
<type>[optional scope]: <description>
[body]
[optional footer]
Core Commit Types
| Type | Purpose | Version Impact |
|---|---|---|
feat | New features or functionality | MINOR |
fix | Bug fixes | PATCH |
refactor | Code changes that neither fix bugs nor add features | NONE |
perf | Performance improvements | NONE |
docs | Documentation only changes | NONE |
build | Changes to build system or dependencies | NONE |
Sources: AGENTS.md:47-81
Summary
The Turborepo and CLI configuration in cheMD provides a robust foundation for monorepo management. By enforcing a package-first development strategy and standardized CLI workflows, the system ensures that complex chemical data parsing and rendering logic remain modular, highly testable, and easily integrated into the primary web application.