chore(ui): upgrade pnpm to 11 and harden supply-chain defaults#11225
Conversation
|
✅ All necessary |
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
🔒 Container Security ScanImage: 📊 Vulnerability Summary
2 package(s) affected
|
alejandrobailo
left a comment
There was a problem hiding this comment.
Nice cleanup,
A few small things I noticed:
The description says installs will fail on Node ≠ .nvmrc, but engines.node is >=22.13, so anything from 22.13 onwards will still install (Docker and CI pin 24.13.0 via .nvmrc). Either tighten engines.node or tweak the wording so future readers don't expect strict parity.
engines.pnpm: ">=11" is a bit looser than packageManager: pnpm@11.1.3. Not blocking, just a tiny drift.
In .config/wt.toml the new pre-start block has two keys (corepack-enable, corepack-install). TOML doesn't guarantee key order, so depending on the runner they could run out of order. Splitting into two [[pre-start]] blocks (or chaining with &&) would make it bulletproof.
Other than that, looks good to me.
bfca1e6 to
1d347c1
Compare
|
Thanks @alejandrobailo — addressed all three in 2047937:
|
2047937 to
9ba80b7
Compare
|
@alejandrobailo Also let me know if you wanna go really strict and require exact node/pnpm versions instead of >= Usually the exact version is my approach, but I wanna check here before enforcing it |
9ba80b7 to
df8e689
Compare
9b08026 to
c59d7a7
Compare
|
Thanks, this looks good overall. One thing I want to clarify before approval: I also checked the new |
|
Thanks for the close read @Alan-TheGentleman — both addressed in 1884ddd:
|
6be5b2a
80e7dbe to
6be5b2a
Compare
- Bump pnpm 10.33.0 → 11.1.3 (Node ≥22.13 required by pnpm 11) - Migrate package.json#pnpm.overrides and .npmrc settings to pnpm-workspace.yaml (required by pnpm 11; .npmrc deleted) - Read Node from ui/.nvmrc and pnpm from packageManager in CI workflows (drop hardcoded versions) - Add engines + engineStrict; document trustPolicyExclude for known false positives (next-auth, langium, semver) - Add corepack pre-start hook to wt.toml; comment Dockerfile FROM to keep in sync with .nvmrc
The pnpm 11 migration in 8fa7959 removed ui/.npmrc (its settings moved to pnpm-workspace.yaml), but the Dockerfile's deps stage still listed .npmrc in its COPY line, breaking the ui-container build ("failed to compute cache key ... \"/.npmrc\": not found").
- Tighten engines.pnpm to ">=11.1.3" so it stops drifting below the exact version pinned by packageManager (pnpm@11.1.3). - Split the corepack pre-start block in .config/wt.toml into two [[pre-start]] entries: worktrunk runs keys inside one block concurrently, so corepack-install could race ahead of corepack-enable. Two ordered blocks guarantee enable runs first.
Three transitive copies of uuid were present in the lockfile: 9.0.1 (@sentry/webpack-plugin), 10.0.0 (@langchain/langgraph) and 13.0.2 (streamdown/mermaid). The first two land below the 11.1.1 fix for GHSA-w5hq-g745-h8pq (missing bounds check in v3/v5/v6 name-based generators when buf is provided). In practice the consumers in our tree call uuid.v4() only, so the vulnerable code path isn't reachable, but pinning via overrides unifies the tree on a single patched version (11.1.1) and clears the osv-scanner finding.
…oist) - Restore format:check in the healthcheck script. It was dropped inadvertently when the package.json rebase conflict from PR #11172 (prettier-plugin-packagejson) was resolved with --theirs, losing master's healthcheck enhancement. Format enforcement is meant to run together with typecheck and lint, not somewhere else. - Drop the `*@nextui-org/*` publicHoistPattern entry. It was a legacy carry-over from the NextUI -> HeroUI rename: zero source imports and zero packages in the resolved tree. The `*@heroui/*` entry stays because the UI still imports HeroUI directly.
6be5b2a to
f498250
Compare
Context
The UI workspace was on pnpm 10.33.0 with supply-chain configuration spread across three files (
ui/.npmrc,ui/package.json#pnpm,ui/pnpm-workspace.yaml). pnpm 11 dropped support forpnpmand most.npmrckeys, so the migration was needed to stay on a supported release line while consolidating the security defaults in a single place. While at it, severaltrustPolicyExcludeentries were open-ended package names — a bump to a malicious version of those would silently pass the trust check.Description
10.33.0→11.1.3(Node ≥22.13 required by pnpm 11; aligned withui/.nvmrc).pnpm.overridesfrompackage.jsonand the security-relevant keys from.npmrcintoui/pnpm-workspace.yaml(pnpm 11 only readsauth/registryfrom.npmrc, soui/.npmrcis deleted).ui-e2e-tests-v2.yml,ui-tests.yml) read Node fromui/.nvmrcand pnpm frompackage.json#packageManagerinstead of hardcoding values.express-rate-limitto exact8.5.1inoverrides— version8.2.2dropped provenance attestation, so without a pin pnpm 11'strustPolicy: no-downgraderejects the transitive (@modelcontextprotocol/sdk→express-rate-limit).trustPolicyExclude: entries are now pinned to the exact resolved version (next-auth@5.0.0-beta.30,semver@6.3.1). A bump now fails until reviewed.langiumremoved fromtrustPolicyExclude(no longer in the dep tree after pnpm 11 re-resolution).corepack enable/corepack installpre-start hook in.config/wt.toml; document the Node version sync requirement inui/Dockerfile.engineStrict: trueplusengines.node/engines.pnpminpackage.jsonrefuse installs outside the supported versions.Steps to review
cd ui && pnpm install— should succeed with no--trust-policy-excludeflag and resolveexpress-rate-limit@8.5.1,next-auth@5.0.0-beta.30,semver@6.3.1.pnpm-lock.yamlheader reflects the overrides (express-rate-limit: 8.5.1).engineStrict(the floor required by pnpm 11). Anything ≥22.13 still installs;.nvmrcpins 24.13.0 to keep Docker and CI in lockstep with the team default, not as a strict equality requirement.ui/pnpm-workspace.yaml— all supply-chain settings (engineStrict,publicHoistPattern,saveExact,overrides,minimumReleaseAge,strictDepBuilds/allowBuilds,trustPolicy/trustPolicyExclude,blockExoticSubdeps) are now in one file.git grep -n "node-version" .github/workflows/ui-*.yml— should show onlynode-version-file: ui/.nvmrc(no hardcoded number).Checklist
Community Checklist
UI (if applicable)
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.