Development Setup
This guide covers setting up a local development environment for contributing to the Canvus SDK.
Not a contributor? If you just want to use the SDK in your project, head to the Installation page and install via npm install @canvus/core.
Prerequisites
- Node.js 18+ (LTS recommended)
- npm 9+
- Git
Getting Started
# Clone the repository
git clone https://github.com/balfaro01/canvus.git
cd canvus
# Install dependencies
npm install
# Build the SDK
npm run build
# Launch the dev workbench
npm run demoThe demo is available at http://localhost:3000.
Development Workflow
Making SDK Changes
- Edit TypeScript source files in
src/ - Run
npm run buildto compile - Refresh the demo page in your browser to see changes
- Run
npm run typecheckto verify type correctness without building
Running the Documentation Site
# Install docs dependencies
cd docs-site
npm install
# Start the docs dev server
npm run devThe docs site is available at http://localhost:3001.
Available Scripts
| Script | Description |
|---|---|
npm run build | Compile TypeScript to dist/ |
npm run typecheck | Type-check without emitting output |
npm run demo | Launch the interactive workbench on port 3000 |
npm run docs:validate | Run documentation validation checks |
Project Conventions
Code Style
- Pure vanilla TypeScript — no framework dependencies
- Strict TypeScript compiler settings
- ESM modules (no CommonJS)
- Explicit type annotations on public APIs
Commit Messages
Use clear, descriptive commit messages that explain what and why.
Testing Changes
The demo workbench at http://localhost:3000 is the primary testing surface. Use it to verify:
- Selection, resize, and drag interactions
- Layout detection (flex, grid, block)
- Spacing adjusters (margin/padding)
- Operation generation (check the browser console)
- Flat String Bridge exports (check the console logs)