Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose version property in public API #1479

Merged
merged 1 commit into from May 7, 2024

Conversation

lovell
Copy link
Contributor

@lovell lovell commented Apr 17, 2024

This PR contains a proposal to expose the package version property in the public API.

The version value is already used by the conversion tooling and is additionally useful in external contexts too, for example when specifying/detecting node-addon-api as an optional and/or peer dependency.

This would bring node-addon-api in line with node-gyp, which already exports require('node-gyp').version. The change in the PR will allow me to improve the install-time detecting/logging for node-addon-api within sharp.

It also adds a test with expectations for this property as well as all existing exported properties.

@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.71%. Comparing base (7391105) to head (92dc899).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1479   +/-   ##
=======================================
  Coverage   64.71%   64.71%           
=======================================
  Files           3        3           
  Lines        1981     1981           
  Branches      687      687           
=======================================
  Hits         1282     1282           
  Misses        138      138           
  Partials      561      561           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This value is already used in the conversion tooling and is useful
in external contexts too, for example when specifying/detecting
node-addon-api as an optional peer dependency.

Also adds test expectations for all exported properties.
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@mhdawson mhdawson merged commit 23bb42b into nodejs:main May 7, 2024
27 checks passed
@lovell lovell deleted the expose-version-property branch May 8, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants