From a1a93550db6b05afa010d0fc3baf9b244048f494 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:25:33 +0200 Subject: [PATCH 001/340] RichTextBlock: only render `div` when `disableLastBottomSpacing` is set (#292) prevents invalid html when div is rendered inside p tag when a Typgraphy is wrapped around the RichTextBlock --------- Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> --- site/src/common/blocks/RichTextBlock.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/site/src/common/blocks/RichTextBlock.tsx b/site/src/common/blocks/RichTextBlock.tsx index 093afd3d4..1326250ae 100644 --- a/site/src/common/blocks/RichTextBlock.tsx +++ b/site/src/common/blocks/RichTextBlock.tsx @@ -130,7 +130,7 @@ export const RichTextBlock = withPreview( return ( - {rendered} + {disableLastBottomSpacing ? {rendered} : rendered} ); }, @@ -145,9 +145,8 @@ export const PageContentRichTextBlock = (props: RichTextBlockProps) => ( ); -const Root = styled.div<{ $disableLastBottomSpacing?: boolean }>` - ${({ theme, $disableLastBottomSpacing }) => - $disableLastBottomSpacing && +const DisableLastBottomSpacing = styled.div` + ${({ theme }) => css` > *:last-child { margin-bottom: 0; From df7214e54fb2f725da8ba18837788b158f84f382 Mon Sep 17 00:00:00 2001 From: johnnyomair Date: Mon, 15 Jul 2024 09:24:16 +0000 Subject: [PATCH 002/340] @comet/create-app: Publish v1.24.0 --- create-app/package-lock.json | 4 ++-- create-app/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/create-app/package-lock.json b/create-app/package-lock.json index c1805310a..8bc28e62e 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comet/create-app", - "version": "1.23.0", + "version": "1.24.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comet/create-app", - "version": "1.23.0", + "version": "1.24.0", "license": "BSD-2-Clause", "dependencies": { "commander": "^11.0.0", diff --git a/create-app/package.json b/create-app/package.json index 879e87116..a3d8b0c27 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@comet/create-app", - "version": "1.23.0", + "version": "1.24.0", "description": "Command-line interface to create a new Comet application", "homepage": "https://github.com/vivid-planet/comet-starter/tree/main/create-app#readme", "bugs": { From 6b6ea080efe03e65346cd6b0c27b750e7b8230c1 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Mon, 15 Jul 2024 12:34:08 +0200 Subject: [PATCH 003/340] Site: Enable relative DAM URLs (#298) Benefits: - (Probably) a better SEO ranking - API can be private --- site/src/middleware.ts | 4 ++++ site/src/util/graphQLClient.ts | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/site/src/middleware.ts b/site/src/middleware.ts index 7844daa52..2e1939e96 100644 --- a/site/src/middleware.ts +++ b/site/src/middleware.ts @@ -7,6 +7,10 @@ import { createRedirects } from "./redirects/redirects"; export async function middleware(request: NextRequest) { const { pathname } = new URL(request.url); + if (pathname.startsWith("/dam/")) { + return NextResponse.rewrite(new URL(`${process.env.API_URL_INTERNAL}${request.nextUrl.pathname}`)); + } + const redirects = await createRedirects(); const redirect = redirects.get(pathname); diff --git a/site/src/util/graphQLClient.ts b/site/src/util/graphQLClient.ts index 6634bd722..0a071f103 100644 --- a/site/src/util/graphQLClient.ts +++ b/site/src/util/graphQLClient.ts @@ -8,11 +8,14 @@ import { const isServerSide = typeof window === "undefined"; export const graphQLApiUrl = `${isServerSide ? process.env.API_URL_INTERNAL : process.env.NEXT_PUBLIC_API_URL}/graphql`; export function createGraphQLFetch(previewData?: SitePreviewData) { - const headers = isServerSide - ? { - authorization: `Basic ${Buffer.from(`vivid:${process.env.API_PASSWORD}`).toString("base64")}`, - } - : undefined; + const headers: HeadersInit = { + "x-relative-dam-urls": "1", + }; + + if (isServerSide) { + headers.authorization = `Basic ${Buffer.from(`vivid:${process.env.API_PASSWORD}`).toString("base64")}`; + } + return createGraphQLFetchLibrary( createFetchWithDefaults(createFetchWithPreviewHeaders(fetch, previewData), { next: { revalidate: 15 * 60 }, headers }), graphQLApiUrl, From eac9cddd79d51855adc7147898ec6c84c565f5f9 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:02:04 +0200 Subject: [PATCH 004/340] Add key facts block (#276) --- .../documents/pages/blocks/KeyFactsBlock.tsx | 32 ++++ .../pages/blocks/KeyFactsItemBlock.tsx | 44 ++++++ .../pages/blocks/PageContentBlock.tsx | 2 + api/block-meta.json | 141 ++++++++++++++++++ .../pages/blocks/key-facts-item.block.ts | 50 +++++++ .../documents/pages/blocks/key-facts.block.ts | 37 +++++ .../pages/blocks/page-content.block.ts | 2 + .../pages/blocks/KeyFactItemBlock.tsx | 46 ++++++ .../documents/pages/blocks/KeyFactsBlock.tsx | 42 ++++++ .../pages/blocks/PageContentBlock.tsx | 2 + 10 files changed, 398 insertions(+) create mode 100644 admin/src/documents/pages/blocks/KeyFactsBlock.tsx create mode 100644 admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx create mode 100644 api/src/documents/pages/blocks/key-facts-item.block.ts create mode 100644 api/src/documents/pages/blocks/key-facts.block.ts create mode 100644 site/src/documents/pages/blocks/KeyFactItemBlock.tsx create mode 100644 site/src/documents/pages/blocks/KeyFactsBlock.tsx diff --git a/admin/src/documents/pages/blocks/KeyFactsBlock.tsx b/admin/src/documents/pages/blocks/KeyFactsBlock.tsx new file mode 100644 index 000000000..10068a1c4 --- /dev/null +++ b/admin/src/documents/pages/blocks/KeyFactsBlock.tsx @@ -0,0 +1,32 @@ +import { BlockCategory, createCompositeBlock, createListBlock } from "@comet/blocks-admin"; +import { HeadingBlock } from "@src/common/blocks/HeadingBlock"; +import { KeyFactsItemBlock } from "@src/documents/pages/blocks/KeyFactsItemBlock"; +import { FormattedMessage } from "react-intl"; + +const KeyFactsItemsBlock = createListBlock({ + name: "KeyFactsItems", + displayName: , + block: KeyFactsItemBlock, + itemName: , + itemsName: , +}); + +export const KeyFactsBlock = createCompositeBlock( + { + name: "KeyFacts", + displayName: , + blocks: { + heading: { + block: HeadingBlock, + }, + items: { + block: KeyFactsItemsBlock, + title: , + }, + }, + }, + (block) => { + block.category = BlockCategory.TextAndContent; + return block; + }, +); diff --git a/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx b/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx new file mode 100644 index 000000000..97dc92485 --- /dev/null +++ b/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx @@ -0,0 +1,44 @@ +import { createCompositeBlock, createCompositeBlockTextField } from "@comet/blocks-admin"; +import { createRichTextBlock, SvgImageBlock } from "@comet/cms-admin"; +import { LinkBlock } from "@src/common/blocks/LinkBlock"; +import { FormattedMessage } from "react-intl"; + +const DescriptionRichTextBlock = createRichTextBlock({ + link: LinkBlock, + rte: { + maxBlocks: 1, + supports: ["bold", "italic", "sub", "sup", "non-breaking-space", "soft-hyphen"], + }, + minHeight: 0, +}); + +export const KeyFactsItemBlock = createCompositeBlock( + { + name: "KeyFactsItem", + displayName: , + blocks: { + icon: { + block: SvgImageBlock, + title: , + }, + fact: { + block: createCompositeBlockTextField({ + fieldProps: { fullWidth: true, label: }, + }), + }, + label: { + block: createCompositeBlockTextField({ + fieldProps: { fullWidth: true, label: }, + }), + }, + description: { + block: DescriptionRichTextBlock, + title: , + }, + }, + }, + (block) => { + block.previewContent = (state) => [{ type: "text", content: state.fact }]; + return block; + }, +); diff --git a/admin/src/documents/pages/blocks/PageContentBlock.tsx b/admin/src/documents/pages/blocks/PageContentBlock.tsx index 41c6399f1..cb48fcb17 100644 --- a/admin/src/documents/pages/blocks/PageContentBlock.tsx +++ b/admin/src/documents/pages/blocks/PageContentBlock.tsx @@ -7,6 +7,7 @@ import { RichTextBlock } from "@src/common/blocks/RichTextBlock"; import { SpaceBlock } from "@src/common/blocks/SpaceBlock"; import { StandaloneMediaBlock } from "@src/common/blocks/StandaloneMediaBlock"; import { ColumnsBlock } from "@src/documents/pages/blocks/ColumnsBlock"; +import { KeyFactsBlock } from "@src/documents/pages/blocks/KeyFactsBlock"; export const PageContentBlock = createBlocksBlock({ name: "PageContent", @@ -18,6 +19,7 @@ export const PageContentBlock = createBlocksBlock({ heading: HeadingBlock, columns: ColumnsBlock, callToActionList: CallToActionListBlock, + keyFacts: KeyFactsBlock, media: StandaloneMediaBlock, }, }); diff --git a/api/block-meta.json b/api/block-meta.json index 6cf7f74f4..ebb62f760 100644 --- a/api/block-meta.json +++ b/api/block-meta.json @@ -840,6 +840,145 @@ } ] }, + { + "name": "KeyFacts", + "fields": [ + { + "name": "heading", + "kind": "Block", + "block": "Heading", + "nullable": false + }, + { + "name": "items", + "kind": "Block", + "block": "KeyFactsItems", + "nullable": false + } + ], + "inputFields": [ + { + "name": "heading", + "kind": "Block", + "block": "Heading", + "nullable": false + }, + { + "name": "items", + "kind": "Block", + "block": "KeyFactsItems", + "nullable": false + } + ] + }, + { + "name": "KeyFactsItem", + "fields": [ + { + "name": "icon", + "kind": "Block", + "block": "SvgImage", + "nullable": false + }, + { + "name": "fact", + "kind": "String", + "nullable": false + }, + { + "name": "label", + "kind": "String", + "nullable": false + }, + { + "name": "description", + "kind": "Block", + "block": "RichText", + "nullable": false + } + ], + "inputFields": [ + { + "name": "icon", + "kind": "Block", + "block": "SvgImage", + "nullable": false + }, + { + "name": "fact", + "kind": "String", + "nullable": false + }, + { + "name": "label", + "kind": "String", + "nullable": false + }, + { + "name": "description", + "kind": "Block", + "block": "RichText", + "nullable": false + } + ] + }, + { + "name": "KeyFactsItems", + "fields": [ + { + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "KeyFactsItem", + "nullable": false + } + ] + }, + "nullable": false + } + ], + "inputFields": [ + { + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "KeyFactsItem", + "nullable": false + } + ] + }, + "nullable": false + } + ] + }, { "name": "Link", "fields": [ @@ -1047,6 +1186,7 @@ "heading": "Heading", "columns": "Columns", "callToActionList": "CallToActionList", + "keyFacts": "KeyFacts", "media": "StandaloneMedia" }, "nullable": false @@ -1088,6 +1228,7 @@ "heading": "Heading", "columns": "Columns", "callToActionList": "CallToActionList", + "keyFacts": "KeyFacts", "media": "StandaloneMedia" }, "nullable": false diff --git a/api/src/documents/pages/blocks/key-facts-item.block.ts b/api/src/documents/pages/blocks/key-facts-item.block.ts new file mode 100644 index 000000000..e81efd8f8 --- /dev/null +++ b/api/src/documents/pages/blocks/key-facts-item.block.ts @@ -0,0 +1,50 @@ +import { + BlockData, + BlockDataInterface, + BlockField, + BlockInput, + ChildBlock, + ChildBlockInput, + createBlock, + ExtractBlockInput, + inputToData, +} from "@comet/blocks-api"; +import { SvgImageBlock } from "@comet/cms-api"; +import { RichTextBlock } from "@src/common/blocks/rich-text.block"; +import { IsString } from "class-validator"; + +class KeyFactsItemBlockData extends BlockData { + @ChildBlock(SvgImageBlock) + icon: BlockDataInterface; + + @BlockField() + fact: string; + + @BlockField() + label: string; + + @ChildBlock(RichTextBlock) + description: BlockDataInterface; +} + +class KeyFactsItemBlockInput extends BlockInput { + @ChildBlockInput(SvgImageBlock) + icon: ExtractBlockInput; + + @BlockField() + @IsString() + fact: string; + + @BlockField() + @IsString() + label: string; + + @ChildBlockInput(RichTextBlock) + description: ExtractBlockInput; + + transformToBlockData(): KeyFactsItemBlockData { + return inputToData(KeyFactsItemBlockData, this); + } +} + +export const KeyFactsItemBlock = createBlock(KeyFactsItemBlockData, KeyFactsItemBlockInput, "KeyFactsItem"); diff --git a/api/src/documents/pages/blocks/key-facts.block.ts b/api/src/documents/pages/blocks/key-facts.block.ts new file mode 100644 index 000000000..3e009c1dd --- /dev/null +++ b/api/src/documents/pages/blocks/key-facts.block.ts @@ -0,0 +1,37 @@ +import { + BlockData, + BlockDataInterface, + BlockInput, + ChildBlock, + ChildBlockInput, + createBlock, + createListBlock, + ExtractBlockInput, + inputToData, +} from "@comet/blocks-api"; +import { HeadingBlock } from "@src/common/blocks/heading.block"; +import { KeyFactsItemBlock } from "@src/documents/pages/blocks/key-facts-item.block"; + +const KeyFactsItemsBlock = createListBlock({ block: KeyFactsItemBlock }, "KeyFactsItems"); + +class KeyFactsBlockData extends BlockData { + @ChildBlock(HeadingBlock) + heading: BlockDataInterface; + + @ChildBlock(KeyFactsItemsBlock) + items: BlockDataInterface; +} + +class KeyFactsBlockInput extends BlockInput { + @ChildBlockInput(HeadingBlock) + heading: ExtractBlockInput; + + @ChildBlockInput(KeyFactsItemsBlock) + items: ExtractBlockInput; + + transformToBlockData(): KeyFactsBlockData { + return inputToData(KeyFactsBlockData, this); + } +} + +export const KeyFactsBlock = createBlock(KeyFactsBlockData, KeyFactsBlockInput, "KeyFacts"); diff --git a/api/src/documents/pages/blocks/page-content.block.ts b/api/src/documents/pages/blocks/page-content.block.ts index 4dfcd0dba..b78f4dc4f 100644 --- a/api/src/documents/pages/blocks/page-content.block.ts +++ b/api/src/documents/pages/blocks/page-content.block.ts @@ -7,6 +7,7 @@ import { RichTextBlock } from "@src/common/blocks/rich-text.block"; import { SpaceBlock } from "@src/common/blocks/space.block"; import { StandaloneMediaBlock } from "@src/common/blocks/standalone-media.block"; import { ColumnsBlock } from "@src/documents/pages/blocks/columns.block"; +import { KeyFactsBlock } from "@src/documents/pages/blocks/key-facts.block"; export const PageContentBlock = createBlocksBlock( { @@ -18,6 +19,7 @@ export const PageContentBlock = createBlocksBlock( heading: HeadingBlock, columns: ColumnsBlock, callToActionList: CallToActionListBlock, + keyFacts: KeyFactsBlock, media: StandaloneMediaBlock, }, }, diff --git a/site/src/documents/pages/blocks/KeyFactItemBlock.tsx b/site/src/documents/pages/blocks/KeyFactItemBlock.tsx new file mode 100644 index 000000000..023f1a7b2 --- /dev/null +++ b/site/src/documents/pages/blocks/KeyFactItemBlock.tsx @@ -0,0 +1,46 @@ +import { hasRichTextBlockContent, PropsWithData, SvgImageBlock, withPreview } from "@comet/cms-site"; +import { KeyFactsItemBlockData } from "@src/blocks.generated"; +import { defaultRichTextRenderers, RichTextBlock } from "@src/common/blocks/RichTextBlock"; +import { Typography } from "@src/common/components/Typography"; +import { Renderers } from "redraft"; +import styled from "styled-components"; + +const descriptionRenderers: Renderers = { + inline: defaultRichTextRenderers.inline, +}; + +export const KeyFactItemBlock = withPreview( + ({ data: { icon, fact, label, description } }: PropsWithData) => ( + + {icon.damFile && } + {fact} + {label} + {hasRichTextBlockContent(description) && ( + + + + )} + + ), + { label: "Key fact" }, +); + +const Root = styled.div` + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +`; + +const Icon = styled(SvgImageBlock)` + margin-bottom: ${({ theme }) => theme.spacing.S100}; +`; + +const FactTypography = styled(Typography)` + margin-bottom: ${({ theme }) => theme.spacing.S300}; + color: ${({ theme }) => theme.palette.primary.dark}; +`; + +const DescriptionTypography = styled(Typography)` + margin-top: ${({ theme }) => theme.spacing.S100}; +`; diff --git a/site/src/documents/pages/blocks/KeyFactsBlock.tsx b/site/src/documents/pages/blocks/KeyFactsBlock.tsx new file mode 100644 index 000000000..a9a91000f --- /dev/null +++ b/site/src/documents/pages/blocks/KeyFactsBlock.tsx @@ -0,0 +1,42 @@ +import { ListBlock, PropsWithData, withPreview } from "@comet/cms-site"; +import { KeyFactsBlockData } from "@src/blocks.generated"; +import { HeadingBlock } from "@src/common/blocks/HeadingBlock"; +import { PageLayout } from "@src/layout/PageLayout"; +import styled, { css } from "styled-components"; + +import { KeyFactItemBlock } from "./KeyFactItemBlock"; + +export const KeyFactsBlock = withPreview( + ({ data: { heading, items } }: PropsWithData) => ( + + + + + } /> + + + + ), + { label: "Key facts" }, +); + +const PageLayoutContent = styled.div` + grid-column: 3 / -3; + margin: ${({ theme }) => theme.spacing.D300} 0; +`; + +const ItemWrapper = styled.div<{ $listItemCount: number }>` + margin-top: ${({ theme }) => theme.spacing.D200}; + display: grid; + gap: ${({ theme }) => theme.spacing.D100}; + + ${({ $listItemCount, theme }) => + $listItemCount > 0 && + css` + grid-template-columns: repeat(${Math.min($listItemCount, 2)}, 1fr); + + ${theme.breakpoints.sm.mediaQuery} { + grid-template-columns: repeat(${Math.min($listItemCount, 4)}, 1fr); + } + `} +`; diff --git a/site/src/documents/pages/blocks/PageContentBlock.tsx b/site/src/documents/pages/blocks/PageContentBlock.tsx index 58ef0dba0..361de9bba 100644 --- a/site/src/documents/pages/blocks/PageContentBlock.tsx +++ b/site/src/documents/pages/blocks/PageContentBlock.tsx @@ -9,6 +9,7 @@ import { PageContentRichTextBlock } from "@src/common/blocks/RichTextBlock"; import { SpaceBlock } from "@src/common/blocks/SpaceBlock"; import { StandaloneMediaBlock } from "@src/common/blocks/StandaloneMediaBlock"; import { ColumnsBlock } from "@src/documents/pages/blocks/ColumnsBlock"; +import { KeyFactsBlock } from "@src/documents/pages/blocks/KeyFactsBlock"; const supportedBlocks: SupportedBlocks = { accordion: (props) => , @@ -18,6 +19,7 @@ const supportedBlocks: SupportedBlocks = { heading: (props) => , columns: (props) => , callToActionList: (props) => , + keyFacts: (props) => , media: (props) => , }; From 3dbe54e5b3c930a01aea346604b7c2a82a9d8341 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:02:36 +0200 Subject: [PATCH 005/340] Improve `HeadingBlock` preview skeleton (#299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > Ich würd bei Eyebrow kein PreviewSkeleton machen, weil sie sowieso optional ist. Bei Heading macht’s noch mehr Sinn. Dann gibt’s für den HeadlineBlock auch nur einen Placeholder, was ich besser finde. - Remove preview skeleton for eyebrow. - Improve representation of preview skeleton of the headline --- site/src/common/blocks/HeadingBlock.tsx | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/site/src/common/blocks/HeadingBlock.tsx b/site/src/common/blocks/HeadingBlock.tsx index 8faca4eb1..6dbce89d6 100644 --- a/site/src/common/blocks/HeadingBlock.tsx +++ b/site/src/common/blocks/HeadingBlock.tsx @@ -1,5 +1,5 @@ "use client"; -import { PropsWithData, withPreview } from "@comet/cms-site"; +import { hasRichTextBlockContent, PreviewSkeleton, PropsWithData, withPreview } from "@comet/cms-site"; import { HeadingBlockData } from "@src/blocks.generated"; import { Typography } from "@src/common/components/Typography"; import { PageLayout } from "@src/layout/PageLayout"; @@ -77,10 +77,21 @@ export const HeadingBlock = withPreview( return ( - - - - + {hasRichTextBlockContent(eyebrow) && ( + + + + )} + + Headline + + } + > + + ); }, @@ -102,3 +113,7 @@ const Root = styled.div<{ $textAlign: CSSProperties["textAlign"] }>` const PageLayoutContent = styled.div` grid-column: 3 / -3; `; + +const HeadlineSkeleton = styled(Typography)` + color: inherit; +`; From 3777a33cce6ae403f66fac97ecad9af85c5e22b1 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:26:39 +0200 Subject: [PATCH 006/340] Add `PageLayout` to `StandaloneMediaBlock` (#303) Prevent media from full width on screens larger than max page layout width --- site/src/common/blocks/StandaloneMediaBlock.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/site/src/common/blocks/StandaloneMediaBlock.tsx b/site/src/common/blocks/StandaloneMediaBlock.tsx index 714a38b4e..1cc466fa7 100644 --- a/site/src/common/blocks/StandaloneMediaBlock.tsx +++ b/site/src/common/blocks/StandaloneMediaBlock.tsx @@ -2,10 +2,15 @@ import { PropsWithData, withPreview } from "@comet/cms-site"; import { StandaloneMediaBlockData } from "@src/blocks.generated"; import { MediaBlock } from "@src/common/blocks/MediaBlock"; +import { PageLayout } from "@src/layout/PageLayout"; export const StandaloneMediaBlock = withPreview( ({ data: { media, aspectRatio } }: PropsWithData) => { - return ; + return ( + + + + ); }, { label: "Media" }, ); From d3e1d90d9726c548498297db0af3ac002f8c5351 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:14:17 +0200 Subject: [PATCH 007/340] Update Comet to 7.0.0-beta.5 (#301) --- admin/package-lock.json | 114 +++++++++++++++++------------------ admin/package.json | 20 +++--- api/package-lock.json | 64 ++++++++++---------- api/package.json | 8 +-- create-app/package-lock.json | 18 +++--- create-app/package.json | 4 +- package-lock.json | 8 +-- package.json | 2 +- site/package-lock.json | 34 +++++------ site/package.json | 8 +-- 10 files changed, 140 insertions(+), 140 deletions(-) diff --git a/admin/package-lock.json b/admin/package-lock.json index 354cf91cf..4c1a0062d 100644 --- a/admin/package-lock.json +++ b/admin/package-lock.json @@ -8,13 +8,13 @@ "hasInstallScript": true, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.4", - "@comet/admin-date-time": "7.0.0-beta.4", - "@comet/admin-icons": "7.0.0-beta.4", - "@comet/admin-rte": "7.0.0-beta.4", - "@comet/admin-theme": "7.0.0-beta.4", - "@comet/blocks-admin": "7.0.0-beta.4", - "@comet/cms-admin": "7.0.0-beta.4", + "@comet/admin": "7.0.0-beta.5", + "@comet/admin-date-time": "7.0.0-beta.5", + "@comet/admin-icons": "7.0.0-beta.5", + "@comet/admin-rte": "7.0.0-beta.5", + "@comet/admin-theme": "7.0.0-beta.5", + "@comet/blocks-admin": "7.0.0-beta.5", + "@comet/cms-admin": "7.0.0-beta.5", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -43,9 +43,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.4", - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1197,12 +1197,12 @@ } }, "node_modules/@comet/admin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0-beta.4.tgz", - "integrity": "sha512-lx/sBJa09yTwVERIGy+dMw87ZNFkiA6O4oikvRthxt7ubi9xSITRJNmrEe2ZPi9J2mYEF/BIkCQkmRbFP1N0YQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0-beta.5.tgz", + "integrity": "sha512-BVL8NYshcQJMzZpNSTo0oo/kFnRjuqEFkYSZtdWkyVG4YyEweHaNIUjHMFgCZt5WciadyIfU/VV2mALPKHAYPg==", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.4", - "@comet/admin-theme": "^7.0.0-beta.4", + "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin-theme": "^7.0.0-beta.5", "@mui/lab": "^5.0.0-alpha.76", "@mui/private-theming": "^5.0.0", "clsx": "^1.1.1", @@ -1250,12 +1250,12 @@ } }, "node_modules/@comet/admin-date-time": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0-beta.4.tgz", - "integrity": "sha512-z9Vs/0dr8bGuICbHGqHdLGVtzCsjhiAmHyZGIgcvPrgNTwpS0Q4wk5Ve3b9GuCqPrvLNZJ4g/rSGUnIlaJFYqw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0-beta.5.tgz", + "integrity": "sha512-k24yB1acEgvHqe0F7yczu69JlK97Xt7kYhFl+U0qhq0w6KBvHxnJwfcTNUmoj8Ku7QLzq1GyIXxA/+SXhq1rIg==", "dependencies": { - "@comet/admin": "^7.0.0-beta.4", - "@comet/admin-icons": "^7.0.0-beta.4", + "@comet/admin": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.5", "@mui/utils": "^5.4.1", "clsx": "^1.1.1", "date-fns": "^2.28.0", @@ -1270,9 +1270,9 @@ } }, "node_modules/@comet/admin-icons": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0-beta.4.tgz", - "integrity": "sha512-G94jDE7hzyZ5u/Zq5Ltlp+z7EbS9h/NPC6sbRf7NB+bboOJcqpQFKkJtwgekNlmAthCLdG1gl0engsjIke85FA==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0-beta.5.tgz", + "integrity": "sha512-3lSo7hchtl6VUKq5XwILNE9KzeIJODrQID4B7/34YLey8n0zzZ+X249RVW2cQjemrc6rFw4xLkICXbDtmIF7hw==", "peerDependencies": { "@mui/material": "^5.0.0", "react": "^17.0", @@ -1280,12 +1280,12 @@ } }, "node_modules/@comet/admin-rte": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0-beta.4.tgz", - "integrity": "sha512-Ah1Rvl5+8o+2Zi/DWKhmp1SehDWo/NymcdFoZvo5RjOP8QhWRGCxW3OPHe0GtoJ4xcYAs//i93QqXg/QrWol0g==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0-beta.5.tgz", + "integrity": "sha512-Jy81CvDHIxc3OOB1lyCzJmltD0wqizUODlVXZZIhDHsYv92ppaC79HnOTbq86DipEnhW4V3nLO4EXDNjyLmA8Q==", "dependencies": { - "@comet/admin": "^7.0.0-beta.4", - "@comet/admin-icons": "^7.0.0-beta.4", + "@comet/admin": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.5", "detect-browser": "^5.2.1", "draft-js-export-html": "^1.4.1", "draft-js-import-html": "^1.4.1", @@ -1303,11 +1303,11 @@ } }, "node_modules/@comet/admin-theme": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0-beta.4.tgz", - "integrity": "sha512-QGXeS3TGUs/Y6XgLbGUvD5f8/+woJcU8iR8C3fOxxAdO1sal7iziecR9LVb8NFxTtBDeO35XgS7fHjEFZG2v8g==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0-beta.5.tgz", + "integrity": "sha512-G/Sj89LKjI5LDx3lfFJz238XVuaMI1ojrk8inzGzKeWEmsnLfNwaBZOWcrGdsnkIeiL+3yRQsRNUmtQt+f8qLw==", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.4", + "@comet/admin-icons": "^7.0.0-beta.5", "@mui/utils": "^5.4.1" }, "peerDependencies": { @@ -1317,12 +1317,12 @@ } }, "node_modules/@comet/blocks-admin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0-beta.4.tgz", - "integrity": "sha512-pMs0qWClEyPHwZRHjlwD/jRLHB5SaZM4rLfN6ZUDfz1pyeNsLgA73pEkKWIONVePUHHo1DnlWeYoolQdbXg2NA==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0-beta.5.tgz", + "integrity": "sha512-Rw16paHF+u/jf9Nep+rkr5W4r5aBGo3D8fgxeeukuPkHsN7uws+sAQsG4iXaPLi721vwTRD8ohR6UUunnIUoZg==", "dependencies": { - "@comet/admin": "^7.0.0-beta.4", - "@comet/admin-icons": "^7.0.0-beta.4", + "@comet/admin": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.5", "@mui/lab": "^5.0.0-alpha.76", "clipboard-copy": "^4.0.0", "clsx": "^1.1.1", @@ -1343,9 +1343,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.4.tgz", - "integrity": "sha512-uvckeXXUCA0gMJ3QmLOOsYxdRlfDrBnVS6sgDd2ijtj2u9X7MC4s0dnfvjx4koMoR1bigGf51GdQboe8YbW4fQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", + "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", "dev": true, "dependencies": { "commander": "^9.2.0", @@ -1359,16 +1359,16 @@ } }, "node_modules/@comet/cms-admin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0-beta.4.tgz", - "integrity": "sha512-kntwkb6S06aesabkZv+qElXsKbW32hNTFmlMiiiw1fXgjRLDN+H0B9LYqrCk3mjfDgSHP8k56TKWiE0D83lCSg==", - "dependencies": { - "@comet/admin": "^7.0.0-beta.4", - "@comet/admin-date-time": "^7.0.0-beta.4", - "@comet/admin-icons": "^7.0.0-beta.4", - "@comet/admin-rte": "^7.0.0-beta.4", - "@comet/admin-theme": "^7.0.0-beta.4", - "@comet/blocks-admin": "^7.0.0-beta.4", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0-beta.5.tgz", + "integrity": "sha512-xlydw8Be2M9P29yg8XT4nhJqv8TWtlrtSjpC+y3QMvs/K29dW5Wy20zLjB1W8SEtFSVD2G83WZ0Y+/G5iXlAAA==", + "dependencies": { + "@comet/admin": "^7.0.0-beta.5", + "@comet/admin-date-time": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin-rte": "^7.0.0-beta.5", + "@comet/admin-theme": "^7.0.0-beta.5", + "@comet/blocks-admin": "^7.0.0-beta.5", "@graphql-tools/graphql-file-loader": "^7.5.17", "@graphql-tools/load": "^7.8.14", "@graphql-typed-document-node/core": "^3.1.1", @@ -1456,13 +1456,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.4.tgz", - "integrity": "sha512-gZsnk0bGNfb4U5dasImkAQZZp3D05DAHITSeaHlhZAwOzTLL2NdNRZXATbEeNWgqjYyd/e02bM52GrkMlmBqbw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", + "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.4", + "@comet/eslint-plugin": "^7.0.0-beta.5", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -1489,9 +1489,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.4.tgz", - "integrity": "sha512-Ji3rAawg70JLRWVCxXxSZTiXiHbYqjod1Lr0e3M+lKSnyd8VbsX0fAZ/i0wlp1rtTAUGmolRJplAbcWsg8YVig==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", + "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/admin/package.json b/admin/package.json index c20f411fc..f070bbf05 100644 --- a/admin/package.json +++ b/admin/package.json @@ -26,13 +26,13 @@ }, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.4", - "@comet/admin-date-time": "7.0.0-beta.4", - "@comet/admin-icons": "7.0.0-beta.4", - "@comet/admin-rte": "7.0.0-beta.4", - "@comet/admin-theme": "7.0.0-beta.4", - "@comet/blocks-admin": "7.0.0-beta.4", - "@comet/cms-admin": "7.0.0-beta.4", + "@comet/admin": "7.0.0-beta.5", + "@comet/admin-date-time": "7.0.0-beta.5", + "@comet/admin-icons": "7.0.0-beta.5", + "@comet/admin-rte": "7.0.0-beta.5", + "@comet/admin-theme": "7.0.0-beta.5", + "@comet/blocks-admin": "7.0.0-beta.5", + "@comet/cms-admin": "7.0.0-beta.5", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -61,9 +61,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.4", - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", diff --git a/api/package-lock.json b/api/package-lock.json index 19665ae74..af64ef785 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -6,8 +6,8 @@ "": { "name": "starter-api", "dependencies": { - "@comet/blocks-api": "7.0.0-beta.4", - "@comet/cms-api": "7.0.0-beta.4", + "@comet/blocks-api": "7.0.0-beta.5", + "@comet/cms-api": "7.0.0-beta.5", "@faker-js/faker": "^8.3.1", "@mikro-orm/cli": "^5.0.5", "@mikro-orm/core": "^5.0.5", @@ -43,8 +43,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", @@ -2169,9 +2169,9 @@ } }, "node_modules/@comet/blocks-api": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.4.tgz", - "integrity": "sha512-96JMnPP8PmSHoU20EaiSfFVIl0HfwppyDb3mSBFHdBjF+QriTP3AwIyYh3uA2eltasQl5lE8Joy5Wo6yBj3bFQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.5.tgz", + "integrity": "sha512-6D8o+szUmlChj8ZkIBEhUSkdwrsiqfIZE5wl2zge7+x3BRWM1/h626zclzVS/Il/iJzm/XdCUvn4+NEhnp/52Q==", "dependencies": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -2182,14 +2182,14 @@ } }, "node_modules/@comet/cms-api": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.4.tgz", - "integrity": "sha512-PgTVuDxR5iN+XdOM/TWmNasam6aaRh5zLJor610wUEMRUFCaXgGeojzKmaO6hvcSr+UqXdcl83SFjnR7ZmsVyA==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.5.tgz", + "integrity": "sha512-QaURCpX3swwLFPC5E8mfHV3Bqs4AMRYlAror8P6pzhe5uMpIr1Ypvqo/Zko1Jl3bcmvcbQ3Lrt/nEa9kxzgxVg==", "dependencies": { "@aws-sdk/client-s3": "^3.591.0", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.4", + "@comet/blocks-api": "^7.0.0-beta.5", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -2291,13 +2291,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.4.tgz", - "integrity": "sha512-gZsnk0bGNfb4U5dasImkAQZZp3D05DAHITSeaHlhZAwOzTLL2NdNRZXATbEeNWgqjYyd/e02bM52GrkMlmBqbw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", + "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.4", + "@comet/eslint-plugin": "^7.0.0-beta.5", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -2324,9 +2324,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.4.tgz", - "integrity": "sha512-Ji3rAawg70JLRWVCxXxSZTiXiHbYqjod1Lr0e3M+lKSnyd8VbsX0fAZ/i0wlp1rtTAUGmolRJplAbcWsg8YVig==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", + "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", "dev": true, "peerDependencies": { "eslint": "8" @@ -21245,9 +21245,9 @@ "optional": true }, "@comet/blocks-api": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.4.tgz", - "integrity": "sha512-96JMnPP8PmSHoU20EaiSfFVIl0HfwppyDb3mSBFHdBjF+QriTP3AwIyYh3uA2eltasQl5lE8Joy5Wo6yBj3bFQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.5.tgz", + "integrity": "sha512-6D8o+szUmlChj8ZkIBEhUSkdwrsiqfIZE5wl2zge7+x3BRWM1/h626zclzVS/Il/iJzm/XdCUvn4+NEhnp/52Q==", "requires": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -21255,14 +21255,14 @@ } }, "@comet/cms-api": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.4.tgz", - "integrity": "sha512-PgTVuDxR5iN+XdOM/TWmNasam6aaRh5zLJor610wUEMRUFCaXgGeojzKmaO6hvcSr+UqXdcl83SFjnR7ZmsVyA==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.5.tgz", + "integrity": "sha512-QaURCpX3swwLFPC5E8mfHV3Bqs4AMRYlAror8P6pzhe5uMpIr1Ypvqo/Zko1Jl3bcmvcbQ3Lrt/nEa9kxzgxVg==", "requires": { "@aws-sdk/client-s3": "^3.591.0", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.4", + "@comet/blocks-api": "^7.0.0-beta.5", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -21332,13 +21332,13 @@ } }, "@comet/eslint-config": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.4.tgz", - "integrity": "sha512-gZsnk0bGNfb4U5dasImkAQZZp3D05DAHITSeaHlhZAwOzTLL2NdNRZXATbEeNWgqjYyd/e02bM52GrkMlmBqbw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", + "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", "dev": true, "requires": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.4", + "@comet/eslint-plugin": "^7.0.0-beta.5", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -21356,9 +21356,9 @@ } }, "@comet/eslint-plugin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.4.tgz", - "integrity": "sha512-Ji3rAawg70JLRWVCxXxSZTiXiHbYqjod1Lr0e3M+lKSnyd8VbsX0fAZ/i0wlp1rtTAUGmolRJplAbcWsg8YVig==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", + "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", "dev": true, "requires": {} }, diff --git a/api/package.json b/api/package.json index e71717eae..4bef8bcb3 100644 --- a/api/package.json +++ b/api/package.json @@ -49,8 +49,8 @@ } }, "dependencies": { - "@comet/blocks-api": "7.0.0-beta.4", - "@comet/cms-api": "7.0.0-beta.4", + "@comet/blocks-api": "7.0.0-beta.5", + "@comet/cms-api": "7.0.0-beta.5", "@faker-js/faker": "^8.3.1", "@mikro-orm/cli": "^5.0.5", "@mikro-orm/core": "^5.0.5", @@ -86,8 +86,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", diff --git a/create-app/package-lock.json b/create-app/package-lock.json index 8bc28e62e..6fbaf782b 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -20,8 +20,8 @@ "create-app": "bin/index.js" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", @@ -158,13 +158,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.4.tgz", - "integrity": "sha512-gZsnk0bGNfb4U5dasImkAQZZp3D05DAHITSeaHlhZAwOzTLL2NdNRZXATbEeNWgqjYyd/e02bM52GrkMlmBqbw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", + "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.4", + "@comet/eslint-plugin": "^7.0.0-beta.5", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -191,9 +191,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.4.tgz", - "integrity": "sha512-Ji3rAawg70JLRWVCxXxSZTiXiHbYqjod1Lr0e3M+lKSnyd8VbsX0fAZ/i0wlp1rtTAUGmolRJplAbcWsg8YVig==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", + "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/create-app/package.json b/create-app/package.json index a3d8b0c27..72e152f81 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -39,8 +39,8 @@ "rimraf": "^5.0.1" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", diff --git a/package-lock.json b/package-lock.json index 453f29bbc..aeedd786a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter", "devDependencies": { - "@comet/cli": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", @@ -28,9 +28,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.4.tgz", - "integrity": "sha512-uvckeXXUCA0gMJ3QmLOOsYxdRlfDrBnVS6sgDd2ijtj2u9X7MC4s0dnfvjx4koMoR1bigGf51GdQboe8YbW4fQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", + "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", "dev": true, "dependencies": { "commander": "^9.2.0", diff --git a/package.json b/package.json index be0612e21..07b2d3da9 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "browser:jaeger": "dotenv -- sh -c 'open-cli http://localhost:$JAEGER_UI_PORT'" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", diff --git a/site/package-lock.json b/site/package-lock.json index 74d69fe91..6982960c3 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter-site", "dependencies": { - "@comet/cms-site": "7.0.0-beta.4", + "@comet/cms-site": "7.0.0-beta.5", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -24,9 +24,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.4", - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1049,9 +1049,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.4.tgz", - "integrity": "sha512-uvckeXXUCA0gMJ3QmLOOsYxdRlfDrBnVS6sgDd2ijtj2u9X7MC4s0dnfvjx4koMoR1bigGf51GdQboe8YbW4fQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", + "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", "dev": true, "dependencies": { "commander": "^9.2.0", @@ -1065,9 +1065,9 @@ } }, "node_modules/@comet/cms-site": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0-beta.4.tgz", - "integrity": "sha512-4WfhuL0AjyHWF8EAuLtOcEOhoTqyqPYx/VAnw+a7W0DGAPAhlXwoK6o+PUXIX5Ntm3CvmZmTWf+wFOpeSwxhSQ==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0-beta.5.tgz", + "integrity": "sha512-ztBfigfVQ1mpT4/NfEBZoMXIEF9vTMMFosu3Y59EHhBqDoS8sX/jq7psQ/GTssaX0h3rPXJ/JHFORCU4ttJjfw==", "dependencies": { "jose": "^5.2.4", "rimraf": "^3.0.0", @@ -1089,13 +1089,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.4.tgz", - "integrity": "sha512-gZsnk0bGNfb4U5dasImkAQZZp3D05DAHITSeaHlhZAwOzTLL2NdNRZXATbEeNWgqjYyd/e02bM52GrkMlmBqbw==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", + "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.4", + "@comet/eslint-plugin": "^7.0.0-beta.5", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -1122,9 +1122,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.4", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.4.tgz", - "integrity": "sha512-Ji3rAawg70JLRWVCxXxSZTiXiHbYqjod1Lr0e3M+lKSnyd8VbsX0fAZ/i0wlp1rtTAUGmolRJplAbcWsg8YVig==", + "version": "7.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", + "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/site/package.json b/site/package.json index 1a30e9774..68b2cff98 100644 --- a/site/package.json +++ b/site/package.json @@ -20,7 +20,7 @@ "intl:compile": "formatjs compile-folder --format simple --ast lang/starter-lang/site lang-compiled/" }, "dependencies": { - "@comet/cms-site": "7.0.0-beta.4", + "@comet/cms-site": "7.0.0-beta.5", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -38,9 +38,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.4", - "@comet/eslint-config": "7.0.0-beta.4", - "@comet/eslint-plugin": "7.0.0-beta.4", + "@comet/cli": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.5", + "@comet/eslint-plugin": "7.0.0-beta.5", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", From c826013546337a74b577b0c9cccc442d6e1e030e Mon Sep 17 00:00:00 2001 From: johnnyomair Date: Tue, 16 Jul 2024 15:14:36 +0000 Subject: [PATCH 008/340] @comet/create-app: Publish v1.25.0 --- create-app/package-lock.json | 4 ++-- create-app/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/create-app/package-lock.json b/create-app/package-lock.json index 6fbaf782b..0f81fc0bd 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comet/create-app", - "version": "1.24.0", + "version": "1.25.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comet/create-app", - "version": "1.24.0", + "version": "1.25.0", "license": "BSD-2-Clause", "dependencies": { "commander": "^11.0.0", diff --git a/create-app/package.json b/create-app/package.json index 72e152f81..2f8720f0c 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@comet/create-app", - "version": "1.24.0", + "version": "1.25.0", "description": "Command-line interface to create a new Comet application", "homepage": "https://github.com/vivid-planet/comet-starter/tree/main/create-app#readme", "bugs": { From 26b6f5f0a3b82de4c08c08a9970ed0fc3d9a74c1 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Wed, 17 Jul 2024 09:16:34 +0200 Subject: [PATCH 009/340] Remove next/navigation compat types (#302) Only needed when we both Pages and App Router is used: https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/typescript/writeAppTypeDeclarations.ts#L52-L56. --- site/next-env.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/site/next-env.d.ts b/site/next-env.d.ts index fd36f9494..4f11a03dc 100644 --- a/site/next-env.d.ts +++ b/site/next-env.d.ts @@ -1,6 +1,5 @@ /// /// -/// // NOTE: This file should not be edited // see https://nextjs.org/docs/basic-features/typescript for more information. From 4ee570f9a2b547c142ff5a576890b3d18b20124b Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:18:43 +0200 Subject: [PATCH 010/340] Fix dotenv calls (#306) Without `-c`, `.env` and `.env.local` won't be loaded. Noticed this while trying to run fixtures. --- admin/package.json | 2 +- api/package.json | 8 ++++---- site/package.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/admin/package.json b/admin/package.json index f070bbf05..fdcd48e68 100644 --- a/admin/package.json +++ b/admin/package.json @@ -4,7 +4,7 @@ "scripts": { "postinstall": "cd server && npm install", "serve": "cd server && npm run serve", - "start": "npm run intl:compile && run-p gql:types generate-block-types && dotenv -e .env.secrets -e .env.site-configs -- vite", + "start": "npm run intl:compile && run-p gql:types generate-block-types && dotenv -c -e .env.secrets -e .env.site-configs -- vite", "build": "npm run intl:compile && run-p gql:types generate-block-types && NODE_ENV=production vite build", "preview": "npm run build && vite preview", "gql:types": "graphql-codegen", diff --git a/api/package.json b/api/package.json index 4bef8bcb3..680abbd1a 100644 --- a/api/package.json +++ b/api/package.json @@ -5,7 +5,7 @@ "api-generator": "rimraf 'src/*/generated' && comet-api-generator generate", "prebuild": "rimraf dist", "build": "nest build", - "console": "dotenv -e .env.secrets -e .env.site-configs -- ts-node --transpile-only -r tsconfig-paths/register src/console.ts", + "console": "dotenv -c -e .env.secrets -e .env.site-configs -- ts-node --transpile-only -r tsconfig-paths/register src/console.ts", "console:prod": "node dist/console.js", "db:migrate": "npm run console migrate --", "db:migrate:prod": "npm run console:prod migrate --", @@ -20,9 +20,9 @@ "mikro-orm": "mikro-orm", "mikro-orm:drop": "mikro-orm schema:drop -r", "mikro-orm:migration:generate": "mikro-orm migration:create", - "start": "npm run prebuild && dotenv -e .env.secrets -e .env.site-configs -- nest start", - "start:debug": "npm run prebuild && dotenv -e .env.secrets -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput", - "start:dev": "npm run prebuild && npm run db:migrate && npm run console createBlockIndexViews && dotenv -e .env.secrets -e .env.site-configs -- nest start --watch --preserveWatchOutput", + "start": "npm run prebuild && dotenv -c -e .env.secrets -e .env.site-configs -- nest start", + "start:debug": "npm run prebuild && dotenv -c -e .env.secrets -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput", + "start:dev": "npm run prebuild && npm run db:migrate && npm run console createBlockIndexViews && dotenv -c -e .env.secrets -e .env.site-configs -- nest start --watch --preserveWatchOutput", "start:prod": "node dist/main", "test": "jest --passWithNoTests", "test:ci": "npm run test -- --ci --reporters=default --reporters=jest-junit", diff --git a/site/package.json b/site/package.json index 68b2cff98..155391736 100644 --- a/site/package.json +++ b/site/package.json @@ -2,7 +2,7 @@ "name": "starter-site", "private": true, "scripts": { - "dev": "npm run intl:compile && run-s gql:types generate-block-types && NODE_OPTIONS='--inspect=localhost:9230' dotenv -e .env.secrets -e .env.site-configs -- node server.js", + "dev": "npm run intl:compile && run-s gql:types generate-block-types && NODE_OPTIONS='--inspect=localhost:9230' dotenv -c -e .env.secrets -e .env.site-configs -- node server.js", "build": "npm run intl:compile && run-p gql:types generate-block-types && next build", "serve": "NODE_ENV=production node server.js", "export": "next export", From 6b6288eb4e348965137e7a669dd0a040f405a370 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:16:18 +0200 Subject: [PATCH 011/340] Throw error for duplicate messages with different default messages (#307) --- admin/package.json | 4 ++-- admin/src/common/blocks/AccordionItemBlock.tsx | 2 +- site/package.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/package.json b/admin/package.json index fdcd48e68..9b3db22e8 100644 --- a/admin/package.json +++ b/admin/package.json @@ -10,13 +10,13 @@ "gql:types": "graphql-codegen", "gql:watch": "graphql-codegen --watch", "prelint": "npm run intl:compile && run-p gql:types generate-block-types", - "lint": "run-p lint:eslint lint:tsc", + "lint": "run-p lint:eslint lint:tsc intl:extract", "lint:ci": "npm run lint && npm run lint:generated-files-not-modified", "lint:eslint": "eslint --max-warnings 0 --ext .ts,.tsx,.js,.jsx,.json,.md src/ package.json", "lint:generated-files-not-modified": "npm run api-generator && git diff --exit-code HEAD --", "lint:tsc": "tsc --project .", "lint:prettier": "npx prettier --check './**/*.{js,json,md,yml,yaml}'", - "intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore ./**.d.ts --out-file lang-extracted/en.json --format simple", + "intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore ./**.d.ts --out-file lang-extracted/en.json --format simple --throws", "intl:compile:comet": "formatjs compile-folder --format simple --ast lang/comet-lang lang-compiled/comet-lang", "intl:compile:starter-admin": "formatjs compile-folder --format simple --ast lang/starter-lang/admin lang-compiled/starter-admin", "intl:compile": "run-p intl:compile:starter-admin intl:compile:comet", diff --git a/admin/src/common/blocks/AccordionItemBlock.tsx b/admin/src/common/blocks/AccordionItemBlock.tsx index 64f64073f..7431e0789 100644 --- a/admin/src/common/blocks/AccordionItemBlock.tsx +++ b/admin/src/common/blocks/AccordionItemBlock.tsx @@ -27,7 +27,7 @@ const AccordionContentBlock = createBlocksBlock({ export const AccordionItemBlock = createCompositeBlock( { name: "AccordionItem", - displayName: , + displayName: , blocks: { title: { block: createCompositeBlockTextField({ diff --git a/site/package.json b/site/package.json index 155391736..b113fe059 100644 --- a/site/package.json +++ b/site/package.json @@ -9,14 +9,14 @@ "gql:types": "graphql-codegen", "gql:watch": "graphql-codegen --watch", "prelint": "npm run intl:compile && run-p gql:types generate-block-types", - "lint": "run-p lint:eslint lint:tsc lint:style", + "lint": "run-p lint:eslint lint:tsc lint:style intl:extract", "lint:eslint": "eslint --max-warnings 0 --config ./.eslintrc.cli.js --ext .ts,.tsx,.js,.jsx,.json,.md src/ package.json", "lint:prettier": "npx prettier --check './**/*.{js,json,md,yml,yaml}'", "lint:tsc": "tsc --project .", "lint:style": "npx stylelint '**/*.{ts,tsx,css}'", "generate-block-types": "comet generate-block-types", "generate-block-types:watch": "chokidar -s \"**/block-meta.json\" -c \"npm run generate-block-types\"", - "intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore **/*.d.ts --out-file lang-extracted/en.json --format simple", + "intl:extract": "formatjs extract \"src/**/*.ts*\" --ignore **/*.d.ts --out-file lang-extracted/en.json --format simple --throws", "intl:compile": "formatjs compile-folder --format simple --ast lang/starter-lang/site lang-compiled/" }, "dependencies": { From 63b50e2bbdb1d5d4e9dccdda0fb3a1bd9cdcfaf9 Mon Sep 17 00:00:00 2001 From: Thomas Dax Date: Mon, 22 Jul 2024 08:41:10 +0200 Subject: [PATCH 012/340] Update Comet to v7.0.0-beta.6 (#310) --- admin/package-lock.json | 114 ++++++++++++------------- admin/package.json | 20 ++--- admin/src/documents/links/EditLink.tsx | 2 +- admin/src/documents/pages/EditPage.tsx | 2 +- api/package-lock.json | 64 +++++++------- api/package.json | 8 +- create-app/package-lock.json | 18 ++-- create-app/package.json | 4 +- package-lock.json | 8 +- package.json | 2 +- site-configs.d.ts | 8 +- site-configs.ts | 7 +- site/package-lock.json | 34 ++++---- site/package.json | 8 +- 14 files changed, 152 insertions(+), 147 deletions(-) diff --git a/admin/package-lock.json b/admin/package-lock.json index 4c1a0062d..7c9127b5e 100644 --- a/admin/package-lock.json +++ b/admin/package-lock.json @@ -8,13 +8,13 @@ "hasInstallScript": true, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.5", - "@comet/admin-date-time": "7.0.0-beta.5", - "@comet/admin-icons": "7.0.0-beta.5", - "@comet/admin-rte": "7.0.0-beta.5", - "@comet/admin-theme": "7.0.0-beta.5", - "@comet/blocks-admin": "7.0.0-beta.5", - "@comet/cms-admin": "7.0.0-beta.5", + "@comet/admin": "7.0.0-beta.6", + "@comet/admin-date-time": "7.0.0-beta.6", + "@comet/admin-icons": "7.0.0-beta.6", + "@comet/admin-rte": "7.0.0-beta.6", + "@comet/admin-theme": "7.0.0-beta.6", + "@comet/blocks-admin": "7.0.0-beta.6", + "@comet/cms-admin": "7.0.0-beta.6", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -43,9 +43,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.5", - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1197,12 +1197,12 @@ } }, "node_modules/@comet/admin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0-beta.5.tgz", - "integrity": "sha512-BVL8NYshcQJMzZpNSTo0oo/kFnRjuqEFkYSZtdWkyVG4YyEweHaNIUjHMFgCZt5WciadyIfU/VV2mALPKHAYPg==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0-beta.6.tgz", + "integrity": "sha512-YsJAvQDRXUrfyBH1izmo3KxnD1BHkNvOI7BefQsri8ka6bxEPeqOqn5mZIvH5kzzKF6+IVVdGmws5G0uYpL1tQ==", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.5", - "@comet/admin-theme": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin-theme": "^7.0.0-beta.6", "@mui/lab": "^5.0.0-alpha.76", "@mui/private-theming": "^5.0.0", "clsx": "^1.1.1", @@ -1250,12 +1250,12 @@ } }, "node_modules/@comet/admin-date-time": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0-beta.5.tgz", - "integrity": "sha512-k24yB1acEgvHqe0F7yczu69JlK97Xt7kYhFl+U0qhq0w6KBvHxnJwfcTNUmoj8Ku7QLzq1GyIXxA/+SXhq1rIg==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0-beta.6.tgz", + "integrity": "sha512-olaN6qgNMD680Bq1ZBtlSa9hq+8YkLW4ST2jDUa07W2vWNbAMq2yNHAzgTWHSNsM6169bVVh6oSILjcy7jK9pw==", "dependencies": { - "@comet/admin": "^7.0.0-beta.5", - "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0-beta.6", "@mui/utils": "^5.4.1", "clsx": "^1.1.1", "date-fns": "^2.28.0", @@ -1270,9 +1270,9 @@ } }, "node_modules/@comet/admin-icons": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0-beta.5.tgz", - "integrity": "sha512-3lSo7hchtl6VUKq5XwILNE9KzeIJODrQID4B7/34YLey8n0zzZ+X249RVW2cQjemrc6rFw4xLkICXbDtmIF7hw==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0-beta.6.tgz", + "integrity": "sha512-tWNxMxlA6pSLZPgFRszsaUr1nCU0yp9NvONk5+pSk7dQwaRzinq+oOT1CBtS32ovA/aRNX6JMN0H9vgdKiCJgg==", "peerDependencies": { "@mui/material": "^5.0.0", "react": "^17.0", @@ -1280,12 +1280,12 @@ } }, "node_modules/@comet/admin-rte": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0-beta.5.tgz", - "integrity": "sha512-Jy81CvDHIxc3OOB1lyCzJmltD0wqizUODlVXZZIhDHsYv92ppaC79HnOTbq86DipEnhW4V3nLO4EXDNjyLmA8Q==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0-beta.6.tgz", + "integrity": "sha512-g/wxDqQkKsv62fojG+Vxx4c+2Cd0WxTL9yk3F0vCYe2R+P2nrQac1oKdFsFMMsFDzHYWt66o1/8isTWlx/FGLA==", "dependencies": { - "@comet/admin": "^7.0.0-beta.5", - "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0-beta.6", "detect-browser": "^5.2.1", "draft-js-export-html": "^1.4.1", "draft-js-import-html": "^1.4.1", @@ -1303,11 +1303,11 @@ } }, "node_modules/@comet/admin-theme": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0-beta.5.tgz", - "integrity": "sha512-G/Sj89LKjI5LDx3lfFJz238XVuaMI1ojrk8inzGzKeWEmsnLfNwaBZOWcrGdsnkIeiL+3yRQsRNUmtQt+f8qLw==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0-beta.6.tgz", + "integrity": "sha512-prZ4XZ9UKLTUVV0aYpp3CAmX0SceKIycJvbW0jA3aNtNqllmuD9bhBhdvzg3UbpI6FJXe5lr8la3nkMnhqdQvA==", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin-icons": "^7.0.0-beta.6", "@mui/utils": "^5.4.1" }, "peerDependencies": { @@ -1317,12 +1317,12 @@ } }, "node_modules/@comet/blocks-admin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0-beta.5.tgz", - "integrity": "sha512-Rw16paHF+u/jf9Nep+rkr5W4r5aBGo3D8fgxeeukuPkHsN7uws+sAQsG4iXaPLi721vwTRD8ohR6UUunnIUoZg==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0-beta.6.tgz", + "integrity": "sha512-8VSsZLhjTiUM82G08nrCIT5WW+hqAe8Fwc8NqHKPIOo0dNjPWa9J8z2cgOGNHxmd/oO5J0N3MuBWOTL4oC85cg==", "dependencies": { - "@comet/admin": "^7.0.0-beta.5", - "@comet/admin-icons": "^7.0.0-beta.5", + "@comet/admin": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0-beta.6", "@mui/lab": "^5.0.0-alpha.76", "clipboard-copy": "^4.0.0", "clsx": "^1.1.1", @@ -1343,9 +1343,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", - "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", + "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", "dev": true, "dependencies": { "commander": "^9.2.0", @@ -1359,16 +1359,16 @@ } }, "node_modules/@comet/cms-admin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0-beta.5.tgz", - "integrity": "sha512-xlydw8Be2M9P29yg8XT4nhJqv8TWtlrtSjpC+y3QMvs/K29dW5Wy20zLjB1W8SEtFSVD2G83WZ0Y+/G5iXlAAA==", - "dependencies": { - "@comet/admin": "^7.0.0-beta.5", - "@comet/admin-date-time": "^7.0.0-beta.5", - "@comet/admin-icons": "^7.0.0-beta.5", - "@comet/admin-rte": "^7.0.0-beta.5", - "@comet/admin-theme": "^7.0.0-beta.5", - "@comet/blocks-admin": "^7.0.0-beta.5", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0-beta.6.tgz", + "integrity": "sha512-Zvcfwf6V47ju41HHmGq4Tjba99SYBwlQ4s1CPNnP3CyDcH6K+CMaCrRN1CTagE4Bw+l2a/O5uIn/0KSr22+U0w==", + "dependencies": { + "@comet/admin": "^7.0.0-beta.6", + "@comet/admin-date-time": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin-rte": "^7.0.0-beta.6", + "@comet/admin-theme": "^7.0.0-beta.6", + "@comet/blocks-admin": "^7.0.0-beta.6", "@graphql-tools/graphql-file-loader": "^7.5.17", "@graphql-tools/load": "^7.8.14", "@graphql-typed-document-node/core": "^3.1.1", @@ -1456,13 +1456,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", - "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", + "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.5", + "@comet/eslint-plugin": "^7.0.0-beta.6", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -1489,9 +1489,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", - "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", + "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/admin/package.json b/admin/package.json index 9b3db22e8..3855a086c 100644 --- a/admin/package.json +++ b/admin/package.json @@ -26,13 +26,13 @@ }, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.5", - "@comet/admin-date-time": "7.0.0-beta.5", - "@comet/admin-icons": "7.0.0-beta.5", - "@comet/admin-rte": "7.0.0-beta.5", - "@comet/admin-theme": "7.0.0-beta.5", - "@comet/blocks-admin": "7.0.0-beta.5", - "@comet/cms-admin": "7.0.0-beta.5", + "@comet/admin": "7.0.0-beta.6", + "@comet/admin-date-time": "7.0.0-beta.6", + "@comet/admin-icons": "7.0.0-beta.6", + "@comet/admin-rte": "7.0.0-beta.6", + "@comet/admin-theme": "7.0.0-beta.6", + "@comet/blocks-admin": "7.0.0-beta.6", + "@comet/cms-admin": "7.0.0-beta.6", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -61,9 +61,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.5", - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", diff --git a/admin/src/documents/links/EditLink.tsx b/admin/src/documents/links/EditLink.tsx index 20003e0e0..6ad1a4154 100644 --- a/admin/src/documents/links/EditLink.tsx +++ b/admin/src/documents/links/EditLink.tsx @@ -70,7 +70,7 @@ export const EditLink: React.FC = ({ id }) => { return ; } - if (!linkState) return <>; + if (!linkState) return null; return ( <> diff --git a/admin/src/documents/pages/EditPage.tsx b/admin/src/documents/pages/EditPage.tsx index 16c3f48cb..59caafa68 100644 --- a/admin/src/documents/pages/EditPage.tsx +++ b/admin/src/documents/pages/EditPage.tsx @@ -88,7 +88,7 @@ export const EditPage: React.FC = ({ id, category }) => { }); } - if (!pageState) return <>; + if (!pageState) return null; if (loading) { return ; diff --git a/api/package-lock.json b/api/package-lock.json index af64ef785..cf3c5c370 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -6,8 +6,8 @@ "": { "name": "starter-api", "dependencies": { - "@comet/blocks-api": "7.0.0-beta.5", - "@comet/cms-api": "7.0.0-beta.5", + "@comet/blocks-api": "7.0.0-beta.6", + "@comet/cms-api": "7.0.0-beta.6", "@faker-js/faker": "^8.3.1", "@mikro-orm/cli": "^5.0.5", "@mikro-orm/core": "^5.0.5", @@ -43,8 +43,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", @@ -2169,9 +2169,9 @@ } }, "node_modules/@comet/blocks-api": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.5.tgz", - "integrity": "sha512-6D8o+szUmlChj8ZkIBEhUSkdwrsiqfIZE5wl2zge7+x3BRWM1/h626zclzVS/Il/iJzm/XdCUvn4+NEhnp/52Q==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.6.tgz", + "integrity": "sha512-kfy8wIJezinlchJmZb9LSynANeYKEaElF0e+GrIWbp1uguDCpr3U/boEJnLRYhi0wwG+N3kw7sJTtSIqYDKjig==", "dependencies": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -2182,14 +2182,14 @@ } }, "node_modules/@comet/cms-api": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.5.tgz", - "integrity": "sha512-QaURCpX3swwLFPC5E8mfHV3Bqs4AMRYlAror8P6pzhe5uMpIr1Ypvqo/Zko1Jl3bcmvcbQ3Lrt/nEa9kxzgxVg==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.6.tgz", + "integrity": "sha512-aB/fxwZqG3ahAlTZD9ODh5nDrrippOkTRMPSRTT5YnKLyUZSq85eyFaOvoysh4an+Gjs4zmz/4RmwaGMMOjvlQ==", "dependencies": { "@aws-sdk/client-s3": "^3.591.0", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.5", + "@comet/blocks-api": "^7.0.0-beta.6", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -2291,13 +2291,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", - "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", + "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.5", + "@comet/eslint-plugin": "^7.0.0-beta.6", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -2324,9 +2324,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", - "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", + "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", "dev": true, "peerDependencies": { "eslint": "8" @@ -21245,9 +21245,9 @@ "optional": true }, "@comet/blocks-api": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.5.tgz", - "integrity": "sha512-6D8o+szUmlChj8ZkIBEhUSkdwrsiqfIZE5wl2zge7+x3BRWM1/h626zclzVS/Il/iJzm/XdCUvn4+NEhnp/52Q==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.6.tgz", + "integrity": "sha512-kfy8wIJezinlchJmZb9LSynANeYKEaElF0e+GrIWbp1uguDCpr3U/boEJnLRYhi0wwG+N3kw7sJTtSIqYDKjig==", "requires": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -21255,14 +21255,14 @@ } }, "@comet/cms-api": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.5.tgz", - "integrity": "sha512-QaURCpX3swwLFPC5E8mfHV3Bqs4AMRYlAror8P6pzhe5uMpIr1Ypvqo/Zko1Jl3bcmvcbQ3Lrt/nEa9kxzgxVg==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.6.tgz", + "integrity": "sha512-aB/fxwZqG3ahAlTZD9ODh5nDrrippOkTRMPSRTT5YnKLyUZSq85eyFaOvoysh4an+Gjs4zmz/4RmwaGMMOjvlQ==", "requires": { "@aws-sdk/client-s3": "^3.591.0", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.5", + "@comet/blocks-api": "^7.0.0-beta.6", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -21332,13 +21332,13 @@ } }, "@comet/eslint-config": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", - "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", + "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", "dev": true, "requires": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.5", + "@comet/eslint-plugin": "^7.0.0-beta.6", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -21356,9 +21356,9 @@ } }, "@comet/eslint-plugin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", - "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", + "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", "dev": true, "requires": {} }, diff --git a/api/package.json b/api/package.json index 680abbd1a..b69d2287d 100644 --- a/api/package.json +++ b/api/package.json @@ -49,8 +49,8 @@ } }, "dependencies": { - "@comet/blocks-api": "7.0.0-beta.5", - "@comet/cms-api": "7.0.0-beta.5", + "@comet/blocks-api": "7.0.0-beta.6", + "@comet/cms-api": "7.0.0-beta.6", "@faker-js/faker": "^8.3.1", "@mikro-orm/cli": "^5.0.5", "@mikro-orm/core": "^5.0.5", @@ -86,8 +86,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", diff --git a/create-app/package-lock.json b/create-app/package-lock.json index 0f81fc0bd..ff2e09565 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -20,8 +20,8 @@ "create-app": "bin/index.js" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", @@ -158,13 +158,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", - "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", + "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.5", + "@comet/eslint-plugin": "^7.0.0-beta.6", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -191,9 +191,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", - "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", + "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/create-app/package.json b/create-app/package.json index 2f8720f0c..dab8f3e1d 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -39,8 +39,8 @@ "rimraf": "^5.0.1" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", diff --git a/package-lock.json b/package-lock.json index aeedd786a..4c6e80245 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter", "devDependencies": { - "@comet/cli": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", @@ -28,9 +28,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", - "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", + "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", "dev": true, "dependencies": { "commander": "^9.2.0", diff --git a/package.json b/package.json index 07b2d3da9..d74c02946 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "browser:jaeger": "dotenv -- sh -c 'open-cli http://localhost:$JAEGER_UI_PORT'" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", diff --git a/site-configs.d.ts b/site-configs.d.ts index 292b0d319..a335740e4 100644 --- a/site-configs.d.ts +++ b/site-configs.d.ts @@ -6,9 +6,11 @@ export type ContentScope = { }; export interface SiteConfig extends BaseSiteConfig { - contentScope: ContentScope; preloginPassword?: string; + public: { + contentScope: ContentScope; + }; } -export type PrivateSiteConfig = ExtractPrivateSiteConfig; -export type PublicSiteConfig = ExtractPublicSiteConfig; +export type PrivateSiteConfig = ExtractPrivateSiteConfig & { contentScope: ContentScope }; +export type PublicSiteConfig = ExtractPublicSiteConfig & { contentScope: ContentScope }; diff --git a/site-configs.ts b/site-configs.ts index 232719b43..777f28e60 100644 --- a/site-configs.ts +++ b/site-configs.ts @@ -3,7 +3,7 @@ import { SiteConfig } from "./site-configs.d"; // Types for files in site-configs/ type Environment = "local" | "dev" | "test" | "staging" | "prod"; -export type Config = Omit & { +export type Config = Omit & SiteConfig["public"] & { domains: { preliminary?: string; } & { @@ -18,7 +18,7 @@ const getSiteConfigs = async (env: Environment): Promise => { const files = (await fs.readdir(path)).filter((file) => !file.startsWith("_")); const imports = (await Promise.all(files.map((file) => import(`${path}/${file}`)))) as { default: Config }[]; return imports.map((imprt, index) => { - const { domains, ...site } = imprt.default; + const { domains, contentScope, ...site } = imprt.default; const ret: SiteConfig = { ...site, @@ -27,6 +27,9 @@ const getSiteConfigs = async (env: Environment): Promise => { preliminary: env === "prod" ? domains["preliminary"] : undefined, }, preloginEnabled: env === "prod" ? site.preloginEnabled : true, + public: { + contentScope, + } }; return ret; diff --git a/site/package-lock.json b/site/package-lock.json index 6982960c3..81592ba2f 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter-site", "dependencies": { - "@comet/cms-site": "7.0.0-beta.5", + "@comet/cms-site": "7.0.0-beta.6", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -24,9 +24,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.5", - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1049,9 +1049,9 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.5.tgz", - "integrity": "sha512-YeXVPsMnekQ06HarERcMKfZ5xN1hhzTTQNs2kV5zofZc7i5IE3TXYzHx9aSCKA1ss4h6XxCwqK6WqjUu27mPZA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", + "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", "dev": true, "dependencies": { "commander": "^9.2.0", @@ -1065,9 +1065,9 @@ } }, "node_modules/@comet/cms-site": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0-beta.5.tgz", - "integrity": "sha512-ztBfigfVQ1mpT4/NfEBZoMXIEF9vTMMFosu3Y59EHhBqDoS8sX/jq7psQ/GTssaX0h3rPXJ/JHFORCU4ttJjfw==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0-beta.6.tgz", + "integrity": "sha512-Y7uTsfIiUE3Ak5mSBgCB0VfjAiftxNN2dZuWn1jlvoT1QeGHKzmXZDc2EH0Rxc5dra6C+8KEiGF4zmxllRCfFg==", "dependencies": { "jose": "^5.2.4", "rimraf": "^3.0.0", @@ -1089,13 +1089,13 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.5.tgz", - "integrity": "sha512-en4yngFuc/tuR+ZtVAZ0MQYRNM40HXkdVgmfw2o47bC7mPYJNDKFEVzhRm5PE1aD3H0vJMtPpTNyJS9d76+dHA==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", + "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", "dev": true, "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.5", + "@comet/eslint-plugin": "^7.0.0-beta.6", "@next/eslint-plugin-next": "^12.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", @@ -1122,9 +1122,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.5.tgz", - "integrity": "sha512-wt/Z7ATB15QB8PjMyn0tB77BmRPuJjGntaLIo8SpkL9IYlFyX945O1dmxYM0powrLQtNPc26O1yXynMNE6NnuQ==", + "version": "7.0.0-beta.6", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", + "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", "dev": true, "peerDependencies": { "eslint": "8" diff --git a/site/package.json b/site/package.json index b113fe059..660087c7c 100644 --- a/site/package.json +++ b/site/package.json @@ -20,7 +20,7 @@ "intl:compile": "formatjs compile-folder --format simple --ast lang/starter-lang/site lang-compiled/" }, "dependencies": { - "@comet/cms-site": "7.0.0-beta.5", + "@comet/cms-site": "7.0.0-beta.6", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -38,9 +38,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.5", - "@comet/eslint-config": "7.0.0-beta.5", - "@comet/eslint-plugin": "7.0.0-beta.5", + "@comet/cli": "7.0.0-beta.6", + "@comet/eslint-config": "7.0.0-beta.6", + "@comet/eslint-plugin": "7.0.0-beta.6", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", From 1f804c78b423fde90222e992347f6dad6b1ed8cd Mon Sep 17 00:00:00 2001 From: thomasdax98 Date: Mon, 22 Jul 2024 06:41:34 +0000 Subject: [PATCH 013/340] @comet/create-app: Publish v1.26.0 --- create-app/package-lock.json | 4 ++-- create-app/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/create-app/package-lock.json b/create-app/package-lock.json index ff2e09565..127da7539 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comet/create-app", - "version": "1.25.0", + "version": "1.26.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comet/create-app", - "version": "1.25.0", + "version": "1.26.0", "license": "BSD-2-Clause", "dependencies": { "commander": "^11.0.0", diff --git a/create-app/package.json b/create-app/package.json index dab8f3e1d..688831c1b 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@comet/create-app", - "version": "1.25.0", + "version": "1.26.0", "description": "Command-line interface to create a new Comet application", "homepage": "https://github.com/vivid-planet/comet-starter/tree/main/create-app#readme", "bugs": { From a7c963d0b18c2b24ba88e69d0ece8d60f724d5b1 Mon Sep 17 00:00:00 2001 From: Daniel Karnutsch Date: Mon, 22 Jul 2024 08:47:32 +0200 Subject: [PATCH 014/340] API: uniform usage of config.debug (#305) --- api/src/app.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/app.module.ts b/api/src/app.module.ts index 03304dacf..92cc27eb8 100644 --- a/api/src/app.module.ts +++ b/api/src/app.module.ts @@ -52,7 +52,7 @@ export class AppModule { autoSchemaFile: "schema.gql", formatError: (error) => { // Disable GraphQL field suggestions in production - if (process.env.NODE_ENV !== "development") { + if (!config.debug) { if (error instanceof ValidationError) { return new ValidationError("Invalid request."); } @@ -120,7 +120,7 @@ export class AppModule { StatusModule, MenusModule, DependenciesModule, - ...(process.env.NODE_ENV === "production" + ...(!config.debug ? [ AccessLogModule.forRoot({ shouldLogRequest: ({ user }) => { From d4f2acfc024a04385a926c43e0968f8ba79fcb0b Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:13:51 +0200 Subject: [PATCH 015/340] Remove heading and margins from `KeyFactsBlock` (#308) We decided to remove the heading block and the margins top/bottom from the `KeyFactsBlock`. We try the "do it yourself" way and give to content creators freedom wich spacing they want to use. --- .../documents/pages/blocks/KeyFactsBlock.tsx | 33 +---- .../pages/blocks/KeyFactsItemBlock.tsx | 3 +- api/block-meta.json | 119 +++++++----------- .../documents/pages/blocks/key-facts.block.ts | 37 +----- .../documents/pages/blocks/KeyFactsBlock.tsx | 10 +- 5 files changed, 57 insertions(+), 145 deletions(-) diff --git a/admin/src/documents/pages/blocks/KeyFactsBlock.tsx b/admin/src/documents/pages/blocks/KeyFactsBlock.tsx index 10068a1c4..5b159fb18 100644 --- a/admin/src/documents/pages/blocks/KeyFactsBlock.tsx +++ b/admin/src/documents/pages/blocks/KeyFactsBlock.tsx @@ -1,32 +1,11 @@ -import { BlockCategory, createCompositeBlock, createListBlock } from "@comet/blocks-admin"; -import { HeadingBlock } from "@src/common/blocks/HeadingBlock"; +import { createListBlock } from "@comet/blocks-admin"; import { KeyFactsItemBlock } from "@src/documents/pages/blocks/KeyFactsItemBlock"; import { FormattedMessage } from "react-intl"; -const KeyFactsItemsBlock = createListBlock({ - name: "KeyFactsItems", - displayName: , +export const KeyFactsBlock = createListBlock({ + name: "KeyFacts", + displayName: , block: KeyFactsItemBlock, - itemName: , - itemsName: , + itemName: , + itemsName: , }); - -export const KeyFactsBlock = createCompositeBlock( - { - name: "KeyFacts", - displayName: , - blocks: { - heading: { - block: HeadingBlock, - }, - items: { - block: KeyFactsItemsBlock, - title: , - }, - }, - }, - (block) => { - block.category = BlockCategory.TextAndContent; - return block; - }, -); diff --git a/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx b/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx index 97dc92485..e48a19634 100644 --- a/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx +++ b/admin/src/documents/pages/blocks/KeyFactsItemBlock.tsx @@ -1,4 +1,4 @@ -import { createCompositeBlock, createCompositeBlockTextField } from "@comet/blocks-admin"; +import { BlockCategory, createCompositeBlock, createCompositeBlockTextField } from "@comet/blocks-admin"; import { createRichTextBlock, SvgImageBlock } from "@comet/cms-admin"; import { LinkBlock } from "@src/common/blocks/LinkBlock"; import { FormattedMessage } from "react-intl"; @@ -38,6 +38,7 @@ export const KeyFactsItemBlock = createCompositeBlock( }, }, (block) => { + block.category = BlockCategory.TextAndContent; block.previewContent = (state) => [{ type: "text", content: state.fact }]; return block; }, diff --git a/api/block-meta.json b/api/block-meta.json index ebb62f760..34f1cf52d 100644 --- a/api/block-meta.json +++ b/api/block-meta.json @@ -844,29 +844,55 @@ "name": "KeyFacts", "fields": [ { - "name": "heading", - "kind": "Block", - "block": "Heading", - "nullable": false - }, - { - "name": "items", - "kind": "Block", - "block": "KeyFactsItems", + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "KeyFactsItem", + "nullable": false + } + ] + }, "nullable": false } ], "inputFields": [ { - "name": "heading", - "kind": "Block", - "block": "Heading", - "nullable": false - }, - { - "name": "items", - "kind": "Block", - "block": "KeyFactsItems", + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "KeyFactsItem", + "nullable": false + } + ] + }, "nullable": false } ] @@ -922,63 +948,6 @@ } ] }, - { - "name": "KeyFactsItems", - "fields": [ - { - "name": "blocks", - "kind": "NestedObjectList", - "object": { - "fields": [ - { - "name": "key", - "kind": "String", - "nullable": false - }, - { - "name": "visible", - "kind": "Boolean", - "nullable": false - }, - { - "name": "props", - "kind": "Block", - "block": "KeyFactsItem", - "nullable": false - } - ] - }, - "nullable": false - } - ], - "inputFields": [ - { - "name": "blocks", - "kind": "NestedObjectList", - "object": { - "fields": [ - { - "name": "key", - "kind": "String", - "nullable": false - }, - { - "name": "visible", - "kind": "Boolean", - "nullable": false - }, - { - "name": "props", - "kind": "Block", - "block": "KeyFactsItem", - "nullable": false - } - ] - }, - "nullable": false - } - ] - }, { "name": "Link", "fields": [ diff --git a/api/src/documents/pages/blocks/key-facts.block.ts b/api/src/documents/pages/blocks/key-facts.block.ts index 3e009c1dd..156ea4546 100644 --- a/api/src/documents/pages/blocks/key-facts.block.ts +++ b/api/src/documents/pages/blocks/key-facts.block.ts @@ -1,37 +1,4 @@ -import { - BlockData, - BlockDataInterface, - BlockInput, - ChildBlock, - ChildBlockInput, - createBlock, - createListBlock, - ExtractBlockInput, - inputToData, -} from "@comet/blocks-api"; -import { HeadingBlock } from "@src/common/blocks/heading.block"; +import { createListBlock } from "@comet/blocks-api"; import { KeyFactsItemBlock } from "@src/documents/pages/blocks/key-facts-item.block"; -const KeyFactsItemsBlock = createListBlock({ block: KeyFactsItemBlock }, "KeyFactsItems"); - -class KeyFactsBlockData extends BlockData { - @ChildBlock(HeadingBlock) - heading: BlockDataInterface; - - @ChildBlock(KeyFactsItemsBlock) - items: BlockDataInterface; -} - -class KeyFactsBlockInput extends BlockInput { - @ChildBlockInput(HeadingBlock) - heading: ExtractBlockInput; - - @ChildBlockInput(KeyFactsItemsBlock) - items: ExtractBlockInput; - - transformToBlockData(): KeyFactsBlockData { - return inputToData(KeyFactsBlockData, this); - } -} - -export const KeyFactsBlock = createBlock(KeyFactsBlockData, KeyFactsBlockInput, "KeyFacts"); +export const KeyFactsBlock = createListBlock({ block: KeyFactsItemBlock }, "KeyFacts"); diff --git a/site/src/documents/pages/blocks/KeyFactsBlock.tsx b/site/src/documents/pages/blocks/KeyFactsBlock.tsx index a9a91000f..6735f5fc4 100644 --- a/site/src/documents/pages/blocks/KeyFactsBlock.tsx +++ b/site/src/documents/pages/blocks/KeyFactsBlock.tsx @@ -1,18 +1,16 @@ import { ListBlock, PropsWithData, withPreview } from "@comet/cms-site"; import { KeyFactsBlockData } from "@src/blocks.generated"; -import { HeadingBlock } from "@src/common/blocks/HeadingBlock"; import { PageLayout } from "@src/layout/PageLayout"; import styled, { css } from "styled-components"; import { KeyFactItemBlock } from "./KeyFactItemBlock"; export const KeyFactsBlock = withPreview( - ({ data: { heading, items } }: PropsWithData) => ( + ({ data }: PropsWithData) => ( - - - } /> + + } /> @@ -22,11 +20,9 @@ export const KeyFactsBlock = withPreview( const PageLayoutContent = styled.div` grid-column: 3 / -3; - margin: ${({ theme }) => theme.spacing.D300} 0; `; const ItemWrapper = styled.div<{ $listItemCount: number }>` - margin-top: ${({ theme }) => theme.spacing.D200}; display: grid; gap: ${({ theme }) => theme.spacing.D100}; From c8078358c0cde7485d81bb9c9228ab35cce2f9fe Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:14:05 +0200 Subject: [PATCH 016/340] Disable last bottom spacing for `RichTextBlock` in page content (#309) We decided to remove the margins top/bottom from the Page Content Blocks. We try the "do it yourself" way and give to content creators freedom wich spacing they want to use. --- site/src/documents/pages/blocks/PageContentBlock.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/src/documents/pages/blocks/PageContentBlock.tsx b/site/src/documents/pages/blocks/PageContentBlock.tsx index 361de9bba..aa52a48ce 100644 --- a/site/src/documents/pages/blocks/PageContentBlock.tsx +++ b/site/src/documents/pages/blocks/PageContentBlock.tsx @@ -15,7 +15,7 @@ const supportedBlocks: SupportedBlocks = { accordion: (props) => , anchor: (props) => , space: (props) => , - richtext: (props) => , + richtext: (props) => , heading: (props) => , columns: (props) => , callToActionList: (props) => , From cca237ed25e8e099828f96f853d1648b814a7243 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:47:38 +0200 Subject: [PATCH 017/340] Remove legacy behavior for link blocks (#304) Since Next 13 the `Link` component no longer requires a child `` tag by default. This new behavior is now used by our `InternalLinkBlock`, which uses `Link` internally. To ensure that all other link blocks (e.g., `ExternalLinkBlock`) can be styled in the application, we now render an `` tag for all those blocks. This change adds the `className` prop to the `LinkBlock` to allow styling the block. All link block usages have been adapted to directly style the block. --- site/src/common/blocks/CallToActionBlock.tsx | 8 +- site/src/common/blocks/InternalLinkBlock.tsx | 12 ++- site/src/common/blocks/LinkBlock.tsx | 25 +++--- site/src/common/blocks/RichTextBlock.tsx | 8 +- site/src/common/blocks/TextLinkBlock.tsx | 6 +- site/src/common/components/Button.tsx | 82 ++++++-------------- site/src/layout/header/Header.tsx | 14 +++- site/src/layout/header/PageLink.tsx | 24 ++++-- 8 files changed, 84 insertions(+), 95 deletions(-) diff --git a/site/src/common/blocks/CallToActionBlock.tsx b/site/src/common/blocks/CallToActionBlock.tsx index 7f0af8175..429cdbc48 100644 --- a/site/src/common/blocks/CallToActionBlock.tsx +++ b/site/src/common/blocks/CallToActionBlock.tsx @@ -2,9 +2,9 @@ import { PropsWithData, withPreview } from "@comet/cms-site"; import { CallToActionBlockData } from "@src/blocks.generated"; import { LinkBlock } from "@src/common/blocks/LinkBlock"; -import { HiddenIfInvalidLink } from "@src/common/helpers/HiddenIfInvalidLink"; import { Button, ButtonVariant } from "../components/Button"; +import { HiddenIfInvalidLink } from "../helpers/HiddenIfInvalidLink"; const buttonVariantMap: Record = { Contained: "contained", @@ -15,9 +15,9 @@ const buttonVariantMap: Record export const CallToActionBlock = withPreview( ({ data: { textLink, variant } }: PropsWithData) => ( - - - + ), { label: "Call To Action" }, diff --git a/site/src/common/blocks/InternalLinkBlock.tsx b/site/src/common/blocks/InternalLinkBlock.tsx index d983263b9..a0eb729a1 100644 --- a/site/src/common/blocks/InternalLinkBlock.tsx +++ b/site/src/common/blocks/InternalLinkBlock.tsx @@ -7,11 +7,17 @@ import * as React from "react"; interface InternalLinkBlockProps extends PropsWithData { children: React.ReactNode; title?: string; + className?: string; } -export function InternalLinkBlock({ data: { targetPage, targetPageAnchor }, children, title }: InternalLinkBlockProps): React.ReactElement { +export function InternalLinkBlock({ + data: { targetPage, targetPageAnchor }, + children, + title, + className, +}: InternalLinkBlockProps): React.ReactElement { if (!targetPage) { - return <>{children}; + return {children}; } let href = targetPageAnchor !== undefined ? `${targetPage.path}#${targetPageAnchor}` : targetPage.path; @@ -23,7 +29,7 @@ export function InternalLinkBlock({ data: { targetPage, targetPageAnchor }, chil } return ( - + {children} ); diff --git a/site/src/common/blocks/LinkBlock.tsx b/site/src/common/blocks/LinkBlock.tsx index a68b6b885..2e29832b7 100644 --- a/site/src/common/blocks/LinkBlock.tsx +++ b/site/src/common/blocks/LinkBlock.tsx @@ -15,28 +15,28 @@ import { ReactNode } from "react"; import { InternalLinkBlock } from "./InternalLinkBlock"; const supportedBlocks: SupportedBlocks = { - internal: ({ children, title, ...props }) => ( - + internal: ({ children, title, className, ...props }) => ( + {children} ), - external: ({ children, title, ...props }) => ( - + external: ({ children, title, className, ...props }) => ( + {children} ), - damFileDownload: ({ children, title, ...props }) => ( - + damFileDownload: ({ children, title, className, ...props }) => ( + {children} ), - email: ({ children, title, ...props }) => ( - + email: ({ children, title, className, ...props }) => ( + {children} ), - phone: ({ children, title, ...props }) => ( - + phone: ({ children, title, className, ...props }) => ( + {children} ), @@ -44,12 +44,13 @@ const supportedBlocks: SupportedBlocks = { interface LinkBlockProps extends PropsWithData { children: ReactNode; + className?: string; } export const LinkBlock = withPreview( - ({ data, children }: LinkBlockProps) => { + ({ data, children, className }: LinkBlockProps) => { return ( - + {children} ); diff --git a/site/src/common/blocks/RichTextBlock.tsx b/site/src/common/blocks/RichTextBlock.tsx index 4ea43a2e8..c1bc19d7b 100644 --- a/site/src/common/blocks/RichTextBlock.tsx +++ b/site/src/common/blocks/RichTextBlock.tsx @@ -111,9 +111,9 @@ export const defaultRichTextRenderers: Renderers = { // key is the entity key value from raw LINK: (children, data: LinkBlockData, { key }) => isValidLink(data) ? ( - - {children} - + + {children} + ) : ( {children} ), @@ -173,7 +173,7 @@ const OrderedListItem = styled(Text)<{ $depth: number }>` list-style-type: ${({ $depth }) => ($depth % 3 === 1 ? "lower-alpha" : $depth % 3 === 2 ? "lower-roman" : "decimal")}; `; -const InlineLink = styled.a` +const InlineLink = styled(LinkBlock)` color: ${({ theme }) => theme.palette.primary.main}; transition: color 0.3s ease-in-out; diff --git a/site/src/common/blocks/TextLinkBlock.tsx b/site/src/common/blocks/TextLinkBlock.tsx index 0bbddba3e..24d2f6f83 100644 --- a/site/src/common/blocks/TextLinkBlock.tsx +++ b/site/src/common/blocks/TextLinkBlock.tsx @@ -6,11 +6,7 @@ import { LinkBlock } from "./LinkBlock"; export const TextLinkBlock = withPreview( ({ data: { link, text } }: PropsWithData) => { - return ( - - {text} - - ); + return {text}; }, { label: "Text link" }, ); diff --git a/site/src/common/components/Button.tsx b/site/src/common/components/Button.tsx index 6172999c0..073b4a3fa 100644 --- a/site/src/common/components/Button.tsx +++ b/site/src/common/components/Button.tsx @@ -1,26 +1,33 @@ -import { forwardRef, HTMLAttributes, RefObject } from "react"; import styled, { css } from "styled-components"; export type ButtonVariant = "contained" | "outlined" | "text"; -type ButtonProps = { - variant?: ButtonVariant; - disabled?: boolean; -} & (HTMLAttributes | (HTMLAttributes & Pick)); +export const Button = styled.button<{ variant?: ButtonVariant }>` + display: inline-flex; + padding: ${({ theme }) => `${theme.spacing.S400} ${theme.spacing.S500}`}; + border-radius: 4px; + cursor: pointer; + justify-content: center; + align-items: center; + transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out; + + text-align: center; + text-decoration: none; + font-family: ${({ theme }) => theme.fontFamily}; + font-size: 16px; + font-weight: 700; + line-height: 110%; -export const Button = forwardRef( - ({ variant = "contained", disabled = false, children, ...htmlAttributes }, ref) => { - return "href" in htmlAttributes ? ( - } $variant={variant} $disabled={disabled} {...htmlAttributes}> - {children} - - ) : ( - } $variant={variant} disabled={disabled} {...htmlAttributes}> - {children} - - ); - }, -); + ${({ variant = "contained" }) => + css` + ${buttonVariantStyle[variant]} + + &:disabled { + pointer-events: none; + ${disabledButtonVariantStyle[variant]}; + } + `}; +`; const buttonVariantStyle: Record> = { contained: css` @@ -78,42 +85,3 @@ const disabledButtonVariantStyle: Record> color: ${({ theme }) => theme.palette.grey["300"]}; `, }; - -const commonButtonStyle = css<{ $variant: ButtonVariant }>` - display: inline-flex; - padding: ${({ theme }) => `${theme.spacing.S400} ${theme.spacing.S500}`}; - border-radius: 4px; - cursor: pointer; - justify-content: center; - align-items: center; - transition: background-color 0.2s ease-out, color 0.2s ease-out, border-color 0.2s ease-out; - - text-align: center; - text-decoration: none; - font-family: ${({ theme }) => theme.fontFamily}; - font-size: 16px; - font-weight: 700; - line-height: 110%; - - ${({ $variant }) => buttonVariantStyle[$variant]}; -`; - -const StyledAnchor = styled.a<{ $variant: ButtonVariant; $disabled: boolean }>` - ${commonButtonStyle}; - - ${({ $variant, $disabled }) => - $disabled && - css` - pointer-events: none; - ${disabledButtonVariantStyle[$variant]}; - `} -`; - -const StyledButton = styled.button<{ $variant: ButtonVariant }>` - ${commonButtonStyle}; - - &:disabled { - pointer-events: none; - ${({ $variant }) => disabledButtonVariantStyle[$variant]}; - } -`; diff --git a/site/src/layout/header/Header.tsx b/site/src/layout/header/Header.tsx index f2e97bd2b..b0e9aacbd 100644 --- a/site/src/layout/header/Header.tsx +++ b/site/src/layout/header/Header.tsx @@ -18,12 +18,16 @@ function Header({ header }: Props): JSX.Element { {header.map((node) => ( - {(active) => {node.name}} + + {node.name} + {node.childNodes.length > 0 && ( {node.childNodes.map((node) => (
  • - {(active) => {node.name}} + + {node.name} +
  • ))}
    @@ -68,13 +72,17 @@ const TopLevelLinkContainer = styled.li` } `; -const Link = styled.a<{ $active: boolean }>` +const Link = styled(PageLink)` text-decoration: none; padding: 5px 10px; &:hover { text-decoration: underline; } + + &.active { + color: ${({ theme }) => theme.palette.primary.main}; + } `; export { Header }; diff --git a/site/src/layout/header/PageLink.tsx b/site/src/layout/header/PageLink.tsx index 3fcb28e0c..eb8fe5693 100644 --- a/site/src/layout/header/PageLink.tsx +++ b/site/src/layout/header/PageLink.tsx @@ -3,18 +3,26 @@ import { LinkBlock } from "@src/common/blocks/LinkBlock"; import { HiddenIfInvalidLink } from "@src/common/helpers/HiddenIfInvalidLink"; import Link from "next/link"; import { usePathname } from "next/navigation"; -import * as React from "react"; +import { ReactNode } from "react"; import { GQLPageLinkFragment } from "./PageLink.fragment.generated"; interface Props { page: GQLPageLinkFragment; - children: ((active: boolean) => React.ReactNode) | React.ReactNode; + children: ReactNode; + className?: string; + activeClassName?: string; } -function PageLink({ page, children }: Props): JSX.Element | null { +function PageLink({ page, children, className: passedClassName, activeClassName }: Props): JSX.Element | null { const pathname = usePathname(); - const active = pathname === page.path; + const active = pathname && (pathname.substring(3) || "/") === page.path; // Remove language prefix + + let className = passedClassName; + + if (active) { + className = className ? `${className} ${activeClassName}` : activeClassName; + } if (page.documentType === "Link") { if (page.document === null || page.document.__typename !== "Link") { @@ -23,13 +31,15 @@ function PageLink({ page, children }: Props): JSX.Element | null { return ( - {typeof children === "function" ? children(active) : children} + + {children} + ); } else if (page.documentType === "Page") { return ( - - {typeof children === "function" ? children(active) : children} + + {children} ); } else { From 0dbc698c99c5df1097f030cff3efdf3cceadc768 Mon Sep 17 00:00:00 2001 From: SebiVPS <42858722+SebiVPS@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:28:30 +0200 Subject: [PATCH 018/340] Add `TeaserBlock` (#291) --- .../pages/blocks/PageContentBlock.tsx | 2 + .../documents/pages/blocks/TeaserBlock.tsx | 11 ++ .../pages/blocks/TeaserItemBlock.tsx | 45 +++++++ api/block-meta.json | 112 ++++++++++++++++++ .../pages/blocks/page-content.block.ts | 2 + .../pages/blocks/teaser-item.block.ts | 50 ++++++++ .../documents/pages/blocks/teaser.block.ts | 5 + site/public/icons/arrow-right.svg | 3 + .../pages/blocks/PageContentBlock.tsx | 2 + .../documents/pages/blocks/TeaserBlock.tsx | 35 ++++++ .../pages/blocks/TeaserItemBlock.tsx | 99 ++++++++++++++++ 11 files changed, 366 insertions(+) create mode 100644 admin/src/documents/pages/blocks/TeaserBlock.tsx create mode 100644 admin/src/documents/pages/blocks/TeaserItemBlock.tsx create mode 100644 api/src/documents/pages/blocks/teaser-item.block.ts create mode 100644 api/src/documents/pages/blocks/teaser.block.ts create mode 100644 site/public/icons/arrow-right.svg create mode 100644 site/src/documents/pages/blocks/TeaserBlock.tsx create mode 100644 site/src/documents/pages/blocks/TeaserItemBlock.tsx diff --git a/admin/src/documents/pages/blocks/PageContentBlock.tsx b/admin/src/documents/pages/blocks/PageContentBlock.tsx index cb48fcb17..6cd046e7a 100644 --- a/admin/src/documents/pages/blocks/PageContentBlock.tsx +++ b/admin/src/documents/pages/blocks/PageContentBlock.tsx @@ -8,6 +8,7 @@ import { SpaceBlock } from "@src/common/blocks/SpaceBlock"; import { StandaloneMediaBlock } from "@src/common/blocks/StandaloneMediaBlock"; import { ColumnsBlock } from "@src/documents/pages/blocks/ColumnsBlock"; import { KeyFactsBlock } from "@src/documents/pages/blocks/KeyFactsBlock"; +import { TeaserBlock } from "@src/documents/pages/blocks/TeaserBlock"; export const PageContentBlock = createBlocksBlock({ name: "PageContent", @@ -15,6 +16,7 @@ export const PageContentBlock = createBlocksBlock({ accordion: AccordionBlock, anchor: AnchorBlock, space: SpaceBlock, + teaser: TeaserBlock, richtext: RichTextBlock, heading: HeadingBlock, columns: ColumnsBlock, diff --git a/admin/src/documents/pages/blocks/TeaserBlock.tsx b/admin/src/documents/pages/blocks/TeaserBlock.tsx new file mode 100644 index 000000000..77a4e662f --- /dev/null +++ b/admin/src/documents/pages/blocks/TeaserBlock.tsx @@ -0,0 +1,11 @@ +import { createListBlock } from "@comet/blocks-admin"; +import { TeaserItemBlock } from "@src/documents/pages/blocks/TeaserItemBlock"; +import { FormattedMessage } from "react-intl"; + +export const TeaserBlock = createListBlock({ + name: "Teaser", + displayName: , + block: TeaserItemBlock, + itemName: , + itemsName: , +}); diff --git a/admin/src/documents/pages/blocks/TeaserItemBlock.tsx b/admin/src/documents/pages/blocks/TeaserItemBlock.tsx new file mode 100644 index 000000000..69af6e921 --- /dev/null +++ b/admin/src/documents/pages/blocks/TeaserItemBlock.tsx @@ -0,0 +1,45 @@ +import { BlockCategory, createCompositeBlock, createCompositeBlockTextField } from "@comet/blocks-admin"; +import { createRichTextBlock } from "@comet/cms-admin"; +import { LinkBlock } from "@src/common/blocks/LinkBlock"; +import { MediaBlock } from "@src/common/blocks/MediaBlock"; +import { TextLinkBlock } from "@src/common/blocks/TextLinkBlock"; +import { FormattedMessage } from "react-intl"; + +const DescriptionRichTextBlock = createRichTextBlock({ + link: LinkBlock, + rte: { + maxBlocks: 1, + supports: ["bold", "italic", "sub", "sup", "non-breaking-space", "soft-hyphen"], + }, + minHeight: 0, +}); + +export const TeaserItemBlock = createCompositeBlock( + { + name: "TeaserItem", + displayName: , + blocks: { + media: { + block: MediaBlock, + title: , + }, + title: { + block: createCompositeBlockTextField({ + fieldProps: { fullWidth: true, label: }, + }), + }, + description: { + block: DescriptionRichTextBlock, + title: , + }, + link: { + block: TextLinkBlock, + }, + }, + }, + (block) => { + block.category = BlockCategory.Teaser; + block.previewContent = (state) => [{ type: "text", content: state.title }]; + return block; + }, +); diff --git a/api/block-meta.json b/api/block-meta.json index 34f1cf52d..4255a3ba2 100644 --- a/api/block-meta.json +++ b/api/block-meta.json @@ -1151,6 +1151,7 @@ "accordion": "Accordion", "anchor": "Anchor", "space": "Space", + "teaser": "Teaser", "richtext": "RichText", "heading": "Heading", "columns": "Columns", @@ -1193,6 +1194,7 @@ "accordion": "Accordion", "anchor": "Anchor", "space": "Space", + "teaser": "Teaser", "richtext": "RichText", "heading": "Heading", "columns": "Columns", @@ -1906,6 +1908,116 @@ } ] }, + { + "name": "Teaser", + "fields": [ + { + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "TeaserItem", + "nullable": false + } + ] + }, + "nullable": false + } + ], + "inputFields": [ + { + "name": "blocks", + "kind": "NestedObjectList", + "object": { + "fields": [ + { + "name": "key", + "kind": "String", + "nullable": false + }, + { + "name": "visible", + "kind": "Boolean", + "nullable": false + }, + { + "name": "props", + "kind": "Block", + "block": "TeaserItem", + "nullable": false + } + ] + }, + "nullable": false + } + ] + }, + { + "name": "TeaserItem", + "fields": [ + { + "name": "media", + "kind": "Block", + "block": "Media", + "nullable": false + }, + { + "name": "title", + "kind": "String", + "nullable": false + }, + { + "name": "description", + "kind": "Block", + "block": "RichText", + "nullable": false + }, + { + "name": "link", + "kind": "Block", + "block": "TextLink", + "nullable": false + } + ], + "inputFields": [ + { + "name": "media", + "kind": "Block", + "block": "Media", + "nullable": false + }, + { + "name": "title", + "kind": "String", + "nullable": false + }, + { + "name": "description", + "kind": "Block", + "block": "RichText", + "nullable": false + }, + { + "name": "link", + "kind": "Block", + "block": "TextLink", + "nullable": false + } + ] + }, { "name": "TextLink", "fields": [ diff --git a/api/src/documents/pages/blocks/page-content.block.ts b/api/src/documents/pages/blocks/page-content.block.ts index b78f4dc4f..ac2b155f7 100644 --- a/api/src/documents/pages/blocks/page-content.block.ts +++ b/api/src/documents/pages/blocks/page-content.block.ts @@ -8,6 +8,7 @@ import { SpaceBlock } from "@src/common/blocks/space.block"; import { StandaloneMediaBlock } from "@src/common/blocks/standalone-media.block"; import { ColumnsBlock } from "@src/documents/pages/blocks/columns.block"; import { KeyFactsBlock } from "@src/documents/pages/blocks/key-facts.block"; +import { TeaserBlock } from "@src/documents/pages/blocks/teaser.block"; export const PageContentBlock = createBlocksBlock( { @@ -15,6 +16,7 @@ export const PageContentBlock = createBlocksBlock( accordion: AccordionBlock, anchor: AnchorBlock, space: SpaceBlock, + teaser: TeaserBlock, richtext: RichTextBlock, heading: HeadingBlock, columns: ColumnsBlock, diff --git a/api/src/documents/pages/blocks/teaser-item.block.ts b/api/src/documents/pages/blocks/teaser-item.block.ts new file mode 100644 index 000000000..c922fa789 --- /dev/null +++ b/api/src/documents/pages/blocks/teaser-item.block.ts @@ -0,0 +1,50 @@ +import { + BlockData, + BlockDataInterface, + BlockField, + BlockInput, + ChildBlock, + ChildBlockInput, + createBlock, + ExtractBlockInput, + inputToData, +} from "@comet/blocks-api"; +import { MediaBlock } from "@src/common/blocks/media.block"; +import { RichTextBlock } from "@src/common/blocks/rich-text.block"; +import { TextLinkBlock } from "@src/common/blocks/text-link.block"; +import { IsString } from "class-validator"; + +class TeaserItemBlockData extends BlockData { + @ChildBlock(MediaBlock) + media: BlockDataInterface; + + @BlockField() + title: string; + + @ChildBlock(RichTextBlock) + description: BlockDataInterface; + + @ChildBlock(TextLinkBlock) + link: BlockDataInterface; +} + +class TeaserItemBlockInput extends BlockInput { + @ChildBlockInput(MediaBlock) + media: ExtractBlockInput; + + @BlockField() + @IsString() + title: string; + + @ChildBlockInput(RichTextBlock) + description: ExtractBlockInput; + + @ChildBlockInput(TextLinkBlock) + link: ExtractBlockInput; + + transformToBlockData(): TeaserItemBlockData { + return inputToData(TeaserItemBlockData, this); + } +} + +export const TeaserItemBlock = createBlock(TeaserItemBlockData, TeaserItemBlockInput, "TeaserItem"); diff --git a/api/src/documents/pages/blocks/teaser.block.ts b/api/src/documents/pages/blocks/teaser.block.ts new file mode 100644 index 000000000..1679cd605 --- /dev/null +++ b/api/src/documents/pages/blocks/teaser.block.ts @@ -0,0 +1,5 @@ +import { createListBlock } from "@comet/blocks-api"; + +import { TeaserItemBlock } from "./teaser-item.block"; + +export const TeaserBlock = createListBlock({ block: TeaserItemBlock }, "Teaser"); diff --git a/site/public/icons/arrow-right.svg b/site/public/icons/arrow-right.svg new file mode 100644 index 000000000..7ada92e73 --- /dev/null +++ b/site/public/icons/arrow-right.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/site/src/documents/pages/blocks/PageContentBlock.tsx b/site/src/documents/pages/blocks/PageContentBlock.tsx index aa52a48ce..f12e5f49c 100644 --- a/site/src/documents/pages/blocks/PageContentBlock.tsx +++ b/site/src/documents/pages/blocks/PageContentBlock.tsx @@ -10,11 +10,13 @@ import { SpaceBlock } from "@src/common/blocks/SpaceBlock"; import { StandaloneMediaBlock } from "@src/common/blocks/StandaloneMediaBlock"; import { ColumnsBlock } from "@src/documents/pages/blocks/ColumnsBlock"; import { KeyFactsBlock } from "@src/documents/pages/blocks/KeyFactsBlock"; +import { TeaserBlock } from "@src/documents/pages/blocks/TeaserBlock"; const supportedBlocks: SupportedBlocks = { accordion: (props) => , anchor: (props) => , space: (props) => , + teaser: (props) => , richtext: (props) => , heading: (props) => , columns: (props) => , diff --git a/site/src/documents/pages/blocks/TeaserBlock.tsx b/site/src/documents/pages/blocks/TeaserBlock.tsx new file mode 100644 index 000000000..8824aa1a9 --- /dev/null +++ b/site/src/documents/pages/blocks/TeaserBlock.tsx @@ -0,0 +1,35 @@ +import { ListBlock, PropsWithData, withPreview } from "@comet/cms-site"; +import { TeaserBlockData } from "@src/blocks.generated"; +import { PageLayout } from "@src/layout/PageLayout"; +import styled, { css } from "styled-components"; + +import { TeaserItemBlock } from "./TeaserItemBlock"; + +export const TeaserBlock = withPreview( + ({ data }: PropsWithData) => ( + + + + } /> + + + + ), + { label: "Teaser" }, +); + +const PageLayoutContent = styled.div` + grid-column: 3 / -3; +`; + +const ItemWrapper = styled.div` + display: grid; + gap: ${({ theme }) => theme.spacing.D100}; + + ${({ theme }) => + css` + ${theme.breakpoints.sm.mediaQuery} { + grid-template-columns: repeat(4, 1fr); + } + `} +`; diff --git a/site/src/documents/pages/blocks/TeaserItemBlock.tsx b/site/src/documents/pages/blocks/TeaserItemBlock.tsx new file mode 100644 index 000000000..283d47364 --- /dev/null +++ b/site/src/documents/pages/blocks/TeaserItemBlock.tsx @@ -0,0 +1,99 @@ +import { PropsWithData, withPreview } from "@comet/cms-site"; +import { TeaserItemBlockData } from "@src/blocks.generated"; +import { LinkBlock } from "@src/common/blocks/LinkBlock"; +import { MediaBlock } from "@src/common/blocks/MediaBlock"; +import { defaultRichTextRenderers, RichTextBlock } from "@src/common/blocks/RichTextBlock"; +import { Typography } from "@src/common/components/Typography"; +import { SvgUse } from "@src/common/helpers/SvgUse"; +import { Renderers } from "redraft"; +import styled from "styled-components"; + +const descriptionRenderers: Renderers = { + inline: defaultRichTextRenderers.inline, +}; + +export const TeaserItemBlock = withPreview( + ({ data: { media, title, description, link } }: PropsWithData) => ( + + + + + + + + + + {title} + + + + + + {link.text} + + + + + ), + { label: "Teaser Item" }, +); + +const ItemContent = styled.a` + text-decoration: none; + cursor: pointer; + display: flex; + flex: 1; + flex-direction: row; + gap: ${({ theme }) => theme.spacing.S300}; + + ${({ theme }) => theme.breakpoints.sm.mediaQuery} { + flex: unset; + gap: ${({ theme }) => theme.spacing.S400}; + flex-direction: column; + } +`; + +const MediaMobile = styled.div` + flex: 1; + + ${({ theme }) => theme.breakpoints.xs.mediaQuery} { + display: none; + } +`; + +const MediaDesktop = styled.div` + flex: 1; + display: none; + + ${({ theme }) => theme.breakpoints.xs.mediaQuery} { + display: block; + } +`; + +const ContentContainer = styled.div` + flex: 2; +`; + +const TitleTypography = styled(Typography)` + margin-bottom: ${({ theme }) => theme.spacing.S100}; + color: ${({ theme }) => theme.palette.text.primary}; +`; + +const TextLinkContainer = styled.div` + margin-top: ${({ theme }) => theme.spacing.S300}; + display: flex; + align-items: center; + gap: ${({ theme }) => theme.spacing.S200}; + color: ${({ theme }) => theme.palette.primary.main}; + transition: color 0.3s ease-in-out; + + &:hover { + color: ${({ theme }) => theme.palette.primary.dark}; + } +`; + +const LinkText = styled.span` + font-family: ${({ theme }) => theme.fontFamily}; + font-size: 16px; + font-weight: 700; +`; From 8e8e918a703d7e8d3133177c260b264e6da195b7 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:17:37 +0200 Subject: [PATCH 019/340] Prevent schema.gql write in production (#295) Some of our customers use read-only file systems in deployed environments. We therefore can't write the schema.gql file. Disabling it for production shouldn't be a problem, since our only use case (for now) is generating the types for Site and Admin. --- api/src/app.module.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/src/app.module.ts b/api/src/app.module.ts index 92cc27eb8..1d643aa61 100644 --- a/api/src/app.module.ts +++ b/api/src/app.module.ts @@ -49,7 +49,8 @@ export class AppModule { useFactory: (moduleRef: ModuleRef) => ({ debug: config.debug, playground: config.debug, - autoSchemaFile: "schema.gql", + // Prevents writing the schema.gql file in production. Necessary for environments with a read-only file system + autoSchemaFile: process.env.NODE_ENV === "development" ? "schema.gql" : true, formatError: (error) => { // Disable GraphQL field suggestions in production if (!config.debug) { From 75fe139947a9061acb89eefa15c40244e1325bc0 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Mon, 29 Jul 2024 08:18:35 +0200 Subject: [PATCH 020/340] Remove obsolete version field from docker-compose.yml (#313) --- docker-compose.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2dc55d057..ee1b7d1df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: "3.5" services: postgres: image: bitnami/postgresql:12 From ec9d954c9d70ecb9ac8bd3f8d03b3f143ef81914 Mon Sep 17 00:00:00 2001 From: chernylu <32737738+chernylu@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:19:14 +0200 Subject: [PATCH 021/340] Fix Jaeger tracing (#311) Due to a recent change in the OpenTelemetry Collector, Jaeger didn't accept OpenTelemetry data anymore. Until this change is reverted upstream, we explicitly pass the the host IP to Jaeger as a workaround. See https://github.com/jaegertracing/jaeger/issues/5737 for more information. --- docker-compose.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docker-compose.yml b/docker-compose.yml index ee1b7d1df..6fbfed82f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -40,6 +40,7 @@ services: - ${JAEGER_OLTP_PORT}:4318 #OLTP over HTTP environment: COLLECTOR_OTLP_ENABLED: "true" + COLLECTOR_OTLP_HTTP_HOST_PORT: 0.0.0.0:4318 networks: postgres: From faf27e53bba2742e71240be5d7fb567935637fc2 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:12:53 +0200 Subject: [PATCH 022/340] Fix dotenv calls (for real) (#312) `-c` and `-e` don't work together as expected: .env and .env.local were never loaded. This error only occurred when trying to run console scripts, for instance, `npm run fixtures`. --- admin/package.json | 2 +- api/package-lock.json | 29 +++++++++++++++++++++++++++++ api/package.json | 9 +++++---- package.json | 2 +- site/package.json | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/admin/package.json b/admin/package.json index 3855a086c..4cabff28d 100644 --- a/admin/package.json +++ b/admin/package.json @@ -4,7 +4,7 @@ "scripts": { "postinstall": "cd server && npm install", "serve": "cd server && npm run serve", - "start": "npm run intl:compile && run-p gql:types generate-block-types && dotenv -c -e .env.secrets -e .env.site-configs -- vite", + "start": "npm run intl:compile && run-p gql:types generate-block-types && dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- vite", "build": "npm run intl:compile && run-p gql:types generate-block-types && NODE_ENV=production vite build", "preview": "npm run build && vite preview", "gql:types": "graphql-codegen", diff --git a/api/package-lock.json b/api/package-lock.json index cf3c5c370..609172f7b 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -55,6 +55,7 @@ "@types/jest": "^27.0.0", "@types/node": "^20.0.0", "@types/uuid": "^8.3.0", + "dotenv-cli": "^7.0.0", "eslint": "^8.19.0", "jest-junit": "^13.2.0", "npm-run-all": "^4.1.5", @@ -9997,6 +9998,22 @@ "url": "https://github.com/motdotla/dotenv?sponsor=1" } }, + "node_modules/dotenv-cli": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.4.2.tgz", + "integrity": "sha512-SbUj8l61zIbzyhIbg0FwPJq6+wjbzdn9oEtozQpZ6kW2ihCcapKVZj49oCT3oPM+mgQm+itgvUQcG5szxVrZTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.3.0", + "dotenv-expand": "^10.0.0", + "minimist": "^1.2.6" + }, + "bin": { + "dotenv": "cli.js" + } + }, "node_modules/dotenv-expand": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", @@ -27022,6 +27039,18 @@ "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz", "integrity": "sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==" }, + "dotenv-cli": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/dotenv-cli/-/dotenv-cli-7.4.2.tgz", + "integrity": "sha512-SbUj8l61zIbzyhIbg0FwPJq6+wjbzdn9oEtozQpZ6kW2ihCcapKVZj49oCT3oPM+mgQm+itgvUQcG5szxVrZTA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "dotenv": "^16.3.0", + "dotenv-expand": "^10.0.0", + "minimist": "^1.2.6" + } + }, "dotenv-expand": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-10.0.0.tgz", diff --git a/api/package.json b/api/package.json index b69d2287d..80a58ed3d 100644 --- a/api/package.json +++ b/api/package.json @@ -5,7 +5,7 @@ "api-generator": "rimraf 'src/*/generated' && comet-api-generator generate", "prebuild": "rimraf dist", "build": "nest build", - "console": "dotenv -c -e .env.secrets -e .env.site-configs -- ts-node --transpile-only -r tsconfig-paths/register src/console.ts", + "console": "dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- ts-node --transpile-only -r tsconfig-paths/register src/console.ts", "console:prod": "node dist/console.js", "db:migrate": "npm run console migrate --", "db:migrate:prod": "npm run console:prod migrate --", @@ -20,9 +20,9 @@ "mikro-orm": "mikro-orm", "mikro-orm:drop": "mikro-orm schema:drop -r", "mikro-orm:migration:generate": "mikro-orm migration:create", - "start": "npm run prebuild && dotenv -c -e .env.secrets -e .env.site-configs -- nest start", - "start:debug": "npm run prebuild && dotenv -c -e .env.secrets -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput", - "start:dev": "npm run prebuild && npm run db:migrate && npm run console createBlockIndexViews && dotenv -c -e .env.secrets -e .env.site-configs -- nest start --watch --preserveWatchOutput", + "start": "npm run prebuild && dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- nest start", + "start:debug": "npm run prebuild && dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- nest start --debug --watch --preserveWatchOutput", + "start:dev": "npm run prebuild && npm run db:migrate && npm run console createBlockIndexViews && dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- nest start --watch --preserveWatchOutput", "start:prod": "node dist/main", "test": "jest --passWithNoTests", "test:ci": "npm run test -- --ci --reporters=default --reporters=jest-junit", @@ -98,6 +98,7 @@ "@types/jest": "^27.0.0", "@types/node": "^20.0.0", "@types/uuid": "^8.3.0", + "dotenv-cli": "^7.0.0", "eslint": "^8.19.0", "jest-junit": "^13.2.0", "npm-run-all": "^4.1.5", diff --git a/package.json b/package.json index d74c02946..61ec47f54 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "create-site-configs-env": "npx @comet/cli inject-site-configs -i .env.site-configs.tpl -o .env.site-configs", - "dev": "npm run create-site-configs-env && dotenv -- dev-pm start", + "dev": "npm run create-site-configs-env && dev-pm start", "copy-schema-files": "node copy-schema-files.js", "lint": "run-p lint:*", "lint:root": "npx prettier --check './!(admin|api|site|create-app)/**/*.{js,json,md,yml,yaml}'", diff --git a/site/package.json b/site/package.json index 660087c7c..c7524534f 100644 --- a/site/package.json +++ b/site/package.json @@ -2,7 +2,7 @@ "name": "starter-site", "private": true, "scripts": { - "dev": "npm run intl:compile && run-s gql:types generate-block-types && NODE_OPTIONS='--inspect=localhost:9230' dotenv -c -e .env.secrets -e .env.site-configs -- node server.js", + "dev": "npm run intl:compile && run-s gql:types generate-block-types && NODE_OPTIONS='--inspect=localhost:9230' dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- node server.js", "build": "npm run intl:compile && run-p gql:types generate-block-types && next build", "serve": "NODE_ENV=production node server.js", "export": "next export", From 6f5953ca9413362053c3fca5e39e203ed7ee6bf5 Mon Sep 17 00:00:00 2001 From: Thomas Dax Date: Wed, 31 Jul 2024 11:20:47 +0200 Subject: [PATCH 023/340] Update to COMET v7.0.0 (#319) --- admin/package-lock.json | 186 ++++++++++++++++++------------ admin/package.json | 20 ++-- api/package-lock.json | 216 +++++++++++++++++++++++++++-------- api/package.json | 18 +-- api/schema.gql | 34 +++--- create-app/package-lock.json | 82 +++++++++---- create-app/package.json | 4 +- package-lock.json | 9 +- package.json | 2 +- site/next.config.js | 3 + site/package-lock.json | 103 ++++++++++++----- site/package.json | 10 +- 12 files changed, 461 insertions(+), 226 deletions(-) diff --git a/admin/package-lock.json b/admin/package-lock.json index 7c9127b5e..0ffe69217 100644 --- a/admin/package-lock.json +++ b/admin/package-lock.json @@ -8,13 +8,13 @@ "hasInstallScript": true, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.6", - "@comet/admin-date-time": "7.0.0-beta.6", - "@comet/admin-icons": "7.0.0-beta.6", - "@comet/admin-rte": "7.0.0-beta.6", - "@comet/admin-theme": "7.0.0-beta.6", - "@comet/blocks-admin": "7.0.0-beta.6", - "@comet/cms-admin": "7.0.0-beta.6", + "@comet/admin": "^7.0.0", + "@comet/admin-date-time": "^7.0.0", + "@comet/admin-icons": "^7.0.0", + "@comet/admin-rte": "^7.0.0", + "@comet/admin-theme": "^7.0.0", + "@comet/blocks-admin": "^7.0.0", + "@comet/cms-admin": "^7.0.0", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -43,9 +43,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.6", - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1197,12 +1197,13 @@ } }, "node_modules/@comet/admin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0-beta.6.tgz", - "integrity": "sha512-YsJAvQDRXUrfyBH1izmo3KxnD1BHkNvOI7BefQsri8ka6bxEPeqOqn5mZIvH5kzzKF6+IVVdGmws5G0uYpL1tQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/admin/-/admin-7.0.0.tgz", + "integrity": "sha512-S4towTX1igm+SWtPu00HLfl0VyqSAe6kAorkCdKC/U4/j7O9oqGDb/b9FIcjbk0Zm666v1rZDHrypJVAZzhWEw==", + "license": "BSD-2-Clause", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.6", - "@comet/admin-theme": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0", + "@comet/admin-theme": "^7.0.0", "@mui/lab": "^5.0.0-alpha.76", "@mui/private-theming": "^5.0.0", "clsx": "^1.1.1", @@ -1250,12 +1251,13 @@ } }, "node_modules/@comet/admin-date-time": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0-beta.6.tgz", - "integrity": "sha512-olaN6qgNMD680Bq1ZBtlSa9hq+8YkLW4ST2jDUa07W2vWNbAMq2yNHAzgTWHSNsM6169bVVh6oSILjcy7jK9pw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/admin-date-time/-/admin-date-time-7.0.0.tgz", + "integrity": "sha512-7f/k+IuCHDIhZCmdnpvG5IoYWvGQK+dtSMtcm69mE/Q3zJMau7VYdNZOMk/O6phqR2kPpN7HLJ71DhA3lfB/KA==", + "license": "BSD-2-Clause", "dependencies": { - "@comet/admin": "^7.0.0-beta.6", - "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin": "^7.0.0", + "@comet/admin-icons": "^7.0.0", "@mui/utils": "^5.4.1", "clsx": "^1.1.1", "date-fns": "^2.28.0", @@ -1270,9 +1272,9 @@ } }, "node_modules/@comet/admin-icons": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0-beta.6.tgz", - "integrity": "sha512-tWNxMxlA6pSLZPgFRszsaUr1nCU0yp9NvONk5+pSk7dQwaRzinq+oOT1CBtS32ovA/aRNX6JMN0H9vgdKiCJgg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/admin-icons/-/admin-icons-7.0.0.tgz", + "integrity": "sha512-d57L9wezo9AoLBUpHXOSzaiK4xgyrku3Ym5kwnVTzzFKwI1rz0z+61ER1v+wmFcCMMub5sG3qEp193MzD1ihcw==", "peerDependencies": { "@mui/material": "^5.0.0", "react": "^17.0", @@ -1280,12 +1282,13 @@ } }, "node_modules/@comet/admin-rte": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0-beta.6.tgz", - "integrity": "sha512-g/wxDqQkKsv62fojG+Vxx4c+2Cd0WxTL9yk3F0vCYe2R+P2nrQac1oKdFsFMMsFDzHYWt66o1/8isTWlx/FGLA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/admin-rte/-/admin-rte-7.0.0.tgz", + "integrity": "sha512-Vd2ZZGWAvVVo7rQg652Wj0C1B6Eue+aXi1/eulhgDH44jZoy5pqlTDGqzawAi8w6AUiCfIMBHyJ+umxOjHu0sg==", + "license": "BSD-2-Clause", "dependencies": { - "@comet/admin": "^7.0.0-beta.6", - "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin": "^7.0.0", + "@comet/admin-icons": "^7.0.0", "detect-browser": "^5.2.1", "draft-js-export-html": "^1.4.1", "draft-js-import-html": "^1.4.1", @@ -1303,11 +1306,12 @@ } }, "node_modules/@comet/admin-theme": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0-beta.6.tgz", - "integrity": "sha512-prZ4XZ9UKLTUVV0aYpp3CAmX0SceKIycJvbW0jA3aNtNqllmuD9bhBhdvzg3UbpI6FJXe5lr8la3nkMnhqdQvA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/admin-theme/-/admin-theme-7.0.0.tgz", + "integrity": "sha512-MDZYlLkZzSw8vLCQYaueKhyvGZBo0rUBka1hSNexa7/GZFCwRaznOMFnCXmHAcqbmJDKC7s0DLIPjXk2/lX3aQ==", + "license": "BSD-2-Clause", "dependencies": { - "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin-icons": "^7.0.0", "@mui/utils": "^5.4.1" }, "peerDependencies": { @@ -1317,12 +1321,13 @@ } }, "node_modules/@comet/blocks-admin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0-beta.6.tgz", - "integrity": "sha512-8VSsZLhjTiUM82G08nrCIT5WW+hqAe8Fwc8NqHKPIOo0dNjPWa9J8z2cgOGNHxmd/oO5J0N3MuBWOTL4oC85cg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/blocks-admin/-/blocks-admin-7.0.0.tgz", + "integrity": "sha512-mJzBuxe4xY7YZ47jw334LepCbw/l6GnOkJrEDPqiPjOjuRQAlnRu7EA0XMeUIhJW9JcL6fmT1KfmOzKkxwzY6A==", + "license": "BSD-2-Clause", "dependencies": { - "@comet/admin": "^7.0.0-beta.6", - "@comet/admin-icons": "^7.0.0-beta.6", + "@comet/admin": "^7.0.0", + "@comet/admin-icons": "^7.0.0", "@mui/lab": "^5.0.0-alpha.76", "clipboard-copy": "^4.0.0", "clsx": "^1.1.1", @@ -1343,10 +1348,11 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", - "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0.tgz", + "integrity": "sha512-Oy21mruRcOjT/2a0lBlB4mnRyflnZf54WrUViD6VHHyAC+8V9hQtSzBIdNTa+DNr8JPuZlWyHm6iUF+By4+zaA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "commander": "^9.2.0", "prettier": "^2.7.1" @@ -1359,16 +1365,17 @@ } }, "node_modules/@comet/cms-admin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0-beta.6.tgz", - "integrity": "sha512-Zvcfwf6V47ju41HHmGq4Tjba99SYBwlQ4s1CPNnP3CyDcH6K+CMaCrRN1CTagE4Bw+l2a/O5uIn/0KSr22+U0w==", - "dependencies": { - "@comet/admin": "^7.0.0-beta.6", - "@comet/admin-date-time": "^7.0.0-beta.6", - "@comet/admin-icons": "^7.0.0-beta.6", - "@comet/admin-rte": "^7.0.0-beta.6", - "@comet/admin-theme": "^7.0.0-beta.6", - "@comet/blocks-admin": "^7.0.0-beta.6", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cms-admin/-/cms-admin-7.0.0.tgz", + "integrity": "sha512-PN3Gy+41yQyqsX1hWQ5mN/M3tHrBtbIkAR2rf023a3IKcD+m9mMXghDXy/r9l+LoGZJHyp4KV+KiXxFpkstuiw==", + "license": "BSD-2-Clause", + "dependencies": { + "@comet/admin": "^7.0.0", + "@comet/admin-date-time": "^7.0.0", + "@comet/admin-icons": "^7.0.0", + "@comet/admin-rte": "^7.0.0", + "@comet/admin-theme": "^7.0.0", + "@comet/blocks-admin": "^7.0.0", "@graphql-tools/graphql-file-loader": "^7.5.17", "@graphql-tools/load": "^7.8.14", "@graphql-typed-document-node/core": "^3.1.1", @@ -1456,14 +1463,15 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", - "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", + "integrity": "sha512-TP+/pOMIbyZ43/wYLKXvxspJG7jGag6+5OQi7Jr5P1/xyq4L/tMv/PhpSiD/jiqbjsKnvug5OO8kzprbXj0cZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.6", - "@next/eslint-plugin-next": "^12.0.0", + "@comet/eslint-plugin": "^7.0.0", + "@next/eslint-plugin-next": "^14.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "eslint-config-next": "^14.1.4", @@ -1476,7 +1484,8 @@ "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^9.0.0", - "eslint-plugin-unused-imports": "^2.0.0" + "eslint-plugin-unused-imports": "^2.0.0", + "npm-run-all": "^4.1.5" }, "peerDependencies": { "eslint": ">= 8", @@ -1489,9 +1498,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", - "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0.tgz", + "integrity": "sha512-z+/svgiiEQ8Il9upSitimp/vBs6eFZUvCO9ytY3uQKxhVj3e0RbWdDX7q/AACso1SmxlcZ60k5tJwTtmqL1Nqw==", "dev": true, "peerDependencies": { "eslint": "8" @@ -4123,30 +4132,59 @@ } }, "node_modules/@next/eslint-plugin-next": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.3.4.tgz", - "integrity": "sha512-BFwj8ykJY+zc1/jWANsDprDIu2MgwPOIKxNVnrKvPs+f5TPegrVnem8uScND+1veT4B7F6VeqgaNLFW1Hzl9Og==", + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "7.1.7" + "glob": "10.3.10" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/@next/eslint-plugin-next/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" diff --git a/admin/package.json b/admin/package.json index 4cabff28d..67ba555fb 100644 --- a/admin/package.json +++ b/admin/package.json @@ -26,13 +26,13 @@ }, "dependencies": { "@apollo/client": "^3.2.5", - "@comet/admin": "7.0.0-beta.6", - "@comet/admin-date-time": "7.0.0-beta.6", - "@comet/admin-icons": "7.0.0-beta.6", - "@comet/admin-rte": "7.0.0-beta.6", - "@comet/admin-theme": "7.0.0-beta.6", - "@comet/blocks-admin": "7.0.0-beta.6", - "@comet/cms-admin": "7.0.0-beta.6", + "@comet/admin": "^7.0.0", + "@comet/admin-date-time": "^7.0.0", + "@comet/admin-icons": "^7.0.0", + "@comet/admin-rte": "^7.0.0", + "@comet/admin-theme": "^7.0.0", + "@comet/blocks-admin": "^7.0.0", + "@comet/cms-admin": "^7.0.0", "@emotion/react": "^11.9.3", "@emotion/styled": "^11.9.3", "@fontsource/roboto": "^4.5.8", @@ -61,9 +61,9 @@ "react-router-dom": "^5.1.2" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.6", - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", diff --git a/api/package-lock.json b/api/package-lock.json index 609172f7b..4c382f9e8 100644 --- a/api/package-lock.json +++ b/api/package-lock.json @@ -6,14 +6,14 @@ "": { "name": "starter-api", "dependencies": { - "@comet/blocks-api": "7.0.0-beta.6", - "@comet/cms-api": "7.0.0-beta.6", + "@comet/blocks-api": "^7.0.0", + "@comet/cms-api": "^7.0.0", "@faker-js/faker": "^8.3.1", - "@mikro-orm/cli": "^5.0.5", - "@mikro-orm/core": "^5.0.5", - "@mikro-orm/migrations": "^5.0.0", - "@mikro-orm/nestjs": "^5.0.0", - "@mikro-orm/postgresql": "^5.0.5", + "@mikro-orm/cli": "^5.9.8", + "@mikro-orm/core": "^5.9.8", + "@mikro-orm/migrations": "^5.9.8", + "@mikro-orm/nestjs": "^5.2.3", + "@mikro-orm/postgresql": "^5.9.8", "@nestjs/apollo": "^10.0.0", "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.0.0", @@ -43,8 +43,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", @@ -1195,6 +1195,22 @@ "node": ">=16.0.0" } }, + "node_modules/@azure-rest/ai-translation-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure-rest/ai-translation-text/-/ai-translation-text-1.0.0.tgz", + "integrity": "sha512-Zt1nwHdvfEzM6EVnx4cLz6GNYS5gxYWbwA3dAr6+NM9CWb3vk+p2Vy/mleU53OSeJvkzhpjXJ78qiJh42JmcXA==", + "license": "MIT", + "dependencies": { + "@azure-rest/core-client": "^1.1.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@azure-rest/core-client": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.4.0.tgz", @@ -2170,9 +2186,10 @@ } }, "node_modules/@comet/blocks-api": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.6.tgz", - "integrity": "sha512-kfy8wIJezinlchJmZb9LSynANeYKEaElF0e+GrIWbp1uguDCpr3U/boEJnLRYhi0wwG+N3kw7sJTtSIqYDKjig==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0.tgz", + "integrity": "sha512-5e9nolEKVBsYxEayCgrofjR+0oRfeXpeY2cuZwI6k0YG/k/JRPVPAVd4JekZyiScaL+UI7bbq+qf5Wp9XMEFgQ==", + "license": "BSD-2-Clause", "dependencies": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -2183,14 +2200,16 @@ } }, "node_modules/@comet/cms-api": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.6.tgz", - "integrity": "sha512-aB/fxwZqG3ahAlTZD9ODh5nDrrippOkTRMPSRTT5YnKLyUZSq85eyFaOvoysh4an+Gjs4zmz/4RmwaGMMOjvlQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0.tgz", + "integrity": "sha512-FT3NV+SDxkI5SG6Y2R80/xQWn4RHEr7GHR81V1mzIwhHD+c3x3OqYdscK6/5yD3ScsdxapKIGYXCWRgcwqoVjw==", + "license": "BSD-2-Clause", "dependencies": { "@aws-sdk/client-s3": "^3.591.0", + "@azure-rest/ai-translation-text": "^1.0.0-beta.1", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.6", + "@comet/blocks-api": "^7.0.0", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -2292,14 +2311,15 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", - "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", + "integrity": "sha512-TP+/pOMIbyZ43/wYLKXvxspJG7jGag6+5OQi7Jr5P1/xyq4L/tMv/PhpSiD/jiqbjsKnvug5OO8kzprbXj0cZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.6", - "@next/eslint-plugin-next": "^12.0.0", + "@comet/eslint-plugin": "^7.0.0", + "@next/eslint-plugin-next": "^14.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "eslint-config-next": "^14.1.4", @@ -2312,7 +2332,8 @@ "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^9.0.0", - "eslint-plugin-unused-imports": "^2.0.0" + "eslint-plugin-unused-imports": "^2.0.0", + "npm-run-all": "^4.1.5" }, "peerDependencies": { "eslint": ">= 8", @@ -2325,9 +2346,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", - "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0.tgz", + "integrity": "sha512-z+/svgiiEQ8Il9upSitimp/vBs6eFZUvCO9ytY3uQKxhVj3e0RbWdDX7q/AACso1SmxlcZ60k5tJwTtmqL1Nqw==", "dev": true, "peerDependencies": { "eslint": "8" @@ -4486,12 +4507,62 @@ "dev": true }, "node_modules/@next/eslint-plugin-next": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.3.4.tgz", - "integrity": "sha512-BFwj8ykJY+zc1/jWANsDprDIu2MgwPOIKxNVnrKvPs+f5TPegrVnem8uScND+1veT4B7F6VeqgaNLFW1Hzl9Og==", + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "7.1.7" + "glob": "10.3.10" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@nodelib/fs.scandir": { @@ -20502,6 +20573,18 @@ "tslib": "^2.6.2" } }, + "@azure-rest/ai-translation-text": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@azure-rest/ai-translation-text/-/ai-translation-text-1.0.0.tgz", + "integrity": "sha512-Zt1nwHdvfEzM6EVnx4cLz6GNYS5gxYWbwA3dAr6+NM9CWb3vk+p2Vy/mleU53OSeJvkzhpjXJ78qiJh42JmcXA==", + "requires": { + "@azure-rest/core-client": "^1.1.0", + "@azure/core-auth": "^1.3.0", + "@azure/core-rest-pipeline": "^1.8.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.2.0" + } + }, "@azure-rest/core-client": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@azure-rest/core-client/-/core-client-1.4.0.tgz", @@ -21262,9 +21345,9 @@ "optional": true }, "@comet/blocks-api": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0-beta.6.tgz", - "integrity": "sha512-kfy8wIJezinlchJmZb9LSynANeYKEaElF0e+GrIWbp1uguDCpr3U/boEJnLRYhi0wwG+N3kw7sJTtSIqYDKjig==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/blocks-api/-/blocks-api-7.0.0.tgz", + "integrity": "sha512-5e9nolEKVBsYxEayCgrofjR+0oRfeXpeY2cuZwI6k0YG/k/JRPVPAVd4JekZyiScaL+UI7bbq+qf5Wp9XMEFgQ==", "requires": { "class-transformer": "^0.5.0", "class-validator": "0.13.2", @@ -21272,14 +21355,15 @@ } }, "@comet/cms-api": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0-beta.6.tgz", - "integrity": "sha512-aB/fxwZqG3ahAlTZD9ODh5nDrrippOkTRMPSRTT5YnKLyUZSq85eyFaOvoysh4an+Gjs4zmz/4RmwaGMMOjvlQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cms-api/-/cms-api-7.0.0.tgz", + "integrity": "sha512-FT3NV+SDxkI5SG6Y2R80/xQWn4RHEr7GHR81V1mzIwhHD+c3x3OqYdscK6/5yD3ScsdxapKIGYXCWRgcwqoVjw==", "requires": { "@aws-sdk/client-s3": "^3.591.0", + "@azure-rest/ai-translation-text": "^1.0.0-beta.1", "@azure/openai": "1.0.0-beta.11", "@azure/storage-blob": "^12.23.0", - "@comet/blocks-api": "^7.0.0-beta.6", + "@comet/blocks-api": "^7.0.0", "@fast-csv/parse": "^4.3.6", "@golevelup/nestjs-discovery": "^3.0.0", "@hapi/accept": "^5.0.2", @@ -21349,14 +21433,14 @@ } }, "@comet/eslint-config": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", - "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", + "integrity": "sha512-TP+/pOMIbyZ43/wYLKXvxspJG7jGag6+5OQi7Jr5P1/xyq4L/tMv/PhpSiD/jiqbjsKnvug5OO8kzprbXj0cZA==", "dev": true, "requires": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.6", - "@next/eslint-plugin-next": "^12.0.0", + "@comet/eslint-plugin": "^7.0.0", + "@next/eslint-plugin-next": "^14.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "eslint-config-next": "^14.1.4", @@ -21369,13 +21453,14 @@ "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^9.0.0", - "eslint-plugin-unused-imports": "^2.0.0" + "eslint-plugin-unused-imports": "^2.0.0", + "npm-run-all": "^4.1.5" } }, "@comet/eslint-plugin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", - "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0.tgz", + "integrity": "sha512-z+/svgiiEQ8Il9upSitimp/vBs6eFZUvCO9ytY3uQKxhVj3e0RbWdDX7q/AACso1SmxlcZ60k5tJwTtmqL1Nqw==", "dev": true, "requires": {} }, @@ -22858,12 +22943,45 @@ } }, "@next/eslint-plugin-next": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.3.4.tgz", - "integrity": "sha512-BFwj8ykJY+zc1/jWANsDprDIu2MgwPOIKxNVnrKvPs+f5TPegrVnem8uScND+1veT4B7F6VeqgaNLFW1Hzl9Og==", + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", "dev": true, "requires": { - "glob": "7.1.7" + "glob": "10.3.10" + }, + "dependencies": { + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dev": true, + "requires": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + } + }, + "minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "requires": { + "brace-expansion": "^2.0.1" + } + } } }, "@nodelib/fs.scandir": { diff --git a/api/package.json b/api/package.json index 80a58ed3d..45d611671 100644 --- a/api/package.json +++ b/api/package.json @@ -49,14 +49,14 @@ } }, "dependencies": { - "@comet/blocks-api": "7.0.0-beta.6", - "@comet/cms-api": "7.0.0-beta.6", + "@comet/blocks-api": "^7.0.0", + "@comet/cms-api": "^7.0.0", "@faker-js/faker": "^8.3.1", - "@mikro-orm/cli": "^5.0.5", - "@mikro-orm/core": "^5.0.5", - "@mikro-orm/migrations": "^5.0.0", - "@mikro-orm/nestjs": "^5.0.0", - "@mikro-orm/postgresql": "^5.0.5", + "@mikro-orm/cli": "^5.9.8", + "@mikro-orm/core": "^5.9.8", + "@mikro-orm/migrations": "^5.9.8", + "@mikro-orm/nestjs": "^5.2.3", + "@mikro-orm/postgresql": "^5.9.8", "@nestjs/apollo": "^10.0.0", "@nestjs/common": "^9.0.0", "@nestjs/config": "^2.0.0", @@ -86,8 +86,8 @@ "uuid": "^8.3.2" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@nestjs/cli": "^9.0.0", "@nestjs/schematics": "^9.0.0", "@nestjs/testing": "^9.0.0", diff --git a/api/schema.gql b/api/schema.gql index a21079212..25a637392 100644 --- a/api/schema.gql +++ b/api/schema.gql @@ -43,23 +43,6 @@ A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date """ scalar DateTime -type Dependency { - rootId: String! - rootGraphqlObjectType: String! - rootColumnName: String! - jsonPath: String! - visible: Boolean! - targetGraphqlObjectType: String! - targetId: String! - name: String - secondaryInformation: String -} - -type PaginatedDependencies { - nodes: [Dependency!]! - totalCount: Int! -} - type ImageCropArea { focalPoint: FocalPoint! width: Float @@ -107,6 +90,23 @@ enum LicenseType { RIGHTS_MANAGED } +type Dependency { + rootId: String! + rootGraphqlObjectType: String! + rootColumnName: String! + jsonPath: String! + visible: Boolean! + targetGraphqlObjectType: String! + targetId: String! + name: String + secondaryInformation: String +} + +type PaginatedDependencies { + nodes: [Dependency!]! + totalCount: Int! +} + type BuildTemplate { id: ID! name: String! diff --git a/create-app/package-lock.json b/create-app/package-lock.json index 127da7539..7b5cea867 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -20,8 +20,8 @@ "create-app": "bin/index.js" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", @@ -158,14 +158,15 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", - "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", + "integrity": "sha512-TP+/pOMIbyZ43/wYLKXvxspJG7jGag6+5OQi7Jr5P1/xyq4L/tMv/PhpSiD/jiqbjsKnvug5OO8kzprbXj0cZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.6", - "@next/eslint-plugin-next": "^12.0.0", + "@comet/eslint-plugin": "^7.0.0", + "@next/eslint-plugin-next": "^14.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "eslint-config-next": "^14.1.4", @@ -178,7 +179,8 @@ "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^9.0.0", - "eslint-plugin-unused-imports": "^2.0.0" + "eslint-plugin-unused-imports": "^2.0.0", + "npm-run-all": "^4.1.5" }, "peerDependencies": { "eslint": ">= 8", @@ -191,9 +193,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", - "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0.tgz", + "integrity": "sha512-z+/svgiiEQ8Il9upSitimp/vBs6eFZUvCO9ytY3uQKxhVj3e0RbWdDX7q/AACso1SmxlcZ60k5tJwTtmqL1Nqw==", "dev": true, "peerDependencies": { "eslint": "8" @@ -407,29 +409,59 @@ "dev": true }, "node_modules/@next/eslint-plugin-next": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-12.3.4.tgz", - "integrity": "sha512-BFwj8ykJY+zc1/jWANsDprDIu2MgwPOIKxNVnrKvPs+f5TPegrVnem8uScND+1veT4B7F6VeqgaNLFW1Hzl9Og==", + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", "dev": true, + "license": "MIT", "dependencies": { - "glob": "7.1.7" + "glob": "10.3.10" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, "node_modules/@next/eslint-plugin-next/node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" diff --git a/create-app/package.json b/create-app/package.json index 688831c1b..b4ab480ca 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -39,8 +39,8 @@ "rimraf": "^5.0.1" }, "devDependencies": { - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@tsconfig/node20": "^20.1.2", "@types/node": "^20.0.0", "npm-run-all": "^4.1.5", diff --git a/package-lock.json b/package-lock.json index 4c6e80245..f27fde551 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter", "devDependencies": { - "@comet/cli": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", @@ -28,10 +28,11 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", - "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0.tgz", + "integrity": "sha512-Oy21mruRcOjT/2a0lBlB4mnRyflnZf54WrUViD6VHHyAC+8V9hQtSzBIdNTa+DNr8JPuZlWyHm6iUF+By4+zaA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "commander": "^9.2.0", "prettier": "^2.7.1" diff --git a/package.json b/package.json index 61ec47f54..d14234d52 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "browser:jaeger": "dotenv -- sh -c 'open-cli http://localhost:$JAEGER_UI_PORT'" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", "@comet/dev-process-manager": "^2.0.0", "dotenv-cli": "^7.0.0", "husky": "^9.0.0", diff --git a/site/next.config.js b/site/next.config.js index ec57f5fdf..72fced6d4 100644 --- a/site/next.config.js +++ b/site/next.config.js @@ -21,6 +21,9 @@ const nextConfig = { compiler: { styledComponents: true, }, + experimental: { + optimizePackageImports: ["@comet/cms-site"], + }, // https://nextjs.org/docs/advanced-features/security-headers headers: async () => [ { diff --git a/site/package-lock.json b/site/package-lock.json index 81592ba2f..ddff33a58 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -6,7 +6,7 @@ "": { "name": "starter-site", "dependencies": { - "@comet/cms-site": "7.0.0-beta.6", + "@comet/cms-site": "^7.0.0", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -14,7 +14,7 @@ "@opentelemetry/sdk-node": "^0.46.0", "cache-manager": "^5.6.1", "graphql": "^15.0.0", - "next": "^14.0.0", + "next": "^14.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-intl": "^6.0.0", @@ -24,9 +24,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.6", - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", @@ -1049,10 +1049,11 @@ } }, "node_modules/@comet/cli": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0-beta.6.tgz", - "integrity": "sha512-Zs8tTebiOw64JsUGjn7flqbyVHEjS+Sum7edvO8vJJ9s9b4MPRqFlUgLOPG1gZBVmM2pEg/JvdjssC/S5jKHpw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cli/-/cli-7.0.0.tgz", + "integrity": "sha512-Oy21mruRcOjT/2a0lBlB4mnRyflnZf54WrUViD6VHHyAC+8V9hQtSzBIdNTa+DNr8JPuZlWyHm6iUF+By4+zaA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "commander": "^9.2.0", "prettier": "^2.7.1" @@ -1065,13 +1066,15 @@ } }, "node_modules/@comet/cms-site": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0-beta.6.tgz", - "integrity": "sha512-Y7uTsfIiUE3Ak5mSBgCB0VfjAiftxNN2dZuWn1jlvoT1QeGHKzmXZDc2EH0Rxc5dra6C+8KEiGF4zmxllRCfFg==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/cms-site/-/cms-site-7.0.0.tgz", + "integrity": "sha512-7s1V9vhD6vyiFgAM0ZDy9aaDTsUqo/OMRdUmv/nYQ5QMogS+FByf0oDK2JLy87P2vAnhaD31QJtkVl3kjBvwNg==", + "license": "BSD-2-Clause", "dependencies": { "jose": "^5.2.4", "rimraf": "^3.0.0", "scroll-into-view-if-needed": "^2.0.0", + "server-only": "^0.0.1", "use-debounce": "^6.0.0" }, "peerDependencies": { @@ -1089,14 +1092,15 @@ } }, "node_modules/@comet/eslint-config": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0-beta.6.tgz", - "integrity": "sha512-CeiTvd1oFTLYV14Lu3IE5e/o5q+oiYB8uaTCJbxiS1BVkv3x1i4/jjK7DaryqsgcmKLI8J5Nv54nkc0fN9yaWw==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", + "integrity": "sha512-TP+/pOMIbyZ43/wYLKXvxspJG7jGag6+5OQi7Jr5P1/xyq4L/tMv/PhpSiD/jiqbjsKnvug5OO8kzprbXj0cZA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { "@calm/eslint-plugin-react-intl": "^1.4.1", - "@comet/eslint-plugin": "^7.0.0-beta.6", - "@next/eslint-plugin-next": "^12.0.0", + "@comet/eslint-plugin": "^7.0.0", + "@next/eslint-plugin-next": "^14.0.0", "@typescript-eslint/eslint-plugin": "^5.48.2", "@typescript-eslint/parser": "^5.48.2", "eslint-config-next": "^14.1.4", @@ -1109,7 +1113,8 @@ "eslint-plugin-react": "^7.32.1", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-simple-import-sort": "^9.0.0", - "eslint-plugin-unused-imports": "^2.0.0" + "eslint-plugin-unused-imports": "^2.0.0", + "npm-run-all": "^4.1.5" }, "peerDependencies": { "eslint": ">= 8", @@ -1122,9 +1127,9 @@ } }, "node_modules/@comet/eslint-plugin": { - "version": "7.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0-beta.6.tgz", - "integrity": "sha512-ojAtuxYzhHXRjlLcRAveiMtLIT2FQw5XkMtnGmRlB8lQ2cwKw0a3MGgBEV0vhZbiDUss0WGfVwhB4blE0TqxcQ==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@comet/eslint-plugin/-/eslint-plugin-7.0.0.tgz", + "integrity": "sha512-z+/svgiiEQ8Il9upSitimp/vBs6eFZUvCO9ytY3uQKxhVj3e0RbWdDX7q/AACso1SmxlcZ60k5tJwTtmqL1Nqw==", "dev": true, "peerDependencies": { "eslint": "8" @@ -2668,27 +2673,59 @@ "license": "MIT" }, "node_modules/@next/eslint-plugin-next": { - "version": "12.3.4", + "version": "14.2.5", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.5.tgz", + "integrity": "sha512-LY3btOpPh+OTIpviNojDpUdIbHW9j0JBYBjsIp8IxtDFfYFyORvw3yNq6N231FVqQA7n7lwaf7xHbVJlA1ED7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "glob": "10.3.10" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "license": "MIT", "dependencies": { - "glob": "7.1.7" + "balanced-match": "^1.0.0" } }, "node_modules/@next/eslint-plugin-next/node_modules/glob": { - "version": "7.1.7", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@next/eslint-plugin-next/node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -11106,6 +11143,12 @@ "upper-case-first": "^2.0.2" } }, + "node_modules/server-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/server-only/-/server-only-0.0.1.tgz", + "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==", + "license": "MIT" + }, "node_modules/set-blocking": { "version": "2.0.0", "dev": true, diff --git a/site/package.json b/site/package.json index c7524534f..2f93ddbb7 100644 --- a/site/package.json +++ b/site/package.json @@ -20,7 +20,7 @@ "intl:compile": "formatjs compile-folder --format simple --ast lang/starter-lang/site lang-compiled/" }, "dependencies": { - "@comet/cms-site": "7.0.0-beta.6", + "@comet/cms-site": "^7.0.0", "@next/bundle-analyzer": "^14.0.0", "@opentelemetry/api": "^1.7.0", "@opentelemetry/auto-instrumentations-node": "^0.40.0", @@ -28,7 +28,7 @@ "@opentelemetry/sdk-node": "^0.46.0", "cache-manager": "^5.6.1", "graphql": "^15.0.0", - "next": "^14.0.0", + "next": "^14.2.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-intl": "^6.0.0", @@ -38,9 +38,9 @@ "ts-node": "^10.0.0" }, "devDependencies": { - "@comet/cli": "7.0.0-beta.6", - "@comet/eslint-config": "7.0.0-beta.6", - "@comet/eslint-plugin": "7.0.0-beta.6", + "@comet/cli": "^7.0.0", + "@comet/eslint-config": "^7.0.0", + "@comet/eslint-plugin": "^7.0.0", "@formatjs/cli": "^6.0.0", "@graphql-codegen/add": "^3.0.0", "@graphql-codegen/cli": "^2.0.0", From 4362bbfc03e39e1e9956d6f051098f745d30b94c Mon Sep 17 00:00:00 2001 From: thomasdax98 Date: Wed, 31 Jul 2024 09:21:13 +0000 Subject: [PATCH 024/340] @comet/create-app: Publish v1.27.0 --- create-app/package-lock.json | 4 ++-- create-app/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/create-app/package-lock.json b/create-app/package-lock.json index 7b5cea867..de3901e82 100644 --- a/create-app/package-lock.json +++ b/create-app/package-lock.json @@ -1,12 +1,12 @@ { "name": "@comet/create-app", - "version": "1.26.0", + "version": "1.27.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@comet/create-app", - "version": "1.26.0", + "version": "1.27.0", "license": "BSD-2-Clause", "dependencies": { "commander": "^11.0.0", diff --git a/create-app/package.json b/create-app/package.json index b4ab480ca..b4764aeac 100644 --- a/create-app/package.json +++ b/create-app/package.json @@ -1,6 +1,6 @@ { "name": "@comet/create-app", - "version": "1.26.0", + "version": "1.27.0", "description": "Command-line interface to create a new Comet application", "homepage": "https://github.com/vivid-planet/comet-starter/tree/main/create-app#readme", "bugs": { From 5831bdd2a911b49ba40f3fb8b6949cb7c6ac75d9 Mon Sep 17 00:00:00 2001 From: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Date: Thu, 1 Aug 2024 15:08:12 +0200 Subject: [PATCH 025/340] Remove obsolete `next export` script (#321) With Next 14 `next export` has been removed in favor of 'output: export' in next.config.js. --- site/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/site/package.json b/site/package.json index 2f93ddbb7..f6926eb04 100644 --- a/site/package.json +++ b/site/package.json @@ -5,7 +5,6 @@ "dev": "npm run intl:compile && run-s gql:types generate-block-types && NODE_OPTIONS='--inspect=localhost:9230' dotenv -e .env -e .env.local -e .env.secrets -e .env.site-configs -- node server.js", "build": "npm run intl:compile && run-p gql:types generate-block-types && next build", "serve": "NODE_ENV=production node server.js", - "export": "next export", "gql:types": "graphql-codegen", "gql:watch": "graphql-codegen --watch", "prelint": "npm run intl:compile && run-p gql:types generate-block-types", From 05f8aeee2a1528d939c44889b66f3c35b08da482 Mon Sep 17 00:00:00 2001 From: Magdalena Maislinger Date: Mon, 5 Aug 2024 09:12:21 +0200 Subject: [PATCH 026/340] Use site configs in site (#283) Co-authored-by: Thomas Dax Co-authored-by: Johannes Obermair <48853629+johnnyomair@users.noreply.github.com> Co-authored-by: Franz Unger Co-authored-by: Niko Sams --- admin/src/App.tsx | 17 +++++- admin/src/common/ContentScopeProvider.tsx | 2 +- admin/src/config.tsx | 2 - api/src/app.module.ts | 7 ++- site-configs.d.ts | 7 ++- site-configs.ts | 13 ++-- site-configs/main-en.ts | 12 ---- site-configs/{main-de.ts => main.ts} | 8 +-- site-configs/secondary-en.ts | 12 ---- .../{secondary-de.ts => secondary.ts} | 8 +-- site/package-lock.json | 36 +++++++---- site/package.json | 1 + site/public/{ => assets}/comet-logo.svg | 0 .../public/{ => assets}/icons/arrow-right.svg | 0 .../{ => assets}/icons/chevron-down.svg | 0 .../[language]}/IntlProvider.tsx | 0 .../[language]}/[[...path]]/layout.tsx | 15 ++--- .../[language]}/[[...path]]/page.tsx | 17 +++--- site/src/app/[domain]/[language]/layout.tsx | 20 +++++++ site/src/app/{ => [domain]}/page.tsx | 0 site/src/app/{ => [domain]}/sitemap.ts | 11 ++-- site/src/app/[lang]/layout.tsx | 22 ------- site/src/app/layout.tsx | 15 ++++- site/src/common/blocks/AccordionItemBlock.tsx | 2 +- site/src/config.ts | 25 +++++++- .../pages/blocks/TeaserItemBlock.tsx | 2 +- site/src/layout/header/Header.tsx | 2 +- site/src/middleware.ts | 60 ++++++++++++++++++- 28 files changed, 201 insertions(+), 115 deletions(-) delete mode 100644 site-configs/main-en.ts rename site-configs/{main-de.ts => main.ts} (56%) delete mode 100644 site-configs/secondary-en.ts rename site-configs/{secondary-de.ts => secondary.ts} (55%) rename site/public/{ => assets}/comet-logo.svg (100%) rename site/public/{ => assets}/icons/arrow-right.svg (100%) rename site/public/{ => assets}/icons/chevron-down.svg (100%) rename site/src/app/{[lang] => [domain]/[language]}/IntlProvider.tsx (100%) rename site/src/app/{[lang] => [domain]/[language]}/[[...path]]/layout.tsx (62%) rename site/src/app/{[lang] => [domain]/[language]}/[[...path]]/page.tsx (68%) create mode 100644 site/src/app/[domain]/[language]/layout.tsx rename site/src/app/{ => [domain]}/page.tsx (100%) rename site/src/app/{ => [domain]}/sitemap.ts (87%) delete mode 100644 site/src/app/[lang]/layout.tsx diff --git a/admin/src/App.tsx b/admin/src/App.tsx index 751c36d4c..7cb781137 100644 --- a/admin/src/App.tsx +++ b/admin/src/App.tsx @@ -21,6 +21,7 @@ import { } from "@comet/cms-admin"; import { css, Global } from "@emotion/react"; import { getMessages } from "@src/lang"; +import { ContentScope } from "@src/site-configs"; import { theme } from "@src/theme"; import { HTML5toTouch } from "rdndmb-html5-to-touch"; import { DndProvider } from "react-dnd-multi-backend"; @@ -31,7 +32,7 @@ import { createApolloClient } from "./common/apollo/createApolloClient"; import { ContentScopeProvider } from "./common/ContentScopeProvider"; import { MasterHeader } from "./common/MasterHeader"; import { masterMenuData, pageTreeCategories, pageTreeDocumentTypes } from "./common/masterMenuData"; -import { ConfigProvider, ContentScope, createConfig } from "./config"; +import { ConfigProvider, createConfig } from "./config"; import { Link } from "./documents/links/Link"; import { Page } from "./documents/pages/Page"; @@ -57,7 +58,10 @@ export function App() { value={{ configs: config.sitesConfig, resolveSiteConfigForScope: (configs, scope: ContentScope) => { - const siteConfig = configs.find((config) => config.contentScope.domain === scope.domain); + const siteConfig = configs.find((config) => { + return config.domain === scope.domain; + }); + if (!siteConfig) throw new Error(`siteConfig not found for domain ${scope.domain}`); return { url: siteConfig.url, @@ -100,7 +104,14 @@ export function App() { } + render={(props) => ( + { + return `/${scope.language}${path}`; + }} + {...props} + /> + )} /> ( diff --git a/admin/src/common/ContentScopeProvider.tsx b/admin/src/common/ContentScopeProvider.tsx index 03c32dd04..95d3ea6cf 100644 --- a/admin/src/common/ContentScopeProvider.tsx +++ b/admin/src/common/ContentScopeProvider.tsx @@ -8,7 +8,7 @@ import { useContentScopeConfig as useContentScopeConfigLibrary, useCurrentUser, } from "@comet/cms-admin"; -import { ContentScope } from "@src/config"; +import { ContentScope } from "@src/site-configs"; // convenince wrapper for app (Bind Generic) export function useContentScope(): UseContentScopeApi { diff --git a/admin/src/config.tsx b/admin/src/config.tsx index e9e059423..476264e95 100644 --- a/admin/src/config.tsx +++ b/admin/src/config.tsx @@ -29,8 +29,6 @@ export function createConfig() { }; } -export type ContentScope = PublicSiteConfig["contentScope"]; - export type Config = ReturnType; const ConfigContext = createContext(undefined); diff --git a/api/src/app.module.ts b/api/src/app.module.ts index 1d643aa61..a7edd2851 100644 --- a/api/src/app.module.ts +++ b/api/src/app.module.ts @@ -80,7 +80,12 @@ export class AppModule { AuthModule, UserPermissionsModule.forRootAsync({ useFactory: (userService: UserService, accessControlService: AccessControlService) => ({ - availableContentScopes: config.siteConfigs.map((siteConfig) => siteConfig.contentScope), + availableContentScopes: config.siteConfigs.flatMap((siteConfig) => + siteConfig.languages.map((language) => ({ + domain: siteConfig.domain, + language, + })), + ), userService, accessControlService, systemUsers: ["system"], diff --git a/site-configs.d.ts b/site-configs.d.ts index a335740e4..4a86ec2f7 100644 --- a/site-configs.d.ts +++ b/site-configs.d.ts @@ -8,9 +8,10 @@ export type ContentScope = { export interface SiteConfig extends BaseSiteConfig { preloginPassword?: string; public: { - contentScope: ContentScope; + domain: string; + languages: string[]; }; } -export type PrivateSiteConfig = ExtractPrivateSiteConfig & { contentScope: ContentScope }; -export type PublicSiteConfig = ExtractPublicSiteConfig & { contentScope: ContentScope }; +export type PrivateSiteConfig = ExtractPrivateSiteConfig; +export type PublicSiteConfig = ExtractPublicSiteConfig; diff --git a/site-configs.ts b/site-configs.ts index 777f28e60..d90cd9501 100644 --- a/site-configs.ts +++ b/site-configs.ts @@ -3,7 +3,7 @@ import { SiteConfig } from "./site-configs.d"; // Types for files in site-configs/ type Environment = "local" | "dev" | "test" | "staging" | "prod"; -export type Config = Omit & SiteConfig["public"] & { +export type Config = Omit & Pick & { domains: { preliminary?: string; } & { @@ -18,9 +18,9 @@ const getSiteConfigs = async (env: Environment): Promise => { const files = (await fs.readdir(path)).filter((file) => !file.startsWith("_")); const imports = (await Promise.all(files.map((file) => import(`${path}/${file}`)))) as { default: Config }[]; return imports.map((imprt, index) => { - const { domains, contentScope, ...site } = imprt.default; + const { domains, ...site } = imprt.default; - const ret: SiteConfig = { + return { ...site, domains: { main: domains[env] ?? "", @@ -28,11 +28,10 @@ const getSiteConfigs = async (env: Environment): Promise => { }, preloginEnabled: env === "prod" ? site.preloginEnabled : true, public: { - contentScope, + domain: site.domain, + languages: site.languages, } - }; - - return ret; + } }); }; export default getSiteConfigs; diff --git a/site-configs/main-en.ts b/site-configs/main-en.ts deleted file mode 100644 index 75cf1eb56..000000000 --- a/site-configs/main-en.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Config } from "../site-configs"; - -export default { - name: "Starter Main EN", - contentScope: { - domain: "main", - language: "en", - }, - domains: { - local: "en.localhost:3000", - }, -} satisfies Config; diff --git a/site-configs/main-de.ts b/site-configs/main.ts similarity index 56% rename from site-configs/main-de.ts rename to site-configs/main.ts index 7c3fe9fee..eac3ae329 100644 --- a/site-configs/main-de.ts +++ b/site-configs/main.ts @@ -1,11 +1,9 @@ import { Config } from "../site-configs"; export default { - name: "Starter Main DE", - contentScope: { - domain: "main", - language: "de", - }, + name: "Starter Main", + domain: "main", + languages: ["en", "de"], domains: { local: "localhost:3000", }, diff --git a/site-configs/secondary-en.ts b/site-configs/secondary-en.ts deleted file mode 100644 index 2fe96bfbf..000000000 --- a/site-configs/secondary-en.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { Config } from "../site-configs"; - -export default { - name: "Starter Secondary EN", - contentScope: { - domain: "secondary", - language: "en", - }, - domains: { - local: "secondary-en.localhost:3000", - }, -} satisfies Config; diff --git a/site-configs/secondary-de.ts b/site-configs/secondary.ts similarity index 55% rename from site-configs/secondary-de.ts rename to site-configs/secondary.ts index 909104365..bc9d3b30a 100644 --- a/site-configs/secondary-de.ts +++ b/site-configs/secondary.ts @@ -1,11 +1,9 @@ import { Config } from "../site-configs"; export default { - name: "Starter Secondary DE", - contentScope: { - domain: "secondary", - language: "de", - }, + name: "Starter Secondary", + domain: "secondary", + languages: ["en", "de"], domains: { local: "secondary.localhost:3000", }, diff --git a/site/package-lock.json b/site/package-lock.json index ddff33a58..768fa7467 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -15,6 +15,7 @@ "cache-manager": "^5.6.1", "graphql": "^15.0.0", "next": "^14.2.0", + "next-runtime-env": "^3.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-intl": "^6.0.0", @@ -1084,13 +1085,6 @@ "styled-components": "^6.0.0" } }, - "node_modules/@comet/cms-site/node_modules/jose": { - "version": "5.2.4", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/panva" - } - }, "node_modules/@comet/eslint-config": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/@comet/eslint-config/-/eslint-config-7.0.0.tgz", @@ -2277,6 +2271,15 @@ "graphql": "14 - 16" } }, + "node_modules/@graphql-tools/prisma-loader/node_modules/jose": { + "version": "4.15.9", + "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz", + "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/panva" + } + }, "node_modules/@graphql-tools/prisma-loader/node_modules/urlpattern-polyfill": { "version": "8.0.2", "dev": true, @@ -9164,9 +9167,9 @@ } }, "node_modules/jose": { - "version": "4.15.5", - "dev": true, - "license": "MIT", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.6.3.tgz", + "integrity": "sha512-1Jh//hEEwMhNYPDDLwXHa2ePWgWiFNNUadVmguAAw2IJ6sj9mNxV5tGXJNqlMkJAybF6Lgw1mISDxTePP/187g==", "funding": { "url": "https://github.com/sponsors/panva" } @@ -9788,6 +9791,19 @@ } } }, + "node_modules/next-runtime-env": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/next-runtime-env/-/next-runtime-env-3.2.2.tgz", + "integrity": "sha512-S5S6NxIf3XeaVc9fLBN2L5Jzu+6dLYCXeOaPQa1RzKRYlG2BBayxXOj6A4VsciocyNkJMazW1VAibtbb1/ZjAw==", + "dependencies": { + "next": "^14", + "react": "^18" + }, + "peerDependencies": { + "next": "^14", + "react": "^18" + } + }, "node_modules/nice-try": { "version": "1.0.5", "dev": true, diff --git a/site/package.json b/site/package.json index f6926eb04..103ef93fe 100644 --- a/site/package.json +++ b/site/package.json @@ -28,6 +28,7 @@ "cache-manager": "^5.6.1", "graphql": "^15.0.0", "next": "^14.2.0", + "next-runtime-env": "^3.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", "react-intl": "^6.0.0", diff --git a/site/public/comet-logo.svg b/site/public/assets/comet-logo.svg similarity index 100% rename from site/public/comet-logo.svg rename to site/public/assets/comet-logo.svg diff --git a/site/public/icons/arrow-right.svg b/site/public/assets/icons/arrow-right.svg similarity index 100% rename from site/public/icons/arrow-right.svg rename to site/public/assets/icons/arrow-right.svg diff --git a/site/public/icons/chevron-down.svg b/site/public/assets/icons/chevron-down.svg similarity index 100% rename from site/public/icons/chevron-down.svg rename to site/public/assets/icons/chevron-down.svg diff --git a/site/src/app/[lang]/IntlProvider.tsx b/site/src/app/[domain]/[language]/IntlProvider.tsx similarity index 100% rename from site/src/app/[lang]/IntlProvider.tsx rename to site/src/app/[domain]/[language]/IntlProvider.tsx diff --git a/site/src/app/[lang]/[[...path]]/layout.tsx b/site/src/app/[domain]/[language]/[[...path]]/layout.tsx similarity index 62% rename from site/src/app/[lang]/[[...path]]/layout.tsx rename to site/src/app/[domain]/[language]/[[...path]]/layout.tsx index d1a4cf15f..5af078bec 100644 --- a/site/src/app/[lang]/[[...path]]/layout.tsx +++ b/site/src/app/[domain]/[language]/[[...path]]/layout.tsx @@ -1,5 +1,4 @@ import { gql, previewParams } from "@comet/cms-site"; -import { domain } from "@src/config"; import { Header } from "@src/layout/header/Header"; import { headerFragment } from "@src/layout/header/Header.fragment"; import { createGraphQLFetch } from "@src/util/graphQLClient"; @@ -12,12 +11,14 @@ export const metadata: Metadata = { title: "Comet Starter", }; -export default async function Layout({ children, params }: PropsWithChildren<{ params: { lang: string } }>) { - // TODO support multiple domains, get domain by Host header - const { scope, previewData } = (await previewParams()) || { scope: { domain, language: params.lang }, previewData: undefined }; - const graphQLFetch = createGraphQLFetch(previewData); +export default async function Layout({ + children, + params: { domain, language }, +}: PropsWithChildren<{ params: { domain: string; language: string } }>) { + const { previewData } = (await previewParams()) || { previewData: undefined }; + const graphqlFetch = createGraphQLFetch(previewData); - const { header } = await graphQLFetch( + const { header } = await graphqlFetch( gql` query Layout($domain: String!, $language: String!) { header: mainMenu(scope: { domain: $domain, language: $language }) { @@ -27,7 +28,7 @@ export default async function Layout({ children, params }: PropsWithChildren<{ p ${headerFragment} `, - { domain: scope.domain, language: scope.language }, + { domain, language }, ); return ( diff --git a/site/src/app/[lang]/[[...path]]/page.tsx b/site/src/app/[domain]/[language]/[[...path]]/page.tsx similarity index 68% rename from site/src/app/[lang]/[[...path]]/page.tsx rename to site/src/app/[domain]/[language]/[[...path]]/page.tsx index 2fc2053fc..49e470f5e 100644 --- a/site/src/app/[lang]/[[...path]]/page.tsx +++ b/site/src/app/[domain]/[language]/[[...path]]/page.tsx @@ -1,5 +1,4 @@ import { gql, previewParams } from "@comet/cms-site"; -import { domain, languages } from "@src/config"; import { documentTypes } from "@src/documents"; import { GQLPageTreeNodeScopeInput } from "@src/graphql.generated"; import { createGraphQLFetch } from "@src/util/graphQLClient"; @@ -16,18 +15,15 @@ const documentTypeQuery = gql` } `; -export default async function Page({ params }: { params: { path: string[]; lang: string } }) { - // TODO support multiple domains, get domain by Host header - const { scope, previewData } = (await previewParams()) || { scope: { domain, language: params.lang }, previewData: undefined }; - const graphqlFetch = createGraphQLFetch(previewData); +export default async function Page({ params: { path, domain, language } }: { params: { path: string[]; domain: string; language: string } }) { + const scope = { domain, language }; - if (!languages.includes(params.lang)) { - notFound(); - } + const { previewData } = (await previewParams()) || { previewData: undefined }; + const graphqlFetch = createGraphQLFetch(previewData); //fetch documentType const data = await graphqlFetch(documentTypeQuery, { - path: `/${(params.path ?? []).join("/")}`, + path: `/${(path ?? []).join("/")}`, scope: scope as GQLPageTreeNodeScopeInput, //TODO fix type, the scope from previewParams() is not compatible with GQLPageTreeNodeScopeInput }); @@ -39,8 +35,9 @@ export default async function Page({ params }: { params: { path: string[]; lang: const props = { pageTreeNodeId, - scope: scope as GQLPageTreeNodeScopeInput, //TODO fix type, the scope from previewParams() is not compatible with GQLPageTreeNodeScopeInput, + scope, }; + const { component: Component } = documentTypes[data.pageTreeNodeByPath.documentType]; return ; diff --git a/site/src/app/[domain]/[language]/layout.tsx b/site/src/app/[domain]/[language]/layout.tsx new file mode 100644 index 000000000..cc00f13de --- /dev/null +++ b/site/src/app/[domain]/[language]/layout.tsx @@ -0,0 +1,20 @@ +import { IntlProvider } from "@src/app/[domain]/[language]/IntlProvider"; +import { readFile } from "fs/promises"; + +const messagesCache: Record = {}; +async function loadMessages(language: string) { + if (messagesCache[language]) return messagesCache[language]; + const path = `./lang-compiled/${language}.json`; + const messages = JSON.parse(await readFile(path, "utf8")); + messagesCache[language] = messages; + return messages; +} + +export default async function Page({ children, params: { language } }: { children: React.ReactNode; params: { language: string } }) { + const messages = await loadMessages(language); + return ( + + {children} + + ); +} diff --git a/site/src/app/page.tsx b/site/src/app/[domain]/page.tsx similarity index 100% rename from site/src/app/page.tsx rename to site/src/app/[domain]/page.tsx diff --git a/site/src/app/sitemap.ts b/site/src/app/[domain]/sitemap.ts similarity index 87% rename from site/src/app/sitemap.ts rename to site/src/app/[domain]/sitemap.ts index 5a7f604b6..c5e50330c 100644 --- a/site/src/app/sitemap.ts +++ b/site/src/app/[domain]/sitemap.ts @@ -1,5 +1,5 @@ import { gql } from "@comet/cms-site"; -import { domain, languages } from "@src/config"; +import { getSiteConfig } from "@src/middleware"; import { createGraphQLFetch } from "@src/util/graphQLClient"; import { MetadataRoute } from "next"; @@ -11,8 +11,11 @@ export default async function sitemap(): Promise { const sitemap: MetadataRoute.Sitemap = []; const graphqlFetch = createGraphQLFetch(); - for (const lang of languages) { - const scope = { domain, language: lang }; + const siteConfig = await getSiteConfig(); + + for (const language of siteConfig.languages) { + const domain = siteConfig.domain; + const scope = { domain, language }; let totalCount = 0; let currentCount = 0; @@ -37,7 +40,7 @@ export default async function sitemap(): Promise { const seoBlock = pageTreeNode.document.seo; if (!seoBlock.noIndex) { sitemap.push({ - url: `${process.env.SITE_URL}/${lang}${pageTreeNode.path}`, // TODO support multiple site domains + url: `${siteConfig.url}/${scope.language}${pageTreeNode.path}`, priority: Number(seoBlock.priority.replace("_", ".")), changeFrequency: seoBlock.changeFrequency, lastModified: pageTreeNode.document.updatedAt, diff --git a/site/src/app/[lang]/layout.tsx b/site/src/app/[lang]/layout.tsx deleted file mode 100644 index 454786c2c..000000000 --- a/site/src/app/[lang]/layout.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { readFile } from "fs/promises"; - -import { IntlProvider } from "./IntlProvider"; - -const messagesCache: Record = {}; -async function loadMessages(lang: string) { - if (messagesCache[lang]) return messagesCache[lang]; - const path = `./lang-compiled/${lang}.json`; - const messages = JSON.parse(await readFile(path, "utf8")); - messagesCache[lang] = messages; - return messages; -} - -export default async function Page({ children, params }: { children: React.ReactNode; params: { lang: string } }) { - const messages = await loadMessages(params.lang); - - return ( - - {children} - - ); -} diff --git a/site/src/app/layout.tsx b/site/src/app/layout.tsx index 2ae527422..482494516 100644 --- a/site/src/app/layout.tsx +++ b/site/src/app/layout.tsx @@ -1,21 +1,30 @@ +import { SitePreviewProvider } from "@comet/cms-site"; import { GlobalStyle } from "@src/layout/GlobalStyle"; import { ResponsiveSpacingStyle } from "@src/util/ResponsiveSpacingStyle"; import StyledComponentsRegistry from "@src/util/StyledComponentsRegistry"; import type { Metadata } from "next"; -import { ReactNode } from "react"; +import { draftMode } from "next/headers"; +import { PublicEnvScript } from "next-runtime-env"; export const metadata: Metadata = { title: "Comet Starter", }; -export default function RootLayout({ children }: Readonly<{ children: ReactNode }>) { +export default async function RootLayout({ + children, +}: Readonly<{ + children: React.ReactNode; +}>) { return ( + + + - {children} + {draftMode().isEnabled ? {children} : children} diff --git a/site/src/common/blocks/AccordionItemBlock.tsx b/site/src/common/blocks/AccordionItemBlock.tsx index 64a856077..88954dcf6 100644 --- a/site/src/common/blocks/AccordionItemBlock.tsx +++ b/site/src/common/blocks/AccordionItemBlock.tsx @@ -41,7 +41,7 @@ export const AccordionItemBlock = withPreview( setIsExpanded(!isExpanded)} aria-label={ariaLabelText}> {title} - + diff --git a/site/src/config.ts b/site/src/config.ts index fb13755ca..e83c28d58 100644 --- a/site/src/config.ts +++ b/site/src/config.ts @@ -1,3 +1,22 @@ -// TODO replace with site config -export const domain = "main"; -export const languages = ["en", "de"]; +import { env } from "next-runtime-env"; + +import { PublicSiteConfig as SiteConfig } from "../../site-configs.d"; + +export type { SiteConfig }; + +export function getSiteConfigForDomain(domainParam: string) { + const domain = decodeURIComponent(domainParam); + const siteConfig = getSiteConfigs().find((siteConfig) => siteConfig.domain === domain); + if (!siteConfig) throw new Error(`SiteConfig not found for domain ${domain}`); + return siteConfig; +} + +let siteConfigs: SiteConfig[]; +export function getSiteConfigs() { + if (!siteConfigs) { + const json = typeof window === "undefined" ? process.env.NEXT_PUBLIC_SITE_CONFIGS : env("NEXT_PUBLIC_SITE_CONFIGS"); + if (!json) throw new Error("process.env.NEXT_PUBLIC_SITE_CONFIGS must be set."); + siteConfigs = JSON.parse(json) as SiteConfig[]; + } + return siteConfigs; +} diff --git a/site/src/documents/pages/blocks/TeaserItemBlock.tsx b/site/src/documents/pages/blocks/TeaserItemBlock.tsx index 283d47364..520db52f1 100644 --- a/site/src/documents/pages/blocks/TeaserItemBlock.tsx +++ b/site/src/documents/pages/blocks/TeaserItemBlock.tsx @@ -28,7 +28,7 @@ export const TeaserItemBlock = withPreview( - + {link.text} diff --git a/site/src/layout/header/Header.tsx b/site/src/layout/header/Header.tsx index b0e9aacbd..9cdcc8d04 100644 --- a/site/src/layout/header/Header.tsx +++ b/site/src/layout/header/Header.tsx @@ -13,7 +13,7 @@ interface Props { function Header({ header }: Props): JSX.Element { return ( - +