First of all, thank you for showing interest in contributing to LikeC4! All your contributions are extremely valuable!
- Improve documentation: Fix incomplete or missing docs, bad wording, examples or explanations.
- Give feedback: We are constantly working on making LikeC4 better. Please share how you use LikeC4, what features are missing and what is done well via GitHub Discussions or Discord.
- Share LikeC4: Share links to the LikeC4 docs with everyone who might be interested!
- Contribute to the codebase: Propose new features via GitHub Issues, or find an existing issue that you are interested in and work on it!
- Give us a code review: Help us identify problems with the source code or make LikeC4 better.
- Decide on what you want to contribute.
- If you would like to implement a new feature, discuss it with the maintainers (GitHub Discussions or Discord) before jumping into coding.
- After finalizing issue details, you can begin working on the code.
- Run tests with
pnpm testand submit a PR once all tests have passed. - Get a code review and fix all issues noticed by the maintainer.
- If you cannot finish your task or if you change your mind – that's totally fine! Just let us know in the GitHub issue that you created during the first step of this process. Our community is friendly – we won't judge or ask any questions if you decide to cancel your submission.
- Your PR is merged. You are awesome ❤️!
-
Fork the repository, then clone or download your fork.
-
Project requires Node.js >=22.21.1 and pnpm
See required versions in .tool-versions-
(Optional) If you use asdf:
asdf install
-
-
Install dependencies with pnpm:
pnpm install
-
Pre-generate sources by running
build(orgenerate) in root:pnpm build # or pnpm generate
[!TIP] Tip on TypeScript Project uses Typescript project references to optimize compile time, but sometimes it may cause issues on delete/rename.
It is always a good idea to run
pnpm generateafter checkout or merge.Try
pnpm cleanin root to clean up caches, andpnpm typecheckafter.If it doesn't help, try
pnpm store prune, removenode_modules, and cleanpnpm install.
-
Mostly used dev tasks:
pnpm devinapps/playground
This command starts the playground app in development mode, picking up changes from any package with hot reloading.pnpm dev(or anypnpm dev:*) inpackage/likec4
This command also picks up changes from any package.pnpm vitest:uiin root to run all tests.pnpm typecheckin root to run the typecheck.
-
To work on VSCode extension:
- Launch
Run Extensionto start a new VSCode instance with the extension loaded.
- Launch
[!TIP] Tip on VSCode extension development If you work mostly on
vscode-previewpackage, you don't need to restartRun Extensionwhen you make changes.
Keeppnpm devinvscode-previewrunning, VSCode will pick up changes when close-open the panel.
/e2e contains isolated workspace to run E2E tests.
To run locally, from root:
pnpm test:e2eWhat it does:
- pack
likec4to tarball - install this tarball in isolated wokspace
- generate spec files from model (using LikeC4Model)
- run playwright
This repository's contents are:
/apps/docsAstro-app, contains the content for our docs site at likec4.dev/apps/playground- Vite SPA, site playground.likec4.dev/packagescontains the source for packages
- Purpose: Provides CLI, Vite plugin, generates static website (sources in
/packages/likec4/app/). Main entry point for the tool. - Technology: Uses yargs, Vite
-
Purpose: Core type definitions, api, model builder and utilities.
compute-viewcontains logic for computing diagram views. Read core's README. -
Technology: Pure TypeScript, no frameworks. Heavy use of generators and remeda
-
Suggestions: A great way to start contributing is by adding more tests for compute-view. This will help you understand how it works while also benefiting the project. There are also open questions from @pavelpykhtin, who has made significant contributions.
- Purpose: Converts LikeC4 Model to other formats, like Mermaid, PlantUML, SVG, etc.
Also generates typings for Model API and React.
- Purpose: Parses DSL, builds models, and computes views
- Technology: Built with Langium
- Purpose: Transforms computed views into visual graph layouts
- Technology: Uses Graphviz for layout algorithms
- Purpose: Integrates LikeC4 into Visual Studio Code.
- Technology: Uses reactive-vscode and follows VS Code extension patterns.
create-likec4: Scaffolding tool for new projectsicons: Pre-bundled icon setslog: Common logger implementationtsconfig: TypeScript configurationvscode-preview: Preview panel component for VS Code extension