Skip to content

Commit fdd46ff

Browse files
authored
feat(cli,playground,docs,generators): Export LikeC4 views to Draw.io (likec4#2622)
2 parents 49331fd + 5ad9c3c commit fdd46ff

File tree

105 files changed

+6157
-1531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+6157
-1531
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"likec4": patch
3+
"@likec4/e2e": patch
4+
---
5+
6+
Draw.io: CLI --roundtrip, Playground E2E, DrawioContextMenu getSourceContent
7+
8+
- **CLI:** `likec4 export drawio --roundtrip` reads all `.c4`/`.likec4` in the workspace, parses round-trip comment blocks (layout, stroke colors/widths, edge waypoints), and applies them when generating each view's `.drawio` file.
9+
- **Docs:** CLI reference updated with `--roundtrip` and `--all-in-one` options.
10+
- **Playground:** `DrawioContextMenu` component accepts optional `getSourceContent` for round-trip export when used outside the provider.
11+
- **E2E:** New Playwright config and test for Draw.io context menu in the Playground (`pnpm test:playground` from e2e/).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
"@likec4/generators": patch
3+
likec4: patch
4+
"@likec4/devops": patch
5+
"@likec4/language-server": patch
6+
---
7+
8+
Draw.io export alignment; cross-platform postpack; language-server worker.
9+
10+
- **Draw.io export:** Generators and CLI export views to Draw.io (.drawio); round-trip comment blocks (layout, stroke, waypoints) and postpack behavior only. No import/parser in this PR.
11+
- **Postpack:** `likec4ops postpack` copies packed tgz to package.tgz (cross-platform); all packages use it instead of `cp` so pack/lint:package works on Windows.
12+
- **Language-server:** Safe error stringification in browser worker for oxlint.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@likec4/generators": minor
3+
"@likec4/docs-astro": patch
4+
---
5+
6+
Draw.io: extended round-trip (export options, waypoints, view notation)
7+
8+
- **Export:** Optional `GenerateDrawioOptions`: `layoutOverride`, `strokeColorByNodeId`, `strokeWidthByNodeId`. Emit element/edge customData as mxUserObject; emit edge waypoints (viewmodel points) as mxGeometry Array.
9+
- **Import:** Emit `// likec4.view.notation viewId '...'` from root `likec4ViewNotation`; emit `// <likec4.edge.waypoints>` with `// src|tgt [ [x,y], … ]` for edges with mxGeometry points (single and multi-diagram).
10+
- **Docs:** drawio.mdx updated with options, waypoints, customData, and comment blocks for view notation and edge waypoints.

.github/deprecated/auto-assign.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [opened]
55
jobs:
66
run:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-24.04
88
permissions:
99
issues: write
1010
pull-requests: write

.github/workflows/ci-pr.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CI: reproduce origin repo checks on pull requests and branch pushes.
2+
# Same jobs as main repo (checks.yaml) so PRs get typecheck, build, tests, docs, playground, e2e.
3+
# Only runs on forks (if: github.repository != 'likec4/likec4'); no-op on origin.
4+
5+
name: CI (PR & push)
6+
7+
on:
8+
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
push:
14+
branches-ignore:
15+
- main
16+
- "changeset-release/*"
17+
- "releases/*"
18+
tags-ignore:
19+
- "**"
20+
21+
concurrency:
22+
group: ci-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
23+
cancel-in-progress: true
24+
25+
jobs:
26+
checks:
27+
if: github.repository != 'likec4/likec4' && (github.event_name != 'push' || !contains(github.event.head_commit.message, 'ci skip'))
28+
uses: ./.github/workflows/checks.yaml
29+
secrets: inherit

.github/workflows/cleanup-cache.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212

1313
jobs:
1414
cleanup:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616
steps:
1717
- name: Check out code
1818
uses: actions/checkout@v6

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
# - https://gh.io/supported-runners-and-hardware-resources
2626
# - https://gh.io/using-larger-runners
2727
# Consider using larger runners for possible analysis time improvements.
28-
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
28+
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-24.04' }}
2929
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
3030
permissions:
3131
actions: read

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
1616
copilot-setup-steps:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-24.04
1818
permissions:
1919
contents: read
2020
steps:

.github/workflows/test-export-action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permissions:
1212

1313
jobs:
1414
test:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616
timeout-minutes: 10
1717
steps:
1818
- name: checkout

.github/workflows/trigger-deploy-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
jobs:
99
trigger-deploy-template:
1010
name: trigger deploy template
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-24.04
1212
if: ${{ github.repository_owner == 'likec4' }}
1313
steps:
1414
- name: Decode the GitHub App Private Key

0 commit comments

Comments
 (0)