From e4a3e4e66acb70f9b00b0e2bb45701280c36aaa9 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:32:07 +0200 Subject: [PATCH 01/73] docs: add akkshitgupta as a contributor for code, example, and 2 more (#1971) * update README.md * update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 5 ++++- README.md | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 7d5427d01d..bbcacc6327 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -869,7 +869,10 @@ "profile": "https://github.com/akkshitgupta", "contributions": [ "code", - "bug" + "bug", + "example", + "test", + "doc" ] }, { diff --git a/README.md b/README.md index 66c2ef888c..71a1a222e1 100644 --- a/README.md +++ b/README.md @@ -425,7 +425,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org RowlandBanks
RowlandBanks

💻 ⚠️ 🐛 Moritz Kalwa
Moritz Kalwa

💻 ⚠️ 🐛 📖 - Akshit Gupta
Akshit Gupta

💻 🐛 + Akshit Gupta
Akshit Gupta

💻 🐛 💡 ⚠️ 📖 Athul Tulasidasan
Athul Tulasidasan

💻 💡 📖 ⚠️ souvik
souvik

💻 ⚠️ 💡 📖 Louis-PhilippeGentile
Louis-PhilippeGentile

💻 ⚠️ 📖 🐛 From 696548fa24ecaa0b6de6192dc1272401b43da27d Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 30 Apr 2024 11:14:11 +0200 Subject: [PATCH 02/73] ci: update of files from global .github repo (#1979) --- .github/workflows/if-nodejs-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index 234c5a9c59..e578d9002f 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -15,6 +15,7 @@ on: - next-major-spec - beta - alpha + - next jobs: @@ -128,4 +129,4 @@ jobs: fields: repo,action,workflow text: 'Release workflow failed in release job' env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} \ No newline at end of file + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} From 67d3863e7d5b8897ade0331ebab9869d72abb12f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 08:16:03 +0200 Subject: [PATCH 03/73] chore(deps): bump ejs from 3.1.8 to 3.1.10 in /examples/integrate-with-react (#1985) --- examples/integrate-with-react/package-lock.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/integrate-with-react/package-lock.json b/examples/integrate-with-react/package-lock.json index c76cbf6176..e1ca662d0b 100644 --- a/examples/integrate-with-react/package-lock.json +++ b/examples/integrate-with-react/package-lock.json @@ -6172,9 +6172,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/ejs": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", - "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "dependencies": { "jake": "^10.8.5" }, @@ -20230,9 +20230,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "ejs": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.8.tgz", - "integrity": "sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ==", + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", "requires": { "jake": "^10.8.5" } From 39928362ade13385eeb033f31fa2f5e48bb1a9c0 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 6 May 2024 09:01:50 +0200 Subject: [PATCH 04/73] ci: update of files from global .github repo (#1989) --- .github/workflows/bounty-program-commands.yml | 50 ++++++++++++++++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bounty-program-commands.yml b/.github/workflows/bounty-program-commands.yml index 433f7d953d..645e0c90db 100644 --- a/.github/workflows/bounty-program-commands.yml +++ b/.github/workflows/bounty-program-commands.yml @@ -14,12 +14,18 @@ on: types: - created +env: + BOUNTY_PROGRAM_LABELS_JSON: | + [ + {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} + ] + jobs: guard-against-unauthorized-use: if: > github.actor != ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest @@ -46,15 +52,10 @@ jobs: if: > github.actor == ('aeworxet' || 'thulieblack') && ( - contains(github.event.comment.body, '/bounty' ) + startsWith(github.event.comment.body, '/bounty' ) ) runs-on: ubuntu-latest - env: - BOUNTY_PROGRAM_LABELS_JSON: | - [ - {"name": "bounty", "color": "0e8a16", "description": "Participation in the Bounty Program"} - ] steps: - name: Add label `bounty` @@ -88,3 +89,38 @@ jobs: repo: context.repo.repo, labels: [BOUNTY_PROGRAM_LABELS[0].name] }) + + remove-label-bounty: + if: > + github.actor == ('aeworxet' || 'thulieblack') && + ( + startsWith(github.event.comment.body, '/unbounty' ) + ) + + runs-on: ubuntu-latest + + steps: + - name: Remove label `bounty` + uses: actions/github-script@v6 + + with: + github-token: ${{ secrets.GH_TOKEN }} + script: | + const BOUNTY_PROGRAM_LABELS = JSON.parse(process.env.BOUNTY_PROGRAM_LABELS_JSON); + let LIST_OF_LABELS_FOR_ISSUE = await github.rest.issues.listLabelsOnIssue({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + LIST_OF_LABELS_FOR_ISSUE = LIST_OF_LABELS_FOR_ISSUE.data.map(key => key.name); + + if (LIST_OF_LABELS_FOR_ISSUE.includes(BOUNTY_PROGRAM_LABELS[0].name)) { + console.log('Removing label `bounty`...'); + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: [BOUNTY_PROGRAM_LABELS[0].name] + }) + } From 1b23eff1b0a662aad88e1ba2af15c49537f09628 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 03:54:29 +0200 Subject: [PATCH 05/73] chore(deps): bump next from 13.5.5 to 14.1.1 in /examples/integrate-with-next (#1995) --- .../integrate-with-next/package-lock.json | 119 ++++++++---------- examples/integrate-with-next/package.json | 2 +- 2 files changed, 52 insertions(+), 69 deletions(-) diff --git a/examples/integrate-with-next/package-lock.json b/examples/integrate-with-next/package-lock.json index 4f9d69f69f..03cc2c5886 100644 --- a/examples/integrate-with-next/package-lock.json +++ b/examples/integrate-with-next/package-lock.json @@ -24,7 +24,7 @@ "babel-jest": "^29.4.2", "jest": "^28.1.0", "jest-environment-jsdom": "28.1.0", - "next": "13.5.5", + "next": "14.1.1", "react": "18.2.0", "react-dom": "18.2.0", "typescript": "4.9.4" @@ -3495,9 +3495,9 @@ } }, "node_modules/@next/env": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/env/-/env-13.5.5.tgz", - "integrity": "sha512-agvIhYWp+ilbScg81s/sLueZo8CNEYLjNOqhISxheLmD/AQI4/VxV7bV76i/KzxH4iHy/va0YS9z0AOwGnw4Fg==" + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.1.tgz", + "integrity": "sha512-7CnQyD5G8shHxQIIg3c7/pSeYFeMhsNbpU/bmvH7ZnDql7mNRgg8O2JZrhrc/soFnfBnKP4/xXNiiSIPn2w8gA==" }, "node_modules/@next/font": { "version": "13.1.5", @@ -3505,9 +3505,9 @@ "integrity": "sha512-6M5R6yC3JkdJiqo/YJxDp6+0vDn0smXOAzl8uHt4qmDS2u53ji/19K0HM51d+5kg8xntDi+N2hw7YjaU9inkNA==" }, "node_modules/@next/swc-darwin-arm64": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.5.5.tgz", - "integrity": "sha512-FvTdcJdTA7H1FGY8dKPPbf/O0oDC041/znHZwXA7liiGUhgw5hOQ+9z8tWvuz0M5a/SDjY/IRPBAb5FIFogYww==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.1.tgz", + "integrity": "sha512-yDjSFKQKTIjyT7cFv+DqQfW5jsD+tVxXTckSe1KIouKk75t1qZmj/mV3wzdmFb0XHVGtyRjDMulfVG8uCKemOQ==", "cpu": [ "arm64" ], @@ -3520,9 +3520,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-13.5.5.tgz", - "integrity": "sha512-mTqNIecaojmyia7appVO2QggBe1Z2fdzxgn6jb3x9qlAk8yY2sy4MAcsj71kC9RlenCqDmr9vtC/ESFf110TPA==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.1.tgz", + "integrity": "sha512-KCQmBL0CmFmN8D64FHIZVD9I4ugQsDBBEJKiblXGgwn7wBCSe8N4Dx47sdzl4JAg39IkSN5NNrr8AniXLMb3aw==", "cpu": [ "x64" ], @@ -3535,9 +3535,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.5.5.tgz", - "integrity": "sha512-U9e+kNkfvwh/T8yo+xcslvNXgyMzPPX1IbwCwnHHFmX5ckb1Uc3XZSInNjFQEQR5xhJpB5sFdal+IiBIiLYkZA==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.1.tgz", + "integrity": "sha512-YDQfbWyW0JMKhJf/T4eyFr4b3tceTorQ5w2n7I0mNVTFOvu6CGEzfwT3RSAQGTi/FFMTFcuspPec/7dFHuP7Eg==", "cpu": [ "arm64" ], @@ -3550,9 +3550,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.5.5.tgz", - "integrity": "sha512-h7b58eIoNCSmKVC5fr167U0HWZ/yGLbkKD9wIller0nGdyl5zfTji0SsPKJvrG8jvKPFt2xOkVBmXlFOtuKynw==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.1.tgz", + "integrity": "sha512-fiuN/OG6sNGRN/bRFxRvV5LyzLB8gaL8cbDH5o3mEiVwfcMzyE5T//ilMmaTrnA8HLMS6hoz4cHOu6Qcp9vxgQ==", "cpu": [ "arm64" ], @@ -3565,9 +3565,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.5.5.tgz", - "integrity": "sha512-6U4y21T1J6FfcpM9uqzBJicxycpB5gJKLyQ3g6KOfBzT8H1sMwfHTRrvHKB09GIn1BCRy5YJHrA1G26DzqR46w==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.1.tgz", + "integrity": "sha512-rv6AAdEXoezjbdfp3ouMuVqeLjE1Bin0AuE6qxE6V9g3Giz5/R3xpocHoAi7CufRR+lnkuUjRBn05SYJ83oKNQ==", "cpu": [ "x64" ], @@ -3580,9 +3580,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.5.5.tgz", - "integrity": "sha512-OuqWSAQHJQM2EsapPFTSU/FLQ0wKm7UeRNatiR/jLeCe1V02aB9xmzuWYo2Neaxxag4rss3S8fj+lvMLzwDaFA==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.1.tgz", + "integrity": "sha512-YAZLGsaNeChSrpz/G7MxO3TIBLaMN8QWMr3X8bt6rCvKovwU7GqQlDu99WdvF33kI8ZahvcdbFsy4jAFzFX7og==", "cpu": [ "x64" ], @@ -3595,9 +3595,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.5.5.tgz", - "integrity": "sha512-+yLrOZIIZDY4uGn9bLOc0wTgs+M8RuOUFSUK3BhmcLav9e+tcAj0jyBHD4aXv2qWhppUeuYMsyBo1I58/eE6Dg==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.1.tgz", + "integrity": "sha512-1L4mUYPBMvVDMZg1inUYyPvFSduot0g73hgfD9CODgbr4xiTYe0VOMTZzaRqYJYBA9mana0x4eaAaypmWo1r5A==", "cpu": [ "arm64" ], @@ -3610,9 +3610,9 @@ } }, "node_modules/@next/swc-win32-ia32-msvc": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.5.5.tgz", - "integrity": "sha512-SyMxXyJtf9ScMH0Dh87THJMXNFvfkRAk841xyW9SeOX3KxM1buXX3hN7vof4kMGk0Yg996OGsX+7C9ueS8ugsw==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.1.tgz", + "integrity": "sha512-jvIE9tsuj9vpbbXlR5YxrghRfMuG0Qm/nZ/1KDHc+y6FpnZ/apsgh+G6t15vefU0zp3WSpTMIdXRUsNl/7RSuw==", "cpu": [ "ia32" ], @@ -3625,9 +3625,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.5.5.tgz", - "integrity": "sha512-n5KVf2Ok0BbLwofAaHiiKf+BQCj1M8WmTujiER4/qzYAVngnsNSjqEWvJ03raeN9eURqxDO+yL5VRoDrR33H9A==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.1.tgz", + "integrity": "sha512-S6K6EHDU5+1KrBDLko7/c1MNy/Ya73pIAmvKeFwsF4RmBFJSO7/7YeD4FnZ4iBdzE69PpQ4sOMU9ORKeNuxe8A==", "cpu": [ "x64" ], @@ -4506,9 +4506,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001522", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001522.tgz", - "integrity": "sha512-TKiyTVZxJGhsTszLuzb+6vUZSjVOAhClszBr2Ta2k9IwtNBT/4dzmL6aywt0HCgEZlmwJzXJd8yNiob6HgwTRg==", + "version": "1.0.30001617", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001617.tgz", + "integrity": "sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==", "funding": [ { "type": "opencollective", @@ -5141,11 +5141,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob-to-regexp": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", - "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" - }, "node_modules/globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -9286,34 +9281,34 @@ "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" }, "node_modules/next": { - "version": "13.5.5", - "resolved": "https://registry.npmjs.org/next/-/next-13.5.5.tgz", - "integrity": "sha512-LddFJjpfrtrMMw8Q9VLhIURuSidiCNcMQjRqcPtrKd+Fx07MsG7hYndJb/f2d3I+mTbTotsTJfCnn0eZ/YPk8w==", + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/next/-/next-14.1.1.tgz", + "integrity": "sha512-McrGJqlGSHeaz2yTRPkEucxQKe5Zq7uPwyeHNmJaZNY4wx9E9QdxmTp310agFRoMuIYgQrCrT3petg13fSVOww==", "dependencies": { - "@next/env": "13.5.5", + "@next/env": "14.1.1", "@swc/helpers": "0.5.2", "busboy": "1.6.0", - "caniuse-lite": "^1.0.30001406", + "caniuse-lite": "^1.0.30001579", + "graceful-fs": "^4.2.11", "postcss": "8.4.31", - "styled-jsx": "5.1.1", - "watchpack": "2.4.0" + "styled-jsx": "5.1.1" }, "bin": { "next": "dist/bin/next" }, "engines": { - "node": ">=16.14.0" + "node": ">=18.17.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "13.5.5", - "@next/swc-darwin-x64": "13.5.5", - "@next/swc-linux-arm64-gnu": "13.5.5", - "@next/swc-linux-arm64-musl": "13.5.5", - "@next/swc-linux-x64-gnu": "13.5.5", - "@next/swc-linux-x64-musl": "13.5.5", - "@next/swc-win32-arm64-msvc": "13.5.5", - "@next/swc-win32-ia32-msvc": "13.5.5", - "@next/swc-win32-x64-msvc": "13.5.5" + "@next/swc-darwin-arm64": "14.1.1", + "@next/swc-darwin-x64": "14.1.1", + "@next/swc-linux-arm64-gnu": "14.1.1", + "@next/swc-linux-arm64-musl": "14.1.1", + "@next/swc-linux-x64-gnu": "14.1.1", + "@next/swc-linux-x64-musl": "14.1.1", + "@next/swc-win32-arm64-msvc": "14.1.1", + "@next/swc-win32-ia32-msvc": "14.1.1", + "@next/swc-win32-x64-msvc": "14.1.1" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -10378,18 +10373,6 @@ "makeerror": "1.0.12" } }, - "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", - "dependencies": { - "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.1.2" - }, - "engines": { - "node": ">=10.13.0" - } - }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", diff --git a/examples/integrate-with-next/package.json b/examples/integrate-with-next/package.json index e49d68a73a..b8bf57e84c 100644 --- a/examples/integrate-with-next/package.json +++ b/examples/integrate-with-next/package.json @@ -16,7 +16,7 @@ "@types/node": "18.11.18", "@types/react": "18.0.27", "@types/react-dom": "18.0.10", - "next": "13.5.5", + "next": "14.1.1", "react": "18.2.0", "react-dom": "18.2.0", "typescript": "4.9.4", From a1e63668e07cace023a8c042e77bb36b52e42d8d Mon Sep 17 00:00:00 2001 From: gitankit7 <34441936+gitankit7@users.noreply.github.com> Date: Mon, 13 May 2024 12:48:43 +0530 Subject: [PATCH 06/73] feat: add modelName to warning log (#1997) --- src/helpers/CommonModelToMetaModel.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/CommonModelToMetaModel.ts b/src/helpers/CommonModelToMetaModel.ts index 946681b714..a0ce4d1d44 100644 --- a/src/helpers/CommonModelToMetaModel.ts +++ b/src/helpers/CommonModelToMetaModel.ts @@ -121,7 +121,9 @@ export function convertToMetaModel( if (booleanModel !== undefined) { return booleanModel; } - Logger.warn('Failed to convert to MetaModel, defaulting to AnyModel'); + Logger.warn( + `Failed to convert ${modelName} to MetaModel, defaulting to AnyModel` + ); return new AnyModel( modelName, jsonSchemaModel.originalInput, From 66755692e5737726fa3cc801f2441e5621046d6c Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 13 May 2024 09:36:19 +0200 Subject: [PATCH 07/73] chore(release): v3.5.0 (#1999) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5a2d339bf5..4b62bbbe99 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/modelina", - "version": "3.4.9", + "version": "3.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/modelina", - "version": "3.4.9", + "version": "3.5.0", "license": "Apache-2.0", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", diff --git a/package.json b/package.json index 3c7afa4c00..e402924393 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/modelina", - "version": "3.4.9", + "version": "3.5.0", "description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents", "license": "Apache-2.0", "homepage": "https://www.modelina.org", From 22e685a8a07b1a59d9b6a54c3174b420d9a70356 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 09:47:26 +0200 Subject: [PATCH 08/73] docs: add gitankit7 as a contributor for code (#1998) * update README.md * update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Jonas Lagoni --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index bbcacc6327..ff510268ad 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -941,6 +941,15 @@ "code", "example" ] + }, + { + "login": "gitankit7", + "name": "gitankit7", + "avatar_url": "https://avatars.githubusercontent.com/u/34441936?v=4", + "profile": "https://github.com/gitankit7", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 71a1a222e1..d933486056 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions) [![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org) [![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) -[![All Contributors](https://img.shields.io/badge/all_contributors-86-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-87-orange.svg?style=flat-square)](#contributors-) Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control. @@ -434,6 +434,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org Anders Hellerup Madsen
Anders Hellerup Madsen

💻 ⚠️ 🐛 rquinio1A
rquinio1A

💻 💡 + gitankit7
gitankit7

💻 From 72ac143f6c73ff8937c7b6dbb48f80c249fa2196 Mon Sep 17 00:00:00 2001 From: Akshit Gupta <96991785+akkshitgupta@users.noreply.github.com> Date: Thu, 16 May 2024 13:08:40 +0530 Subject: [PATCH 09/73] chore: add akkshitgupta as Avro Schema Input codeowner (#1975) --- CODEOWNERS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CODEOWNERS b/CODEOWNERS index fd26d550f1..39222ef7bb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -19,6 +19,10 @@ # Input Champions for AsyncAPI input */processors/AsyncAPIInputProcessor*.ts +# Input Champions for Avro Schema input +*/helpers/AvroToMetaModel*.ts @akkshitgupta +*/processors/AvroSchemaInputProcessor*.ts @akkshitgupta + # Input Champions for TypeScript input */processors/TypeScriptInputProcessor*.ts From 5a052830b1cbbe1246163d1b8f1320223b75ed3a Mon Sep 17 00:00:00 2001 From: Janne Husberg <112867847+janne-slamcore@users.noreply.github.com> Date: Thu, 16 May 2024 12:45:54 +0100 Subject: [PATCH 10/73] fix: treat nullable property as optional for pydantic (#2001) --- src/generators/python/presets/Pydantic.ts | 7 +++-- .../python/presets/Pydantic.spec.ts | 29 +++++++++++++++++++ .../__snapshots__/Pydantic.spec.ts.snap | 13 +++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/generators/python/presets/Pydantic.ts b/src/generators/python/presets/Pydantic.ts index 90621732ab..fff3304986 100644 --- a/src/generators/python/presets/Pydantic.ts +++ b/src/generators/python/presets/Pydantic.ts @@ -29,7 +29,10 @@ const PYTHON_PYDANTIC_CLASS_PRESET: ClassPresetType = { type = `Union[${unionTypes.join(', ')}]`; } - if (!params.property.required) { + const isOptional = + !params.property.required || + params.property.property.options.isNullable === true; + if (isOptional) { type = `Optional[${type}]`; } @@ -40,7 +43,7 @@ const PYTHON_PYDANTIC_CLASS_PRESET: ClassPresetType = { `description='''${params.property.property.originalInput['description']}'''` ); } - if (!params.property.required) { + if (isOptional) { decoratorArgs.push('default=None'); } if ( diff --git a/test/generators/python/presets/Pydantic.spec.ts b/test/generators/python/presets/Pydantic.spec.ts index b3442d2048..a76f8f93de 100644 --- a/test/generators/python/presets/Pydantic.spec.ts +++ b/test/generators/python/presets/Pydantic.spec.ts @@ -65,4 +65,33 @@ describe('PYTHON_PYDANTIC_PRESET', () => { const models = await generator.generate(doc); expect(models.map((model) => model.result)).toMatchSnapshot(); }); + + test('should render nullable union', async () => { + const doc = { + title: 'NullableUnionTest', + type: 'object', + required: ['nullableUnionTest'], + properties: { + nullableUnionTest: { + anyOf: [ + { + title: 'Union1', + type: 'object', + properties: { + testProp1: { + type: 'string' + } + } + }, + { + type: 'null' + } + ] + } + } + }; + + const models = await generator.generate(doc); + expect(models.map((model) => model.result)).toMatchSnapshot(); + }); }); diff --git a/test/generators/python/presets/__snapshots__/Pydantic.spec.ts.snap b/test/generators/python/presets/__snapshots__/Pydantic.spec.ts.snap index 4cba95efa5..71e7e71ea8 100644 --- a/test/generators/python/presets/__snapshots__/Pydantic.spec.ts.snap +++ b/test/generators/python/presets/__snapshots__/Pydantic.spec.ts.snap @@ -1,5 +1,18 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`PYTHON_PYDANTIC_PRESET should render nullable union 1`] = ` +Array [ + "class NullableUnionTest(BaseModel): + nullableUnionTest: Optional[Union[Union1]] = Field(default=None) + additionalProperties: Optional[dict[Any, Any]] = Field(default=None) +", + "class Union1(BaseModel): + testProp1: Optional[str] = Field(default=None) + additionalProperties: Optional[dict[Any, Any]] = Field(default=None) +", +] +`; + exports[`PYTHON_PYDANTIC_PRESET should render pydantic for class 1`] = ` "class Test(BaseModel): prop: Optional[str] = Field(description='''test From abebef451884f92cc24624660ec645b914ac3df5 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Thu, 16 May 2024 14:02:14 +0200 Subject: [PATCH 11/73] chore(release): v3.5.1 (#2003) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4b62bbbe99..fef9a7b313 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/modelina", - "version": "3.5.0", + "version": "3.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/modelina", - "version": "3.5.0", + "version": "3.5.1", "license": "Apache-2.0", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", diff --git a/package.json b/package.json index e402924393..003dcfaf34 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/modelina", - "version": "3.5.0", + "version": "3.5.1", "description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents", "license": "Apache-2.0", "homepage": "https://www.modelina.org", From 47917bd1ae3a71b61fece3c90bd6fdb0fb75cbcd Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Thu, 16 May 2024 14:02:49 +0200 Subject: [PATCH 12/73] docs: add janne-slamcore as a contributor for code, and test (#2002) Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Jonas Lagoni --- .all-contributorsrc | 11 +++++++++++ README.md | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index ff510268ad..b305e30f9d 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -950,6 +950,17 @@ "contributions": [ "code" ] + }, + { + "login": "janne-slamcore", + "name": "Janne Husberg", + "avatar_url": "https://avatars.githubusercontent.com/u/112867847?v=4", + "profile": "https://github.com/janne-slamcore", + "contributions": [ + "code", + "test", + "bug" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index d933486056..9d0e19bb94 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions) [![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org) [![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) -[![All Contributors](https://img.shields.io/badge/all_contributors-87-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-88-orange.svg?style=flat-square)](#contributors-) Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control. @@ -435,6 +435,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org Anders Hellerup Madsen
Anders Hellerup Madsen

💻 ⚠️ 🐛 rquinio1A
rquinio1A

💻 💡 gitankit7
gitankit7

💻 + Janne Husberg
Janne Husberg

💻 ⚠️ 🐛 From 33fd7d92b640c544c1112bb70b4582062803a730 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 23:09:05 +0200 Subject: [PATCH 13/73] chore(deps): bump @apidevtools/json-schema-ref-parser from 11.1.0 to 11.1.1 (#2006) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fef9a7b313..b353f232b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,9 +58,9 @@ } }, "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.1.0.tgz", - "integrity": "sha512-g/VW9ZQEFJAOwAyUb8JFf7MLiLy2uEB4rU270rGzDwICxnxMlPy0O11KVePSgS36K1NI29gSlK84n5INGhd4Ag==", + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.1.1.tgz", + "integrity": "sha512-WZyqzPLrWctQB8qB8uGivvzWgvtcVqlmRrayMWSxqjY6pT+CLv9vgyH6j5HqzfdZ95fTvIkBSPcrrUD9/iJ7aA==", "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.13", From 6c958f7786ea8ab12a411d16cda46c1fed25a8ae Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 5 Jun 2024 11:06:37 +0200 Subject: [PATCH 14/73] ci: update of files from global .github repo (#2024) --- .github/workflows/if-nodejs-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/if-nodejs-release.yml b/.github/workflows/if-nodejs-release.yml index e578d9002f..72d01de477 100644 --- a/.github/workflows/if-nodejs-release.yml +++ b/.github/workflows/if-nodejs-release.yml @@ -33,7 +33,9 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. + # See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 + os: [ubuntu-latest, macos-13, windows-latest] steps: - name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows run: | From 40d84512a7ef21fa71a604a93740bb77aebf6634 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 5 Jun 2024 12:05:47 +0200 Subject: [PATCH 15/73] fix: update @asyncapi/parser to 3.0.15 version and others (#2025) --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b353f232b9..fa70435822 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", "@apidevtools/swagger-parser": "^10.1.0", - "@asyncapi/parser": "^3.0.14", + "@asyncapi/parser": "^3.0.15", "@smoya/multi-parser": "^5.0.1", "@swc/core": "^1.3.5", "@swc/jest": "^0.2.23", @@ -272,9 +272,9 @@ "integrity": "sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==" }, "node_modules/@asyncapi/parser": { - "version": "3.0.14", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.14.tgz", - "integrity": "sha512-tC2gmKkw28PWWMcGUXHQjTfVftiZdr+FQtsfapaHh36spX9uwe13iYzkcTyCkwSJAHibtg7wvStuHsiufP8xng==", + "version": "3.0.15", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.15.tgz", + "integrity": "sha512-tP4O6c9jM8pKimg8kw3+/SdPAKJQWPmYozO6ZFJB5ziVtsr3Z8Qe06V13QcBOg4LzIWAwontyG5lZ5jnyvuDPQ==", "dependencies": { "@asyncapi/specs": "^6.6.0", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", diff --git a/package.json b/package.json index 003dcfaf34..801a980ee4 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", "@apidevtools/swagger-parser": "^10.1.0", - "@asyncapi/parser": "^3.0.14", + "@asyncapi/parser": "^3.0.15", "@smoya/multi-parser": "^5.0.1", "@swc/core": "^1.3.5", "@swc/jest": "^0.2.23", From a99c5e638cebc2ace8ab2b07e7cb0f632361b6c6 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 10:05:19 +0200 Subject: [PATCH 16/73] docs: add borrull as a contributor for code, and test (#2033) * update README.md * update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 10 ++++++++++ README.md | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index b305e30f9d..facc9e6ff5 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -961,6 +961,16 @@ "test", "bug" ] + }, + { + "login": "borrull", + "name": "borrull", + "avatar_url": "https://avatars.githubusercontent.com/u/5275400?v=4", + "profile": "https://github.com/borrull", + "contributions": [ + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 9d0e19bb94..10c9db2ba1 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions) [![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org) [![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) -[![All Contributors](https://img.shields.io/badge/all_contributors-88-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-89-orange.svg?style=flat-square)](#contributors-) Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control. @@ -436,6 +436,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org rquinio1A
rquinio1A

💻 💡 gitankit7
gitankit7

💻 Janne Husberg
Janne Husberg

💻 ⚠️ 🐛 + borrull
borrull

💻 ⚠️ From b48df76883c2a77720709613699138ee257e97e6 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Tue, 11 Jun 2024 14:13:21 +0200 Subject: [PATCH 17/73] ci: update of files from global .github repo (#2035) --- .github/workflows/issues-prs-notifications.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml index 78ebe96011..b8b20c6ba6 100644 --- a/.github/workflows/issues-prs-notifications.yml +++ b/.github/workflows/issues-prs-notifications.yml @@ -20,8 +20,6 @@ jobs: name: Notify slack on every new issue runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for issue uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown @@ -40,8 +38,6 @@ jobs: name: Notify slack on every new pull request runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown @@ -60,8 +56,6 @@ jobs: name: Notify slack on every new pull request runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 - name: Convert markdown to slack markdown for pull request uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown From 2a3992ef0d2aeced73d12dc6bc91e42d45323b77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:11:01 +0200 Subject: [PATCH 18/73] chore(deps): bump braces from 3.0.2 to 3.0.3 in /modelina-website (#2036) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- modelina-website/package-lock.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/modelina-website/package-lock.json b/modelina-website/package-lock.json index 343dfd77d8..867424277a 100644 --- a/modelina-website/package-lock.json +++ b/modelina-website/package-lock.json @@ -1024,11 +1024,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -2333,9 +2333,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -7568,11 +7568,11 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browserslist": { @@ -8522,9 +8522,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } From 7053efb67745dc7e5562c6a842c204ee1c11c434 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 12 Jun 2024 14:36:07 +0200 Subject: [PATCH 19/73] fix: update @asyncapi/parser to 3.1.0 version and others (#2038) --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa70435822..776e7e132d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", "@apidevtools/swagger-parser": "^10.1.0", - "@asyncapi/parser": "^3.0.15", + "@asyncapi/parser": "^3.1.0", "@smoya/multi-parser": "^5.0.1", "@swc/core": "^1.3.5", "@swc/jest": "^0.2.23", @@ -272,11 +272,11 @@ "integrity": "sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw==" }, "node_modules/@asyncapi/parser": { - "version": "3.0.15", - "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.0.15.tgz", - "integrity": "sha512-tP4O6c9jM8pKimg8kw3+/SdPAKJQWPmYozO6ZFJB5ziVtsr3Z8Qe06V13QcBOg4LzIWAwontyG5lZ5jnyvuDPQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@asyncapi/parser/-/parser-3.1.0.tgz", + "integrity": "sha512-rUd+fsPRE68o+F3gLqk7OaBj5J5VgBiLk9eJBGEXolNmKbVd45mxJm2aBpMkphQEmYHuBvxZyiNYlSCyr1D2fA==", "dependencies": { - "@asyncapi/specs": "^6.6.0", + "@asyncapi/specs": "^6.7.1", "@openapi-contrib/openapi-schema-to-json-schema": "~3.2.0", "@stoplight/json": "^3.20.2", "@stoplight/json-ref-readers": "^1.2.2", @@ -298,9 +298,9 @@ } }, "node_modules/@asyncapi/parser/node_modules/@asyncapi/specs": { - "version": "6.6.0", - "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.6.0.tgz", - "integrity": "sha512-pXJa0sCeBpif5al5CSa0f3HvwVBQXzd96/Xgq8Jsh6KM4CYxCe7p6paaC9fDjdBVXyWAioQmZiGRxEVUMINbUw==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/@asyncapi/specs/-/specs-6.7.1.tgz", + "integrity": "sha512-jEaW2vgAwD9GboCdO/TI1zN2k+iowL8YFYwiZwTIr4U4KDmsgo3BLypScl6Jl4+IvY9RdsWE67nuzVX7jooiqQ==", "dependencies": { "@types/json-schema": "^7.0.11" } diff --git a/package.json b/package.json index 801a980ee4..226e72b42a 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", "@apidevtools/swagger-parser": "^10.1.0", - "@asyncapi/parser": "^3.0.15", + "@asyncapi/parser": "^3.1.0", "@smoya/multi-parser": "^5.0.1", "@swc/core": "^1.3.5", "@swc/jest": "^0.2.23", From 62e274ceb60888d709e292f25ff618fec8a6f024 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Wed, 12 Jun 2024 15:07:29 +0200 Subject: [PATCH 20/73] chore(release): v3.5.3 (#2039) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 776e7e132d..9805b97b33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/modelina", - "version": "3.5.1", + "version": "3.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/modelina", - "version": "3.5.1", + "version": "3.5.3", "license": "Apache-2.0", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", diff --git a/package.json b/package.json index 226e72b42a..5595cda88d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/modelina", - "version": "3.5.1", + "version": "3.5.3", "description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents", "license": "Apache-2.0", "homepage": "https://www.modelina.org", From c0741229a5280d3513d0b43185013600941177d3 Mon Sep 17 00:00:00 2001 From: Kamil Zuzda Date: Mon, 17 Jun 2024 11:10:47 +0100 Subject: [PATCH 21/73] feat: export AbstractDependencyManager to allow override (#2044) --- src/generators/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generators/index.ts b/src/generators/index.ts index 3cad3a112a..bf80a3a17a 100644 --- a/src/generators/index.ts +++ b/src/generators/index.ts @@ -1,3 +1,4 @@ +export * from './AbstractDependencyManager'; export * from './AbstractGenerator'; export * from './AbstractRenderer'; export * from './java'; From 63d8a52b555691377d4e90812f0fc3e4c6b6b511 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 17 Jun 2024 12:27:45 +0200 Subject: [PATCH 22/73] chore(release): v3.6.0 (#2046) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9805b97b33..c15e58b780 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/modelina", - "version": "3.5.3", + "version": "3.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@asyncapi/modelina", - "version": "3.5.3", + "version": "3.6.0", "license": "Apache-2.0", "dependencies": { "@apidevtools/json-schema-ref-parser": "^11.1.0", diff --git a/package.json b/package.json index 5595cda88d..d911bdba7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/modelina", - "version": "3.5.3", + "version": "3.6.0", "description": "Library for generating data models based on inputs such as AsyncAPI, OpenAPI, or JSON Schema documents", "license": "Apache-2.0", "homepage": "https://www.modelina.org", From 4fc7a3516d06375f9ff8e34bc3f71d219aa6b4b3 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Mon, 17 Jun 2024 12:32:29 +0200 Subject: [PATCH 23/73] docs: add kamaz as a contributor for code (#2045) * update README.md * update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Jonas Lagoni --- .all-contributorsrc | 9 +++++++++ README.md | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index facc9e6ff5..447aa5329f 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -971,6 +971,15 @@ "code", "test" ] + }, + { + "login": "kamaz", + "name": "Kamil Zuzda", + "avatar_url": "https://avatars.githubusercontent.com/u/2106178?v=4", + "profile": "http://www.yokeplatform.com", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 10c9db2ba1..af8af0d8c6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions) [![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org) [![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) -[![All Contributors](https://img.shields.io/badge/all_contributors-89-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-90-orange.svg?style=flat-square)](#contributors-) Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control. @@ -437,6 +437,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org gitankit7
gitankit7

💻 Janne Husberg
Janne Husberg

💻 ⚠️ 🐛 borrull
borrull

💻 ⚠️ + Kamil Zuzda
Kamil Zuzda

💻 From 6c35588c5b52ae914343749f7c240204f7876a57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 08:31:57 +0200 Subject: [PATCH 24/73] chore(deps-dev): bump ws from 7.5.5 to 7.5.10 (#2049) --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c15e58b780..b7467bdd55 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11869,9 +11869,9 @@ } }, "node_modules/ws": { - "version": "7.5.5", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", - "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "dev": true, "engines": { "node": ">=8.3.0" From 38e36e8b34961ed8cc60194026862aa5ad1767d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 08:48:09 +0200 Subject: [PATCH 25/73] chore(deps): bump ws from 8.13.0 to 8.17.1 in /examples/integrate-with-next (#2050) --- examples/integrate-with-next/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/integrate-with-next/package-lock.json b/examples/integrate-with-next/package-lock.json index 03cc2c5886..8b1470a1f9 100644 --- a/examples/integrate-with-next/package-lock.json +++ b/examples/integrate-with-next/package-lock.json @@ -10537,9 +10537,9 @@ } }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "engines": { "node": ">=10.0.0" }, From 3b257d8bc0d64c085641c5c21a936c86a89244a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:08:36 +0200 Subject: [PATCH 26/73] chore(deps): bump braces from 3.0.2 to 3.0.3 in /examples/integrate-with-next (#2047) chore(deps): bump braces in /examples/integrate-with-next Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: asyncapi-bot-eve --- examples/integrate-with-next/package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/integrate-with-next/package-lock.json b/examples/integrate-with-next/package-lock.json index 8b1470a1f9..7f603d4ed8 100644 --- a/examples/integrate-with-next/package-lock.json +++ b/examples/integrate-with-next/package-lock.json @@ -4407,11 +4407,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -4999,9 +4999,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, From 0db19cc2e99ad0bdb09b961a91d5511d061077f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:05:36 +0200 Subject: [PATCH 27/73] chore(deps): bump ws from 7.5.9 to 7.5.10 in /test/runtime/runtime-typescript (#2051) --- test/runtime/runtime-typescript/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/runtime/runtime-typescript/package-lock.json b/test/runtime/runtime-typescript/package-lock.json index 56c3909e87..b14d3eab28 100644 --- a/test/runtime/runtime-typescript/package-lock.json +++ b/test/runtime/runtime-typescript/package-lock.json @@ -4286,9 +4286,9 @@ } }, "node_modules/ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", "engines": { "node": ">=8.3.0" }, From 51f197679a2612fb89c9e44f3628b31083c0297a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:23:18 +0200 Subject: [PATCH 28/73] chore(deps-dev): bump braces from 3.0.2 to 3.0.3 (#2052) Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3. - [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md) - [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: braces dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index b7467bdd55..074c2aef7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3720,12 +3720,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -5985,9 +5985,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" From 4226a1ad7132676835cace44227e63bb577cad1e Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:01:14 +0200 Subject: [PATCH 29/73] docs: add jespitae as a contributor for code, and test (#2056) * update README.md * update .all-contributorsrc --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> --- .all-contributorsrc | 10 ++++++++++ README.md | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 447aa5329f..1897d48f9b 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -980,6 +980,16 @@ "contributions": [ "code" ] + }, + { + "login": "jespitae", + "name": "jespitae", + "avatar_url": "https://avatars.githubusercontent.com/u/23041146?v=4", + "profile": "https://github.com/jespitae", + "contributions": [ + "code", + "test" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index af8af0d8c6..3b27ef72bb 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ [![Discussions](https://img.shields.io/github/discussions/asyncapi/modelina)](https://github.com/asyncapi/modelina/discussions) [![Website](https://img.shields.io/website?label=website&url=https%3A%2F%2Fwww.modelina.org)](https://www.modelina.org) [![Playground](https://img.shields.io/website?label=playground&url=https%3A%2F%2Fwww.modelina.org%2Fplayground)](https://www.modelina.org/playground) -[![All Contributors](https://img.shields.io/badge/all_contributors-90-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-91-orange.svg?style=flat-square)](#contributors-) Your one-stop tool for generating accurate and well-tested models for representing the message payloads. Use it as a tool in your development workflow, or a library in a larger integrations, entirely in your control. @@ -438,6 +438,7 @@ Thanks go out to these wonderful people ([emoji key](https://allcontributors.org Janne Husberg
Janne Husberg

💻 ⚠️ 🐛 borrull
borrull

💻 ⚠️ Kamil Zuzda
Kamil Zuzda

💻 + jespitae
jespitae

💻 ⚠️ From 7c3d127749f7a42d88917347c7990b49e1f73db6 Mon Sep 17 00:00:00 2001 From: Jerens Lensun <54782057+jerensl@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:03:59 +0800 Subject: [PATCH 30/73] style(website): make Playground Mobile Responsive (#2028) Co-authored-by: Ashmit JaiSarita Gupta <43639341+devilkiller-ag@users.noreply.github.com>%0ACo-authored-by: Jonas Lagoni --- modelina-website/package-lock.json | 14 ++ modelina-website/package.json | 1 + .../components/contexts/PlaygroundContext.tsx | 153 +++++++------- .../src/components/playground/Content.tsx | 132 ++++++++----- .../src/components/playground/Playground.tsx | 187 ++++++++++++------ .../src/components/playground/Sidebar.tsx | 49 ++++- modelina-website/src/pages/playground.tsx | 38 +--- modelina-website/tailwind.config.js | 142 ++++++------- 8 files changed, 424 insertions(+), 292 deletions(-) diff --git a/modelina-website/package-lock.json b/modelina-website/package-lock.json index 867424277a..47d7dcbc9f 100644 --- a/modelina-website/package-lock.json +++ b/modelina-website/package-lock.json @@ -13,6 +13,7 @@ "@tailwindcss/line-clamp": "^0.4.0", "@tailwindcss/typography": "^0.5.9", "@tippyjs/react": "^4.2.6", + "clsx": "^2.1.1", "cssnano": "^5.1.14", "js-base64": "^3.7.4", "lodash": "^4.17.21", @@ -1231,6 +1232,14 @@ "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "engines": { + "node": ">=6" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -7692,6 +7701,11 @@ "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" }, + "clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==" + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", diff --git a/modelina-website/package.json b/modelina-website/package.json index 4806ccb794..6fe2494e0b 100644 --- a/modelina-website/package.json +++ b/modelina-website/package.json @@ -21,6 +21,7 @@ "@tailwindcss/line-clamp": "^0.4.0", "@tailwindcss/typography": "^0.5.9", "@tippyjs/react": "^4.2.6", + "clsx": "^2.1.1", "cssnano": "^5.1.14", "js-base64": "^3.7.4", "lodash": "^4.17.21", diff --git a/modelina-website/src/components/contexts/PlaygroundContext.tsx b/modelina-website/src/components/contexts/PlaygroundContext.tsx index 9ed959ec20..b062694bc7 100644 --- a/modelina-website/src/components/contexts/PlaygroundContext.tsx +++ b/modelina-website/src/components/contexts/PlaygroundContext.tsx @@ -20,6 +20,8 @@ interface LoadedState { } interface PlaygroundContextProps { + showInputEditor: boolean; + setShowInputEditor: Dispatch>; showOptions: boolean; setShowOptions: Dispatch>; showOutputNavigation: boolean; @@ -50,9 +52,13 @@ interface PlaygroundContextProps { setRenderModels: (models: React.ReactNode) => void; } -const PlaygroundContext = createContext(undefined); +const PlaygroundContext = createContext( + undefined +); -export const PlaygroundContextProvider: React.FC<{ children: React.ReactNode; }> = ({ children }) => { +export const PlaygroundContextProvider: React.FC<{ + children: React.ReactNode; +}> = ({ children }) => { const defaultConfig: ModelinaOptions = { language: 'typescript', propertyNamingFormat: 'default', @@ -94,15 +100,18 @@ export const PlaygroundContextProvider: React.FC<{ children: React.ReactNode; }> kotlinPackageName: 'asyncapi.models' }; + const [showInputEditor, setShowInputEditor] = useState(true); const [showOptions, setShowOptions] = useState(true); const [showOutputNavigation, setShowOutputNavigation] = useState(true); const [config, setConfig] = useState(defaultConfig); - const [input, setInput] = useState(JSON.stringify(defaultAsyncapiDocument, null, 4)); + const [input, setInput] = useState( + JSON.stringify(defaultAsyncapiDocument, null, 4) + ); const [models, setModels] = useState([]); const [generatorCode, setGeneratorCode] = useState(''); const [loaded, setLoaded] = useState({ editorLoaded: false, - hasReceivedCode: false, + hasReceivedCode: false }); const [showGeneratorCode, setShowGeneratorCode] = useState(false); const [error, setError] = useState(false); @@ -110,79 +119,89 @@ export const PlaygroundContextProvider: React.FC<{ children: React.ReactNode; }> const [errorMessage, setErrorMessage] = useState('Bad Request'); const [isLoaded, setIsLoaded] = useState(false); const [hasLoadedQuery, setHasLoadedQuery] = useState(false); - const [renderModels, setRenderModels] = React.useState(null); + const [renderModels, setRenderModels] = + React.useState(null); - const contextValue = useMemo(() => ({ - showOptions, - setShowOptions, - showOutputNavigation, - setShowOutputNavigation, - config, - setConfig, - input, - setInput, - models, - setModels, - generatorCode, - setGeneratorCode, - loaded, - setLoaded, - showGeneratorCode, - setShowGeneratorCode, - error, - setError, - statusCode, - setStatusCode, - errorMessage, - setErrorMessage, - isLoaded, - setIsLoaded, - hasLoadedQuery, - setHasLoadedQuery, - renderModels, - setRenderModels - }), [ - showOptions, - setShowOptions, - showOutputNavigation, - setShowOutputNavigation, - config, - setConfig, - input, - setInput, - models, - setModels, - generatorCode, - setGeneratorCode, - loaded, - setLoaded, - showGeneratorCode, - setShowGeneratorCode, - error, - setError, - statusCode, - setStatusCode, - errorMessage, - setErrorMessage, - isLoaded, - setIsLoaded, - hasLoadedQuery, - setHasLoadedQuery, - renderModels, - setRenderModels, - ]); + const contextValue = useMemo( + () => ({ + showInputEditor, + setShowInputEditor, + showOptions, + setShowOptions, + showOutputNavigation, + setShowOutputNavigation, + config, + setConfig, + input, + setInput, + models, + setModels, + generatorCode, + setGeneratorCode, + loaded, + setLoaded, + showGeneratorCode, + setShowGeneratorCode, + error, + setError, + statusCode, + setStatusCode, + errorMessage, + setErrorMessage, + isLoaded, + setIsLoaded, + hasLoadedQuery, + setHasLoadedQuery, + renderModels, + setRenderModels + }), + [ + showInputEditor, + setShowInputEditor, + showOptions, + setShowOptions, + showOutputNavigation, + setShowOutputNavigation, + config, + setConfig, + input, + setInput, + models, + setModels, + generatorCode, + setGeneratorCode, + loaded, + setLoaded, + showGeneratorCode, + setShowGeneratorCode, + error, + setError, + statusCode, + setStatusCode, + errorMessage, + setErrorMessage, + isLoaded, + setIsLoaded, + hasLoadedQuery, + setHasLoadedQuery, + renderModels, + setRenderModels + ] + ); return ( {children} ); -} +}; export const usePlaygroundContext = () => { const context = useContext(PlaygroundContext); if (!context) { - throw new Error('Playground was unable to load the context to display, please report this problem on GitHub.'); + throw new Error( + 'Playground was unable to load the context to display, please report this problem on GitHub.' + ); } return context; -}; \ No newline at end of file +}; diff --git a/modelina-website/src/components/playground/Content.tsx b/modelina-website/src/components/playground/Content.tsx index 6e6f457185..465ed7bba3 100644 --- a/modelina-website/src/components/playground/Content.tsx +++ b/modelina-website/src/components/playground/Content.tsx @@ -8,17 +8,27 @@ import CustomError from '../CustomError'; import OutputNavigation from './OutputNavigation'; import { OptionsNavigation } from './OptionsNavigation'; import GeneratedModelsComponent from './GeneratedModels'; +import clsx from 'clsx'; interface ContentProps { - setNewConfig: (config: string, configValue: any, updateCode?: boolean) => void; + setNewConfig: ( + config: string, + configValue: any, + updateCode?: boolean + ) => void; setNewQuery: (queryKey: string, queryValue: any) => void; generateNewCode: (input: string) => void; } -export const Content: FunctionComponent = ({ setNewConfig, setNewQuery, generateNewCode }) => { +export const Content: FunctionComponent = ({ + setNewConfig, + setNewQuery, + generateNewCode +}) => { const { config, input, + showInputEditor, setInput, models, loaded, @@ -27,63 +37,81 @@ export const Content: FunctionComponent = ({ setNewConfig, setNewQ statusCode, errorMessage, showOptions, - showOutputNavigation, + showOutputNavigation } = usePlaygroundContext(); - const PlaygroundGeneratedContextValue = useMemo(() => ({ - language: config.language, - models: models - }), [config.language, models]); + const PlaygroundGeneratedContextValue = useMemo( + () => ({ + language: config.language, + models + }), + [config.language, models] + ); return ( -
- {/* OPTIONS & EDITOR */} -
- { - showOptions &&
- -
- } -
-
-
- { - setInput(change); - generateNewCode(change); - }} - editorDidMount={() => { - setLoaded({ ...loaded, editorLoaded: true }); - }} - language="json" - /> -
-
-
+
+
+
- - {/* OUTPUT NAVIGATION AND OUTPUTS */} -
- { - showOutputNavigation &&
- -
- } -
-
- {error ? ( - - ) : ( - - - - )} -
+
+ +
+
+
+ { + setInput(change); + generateNewCode(change); + }} + editorDidMount={() => { + setLoaded({ ...loaded, editorLoaded: true }); + }} + language="json" + />
+
+ {error ? ( + + ) : ( + + + + )} +
); }; diff --git a/modelina-website/src/components/playground/Playground.tsx b/modelina-website/src/components/playground/Playground.tsx index fae6a49957..5f269da3af 100644 --- a/modelina-website/src/components/playground/Playground.tsx +++ b/modelina-website/src/components/playground/Playground.tsx @@ -1,11 +1,7 @@ import React, { useEffect, useState } from 'react'; import Router, { withRouter, NextRouter } from 'next/router'; import { encode } from 'js-base64'; -import { - ModelinaQueryOptions, - GenerateMessage, - UpdateMessage -} from '@/types'; +import { ModelinaQueryOptions, GenerateMessage, UpdateMessage } from '@/types'; import { getTypeScriptGeneratorCode } from '@/helpers/GeneratorCode/TypeScriptGenerator'; import { getJavaScriptGeneratorCode } from '@/helpers/GeneratorCode/JavaScriptGenerator'; import { getJavaGeneratorCode } from '@/helpers/GeneratorCode/JavaGenerator'; @@ -44,7 +40,7 @@ const Playground: React.FC = (props) => { isLoaded, setIsLoaded, hasLoadedQuery, - setHasLoadedQuery, + setHasLoadedQuery } = usePlaygroundContext(); // To avoid hydration error @@ -64,16 +60,28 @@ const Playground: React.FC = (props) => { setConfig({ ...config, language: query.language as any }); } if (query.enumKeyNamingFormat !== undefined) { - setConfig({ ...config, enumKeyNamingFormat: query.enumKeyNamingFormat as any }); + setConfig({ + ...config, + enumKeyNamingFormat: query.enumKeyNamingFormat as any + }); } if (query.propertyNamingFormat !== undefined) { - setConfig({ ...config, propertyNamingFormat: query.propertyNamingFormat as any }); + setConfig({ + ...config, + propertyNamingFormat: query.propertyNamingFormat as any + }); } if (query.modelNamingFormat !== undefined) { - setConfig({ ...config, modelNamingFormat: query.modelNamingFormat as any }); + setConfig({ + ...config, + modelNamingFormat: query.modelNamingFormat as any + }); } if (query.showTypeMappingExample !== undefined) { - setConfig({ ...config, showTypeMappingExample: query.showTypeMappingExample === 'true' }); + setConfig({ + ...config, + showTypeMappingExample: query.showTypeMappingExample === 'true' + }); } if (query.indentationType !== undefined) { setConfig({ ...config, indentationType: query.indentationType as any }); @@ -91,37 +99,64 @@ const Playground: React.FC = (props) => { setConfig({ ...config, tsMapType: query.tsMapType as any }); } if (query.tsIncludeDescriptions !== undefined) { - setConfig({ ...config, tsIncludeDescriptions: query.tsIncludeDescriptions === 'true' }); + setConfig({ + ...config, + tsIncludeDescriptions: query.tsIncludeDescriptions === 'true' + }); } if (query.tsIncludeJsonBinPack !== undefined) { - setConfig({ ...config, tsIncludeJsonBinPack: query.tsIncludeJsonBinPack === 'true' }); + setConfig({ + ...config, + tsIncludeJsonBinPack: query.tsIncludeJsonBinPack === 'true' + }); } if (query.tsIncludeExampleFunction !== undefined) { - setConfig({ ...config, tsIncludeExampleFunction: query.tsIncludeExampleFunction === 'true' }); + setConfig({ + ...config, + tsIncludeExampleFunction: query.tsIncludeExampleFunction === 'true' + }); } if (query.csharpArrayType !== undefined) { setConfig({ ...config, csharpArrayType: query.csharpArrayType as any }); } if (query.csharpAutoImplemented !== undefined) { - setConfig({ ...config, csharpAutoImplemented: query.csharpAutoImplemented === 'true' }); + setConfig({ + ...config, + csharpAutoImplemented: query.csharpAutoImplemented === 'true' + }); } if (query.csharpOverwriteHashcode !== undefined) { - setConfig({ ...config, csharpOverwriteHashcode: query.csharpOverwriteHashcode === 'true' }); + setConfig({ + ...config, + csharpOverwriteHashcode: query.csharpOverwriteHashcode === 'true' + }); } if (query.phpIncludeDescriptions !== undefined) { - setConfig({ ...config, phpIncludeDescriptions: query.phpIncludeDescriptions === 'true' }); + setConfig({ + ...config, + phpIncludeDescriptions: query.phpIncludeDescriptions === 'true' + }); } if (query.phpNamespace !== undefined) { setConfig({ ...config, phpNamespace: query.phpNamespace }); } if (query.csharpIncludeJson !== undefined) { - setConfig({ ...config, csharpIncludeJson: query.csharpIncludeJson === 'true' }); + setConfig({ + ...config, + csharpIncludeJson: query.csharpIncludeJson === 'true' + }); } if (query.csharpOverwriteEqual !== undefined) { - setConfig({ ...config, csharpOverwriteEqual: query.csharpOverwriteEqual === 'true' }); + setConfig({ + ...config, + csharpOverwriteEqual: query.csharpOverwriteEqual === 'true' + }); } if (query.csharpIncludeNewtonsoft !== undefined) { - setConfig({ ...config, csharpIncludeNewtonsoft: query.csharpIncludeNewtonsoft === 'true' }); + setConfig({ + ...config, + csharpIncludeNewtonsoft: query.csharpIncludeNewtonsoft === 'true' + }); } if (query.csharpNamespace !== undefined) { setConfig({ ...config, csharpNamespace: query.csharpNamespace }); @@ -136,28 +171,46 @@ const Playground: React.FC = (props) => { setConfig({ ...config, javaPackageName: query.javaPackageName }); } if (query.javaIncludeJackson !== undefined) { - setConfig({ ...config, javaIncludeJackson: query.javaIncludeJackson === 'true' }); + setConfig({ + ...config, + javaIncludeJackson: query.javaIncludeJackson === 'true' + }); } if (query.javaIncludeMarshaling !== undefined) { - setConfig({ ...config, javaIncludeMarshaling: query.javaIncludeMarshaling === 'true' }); + setConfig({ + ...config, + javaIncludeMarshaling: query.javaIncludeMarshaling === 'true' + }); } if (query.javaArrayType !== undefined) { setConfig({ ...config, javaArrayType: query.javaArrayType as any }); } if (query.javaOverwriteHashcode !== undefined) { - setConfig({ ...config, javaOverwriteHashcode: query.javaOverwriteHashcode === 'true' }); + setConfig({ + ...config, + javaOverwriteHashcode: query.javaOverwriteHashcode === 'true' + }); } if (query.javaOverwriteEqual !== undefined) { - setConfig({ ...config, javaOverwriteEqual: query.javaOverwriteEqual === 'true' }); + setConfig({ + ...config, + javaOverwriteEqual: query.javaOverwriteEqual === 'true' + }); } if (query.javaOverwriteToString !== undefined) { - setConfig({ ...config, javaOverwriteToString: query.javaOverwriteToString === 'true' }); + setConfig({ + ...config, + javaOverwriteToString: query.javaOverwriteToString === 'true' + }); } if (query.javaJavaDocs !== undefined) { setConfig({ ...config, javaJavaDocs: query.javaJavaDocs === 'true' }); } if (query.javaJavaxAnnotation !== undefined) { - setConfig({ ...config, javaJavaxAnnotation: query.javaJavaxAnnotation === 'true' }); + setConfig({ + ...config, + javaJavaxAnnotation: query.javaJavaxAnnotation === 'true' + }); } if (query.goPackageName !== undefined) { setConfig({ ...config, goPackageName: query.goPackageName }); @@ -185,7 +238,11 @@ const Playground: React.FC = (props) => { } }, [props.router.isReady, hasLoadedQuery]); - const setNewConfig = (configName: string, configValue: any, updateCode?: boolean) => { + const setNewConfig = ( + configName: string, + configValue: any, + updateCode?: boolean + ) => { setNewQuery(configName, configValue); /* eslint-disable-next-line security/detect-object-injection */ (config as any)[configName] = configValue; @@ -248,32 +305,38 @@ const Playground: React.FC = (props) => { fetch(`${process.env.NEXT_PUBLIC_API_PATH}/generate`, { body: JSON.stringify(message), method: 'POST' - }).then(async (res) => { - if (!res.ok) { - throw new Error(res.statusText); - } + }) + .then(async (res) => { + if (!res.ok) { + throw new Error(res.statusText); + } - const response: UpdateMessage = await res.json(); - setGeneratorCode(generatorCode); - setModels(response.models); - setLoaded({ - ...loaded, - hasReceivedCode: true + const response: UpdateMessage = await res.json(); + setGeneratorCode(generatorCode); + setModels(response.models); + setLoaded({ + ...loaded, + hasReceivedCode: true + }); + setError(false); + setStatusCode(200); + setErrorMessage(''); + }) + .catch((error) => { + console.error(error); + setError(true); + setErrorMessage( + 'Input is not a correct AsyncAPI document, so it cannot be processed.' + ); + setStatusCode(500); }); - setError(false); - setStatusCode(200); - setErrorMessage(''); - }).catch(error => { - console.error(error); - setError(true); - setErrorMessage("Input is not a correct AsyncAPI document, so it cannot be processed."); - setStatusCode(500); - }); } } catch (e: any) { console.error(e); setError(true); - setErrorMessage("Input is not a correct AsyncAPI document, so it cannot be processed."); + setErrorMessage( + 'Input is not a correct AsyncAPI document, so it cannot be processed.' + ); setStatusCode(400); } }; @@ -284,24 +347,20 @@ const Playground: React.FC = (props) => { return (
- { - isLoaded - ? -
- Loading Modelina Playground. Rendering playground components... -
- : -
-
-
- -
-
- -
-
-
- } + {isLoaded ? ( +
+ Loading Modelina Playground. Rendering playground components... +
+ ) : ( +
+ + +
+ )}
); }; diff --git a/modelina-website/src/components/playground/Sidebar.tsx b/modelina-website/src/components/playground/Sidebar.tsx index 45e91a1424..16f3496de1 100644 --- a/modelina-website/src/components/playground/Sidebar.tsx +++ b/modelina-website/src/components/playground/Sidebar.tsx @@ -1,13 +1,17 @@ import React from 'react'; import { IoOptionsOutline } from 'react-icons/io5'; import { VscListSelection } from 'react-icons/vsc'; +import { LuFileInput, LuFileOutput } from 'react-icons/lu'; import { Tooltip } from './Tooltip'; import { usePlaygroundContext } from '../contexts/PlaygroundContext'; +import clsx from 'clsx'; interface SidebarItem { name: string; title: string; isActive: boolean; + isShow: boolean; + mobileOnly: boolean; onClick: () => void; icon: React.ReactNode; tooltip: React.ReactNode; @@ -16,13 +20,40 @@ interface SidebarItem { interface SidebarProps {} export const Sidebar: React.FunctionComponent = () => { - const { setShowOptions, setShowOutputNavigation } = usePlaygroundContext(); + const { + setShowOptions, + setShowOutputNavigation, + setShowInputEditor, + showInputEditor, + showOptions + } = usePlaygroundContext(); const sidebarItems: SidebarItem[] = [ + // Input/Output Editor + { + name: 'input-editor', + title: 'Input Editor', + isActive: false, + isShow: true, + mobileOnly: true, + onClick: () => { + setShowInputEditor((prevShowOptions) => !prevShowOptions); + setShowOutputNavigation(false); + setShowOptions(false); + }, + icon: showInputEditor ? ( + + ) : ( + + ), + tooltip: `Show ${showInputEditor ? 'Input Editor' : 'Output Editor'}` + }, // Options { name: 'options', title: 'Options', - isActive: false, + isActive: showOptions, + isShow: true, + mobileOnly: false, onClick: () => { setShowOptions((prevShowOptions) => !prevShowOptions); }, @@ -34,8 +65,12 @@ export const Sidebar: React.FunctionComponent = () => { name: 'outputExplorer', title: 'Output', isActive: false, + isShow: showInputEditor, + mobileOnly: false, onClick: () => { - setShowOutputNavigation((prevShowOutputNavigation) => !prevShowOutputNavigation); + setShowOutputNavigation( + (prevShowOutputNavigation) => !prevShowOutputNavigation + ); }, icon: , tooltip: 'Show or hide the list of output models' @@ -55,7 +90,13 @@ export const Sidebar: React.FunctionComponent = () => {
@@ -336,22 +322,14 @@ registerLanguage('asyncapi+yaml', (hljs: any) => { const STRING = { className: 'string', relevance: 0, - variants: [ - { begin: /'/, end: /'/ }, - { begin: /"/, end: /"/ }, - { begin: /\S+/ } - ], + variants: [{ begin: /'/, end: /'/ }, { begin: /"/, end: /"/ }, { begin: /\S+/ }], contains: [hljs.BACKSLASH_ESCAPE, TEMPLATE_VARIABLES] }; // Strings inside of value containers (objects) can't contain braces, // brackets, or commas const CONTAINER_STRING = hljs.inherit(STRING, { - variants: [ - { begin: /'/, end: /'/ }, - { begin: /"/, end: /"/ }, - { begin: /[^\s,{}[\]]+/ } - ] + variants: [{ begin: /'/, end: /'/ }, { begin: /"/, end: /"/ }, { begin: /[^\s,{}[\]]+/ }] }); const DATE_RE = '[0-9]{4}(-[0-9][0-9]){0,2}'; @@ -467,6 +445,7 @@ registerLanguage('asyncapi+yaml', (hljs: any) => { ]; const VALUE_MODES = [...MODES]; + VALUE_MODES.pop(); VALUE_MODES.push(CONTAINER_STRING); VALUE_CONTAINER.contains = VALUE_MODES as any; diff --git a/modelina-website/src/components/CustomError.tsx b/modelina-website/src/components/CustomError.tsx index d68c4b0f49..8585ef63bc 100644 --- a/modelina-website/src/components/CustomError.tsx +++ b/modelina-website/src/components/CustomError.tsx @@ -1,15 +1,21 @@ +import Exclamation from './icons/Exclamation'; import Heading from './typography/Heading'; -import Exclamation from "./icons/Exclamation"; -function CustomError({ statusCode, errorMessage }: {statusCode: number, errorMessage: string}) { +function CustomError({ + statusCode, + errorMessage +}: { + statusCode: number; + errorMessage: string; +}) { return ( -
-
-
+
+
+
Error: {statusCode} -

+

{errorMessage}

@@ -17,4 +23,4 @@ function CustomError({ statusCode, errorMessage }: {statusCode: number, errorMes ); } -export default CustomError; \ No newline at end of file +export default CustomError; diff --git a/modelina-website/src/components/InfoModal.tsx b/modelina-website/src/components/InfoModal.tsx index ac84d75c86..b8c02b5513 100644 --- a/modelina-website/src/components/InfoModal.tsx +++ b/modelina-website/src/components/InfoModal.tsx @@ -1,61 +1,59 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; interface InfoModalProps { - text: string; - children: React.ReactNode; + text: string; + children: React.ReactNode; } export default function InfoModal(props: InfoModalProps) { - - const [showModal, setShowModal] = useState(false); - - const onOpenModal = () => { - setShowModal(true) - document.body.style.overflowY = 'hidden' - }; - - const onCloseModal = () => { - setShowModal(false) - document.body.style.overflowY = 'scroll' - }; - - const MyModal = () => { - return ( - <> -
-
-
-

{props.text}

-
- {props.children} -
-
-
- - ) - } - - return ( - <> - - {showModal && } - - ) - -} \ No newline at end of file + const [showModal, setShowModal] = useState(false); + + const onOpenModal = () => { + setShowModal(true); + document.body.style.overflowY = 'hidden'; + }; + + const onCloseModal = () => { + setShowModal(false); + document.body.style.overflowY = 'scroll'; + }; + + const MyModal = () => ( + <> +
+
+
+
+

{props.text}

+ +
+
{props.children}
+
+
+ + ); + + return ( + <> + + {showModal && } + + ); +} diff --git a/modelina-website/src/components/MonacoEditorWrapper.tsx b/modelina-website/src/components/MonacoEditorWrapper.tsx index 18f58b853c..d5f0ff8ba5 100644 --- a/modelina-website/src/components/MonacoEditorWrapper.tsx +++ b/modelina-website/src/components/MonacoEditorWrapper.tsx @@ -1,17 +1,14 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { useEffect, useRef } from 'react'; -import PropTypes from 'prop-types'; import Editor, { useMonaco } from '@monaco-editor/react'; import { debounce } from 'lodash'; +// eslint-disable-next-line import/no-extraneous-dependencies +import PropTypes from 'prop-types'; +import { useEffect, useRef } from 'react'; export default function MonacoEditorWrapper({ language, theme = 'asyncapi-theme', onChange = undefined, value, - highlightedLines = [], - highlightedRanges = [], - updateHighlightOnChange = false, options, editorDidMount, ...props @@ -22,28 +19,30 @@ export default function MonacoEditorWrapper({ const handleEditorDidMount = (editor: any) => { editor.onDidChangeModelContent((ev: any) => { const currentValue = editor.getValue(); + if (currentValue !== previousValue.current) { previousValue.current = currentValue; - const value = debouncedOnChange(ev, currentValue); + const debouncedValue = debouncedOnChange(ev, currentValue); - if (typeof value === 'string' && currentValue !== value) { - editor.setValue(value); + if (typeof debouncedValue === 'string' && currentValue !== value) { + editor.setValue(debouncedValue); } } }); editorDidMount(editor.getValue, editor); }; - //Alias because Modelina uses cplusplus - if(language === 'cplusplus') { + + // Alias because Modelina uses cplusplus + + if (language === 'cplusplus') { + // eslint-disable-next-line no-param-reassign language = 'cpp'; } useEffect(() => { // do conditional chaining - monacoInstance?.languages.typescript.javascriptDefaults.setEagerModelSync( - true - ); + monacoInstance?.languages.typescript.javascriptDefaults.setEagerModelSync(true); // or make sure that it exists by other ways if (monacoInstance) { monacoInstance.editor.defineTheme('asyncapi-theme', { diff --git a/modelina-website/src/components/Select.tsx b/modelina-website/src/components/Select.tsx index d1b2d5a29c..0899c50894 100644 --- a/modelina-website/src/components/Select.tsx +++ b/modelina-website/src/components/Select.tsx @@ -1,11 +1,6 @@ import { twMerge } from 'tailwind-merge'; -export default function Select({ - className = '', - onChange = () => {}, - options = [], - value -}: any) { +export default function Select({ className = '', onChange = () => {}, options = [], value }: any) { return (