From f3654916536f86be351b3cd35b911700e8c0b6d2 Mon Sep 17 00:00:00 2001 From: Emile Fugulin Date: Fri, 29 Jul 2022 14:17:39 -0400 Subject: [PATCH] fix: add author and license to list (#2825) close #5533 ref #2825 --- .changeset/hot-forks-tap.md | 6 ++++++ packages/list/src/getPkgInfo.ts | 2 ++ packages/list/test/index.ts | 6 ++++++ 3 files changed, 14 insertions(+) create mode 100644 .changeset/hot-forks-tap.md diff --git a/.changeset/hot-forks-tap.md b/.changeset/hot-forks-tap.md new file mode 100644 index 00000000000..c5d5302120a --- /dev/null +++ b/.changeset/hot-forks-tap.md @@ -0,0 +1,6 @@ +--- +"@pnpm/list": patch +"pnpm": patch +--- + +`pnpm list --long --json` should print licenses and authors of packagese [#5533](https://github.com/pnpm/pnpm/pull/5533). diff --git a/packages/list/src/getPkgInfo.ts b/packages/list/src/getPkgInfo.ts index db35f818e1f..210ef8a2b9c 100644 --- a/packages/list/src/getPkgInfo.ts +++ b/packages/list/src/getPkgInfo.ts @@ -28,6 +28,8 @@ export async function getPkgInfo ( resolved: pkg.resolved, description: manifest.description, + license: manifest.license, + author: manifest.author, homepage: manifest.homepage, repository: (manifest.repository && ( diff --git a/packages/list/test/index.ts b/packages/list/test/index.ts index 0590e20bc01..6d5ed0282bc 100644 --- a/packages/list/test/index.ts +++ b/packages/list/test/index.ts @@ -435,6 +435,12 @@ test('JSON list with aliased dep', async () => { resolved: 'https://registry.npmjs.org/is-positive/-/is-positive-1.0.0.tgz', description: 'Test if a number is positive', + license: 'MIT', + author: { + name: 'Kevin Martensson', + email: 'kevinmartensson@gmail.com', + url: 'github.com/kevva', + }, homepage: 'https://github.com/kevva/is-positive#readme', repository: 'git+https://github.com/kevva/is-positive.git', },