Skip to content

Latest commit

 

History

History
114 lines (78 loc) · 5.13 KB

File metadata and controls

114 lines (78 loc) · 5.13 KB

Contributing to LikeC4

First of all, thank you for showing interest in contributing to LikeC4! All your contributions are extremely valuable!

Ways to contribute

  • 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.

Contributing workflow

  • 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 test and 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 ❤️!

Get started with LikeC4 locally

  1. Fork the repository, then clone or download your fork.

  2. Ensure you have all required tools
    Install manually or use asdf:

    asdf install
  3. Install dependencies with pnpm – pnpm install

  4. Pre-generate sources by running build (or generate) in root:

    pnpm build
  5. Mostly used dev tasks:

    1. pnpm dev in apps/playground
    2. pnpm dev (or any pnpm dev:*) in package/likec4
    3. pnpm vitest:ui in root
    4. pnpm typecheck in root
  6. To work on VSCode extension:

    • Launch Run Extension to start a new VSCode instance with the extension loaded.

E2E

/e2e contains isolated workspace. Test steps are:

  • pack likec4 to tarball
  • install this tarball in isolated wokspace
  • generate spec files from model (using LikeC4Model)
  • run playwright

To run from root workspace:

pnpm test:e2e

About this repository

Top-level layout

This repository's contents are:

  • /apps/docs Astro-app, contains the content for our docs site at likec4.dev
  • /apps/playground - Vite SPA, site playground.likec4.dev
  • /packages contains the source for packages

Packages

CLI (/packages/likec4)

  • Purpose: Command-line interface and integration point, main entry point for the tool.
  • Technology: Uses yargs

Core (/packages/core)

  • Technology: Pure TypeScript, no frameworks. Heavy use of generators and remeda
  • Purpose: Core type definitions and domain model. compute-view contains logic for computing diagram views
  • 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.

Diagrams (/packages/diagram)

Language Server (/packages/language-server)

  • Purpose: Parses DSL, builds models, and computes views
  • Technology: Built with Langium

Layouts (/packages/layouts)

  • Purpose: Transforms computed views into visual graph layouts
  • Technology: Uses Graphviz for layout algorithms

VSCode Extension (/packages/vscode)

Additional Packages

  • create-likec4: Scaffolding tool for new projects
  • generators: Converts LikeC4 to other formats
  • icons: Pre-bundled icon sets
  • log: Common logger implementation
  • tsconfig: TypeScript configuration
  • vscode-preview: Preview panel component for VS Code extension