Repository navigation
Conversation
The script reads the sourcemaps of the identifier build, walks up from
each bundled source to the nearest package.json and takes the license
from there. make dist puts its output into the 3rdparty-LICENSES.md of
the release tarball.
react-i18next ships dist/es/package.json, a file without a name which
only sets the module type of that directory. findLicense special-cased
such a file only when it held nothing but type and version, and then
returned no entry. With react-i18next 17.0.16, whose file is
{"type":"module","version":"17.0.16"}, the package was therefore
skipped silently: the license document of master has 43 entries and
lacks react-i18next, although it ships in the bundle under MIT.
react-i18next 17.1.x adds sideEffects to that file. The special case no
longer matches, the script looks for a license in dist/es, finds none
and throws "no license found: ./node_modules/react-i18next/dist/es",
which fails make licenses in the build of Dependabot PR libregraph#293.
A package.json without a name is not a package root, Node uses such
files only to scope the module type. findModuleViaPackageJSON now skips
them and keeps walking up. Such files are common, for example in
tiny-invariant/dist/esm, @emotion/styled/base and lru-cache/dist/*.
This makes the type module case in findLicense and the popping of a
trailing esm directory obsolete, so both are removed. The revision
record goes to 20261110-1.
With the dependencies of master the output is identical but for the
new react-i18next entry with its MIT license, 44 entries in all.
@emotion/styled/base now resolves to @emotion/styled, which is already
listed with the same license. With react-i18next 17.1.13 the script
exits 0, lists react-i18next and skips no package.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The script reads the sourcemaps of the identifier build, walks up from each bundled source to the nearest package.json and takes the license from there. make dist puts its output into the 3rdparty-LICENSES.md of the release tarball.
react-i18next ships dist/es/package.json, a file without a name which only sets the module type of that directory. findLicense special-cased such a file only when it held nothing but type and version, and then returned no entry. With react-i18next 17.0.16, whose file is {"type":"module","version":"17.0.16"}, the package was therefore skipped silently: the license document of master has 43 entries and lacks react-i18next, although it ships in the bundle under MIT.
react-i18next 17.1.x adds sideEffects to that file. The special case no longer matches, the script looks for a license in dist/es, finds none and throws "no license found: ./node_modules/react-i18next/dist/es", which fails make licenses in the build of Dependabot PR #293.
A package.json without a name is not a package root, Node uses such files only to scope the module type. findModuleViaPackageJSON now skips them and keeps walking up. Such files are common, for example in tiny-invariant/dist/esm, @emotion/styled/base and lru-cache/dist/*. This makes the type module case in findLicense and the popping of a trailing esm directory obsolete, so both are removed. The revision record goes to 20261110-1.
With the dependencies of master the output is identical but for the new react-i18next entry with its MIT license, 44 entries in all. @emotion/styled/base now resolves to @emotion/styled, which is already listed with the same license. With react-i18next 17.1.13 the script exits 0, lists react-i18next and skips no package.