Closed jsumners-nr closed 8 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.81%. Comparing base (
02f7bce
) to head (e51abcd
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR resolves #205.
Proposed Release Notes
Migrated to using prebuildify and node-gyp-install.
Links
Details
Utilizing prebuildify and node-gyp-install allows us to remove all of the custom code around checking for a local binary and downloading one from an S3 bucket if a binary isn't found. This is accomplished by bundling a binary for all known supported platforms within the npm package. If the module is installed on a platform we have not bundled a binary for, then node-gyp-install will run the build locally as per normal node-gyp. Additionally, if anyone wants to force a build, they can
npm install --build-from-source
.Notice: the
create-release.yml
workflow does not directly use the one fromnewrelic/node-newrelic
. We need to do some extra steps to 1. build the binaries, 2. grab them from the GHA artifacts cache, 3. construct a project structure with the binaries andnpm pack
to build the shippable module, and 4. grab the packed module from the GHA actions cache and then publish it to npmjs.com.The process can be seen in this dry run. The npm-module artifact from that run can be downloaded and:
unzip npm-module.zip
mkdir foo && cd foo && npm init && npm install ../newrelic-*.tgz
echo -e "const nr = require('@newrelic/native-metrics')\nconsole.log(nr)" > index.js
node index.js
You'll see the serialized representation of the exported module since the prebuilt binary gets loaded from the
require
line 😁