chore(calm-suite): migrate calm-guard to npm workspaces#2407
chore(calm-suite): migrate calm-guard to npm workspaces#2407rocketstack-matt merged 2 commits intofinos:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Migrates calm-suite/calm-guard (including its docs/ package) from a standalone pnpm setup into the repo’s root npm workspaces, aligning calm-guard’s dependency installation and CI workflow with the monorepo’s standard npm workspace pattern.
Changes:
- Added
calm-suite/calm-guardandcalm-suite/calm-guard/docsto the root npmworkspaces. - Updated calm-guard and its docs package metadata/scripts to work under npm workspaces (including renaming the docs workspace package).
- Reworked the
Build CALM GuardGitHub Actions workflow to usenpm ciandnpm run ... --workspace=...instead of pnpm.
Reviewed changes
Copilot reviewed 5 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Registers calm-guard and its docs as root npm workspaces. |
| calm-suite/calm-guard/package.json | Removes pnpm packageManager pin; rewires docs scripts to npm workspaces. |
| calm-suite/calm-guard/docs/package.json | Renames docs workspace package; adjusts TypeScript range; removes pnpm overrides. |
| .github/workflows/build-calm-guard.yml | Switches CI from pnpm-in-subdir to root npm ci + workspace-scoped commands and npm caching. |
| calm-suite/calm-guard/src/lib/calm/cli-validator.ts | Attempts to avoid webpack static tracing of require.resolve for calm-cli entrypoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add calm-suite/calm-guard and calm-suite/calm-guard/docs to root npm workspaces - Rename calm-suite/calm-guard/docs package from "docs" to "calmguard-docs" to avoid collision with root docs/ workspace - Remove "packageManager: pnpm@10.23.0" from calm-guard package.json - Rewrite docs:dev/docs:build scripts to use "npm run --workspace=calmguard-docs" - Widen calmguard-docs typescript range from ~5.6.2 to ^5.6.2 to align with hoisted root version - Remove pnpm.overrides from calmguard-docs (root overrides cover them) - Delete calm-suite/calm-guard/pnpm-lock.yaml and calm-suite/calm-guard/docs/pnpm-lock.yaml - Rewrite .github/workflows/build-calm-guard.yml to use actions/setup-node with cache: npm, npm ci, and --workspace=calmguard - Regenerate root package-lock.json - cli-validator: defeat webpack static analysis of @finos/calm-cli/dist path so Next.js build succeeds under npm hoisting (uri-js submodule resolution differs from pnpm strict isolation) Refs finos#2328 (calm-guard half; calm-studio follows in a separate PR). Signed-off-by: Gourav Shah <gjs@opsflow.sh>
24e8876 to
2e6bcc9
Compare
rocketstack-matt
left a comment
There was a problem hiding this comment.
Looks good - just need to update the docs README and calm-guard AGENTS.md to instruct use of npm instead on pnpm
Address review feedback on finos#2407: update calm-guard README, AGENTS.md, and the Docusaurus docs site (getting-started, contributing, getting-started, security, api/reference, architecture/system-overview, uploading-architectures, docs/README) to instruct contributors to use npm from the monorepo root instead of pnpm. - README badge pnpm 9+ → npm 10+ - All install/dev/build/test commands rewritten as npm with --workspace=calmguard (or --workspace=calmguard-docs for the docs site) - Clone instructions point at finos/architecture-as-code (the monorepo) instead of the standalone hackathon repo - Both root- and calm-guard-relative invocations documented where useful Refs finos#2328. Signed-off-by: Gourav Shah <gjs@opsflow.sh>
|
@Copilot good catch. You're right that webpack 5 can constant-fold simple string concatenation. Pushed an amended commit using Verified locally: build still emits the expected |
|
Pushed
Verified zero remaining |
Summary
Migrates
calm-suite/calm-guard(and itsdocs/sub-package) from a standalone pnpm workspace into the root npm workspaces. This is the first half of the pnpm→npm migration tracked by #2328 — a smaller, lower-risk PR landed first as a proof-of-concept. Thecalm-studiohalf follows in a separate PR.Resolves #2328 (calm-guard portion).
Changes
package.json: Addedcalm-suite/calm-guardandcalm-suite/calm-guard/docsto theworkspacesarray.calm-suite/calm-guard/package.json: Removed"packageManager": "pnpm@10.23.0". Rewrotedocs:dev/docs:buildscripts to callnpm run --workspace=calmguard-docs.calm-suite/calm-guard/docs/package.json: Renamed"name": "docs"→"name": "calmguard-docs"to avoid collision with the rootdocs/workspace. Widenedtypescriptrange from~5.6.2to^5.6.2to align with the hoisted root version. Removedpnpm.overrides(root overrides cover them).calm-suite/calm-guard/pnpm-lock.yaml,calm-suite/calm-guard/docs/pnpm-lock.yaml.package-lock.json(single source of truth)..github/workflows/build-calm-guard.yml: Removedpnpm/action-setupsteps; switched cache tonpmwithcache-dependency-path: package-lock.json; replacedpnpm install --frozen-lockfilewithnpm ci; replacedpnpm <script>withnpm run <script> --workspace=calmguard.calm-suite/calm-guard/src/lib/calm/cli-validator.ts: Defeat webpack static analysis ofrequire.resolve('@finos/calm-cli/dist/index.js')by concatenating the path at runtime. Required because npm hoistsuri-jsdifferently than pnpm strict isolation, exposing the bundled CLI's transitive submodule references (./IPv6,./SecondLevelDomains,./punycode) to webpack's static analysis.serverExternalPackagesalone is insufficient when a staticrequire.resolveis present in the source.Validation evidence
Local validation from a clean checkout (run from repo root):
rm -rf node_modules && CYPRESS_INSTALL_BINARY=0 npm ci— exits 0, noEUNSUPPORTEDPROTOCOL.npm run lint --workspace=calmguard— green.npm run typecheck --workspace=calmguard— green.npm run test:run --workspace=calmguard— green (111 tests).npm run build --workspace=calmguard— green (Next.js production build).npm run test --workspaces --if-present— 634/635 tests pass; the single failure (shared/src/docify/template-bundles/docusaurus/package.spec.ts) is pre-existing onorigin/mainand unrelated to this migration.! rg 'pnpm' calm-suite/calm-guard/ .github/workflows/build-calm-guard.yml— zero matches inside calm-guard scope.CI on this PR will run the rewritten
Build CALM Guardworkflow and must be green before merge.Breaking-change notes
pnpmis no longer the package manager forcalm-guard. Contributors must runnpm cifrom the repo root (notpnpm installinsidecalm-suite/calm-guard/).docssub-package name changed fromdocstocalmguard-docs. Any downstream tooling that referenced it by name (none known in-repo) must update.calm-guarddeps via the rootpackage-lock.json(previously not scanned). Expect a small wave of automated dep PRs after merge.Out of scope (follow-up)
calm-suite/calm-studiomigration — separate PR (also against Migrate calm-suite projects from pnpm to npm workspaces #2328).