Thank you for your interest in contributing to diagrams-js! This document provides guidelines and instructions for contributing to this project.
The TypeScript port of the diagrams Python library now has a complete build system that:
- Compiles the core library to ESM JavaScript
- Compiles all 17 providers (2000+ classes) to JavaScript
- Generates proper package.json exports for tree-shaking
- Supports both Node.js and browser environments
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/diagrams-js.git cd diagrams-js -
Install dependencies:
vp install
# Build everything (core + providers)
vp run build
# Build only core library
vp run build:core
# Build only providers
vp run build:providers
# Development mode (watch)
vp run dev
# Run tests
vp test
# Check types and lint
vp checkdiagrams-js/
├── src/
│ ├── core/ # Core classes (Diagram, Node, Edge, Cluster)
│ │ ├── Diagram.ts
│ │ ├── Node.ts
│ │ ├── Edge.ts
│ │ ├── Cluster.ts
│ │ └── ...
│ ├── providers/ # Generated provider classes
│ │ ├── aws/
│ │ │ ├── index.ts # Base _Aws class
│ │ │ ├── compute.ts # EC2, ECS, Lambda, etc.
│ │ │ ├── storage.ts # S3, EBS, etc.
│ │ │ └── ... (26 modules)
│ │ ├── gcp/
│ │ ├── azure/
│ │ ├── k8s/
│ │ └── ... (14 more providers)
│ └── index.ts # Main exports
├── dist/
│ ├── index.mjs # Compiled core library
│ ├── index.d.mts # Type definitions
│ └── providers/ # Compiled providers
│ ├── aws/
│ ├── gcp/
│ └── ...
├── resources/ # Icon files (copied from Python lib)
│ ├── aws/
│ ├── gcp/
│ └── ...
└── scripts/
├── generate.ts # Generate providers from resources
├── build-providers.mjs # Build providers to JavaScript
├── config.ts # Provider configuration
└── ...
import { Diagram, setIconBaseDir } from "diagrams-js";
import { EC2, S3, Lambda } from "diagrams-js/aws/compute";
import { RDS } from "diagrams-js/aws/database";
const diagram = Diagram("My Architecture", {
direction: "TB",
});
const web = diagram.add(EC2("web-server"));
const db = diagram.add(RDS("database"));
const storage = diagram.add(S3("storage"));
web.to(db).to(storage);
await diagram.save("architecture.svg");- AWS - 500+ classes (EC2, S3, Lambda, RDS, etc.)
- Azure - 400+ classes
- GCP - 100+ classes (Compute, Storage, BigQuery, etc.)
- Kubernetes - Pods, Deployments, Services, etc.
- Alibaba Cloud
- Oracle Cloud (OCI)
- IBM Cloud
- Firebase
- DigitalOcean
- Elastic
- Generic - VPN, OS icons, etc.
- OpenStack
- Outscale
- GIS - Geo/ mapping tools
- On-Premises - Docker, Kubernetes, databases
- Programming - Languages, frameworks
- SaaS - Third-party services
The package includes:
- ✅ Compiled JavaScript (ESM)
- ✅ TypeScript definitions
- ✅ Icon resources
- ✅ Tree-shakable exports
npm install diagrams-js// Works out of the box
import { Diagram } from "diagrams-js";
import { EC2 } from "diagrams-js/aws/compute";After running vp run build:
dist/
├── index.js # Compiled core library
├── index.d.mts # Type definitions
└── providers/ # Provider files
If you find a bug, please open an issue with:
- A clear, descriptive title
- Steps to reproduce the bug
- Expected vs actual behavior
- Code example (if applicable)
- Environment details (Node.js version, OS, etc.)
Feature suggestions are welcome! Please open an issue with:
- A clear description of the feature
- Use cases and motivation
- Proposed API (if applicable)
- Examples of how it would be used
- Bug fixes: Fix existing issues
- Feature additions: Add new functionality
- Provider updates: Add new cloud services or update existing ones
- Documentation: Improve docs, add examples
- Performance: Optimize rendering or bundle size
- Tests: Add or improve test coverage
✅ Core Framework - Diagram, Node, Edge, Cluster ✅ Cross-Platform - Node.js, Deno, Bun, Browsers ✅ 17 Providers - 1000+ generated classes ✅ Build System - Vite+ + esbuild for fast compilation and assets inlining ✅ TypeScript - Full type support ✅ Tests - 100% passing tests ✅ Ready for npm - Can publish immediately
- Check existing issues
- Start a discussion
- Review documentation
Your contributions help make diagrams-js better for everyone. We appreciate your time and effort!