Skip to content

Commit 56ebe4f

Browse files
authored
Merge pull request #135 from wpengine/wp-env-backport-nextjs-apollo-filesystem-routing
chore: wp-env backport nextjs apollo filesystem routing
2 parents 1a584cc + 0b160cc commit 56ebe4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+608
-5581
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
example-app/package-lock.json
2+
package-lock.json
3+
wp-env/__MACOSX
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"phpVersion": "7.4",
3+
"plugins": [
4+
"https://github.com/wp-graphql/wp-graphql/releases/latest/download/wp-graphql.zip",
5+
"https://github.com/AdvancedCustomFields/acf/releases/download/6.3.12/advanced-custom-fields-6.3.12.zip",
6+
"https://github.com/wp-graphql/wpgraphql-acf/releases/latest/download/wpgraphql-acf.zip"
7+
],
8+
"config": {
9+
"WP_DEBUG": true,
10+
"SCRIPT_DEBUG": false,
11+
"GRAPHQL_DEBUG": true,
12+
"WP_DEBUG_LOG": true,
13+
"WP_DEBUG_DISPLAY": false,
14+
"SAVEQUERIES": false
15+
},
16+
"mappings": {
17+
"db": "./wp-env/db",
18+
"wp-content/uploads": "./wp-env/uploads",
19+
".htaccess": "./wp-env/setup/.htaccess"
20+
},
21+
"lifecycleScripts": {
22+
"afterStart": "wp-env run cli -- wp plugin update wpgraphql-acf && wp-env run cli -- wp rewrite structure '/posts/%postname%/' && wp-env run cli -- wp rewrite flush"
23+
}
24+
}

examples/nextjs-pages-router/apollo-client-filesystem-routing/.gitignore renamed to examples/next/apollo-client-filesystem-routing/example-app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ yarn-error.log*
3939
# typescript
4040
*.tsbuildinfo
4141
next-env.d.ts
42+
package-lock.json

examples/nextjs-pages-router/apollo-client-filesystem-routing/package.json renamed to examples/next/apollo-client-filesystem-routing/example-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "apollo-client-filesystem-routing",
2+
"name": "apollo-client-filesystem-routing-example-app",
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "apollo-client-filesystem-routing",
3+
"version": "1.0.0",
4+
"description": "A Next.js project integrated with WPGraphQL and WPGraphQL for ACF to build a headless WordPress-powered site.",
5+
"scripts": {
6+
"example:build": "npm run wp:images:unzip && npm run example:dev:install && npm run wp:start && npm run wp:db:import && npm run example:start",
7+
"example:dev:install": "cd example-app && npm install && cd ..",
8+
"example:start": "npm run wp:start && npm run example:dev",
9+
"example:stop": "npm run wp:stop",
10+
"example:prune": "wp-env destroy && npm run example:build && npm run example:start",
11+
"example:dev": "npm --prefix ./example-app run dev",
12+
"wp:start": "npm install && wp-env start",
13+
"wp:stop": "wp-env stop",
14+
"wp:destroy": "wp-env destroy --config ./wp-env/wp-env.json",
15+
"wp:db:query": "wp-env run cli -- wp db query",
16+
"wp:db:export": "wp-env run cli -- wp db export /var/www/html/db/database.sql",
17+
"wp:db:import": "wp-env run cli -- wp db import /var/www/html/db/database.sql",
18+
"wp:images:unzip": "rm -rf wp-env/uploads/ && unzip wp-env/uploads.zip -d wp-env;",
19+
"wp:images:zip": "zip -r wp-env/uploads.zip wp-env/uploads",
20+
"wp-env": "wp-env"
21+
},
22+
"keywords": [
23+
"headless",
24+
"wordpress",
25+
"nextjs",
26+
"apollo-client",
27+
"fullstack",
28+
"headless-cms",
29+
"wpgraphql",
30+
"headless-wordpress",
31+
"nextjs-pages-router",
32+
"wp-env-configuration",
33+
"fullstack-example"
34+
],
35+
"author": "hwptoolkit",
36+
"license": "BSD-0-Clause",
37+
"dependencies": {
38+
"@wordpress/env": "^10.20.0"
39+
}
40+
}

examples/next/apollo-client-filesystem-routing/wp-env/db/database.sql

+411
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<IfModule mod_headers.c>
2+
Header set Access-Control-Allow-Origin "*"
3+
Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
4+
Header set Access-Control-Allow-Headers "Authorization, Content-Type"
5+
</IfModule>
6+
7+
# BEGIN WordPress
8+
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
9+
# dynamically generated, and should only be modified via WordPress filters.
10+
# Any changes to the directives between these markers will be overwritten.
11+
<IfModule mod_rewrite.c>
12+
RewriteEngine On
13+
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
14+
RewriteBase /
15+
RewriteRule ^index\.php$ - [L]
16+
RewriteCond %{REQUEST_FILENAME} !-f
17+
RewriteCond %{REQUEST_FILENAME} !-d
18+
RewriteRule . /index.php [L]
19+
</IfModule>
20+
21+
# END WordPress
Binary file not shown.

examples/nextjs-pages-router/apollo-client-filesystem-routing/README.md

-116
This file was deleted.

0 commit comments

Comments
 (0)