Skip to content

Extract shared Node.js types into nodejs-data crate#1328

Merged
colincasey merged 5 commits intomainfrom
ccasey/nodejs-data-crate
Apr 7, 2026
Merged

Extract shared Node.js types into nodejs-data crate#1328
colincasey merged 5 commits intomainfrom
ccasey/nodejs-data-crate

Conversation

@colincasey
Copy link
Copy Markdown
Contributor

@colincasey colincasey commented Mar 20, 2026

Summary

  • Creates crates/nodejs-data with shared Version, Range, NodejsArtifact, and NodejsInventory types
  • Migrates the CNB buildpack off src/utils/vrs.rs to use nodejs-data
  • Migrates the xtask inventory updater to use nodejs-data types
  • Removes direct node-semver dependency from both CNB and xtask (now transitive via nodejs-data)
  • No behavioral changes — pure type extraction and rename (RequirementRange)

Test plan

  • cargo clippy --all-targets --locked -- --deny warnings passes
  • cargo test passes
  • No snapshot changes (note - a new version of npm was released since main last updated snapshots so there is one snapshot change but only for version information)

W-21451605

@colincasey colincasey self-assigned this Mar 20, 2026
@colincasey colincasey marked this pull request as ready for review March 20, 2026 16:56
@colincasey colincasey requested a review from a team as a code owner March 20, 2026 16:56
Comment thread crates/nodejs-data/src/lib.rs Outdated
Malax
Malax previously requested changes Apr 2, 2026
Copy link
Copy Markdown
Member

@Malax Malax left a comment

Choose a reason for hiding this comment

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

This PR unfortunately does more than just moving the types around - it also contains the parts of the implementation for #1330. We need to split this up.

@colincasey colincasey force-pushed the ccasey/nodejs-data-crate branch from fbc651d to 5fad153 Compare April 2, 2026 18:56
@colincasey
Copy link
Copy Markdown
Contributor Author

That was in error @Malax. Meant to pull those changes into #1330. That's fixed now with the latest push.

@colincasey colincasey changed the base branch from main to ccasey/update-fixtures April 2, 2026 19:59
@colincasey colincasey force-pushed the ccasey/nodejs-data-crate branch from 5fad153 to 0aac35d Compare April 2, 2026 20:01
@runesoerensen runesoerensen dismissed Malax’s stale review April 6, 2026 02:32

This has been addressed now (see #1328 (comment))

Base automatically changed from ccasey/update-fixtures to main April 6, 2026 16:31
Replace local `src/utils/vrs.rs` module with shared types from the
`nodejs-data` crate. Renames `Requirement` to `Range` throughout and
re-exports `NodejsArtifact`/`NodejsInventory` from the shared crate.
Removes the `DefaultNodeRequirement` wrapper since `Range` now captures
the original string in its Display impl.
@colincasey colincasey force-pushed the ccasey/nodejs-data-crate branch from 0aac35d to b40843b Compare April 6, 2026 16:35
@colincasey colincasey merged commit 2b065e9 into main Apr 7, 2026
7 checks passed
@colincasey colincasey deleted the ccasey/nodejs-data-crate branch April 7, 2026 18:51
heroku-linguist Bot added a commit that referenced this pull request Apr 9, 2026
## heroku/nodejs

### Added

- Warn when deploying with end-of-life Node.js versions. ([#1353](#1353))

### Changed

- Extracted shared Node.js version types into `nodejs-data` crate. ([#1328](#1328))
@heroku-linguist heroku-linguist Bot mentioned this pull request Apr 9, 2026
heroku-linguist Bot added a commit to heroku/cnb-builder-images that referenced this pull request Apr 9, 2026
## heroku/nodejs

### Added

- Warn when deploying with end-of-life Node.js versions. ([#1353](heroku/buildpacks-nodejs#1353))

### Changed

- Extracted shared Node.js version types into `nodejs-data` crate. ([#1328](heroku/buildpacks-nodejs#1328))
heroku-linguist Bot added a commit to heroku/cnb-builder-images that referenced this pull request Apr 9, 2026
## heroku/nodejs

### Added

- Warn when deploying with end-of-life Node.js versions. ([#1353](heroku/buildpacks-nodejs#1353))

### Changed

- Extracted shared Node.js version types into `nodejs-data` crate. ([#1328](heroku/buildpacks-nodejs#1328))

Co-authored-by: heroku-linguist[bot] <136119646+heroku-linguist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants