-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1546 from wpengine/canary
Sync `canary` -> `main`
- Loading branch information
Showing
101 changed files
with
20,376 additions
and
9,942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ runs: | |
# Remove this when the issue has been resolved. | ||
- uses: ArtiomTr/[email protected] | ||
with: | ||
# tell to the action to not attach comment. | ||
output: report-markdown | ||
test-script: npm run test:coverage:ci | ||
working-directory: ${{ inputs.working-directory }} | ||
annotations: none | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
pull_request: | ||
push: | ||
branches: | ||
- canary | ||
- 'canary' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Your WordPress site URL | ||
NEXT_PUBLIC_WORDPRESS_URL=https://faustexample.wpengine.com | ||
|
||
# Plugin secret found in WordPress Settings->Faust | ||
# FAUST_SECRET_KEY=YOUR_PLUGIN_SECRET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// import { fetchAccessToken } from "@/faust/auth/fetchAccessToken"; | ||
// import { getAuthClient, getClient } from "@/faust/client"; | ||
// import { isPreviewMode } from "@/faust/previews"; | ||
import { getClient } from '@faustwp/experimental-app-router'; | ||
import { gql } from '@apollo/client'; | ||
|
||
export default async function Page(props) { | ||
const postSlug = props.params.postSlug; | ||
|
||
// Depending on if isPreview or not use the auth client or regular client | ||
let client = getClient(); | ||
|
||
const { data } = await client.query({ | ||
query: gql` | ||
query GetPost($postSlug: ID!) { | ||
post(id: $postSlug, idType: SLUG) { | ||
title | ||
content | ||
date | ||
} | ||
} | ||
`, | ||
variables: { | ||
postSlug, | ||
}, | ||
}); | ||
|
||
return ( | ||
<main> | ||
<h2>{data?.post?.title}</h2> | ||
<div dangerouslySetInnerHTML={{ __html: data?.post?.content ?? '' }} /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { gql } from '@apollo/client'; | ||
import { getClient } from '@faustwp/experimental-app-router'; | ||
import Link from 'next/link'; | ||
/** | ||
* For now, we will manually call the Faust config as we have not yet determined | ||
* how we want to set the config (Currently in Faust we call it in the [wordPressNode] file). | ||
* | ||
* @todo | ||
*/ | ||
import '../faust.config.js'; | ||
|
||
export const metadata = { | ||
title: 'Create Next App', | ||
description: 'Generated by create next app', | ||
}; | ||
|
||
export default async function RootLayout({ children }) { | ||
const client = getClient(); | ||
|
||
const { data } = await client.query({ | ||
query: gql` | ||
query GetLayout { | ||
generalSettings { | ||
title | ||
description | ||
} | ||
primaryMenuItems: menuItems(where: { location: PRIMARY }) { | ||
nodes { | ||
id | ||
label | ||
uri | ||
} | ||
} | ||
footerMenuItems: menuItems(where: { location: FOOTER }) { | ||
nodes { | ||
id | ||
label | ||
uri | ||
} | ||
} | ||
} | ||
`, | ||
}); | ||
|
||
return ( | ||
<html lang="en"> | ||
<body> | ||
<header> | ||
<div> | ||
<h1> | ||
<Link href="/">{data.generalSettings.title}</Link> | ||
</h1> | ||
|
||
<h5>{data.generalSettings.description}</h5> | ||
</div> | ||
|
||
<ul> | ||
{data.primaryMenuItems.nodes.map((node) => ( | ||
<li> | ||
<Link href={node.uri}>{node.label}</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</header> | ||
{children} | ||
</body> | ||
</html> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { getClient } from '@faustwp/experimental-app-router'; | ||
import { gql } from '@apollo/client'; | ||
import Link from 'next/link'; | ||
|
||
export default async function Home() { | ||
let client = getClient(); | ||
|
||
const { data } = await client.query({ | ||
query: gql` | ||
query GetPosts { | ||
posts { | ||
nodes { | ||
id | ||
title | ||
uri | ||
slug | ||
} | ||
} | ||
} | ||
`, | ||
}); | ||
|
||
return ( | ||
<main> | ||
<h2>Posts</h2> | ||
<ul> | ||
{data.posts.nodes.map((post) => ( | ||
<li> | ||
<Link href={`/${post.slug}`}>{post.title}</Link> | ||
</li> | ||
))} | ||
</ul> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { setConfig } from '@faustwp/core/dist/cjs/config/index.js'; | ||
import possibleTypes from './possibleTypes.json'; | ||
|
||
/** @type {import('@faustwp/core').FaustConfig} */ | ||
export default setConfig({ | ||
possibleTypes, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** @type {import('next').NextConfig} */ | ||
export default { | ||
experimental: { | ||
appDir: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "@faustwp/app-router-example", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "faust dev", | ||
"build": "faust build", | ||
"generate": "faust generatePossibleTypes", | ||
"stylesheet": "faust generateGlobalStylesheet", | ||
"start": "faust start" | ||
}, | ||
"dependencies": { | ||
"@apollo/client": "^3.8.0", | ||
"@faustwp/cli": "1.1.1", | ||
"@faustwp/core": "1.1.1", | ||
"@faustwp/experimental-app-router": "^0.0.2", | ||
"@apollo/experimental-nextjs-app-support": "^0.4.1", | ||
"graphql": "^16.7.1", | ||
"next": "^13.4.13", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"engines": { | ||
"node": ">=16", | ||
"npm": ">=8" | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
cbd764a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the recent updates to your Atlas environment:
Learn more about building on Atlas in our documentation.
cbd764a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check out the recent updates to your Atlas environment:
Learn more about building on Atlas in our documentation.