Skip to content

fix: ship LICENSE, NOTICE and README in the published packages - #1226

Open
justFU7 wants to merge 11 commits into
asyncapi:masterfrom
justFU7:fix/ship-license-notice-readme
Open

fix: ship LICENSE, NOTICE and README in the published packages#1226
justFU7 wants to merge 11 commits into
asyncapi:masterfrom
justFU7:fix/ship-license-notice-readme

Conversation

@justFU7

@justFU7 justFU7 commented Aug 17, 2026

Copy link
Copy Markdown

Description

The published packages of this monorepo are missing their legal files, and two of the three are missing
their README as well.

Each manifest asks for them:

"files": ["/esm", "/cjs", "/browser", "LICENSE", "README.md"]

but those paths resolve relative to packages/<pkg>/, and LICENSE, NOTICE and (for two of the three
packages) README.md exist only at the repository root, so npm has nothing to match and packs neither.

Evidence from the published artifacts

Listing the current tarballs, everything outside esm/, cjs/ and browser/:

package version files at the tarball root
@asyncapi/parser 3.6.3 package.json
@asyncapi/multi-parser 2.4.0 package.json
@asyncapi/openapi-schema-parser 3.1.0 package.json, README.md
$ curl -sLO https://registry.npmjs.org/@asyncapi/parser/-/parser-3.6.3.tgz
$ tar tzf parser-3.6.3.tgz | grep -vE "^package/(esm|cjs|browser)/"
package/package.json

So no package ships a LICENSE or a NOTICE, and only openapi-schema-parser ships a README.

Why it matters

Apache-2.0 section 4(a) requires a copy of the licence to accompany each distribution of the work, and 4(d)
requires the NOTICE attributions to travel with it. The npm tarball is how essentially every consumer
receives these packages, and it currently carries neither. Separately, @asyncapi/parser and
@asyncapi/multi-parser render with no README on npmjs.com.

Changes

  • new scripts/copy-legal.js, copying the root LICENSE and NOTICE into the package being published, plus
    the root README.md only when the package does not ship one of its own (so
    openapi-schema-parser’s README is left alone);
  • each package runs it from prepublishOnly, so the files exist by the time npm packs;
  • NOTICE added to each files array next to the LICENSE entry that was already there;
  • the copied files are gitignored per package.

No new dependency - prepublishOnly already existed in all three manifests, this only prepends one step.

Verifying

npm -w @asyncapi/parser run copy:legal && npm pack -w @asyncapi/parser --dry-run

LICENSE, NOTICE and README.md now appear in the pack listing.

@changeset-bot

changeset-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: afdb541

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@asyncapi/parser Patch
@asyncapi/multi-parser Patch
@asyncapi/openapi-schema-parser Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant