feat: centralize TS dependency management via catalogs#2782
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughMultiple package.json files across the monorepo had dependency and devDependency version specifiers replaced with the literal Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2782 +/- ##
==========================================
+ Coverage 41.70% 47.53% +5.82%
==========================================
Files 791 1065 +274
Lines 113325 144278 +30953
Branches 8768 9767 +999
==========================================
+ Hits 47266 68578 +21312
- Misses 65695 73925 +8230
- Partials 364 1775 +1411 🚀 New features to boost your workflow:
|
Router-nonroot image scan passed✅ No security vulnerabilities found in image: |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
controlplane/emails/package.json (1)
20-23: Align React type package versions with catalog-managed React.React is centrally managed via
catalog:on line 22, but@types/reactand@types/react-domremain pinned to specific versions (lines 20-21). This pattern exists inplayground/package.jsonandstudio/package.jsonas well. Consider usingcatalog:for the type packages too to prevent runtime/type version drift during future React upgrades.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@controlplane/emails/package.json` around lines 20 - 23, The `@types` packages are pinned to specific versions while "react" is managed via "catalog:", causing potential drift; update the dependencies for "@types/react" and "@types/react-dom" in controlplane/emails/package.json to use "catalog:" instead of fixed versions, and apply the same change in playground/package.json and studio/package.json so the type packages follow the catalog-managed React version consistently (look for the dependency keys "@types/react" and "@types/react-dom" to modify).playground/package.json (1)
63-63: Moveprettierfrom dependencies to devDependencies.
prettieris only used in the"format"script and has no runtime imports. Since this package is published, unnecessary production dependencies increase the install footprint for consumers.Proposed change
"dependencies": { "lodash": "catalog:", "monaco-editor": "^0.45.0", - "prettier": "catalog:", "prism-react-renderer": "^2.3.0", }, "devDependencies": { + "prettier": "catalog:", "@tailwindcss/typography": "^0.5.10",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@playground/package.json` at line 63, The package currently lists "prettier" under dependencies in package.json but it's only used for the "format" script; move "prettier" from the "dependencies" object into "devDependencies" so it won't be installed for consumers—update the package.json entries accordingly and ensure the "format" script still references "prettier" (no other changes to script names or runtime imports like format should be required).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@studio/package.json`:
- Around line 32-34: The package.json currently mixes catalog resolution and
explicit version pins causing drift: either add "@connectrpc/connect-web" to the
catalog so it resolves consistently with "@connectrpc/connect" and
"@connectrpc/connect-query", or change "@connectrpc/connect" and
"@connectrpc/connect-query" to explicit pins matching "^1.4.0"/the same semver
you want; likewise, make the react typings consistent by adding "@types/react"
and "@types/react-dom" to the catalog or pinning "react" and "react-dom" to the
same versions as their `@types` packages—update package names
"@connectrpc/connect-web", "@connectrpc/connect", "@connectrpc/connect-query",
"react", "react-dom", "@types/react", and "@types/react-dom" accordingly.
---
Nitpick comments:
In `@controlplane/emails/package.json`:
- Around line 20-23: The `@types` packages are pinned to specific versions while
"react" is managed via "catalog:", causing potential drift; update the
dependencies for "@types/react" and "@types/react-dom" in
controlplane/emails/package.json to use "catalog:" instead of fixed versions,
and apply the same change in playground/package.json and studio/package.json so
the type packages follow the catalog-managed React version consistently (look
for the dependency keys "@types/react" and "@types/react-dom" to modify).
In `@playground/package.json`:
- Line 63: The package currently lists "prettier" under dependencies in
package.json but it's only used for the "format" script; move "prettier" from
the "dependencies" object into "devDependencies" so it won't be installed for
consumers—update the package.json entries accordingly and ensure the "format"
script still references "prettier" (no other changes to script names or runtime
imports like format should be required).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b1fcc226-bce1-4718-8cad-9c462a3f7fd3
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (15)
admission-server/package.jsoncdn-server/cdn/package.jsoncdn-server/package.jsoncli/package.jsoncomposition-go/shim/package.jsoncomposition/package.jsonconnect/package.jsoncontrolplane/emails/package.jsoncontrolplane/package.jsonpackage.jsonplayground/package.jsonpnpm-workspace.yamlprotographic/package.jsonshared/package.jsonstudio/package.json
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4392c72 to
9ecf925
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
ac9f904 to
f18bbaf
Compare
c663f4d to
125c4c5
Compare
c900d20 to
597917a
Compare
4a5b04f to
2a381f0
Compare
…-adopt-pnpm-catalogs-feature
This PR centralizes dependency management via pnpm catalogs feature. I identified several dependencies
that are shared across packages in our monorepo. These deps should use a single common version across
packages.
Caution
I went through the dependency versions by looking at what the current versions are vs what's in the
catalog file. I used the highest version that we had in the codebase to use as the base.
There were no situations where major version would be increased so I don't think we should run
into any issues but it's worth mentioning.
The intention is not to maintain every dependency in a catalog, but the ones that are shared and
important enough, should be using single version to avoid issues like:
Note
I had to re-format playground code as I'm touching the library.
After merging these changes, we should run release CI workflow. I ran
pnpm release-previewscript manually on local machine and nothing failed, so we should be OK.Summary by CodeRabbit
Checklist
Open Source AI Manifesto
This project follows the principles of the Open Source AI Manifesto. Please ensure your contribution aligns with its principles.