Commit 2839abdd authored by Tim Neutkens's avatar Tim Neutkens

Update

parent fbfbb400
......@@ -6,31 +6,31 @@ export const typeDefs = gql`
email: String!
createdAt: Int!
}
input SignUpInput {
email: String!
password: String!
}
input SignInInput {
email: String!
password: String!
}
type SignUpPayload {
user: User!
}
type SignInPayload {
user: User!
}
type Query {
user(id: ID!): User!
users: [User]!
viewer: User
}
type Mutation {
signUp(input: SignUpInput!): SignUpPayload!
signIn(input: SignInInput!): SignInPayload!
......
......@@ -6,7 +6,7 @@ export const typeDefs = gql`
name: String!
status: String!
}
type Query {
viewer: User
}
......
......@@ -18,9 +18,9 @@ export default function LandingPageSection({ type, sectionData }) {
),
two_column_with_image: dynamic(
() =>
import(
"@/components/landing-page-sections/two-column-with-image"
).catch(() => () => MissingSection),
import("@/components/landing-page-sections/two-column-with-image").catch(
() => () => MissingSection,
),
{
loading: Preloader,
},
......
......@@ -36,7 +36,11 @@ export const Media: React.FC<Props> = (props) => {
: {})}
>
{
isVideo ? <Video {...props} /> : <Image {...props} /> // eslint-disable-line
isVideo ? (
<Video {...props} />
) : (
<Image {...props} /> // eslint-disable-line
)
}
</Tag>
);
......
......@@ -89,7 +89,6 @@ Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&ut
- WPGraphQL for ACF (optional)
6. Do first-time install of Redirection. Recommended to enable monitor of changes
7. Configure Yoast SEO with:
- Disable XML Sitemaps under Yoast SEO -> Settings
- If you did not change the `Site Address (URL)` before installing Yoast, it will ask you to run optimize SEO data after changing permalinks, do so
- Generate a robots.txt file under Yoast SEO -> Tools -> File Editor
......@@ -119,7 +118,7 @@ Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&ut
| `NEXT_PUBLIC_BASE_URL` | Insert base url of frontend | http://localhost:3000 | Used for generating sitemap, redirects etc. |
| `NEXT_PUBLIC_WORDPRESS_API_URL` | Insert base url of your WordPress installation | http://wp-domain.com | Used when requesting wordpress for data |
| `NEXT_PUBLIC_WORDPRESS_API_HOSTNAME` | The hostname without protocol for your WordPress installation | wp-domain.com | Used for dynamically populating the next.config images remotePatterns |
| `HEADLESS_SECRET` | Insert the same random key, that you generated for your `wp-config.php` | INSERT_RANDOM_SECRET_KEY | Used for public exchanges between frontend and backend |
| `HEADLESS_SECRET` | Insert the same random key, that you generated for your `wp-config.php` | INSERT_RANDOM_SECRET_KEY | Used for public exchanges between frontend and backend |
| `WP_USER` | Insert a valid WordPress username | username | Username for a system user created specifically for interacting with your WordPress installation |
| `WP_APP_PASS` | Insert application password | 1234 5678 abcd efgh | [Generate an application password](https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/) for the WordPress user defined in `WP_USER` |
......
......@@ -89,5 +89,4 @@ To deploy your local project to Vercel, push it to GitHub/GitLab/Bitbucket and [
- When you import your project on Vercel, make sure to click on **Environment Variables** and set the keys to match your `.env.local` file.
- For a cloud deployment on Vercel, the **Environment Variables** values will need to **correspond to a cloud instance of Couchbase** (localhost will **NOT** connect from a remote server such as Vercel). Find info on [getting started with Couchbase cloud](https://developer.couchbase.com/tutorial-cloud-getting-started/).
- _Important:_ you will have to allowlist 0.0.0.0/0 as the IP address, since Vercel's serverless deployments use [dynamic IP addresses](https://vercel.com/docs/solutions/databases#allowing-&-blocking-ip-addresses)
......@@ -25,14 +25,16 @@ bun create next-app --example with-docker nextjs-docker
## Using Docker
1. [Install Docker](https://docs.docker.com/get-docker/) on your machine.
1. Build your container:
```bash
# For npm, pnpm or yarn
docker build -t nextjs-docker .
# For bun
docker build -f Dockerfile.bun -t nextjs-docker .
```
1. Build your container:
```bash
# For npm, pnpm or yarn
docker build -t nextjs-docker .
# For bun
docker build -f Dockerfile.bun -t nextjs-docker .
```
1. Run your container: `docker run -p 3000:3000 nextjs-docker`.
You can view your images created with `docker images`.
......@@ -58,7 +60,6 @@ This will build the project as a standalone app inside the Docker image.
1. [Create a new project](https://cloud.google.com/run/docs/quickstarts/build-and-deploy) in Google Cloud Run (e.g. `nextjs-docker`). Ensure billing is turned on.
1. Build your container image using Cloud Build: `gcloud builds submit --tag gcr.io/PROJECT-ID/helloworld --project PROJECT-ID`. This will also enable Cloud Build for your project.
1. Deploy to Cloud Run: `gcloud run deploy --image gcr.io/PROJECT-ID/helloworld --project PROJECT-ID --platform managed --allow-unauthenticated`. Choose a region of your choice.
- You will be prompted for the service name: press Enter to accept the default name, `helloworld`.
- You will be prompted for [region](https://cloud.google.com/run/docs/quickstarts/build-and-deploy#follow-cloud-run): select the region of your choice, for example `us-central1`.
......
import { useGraphQL } from "graphql-react";
export default function IndexPage() {
const {
loading,
cacheValue: { data } = {},
} = useGraphQL({
const { loading, cacheValue: { data } = {} } = useGraphQL({
fetchOptionsOverride(options) {
options.url = "https://graphql-pokemon.vercel.app";
},
......
/** @type {import('next').NextConfig} */
module.exports = {
/* this needs to be set to false until a bug in the compression npm module gets fixed.
/* this needs to be set to false until a bug in the compression npm module gets fixed.
reference: https://github.com/expressjs/compression/issues/122
*/
compress: false,
......
......@@ -16,8 +16,9 @@ type ToReact<T> = {
declare global {
export namespace JSX {
interface IntrinsicElements
extends ToReact<IonicIntrinsicElements & IoniconsIntrinsicElements> {
interface IntrinsicElements extends ToReact<
IonicIntrinsicElements & IoniconsIntrinsicElements
> {
key?: string;
}
}
......
......@@ -34,7 +34,6 @@ pnpm create next-app --example with-oxlint with-oxlint-app
## Linting the application
```bash
npm run lint
```
......
......@@ -2,9 +2,7 @@ import { useUser, fetcher } from "../lib/hooks";
import useSWR from "swr";
function UserList() {
const {
data: { users } = {},
} = useSWR("/api/users", fetcher);
const { data: { users } = {} } = useSWR("/api/users", fetcher);
return (
<>
<h2>All users</h2>
......
......@@ -2,7 +2,8 @@ import React, { ReactElement, AnchorHTMLAttributes } from "react";
import Link, { LinkProps } from "next/link";
export interface LinkUnstyledProps
extends Omit<LinkProps, "children" | "onError">,
extends
Omit<LinkProps, "children" | "onError">,
Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "onError" | "href"> {}
export default function LinkUnstyled({
......
......@@ -26,8 +26,7 @@ export namespace Components {
declare global {
interface HTMLMyComponentElement
extends Components.MyComponent,
HTMLStencilElement {}
extends Components.MyComponent, HTMLStencilElement {}
var HTMLMyComponentElement: {
prototype: HTMLMyComponentElement;
new (): HTMLMyComponentElement;
......
......@@ -75,16 +75,17 @@ If you wish to just develop locally and not deploy to Vercel, [follow the steps
4. Rename `.env.example` to `.env.local` and update the following:
```env
NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=[INSERT SUPABASE PROJECT API PUBLISHABLE OR ANON KEY]
```
> [!NOTE]
> This example uses `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`, which refers to Supabase's new **publishable** key format.
> Both legacy **anon** keys and new **publishable** keys can be used with this variable name during the transition period. Supabase's dashboard may show `NEXT_PUBLIC_SUPABASE_ANON_KEY`; its value can be used in this example.
> See the [full announcement](https://github.com/orgs/supabase/discussions/29260) for more information.
Both `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` can be found in [your Supabase project's API settings](https://supabase.com/dashboard/project/_?showConnect=true)
```env
NEXT_PUBLIC_SUPABASE_URL=[INSERT SUPABASE PROJECT URL]
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY=[INSERT SUPABASE PROJECT API PUBLISHABLE OR ANON KEY]
```
> [!NOTE]
> This example uses `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY`, which refers to Supabase's new **publishable** key format.
> Both legacy **anon** keys and new **publishable** keys can be used with this variable name during the transition period. Supabase's dashboard may show `NEXT_PUBLIC_SUPABASE_ANON_KEY`; its value can be used in this example.
> See the [full announcement](https://github.com/orgs/supabase/discussions/29260) for more information.
Both `NEXT_PUBLIC_SUPABASE_URL` and `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` can be found in [your Supabase project's API settings](https://supabase.com/dashboard/project/_?showConnect=true)
5. You can now run the Next.js local development server:
......
......@@ -24,7 +24,8 @@ const badgeVariants = cva(
);
export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
extends
React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}
function Badge({ className, variant, ...props }: BadgeProps) {
......
......@@ -35,7 +35,8 @@ const buttonVariants = cva(
);
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
extends
React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
}
......
......@@ -4,8 +4,10 @@ import { type PropsWithChildren, useRef } from "react";
import type { StoreInterface, StoreType } from "./store";
import { initializeStore, Provider } from "./store";
export interface PreloadedStoreInterface
extends Pick<StoreInterface, "lastUpdate"> {}
export interface PreloadedStoreInterface extends Pick<
StoreInterface,
"lastUpdate"
> {}
export default function StoreProvider({
children,
......
......@@ -26,7 +26,9 @@ export default async function Page() {
<h1 id="title">revalidate</h1>
<p>
{' '}
revalidate (tags: thankyounext): <span id="thankyounext">{data}</span>{' '}
revalidate (tags: thankyounext): <span id="thankyounext">
{data}
</span>{' '}
<span>
<Link href="/revalidate-2" id="another">
/revalidate-2
......
......@@ -2,20 +2,18 @@ import { ImageResponse } from 'next/og'
export default function og() {
return new ImageResponse(
(
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 128,
background: 'lavender',
}}
>
Open Graph
</div>
)
<div
style={{
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 128,
background: 'lavender',
}}
>
Open Graph
</div>
)
}
......@@ -17,22 +17,20 @@ export default async function Icon() {
const letter = await fetchIconLetter()
return new ImageResponse(
(
<div
style={{
fontSize: 24,
background: 'black',
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
}}
>
{letter}
</div>
),
<div
style={{
fontSize: 24,
background: 'black',
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'white',
}}
>
{letter}
</div>,
{ ...size }
)
}
......@@ -14,25 +14,23 @@ export default async function Image() {
const post = await fetchPostData()
return new ImageResponse(
(
<div
style={{
fontSize: 48,
background: 'white',
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<h1>{post.title}</h1>
<p style={{ fontSize: 32 }}>
{new Date(post.created).toLocaleTimeString()}
</p>
</div>
),
<div
style={{
fontSize: 48,
background: 'white',
width: '100%',
height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
}}
>
<h1>{post.title}</h1>
<p style={{ fontSize: 32 }}>
{new Date(post.created).toLocaleTimeString()}
</p>
</div>,
size
)
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment