Join Slack
Powered by
<#14 feat: create os/arch specific npm optional de...
# pact-js-development
g
GitHub
07/16/2024, 12:17 AM
#14 feat: create os/arch specific npm optional deps for pact-ruby-standalone
Pull request opened by
YOU54F
Motivation
Currently we provide a fat npm package, with the associated pact ruby standalone library for each supported os/arch combo. It would be neat to leverage the NPM ecosystems optional dependencies and os/arch resolver, in order to reduce the payload delivered for any particular install (which will be for a single os/arch system anyway when executed)
Related issues
•
npm/npm#17722
•
npm/cli#4828
Approach
As documented in
https://blog.orhun.dev/packaging-rust-for-npm/
Related repo -
https://github.com/orhun/packaging-rust-for-npm
• updates version number of package.json to required level (patch/minor/major) • downloads standalone for all os/arch combos • creates os/arch specific npm package and moves relevant os/arch standalone bindings into package. uses version number of current main npm package • npm link os/arch specific npm package • npm build and test project • publish all os/arch specific npm packages to npm • update main package.json to reflect updated os/arch npm package version numbers • publishes main npm package
Testing
• 190 MB
https://www.npmjs.com/package/@pact-foundation/pact-cli
• 280kb
https://www.npmjs.com/package/@you54f/pact-cli?activeTab=versions
my target platform darwin-arm64 • 39.8mb
https://www.npmjs.com/package/@you54f/pact-cli-darwin-arm64
npx --package=@you54f/pact-cli@17.0.0 -c 'pact-broker version'
npx --package=@you54f/pact-cli@17.0.0 -c 'pact-broker version' 1.75.3
pact-foundation/pact-js-cli
✅ All checks have passed 10/10 successful checks
Open in Slack
Previous
Next