From 0c898cf19d3b9ed8246be1465e05f9e3577d8521 Mon Sep 17 00:00:00 2001 From: Akshat Nema <76521428+akshatnema@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:59:50 +0530 Subject: [PATCH 1/6] fix: remove hydration errors (#3262) Co-authored-by: Ansh Goyal %0ACo-authored-by: asyncapi-bot --- components/AlgoliaSearch.tsx | 11 +++- components/Avatar.tsx | 12 +++- components/Loader.tsx | 4 +- components/dashboard/table/Row.tsx | 73 +++++++++++++----------- components/navigation/BlogPostItem.tsx | 41 +++++++------ components/newsroom/FeaturedBlogPost.tsx | 13 +---- components/tools/ToolsCard.tsx | 9 ++- next-env.d.ts | 2 +- pages/blog/index.tsx | 22 +++++-- pages/index.tsx | 2 + utils/getStatic.ts | 40 ++++++------- 11 files changed, 127 insertions(+), 102 deletions(-) diff --git a/components/AlgoliaSearch.tsx b/components/AlgoliaSearch.tsx index 43b3cc7ce6b..a7d3604fafb 100644 --- a/components/AlgoliaSearch.tsx +++ b/components/AlgoliaSearch.tsx @@ -5,7 +5,7 @@ import clsx from 'clsx'; import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; -import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'; +import React, { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react'; import { createPortal } from 'react-dom'; export const INDEX_NAME = 'asyncapi'; @@ -283,6 +283,7 @@ export default function AlgoliaSearch({ children }: { children: React.ReactNode */ export function SearchButton({ children, indexName = INDEX_NAME, ...props }: ISearchButtonProps) { const { onOpen, onInput } = useContext(SearchContext); + const [Children, setChildren] = useState(''); const searchButtonRef = useRef(null); const actionKey = getActionKey(); @@ -308,6 +309,12 @@ export function SearchButton({ children, indexName = INDEX_NAME, ...props }: ISe }; }, [onInput, searchButtonRef]); + useEffect(() => { + if (typeof children === 'function') { + setChildren(children({ actionKey })); + } + }, []); + return ( ); } diff --git a/components/Avatar.tsx b/components/Avatar.tsx index b8bb1e55715..d889cafb9d7 100644 --- a/components/Avatar.tsx +++ b/components/Avatar.tsx @@ -32,9 +32,17 @@ export default function Avatar({ name, photo, link, className }: AvatarProps) { ); return link ? ( - + ) : ( {avatar} ); diff --git a/components/Loader.tsx b/components/Loader.tsx index 94fd2941765..b0be9da3475 100644 --- a/components/Loader.tsx +++ b/components/Loader.tsx @@ -1,6 +1,8 @@ import React from 'react'; import { twMerge } from 'tailwind-merge'; +import AsyncAPIColorIcon from './icons/AsyncAPIColorIcon'; + interface LoaderProps { // eslint-disable-next-line prettier/prettier @@ -25,7 +27,7 @@ interface LoaderProps { */ export default function Loader({ loaderText = '', - loaderIcon = null, + loaderIcon = , className = '', dark = false, pulsating = false diff --git a/components/dashboard/table/Row.tsx b/components/dashboard/table/Row.tsx index f5794faa8c4..8b03be87263 100644 --- a/components/dashboard/table/Row.tsx +++ b/components/dashboard/table/Row.tsx @@ -16,47 +16,52 @@ export default function Row({ item }: RowProps) { return (
  • - -
    -
    - - +
    + - arrow icon + + {item.labels && item?.labels?.length > 0 && ( +
    + {item.labels.map((label) => ( + + {label.name} + + ))} +
    + )}
    - + + arrow icon + +
  • ); diff --git a/components/navigation/BlogPostItem.tsx b/components/navigation/BlogPostItem.tsx index 09559f00523..264fe0b6c66 100644 --- a/components/navigation/BlogPostItem.tsx +++ b/components/navigation/BlogPostItem.tsx @@ -1,7 +1,7 @@ import moment from 'moment'; import Link from 'next/link'; import type { Ref } from 'react'; -import { forwardRef } from 'react'; +import React, { forwardRef } from 'react'; import TextTruncate from 'react-text-truncate'; import { BlogPostType } from '@/types/components/navigation/BlogPostType'; @@ -77,16 +77,14 @@ export default forwardRef(function BlogPostItem( {post.type} - - - - {post.title} - - - - - - + + + {post.title} + + + + +
    @@ -94,30 +92,31 @@ export default forwardRef(function BlogPostItem(
    - + {post.authors .map((author, index) => author.link ? ( - { - e.stopPropagation(); + e.preventDefault(); + + // Handle the click event, e.g., navigate to author.link + window.open(author.link, '_blank'); }} - target='_blank' - rel='noreferrer' > {author.name} - + ) : ( author.name ) ) - .reduce((prev, curr) => ( - <> + .reduce((prev, curr, index) => ( + {prev} & {curr} - + ))} diff --git a/components/newsroom/FeaturedBlogPost.tsx b/components/newsroom/FeaturedBlogPost.tsx index fd459f2977a..49b4c8ef4ab 100644 --- a/components/newsroom/FeaturedBlogPost.tsx +++ b/components/newsroom/FeaturedBlogPost.tsx @@ -88,18 +88,9 @@ export default function FeaturedBlogPost({ post, className = '' }: FeaturedBlogP {post.authors .map((author, index) => author.link ? ( - { - e.stopPropagation(); - }} - target='_blank' - rel='noreferrer' - > + {author.name} - + ) : ( author.name ) diff --git a/components/tools/ToolsCard.tsx b/components/tools/ToolsCard.tsx index b3e73df9364..2a6d9ced02f 100644 --- a/components/tools/ToolsCard.tsx +++ b/components/tools/ToolsCard.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import React, { useEffect, useRef, useState } from 'react'; import type { ToolData, VisibleDataListType } from '@/types/components/tools/ToolDataType'; import { HeadingTypeStyle } from '@/types/typography/Heading'; @@ -92,9 +92,12 @@ export default function ToolsCard({ toolData }: ToolsCardProp) { }, 500) } > -
    + {toolData.description} -
    + diff --git a/next-env.d.ts b/next-env.d.ts index 4f11a03dc6c..a4a7b3f5cfa 100644 --- a/next-env.d.ts +++ b/next-env.d.ts @@ -2,4 +2,4 @@ /// // NOTE: This file should not be edited -// see https://nextjs.org/docs/basic-features/typescript for more information. +// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. diff --git a/pages/blog/index.tsx b/pages/blog/index.tsx index 7829daf7435..37958cec430 100644 --- a/pages/blog/index.tsx +++ b/pages/blog/index.tsx @@ -1,8 +1,9 @@ import { useRouter } from 'next/router'; -import { useContext, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; import Empty from '@/components/illustrations/Empty'; import GenericLayout from '@/components/layout/GenericLayout'; +import Loader from '@/components/Loader'; import BlogPostItem from '@/components/navigation/BlogPostItem'; import Filter from '@/components/navigation/Filter'; import Heading from '@/components/typography/Heading'; @@ -33,6 +34,7 @@ export default function BlogIndexPage() { }) : [] ); + const [isClient, setIsClient] = useState(false); const onFilter = (data: IBlogPost[]) => setPosts(data); const toFilter = [ @@ -57,6 +59,10 @@ export default function BlogIndexPage() { const description = 'Find the latest and greatest stories from our community'; const image = '/img/social/blog.webp'; + useEffect(() => { + setIsClient(true); + }, []); + return (
    @@ -108,16 +114,24 @@ export default function BlogIndexPage() { )}
    - {Object.keys(posts).length === 0 ? ( + {Object.keys(posts).length === 0 && (

    No post matches your filter

    - ) : ( + )} + {Object.keys(posts).length > 0 && isClient && (
      - {router.isReady && posts.map((post, index) => )} + {posts.map((post, index) => ( + + ))}
    )} + {Object.keys(posts).length > 0 && !isClient && ( +
    + +
    + )}
    diff --git a/pages/index.tsx b/pages/index.tsx index 906ed8c65cf..826a795c8ae 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,3 +1,5 @@ +import React from 'react'; + import AsyncAPIColorIcon from '@/components/icons/AsyncAPIColorIcon'; import Loader from '@/components/Loader'; diff --git a/utils/getStatic.ts b/utils/getStatic.ts index 9b76ba9d4e5..56af2cf6b1c 100644 --- a/utils/getStatic.ts +++ b/utils/getStatic.ts @@ -2,26 +2,24 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations'; import i18nextConfig from '../next-i18next.config'; -console.log(i18nextConfig.i18n.locales); - /** * Retrieves the internationalization paths for the supported locales. * @returns An array of paths for each supported locale. */ export const getI18nPaths = () => - i18nextConfig.i18n.locales.map((lng) => ({ - params: { - lang: lng - } - })); + i18nextConfig.i18n.locales.map((lng) => ({ + params: { + lang: lng + } + })); /** * Retrieves the static paths for Next.js. * @returns An object containing the fallback value and an array of paths. */ export const getStaticPaths = () => ({ - fallback: false, - paths: getI18nPaths() + fallback: false, + paths: getI18nPaths() }); /** @@ -30,15 +28,13 @@ export const getStaticPaths = () => ({ * @param ns - An array of namespaces to be loaded. * @returns An object containing the internationalization props. */ -export async function getI18nProps(ctx:any, ns = ['common']) { - const locale = ctx?.params?.lang; - - console.log(locale, 'here'); - const props = { - ...(await serverSideTranslations(locale, ns)) - }; +export async function getI18nProps(ctx: any, ns = ['common']) { + const locale = ctx?.params?.lang; + const props = { + ...(await serverSideTranslations(locale, ns)) + }; - return props; + return props; } /** @@ -47,11 +43,9 @@ export async function getI18nProps(ctx:any, ns = ['common']) { * @returns A function that retrieves the static props. */ export function makeStaticProps(ns = {}) { - return async function getStaticProps(ctx:any) { - console.log(ctx, 'ctx'); - - return { - props: await getI18nProps(ctx, ns as any) - }; + return async function getStaticProps(ctx: any) { + return { + props: await getI18nProps(ctx, ns as any) }; + }; } From a46f8708eea9c009af91c6ef10d90f2a9c2cf9ba Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 14:23:50 +0200 Subject: [PATCH 2/6] docs: add raj17ce as a contributor for code (#3288) Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com> --- .all-contributorsrc | 9 +++++++++ README.md | 3 +++ 2 files changed, 12 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 64e7fe6bdf7..8f3a49ee524 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -555,6 +555,15 @@ "contributions": [ "doc" ] + }, + { + "login": "raj17ce", + "name": "Raj Patel", + "avatar_url": "https://avatars.githubusercontent.com/u/116947399?v=4", + "profile": "https://github.com/raj17ce", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index 543ff41d935..2422bd1b2ae 100644 --- a/README.md +++ b/README.md @@ -395,6 +395,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Neutron
    Neutron

    💻 Sagar Kori
    Sagar Kori

    📖 + + Raj Patel
    Raj Patel

    💻 + From e4b2e805f85126d62e398cbb3e01004671c69025 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Sun, 13 Oct 2024 12:10:08 +0200 Subject: [PATCH 3/6] docs(community): update latest maintainers list (#3291) --- config/MAINTAINERS.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/MAINTAINERS.json b/config/MAINTAINERS.json index 7ae06a8ebac..d5914331c17 100644 --- a/config/MAINTAINERS.json +++ b/config/MAINTAINERS.json @@ -258,7 +258,6 @@ "website", "spec-json-schemas", "generator", - "asyncapi-react", "extensions-catalog", "bindings", "enterprise-patterns", @@ -321,6 +320,7 @@ "availableForHire": false, "isTscMember": true, "repos": [ + "asyncapi-react", "conference-website", "chatbot" ], From 739f9a557c53ce24e47ab8998375f99e1d0c1a12 Mon Sep 17 00:00:00 2001 From: asyncapi-bot Date: Mon, 14 Oct 2024 02:38:45 +0200 Subject: [PATCH 4/6] chore: update tools.json (#3292) --- config/all-tags.json | 2 +- config/tools-automated.json | 254 ++++++++++++++++++------------------ 2 files changed, 128 insertions(+), 128 deletions(-) diff --git a/config/all-tags.json b/config/all-tags.json index b2a1c6f3c3a..bcbe78efc37 100644 --- a/config/all-tags.json +++ b/config/all-tags.json @@ -1 +1 @@ -{"languages":[{"name":"Go/Golang","color":"bg-[#8ECFDF]","borderColor":"border-[#00AFD9]"},{"name":"Java","color":"bg-[#ECA2A4]","borderColor":"border-[#EC2125]"},{"name":"JavaScript","color":"bg-[#F2F1C7]","borderColor":"border-[#BFBE86]"},{"name":"HTML","color":"bg-[#E2A291]","borderColor":"border-[#E44D26]"},{"name":"C/C++","color":"bg-[#93CDEF]","borderColor":"border-[#0080CC]"},{"name":"C#","color":"bg-[#E3AFE0]","borderColor":"border-[#9B4F96]"},{"name":"Python","color":"bg-[#A8D0EF]","borderColor":"border-[#3878AB]"},{"name":"TypeScript","color":"bg-[#7DBCFE]","borderColor":"border-[#2C78C7]"},{"name":"Kotlin","color":"bg-[#B1ACDF]","borderColor":"border-[#756BD9]"},{"name":"Scala","color":"bg-[#FFA299]","borderColor":"border-[#DF301F]"},{"name":"Markdown","color":"bg-[#BABEBF]","borderColor":"border-[#445B64]"},{"name":"YAML","color":"bg-[#FFB764]","borderColor":"border-[#F1901F]"},{"name":"R","color":"bg-[#84B5ED]","borderColor":"border-[#246BBE]"},{"name":"Ruby","color":"bg-[#FF8289]","borderColor":"border-[#FF000F]"},{"name":"Rust","color":"bg-[#FFB8AA]","borderColor":"border-[#E43716]"},{"name":"Shell","color":"bg-[#87D4FF]","borderColor":"border-[#389ED7]"},{"name":"Groovy","color":"bg-[#B6D5E5]","borderColor":"border-[#609DBC]"}],"technologies":[{"name":"Node.js","color":"bg-[#BDFF67]","borderColor":"border-[#84CE24]"},{"name":"Hermes","color":"bg-[#8AEEBD]","borderColor":"border-[#2AB672]"},{"name":"React JS","color":"bg-[#9FECFA]","borderColor":"border-[#08D8FE]"},{"name":".NET","color":"bg-[#A184FF]","borderColor":"border-[#5026D4]"},{"name":"ASP.NET","color":"bg-[#71C2FB]","borderColor":"border-[#1577BC]"},{"name":"Springboot","color":"bg-[#98E279]","borderColor":"border-[#68BC44]"},{"name":"AWS","color":"bg-[#FF9F59]","borderColor":"border-[#EF6703]"},{"name":"Docker","color":"bg-[#B8E0FF]","borderColor":"border-[#2596ED]"},{"name":"Node-RED","color":"bg-[#FF7474]","borderColor":"border-[#8F0101]"},{"name":"Maven","color":"bg-[#FF6B80]","borderColor":"border-[#CA1A33]"},{"name":"Saas","color":"bg-[#6AB8EC]","borderColor":"border-[#2275AD]"},{"name":"Kubernetes-native","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Scala","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Azure","color":"bg-[#4B93FF]","borderColor":"border-[#015ADF]"},{"name":"Jenkins","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Flask","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Nest Js","color":"bg-[#E1224E]","borderColor":"border-[#B9012b]"},{"name":"TypeScript","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Socket.IO","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Liquid","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Kotlin","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Gradle","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Spring Cloud Streams","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"JHipster JDL","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Groovy","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Markdown","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Shell","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"WebComponents","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Babel","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Storybook","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"AsyncAPI Generator","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"VSCode","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"SmartPaste","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"JetBrains","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"IntelliJ IDEA","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"HTML","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Java","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"}]} \ No newline at end of file +{"languages":[{"name":"Go/Golang","color":"bg-[#8ECFDF]","borderColor":"border-[#00AFD9]"},{"name":"Java","color":"bg-[#ECA2A4]","borderColor":"border-[#EC2125]"},{"name":"JavaScript","color":"bg-[#F2F1C7]","borderColor":"border-[#BFBE86]"},{"name":"HTML","color":"bg-[#E2A291]","borderColor":"border-[#E44D26]"},{"name":"C/C++","color":"bg-[#93CDEF]","borderColor":"border-[#0080CC]"},{"name":"C#","color":"bg-[#E3AFE0]","borderColor":"border-[#9B4F96]"},{"name":"Python","color":"bg-[#A8D0EF]","borderColor":"border-[#3878AB]"},{"name":"TypeScript","color":"bg-[#7DBCFE]","borderColor":"border-[#2C78C7]"},{"name":"Kotlin","color":"bg-[#B1ACDF]","borderColor":"border-[#756BD9]"},{"name":"Scala","color":"bg-[#FFA299]","borderColor":"border-[#DF301F]"},{"name":"Markdown","color":"bg-[#BABEBF]","borderColor":"border-[#445B64]"},{"name":"YAML","color":"bg-[#FFB764]","borderColor":"border-[#F1901F]"},{"name":"R","color":"bg-[#84B5ED]","borderColor":"border-[#246BBE]"},{"name":"Ruby","color":"bg-[#FF8289]","borderColor":"border-[#FF000F]"},{"name":"Rust","color":"bg-[#FFB8AA]","borderColor":"border-[#E43716]"},{"name":"Shell","color":"bg-[#87D4FF]","borderColor":"border-[#389ED7]"},{"name":"Groovy","color":"bg-[#B6D5E5]","borderColor":"border-[#609DBC]"}],"technologies":[{"name":"Node.js","color":"bg-[#BDFF67]","borderColor":"border-[#84CE24]"},{"name":"Hermes","color":"bg-[#8AEEBD]","borderColor":"border-[#2AB672]"},{"name":"React JS","color":"bg-[#9FECFA]","borderColor":"border-[#08D8FE]"},{"name":".NET","color":"bg-[#A184FF]","borderColor":"border-[#5026D4]"},{"name":"ASP.NET","color":"bg-[#71C2FB]","borderColor":"border-[#1577BC]"},{"name":"Springboot","color":"bg-[#98E279]","borderColor":"border-[#68BC44]"},{"name":"AWS","color":"bg-[#FF9F59]","borderColor":"border-[#EF6703]"},{"name":"Docker","color":"bg-[#B8E0FF]","borderColor":"border-[#2596ED]"},{"name":"Node-RED","color":"bg-[#FF7474]","borderColor":"border-[#8F0101]"},{"name":"Maven","color":"bg-[#FF6B80]","borderColor":"border-[#CA1A33]"},{"name":"Saas","color":"bg-[#6AB8EC]","borderColor":"border-[#2275AD]"},{"name":"Kubernetes-native","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Scala","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Azure","color":"bg-[#4B93FF]","borderColor":"border-[#015ADF]"},{"name":"Jenkins","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Flask","color":"bg-[#D7C7F2]","borderColor":"border-[#A387D2]"},{"name":"Nest Js","color":"bg-[#E1224E]","borderColor":"border-[#B9012b]"},{"name":"TypeScript","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Socket.IO","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Liquid","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Kotlin","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Gradle","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Spring Cloud Streams","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"JHipster JDL","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Groovy","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Markdown","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Shell","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"WebComponents","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Babel","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Storybook","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"AsyncAPI Generator","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"VSCode","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"SmartPaste","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"JetBrains","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"IntelliJ IDEA","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"Java","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"},{"name":"HTML","color":"bg-[#61d0f2]","borderColor":"border-[#40ccf7]"}]} \ No newline at end of file diff --git a/config/tools-automated.json b/config/tools-automated.json index 6fac6523de4..a48496cf7dd 100644 --- a/config/tools-automated.json +++ b/config/tools-automated.json @@ -72,19 +72,22 @@ } }, { - "title": "nestjs-asyncapi", - "description": "Utilize decorators to generate AsyncAPI document utilizing DTOs (similar to @nestjs/swagger) and a web UI.", + "title": "Zod Sockets", + "description": "Socket.IO solution with I/O validation and the ability to generate AsyncAPI specification and a contract for consumers.", "links": { - "repoUrl": "https://github.com/flamewow/nestjs-asyncapi" + "websiteUrl": "https://www.npmjs.com/package/zod-sockets", + "repoUrl": "https://github.com/RobinTail/zod-sockets" }, "filters": { - "language": "Typescript", + "language": "TypeScript", "technology": [ "Node.js", - "NestJS" + "TypeScript" ], "categories": [ - "code-first" + "code-first", + "dsl", + "framework" ], "hasCommercial": false, "isAsyncAPIOwner": false @@ -113,22 +116,19 @@ } }, { - "title": "Zod Sockets", - "description": "Socket.IO solution with I/O validation and the ability to generate AsyncAPI specification and a contract for consumers.", + "title": "nestjs-asyncapi", + "description": "Utilize decorators to generate AsyncAPI document utilizing DTOs (similar to @nestjs/swagger) and a web UI.", "links": { - "websiteUrl": "https://www.npmjs.com/package/zod-sockets", - "repoUrl": "https://github.com/RobinTail/zod-sockets" + "repoUrl": "https://github.com/flamewow/nestjs-asyncapi" }, "filters": { - "language": "TypeScript", + "language": "Typescript", "technology": [ "Node.js", - "TypeScript" + "NestJS" ], "categories": [ - "code-first", - "dsl", - "framework" + "code-first" ], "hasCommercial": false, "isAsyncAPIOwner": false @@ -139,32 +139,6 @@ "Code Generators": { "description": "The following is a list of tools that generate code from an AsyncAPI document; not the other way around.", "toolsList": [ - { - "title": "ZenWave SDK", - "description": "DDD and API-First for Event-Driven Microservices", - "links": { - "websiteUrl": "https://zenwave360.github.io/", - "docsUrl": "https://zenwave360.github.io/zenwave-sdk/plugins/asyncapi-spring-cloud-streams3/", - "repoUrl": "https://github.com/zenwave360/zenwave-sdk" - }, - "filters": { - "language": "Java", - "technology": [ - "Maven", - "CLI", - "Spring Cloud Streams", - "JHipster JDL" - ], - "categories": [ - "code-generator", - "dsl", - "mocking-and-testing", - "cli" - ], - "hasCommercial": false, - "isAsyncAPIOwner": false - } - }, { "title": "Golang AsyncAPI Code Generator", "description": "Generate Go user and application boilerplate from AsyncAPI specifications. Can be called from `go generate` without requirements.\n", @@ -200,6 +174,32 @@ "hasCommercial": false, "isAsyncAPIOwner": true } + }, + { + "title": "ZenWave SDK", + "description": "DDD and API-First for Event-Driven Microservices", + "links": { + "websiteUrl": "https://zenwave360.github.io/", + "docsUrl": "https://zenwave360.github.io/zenwave-sdk/plugins/asyncapi-spring-cloud-streams3/", + "repoUrl": "https://github.com/zenwave360/zenwave-sdk" + }, + "filters": { + "language": "Java", + "technology": [ + "Maven", + "CLI", + "Spring Cloud Streams", + "JHipster JDL" + ], + "categories": [ + "code-generator", + "dsl", + "mocking-and-testing", + "cli" + ], + "hasCommercial": false, + "isAsyncAPIOwner": false + } } ] }, @@ -290,48 +290,48 @@ "description": "Writing YAML by hand is no fun, and maybe you don't want a GUI, so use a Domain Specific Language to write AsyncAPI in your language of choice.", "toolsList": [ { - "title": "ZenWave SDK", - "description": "DDD and API-First for Event-Driven Microservices", + "title": "Zod Sockets", + "description": "Socket.IO solution with I/O validation and the ability to generate AsyncAPI specification and a contract for consumers.", "links": { - "websiteUrl": "https://zenwave360.github.io/", - "docsUrl": "https://zenwave360.github.io/zenwave-sdk/plugins/asyncapi-spring-cloud-streams3/", - "repoUrl": "https://github.com/zenwave360/zenwave-sdk" + "websiteUrl": "https://www.npmjs.com/package/zod-sockets", + "repoUrl": "https://github.com/RobinTail/zod-sockets" }, "filters": { - "language": "Java", + "language": "TypeScript", "technology": [ - "Maven", - "CLI", - "Spring Cloud Streams", - "JHipster JDL" + "Node.js", + "TypeScript" ], "categories": [ - "code-generator", + "code-first", "dsl", - "mocking-and-testing", - "cli" + "framework" ], "hasCommercial": false, "isAsyncAPIOwner": false } }, { - "title": "Zod Sockets", - "description": "Socket.IO solution with I/O validation and the ability to generate AsyncAPI specification and a contract for consumers.", + "title": "ZenWave SDK", + "description": "DDD and API-First for Event-Driven Microservices", "links": { - "websiteUrl": "https://www.npmjs.com/package/zod-sockets", - "repoUrl": "https://github.com/RobinTail/zod-sockets" + "websiteUrl": "https://zenwave360.github.io/", + "docsUrl": "https://zenwave360.github.io/zenwave-sdk/plugins/asyncapi-spring-cloud-streams3/", + "repoUrl": "https://github.com/zenwave360/zenwave-sdk" }, "filters": { - "language": "TypeScript", + "language": "Java", "technology": [ - "Node.js", - "TypeScript" + "Maven", + "CLI", + "Spring Cloud Streams", + "JHipster JDL" ], "categories": [ - "code-first", + "code-generator", "dsl", - "framework" + "mocking-and-testing", + "cli" ], "hasCommercial": false, "isAsyncAPIOwner": false @@ -387,34 +387,34 @@ } }, { - "title": "GitHub Action for Generator", - "description": "CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!", + "title": "GitHub Action for CLI", + "description": "GitHub Action with generator, validator, converter and others - all in one for your AsyncAPI documents with AsyncAPI CLI as backbone", "links": { - "repoUrl": "https://github.com/asyncapi/cli" + "repoUrl": "https://github.com/asyncapi/github-action-for-cli" }, "filters": { "technology": [ - "AsyncAPI Generator" + "AsyncAPI CLI" ], "categories": [ - "github-actions" + "github-action" ], "hasCommercial": false, "isAsyncAPIOwner": true } }, { - "title": "GitHub Action for CLI", - "description": "GitHub Action with generator, validator, converter and others - all in one for your AsyncAPI documents with AsyncAPI CLI as backbone", + "title": "GitHub Action for Generator", + "description": "CLI to work with your AsyncAPI files. You can validate them and in the future use a generator and even bootstrap a new file. Contributions are welcomed!", "links": { - "repoUrl": "https://github.com/asyncapi/github-action-for-cli" + "repoUrl": "https://github.com/asyncapi/cli" }, "filters": { "technology": [ - "AsyncAPI CLI" + "AsyncAPI Generator" ], "categories": [ - "github-action" + "github-actions" ], "hasCommercial": false, "isAsyncAPIOwner": true @@ -564,6 +564,25 @@ "CLIs": { "description": "The following is a list of tools that you can work with in terminal or do some CI/CD automation.", "toolsList": [ + { + "title": "AsyncAPI CLI", + "description": "One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n", + "links": { + "websiteUrl": "https://www.asyncapi.com/tools/cli", + "repoUrl": "https://github.com/asyncapi/cli" + }, + "filters": { + "technology": [ + "TypeScript" + ], + "categories": [ + "others", + "cli" + ], + "hasCommercial": false, + "isAsyncAPIOwner": true + } + }, { "title": "ZenWave SDK", "description": "DDD and API-First for Event-Driven Microservices", @@ -590,25 +609,6 @@ "isAsyncAPIOwner": false } }, - { - "title": "AsyncAPI CLI", - "description": "One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n", - "links": { - "websiteUrl": "https://www.asyncapi.com/tools/cli", - "repoUrl": "https://github.com/asyncapi/cli" - }, - "filters": { - "technology": [ - "TypeScript" - ], - "categories": [ - "others", - "cli" - ], - "hasCommercial": false, - "isAsyncAPIOwner": true - } - }, { "title": "AsyncAPI CLI", "description": "One CLI to rule them all. \nThis is a CLI that aims to integrate all AsyncAPI tools that you need while AsyncAPI document development and maintainance. \nYou can use it to generate docs or code, validate AsyncAPI document and event create new documents.\n", @@ -719,15 +719,18 @@ "description": "The following is a list of templates compatible with AsyncAPI Generator. You can use them to generate apps, clients or documentation from your AsyncAPI documents.", "toolsList": [ { - "title": "HTML Template", - "description": "HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.", + "title": "Java Spring Cloud Stream Template", + "description": "Java Spring Cloud Stream template for the AsyncAPI Generator", "links": { - "repoUrl": "https://github.com/asyncapi/html-template" + "repoUrl": "https://github.com/asyncapi/java-spring-cloud-stream-template" }, "filters": { - "language": "javascript", + "language": [ + "javascript" + ], "technology": [ - "HTML" + "Spring Cloud Streams", + "Maven" ], "categories": [ "generator-template" @@ -737,17 +740,15 @@ } }, { - "title": "Java Template", - "description": "Java template for the AsyncAPI Generator", + "title": "Node.js Multiprotocol Template", + "description": "This template generates a server using your AsyncAPI document. It supports multiple different protocols, like Kafka or MQTT. It is designed in the way that generated code is a library and with it's API you can start the server, send messages or register a middleware for listening incoming messages. Runtime message validation included.", "links": { - "repoUrl": "https://github.com/asyncapi/java-template" + "repoUrl": "https://github.com/asyncapi/nodejs-template" }, "filters": { - "language": [ - "javascript" - ], + "language": "javascript", "technology": [ - "Java" + "Node.js" ], "categories": [ "generator-template" @@ -757,19 +758,17 @@ } }, { - "title": "Java Spring Template", - "description": "Java Spring template for the AsyncAPI Generator", + "title": "Java Template", + "description": "Java template for the AsyncAPI Generator", "links": { - "repoUrl": "https://github.com/asyncapi/java-spring-template" + "repoUrl": "https://github.com/asyncapi/java-template" }, "filters": { "language": [ "javascript" ], "technology": [ - "Springboot", - "Maven", - "Gradle" + "Java" ], "categories": [ "generator-template" @@ -779,18 +778,15 @@ } }, { - "title": "Java Spring Cloud Stream Template", - "description": "Java Spring Cloud Stream template for the AsyncAPI Generator", + "title": "Node.js Websockets Template", + "description": "Node.js WebSockets template for the AsyncAPI Generator. It showcases how from a single AsyncAPI document you can generate a server and a client at the same time.", "links": { - "repoUrl": "https://github.com/asyncapi/java-spring-cloud-stream-template" + "repoUrl": "https://github.com/asyncapi/nodejs-ws-template" }, "filters": { - "language": [ - "javascript" - ], + "language": "javascript", "technology": [ - "Spring Cloud Streams", - "Maven" + "Node.js" ], "categories": [ "generator-template" @@ -800,15 +796,15 @@ } }, { - "title": "Node.js Multiprotocol Template", - "description": "This template generates a server using your AsyncAPI document. It supports multiple different protocols, like Kafka or MQTT. It is designed in the way that generated code is a library and with it's API you can start the server, send messages or register a middleware for listening incoming messages. Runtime message validation included.", + "title": "HTML Template", + "description": "HTML template for AsyncAPI Generator. Use it to generate a static docs. It is using AsyncAPI React component under the hood.", "links": { - "repoUrl": "https://github.com/asyncapi/nodejs-template" + "repoUrl": "https://github.com/asyncapi/html-template" }, "filters": { "language": "javascript", "technology": [ - "Node.js" + "HTML" ], "categories": [ "generator-template" @@ -818,15 +814,19 @@ } }, { - "title": "Node.js Websockets Template", - "description": "Node.js WebSockets template for the AsyncAPI Generator. It showcases how from a single AsyncAPI document you can generate a server and a client at the same time.", + "title": "Java Spring Template", + "description": "Java Spring template for the AsyncAPI Generator", "links": { - "repoUrl": "https://github.com/asyncapi/nodejs-ws-template" + "repoUrl": "https://github.com/asyncapi/java-spring-template" }, "filters": { - "language": "javascript", + "language": [ + "javascript" + ], "technology": [ - "Node.js" + "Springboot", + "Maven", + "Gradle" ], "categories": [ "generator-template" From ec62c5ed5eca8c246589b5b7da8f9c98fd805829 Mon Sep 17 00:00:00 2001 From: Vishvamsinh Vaghela <90895835+vishvamsinh28@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:15:09 +0530 Subject: [PATCH 5/6] feat: add codecov to the project (#3168) Co-authored-by: Akshat Nema <76521428+akshatnema@users.noreply.github.com>%0ACo-authored-by: Ansh Goyal %0ACo-authored-by: asyncapi-bot --- .github/workflows/if-nodejs-pr-testing.yml | 10 ++++++++++ jest.config.js | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index 2154143339c..c50814a4a17 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -60,6 +60,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: "${{ steps.nodeversion.outputs.version }}" + - name: Install dependencies run: npm ci - if: steps.packagejson.outputs.exists == 'true' @@ -72,3 +73,12 @@ jobs: name: Run release assets generation to make sure PR does not break it shell: bash run: npm run generate:assets --if-present + + - if: steps.packagejson.outputs.exists == 'true' + name: Upload Coverage to Codecov + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 + with: + fail_ci_if_error: true + files: ./coverage/lcov.info + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true diff --git a/jest.config.js b/jest.config.js index 25c7865434e..9d370a6bb76 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,9 @@ module.exports = { verbose: true, collectCoverage: true, + coverageReporters: ['text', 'lcov', 'json-summary'], + coverageDirectory: 'coverage', collectCoverageFrom: ['scripts/**/*.js'], // To disallow netlify edge function tests from running testMatch: ['**/tests/**/*.test.*', '!**/netlify/**/*.test.*'], -}; +}; \ No newline at end of file From 7abb5fdfbf12277d210634885dbd63e3135e2422 Mon Sep 17 00:00:00 2001 From: Ansh Goyal Date: Thu, 17 Oct 2024 21:16:31 +0530 Subject: [PATCH 6/6] fix: run tests on branch pushes (#3296) --- .github/workflows/if-nodejs-pr-testing.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/if-nodejs-pr-testing.yml b/.github/workflows/if-nodejs-pr-testing.yml index c50814a4a17..769039d1a0a 100644 --- a/.github/workflows/if-nodejs-pr-testing.yml +++ b/.github/workflows/if-nodejs-pr-testing.yml @@ -4,6 +4,8 @@ name: PR testing - if Node project on: pull_request: types: [opened, reopened, synchronize, ready_for_review] + push: + branches: [master] jobs: test-nodejs-pr: