gitea/modules/packages
eleith 169c08e20a
support binary deploy in npm packages (#21589)
backport of #21372 for v1.17.4

-------------------

npm package.json supports binary packaging:
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#bin

the npm registry documents that the binary references will be attached
to the abbreviated version object:

https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-object

unfortunately their api documentation leaves this out:
https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#abbreviated-version-objectdoc

which is likely to be the reason this was left out in gitea's initial
implementation

this response is critical for npm to install the binary in the .bin
folder so as to be included on the users default bin path, resulting in
immediate access to any binaries provided by the package

i have tested upload and installing through npm and can confirm the npm
registry now responds with bin in the version metadata and results in
the binary being available after install.

this fixes https://github.com/go-gitea/gitea/issues/21303

Co-authored-by: eleith <online-github@eleith.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2022-10-25 14:13:27 +08:00
..
composer Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
conan Allow non-semver packages in the Conan package registry (#20412) (#20523) 2022-07-28 21:19:56 +01:00
container Fix empty container layer history and UI (#21251) (#21278) 2022-09-27 23:10:19 +08:00
helm Add Helm Chart registry (#19406) 2022-04-19 12:55:35 -04:00
maven Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
npm support binary deploy in npm packages (#21589) 2022-10-25 14:13:27 +08:00
nuget Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
pypi Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
rubygems Fix Ruby package parsing by removed unused email field (#20470) (#20525) 2022-07-28 20:41:57 +02:00
content_store.go Add migrate repo archiver and packages storage support on command line (#20757) (#20806) 2022-08-18 09:27:56 +08:00
hashed_buffer_test.go Fix package upload for files >32mb (#20622) (#20635) 2022-08-03 01:45:38 +03:00
hashed_buffer.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
multi_hasher_test.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00
multi_hasher.go Add Package Registry (#16510) 2022-03-30 16:42:47 +08:00