Skip to content

Commit 2b6996c

Browse files
Merge pull request #2407 from gjs-opsflo/chore/calm-guard-npm-workspaces
chore(calm-suite): migrate calm-guard to npm workspaces
2 parents dd3875d + faa4e3b commit 2b6996c

17 files changed

Lines changed: 11549 additions & 26986 deletions

.github/workflows/build-calm-guard.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ on:
1111
paths:
1212
- 'calm-suite/calm-guard/**'
1313
- '.github/workflows/build-calm-guard.yml'
14+
- 'package.json'
15+
- 'package-lock.json'
1416
push:
1517
branches:
1618
- 'main'
1719
- 'release*'
1820
paths:
1921
- 'calm-suite/calm-guard/**'
2022
- '.github/workflows/build-calm-guard.yml'
21-
22-
defaults:
23-
run:
24-
working-directory: calm-suite/calm-guard
23+
- 'package.json'
24+
- 'package-lock.json'
2525

2626
jobs:
2727
lint:
@@ -31,26 +31,21 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
3333

34-
- name: Install pnpm
35-
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
36-
with:
37-
package_json_file: calm-suite/calm-guard/package.json
38-
3934
- name: Setup Node.js
40-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
35+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
4136
with:
4237
node-version: 22
43-
cache: pnpm
44-
cache-dependency-path: calm-suite/calm-guard/pnpm-lock.yaml
38+
cache: npm
39+
cache-dependency-path: package-lock.json
4540

4641
- name: Install dependencies
47-
run: pnpm install --frozen-lockfile
42+
run: npm ci
4843

4944
- name: Lint
50-
run: pnpm lint
45+
run: npm run lint --workspace=calmguard
5146

5247
- name: Typecheck
53-
run: pnpm typecheck
48+
run: npm run typecheck --workspace=calmguard
5449

5550
test:
5651
name: Test
@@ -60,23 +55,18 @@ jobs:
6055
- name: Checkout
6156
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6257

63-
- name: Install pnpm
64-
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
65-
with:
66-
package_json_file: calm-suite/calm-guard/package.json
67-
6858
- name: Setup Node.js
69-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
59+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
7060
with:
7161
node-version: 22
72-
cache: pnpm
73-
cache-dependency-path: calm-suite/calm-guard/pnpm-lock.yaml
62+
cache: npm
63+
cache-dependency-path: package-lock.json
7464

7565
- name: Install dependencies
76-
run: pnpm install --frozen-lockfile
66+
run: npm ci
7767

7868
- name: Run tests
79-
run: pnpm test:run
69+
run: npm run test:run --workspace=calmguard
8070

8171
build:
8272
name: Build
@@ -88,20 +78,15 @@ jobs:
8878
- name: Checkout
8979
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
9080

91-
- name: Install pnpm
92-
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
93-
with:
94-
package_json_file: calm-suite/calm-guard/package.json
95-
9681
- name: Setup Node.js
97-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
82+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
9883
with:
9984
node-version: 22
100-
cache: pnpm
101-
cache-dependency-path: calm-suite/calm-guard/pnpm-lock.yaml
85+
cache: npm
86+
cache-dependency-path: package-lock.json
10287

10388
- name: Install dependencies
104-
run: pnpm install --frozen-lockfile
89+
run: npm ci
10590

10691
- name: Build
107-
run: pnpm build
92+
run: npm run build --workspace=calmguard

calm-suite/calm-guard/AGENTS.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Built for the DTCC/FINOS Innovate.DTCC AI Hackathon (Feb 23-27, 2026).
1111
| Layer | Choice | Notes |
1212
|-------|--------|-------|
1313
| Framework | Next.js 14+ (App Router) | `src/app/` routing, API routes for SSE |
14-
| Package Manager | pnpm | Use `pnpm` for all package operations |
14+
| Package Manager | npm (workspaces) | CalmGuard is a workspace of the monorepo root. Run `npm` commands from the repo root or use `--workspace=calmguard`. The docs sub-package is `calmguard-docs`. |
1515
| Language | TypeScript (strict mode) | No `any` types. Use Zod for runtime validation |
1616
| LLM SDK | Vercel AI SDK (`ai`) | `generateObject` with Zod schemas for all agent outputs |
1717
| Default LLM | Google Gemini | `@ai-sdk/google`. Multi-provider: also supports Anthropic, OpenAI, Ollama, Grok |
@@ -136,11 +136,19 @@ examples/ # Demo CALM architecture JSON files
136136

137137
## Key Commands
138138

139+
Run from monorepo root (preferred) or from `calm-suite/calm-guard/` (drop the `--workspace=calmguard` flag).
140+
139141
```bash
140-
pnpm dev # Start dev server
141-
pnpm build # Production build
142-
pnpm lint # ESLint
143-
pnpm typecheck # TypeScript strict check
142+
# From monorepo root
143+
npm ci # Install all workspaces (one-time / on lockfile change)
144+
npm run dev --workspace=calmguard # Start dev server
145+
npm run build --workspace=calmguard # Production build
146+
npm run lint --workspace=calmguard # ESLint
147+
npm run typecheck --workspace=calmguard # TypeScript strict check
148+
npm run test:run --workspace=calmguard # Vitest single run
149+
150+
# Docs site (Docusaurus)
151+
npm run docs:dev # From calm-suite/calm-guard/
144152
```
145153

