Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ process.yml
.env
.env.*
!.env.local.sample
!.env.local.example
build/
faustjs.code-workspace
plugins/faustwp/.docker/plugins/akismet/
Expand Down
5 changes: 5 additions & 0 deletions examples/next/tutorial/.env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Your WordPress site URL
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8881

# Plugin secret found in WordPress Settings->Faust
FAUST_SECRET_KEY=
3 changes: 3 additions & 0 deletions examples/next/tutorial/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Learn Faust.js

Next.js app to be used with the [Learn Faust tutorial](https://faustjs.org/docs/tutorial/learn-faust/).
14 changes: 14 additions & 0 deletions examples/next/tutorial/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

const eslintConfig = [...compat.extends("next/core-web-vitals")];

export default eslintConfig;
20 changes: 20 additions & 0 deletions examples/next/tutorial/faust-tutorial-blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"meta": {
"title": "Tutorial: Learn Faust.js",
"description": "Example site to use when learning how to work with Faust.js to build a headless WordPress site with Next.js.",
"author": "wpengine",
"categories": ["API", "wpgraphql", "Faust", "headless"]
},
"siteOptions": {
"blogname": "Learn Faust.js"
},
"landingPage": "/wp-admin/plugins.php",
"plugins": ["wp-graphql", "faustwp"],
"steps": [
{
"step": "login",
"username": "admin"
}
]
}
11 changes: 11 additions & 0 deletions examples/next/tutorial/faust.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import templates from "./src/wp-templates/index";
import possibleTypes from "./possibleTypes.json";
import { setConfig } from "@faustwp/core";

/**
* @type {import('@faustwp/core').FaustConfig}
**/
export default setConfig({
templates,
possibleTypes,
});
7 changes: 7 additions & 0 deletions examples/next/tutorial/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
6 changes: 6 additions & 0 deletions examples/next/tutorial/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
};

export default nextConfig;
Loading
Loading