Packages which are distributed with lerna are often do not include a LICENSE file, this makes consuming packages that use lerna tricky as the license file and copyright notice are not included in the NPM distribution. Tools such as license-checker won't be able to find the license file and respective copyright notice and author.
NPM would normally include files such as the LICENSE file in the NPM distribution. When running npm pack or such the license will be included in the created tarball.
Certain files are always included, regardless of settings:
- README
- CHANGES / CHANGELOG / HISTORY
- LICENSE / LICENCE
- NOTICE
From https://docs.npmjs.com/files/package.json#files.
The common pattern I've seen in libraries using lerna is that the LICENSE file is found in the root of the repository. Since lerna will publish each package in the package/ directory, the package inside repository doesn't contain a copy of the LICENSE.
You can see this in babel, the repository contains a LICENSE file, and package such as babel-runtime on NPM (tarball: https://registry.npmjs.org/babel-runtime/-/babel-runtime-7.0.0-beta.2.tgz) will not have any license file.
I am wondering if there is an automated way that this problem can be solved and the project LICENSE can be present in the distributed NPM tarball. Perhaps in lerna publish the license could be injected into the package?
Packages which are distributed with lerna are often do not include a LICENSE file, this makes consuming packages that use lerna tricky as the license file and copyright notice are not included in the NPM distribution. Tools such as license-checker won't be able to find the license file and respective copyright notice and author.
NPM would normally include files such as the LICENSE file in the NPM distribution. When running
npm packor such the license will be included in the created tarball.From https://docs.npmjs.com/files/package.json#files.
The common pattern I've seen in libraries using lerna is that the LICENSE file is found in the root of the repository. Since lerna will publish each package in the
package/directory, the package inside repository doesn't contain a copy of the LICENSE.You can see this in babel, the repository contains a LICENSE file, and package such as babel-runtime on NPM (tarball: https://registry.npmjs.org/babel-runtime/-/babel-runtime-7.0.0-beta.2.tgz) will not have any license file.
I am wondering if there is an automated way that this problem can be solved and the project LICENSE can be present in the distributed NPM tarball. Perhaps in
lerna publishthe license could be injected into the package?