146154
## Environment Variables

calm-suite/calm-guard/README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<img src="https://img.shields.io/badge/TypeScript-strict-blue?logo=typescript&logoColor=white" alt="TypeScript" />
1818
<img src="https://img.shields.io/badge/FINOS-CALM_1.0--1.2-00A3E0?logo=linux-foundation&logoColor=white" alt="FINOS CALM" />
1919
<img src="https://img.shields.io/badge/Node-22+-339933?logo=node.js&logoColor=white" alt="Node 22+" />
20-
<img src="https://img.shields.io/badge/pnpm-9+-F69220?logo=pnpm&logoColor=white" alt="pnpm" />
20+
<img src="https://img.shields.io/badge/npm-10+-CB3837?logo=npm&logoColor=white" alt="npm" />
2121
</p>
2222

2323
---
@@ -70,15 +70,17 @@ You could [Access the Presentation ->](https://github.com/finos-labs/dtcch-2026-
7070

7171
### Prerequisites
7272

73-
- **Node.js 22+** and **pnpm 9+**
73+
- **Node.js 22+** and **npm 10+**
7474
- At least one LLM provider API key (Gemini is the default)
7575

7676
### Setup
7777

78+
CalmGuard is a workspace of the [`finos/architecture-as-code`](https://github.com/finos/architecture-as-code) monorepo. Clone the monorepo and install all workspaces from the root:
79+
7880
```bash
79-
git clone https://github.com/finos-labs/dtcch-2026-opsflow-llc.git
80-
cd dtcch-2026-opsflow-llc
81-
pnpm install
81+
git clone https://github.com/finos/architecture-as-code.git
82+
cd architecture-as-code
83+
npm ci
8284
```
8385

8486
Create a `.env.local` file:
@@ -98,8 +100,16 @@ GITHUB_TOKEN=your-github-token
98100

99101
### Run
100102

103+
From the monorepo root:
104+
105+
```bash
106+
npm run dev --workspace=calmguard # Start dev server at http://localhost:3000
107+
```
108+
109+
Or from `calm-suite/calm-guard/`:
110+
101111
```bash
102-
pnpm dev # Start dev server at http://localhost:3000
112+
npm run dev
103113
```
104114

105115
Visit the dashboard — click **"Demo Mode"** to see CALMGuard analyze a sample architecture without any API keys.
@@ -377,7 +387,7 @@ Unknown node types (e.g., `lambda`) are mapped to `service` — maximizing compa
377387
378388
## Documentation
379389

380-
Full documentation is available in [`docs/`](docs/). Run locally with `pnpm docs:dev`, or browse directly on GitHub:
390+
Full documentation is available in [`docs/`](docs/). Run locally with `npm run docs:dev`, or browse directly on GitHub:
381391

382392
### Getting Started
383393

calm-suite/calm-guard/docs/README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,44 @@
22

33
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

5+
It is published as the `calmguard-docs` workspace of the [`finos/architecture-as-code`](https://github.com/finos/architecture-as-code) monorepo.
6+
57
## Installation
68

9+
From the monorepo root:
10+
711
```bash
8-
pnpm install
12+
npm ci
913
```
1014

1115
## Local Development
1216

17+
From the monorepo root:
18+
19+
```bash
20+
npm run start --workspace=calmguard-docs
21+
```
22+
23+
Or from `calm-suite/calm-guard/`:
24+
1325
```bash
14-
pnpm start
26+
npm run docs:dev
1527
```
1628

1729
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1830

1931
## Build
2032

33+
From the monorepo root:
34+
35+
```bash
36+
npm run build --workspace=calmguard-docs
37+
```
38+
39+
Or from `calm-suite/calm-guard/`:
40+
2141
```bash
22-
pnpm build
42+
npm run docs:build
2343
```
2444

2545
This command generates static content into the `build` directory and can be served using any static contents hosting service.

calm-suite/calm-guard/docs/docs/api/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: API Reference
66
# API Reference
77

88
> This page is auto-generated from Zod schema source files by `scripts/generate-api-docs.ts`.
9-
> Run `pnpm docs:api` to regenerate.
9+
> Run `npm run docs:api --workspace=calmguard` to regenerate.
1010
1111
*Generated: 2026-02-24T08:36:31.355Z*
1212

calm-suite/calm-guard/docs/docs/architecture/system-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CALMGuard is built on Next.js 15 with a multi-agent AI architecture. This page c
2020
| Charts | Recharts | Compliance gauges, heat maps |
2121
| State | Zustand | Flat state, SSE event updates |
2222
| Validation | Zod | CALM parsing + agent output validation |
23-
| Package Manager | pnpm | Workspace tooling |
23+
| Package Manager | npm (workspaces) | Root of `finos/architecture-as-code` monorepo |
2424

2525
## Architecture Diagram
2626

calm-suite/calm-guard/docs/docs/contributing.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ CALMGuard is an open-source project built for the DTCC/FINOS Innovate Hackathon
1212
### Prerequisites
1313

1414
- Node.js 22+
15-
- pnpm 9+
15+
- npm 10+
1616
- A Gemini API key (free tier works for development)
1717

1818
### Installation
1919

20+
CalmGuard lives in the [`finos/architecture-as-code`](https://github.com/finos/architecture-as-code) monorepo as the `calmguard` npm workspace.
21+
2022
```bash
21-
git clone https://github.com/finos/dtcch-2026-opsflow-llc.git
22-
cd dtcch-2026-opsflow-llc
23-
pnpm install
24-
cp .env.example .env.local
23+
git clone https://github.com/finos/architecture-as-code.git
24+
cd architecture-as-code
25+
npm ci
26+
cp calm-suite/calm-guard/.env.example calm-suite/calm-guard/.env.local
2527
# Edit .env.local and add your GOOGLE_GENERATIVE_AI_API_KEY
26-
pnpm dev
28+
npm run dev --workspace=calmguard
2729
```
2830

2931
## Project Structure
@@ -68,11 +70,11 @@ See the [System Overview](/architecture/system-overview) for a full directory br
6870

6971
## Testing
7072

71-
Run the test suite:
73+
Run the test suite (from monorepo root):
7274

7375
```bash
74-
pnpm test # Watch mode
75-
pnpm test:run # Single run
76+
npm run test --workspace=calmguard # Watch mode
77+
npm run test:run --workspace=calmguard # Single run
7678
```
7779

7880
Tests use Vitest with jsdom for component testing.
@@ -88,12 +90,12 @@ Tests use Vitest with jsdom for component testing.
8890
1. Fork the repository
8991
2. Create a feature branch: `git checkout -b feat/my-feature`
9092
3. Make your changes with tests
91-
4. Run the full check suite:
93+
4. Run the full check suite (from monorepo root):
9294
```bash
93-
pnpm typecheck
94-
pnpm lint
95-
pnpm test:run
96-
pnpm build
95+
npm run typecheck --workspace=calmguard
96+
npm run lint --workspace=calmguard
97+
npm run test:run --workspace=calmguard
98+
npm run build --workspace=calmguard
9799
```
98100
5. Commit with DCO sign-off: `git commit -s -m "feat: add my feature"`
99101
6. Push and open a Pull Request

calm-suite/calm-guard/docs/docs/getting-started.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,32 @@ Get CALMGuard running locally in under 5 minutes.
1212
| Requirement | Minimum Version | Notes |
1313
|------------|-----------------|-------|
1414
| Node.js | 22+ | LTS recommended |
15-
| pnpm | 9+ | `npm install -g pnpm` |
15+
| npm | 10+ | Ships with Node 22 |
1616
| Git | Any | For cloning |
1717
| Google Gemini API key || Free tier sufficient for demo |
1818

19+
CalmGuard is the `calmguard` workspace inside the [`finos/architecture-as-code`](https://github.com/finos/architecture-as-code) monorepo. All commands run from the monorepo root.
20+
1921
## Installation
2022

21-
### 1. Clone the repository
23+
### 1. Clone the monorepo
2224

2325
```bash
24-
git clone https://github.com/finos/dtcch-2026-opsflow-llc.git
25-
cd dtcch-2026-opsflow-llc
26+
git clone https://github.com/finos/architecture-as-code.git
27+
cd architecture-as-code
2628
```
2729

2830
### 2. Install dependencies
2931

3032
```bash
31-
pnpm install
33+
npm ci
3234
```
3335

36+
This installs all workspaces (calm-guard, calm-studio, cli, server, etc.) from the root `package-lock.json`.
37+
3438
### 3. Configure environment variables
3539

36-
Create a `.env.local` file in the project root:
40+
Create a `.env.local` file in `calm-suite/calm-guard/`:
3741

3842
```bash
3943
# Required — Gemini is the default LLM provider
@@ -51,8 +55,10 @@ OPENAI_API_KEY=your-openai-key
5155

5256
### 4. Start the development server
5357

58+
From the monorepo root:
59+
5460
```bash
55-
pnpm dev
61+
npm run dev --workspace=calmguard
5662
```
5763

5864
The app will be available at [http://localhost:3000](http://localhost:3000).

calm-suite/calm-guard/docs/docs/security.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,18 @@ We follow responsible disclosure and will credit reporters in our changelog.
140140

141141
## Dependencies
142142

143-
Security-relevant dependencies are audited with `pnpm audit`. Run:
143+
Security-relevant dependencies are audited with `npm audit`. Run from the monorepo root:
144144

145145
```bash
146-
pnpm audit
146+
npm audit
147147
```
148148

149149
Known issues will be tracked in GitHub Issues with the `security` label.
150150

151151
License compliance is checked with:
152152

153153
```bash
154-
pnpm license-check
154+
npm run license-check --workspace=calmguard
155155
```
156156

157157
This fails on GPL/AGPL dependencies to ensure no copyleft code enters the project.

0 commit comments

Comments
 (0)