Skip to content

Expose version property in public API - #1479

Merged
mhdawson merged 1 commit into
nodejs:mainfrom
lovell:expose-version-property
May 7, 2024
Merged

Expose version property in public API#1479
mhdawson merged 1 commit into
nodejs:mainfrom
lovell:expose-version-property

Conversation

@lovell

@lovelllovell commented Apr 17, 2024

Copy link
Copy Markdown
Contributor

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.

BEGIN_COMMIT_OVERRIDE
feat: Expose version property in public API (#1479)
END_COMMIT_OVERRIDE

@codecov-commenter

codecov-commenter commented Apr 17, 2024

Copy link
Copy Markdown

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.

Comment threadtest/exports.js
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.
@lovell
lovellforce-pushed the expose-version-property branch from 776991d to 92dc899CompareMay 1, 2024 10:38

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@mhdawsonmhdawson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@lovell@codecov-commenter@gabrielschulhof@legendecas@KevinEady@mhdawson