Skip to content

chore: Tidy up examples #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
499ca6c
Moved examples for previews under "/examples" in the plugin directory…
colinmurphy Jun 30, 2025
beed62d
Fixed vendor directory for previews.
colinmurphy Jun 30, 2025
d94e6c6
Fix for e2e tests.
colinmurphy Jun 30, 2025
7c6ac68
Remove __MACOSX directory
colinmurphy Jul 1, 2025
7681502
Moved webhooks example under the plugin.
colinmurphy Jul 1, 2025
d38f637
Updated .gitignore to renove uplaods.zip rather than uploads and star…
colinmurphy Jul 1, 2025
e968d34
chore: cleanup part 1
ahuseyn Jul 1, 2025
168e277
chore: custom-sitemap-apollo update
ahuseyn Jul 1, 2025
a8a502e
chore: clean up part 2
ahuseyn Jul 1, 2025
d59b4c7
chore: cleanup part 3
ahuseyn Jul 1, 2025
008b60e
Merge branch 'main' into chore-update-examples-iteration-1
colinmurphy Jul 1, 2025
bd3a1c5
fix: instructions and styles fix for proxied-graphql-debug
ahuseyn Jul 2, 2025
e4d072e
chore: cleanup after tests
ahuseyn Jul 3, 2025
b969cf2
Updated ACF version.
colinmurphy Jul 4, 2025
369a58f
docs: update examples readme, add best practices guide
ahuseyn Jul 4, 2025
165c61a
fix: nuxt example package and wp-env fixes
ahuseyn Jul 4, 2025
4be9f93
Merge branch 'chore-update-examples-iteration-1' of https://github.co…
ahuseyn Jul 4, 2025
6ab32de
Merge branch 'main' into chore-update-examples-iteration-1
ahuseyn Jul 8, 2025
0f0bf5d
Merge branch 'main' into chore-update-examples-iteration-1
colinmurphy Jul 9, 2025
ede4bd5
fix: update .gitignore, bring uploads.zip back, ignore uploads folder
ahuseyn Jul 11, 2025
72413fd
fix: apollo-client-data-fetch uploads.zip add
ahuseyn Jul 11, 2025
91fabb5
fix: apollo-client-filesystem-routing uploads.zip add
ahuseyn Jul 11, 2025
f1b7baf
fix: client-app-router-fetch-data uploads.zip add
ahuseyn Jul 11, 2025
929d39e
fix: custom-sitemap-apollo uploads.zip add
ahuseyn Jul 11, 2025
a8bc9b3
fix: custom-sitemap-vanilla-wpgraphql uploads.zip add
ahuseyn Jul 11, 2025
e89642a
fix: client-multisite-app-router-fetch-data uploads.zip add
ahuseyn Jul 11, 2025
a54c707
fix: template-hierarchy-data-fetching-urql uploads.zip add
ahuseyn Jul 11, 2025
da28655
Merge pull request #334 from wpengine/chore-update-examples-iteration-2
ahuseyn Jul 11, 2025
a945c49
chore: remove uploads from plugin examples
ahuseyn Jul 11, 2025
63b7396
fix: fix .gitignore to preserve example .sql files
ahuseyn Jul 11, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
cache: "npm"

- name: Install dependencies
run: npm ci
run: npm install

- name: Setup PHP with Cached Composer
uses: ./.github/actions/setup-php-composer
Expand Down
410 changes: 0 additions & 410 deletions examples/next/hwp-preview-rest/wp-env/db/database.sql

This file was deleted.

410 changes: 0 additions & 410 deletions examples/next/hwp-preview-wpgraphql/wp-env/db/database.sql

This file was deleted.

53 changes: 26 additions & 27 deletions plugins/hwp-previews/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,36 +72,35 @@
"archive": {
"name": "hwp-previews",
"exclude": [
"/.*",
"bin",
"docker",
"docs",
"phpstan",
"phpcs",
"plugin-build",
"tests",
"!vendor",
"!vendor-prefixed",
"/docker-compose.yml",
"/phpstan.neon.dist",
"/psalm.xml",
"/phpcs.xml",
"/.DS_Store",
"/.docker/",
"/.env.dist",
"/ACTIONS_AND_FILTERS.md",
"/phpcs-cache.json",
"/TESTING.md",
"/Thumbs.db",
"/artifacts",
"/auth.json",
"/.DS_Store",
".docker/",
".env.dist",
"c3.php",
"codeception.dist.yml",
"tests",
"artifacts",
"package.json",
"package-lock.json",
"node_modules/",
"/TESTING.md",
"/screenshots"
"/bin",
"/c3.php",
"/codeception.dist.yml",
"/docker",
"/docker-compose.yml",
"/docs",
"/examples",
"/node_modules",
"/package-lock.json",
"/package.json",
"/phpcs",
"/phpcs-cache.json",
"/phpcs.xml",
"/phpstan",
"/phpstan.neon.dist",
"/plugin-build",
"/psalm.xml",
"/screenshots",
"/tests",
"!vendor",
"!vendor-prefixed"
]
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Example: Headless WordPress Previews with Nextjs App Router and REST API

> [!NOTE]
> Check out [HWP Previews WPGraphQL example](https://github.com/wpengine/hwptoolkit/tree/main/examples/next/hwp-preview-wpgraphql) if you need the previews implementation with Nextjs pages router, Draft Mode or WordPress Application Passwords.
> Check out [HWP Previews WPGraphQL example](../hwp-preview-wpgraphql) if you need the previews implementation with Nextjs pages router, Draft Mode or WordPress Application Passwords.

## Overview

The purpose of this example is to showcase different use cases of HWP Previews. The example demonstrates the usage of [HWP Previews](https://github.com/wpengine/hwptoolkit/tree/main/plugins/hwp-previews) with Nextjs App Router and REST API. Example uses credentials authentication to fetch the posts in draft status. Unlike [HWP Previews WPGraphQL example](https://github.com/wpengine/hwptoolkit/tree/main/examples/next/hwp-preview-wpgraphql) this example don't use [Draft Mode](https://nextjs.org/docs/pages/guides/draft-mode).
The purpose of this example is to showcase different use cases of HWP Previews. The example demonstrates the usage of [HWP Previews](https://github.com/wpengine/hwptoolkit/tree/main/plugins/hwp-previews) with Nextjs App Router and REST API. Example uses credentials authentication to fetch the posts in draft status. Unlike [HWP Previews WPGraphQL example](../hwp-preview-wpgraphql) this example don't use [Draft Mode](https://nextjs.org/docs/pages/guides/draft-mode).

The example includes a wp-env setup, which will allow you to build and start this example quickly. With this wp-env setup, you don't need to have a separate WordPress instance or demo data to inspect the example.

Expand Down Expand Up @@ -80,6 +80,7 @@ Congratulations, WordPress should now be fully set up.

Create a .env file under `examples/next/hwp-preview-rest/example-app` and add copy-paste the environment variable below:


```bash
NEXT_PUBLIC_WORDPRESS_URL=http://localhost:8888
```
Expand Down
Loading
Loading