philip-x-rutkowski-intel-com
6487d14855
enhance(packages/npm): expand version metadata and support npm deprecate ( #37890 )
...
Fixes #21624
Adds the npm package version metadata fields that Gitea's npm registry
was previously dropping on publish, and implements the `npm deprecate`
command, which Gitea did not accept before.
### New / pass-through metadata fields
The following are now parsed from the publish payload, persisted in the
stored `npm.Metadata`, and re-emitted on the abbreviated version
manifest returned to npm clients:
- `hasInstallScript` — auto-detected from `scripts.preinstall` /
`scripts.install` / `scripts.postinstall` (also honors a client-supplied
value). Without this flag, `npm install` skips lifecycle scripts.
- `_hasShrinkwrap` — authoritatively derived by inspecting the uploaded
tarball for a top-level `*/npm-shrinkwrap.json` entry. Client-supplied
values are ignored. Decompression failures fall back to `false` and do
not block publish (integrity has already been validated).
- `engines` (`map[string]string`)
- `cpu`, `os` (`[]string`)
- `directories` (`map[string]string`)
- `funding` (`any`; preserves the spec's string / object / array shape)
- `acceptDependencies` (`map[string]string`)
- `deprecated` (`string`)
`peerDependenciesMeta` was already in the stored struct but is now
exercised
by tests.
### `npm deprecate` support
`npm deprecate <pkg-spec> <message>` PUTs the package document to the
same URL as publish but with no `_attachments`. The router now detects
that shape and routes to a new handler that updates each affected
version's stored `Metadata.Deprecated` via
`packages_model.UpdateVersion`. An empty message clears the flag
(undeprecate). Unknown versions are silently skipped, matching npm's
behavior. No new routes were added.
Supported invocations include:
- `npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"`
- `npm deprecate my-thing@1.x "1.x is no longer supported"`
- `npm deprecate my-thing@1.0.0 ""` (undeprecate)
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com >
Co-authored-by: bircni <bircni@icloud.com >
2026-08-03 05:26:08 +00:00
..
2026-04-23 15:18:53 +00:00
2026-07-20 03:42:02 +00:00
2026-06-08 20:07:15 +00:00
2026-06-08 20:07:15 +00:00
2026-06-27 17:56:12 +00:00
2026-05-27 16:23:44 -07:00
2026-07-30 09:13:47 +00:00
2026-05-26 15:49:31 -07:00
2026-05-27 16:23:44 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-28 05:19:46 +02:00
2026-05-27 16:23:44 -07:00
2026-07-25 16:07:40 +00:00
2026-07-22 20:54:51 +00:00
2026-06-08 19:11:00 +00:00
2026-07-15 02:36:03 +00:00
2026-07-25 21:31:19 +00:00
2026-05-27 16:23:44 -07:00
2026-07-27 17:45:27 +00:00
2026-07-01 21:47:47 +02:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-06-27 12:09:01 +00:00
2026-07-26 17:26:02 +00:00
2026-06-08 19:11:00 +00:00
2026-05-27 16:23:44 -07:00
2026-05-26 15:49:31 -07:00
2026-08-02 12:22:07 +08:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-10 17:34:10 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-29 01:12:11 +00:00
2026-07-25 20:39:36 +08:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-09 06:12:09 +00:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-17 06:39:22 +00:00
2026-07-16 17:38:33 +00:00
2026-07-16 11:51:36 +02:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-29 01:12:11 +00:00
2026-05-26 15:49:31 -07:00
2026-08-03 05:26:08 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-31 10:40:17 +00:00
2026-05-26 15:49:31 -07:00
2026-06-17 06:39:22 +00:00
2026-06-03 16:21:48 -07:00
2026-05-26 15:49:31 -07:00
2026-06-24 05:38:02 +00:00
2026-07-20 16:07:38 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-07-01 20:43:46 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-31 11:05:41 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-09 06:12:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-10 19:30:43 +02:00
2026-05-26 15:49:31 -07:00
2026-06-14 20:05:18 +02:00
2026-07-12 17:14:09 +00:00
2026-06-17 16:06:51 +00:00
2026-06-17 06:39:22 +00:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-08 16:58:42 +08:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-16 17:38:33 +00:00
2026-05-26 15:49:31 -07:00
2026-07-10 19:30:43 +02:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-03 20:07:37 +02:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-07-08 00:16:32 +00:00
2026-07-20 16:07:38 +00:00
2026-06-29 15:10:47 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-18 12:02:11 +00:00
2026-05-26 15:49:31 -07:00
2026-05-29 01:12:11 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-17 06:50:25 +02:00
2026-07-12 17:14:09 +00:00
2026-07-28 17:04:22 +00:00
2026-07-20 16:07:38 +00:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-06-13 12:02:02 +08:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-07-16 21:38:39 +00:00
2026-05-26 15:49:31 -07:00
2026-06-18 12:02:11 +00:00
2026-05-26 15:49:31 -07:00
2026-07-23 14:31:29 +00:00
2026-07-12 17:14:09 +00:00
2026-07-30 21:09:32 +02:00
2026-05-26 15:49:31 -07:00
2026-07-31 11:05:41 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-31 14:16:27 +00:00
2026-05-26 15:49:31 -07:00
2026-06-12 08:36:05 +08:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-07-12 17:14:09 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-07 14:40:12 +08:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-28 17:04:22 +00:00
2026-08-02 21:30:59 +00:00
2026-07-11 19:36:10 +02:00
2026-07-20 16:07:38 +00:00
2026-07-04 15:02:17 +02:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-08 17:16:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-12 17:14:09 +00:00
2026-06-17 16:06:51 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-30 21:09:32 +02:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-31 11:31:17 +00:00
2026-07-28 17:04:22 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-07-27 07:46:00 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-18 12:02:11 +00:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-05-26 15:49:31 -07:00
2026-06-06 11:06:08 +00:00
2026-06-11 17:12:30 +00:00