Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: set up 3rd-party license generation #11640

Merged
merged 5 commits into from
Mar 1, 2025

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Feb 27, 2025

Related Issue: #11546

Summary

This adds a utility script that generates 3rd-party license information for each package.

Notes

  • file name is THIRD-PARTY-LICENSES.md (TPL)
  • TPL is referenced in each package's README
  • all packages are set up to generate a TPL (except the internal @esri/eslint-config-calcite package)
    • if there are no 3rd-party dependencies, it will display an appropriate message
  • relies on https://www.npmjs.com/package/generate-license-file
  • packages will now include TPL when published
  • util script (util:update-3rd-party-licenses) can be called from the monorepo root or from individual packages

@github-actions github-actions bot added the chore Issues with changes that don't modify src or test files. label Feb 27, 2025
@jcfranco jcfranco added the skip visual snapshots Pull requests that do not need visual regression testing. label Feb 27, 2025
@jcfranco jcfranco force-pushed the jcfranco/11546-add-third-party-copyright-licensing branch 3 times, most recently from 8706ce6 to 18411cf Compare February 27, 2025 20:22
@jcfranco jcfranco force-pushed the jcfranco/11546-add-third-party-copyright-licensing branch from 18411cf to dd3de94 Compare February 27, 2025 20:39
@jcfranco jcfranco marked this pull request as ready for review February 27, 2025 23:09
Copy link
Member

@benelan benelan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

# The "|| true" prevents failure if there are no changes
git add package-lock.json || true
# The release-please PR only updates when there are new deployable
# commits, e.g., fixes, features, or breaking changes. This is fine
# but it means autogenerated files can become outdated.
#
# Lerna will only publish when the working tree is clean, so changes
# to autogenerated files cause the release to fail.
#
# The workaround is to commit the files before releasing so everything
# will be up to date in the dists. The commit will be discarded once
# the container is destroyed, and then the autogenerated files will be
# updated in a subsequent PR.
git commit -m "build(deps): update package-lock" || true

"@esri/eslint-plugin-calcite-components",
];

const licenses = await getProjectLicenses(".package.json", {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "./package.json" or "package.json"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch. 🎣 It seems that generate-license-file's file path logic was unintentionally handling this case.

@jcfranco
Copy link
Member Author

jcfranco commented Mar 1, 2025

You could run the script and git add **/THIRD-PARTY-LICENSES.md before committing here:

Great idea. I've updated the deploy-next action to run the script and stage the license files as suggested. LMK if further tweaks are needed.

@jcfranco jcfranco merged commit 56adcf8 into dev Mar 1, 2025
10 checks passed
@jcfranco jcfranco deleted the jcfranco/11546-add-third-party-copyright-licensing branch March 1, 2025 22:29
benelan added a commit that referenced this pull request Mar 6, 2025
* 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)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issues with changes that don't modify src or test files. skip visual snapshots Pull requests that do not need visual regression testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants