Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .github/workflows/automated-release-calm-studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ on:
- 'calm-suite/calm-studio/**'
workflow_dispatch:

defaults:
run:
working-directory: calm-suite/calm-studio

jobs:
release:
name: Multi-Package Semantic Release
Expand All @@ -32,27 +28,32 @@ jobs:
fetch-depth: 0
persist-credentials: false

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
cache: npm
cache-dependency-path: package-lock.json
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm -r run build
run: npm ci

- name: Build (in dep order)
run: |
npm run build --if-present --workspace=@calmstudio/calm-core
npm run build --if-present --workspace=@calmstudio/extensions
npm run build --if-present --workspace=@calmstudio/mcp
npm run build --if-present --workspace=@calmstudio/studio
npm run build --if-present --workspace=calmstudio
npm run build --if-present --workspace=@calmstudio/github-action
npm run build --if-present --workspace=@calmstudio/diagram

- name: Release
run: pnpm dlx multi-semantic-release
# Run multi-semantic-release from calm-studio dir so it scopes to @calmstudio/*
# packages only and does not accidentally release @finos/* siblings.
working-directory: calm-suite/calm-studio
run: npx multi-semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52 changes: 24 additions & 28 deletions .github/workflows/build-calm-studio-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ on:
type: boolean
default: true

defaults:
run:
working-directory: calm-suite/calm-studio

jobs:
build-sidecar:
name: Build MCP Sidecar (${{ matrix.target }})
Expand All @@ -39,25 +35,22 @@ jobs:
triple: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @calmstudio/calm-core build
- name: Build sidecar
run: |
cd packages/mcp-server
pnpm build:bundle
pnpm dlx @yao-pkg/pkg dist/bundle.cjs --target ${{ matrix.target }} --output dist/calmstudio-mcp
cache: npm
cache-dependency-path: package-lock.json
- run: npm ci
- run: npm run build --if-present --workspace=@calmstudio/calm-core
- name: Build sidecar bundle
run: npm run build:bundle --workspace=@calmstudio/mcp
- name: Build sidecar binary
working-directory: calm-suite/calm-studio/packages/mcp-server
run: npx @yao-pkg/pkg dist/bundle.cjs --target ${{ matrix.target }} --output dist/calmstudio-mcp
- name: Rename with target triple
shell: bash
run: |
cd packages/mcp-server/dist
cd calm-suite/calm-studio/packages/mcp-server/dist
if [ "${{ runner.os }}" = "Windows" ]; then
mv calmstudio-mcp.exe calmstudio-mcp-${{ matrix.triple }}.exe
else
Expand Down Expand Up @@ -89,15 +82,12 @@ jobs:
triple: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
- run: cd calm-suite/calm-studio && pnpm install --frozen-lockfile
cache: npm
cache-dependency-path: package-lock.json
- run: npm ci

- name: Install Linux dependencies
if: runner.os == 'Linux'
Expand All @@ -116,14 +106,20 @@ jobs:
workspaces: calm-suite/calm-studio/apps/studio/src-tauri

- name: Download sidecar binary
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: sidecar-${{ matrix.triple }}
path: calm-suite/calm-studio/apps/studio/src-tauri/binaries/

- name: Make sidecar executable
if: runner.os != 'Windows'
run: chmod +x apps/studio/src-tauri/binaries/calmstudio-mcp-*
run: chmod +x calm-suite/calm-studio/apps/studio/src-tauri/binaries/calmstudio-mcp-*

- name: Build calm-core and studio (pre-Tauri)
run: |
npm run build --if-present --workspace=@calmstudio/calm-core
npm run build --if-present --workspace=@calmstudio/extensions
npm run build --if-present --workspace=@calmstudio/studio

