Skip to content

feat: create os/arch specific npm optional deps for pact-ruby-standalone#14

Merged
YOU54F merged 1 commit intopact-foundation:mainfrom
YOU54F:feat/opt_deps_platform_specific
Sep 6, 2024
Merged

feat: create os/arch specific npm optional deps for pact-ruby-standalone#14
YOU54F merged 1 commit intopact-foundation:mainfrom
YOU54F:feat/opt_deps_platform_specific

Conversation

@YOU54F
Copy link
Member

@YOU54F YOU54F commented Jul 16, 2024

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

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

my target platform 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

@YOU54F YOU54F merged commit 5050e80 into pact-foundation:main Sep 6, 2024
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.

1 participant