Skip to content

Conversation

@rbarker-dev
Copy link
Member

@rbarker-dev rbarker-dev commented Sep 9, 2025

Description

This pull request makes dependency management more consistent and predictable across the rest/check-state-proof and rest/monitoring packages by enforcing exact versioning for dependencies and updating several dependency versions and peer dependencies. The changes help ensure reproducible builds and reduce the risk of unexpected issues due to unintentional dependency upgrades.

Dependency management improvements:

  • Added save-exact=true to .npmrc files in rest/, rest/check-state-proof/, and rest/monitoring/ to enforce exact dependency versioning for future installs.
  • Updated all dependency and devDependency versions in package.json and package-lock.json for both rest/check-state-proof and rest/monitoring to use exact versions instead of version ranges (e.g., "^1.2.3""1.2.3"). [1] [2] [3]
  • Added and updated peerDependencies in both packages to explicitly require certain versions of shared libraries (such as chalk, ansi-styles, debug, is-arrayish, strip-ansi, wrap-ansi, etc.), improving compatibility and clarity for consumers. [1] [2] [3]

Dependency version updates and cleanups:

  • Updated or replaced specific versions of transitive dependencies in package-lock.json, including upgrades and removals (e.g., wrap-ansi, is-arrayish, protobufjs, and related dependencies), and removed redundant or outdated nested dependencies. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17]

These changes together make dependency management more robust and predictable for these packages.

Related issue(s)

Fixes #11964

Related Testing

@rbarker-dev rbarker-dev self-assigned this Sep 9, 2025
@rbarker-dev rbarker-dev added the dependencies Type: Pull requests that update a dependency file label Sep 9, 2025
@rbarker-dev rbarker-dev requested a review from a team as a code owner September 9, 2025 19:13
@rbarker-dev rbarker-dev linked an issue Sep 9, 2025 that may be closed by this pull request
@lfdt-bot
Copy link

lfdt-bot commented Sep 9, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@codacy-production
Copy link

codacy-production bot commented Sep 9, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
-31.53% (target: -1.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (245a69c) 36775 33493 91.08%
Head commit (e984723) 60784 (+24009) 36195 (+2702) 59.55% (-31.53%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#11965) 0 0 ∅ (not applicable)

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

@rbarker-dev rbarker-dev marked this pull request as draft September 10, 2025 18:29
@rbarker-dev rbarker-dev force-pushed the 11964-pin-third-party-dependencies-in-node-packages branch from 4e1d4ff to fc3ac0a Compare September 24, 2025 15:27
@rbarker-dev rbarker-dev marked this pull request as ready for review September 24, 2025 15:58
andrewb1269
andrewb1269 previously approved these changes Sep 24, 2025
@steven-sheehy steven-sheehy added this to the 0.140.0 milestone Sep 24, 2025
Copy link
Contributor

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have other NPM packages in the tools/ folder. Shouldn't we handle those as well?

Comment on lines +34 to +41
"peerDependencies": {
"ansi-styles": "6.2.3",
"ansi-regex": "6.2.2",
"strip-ansi": "7.1.2",
"debug": "4.4.1",
"chalk": "5.6.2",
"wrap-ansi": "9.0.2",
"is-arrayish": "0.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need to put these here if we don't even use most of them? Shouldn't we just put the actual transitive packages we use? Same comment for other package.jsons

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each of these were present in the lock files when we reviewed them. That's why we've added these in here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. On main, rest/monitoring/package.json only uses debug out of the above list. So shouldn't peerDependencies only contain debug instead of a bunch of unused and irrelevant dependencies?

Signed-off-by: Andrew Brandt <[email protected]>
@andrewb1269
Copy link
Contributor

@steven-sheehy please re-review when you get a chance, thank you!

@steven-sheehy
Copy link
Contributor

steven-sheehy commented Sep 26, 2025

So we're not going to update the tools folder as well? Or will that be a separate PR?

Comment on lines +71 to +77
"ansi-styles": "6.2.3",
"ansi-regex": "6.2.2",
"strip-ansi": "7.1.2",
"debug": "4.4.1",
"chalk": "5.6.2",
"wrap-ansi": "9.0.2",
"is-arrayish": "0.3.2"
Copy link
Contributor

@steven-sheehy steven-sheehy Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On main, only debug and chalk are in this package-lock.json

Comment on lines +34 to +41
"peerDependencies": {
"ansi-styles": "6.2.3",
"ansi-regex": "6.2.2",
"strip-ansi": "7.1.2",
"debug": "4.4.1",
"chalk": "5.6.2",
"wrap-ansi": "9.0.2",
"is-arrayish": "0.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean. On main, rest/monitoring/package.json only uses debug out of the above list. So shouldn't peerDependencies only contain debug instead of a bunch of unused and irrelevant dependencies?

@steven-sheehy steven-sheehy removed this from the 0.140.0 milestone Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Type: Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin third party dependencies in node packages

5 participants