- name: Build desktop app
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
Expand All @@ -139,7 +135,7 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
projectPath: calm-suite/calm-studio/apps/studio
tauriScript: pnpm tauri
tauriScript: npm run tauri --if-present --workspace=@calmstudio/studio
args: ${{ matrix.args }}
tagName: ${{ github.ref_name }}
releaseName: 'CalmStudio ${{ github.ref_name }}'
Expand Down
93 changes: 35 additions & 58 deletions .github/workflows/build-calm-studio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ permissions:

on:
pull_request:
branches:
- 'main'
- 'release*'
branches: ['main', 'release*']
paths:
- 'calm-suite/calm-studio/**'
- '.github/workflows/build-calm-studio.yml'
- 'package.json'
- 'package-lock.json'
push:
branches:
- 'main'
- 'release*'
branches: ['main', 'release*']
paths:
- 'calm-suite/calm-studio/**'
- '.github/workflows/build-calm-studio.yml'

defaults:
run:
working-directory: calm-suite/calm-studio
- 'package.json'
- 'package-lock.json'

jobs:
build-lint-test:
Expand All @@ -31,62 +27,43 @@ jobs:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
cache: npm
cache-dependency-path: package-lock.json

- name: Install dependencies
run: pnpm install --frozen-lockfile
run: npm ci

- name: Build
run: pnpm --filter '!calmstudio-docs' -r run build
- name: Build (in dep order)
run: |
npm run build --if-present --workspace=@calmstudio/calm-core
npm run build --if-present --workspace=@calmstudio/extensions
npm run build --if-present --workspace=@calmstudio/mcp
npm run build --if-present --workspace=@calmstudio/diagram
npm run build --if-present --workspace=@calmstudio/studio
npm run build --if-present --workspace=calmstudio
npm run build --if-present --workspace=@calmstudio/github-action

- name: Lint
run: pnpm --filter '!calmstudio-docs' -r run lint

- name: Test
run: |
pnpm --filter @calmstudio/calm-core run test
pnpm --filter @calmstudio/extensions run test
pnpm --filter @calmstudio/mcp-server run test
pnpm --filter @calmstudio/studio run test
npm run lint --if-present --workspace=@calmstudio/calm-core
npm run lint --if-present --workspace=@calmstudio/extensions
npm run lint --if-present --workspace=@calmstudio/mcp
npm run lint --if-present --workspace=@calmstudio/studio

e2e-tests:
name: E2E Tests
runs-on: ubuntu-latest
needs: build-lint-test
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9

- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Install Playwright browsers
run: pnpm --filter @calmstudio/studio exec playwright install --with-deps chromium

- name: Build
run: pnpm --filter '!calmstudio-docs' -r run build
- name: Typecheck
run: |
npm run typecheck --if-present --workspace=@calmstudio/calm-core
npm run typecheck --if-present --workspace=@calmstudio/extensions
npm run typecheck --if-present --workspace=@calmstudio/mcp
npm run typecheck --if-present --workspace=@calmstudio/github-action

- name: Run E2E tests
run: pnpm --filter @calmstudio/studio run test:e2e
- name: Test
run: |
npm run test --if-present --workspace=@calmstudio/calm-core
npm run test --if-present --workspace=@calmstudio/extensions
npm run test --if-present --workspace=@calmstudio/mcp
npm run test --if-present --workspace=@calmstudio/studio
4 changes: 2 additions & 2 deletions calm-suite/calm-studio/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CalmStudio

Visual CALM architecture editor. SvelteKit (Svelte 5), TypeScript strict, pnpm monorepo.
Visual CALM architecture editor. SvelteKit (Svelte 5), TypeScript strict, npm workspaces monorepo.

## Structure
- `packages/calm-core/` — CALM types, validation
Expand All @@ -10,7 +10,7 @@ Visual CALM architecture editor. SvelteKit (Svelte 5), TypeScript strict, pnpm m
- `apps/studio/src/lib/` — canvas, editor, io, layout, palette, properties, stores, validation, governance, templates

## Commands
`pnpm dev` | `pnpm build` | `pnpm test` | `pnpm typecheck` | `pnpm lint`
`npm run dev --workspace=@calmstudio/studio` | `npm run build --workspace=@calmstudio/studio` | `npm run test --workspace=@calmstudio/studio` | `npm run typecheck --workspace=@calmstudio/studio` (from repo root)

