Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/multi-parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ node_modules
/cjs
/browser
*.tgz

# copied from the repo root by prepublishOnly (scripts/copy-legal.js)
LICENSE
NOTICE
README.md
4 changes: 3 additions & 1 deletion packages/multi-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"/esm",
"/cjs",
"LICENSE",
"NOTICE",
"README.md"
],
"scripts": {
Expand All @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions packages/openapi-schema-parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ node_modules
/lib
/esm
/cjs

# copied from the repo root by prepublishOnly (scripts/copy-legal.js)
LICENSE
NOTICE
README.md
4 changes: 3 additions & 1 deletion packages/openapi-schema-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"/esm",
"/cjs",
"LICENSE",
"NOTICE",
"README.md"
],
"scripts": {
Expand All @@ -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",
Expand Down
5 changes: 5 additions & 0 deletions packages/parser/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ node_modules
/browser
*.tgz
.turbo

# copied from the repo root by prepublishOnly (scripts/copy-legal.js)
LICENSE
NOTICE
README.md
4 changes: 3 additions & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"/cjs",
"/browser",
"LICENSE",
"NOTICE",
"README.md"
],
"scripts": {
Expand All @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions scripts/copy-legal.js
Original file line number Diff line number Diff line change
@@ -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');

Check warning on line 4 in scripts/copy-legal.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `node:fs` over `fs`.

See more on https://sonarcloud.io/project/issues?id=asyncapi_parser-js&issues=AaARP4AS3ej0ChNoZNK7&open=AaARP4AS3ej0ChNoZNK7&pullRequest=1226
const path = require('path');

Check warning on line 5 in scripts/copy-legal.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `node:path` over `path`.

See more on https://sonarcloud.io/project/issues?id=asyncapi_parser-js&issues=AaARP4AS3ej0ChNoZNK8&open=AaARP4AS3ej0ChNoZNK8&pullRequest=1226

const root = path.join(__dirname, '..');
for (const name of ['LICENSE', 'NOTICE', 'README.md']) {
fs.copyFileSync(path.join(root, name), path.join(process.cwd(), name));
}
Loading