From de6ff5cb0dcada9b80b8249db487a30ebbe0e8b4 Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Thu, 13 Jun 2024 13:11:38 +0200 Subject: [PATCH] fix: update fields for abbreviated manifest (#4674) --- .changeset/rich-shrimps-check.md | 6 ++++++ packages/core/types/src/manifest.ts | 12 +++++++++++- packages/store/src/storage.ts | 5 ++++- packages/store/test/storage.spec.ts | 5 ++++- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 .changeset/rich-shrimps-check.md diff --git a/.changeset/rich-shrimps-check.md b/.changeset/rich-shrimps-check.md new file mode 100644 index 000000000..27ee0c808 --- /dev/null +++ b/.changeset/rich-shrimps-check.md @@ -0,0 +1,6 @@ +--- +'@verdaccio/types': patch +'@verdaccio/store': patch +--- + +fix: update fields for abbreviated manifest diff --git a/packages/core/types/src/manifest.ts b/packages/core/types/src/manifest.ts index fe719762b..26ed5e310 100644 --- a/packages/core/types/src/manifest.ts +++ b/packages/core/types/src/manifest.ts @@ -124,6 +124,7 @@ export interface Version { optionalDependencies?: Dependencies; peerDependenciesMeta?: PeerDependenciesMeta; bundleDependencies?: Dependencies; + acceptDependencies?: Dependencies; keywords?: string | string[]; nodeVersion?: string; _id: string; @@ -180,6 +181,7 @@ export interface FullRemoteManifest { versions: Versions; /** store owners of this package */ maintainers?: Author[]; + contributors?: Author[]; /** store the latest readme **/ readme?: string; /** store star assigned to this packages by users */ @@ -224,7 +226,6 @@ export type AbbreviatedVersion = Pick< Version, | 'name' | 'version' - | 'description' | 'dependencies' | 'devDependencies' | 'bin' @@ -232,6 +233,15 @@ export type AbbreviatedVersion = Pick< | 'engines' | 'funding' | 'peerDependencies' + | 'cpu' + | 'deprecated' + | 'directories' + | 'hasInstallScript' + | 'optionalDependencies' + | 'os' + | 'peerDependenciesMeta' + | 'acceptDependencies' + | '_hasShrinkwrap' >; export interface AbbreviatedVersions { diff --git a/packages/store/src/storage.ts b/packages/store/src/storage.ts index 2c06fcbdc..3d9094efa 100644 --- a/packages/store/src/storage.ts +++ b/packages/store/src/storage.ts @@ -524,7 +524,6 @@ class Storage { const _version_abbreviated = { name: _version.name, version: _version.version, - description: _version.description, deprecated: _version.deprecated, bin: _version.bin, dist: _version.dist, @@ -536,6 +535,10 @@ class Storage { peerDependencies: _version.peerDependencies, optionalDependencies: _version.optionalDependencies, bundleDependencies: _version.bundleDependencies, + cpu: _version.cpu, + os: _version.os, + peerDependenciesMeta: _version.peerDependenciesMeta, + acceptDependencies: _version.acceptDependencies, // npm cli specifics _hasShrinkwrap: _version._hasShrinkwrap, hasInstallScript: _version.hasInstallScript, diff --git a/packages/store/test/storage.spec.ts b/packages/store/test/storage.spec.ts index 9292d044b..a1624c9a0 100644 --- a/packages/store/test/storage.spec.ts +++ b/packages/store/test/storage.spec.ts @@ -1894,7 +1894,6 @@ describe('storage', () => { expect(Object.keys(version)).toEqual([ 'name', 'version', - 'description', 'deprecated', 'bin', 'dist', @@ -1906,6 +1905,10 @@ describe('storage', () => { 'peerDependencies', 'optionalDependencies', 'bundleDependencies', + 'cpu', + 'os', + 'peerDependenciesMeta', + 'acceptDependencies', '_hasShrinkwrap', 'hasInstallScript', ]);