## CALM 1.2 Rules

Expand Down
36 changes: 18 additions & 18 deletions calm-suite/calm-studio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,22 @@ Architecture diagrams are everywhere — but they rot. They're images no tool ca

### Prerequisites

- Node.js >= 20
- pnpm >= 9 (`npm install -g pnpm`)
- Node.js >= 22 (required by `engine-strict` in the monorepo)

### Development

```bash
git clone https://github.com/finos/calmstudio.git
cd calmstudio
pnpm install
pnpm build
git clone https://github.com/finos/architecture-as-code.git
cd architecture-as-code
npm ci
npm run build --workspace=@calmstudio/calm-core
npm run build --workspace=@calmstudio/extensions
```

Run the studio:

```bash
pnpm --filter @calmstudio/studio dev
npm run dev --workspace=@calmstudio/studio
```

Open [http://localhost:5173](http://localhost:5173).
Expand Down Expand Up @@ -147,27 +147,27 @@ CalmStudio uses a comprehensive test suite across all packages:

| Package | Threshold | Command |
|---------|-----------|---------|
| calm-core | 90% | `pnpm --filter @calmstudio/calm-core run test:coverage` |
| extensions | 80% | `pnpm --filter @calmstudio/extensions run test:coverage` |
| mcp-server | 80% | `pnpm --filter @calmstudio/mcp-server run test:coverage` |
| studio | 60% | `pnpm --filter @calmstudio/studio run test:coverage` |
| calm-core | 90% | `npm run test:coverage --workspace=@calmstudio/calm-core` |
| extensions | 80% | `npm run test:coverage --workspace=@calmstudio/extensions` |
| mcp-server | 80% | `npm run test:coverage --workspace=@calmstudio/mcp` |
| studio | 60% | `npm run test:coverage --workspace=@calmstudio/studio` |

**Run all tests:**

```bash
pnpm -r run test
npm run test --workspaces --if-present
```

**Run with coverage (enforces thresholds):**

```bash
pnpm -r run test:coverage
npm run test:coverage --workspaces --if-present
```

**Run E2E tests** (requires dev server running on port 5173):

```bash
pnpm --filter @calmstudio/studio run test:e2e
npm run test:e2e --workspace=@calmstudio/studio
```

Coverage reports are uploaded as CI artifacts on every build. E2E tests run automatically on merge to `main`.
Expand All @@ -184,10 +184,10 @@ We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md)
### Development Commands

```bash
pnpm build # Build all packages
pnpm test # Run all tests
pnpm typecheck # TypeScript type check
pnpm lint # Lint all packages
npm run build --workspaces --if-present # Build all packages
npm run test --workspaces --if-present # Run all tests
npm run typecheck --workspaces --if-present # TypeScript type check
npm run lint --workspaces --if-present # Lint all packages
```

### Commit Convention
Expand Down
6 changes: 3 additions & 3 deletions calm-suite/calm-studio/apps/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"typecheck": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json"
},
"dependencies": {
"@calmstudio/calm-core": "workspace:*",
"@calmstudio/extensions": "workspace:*",
"@calmstudio/calm-core": "file:../../packages/calm-core",
"@calmstudio/extensions": "file:../../packages/extensions",
"@codemirror/lang-json": "^6.0.2",
"@codemirror/lint": "^6.9.5",
"@codemirror/state": "^6.5.4",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@sveltejs/adapter-static": "^3.0.10",
"@sveltejs/adapter-vercel": "^6.3.3",
"@sveltejs/kit": "^2.53.4",
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@sveltejs/vite-plugin-svelte": "^7.0.0",
"@tailwindcss/vite": "^4.2.1",
"@tauri-apps/cli": "^2.10.1",
"@testing-library/svelte": "^5.2.7",
Expand Down
Loading
Loading