Accepted - February 2026
The templ.js project consists of multiple interdependent packages:
@templjs/core) - Parser, renderer, query engine@templjs/cli) - Command-line interface@templjs/volar) - Language server pluginvscode-templjs) - Editor integration| Approach | Pros | Cons |
|---|---|---|
| Separate Repos | Simple, independent releases | Duplicate config, hard to test cross-package changes |
| npm Workspaces | Native npm support | Limited build orchestration |
| pnpm Workspaces | Efficient disk usage, fast installs | Requires pnpm CLI |
| Lerna | Battle-tested, versioning tools | Heavyweight, maintenance concerns |
| Nx + pnpm | ⭐ Caching, task orchestration, workspace analysis | Learning curve |
Use pnpm Workspaces with Nx for build orchestration.
```bash ascii-tree templjs/templ.js/ ├── pnpm-workspace.yaml # Workspace definition ├── nx.json # Nx configuration ├── package.json # Root package with shared scripts ├── packages/ │ ├── core/ # @templjs/core │ │ ├── package.json # “name”: “@templjs/core” │ │ ├── src/ │ │ └── tests/ │ ├── cli/ # @templjs/cli │ │ ├── package.json # “name”: “@templjs/cli” │ │ └── “dependencies”: {“@templjs/core”: “workspace:”} │ └── volar/ # @templjs/volar │ └── “dependencies”: {“@templjs/core”: “workspace:”} ├── extensions/ │ └── vscode/ # vscode-templjs │ └── “dependencies”: {“@templjs/volar”: “workspace:*”} └── tools/ └── scripts/ # Shared build/release scripts
### Key Configuration
**pnpm-workspace.yaml:**
```yaml
packages:
- 'packages/*'
- 'extensions/*'
nx.json:
{
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "test", "lint"]
}
}
},
"targetDefaults": {
"build": { "dependsOn": ["^build"] }
}
}
"workspace:*" for internal dependenciespackage.jsonpackage.json filesnx graph)pnpm link makes local changes immediately available```bash ascii-flow vscode-templjs ↓ @templjs/volar ↓ @templjs/core ← @templjs/cli
**Build Order:**
1. `@templjs/core` (no dependencies)
2. `@templjs/cli` + `@templjs/volar` (parallel)
3. `vscode-templjs`
## Performance Targets
| Operation | Target | Measured With |
| --------------------- | ------ | ------------------------ |
| **Full Install** | <30s | `time pnpm install` |
| **Incremental Build** | <5s | `nx build core` (cached) |
| **Affected Tests** | <20s | `nx affected:test` |
| **Full CI Pipeline** | <3min | GitHub Actions |
## Commands
```bash
# Setup
pnpm install # Install all dependencies
# Development
nx build core # Build single package
nx build --all # Build all packages
nx affected:build # Build only changed packages
# Testing
nx test core # Test single package
nx affected:test # Test affected by git changes
# Utilities
nx graph # Visualize dependency graph
nx affected:dep-graph # Show affected by changes
The Python version used:
temple and temple-linter packagesThis monorepo consolidates all TypeScript packages with proper dependency management.