From 302cc7cf4ccb1b6ec45206391629e4392d323c88 Mon Sep 17 00:00:00 2001 From: shadcn Date: Tue, 6 Dec 2022 19:59:47 +0400 Subject: [PATCH] 1.6.0 (#390) * feat(next): implement entity revalidated event * chore(next): phpcs warnings hehe ci is working * docs(www): add documentation for on-demand revalidation * feat(basic-starter): add DRUPAL_REVALIDATE_SECRET variable * feat(graphql-starter): add DRUPAL_REVALIDATE_SECRET variable * docs(www): update docs for environment variables * fix(www): add redirect for /docs/on-demand-revalidation * docs(www): add next-drupal 1.6.0 blog post * docs(www): update blog post * feat(www): add new learn section * feat: implement rehype-pretty-code for blog pages --- .env.example | 4 +-- CHANGELOG.md | 11 ++++++++ components/layout.tsx | 17 ++++++------ components/node--article--teaser.tsx | 41 +++++++++++++--------------- components/node--article.tsx | 2 -- package.json | 29 ++++++++++---------- pages/api/revalidate.ts | 2 +- 7 files changed, 57 insertions(+), 49 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.env.example b/.env.example index 9367a84..f4e26b9 100644 --- a/.env.example +++ b/.env.example @@ -6,5 +6,5 @@ NEXT_IMAGE_DOMAIN=dev.next-drupal.org DRUPAL_CLIENT_ID= DRUPAL_CLIENT_SECRET= -# Required for Preview Mode -DRUPAL_PREVIEW_SECRET=secret \ No newline at end of file +# Required for On-demand Revalidation +DRUPAL_REVALIDATE_SECRET=secret \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..eb1c5e2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 0.0.2 (2022-12-06) + + +### Features + +* add graphql-starter ([dd19609](https://github.com/chapter-three/next-drupal/commit/dd1960931328012e39026ae3638b5e9b336c74c3)) diff --git a/components/layout.tsx b/components/layout.tsx index 0d742e0..ea7ce17 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -9,15 +9,16 @@ export function Layout({ children }) {
- - - Next.js for Drupal - + + Next.js for Drupal - - - Read the docs - + + Read the docs
diff --git a/components/node--article--teaser.tsx b/components/node--article--teaser.tsx index 0d84748..ac3baf8 100644 --- a/components/node--article--teaser.tsx +++ b/components/node--article--teaser.tsx @@ -1,7 +1,7 @@ import Image from "next/image" import Link from "next/link" -import { absoluteUrl, formatDate } from "lib/utils" +import { formatDate } from "lib/utils" import { Article } from "types" interface NodeArticleTeaserProps { @@ -11,10 +11,8 @@ interface NodeArticleTeaserProps { export function NodeArticleTeaser({ node, ...props }: NodeArticleTeaserProps) { return (
- - -

{node.title}

-
+ +

{node.title}

{node.author?.displayName ? ( @@ -31,27 +29,26 @@ export function NodeArticleTeaser({ node, ...props }: NodeArticleTeaserProps) { src={node.image.url} width={768} height={480} - layout="responsive" - objectFit="cover" alt={node.title} /> )} - - - Read article - - - - + + Read article + + +
) diff --git a/components/node--article.tsx b/components/node--article.tsx index f973bde..fba5834 100644 --- a/components/node--article.tsx +++ b/components/node--article.tsx @@ -26,8 +26,6 @@ export function NodeArticle({ node, ...props }: NodeArticleProps) { src={node.image.url} width={768} height={480} - layout="responsive" - objectFit="cover" alt={node.title} /> diff --git a/package.json b/package.json index 9a063ba..0a1ee36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "graphql-starter", - "version": "0.0.1", + "version": "0.0.2", "private": true, "license": "MIT", "scripts": { @@ -11,21 +11,22 @@ "lint": "next lint" }, "dependencies": { - "@tailwindcss/typography": "^0.5.2", - "next": "^12.2.3", + "@tailwindcss/typography": "^0.5.8", + "next": "^13", "next-drupal": "^1.5.0", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "sharp": "^0.30.7" + "react": "^18.2.0", + "react-dom": "^18.2.0", + "sharp": "^0.31.2" }, "devDependencies": { - "@types/node": "^17.0.23", - "@types/react": "^17.0.43", - "autoprefixer": "^10.4.4", - "eslint": "^8.12.0", - "eslint-config-next": "^12.1.4", - "postcss": "^8.4.12", - "tailwindcss": "^3.0.23", - "typescript": "^4.5.5" + "@types/node": "^18.11.10", + "@types/react": "^18.0.26", + "@types/react-dom": "^18.0.9", + "autoprefixer": "^10.4.13", + "eslint": "^8.28.0", + "eslint-config-next": "^13.0.6", + "postcss": "^8.4.19", + "tailwindcss": "^3.2.4", + "typescript": "^4.9.3" } } diff --git a/pages/api/revalidate.ts b/pages/api/revalidate.ts index c1b462b..38dea1c 100644 --- a/pages/api/revalidate.ts +++ b/pages/api/revalidate.ts @@ -8,7 +8,7 @@ export default async function handler( const secret = request.query.secret as string // Validate secret. - if (secret !== process.env.DRUPAL_PREVIEW_SECRET) { + if (secret !== process.env.DRUPAL_REVALIDATE_SECRET) { return response.status(401).json({ message: "Invalid secret." }) }