Skip to content

chore(calm-suite): migrate calm-studio to npm workspaces#2408

Open
gjs-opsflo wants to merge 4 commits into
finos:mainfrom
gjs-opsflo:chore/calm-studio-npm-workspaces
Open

chore(calm-suite): migrate calm-studio to npm workspaces#2408
gjs-opsflo wants to merge 4 commits into
finos:mainfrom
gjs-opsflo:chore/calm-studio-npm-workspaces

Conversation

@gjs-opsflo
Copy link
Copy Markdown
Contributor

Summary

Migrates calm-suite/calm-studio (orchestration root + 7 packages + 1 SvelteKit/Tauri app + Docusaurus docs site) from a standalone pnpm workspace into the root npm workspaces. Second half of the pnpm→npm migration tracked by #2328 — companion to PR #2407 (calm-guard).

Resolves #2328 (calm-studio portion).

Relationship to PR #2407 (calm-guard)

Independent of PR #2407. Lockfile and root package.json overlap:

Whichever PR merges second will need a trivial rebase (lockfile + workspaces array merge). No logical conflicts.

Changes

Workspaces

  • Root package.json workspaces array gains:
    • calm-suite/calm-studio (orchestration root, declared as calmstudio-workspace)
    • calm-suite/calm-studio/packages/* (7 packages)
    • calm-suite/calm-studio/apps/* (studio app)
    • calm-suite/calm-studio/docs-site (Docusaurus docs)

Internal dependency conversion (9 occurrences)

All workspace:* references converted to file: relative paths matching repo convention:

Source Dependency Target
apps/studio @calmstudio/calm-core file:../../packages/calm-core
apps/studio @calmstudio/extensions file:../../packages/extensions
packages/github-action @calmstudio/calm-core file:../calm-core
packages/github-action @calmstudio/mcp file:../mcp-server
packages/mcp-server (deps + devDeps) @calmstudio/calm-core file:../calm-core
packages/vscode-extension @calmstudio/mcp file:../mcp-server
packages/web-component @calmstudio/calm-core file:../calm-core
packages/web-component @calmstudio/extensions file:../extensions

Vitest version alignment

packages/extensions had vitest@^4.1.0 and @vitest/coverage-v8@^4.1.0; all sibling packages used ^3.x. pnpm's strict isolation hid the divergence; npm hoisting needs a single version. Aligned both to ^3.2.4.

Tauri / Vite config

  • apps/studio/src-tauri/tauri.conf.json: pnpm dev/pnpm buildnpm run dev/npm run build.
  • apps/studio/vite.config.ts: import defineConfig from 'vitest/config' (was 'vite') so the test field typechecks. This was a latent bug.

Removed

  • pnpm packageManager field from migrated package.json files.
  • pnpm.overrides blocks (merged into root overrides).
  • calm-suite/calm-studio/pnpm-workspace.yaml.
  • calm-suite/calm-studio/pnpm-lock.yaml.

CI workflows

Three workflows rewritten:

  • .github/workflows/build-calm-studio.yml: removes defaults.run.working-directory, switches to actions/setup-node with cache: npm and cache-dependency-path: package-lock.json, replaces pnpm install --frozen-lockfile with npm ci, replaces pnpm <script> with npm run <script> --if-present --workspace=@calmstudio/<pkg>. Build runs for all 8 packages; lint/typecheck/test scoped to packages with the relevant scripts.
  • .github/workflows/build-calm-studio-desktop.yml: same npm setup; tauriScript becomes npm run tauri --if-present --workspace=@calmstudio/studio.
  • .github/workflows/automated-release-calm-studio.yml: npm-based bootstrap before multi-semantic-release.

Lockfile

Root package-lock.json regenerated from a clean npm install. Single source of truth.

Docs sweep

Separate commit (docs(calm-suite): instruct npm usage instead of pnpm...) updates calm-studio/README.md, AGENTS.md, packages/calm-core/README.md, and the Docusaurus docs site (getting-started/quick-start.md, developer-guide/contributing.md, developer-guide/extension-packs.md, adrs/0008-docusaurus-for-documentation.md).

Validation evidence

Local validation from a clean checkout (run from repo root):

  • rm -rf node_modules && CYPRESS_INSTALL_BINARY=0 npm ci — exits 0, no EUNSUPPORTEDPROTOCOL.
  • Build for all 8 packages — green: calm-core, extensions, mcp, diagram, studio, github-action, vscode-extension (calmstudio), calmscript.
  • Lint for calm-core, extensions, mcp, studio — green (where script exists).
  • Typecheck for calm-core, extensions, mcp, github-action — green.
  • Test for calm-core (4 files), extensions (3 files), mcp (7 files), studio (28 files, 419 tests) — all green.
  • ! rg 'pnpm' calm-suite/calm-studio/ -g '*.md' -g '*.mdx' -g 'package.json' -g '!**/node_modules/**' — zero matches.
  • ! rg 'workspace:' calm-suite/calm-studio/ -g 'package.json' -g '!**/node_modules/**' — zero matches.
  • ! rg "require\.resolve\(['\"]@" calm-suite/calm-studio/ -g '!**/node_modules/**' -g '!**/dist/**' — zero matches (no webpack-static-analysis traps to fix in calm-studio source).

CI on this PR will run the rewritten Build CALM Studio workflow (build/lint/typecheck/test for the workspaces with the relevant scripts) and the desktop + release workflows (paths trigger only). All three must be green before merge.

Breaking-change notes

  • pnpm is no longer the package manager for calm-studio. Contributors must run npm ci from the repo root (not pnpm install inside calm-suite/calm-studio/).
  • The intermediate calm-suite/calm-studio/package.json (named calmstudio-workspace) is now an npm workspace member; npm run --workspaces --if-present from the root fans out to the calm-studio orchestration scripts.
  • Renovate/Dependabot will start scanning calm-studio deps via the root package-lock.json.

Out of scope (follow-up)

  • Renovate/Dependabot CVE/license-scan matrix expansion to include calm-suite — separate PR.
  • Strict-typecheck cleanup for @calmstudio/diagram and @calmstudio/studio — pre-existing TS strictness errors that origin/main CI never ran. Not blocking; addressed separately if desired.

aamanrebello
aamanrebello previously approved these changes May 8, 2026
…-workspaces

# Conflicts:
#	.github/workflows/automated-release-calm-studio.yml
#	.github/workflows/build-calm-studio-desktop.yml
#	.github/workflows/build-calm-studio.yml
#	calm-suite/calm-studio/pnpm-lock.yaml
#	package-lock.json
#	package.json
The Playwright webServer was still spawning the dev server with pnpm,
but the runner has no pnpm after the npm-workspaces migration. Use
npm run dev so the e2e CI job can start the server.

Signed-off-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com>
Under npm workspaces, @sveltejs/kit (and friends) install at
calm-suite/calm-studio/node_modules rather than at apps/studio/node_modules,
which is outside Vite's default fs.allow root. Without this, Playwright's
dev server boots but every page request fails with 'outside of Vite serving
allow list', and all 14 e2e tests fail with timeouts on the first locator.

Signed-off-by: Matthew Bain <66839492+rocketstack-matt@users.noreply.github.com>
@rocketstack-matt
Copy link
Copy Markdown
Member

rocketstack-matt commented May 9, 2026

This had been left for a while with conflicts so I've fixed them up - given both @gjs-opsflo and myself have touched it, can @opsflowanoop @eddie-knight @jpgough-ms or @markscott-ms as other codeowners of calm-studio please review

markscott-ms pushed a commit that referenced this pull request May 10, 2026
Removes the calmstudio-docs entry from root package.json workspaces
(added by #2408) now that its content lives in the main docs site
(see previous commit). Regenerates package-lock.json to drop the
calmstudio-docs package and its transitive dependencies.

Note: calm-suite/calm-studio/pnpm-workspace.yaml was already cleaned up
in Phase 2 (d446522). No --filter '!calmstudio-docs' existed in
build-calm-studio.yml on the Phase 2 branch (it was rewritten to use
npm --workspace flags).

Resolves #2331 (with previous commit).

Signed-off-by: Gourav Shah <gjs@opsflow.sh>
# Conflicts:
#	package-lock.json
#	package.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate calm-suite projects from pnpm to npm workspaces

3 participants