Skip to content

Commit

Permalink
Merge branch 'master' into docs-fix-incorrect-indentation-in-websocke…
Browse files Browse the repository at this point in the history
…t-tutorial
  • Loading branch information
asyncapi-bot authored Dec 16, 2024
2 parents 537947a + 4f9e745 commit efbc236
Show file tree
Hide file tree
Showing 77 changed files with 1,784 additions and 711 deletions.
6 changes: 3 additions & 3 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
]
},
{
"login": "alequetzalli",
"name": "Alejandra Quetzalli ",
"login": "quetzalliwrites",
"name": "Quetzalli Writes",
"avatar_url": "https://avatars.githubusercontent.com/u/19964402?v=4",
"profile": "https://github.com/alequetzalli",
"profile": "https://github.com/quetzalliwrites",
"contributions": [
"doc",
"review",
Expand Down
35 changes: 35 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
language: "en-US"
reviews:
high_level_summary: true
tools:
markdownlint:
enabled: true
biome:
enabled: true
github-checks:
enabled: true
timeout_ms: 180000
languagetool:
enabled: true
enabled_only: false
level: default
hadolint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
eslint:
enabled: true
actionlint:
enabled: true
semgrep:
enabled: true
knowledge_base:
opt_out: false
learnings:
scope: "local"
issues:
scope: "local"
pull_requests:
scope: "local"
45 changes: 0 additions & 45 deletions .coderrabbit.yml

This file was deleted.

37 changes: 21 additions & 16 deletions .github/workflows/notify-triager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ jobs:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 0
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Get commit message
id: commit-message
run: |
# Extract the commit message
commit_message=$(git log --format=%B -n 1 ${{ github.event.pull_request.head.sha }})
commit_message=$(echo "$commit_message" | tr '\n' ' ')
commit_message=$(echo "$commit_message" | sed 's/[<>|]//g' | sed 's/[][]//g' | sed 's/(//g' | sed 's/)//g' | xargs)
echo "commit_message=$commit_message" >> $GITHUB_OUTPUT
- name: Check if last commit is a merge commit
Expand All @@ -31,23 +35,23 @@ jobs:
echo "isMergeCommit=false" >> $GITHUB_OUTPUT
fi
- name: Checkout asyncapi/website Repository
uses: actions/[email protected]
- name: Count changed files
id: changed_files
run: |
# Get the list of files changed in the latest commit
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }})
- name: Check PR Changes for .md files
id: md-pr-changes
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0
with:
files: |
**.md
# Initialize counters
md_count=0
non_md_count=0
- name: Check PR Changes for non-.md files
id: non-md-pr-changes
uses: tj-actions/changed-files@aa08304bd477b800d468db44fe10f6c61f7f7b11 # version 42.1.0 https://github.com/tj-actions/changed-files/releases/tag/v42.1.0
with:
files: |
!**.md
# Count .md files
md_count=$(echo "$changed_files" | grep -c '\.md$' || true)
# Count non-.md files
non_md_count=$(echo "$changed_files" | grep -vc '\.md$' || true)
echo "md_count=$md_count" >> $GITHUB_OUTPUT
echo "non_md_count=$non_md_count" >> $GITHUB_OUTPUT
- name: Extract Doc Triage Maintainers
id: doc-triager
Expand All @@ -68,7 +72,7 @@ jobs:
echo "codeTriagers=$codeTriagers" >> $GITHUB_ENV
- name: Add Reviewers for code files
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.non-md-pr-changes.outputs.any_changed == 'true'
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed_files.outputs.non_md_count > 0 }}
run: |
IFS=' ' read -r -a codeTriagers <<< "${{ env.codeTriagers }}"
reviewers=$(printf ', "%s"' "${codeTriagers[@]}")
Expand All @@ -83,7 +87,7 @@ jobs:
}"
- name: Add Reviewers for doc files
if: steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.md-pr-changes.outputs.any_changed == 'true'
if: ${{ steps.check-merge-branch.outputs.isMergeCommit == 'false' && steps.changed_files.outputs.md_count > 0 }}
run: |
IFS=' ' read -r -a docTriagers <<< "${{ env.docTriagers }}"
reviewers=$(printf ', "%s"' "${docTriagers[@]}")
Expand All @@ -96,3 +100,4 @@ jobs:
-d "{
\"reviewers\": $reviewers
}"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ After cloning repository to your local, perform the following steps from the roo
#### Steps:
1. Build the Docker image:
```bash
docker build -t asyncapi-website .`
docker build -t asyncapi-website .
```
2. Start the container:
```bash
Expand Down Expand Up @@ -336,7 +336,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="http://www.fmvilas.com/"><img src="https://avatars.githubusercontent.com/u/242119?v=4?s=100" width="100px;" alt="Fran Méndez"/><br /><sub><b>Fran Méndez</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=fmvilas" title="Code">💻</a> <a href="https://github.com/asyncapi/website/commits?author=fmvilas" title="Documentation">📖</a> <a href="https://github.com/asyncapi/website/issues?q=author%3Afmvilas" title="Bug reports">🐛</a> <a href="#design-fmvilas" title="Design">🎨</a> <a href="#maintenance-fmvilas" title="Maintenance">🚧</a> <a href="#infra-fmvilas" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-fmvilas" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/asyncapi/website/pulls?q=is%3Apr+reviewed-by%3Afmvilas" title="Reviewed Pull Requests">👀</a> <a href="#blog-fmvilas" title="Blogposts">📝</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://dev.to/derberg"><img src="https://avatars.githubusercontent.com/u/6995927?v=4?s=100" width="100px;" alt="Lukasz Gornicki"/><br /><sub><b>Lukasz Gornicki</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=derberg" title="Code">💻</a> <a href="https://github.com/asyncapi/website/commits?author=derberg" title="Documentation">📖</a> <a href="https://github.com/asyncapi/website/issues?q=author%3Aderberg" title="Bug reports">🐛</a> <a href="#design-derberg" title="Design">🎨</a> <a href="#maintenance-derberg" title="Maintenance">🚧</a> <a href="#infra-derberg" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-derberg" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/asyncapi/website/pulls?q=is%3Apr+reviewed-by%3Aderberg" title="Reviewed Pull Requests">👀</a> <a href="#blog-derberg" title="Blogposts">📝</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/magicmatatjahu"><img src="https://avatars.githubusercontent.com/u/20404945?v=4?s=100" width="100px;" alt="Maciej Urbańczyk"/><br /><sub><b>Maciej Urbańczyk</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=magicmatatjahu" title="Code">💻</a> <a href="https://github.com/asyncapi/website/commits?author=magicmatatjahu" title="Documentation">📖</a> <a href="https://github.com/asyncapi/website/issues?q=author%3Amagicmatatjahu" title="Bug reports">🐛</a> <a href="#design-magicmatatjahu" title="Design">🎨</a> <a href="#maintenance-magicmatatjahu" title="Maintenance">🚧</a> <a href="#infra-magicmatatjahu" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#ideas-magicmatatjahu" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/asyncapi/website/pulls?q=is%3Apr+reviewed-by%3Amagicmatatjahu" title="Reviewed Pull Requests">👀</a> <a href="#blog-magicmatatjahu" title="Blogposts">📝</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/alequetzalli"><img src="https://avatars.githubusercontent.com/u/19964402?v=4?s=100" width="100px;" alt="Alejandra Quetzalli "/><br /><sub><b>Alejandra Quetzalli </b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=alequetzalli" title="Documentation">📖</a> <a href="https://github.com/asyncapi/website/pulls?q=is%3Apr+reviewed-by%3Aalequetzalli" title="Reviewed Pull Requests">👀</a> <a href="#talk-alequetzalli" title="Talks">📢</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/quetzalliwrites"><img src="https://avatars.githubusercontent.com/u/19964402?v=4?s=100" width="100px;" alt="Quetzalli Writes "/><br /><sub><b>Quetzalli Writes</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=quetzalliwrites" title="Documentation">📖</a> <a href="https://github.com/asyncapi/website/pulls?q=is%3Apr+reviewed-by%3Aquetzalliwrites" title="Reviewed Pull Requests">👀</a> <a href="#talk-quetzalliwrites" title="Talks">📢</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://aayushmau5.github.io/"><img src="https://avatars.githubusercontent.com/u/54525741?v=4?s=100" width="100px;" alt="Aayush Kumar Sahu"/><br /><sub><b>Aayush Kumar Sahu</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=aayushmau5" title="Code">💻</a> <a href="https://github.com/asyncapi/website/issues?q=author%3Aaayushmau5" title="Bug reports">🐛</a> <a href="#design-aayushmau5" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://boyney.io/"><img src="https://avatars.githubusercontent.com/u/3268013?v=4?s=100" width="100px;" alt="David Boyne"/><br /><sub><b>David Boyne</b></sub></a><br /><a href="https://github.com/asyncapi/website/commits?author=boyney123" title="Code">💻</a> <a href="#design-boyney123" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jessemenning"><img src="https://avatars.githubusercontent.com/u/62108913?v=4?s=100" width="100px;" alt="Jesse Menning"/><br /><sub><b>Jesse Menning</b></sub></a><br /><a href="#blog-jessemenning" title="Blogposts">📝</a></td>
Expand Down
2 changes: 1 addition & 1 deletion assets/docs/fragments/contribution-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ To get started as a Docs contributor:

