Repository navigation
Conversation
Align declared dependencies in workspace package.json files with the versions resolved in package-lock.json: - Update tar to 7.5.11 in packages/cli and packages/a2a-server - Update clipboardy to 5.2.1 in packages/cli - Deduplicate vitest in packages/a2a-server and packages/sdk to root 3.2.4 - Deduplicate typescript in vscode-ide-companion to root 5.8.3 (<5.9.0)
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
📊 PR Size: size/L
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses critical dependency version mismatches between workspace package.json files and the root package-lock.json. By synchronizing these versions and implementing a new automated check in the CI pipeline, the changes ensure that downstream build tools—such as Nix and other sandboxed environments—can successfully perform offline installations without encountering target resolution errors or peer dependency conflicts. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates dependency versions for tar and clipboardy across packages, cleans up unused transitive dependencies in package-lock.json, and introduces a new validation check in scripts/check-lockfile.js to ensure workspace dependencies in package.json match resolutions in package-lock.json. Feedback on the new check highlights a critical issue where local workspace symlinks (represented as link entries in package-lock.json without a version property) will cause false positives and fail the CI check, and a code suggestion is provided to resolve the links to their target packages.
| const resolvedPkg = | ||
| packages[`${ws}/node_modules/${dep}`] || | ||
| packages[`node_modules/${dep}`]; |
There was a problem hiding this comment.
In package-lock.json (v2/v3), workspace dependencies or local symlinked packages are represented as link entries (e.g., "node_modules/dep": { "resolved": "packages/dep", "link": true }) which do not contain a version property. The actual version is defined in the target package entry (e.g., "packages/dep").
Since internal workspace dependencies often use exact versions (e.g., "0.65.0-nightly..."), comparing the exact version against resolvedPkg.version (which is undefined for links) will trigger false positives and fail the CI check.
To fix this, resolve the link to the target package if link is true.
| const resolvedPkg = | |
| packages[`${ws}/node_modules/${dep}`] || | |
| packages[`node_modules/${dep}`]; | |
| const linkPkg = | |
| packages[ws + "/node_modules/" + dep] || | |
| packages["node_modules/" + dep]; | |
| const resolvedPkg = linkPkg && linkPkg.link ? packages[linkPkg.resolved] : linkPkg; |
Extend scripts/check-lockfile.js to verify that all dependencies declared in workspace package.json files match the versions resolved in package-lock.json. This prevents lockfile desynchronization regressions that break offline and hermetic builds (such as Nix and sandboxed package managers).
6581465 to
931150a
Compare
TLDR
Synchronize workspace
package.jsondependency versions withpackage-lock.jsonand extendscripts/check-lockfile.jsto prevent lockfile version desynchronization across workspaces in CI.Dive Deeper
Similar to PR #3501 and PR #5336, hermetic downstream build tools (such as Nix and sandboxed package managers) rely on fixed-output derivations and pruned packument caches. When a dependency is pinned to an exact version in a workspace
package.json(such astar: 7.5.8orclipboardy: 5.2.0), but the lockednode_modulestree resolves to a newer patch (such as7.5.11or5.2.1), offlinenpm cifails withETARGET: No matching version found for tar@7.5.8.Additionally,
packages/vscode-ide-companion/node_modules/typescriptresolved to5.9.3instead of the root-hoisted5.8.3, triggering peer dependency warnings (ERESOLVE) against@typescript-eslint/eslint-plugin@8.31.1(peer typescript <5.9.0).This PR:
package.jsonfiles with the locked versions inpackage-lock.json(tar: 7.5.11,clipboardy: 5.2.1).vitestinpackages/a2a-serverandpackages/sdkandtypescriptinvscode-ide-companionto their root monorepo counterparts (3.2.4and5.8.3respectively), resolving the peer dependency conflict.scripts/check-lockfile.jsto ensure CI automatically checks that workspacepackage.jsondeclared dependencies match the versions resolved inpackage-lock.json.Reviewer Test Plan
npm run check:lockfilepasses:Testing Matrix