Development Guide
This section contains guides for developing and contributing to the Datto RMM API clients.
Setting Up Development Environment
Section titled “Setting Up Development Environment”Prerequisites
Section titled “Prerequisites”- Node.js v22 (use
nvm useto activate from.nvmrc) - pnpm v9.14.2+
- Rust (latest stable)
Initial Setup
Section titled “Initial Setup”# Clone and installgit clone https://github.com/josh-fisher/datto-rmm.gitcd datto-rmmpnpm install
# Fetch the OpenAPI specpnpm sync:openapi
# Generate API clientspnpm generate:api
# Build everythingpnpm buildDevelopment Workflow
Section titled “Development Workflow”Making Changes to TypeScript Client
Section titled “Making Changes to TypeScript Client”- Edit files in
packages/api/src/ - Run
pnpm --filter datto-rmm-api buildto compile - Run
pnpm --filter datto-rmm-api typecheckto verify types
Making Changes to Rust Client
Section titled “Making Changes to Rust Client”- Edit files in
crates/datto-api/src/ - Run
cargo check -p datto-apito verify - Run
cargo build -p datto-apito compile
Regenerating Types
Section titled “Regenerating Types”When the Datto RMM API is updated:
# Fetch latest specpnpm sync:openapi
# Regenerate all clientspnpm generate:api
# Rebuildpnpm buildCode Style
Section titled “Code Style”TypeScript
Section titled “TypeScript”- Strict mode enabled
- Explicit types for public APIs
- Use
typeimports:import type { Foo } from './foo.js' - ESM modules with
.jsextensions in imports
- Follow standard Rust conventions
- Use
thiserrorfor error types - Async/await with tokio
File Naming
Section titled “File Naming”| Type | Convention |
|---|---|
| TypeScript files | kebab-case.ts |
| Rust files | snake_case.rs |
| Directories | kebab-case |
Testing
Section titled “Testing”TypeScript
Section titled “TypeScript”# Run all testspnpm test
# Run tests for specific packagepnpm --filter datto-rmm-api test# Run all testscargo test
# Run tests for specific cratecargo test -p datto-apiAdding New Features
Section titled “Adding New Features”TypeScript Client
Section titled “TypeScript Client”- Add types/interfaces in appropriate file
- Export from
index.ts - Add documentation in JSDoc comments
- Update README if needed
- Add tests
Rust Client
Section titled “Rust Client”- Add types/functions in appropriate module
- Export from
lib.rs - Add doc comments (
///) - Update README if needed
- Add tests
Documentation
Section titled “Documentation”Human Documentation
Section titled “Human Documentation”Update docs in apps/docs/src/content/docs/:
# Start docs dev serverpnpm --filter @datto-rmm/docs devVisit http://localhost:4000 to preview changes.
Code Documentation
Section titled “Code Documentation”- TypeScript: JSDoc comments for public APIs
- Rust: Doc comments (
///) for public items
Common Tasks
Section titled “Common Tasks”Adding a New Platform
Section titled “Adding a New Platform”If Datto adds a new regional platform:
- TypeScript: Add to
packages/api/src/platforms.ts - Rust: Add to
crates/datto-api/src/platforms.rs - Docs: Update platform tables in documentation
Updating Dependencies
Section titled “Updating Dependencies”# Update all pnpm dependenciespnpm update
# Update Rust dependenciescargo updateRunning the Full Build
Section titled “Running the Full Build”# Clean, generate, build, and typecheckpnpm clean && pnpm generate:api && pnpm build && pnpm typecheckTroubleshooting
Section titled “Troubleshooting””OpenAPI spec not found”
Section titled “”OpenAPI spec not found””Run pnpm sync:openapi to fetch the spec.
TypeScript build errors after spec update
Section titled “TypeScript build errors after spec update”The spec may have changed. Check the generated types and update any affected code.
Rust progenitor generation fails
Section titled “Rust progenitor generation fails”Progenitor doesn’t yet support OpenAPI 3.1.0. The crate will compile but without generated types.
Getting Help
Section titled “Getting Help”- Check existing documentation
- Review the Architecture section
- Open an issue on GitHub