chore: set up 3rd-party license generation#11640
Conversation
8706ce6 to
18411cf
Compare
18411cf to
dd3de94
Compare
benelan
left a comment
There was a problem hiding this comment.
Nice this looks good! So we have to remember to rerun that script whenever a dependency gets added to any of the packages, right?
I wonder if we should automatically run the script before publishing just in case we forget at some point. At least that way the package's license will be included.
You could run the script and git add **/THIRD-PARTY-LICENSES.md before committing here:
calcite-design-system/.github/workflows/deploy-latest.yml
Lines 75 to 89 in c88a31f
| "@esri/eslint-plugin-calcite-components", | ||
| ]; | ||
|
|
||
| const licenses = await getProjectLicenses(".package.json", { |
There was a problem hiding this comment.
Should this be "./package.json" or "package.json"?
There was a problem hiding this comment.
Oh, good catch. 🎣 It seems that generate-license-file's file path logic was unintentionally handling this case.
Great idea. I've updated the |
* origin/dev: (80 commits) build(deps): update nx monorepo to v20.4.6 (#11662) build(deps): update arcgis to ^4.32.7 (#11648) build: update browserslist db (#11639) build(deps): update eslint (#11670) build(deps): update dependency chromatic to v11.26.1 (#11669) build(deps): update dependency rollup to v4.34.9 (#11661) build(deps): update dependency tsx to v4.19.3 (#11658) chore: release next docs(text-area): update limitText description (#11672) feat(block, block-section): add `expanded` property and deprecate `open` property (#11582) feat(list-item, list): add `expanded` property and deprecate `open` property (#11003) chore: release next fix(tabs): redisplay close button when more than one tab is closable (#11492) test(shell-panel): Fix token story set up (#11635) chore: set up 3rd-party license generation (#11640) build(deps): update dependency happy-dom to v17.1.8 (#11649) build(deps): update dependency prettier to v3.5.2 (#11642) build(deps): update dependency happy-dom to v17.1.6 (#11641) chore: release next fix(card-group): Restore default gap spacing (#11638) ...
**Related Issue:** #11640 ## Summary Apparently [`generate-license-file`](https://www.npmjs.com/package/generate-license-file) installs our packages locally somewhere in order to generate the 3rd party licenses. The licenses script uses the version in `package.json`, so running it before publishing causes the following [error], since the version doesn't exist yet: ```text Error: Command failed: npm install --no-workspaces npm error code ETARGET npm error notarget No matching version found for @esri/calcite-components@3.1.0. npm error notarget In most cases you or one of your dependencies are requesting npm error notarget a package version that doesn't exist. ``` This moves the 3rd party license generation to the scheduled workflow. A pull request will be created with any licensing changes. [error]: https://github.com/Esri/calcite-design-system/actions/runs/14076068483/job/39419195501#step:5:1288
**Related Issue:** #11640 ## Summary Apparently [`generate-license-file`](https://www.npmjs.com/package/generate-license-file) installs our packages locally somewhere in order to generate the 3rd party licenses. The licenses script uses the version in `package.json`, so running it before publishing causes the following [error], since the version doesn't exist yet: ```text Error: Command failed: npm install --no-workspaces npm error code ETARGET npm error notarget No matching version found for @esri/calcite-components@3.1.0. npm error notarget In most cases you or one of your dependencies are requesting npm error notarget a package version that doesn't exist. ``` This moves the 3rd party license generation to the scheduled workflow. A pull request will be created with any licensing changes. [error]: https://github.com/Esri/calcite-design-system/actions/runs/14076068483/job/39419195501#step:5:1288
Related Issue: #11546
Summary
This adds a utility script that generates 3rd-party license information for each package.
Notes
THIRD-PARTY-LICENSES.md(TPL)@esri/eslint-config-calcitepackage)util:update-3rd-party-licenses) can be called from the monorepo root or from individual packagesgenerate-license-filegenerates licenses correctly, this script installsnode_modulesandpackage-lock.jsonlocally in each package (removed when finished)