Do you have a documentation contributor question and you're wondering how to tag me into a GitHub discussion or PR? Never fear!

Tag me in your AsyncAPI Doc PRs or [GitHub Discussions](https://github.com/asyncapi/community/discussions/categories/docs) via my GitHub handle, [`alequetzalli`](https://github.com/alequetzalli) 🐙.
Tag me in your AsyncAPI Doc PRs or [GitHub Discussions](https://github.com/asyncapi/community/discussions/categories/docs) via my GitHub handle, [`quetzalliwrites`](https://github.com/quetzalliwrites) 🐙.
2 changes: 2 additions & 0 deletions components/AlgoliaSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ export function SearchButton({ children, indexName = INDEX_NAME, ...props }: ISe
useEffect(() => {
if (typeof children === 'function') {
setChildren(children({ actionKey }));
} else {
setChildren(children);
}
}, []);

Expand Down
21 changes: 13 additions & 8 deletions components/Calendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,16 @@ export default function Calendar({ className = '', size }: ICalendarProps) {

const CALENDAR_URL =
'https://calendar.google.com/calendar/embed?src=c_q9tseiglomdsj6njuhvbpts11c%40group.calendar.google.com&ctz=UTC';
const eventsExist = eventsData.length > 0;
const currentDate = new Date();
const eventsExist = eventsData?.filter((event: IEvent) => moment(event.date).isAfter(currentDate)).length > 0;

return (
<div className={twMerge('overflow-hidden rounded-md border border-gray-200 bg-white p-4', className)}>
<div
className={twMerge(
'overflow-hidden rounded-md border border-gray-200 bg-white p-4 h-full flex flex-col gap-2',
className
)}
>
<Heading level={HeadingLevel.h2} typeStyle={HeadingTypeStyle.mdSemibold}>
{t('calendar.title')}
</Heading>
Expand All @@ -43,7 +49,7 @@ export default function Calendar({ className = '', size }: ICalendarProps) {
<span className='flex-1 self-center text-center'>{moment(event.date).format('D')}</span>
</div>
<div className='grow text-left sm:mt-0 sm:pl-6'>
<h2 className='title-font text-xl font-medium text-gray-900 hover:text-gray-500'>{event.title}</h2>
<h2 className='title-font font-medium text-gray-900 hover:text-gray-500'>{event.title}</h2>
<p className='text-gray-600'>
{moment(event.date).local().format('LLLL')} UTC
{moment(event.date).local().format('Z')}
Expand All @@ -53,13 +59,12 @@ export default function Calendar({ className = '', size }: ICalendarProps) {
</li>
))}
</ul>
{eventsExist ? (
<div className='pt-4' data-testid='Calendar-button'>
<div className='h-full content-center'>
{!eventsExist && <div className='font-bold text-gray-700 lg:pb-8'>{t('calendar.noMeetingsMessage')}</div>}
<div className='sm:pt-0 md:pt-2 lg:pb-8 lg:pt-0' data-testid='Calendar-button'>
<GoogleCalendarButton href={CALENDAR_URL} text={t('calendar.viewCalendarBtn')} />
</div>
) : (
<div className='mt-2 text-gray-700'>{t('calendar.noMeetingsMessage')}</div>
)}
</div>
</div>
);
}
4 changes: 2 additions & 2 deletions components/MDX/MDX.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MDXProvider as CoreMDXProvider } from '@mdx-js/react';
import mermaid from 'mermaid';
import Link from 'next/link';
import React, { useLayoutEffect, useState } from 'react';
import React, { useEffect, useState } from 'react';
import {
TwitterDMButton,
TwitterFollowButton,
Expand Down Expand Up @@ -97,7 +97,7 @@ function MermaidDiagram({ graph }: MermaidDiagramProps) {
/**
* @description Renders the Mermaid diagram.
*/
useLayoutEffect(() => {
useEffect(() => {
if (!graph) {
return;
}
Expand Down
29 changes: 16 additions & 13 deletions components/NewsletterSubscribe.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useTranslation } from 'next-i18next';
import React, { useState } from 'react';

import IconCircularLoader from '@/components/icons/CircularLoader';
import { ButtonType } from '@/types/components/buttons/ButtonPropsType';
import { InputTypes } from '@/types/components/InputBoxPropsType';
import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading';

import { useTranslation } from '../utils/i18n';
import Button from './buttons/Button';
import InputBox from './InputBox';
import Loader from './Loader';
Expand All @@ -26,6 +26,7 @@ interface NewsletterSubscribeProps {
title?: string;
subtitle?: string;
type?: string;
errorSubtitle?: string;
}

/**
Expand All @@ -37,19 +38,21 @@ interface NewsletterSubscribeProps {
* @param {string} props.title - The title of the Subscribe card.
* @param {string} props.subtitle - The subtitle of the Subscribe card.
* @param {string} props.type - The type of subscription.
* @param {string} props.errorSubtitle - The error subtitle to be displayed.
*/
export default function NewsletterSubscribe({
className = 'p-8 text-center text-black',
dark = false,
title = 'Subscribe to our newsletter to receive news about AsyncAPI.',
subtitle = 'We respect your inbox. No spam, promise ✌️',
type = 'Newsletter'
type = 'Newsletter',
errorSubtitle = 'Subscription failed, please let us know about it by submitting a bug'
}: NewsletterSubscribeProps) {
const [email, setEmail] = useState<string>('');
const [name, setName] = useState<string>('');
const [status, setStatus] = useState<FormStatus>(FormStatus.NORMAL);

const { t } = useTranslation('common');
const { t, ready } = useTranslation('common', { keyPrefix: 'newsletterCTA' });

const headTextColor = dark ? 'text-white' : '';
const paragraphTextColor = dark ? 'text-gray-300' : '';
Expand Down Expand Up @@ -94,10 +97,10 @@ export default function NewsletterSubscribe({
return (
<div className={className} data-testid='NewsletterSubscribe-main'>
<Heading level={HeadingLevel.h3} textColor={headTextColor} typeStyle={HeadingTypeStyle.lg} className='mb-4'>
{t('newsletterCTA.successTitle')}
{ready ? t('successTitle') : 'Thank you for subscribing!'}
</Heading>
<Paragraph className='mb-8' textColor={paragraphTextColor}>
{t('newsletterCTA.subtitle')}
{ready ? t('subtitle') : subtitle}
</Paragraph>
</div>
);
Expand All @@ -107,12 +110,12 @@ export default function NewsletterSubscribe({
return (
<div className={className} data-testid='NewsletterSubscribe-main'>
<Heading level={HeadingLevel.h3} textColor={headTextColor} typeStyle={HeadingTypeStyle.lg} className='mb-4'>
{t('newsletterCTA.errorTitle')}
{ready ? t('errorTitle') : 'Something went wrong'}
</Heading>
<Paragraph className='mb-8' textColor={paragraphTextColor}>
{t('newsletterCTA.errorSubtitle')}{' '}
{ready ? t('errorSubtitle') : errorSubtitle}{' '}
<TextLink href='https://github.com/asyncapi/website/issues/new?template=bug.md' target='_blank'>
{t('newsletterCTA.errorLinkText')}
{ready ? t('errorLinkText') : 'here'}
</TextLink>
</Paragraph>
</div>
Expand All @@ -122,10 +125,10 @@ export default function NewsletterSubscribe({
return (
<div className={className} data-testid='NewsletterSubscribe-main'>
<Heading level={HeadingLevel.h3} textColor={headTextColor} typeStyle={HeadingTypeStyle.lg} className='mb-4'>
{title}
{ready ? t('title') : title}
</Heading>
<Paragraph className='mb-8' textColor={paragraphTextColor}>
{subtitle}
{ready ? t('subtitle') : subtitle}
</Paragraph>
{status === 'loading' ? (
<Loader loaderText={'Waiting for response...'} loaderIcon={<IconCircularLoader dark />} dark={dark} />
Expand All @@ -134,20 +137,20 @@ export default function NewsletterSubscribe({
<InputBox
inputType={InputTypes.TEXT}
inputName='name'
placeholder={t('newsletterCTA.nameInput')}
placeholder={ready ? t('nameInput') : 'Your name'}
inputValue={name}
setInput={setName}
/>
<InputBox
inputType={InputTypes.EMAIL}
inputName='email'
placeholder={t('newsletterCTA.emailInput')}
placeholder={ready ? t('emailInput') : 'Your email'}
inputValue={email}
setInput={setEmail}
/>
<Button
type={ButtonType.SUBMIT}
text={t('newsletterCTA.subscribeBtn')}
text={ready ? t('subscribeBtn') : 'Subscribe'}
className='mt-2 w-full md:mr-2 md:mt-0 md:flex-1'
href=''
/>
Expand Down
2 changes: 1 addition & 1 deletion components/data/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export const buckets: Bucket[] = [
name: 'Explorer',
title: 'Specification Explorer',
description: 'Simplifying our Specification JSON Schema like a pro.',
link: '/docs/reference/specification/v3.0.0-Explorer',
link: '/docs/reference/specification/v3.0.0-explorer',
className: 'bg-teal-200',
borderClassName: 'border-orange-200',
icon: IconExplorer
Expand Down
Loading

0 comments on commit efbc236

Please sign in to comment.