From cfe1b15cf53478268fde9879e63da1af45317c83 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:04 +0530 Subject: [PATCH 01/11] chore: add script copying root LICENSE/NOTICE/README into a package before pack --- scripts/copy-legal.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/copy-legal.js diff --git a/scripts/copy-legal.js b/scripts/copy-legal.js new file mode 100644 index 000000000..5deefdaf6 --- /dev/null +++ b/scripts/copy-legal.js @@ -0,0 +1,10 @@ +// Copy the monorepo-root legal and readme files into the package being published. +// npm only packs files that exist inside the package directory, so without this the published tarballs +// contain no LICENSE, no NOTICE and no README - see the "files" array in each packages/*/package.json. +const fs = require('fs'); +const path = require('path'); + +const root = path.join(__dirname, '..'); +for (const name of ['LICENSE', 'NOTICE', 'README.md']) { + fs.copyFileSync(path.join(root, name), path.join(process.cwd(), name)); +} From 8481a035267e120e4eafaad4db0855bede69e536 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:06 +0530 Subject: [PATCH 02/11] fix(parser): ship LICENSE, NOTICE and README in the published tarball --- packages/parser/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/parser/package.json b/packages/parser/package.json index 5957fa1c5..e1459afb1 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -24,6 +24,7 @@ "/cjs", "/browser", "LICENSE", + "NOTICE", "README.md" ], "scripts": { @@ -40,7 +41,8 @@ "generate:readme:toc": "markdown-toc -i \"../../README.md\"", "generate:assets": "npm run generate:readme:toc", "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", - "prepublishOnly": "npm run generate:assets" + "copy:legal": "node ../../scripts/copy-legal.js", + "prepublishOnly": "npm run copy:legal && npm run generate:assets" }, "dependencies": { "@asyncapi/specs": "^6.11.1", From 3692b98821065206bfd03c8387f5405fb35f82b4 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:07 +0530 Subject: [PATCH 03/11] chore(parser): ignore the legal files copied in at pack time --- packages/parser/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/parser/.gitignore b/packages/parser/.gitignore index 70f71a941..df85cfa8e 100644 --- a/packages/parser/.gitignore +++ b/packages/parser/.gitignore @@ -9,3 +9,8 @@ node_modules /browser *.tgz .turbo + +# copied from the repo root by prepublishOnly (scripts/copy-legal.js) +LICENSE +NOTICE +README.md From 391712eb9c05864252abff2e4117d991b38dc79a Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:09 +0530 Subject: [PATCH 04/11] fix(multi-parser): ship LICENSE, NOTICE and README in the published tarball --- packages/multi-parser/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/multi-parser/package.json b/packages/multi-parser/package.json index 5f9a15524..85f65ce69 100644 --- a/packages/multi-parser/package.json +++ b/packages/multi-parser/package.json @@ -23,6 +23,7 @@ "/esm", "/cjs", "LICENSE", + "NOTICE", "README.md" ], "scripts": { @@ -36,7 +37,8 @@ "generate:readme:toc": "markdown-toc -i \"../../README.md\"", "generate:assets": "npm run generate:readme:toc", "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", - "prepublishOnly": "npm run generate:assets" + "copy:legal": "node ../../scripts/copy-legal.js", + "prepublishOnly": "npm run copy:legal && npm run generate:assets" }, "dependencies": { "@asyncapi/avro-schema-parser": "^3.0.3", From 352b8e0c6fa943ef95fa5929011dec23ffba9177 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:10 +0530 Subject: [PATCH 05/11] chore(multi-parser): ignore the legal files copied in at pack time --- packages/multi-parser/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/multi-parser/.gitignore b/packages/multi-parser/.gitignore index 943fd793b..a39117d6f 100644 --- a/packages/multi-parser/.gitignore +++ b/packages/multi-parser/.gitignore @@ -8,3 +8,8 @@ node_modules /cjs /browser *.tgz + +# copied from the repo root by prepublishOnly (scripts/copy-legal.js) +LICENSE +NOTICE +README.md From 47509720c19ff3e6cdce756791384b984aff7203 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:12 +0530 Subject: [PATCH 06/11] fix(openapi-schema-parser): ship LICENSE, NOTICE and README in the published tarball --- packages/openapi-schema-parser/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/openapi-schema-parser/package.json b/packages/openapi-schema-parser/package.json index f94d767b5..9d2fc4d22 100644 --- a/packages/openapi-schema-parser/package.json +++ b/packages/openapi-schema-parser/package.json @@ -34,6 +34,7 @@ "/esm", "/cjs", "LICENSE", + "NOTICE", "README.md" ], "scripts": { @@ -47,7 +48,8 @@ "generate:readme:toc": "markdown-toc -i \"README.md\"", "generate:assets": "npm run build && npm run generate:readme:toc", "bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION", - "prepublishOnly": "npm run generate:assets" + "copy:legal": "node ../../scripts/copy-legal.js", + "prepublishOnly": "npm run copy:legal && npm run generate:assets" }, "dependencies": { "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", From a845d4526612d8ec2e4af8032c52e907d82b2049 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:12:14 +0530 Subject: [PATCH 07/11] chore(openapi-schema-parser): ignore the legal files copied in at pack time --- packages/openapi-schema-parser/.gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/openapi-schema-parser/.gitignore b/packages/openapi-schema-parser/.gitignore index 666dee4ba..3b333e12b 100644 --- a/packages/openapi-schema-parser/.gitignore +++ b/packages/openapi-schema-parser/.gitignore @@ -6,3 +6,8 @@ node_modules /lib /esm /cjs + +# copied from the repo root by prepublishOnly (scripts/copy-legal.js) +LICENSE +NOTICE +README.md From a102ce6137cca711dd11f21c8f21f590838960b8 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 01:41:41 +0530 Subject: [PATCH 08/11] chore: add changeset for the packaged legal files fix --- .changeset/ship-legal-files.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/ship-legal-files.md diff --git a/.changeset/ship-legal-files.md b/.changeset/ship-legal-files.md new file mode 100644 index 000000000..1e53a46df --- /dev/null +++ b/.changeset/ship-legal-files.md @@ -0,0 +1,9 @@ +--- +"@asyncapi/parser": patch +"@asyncapi/multi-parser": patch +"@asyncapi/openapi-schema-parser": patch +--- + +Ship LICENSE, NOTICE and README.md inside the published tarballs. All three were already listed in each +package's `files` array, but those entries resolve inside `packages//` where the files do not exist, +so npm packed none of them. From 4aa82df03061587d140872303abf9e55227c23ae Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 02:25:47 +0530 Subject: [PATCH 09/11] fix: do not overwrite a package that ships its own README --- scripts/copy-legal.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/copy-legal.js b/scripts/copy-legal.js index 5deefdaf6..3e0548740 100644 --- a/scripts/copy-legal.js +++ b/scripts/copy-legal.js @@ -1,10 +1,18 @@ // Copy the monorepo-root legal and readme files into the package being published. // npm only packs files that exist inside the package directory, so without this the published tarballs -// contain no LICENSE, no NOTICE and no README - see the "files" array in each packages/*/package.json. +// contain no LICENSE and no NOTICE - see the "files" array in each packages/*/package.json. const fs = require('fs'); const path = require('path'); const root = path.join(__dirname, '..'); -for (const name of ['LICENSE', 'NOTICE', 'README.md']) { - fs.copyFileSync(path.join(root, name), path.join(process.cwd(), name)); +const pkg = process.cwd(); + +for (const name of ['LICENSE', 'NOTICE']) { + fs.copyFileSync(path.join(root, name), path.join(pkg, name)); +} + +// Only fall back to the monorepo README for packages that do not ship one of their own; +// @asyncapi/openapi-schema-parser has its own and it must not be overwritten. +if (!fs.existsSync(path.join(pkg, 'README.md'))) { + fs.copyFileSync(path.join(root, 'README.md'), path.join(pkg, 'README.md')); } From 28fb0649127ca0e9e5df3a10eca9082a654f1e91 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 02:25:49 +0530 Subject: [PATCH 10/11] fix: keep the tracked README of openapi-schema-parser out of gitignore --- packages/openapi-schema-parser/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/openapi-schema-parser/.gitignore b/packages/openapi-schema-parser/.gitignore index 3b333e12b..28a4681ca 100644 --- a/packages/openapi-schema-parser/.gitignore +++ b/packages/openapi-schema-parser/.gitignore @@ -10,4 +10,3 @@ node_modules # copied from the repo root by prepublishOnly (scripts/copy-legal.js) LICENSE NOTICE -README.md From afdb541488636f77f24dc289a100e7ca58ce2730 Mon Sep 17 00:00:00 2001 From: justFU7 Date: Tue, 18 Aug 2026 02:26:23 +0530 Subject: [PATCH 11/11] chore: correct the changeset - openapi-schema-parser ships its own README --- .changeset/ship-legal-files.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.changeset/ship-legal-files.md b/.changeset/ship-legal-files.md index 1e53a46df..ba428b993 100644 --- a/.changeset/ship-legal-files.md +++ b/.changeset/ship-legal-files.md @@ -4,6 +4,6 @@ "@asyncapi/openapi-schema-parser": patch --- -Ship LICENSE, NOTICE and README.md inside the published tarballs. All three were already listed in each -package's `files` array, but those entries resolve inside `packages//` where the files do not exist, -so npm packed none of them. +Ship the Apache-2.0 `LICENSE` and the `NOTICE` file inside the published tarballs, and add the repository +README to the two packages that had none. `LICENSE` and `README.md` were already listed in each package's +`files` array, but those entries resolve inside `packages//`, where neither file exists.