Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve license file reading logic (#5740)
* fix: improve license file reading logic If the file index is of the appropriate type so we can leverage the contents of `PackageFileInfo`-type we try to lookup the file mode to and pass it to the `readLicenseFileFromCafs`-function so it can be correctly passed to the underlying `getFilePathByModeInCafs`-function responsible for fetching the file from the PNPM store * test: add integration test for the problematic `svgicons2svgfont` Added a test to verify that the LICENSE files of the `svgicons2svgfont@5.0.2`-package and similar packages can be read without errors * refactor: license * docs: add changesets Co-authored-by: Weyert de Boer <weyert@innerfuse.biz> Co-authored-by: Zoltan Kochan <z@kochan.io>
- Loading branch information
1 parent
ef134a0
commit 5464e1d
Showing
6 changed files
with
237 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@pnpm/license-scanner": patch | ||
"@pnpm/plugin-commands-licenses": patch | ||
"pnpm": patch | ||
--- | ||
|
||
`pnpm license list` should not fail if a license file is an executable [#5740](https://github.com/pnpm/pnpm/pull/5740). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
reviewing/plugin-commands-licenses/test/fixtures/file-mode-test/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "pnpm-licenses-bug001", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"svgicons2svgfont": "5.0.2" | ||
} | ||
} |
134 changes: 134 additions & 0 deletions
134
reviewing/plugin-commands-licenses/test/fixtures/file-mode-test/pnpm-lock.yaml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters