From ab802c4ae374c87a16b9b496d36900fa8231d43a Mon Sep 17 00:00:00 2001 From: ahuseyn Date: Wed, 18 Feb 2026 12:50:38 +0100 Subject: [PATCH 1/4] update packages --- .../next/faustwp-getting-started/package.json | 18 +- package-lock.json | 258 +++++++++++++++--- 2 files changed, 236 insertions(+), 40 deletions(-) diff --git a/examples/next/faustwp-getting-started/package.json b/examples/next/faustwp-getting-started/package.json index 0314ba25b..b085f5920 100644 --- a/examples/next/faustwp-getting-started/package.json +++ b/examples/next/faustwp-getting-started/package.json @@ -10,17 +10,17 @@ "start": "faust start" }, "dependencies": { - "@apollo/client": "^3.10.4", - "@faustwp/cli": "^3.3.4", - "@faustwp/core": "^3.3.4", + "@apollo/client": "^3.14.0", + "@faustwp/cli": "^3.3.6", + "@faustwp/core": "^3.3.6", "@wordpress/base-styles": "^6.15.0", - "@wordpress/block-library": "^9.10.0", + "@wordpress/block-library": "^9.39.0", "classnames": "^2.5.1", - "graphql": "^16.8.1", - "next": "^15.2.4", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "sass": "1.77.3" + "graphql": "^16.12.0", + "next": "^15.5.12", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "sass": "1.97.3" }, "devDependencies": { "next-secure-headers": "^2.2.0" diff --git a/package-lock.json b/package-lock.json index 90bd47d91..f90b4d1d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,17 +44,17 @@ "name": "@faustwp/getting-started-example", "version": "0.1.0", "dependencies": { - "@apollo/client": "^3.10.4", - "@faustwp/cli": "^3.3.4", - "@faustwp/core": "^3.3.4", + "@apollo/client": "^3.14.0", + "@faustwp/cli": "^3.3.6", + "@faustwp/core": "^3.3.6", "@wordpress/base-styles": "^6.15.0", - "@wordpress/block-library": "^9.10.0", + "@wordpress/block-library": "^9.39.0", "classnames": "^2.5.1", - "graphql": "^16.8.1", - "next": "^15.2.4", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "sass": "1.77.3" + "graphql": "^16.12.0", + "next": "^15.5.12", + "react": "^18.3.1", + "react-dom": "^18.3.1", + "sass": "1.97.3" }, "devDependencies": { "next-secure-headers": "^2.2.0" @@ -159,6 +159,140 @@ "react-dom": ">=16.8.0" } }, + "examples/next/faustwp-getting-started/node_modules/@next/env": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.12.tgz", + "integrity": "sha512-pUvdJN1on574wQHjaBfNGDt9Mz5utDSZFsIIQkMzPgNS8ZvT4H2mwOrOIClwsQOb6EGx5M76/CZr6G8i6pSpLg==", + "license": "MIT" + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-darwin-arm64": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.12.tgz", + "integrity": "sha512-RnRjBtH8S8eXCpUNkQ+543DUc7ys8y15VxmFU9HRqlo9BG3CcBUiwNtF8SNoi2xvGCVJq1vl2yYq+3oISBS0Zg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-darwin-x64": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.12.tgz", + "integrity": "sha512-nqa9/7iQlboF1EFtNhWxQA0rQstmYRSBGxSM6g3GxvxHxcoeqVXfGNr9stJOme674m2V7r4E3+jEhhGvSQhJRA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.12.tgz", + "integrity": "sha512-dCzAjqhDHwmoB2M4eYfVKqXs99QdQxNQVpftvP1eGVppamXh/OkDAwV737Zr0KPXEqRUMN4uCjh6mjO+XtF3Mw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-linux-arm64-musl": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.12.tgz", + "integrity": "sha512-+fpGWvQiITgf7PUtbWY1H7qUSnBZsPPLyyq03QuAKpVoTy/QUx1JptEDTQMVvQhvizCEuNLEeghrQUyXQOekuw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-linux-x64-gnu": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.12.tgz", + "integrity": "sha512-jSLvgdRRL/hrFAPqEjJf1fFguC719kmcptjNVDJl26BnJIpjL3KH5h6mzR4mAweociLQaqvt4UyzfbFjgAdDcw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-linux-x64-musl": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.12.tgz", + "integrity": "sha512-/uaF0WfmYqQgLfPmN6BvULwxY0dufI2mlN2JbOKqqceZh1G4hjREyi7pg03zjfyS6eqNemHAZPSoP84x17vo6w==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.12.tgz", + "integrity": "sha512-xhsL1OvQSfGmlL5RbOmU+FV120urrgFpYLq+6U8C6KIym32gZT6XF/SDE92jKzzlPWskkbjOKCpqk5m4i8PEfg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "examples/next/faustwp-getting-started/node_modules/@next/swc-win32-x64-msvc": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.12.tgz", + "integrity": "sha512-Z1Dh6lhFkxvBDH1FoW6OU/L6prYwPSlwjLiZkExIAh8fbP6iI/M7iGTQAJPYJ9YFlWobCZ1PHbchFhFYb2ADkw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "examples/next/faustwp-getting-started/node_modules/@types/react": { "version": "18.3.27", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.27.tgz", @@ -1277,6 +1411,58 @@ "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", "license": "MIT" }, + "examples/next/faustwp-getting-started/node_modules/next": { + "version": "15.5.12", + "resolved": "https://registry.npmjs.org/next/-/next-15.5.12.tgz", + "integrity": "sha512-Fi/wQ4Etlrn60rz78bebG1i1SR20QxvV8tVp6iJspjLUSHcZoeUXCt+vmWoEcza85ElZzExK/jJ/F6SvtGktjA==", + "license": "MIT", + "dependencies": { + "@next/env": "15.5.12", + "@swc/helpers": "0.5.15", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.5.12", + "@next/swc-darwin-x64": "15.5.12", + "@next/swc-linux-arm64-gnu": "15.5.12", + "@next/swc-linux-arm64-musl": "15.5.12", + "@next/swc-linux-x64-gnu": "15.5.12", + "@next/swc-linux-x64-musl": "15.5.12", + "@next/swc-win32-arm64-msvc": "15.5.12", + "@next/swc-win32-x64-msvc": "15.5.12", + "sharp": "^0.34.3" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.51.1", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, "examples/next/faustwp-getting-started/node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3927,7 +4113,8 @@ "version": "15.5.11", "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.11.tgz", "integrity": "sha512-g9s5SS9gC7GJCEOR3OV3zqs7C5VddqxP9X+/6BpMbdXRkqsWfFf2CJPBZNvNEtAkKTNuRgRXAgNxSAXzfLdaTg==", - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@next/swc-darwin-arm64": { "version": "15.5.7", @@ -3941,6 +4128,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10" } @@ -3957,6 +4145,7 @@ "os": [ "darwin" ], + "peer": true, "engines": { "node": ">= 10" } @@ -3973,6 +4162,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10" } @@ -3989,6 +4179,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10" } @@ -4005,6 +4196,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10" } @@ -4021,6 +4213,7 @@ "os": [ "linux" ], + "peer": true, "engines": { "node": ">= 10" } @@ -4037,6 +4230,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10" } @@ -4053,6 +4247,7 @@ "os": [ "win32" ], + "peer": true, "engines": { "node": ">= 10" } @@ -4099,7 +4294,7 @@ "version": "2.4.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.4.1.tgz", "integrity": "sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "detect-libc": "^1.0.3", @@ -4136,12 +4331,12 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "android" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4157,12 +4352,12 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4178,12 +4373,12 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4199,12 +4394,12 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4220,12 +4415,12 @@ "cpu": [ "arm" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4241,12 +4436,12 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4262,12 +4457,12 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4283,12 +4478,12 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4304,12 +4499,12 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4325,12 +4520,12 @@ "cpu": [ "arm64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4346,12 +4541,12 @@ "cpu": [ "ia32" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -4367,12 +4562,12 @@ "cpu": [ "x64" ], + "dev": true, "license": "MIT", "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">= 10.0.0" }, @@ -15666,7 +15861,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "devOptional": true, + "dev": true, "license": "Apache-2.0", "bin": { "detect-libc": "bin/detect-libc.js" @@ -20146,7 +20341,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "devOptional": true, + "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -20340,6 +20535,7 @@ "resolved": "https://registry.npmjs.org/next/-/next-15.5.11.tgz", "integrity": "sha512-L2KPiKmqTDpRdeVDdPjhf43g2/VPe0NCNndq7OKDCgOLWtxe1kbr/zXGIZtYY7kZEAjRf7Bj/mwUFSr+tYC2Yg==", "license": "MIT", + "peer": true, "dependencies": { "@next/env": "15.5.11", "@swc/helpers": "0.5.15", @@ -20411,7 +20607,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", - "devOptional": true, + "dev": true, "license": "MIT" }, "node_modules/node-fetch": { @@ -24959,7 +25155,7 @@ }, "packages/block-editor-utils": { "name": "@faustwp/block-editor-utils", - "version": "0.3.6", + "version": "0.3.8", "license": "MIT", "dependencies": { "@wordpress/block-editor": "^12.11.1", @@ -25125,7 +25321,7 @@ }, "packages/blocks": { "name": "@faustwp/blocks", - "version": "6.1.6", + "version": "6.1.8", "license": "MIT", "devDependencies": { "@testing-library/jest-dom": "^5.16.5", @@ -25257,7 +25453,7 @@ }, "packages/faustwp-cli": { "name": "@faustwp/cli", - "version": "3.3.4", + "version": "3.3.6", "license": "MIT", "dependencies": { "archiver": "^6.0.1", @@ -25492,7 +25688,7 @@ }, "packages/faustwp-core": { "name": "@faustwp/core", - "version": "3.3.4", + "version": "3.3.6", "license": "MIT", "dependencies": { "@wordpress/hooks": "^3.14.0", @@ -25694,7 +25890,7 @@ }, "plugins/faustwp": { "name": "@faustwp/wordpress-plugin", - "version": "1.8.4" + "version": "1.8.5" } } } From 03f707995755da00a371c57e35a40acf08df8dd5 Mon Sep 17 00:00:00 2001 From: ahuseyn Date: Wed, 18 Feb 2026 15:42:51 +0100 Subject: [PATCH 2/4] migrate example into Nextjs v16 --- .../ContentWrapper/ContentWrapper.module.scss | 208 +++++++++--------- .../EntryHeader/EntryHeader.module.scss | 2 +- .../components/Header/Header.module.scss | 2 +- .../components/Hero/Hero.module.scss | 2 +- .../NavigationMenu/NavigationMenu.module.scss | 2 +- .../NavigationMenuClassesFromWP.module.scss | 2 +- .../faustwp-getting-started/next.config.js | 8 +- .../next/faustwp-getting-started/package.json | 4 +- package-lock.json | 85 +++---- 9 files changed, 160 insertions(+), 155 deletions(-) diff --git a/examples/next/faustwp-getting-started/components/ContentWrapper/ContentWrapper.module.scss b/examples/next/faustwp-getting-started/components/ContentWrapper/ContentWrapper.module.scss index 1fe0634c7..36e0573dd 100644 --- a/examples/next/faustwp-getting-started/components/ContentWrapper/ContentWrapper.module.scss +++ b/examples/next/faustwp-getting-started/components/ContentWrapper/ContentWrapper.module.scss @@ -2,133 +2,133 @@ max-width: var(--wpe--content--max-width); margin: 0 auto; line-height: 1.6875; +} - :global { - // Scope WordPress block styles within ContentWrapper. - @import 'styles/blocks'; +:global(.component *) { + // Scope WordPress block styles within ContentWrapper. + @import '../../styles/blocks'; - * { - max-width: 100%; - } + * { + max-width: 100%; + } - figure { - margin-left: 0; - margin-right: 0; - } + figure { + margin-left: 0; + margin-right: 0; + } - h1, - h2, - h3, - h4, - h5, - h6 { - margin: 4.8rem 0; - } + h1, + h2, + h3, + h4, + h5, + h6 { + margin: 4.8rem 0; + } - strong { - font-weight: 700; - } + strong { + font-weight: 700; + } - a { - color: var(--wpe--link--color); - text-decoration: underline; + a { + color: var(--wpe--link--color); + text-decoration: underline; - &:hover, - &:focus { - color: var(--wpe--link--color); - text-decoration: none; - } + &:hover, + &:focus { + color: var(--wpe--link--color); + text-decoration: none; } + } - li { - font-size: 1.6rem; - } + li { + font-size: 1.6rem; + } - img { - display: block; - height: auto; - max-width: 100%; - } + img { + display: block; + height: auto; + max-width: 100%; + } - .alignleft { - display: inline; - float: left; - margin-right: 1.5em; - } + .alignleft { + display: inline; + float: left; + margin-right: 1.5em; + } - .alignright { - display: inline; - float: right; - margin-left: 1.5em; - } + .alignright { + display: inline; + float: right; + margin-left: 1.5em; + } - .aligncenter { - clear: both; - display: block; - margin-left: auto; - margin-right: auto; - } + .aligncenter { + clear: both; + display: block; + margin-left: auto; + margin-right: auto; + } - code, - pre { - color: var(--color-white); - background: var(--color-black); - } + code, + pre { + color: var(--color-white); + background: var(--color-black); + } - code { - padding: 0.25rem 0.5rem; - } + code { + padding: 0.25rem 0.5rem; + } - pre { - max-width: 100%; - overflow: auto; - padding: 1rem; - } + pre { + max-width: 100%; + overflow: auto; + padding: 1rem; + } - blockquote { - border-top: 1px solid var(--color-black); - border-bottom: 1px solid var(--color-black); - font-style: italic; - margin-top: 0; - margin-left: 0; - margin-right: 0; - padding: 4rem 1rem 4rem; - text-align: center; - - &::before { - content: '”'; - display: block; - font-size: 6rem; - line-height: 0; - margin: 2rem 0; - } - - > *:last-child { - margin-bottom: 0; - } + blockquote { + border-top: 1px solid var(--color-black); + border-bottom: 1px solid var(--color-black); + font-style: italic; + margin-top: 0; + margin-left: 0; + margin-right: 0; + padding: 4rem 1rem 4rem; + text-align: center; + + &::before { + content: '”'; + display: block; + font-size: 6rem; + line-height: 0; + margin: 2rem 0; } - table { - border-collapse: collapse; - width: 100%; + > *:last-child { + margin-bottom: 0; } + } - thead th { - border-bottom: 1px solid var(--wpe--color--border); - padding-bottom: 0.5em; - } + table { + border-collapse: collapse; + width: 100%; + } - th { - padding: 0.4rem 0; - text-align: left; - } + thead th { + border-bottom: 1px solid var(--wpe--color--border); + padding-bottom: 0.5em; + } - tr { - border-bottom: 1px solid var(--wpe--color--border); - } + th { + padding: 0.4rem 0; + text-align: left; + } - td { - padding: 0.4em; - } + tr { + border-bottom: 1px solid var(--wpe--color--border); + } + + td { + padding: 0.4em; } } diff --git a/examples/next/faustwp-getting-started/components/EntryHeader/EntryHeader.module.scss b/examples/next/faustwp-getting-started/components/EntryHeader/EntryHeader.module.scss index bed8bec82..88fa39eeb 100644 --- a/examples/next/faustwp-getting-started/components/EntryHeader/EntryHeader.module.scss +++ b/examples/next/faustwp-getting-started/components/EntryHeader/EntryHeader.module.scss @@ -1,4 +1,4 @@ -@import 'styles/breakpoints'; +@import '../../styles/breakpoints'; .component { color: var(--wpe--color--white); diff --git a/examples/next/faustwp-getting-started/components/Header/Header.module.scss b/examples/next/faustwp-getting-started/components/Header/Header.module.scss index e26ce301a..92fcfd15a 100644 --- a/examples/next/faustwp-getting-started/components/Header/Header.module.scss +++ b/examples/next/faustwp-getting-started/components/Header/Header.module.scss @@ -1,4 +1,4 @@ -@import 'styles/breakpoints'; +@import '../../styles/breakpoints'; .component { color: var(--wpe--header--color); diff --git a/examples/next/faustwp-getting-started/components/Hero/Hero.module.scss b/examples/next/faustwp-getting-started/components/Hero/Hero.module.scss index 2b713d4a1..c04443d32 100644 --- a/examples/next/faustwp-getting-started/components/Hero/Hero.module.scss +++ b/examples/next/faustwp-getting-started/components/Hero/Hero.module.scss @@ -1,4 +1,4 @@ -@import "styles/breakpoints"; +@import "../../styles/breakpoints"; .component { text-align: center; diff --git a/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenu.module.scss b/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenu.module.scss index c7623f924..5c88210e6 100644 --- a/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenu.module.scss +++ b/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenu.module.scss @@ -1,4 +1,4 @@ -@import 'styles/breakpoints'; +@import '../../styles/breakpoints'; %visible { visibility: visible; diff --git a/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenuClassesFromWP.module.scss b/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenuClassesFromWP.module.scss index 78e921337..bae5abdb1 100644 --- a/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenuClassesFromWP.module.scss +++ b/examples/next/faustwp-getting-started/components/NavigationMenu/NavigationMenuClassesFromWP.module.scss @@ -1,7 +1,7 @@ // Classes in this file can be optionally added to menu items from within WordPress. // Appearance --> Menus --> Screen Options --> CSS Classes -@import 'styles/breakpoints'; +@import '../../styles/breakpoints'; .button { a { diff --git a/examples/next/faustwp-getting-started/next.config.js b/examples/next/faustwp-getting-started/next.config.js index b886fe7ab..5707faef7 100644 --- a/examples/next/faustwp-getting-started/next.config.js +++ b/examples/next/faustwp-getting-started/next.config.js @@ -7,10 +7,14 @@ const { createSecureHeaders } = require('next-secure-headers'); module.exports = withFaust({ reactStrictMode: true, sassOptions: { - includePaths: ['node_modules'], + includePaths: ['node_modules', '.'], }, images: { - domains: [getWpHostname()], + remotePatterns: [ + { + hostname: getWpHostname(), + }, + ], }, i18n: { locales: ['en'], diff --git a/examples/next/faustwp-getting-started/package.json b/examples/next/faustwp-getting-started/package.json index b085f5920..0fc79a238 100644 --- a/examples/next/faustwp-getting-started/package.json +++ b/examples/next/faustwp-getting-started/package.json @@ -17,7 +17,7 @@ "@wordpress/block-library": "^9.39.0", "classnames": "^2.5.1", "graphql": "^16.12.0", - "next": "^15.5.12", + "next": "^16.1.6", "react": "^18.3.1", "react-dom": "^18.3.1", "sass": "1.97.3" @@ -26,7 +26,7 @@ "next-secure-headers": "^2.2.0" }, "engines": { - "node": ">=18", + "node": ">=20.9", "npm": ">=8" } } diff --git a/package-lock.json b/package-lock.json index a1a9155ea..5c32cfa56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "@wordpress/block-library": "^9.39.0", "classnames": "^2.5.1", "graphql": "^16.12.0", - "next": "^15.5.12", + "next": "^16.1.6", "react": "^18.3.1", "react-dom": "^18.3.1", "sass": "1.97.3" @@ -158,15 +158,15 @@ } }, "examples/next/faustwp-getting-started/node_modules/@next/env": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.12.tgz", - "integrity": "sha512-pUvdJN1on574wQHjaBfNGDt9Mz5utDSZFsIIQkMzPgNS8ZvT4H2mwOrOIClwsQOb6EGx5M76/CZr6G8i6pSpLg==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.6.tgz", + "integrity": "sha512-N1ySLuZjnAtN3kFnwhAwPvZah8RJxKasD7x1f8shFqhncnWZn4JMfg37diLNuoHsLAlrDfM3g4mawVdtAG8XLQ==", "license": "MIT" }, "examples/next/faustwp-getting-started/node_modules/@next/swc-darwin-arm64": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.12.tgz", - "integrity": "sha512-RnRjBtH8S8eXCpUNkQ+543DUc7ys8y15VxmFU9HRqlo9BG3CcBUiwNtF8SNoi2xvGCVJq1vl2yYq+3oISBS0Zg==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.6.tgz", + "integrity": "sha512-wTzYulosJr/6nFnqGW7FrG3jfUUlEf8UjGA0/pyypJl42ExdVgC6xJgcXQ+V8QFn6niSG2Pb8+MIG1mZr2vczw==", "cpu": [ "arm64" ], @@ -1286,13 +1286,14 @@ "license": "MIT" }, "examples/next/faustwp-getting-started/node_modules/next": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/next/-/next-15.5.12.tgz", - "integrity": "sha512-Fi/wQ4Etlrn60rz78bebG1i1SR20QxvV8tVp6iJspjLUSHcZoeUXCt+vmWoEcza85ElZzExK/jJ/F6SvtGktjA==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/next/-/next-16.1.6.tgz", + "integrity": "sha512-hkyRkcu5x/41KoqnROkfTm2pZVbKxvbZRuNvKXLRXxs3VfyO0WhY50TQS40EuKO9SW3rBj/sF3WbVwDACeMZyw==", "license": "MIT", "dependencies": { - "@next/env": "15.5.12", + "@next/env": "16.1.6", "@swc/helpers": "0.5.15", + "baseline-browser-mapping": "^2.8.3", "caniuse-lite": "^1.0.30001579", "postcss": "8.4.31", "styled-jsx": "5.1.6" @@ -1301,18 +1302,18 @@ "next": "dist/bin/next" }, "engines": { - "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + "node": ">=20.9.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "15.5.12", - "@next/swc-darwin-x64": "15.5.12", - "@next/swc-linux-arm64-gnu": "15.5.12", - "@next/swc-linux-arm64-musl": "15.5.12", - "@next/swc-linux-x64-gnu": "15.5.12", - "@next/swc-linux-x64-musl": "15.5.12", - "@next/swc-win32-arm64-msvc": "15.5.12", - "@next/swc-win32-x64-msvc": "15.5.12", - "sharp": "^0.34.3" + "@next/swc-darwin-arm64": "16.1.6", + "@next/swc-darwin-x64": "16.1.6", + "@next/swc-linux-arm64-gnu": "16.1.6", + "@next/swc-linux-arm64-musl": "16.1.6", + "@next/swc-linux-x64-gnu": "16.1.6", + "@next/swc-linux-x64-musl": "16.1.6", + "@next/swc-win32-arm64-msvc": "16.1.6", + "@next/swc-win32-x64-msvc": "16.1.6", + "sharp": "^0.34.4" }, "peerDependencies": { "@opentelemetry/api": "^1.1.0", @@ -3253,9 +3254,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.12.tgz", - "integrity": "sha512-nqa9/7iQlboF1EFtNhWxQA0rQstmYRSBGxSM6g3GxvxHxcoeqVXfGNr9stJOme674m2V7r4E3+jEhhGvSQhJRA==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.6.tgz", + "integrity": "sha512-BLFPYPDO+MNJsiDWbeVzqvYd4NyuRrEYVB5k2N3JfWncuHAy2IVwMAOlVQDFjj+krkWzhY2apvmekMkfQR0CUQ==", "cpu": [ "x64" ], @@ -3269,9 +3270,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.12.tgz", - "integrity": "sha512-dCzAjqhDHwmoB2M4eYfVKqXs99QdQxNQVpftvP1eGVppamXh/OkDAwV737Zr0KPXEqRUMN4uCjh6mjO+XtF3Mw==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.6.tgz", + "integrity": "sha512-OJYkCd5pj/QloBvoEcJ2XiMnlJkRv9idWA/j0ugSuA34gMT6f5b7vOiCQHVRpvStoZUknhl6/UxOXL4OwtdaBw==", "cpu": [ "arm64" ], @@ -3285,9 +3286,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.12.tgz", - "integrity": "sha512-+fpGWvQiITgf7PUtbWY1H7qUSnBZsPPLyyq03QuAKpVoTy/QUx1JptEDTQMVvQhvizCEuNLEeghrQUyXQOekuw==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.6.tgz", + "integrity": "sha512-S4J2v+8tT3NIO9u2q+S0G5KdvNDjXfAv06OhfOzNDaBn5rw84DGXWndOEB7d5/x852A20sW1M56vhC/tRVbccQ==", "cpu": [ "arm64" ], @@ -3301,9 +3302,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.12.tgz", - "integrity": "sha512-jSLvgdRRL/hrFAPqEjJf1fFguC719kmcptjNVDJl26BnJIpjL3KH5h6mzR4mAweociLQaqvt4UyzfbFjgAdDcw==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.6.tgz", + "integrity": "sha512-2eEBDkFlMMNQnkTyPBhQOAyn2qMxyG2eE7GPH2WIDGEpEILcBPI/jdSv4t6xupSP+ot/jkfrCShLAa7+ZUPcJQ==", "cpu": [ "x64" ], @@ -3317,9 +3318,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.12.tgz", - "integrity": "sha512-/uaF0WfmYqQgLfPmN6BvULwxY0dufI2mlN2JbOKqqceZh1G4hjREyi7pg03zjfyS6eqNemHAZPSoP84x17vo6w==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.6.tgz", + "integrity": "sha512-oicJwRlyOoZXVlxmIMaTq7f8pN9QNbdes0q2FXfRsPhfCi8n8JmOZJm5oo1pwDaFbnnD421rVU409M3evFbIqg==", "cpu": [ "x64" ], @@ -3333,9 +3334,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.12.tgz", - "integrity": "sha512-xhsL1OvQSfGmlL5RbOmU+FV120urrgFpYLq+6U8C6KIym32gZT6XF/SDE92jKzzlPWskkbjOKCpqk5m4i8PEfg==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.6.tgz", + "integrity": "sha512-gQmm8izDTPgs+DCWH22kcDmuUp7NyiJgEl18bcr8irXA5N2m2O+JQIr6f3ct42GOs9c0h8QF3L5SzIxcYAAXXw==", "cpu": [ "arm64" ], @@ -3349,9 +3350,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "15.5.12", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.12.tgz", - "integrity": "sha512-Z1Dh6lhFkxvBDH1FoW6OU/L6prYwPSlwjLiZkExIAh8fbP6iI/M7iGTQAJPYJ9YFlWobCZ1PHbchFhFYb2ADkw==", + "version": "16.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.6.tgz", + "integrity": "sha512-NRfO39AIrzBnixKbjuo2YiYhB6o9d8v/ymU9m/Xk8cyVk+k7XylniXkHwjs4s70wedVffc6bQNbufk5v0xEm0A==", "cpu": [ "x64" ], From 3e372655c506b03ff2b62e7cec9359d0ef3454b7 Mon Sep 17 00:00:00 2001 From: ahuseyn Date: Wed, 18 Feb 2026 17:24:36 +0100 Subject: [PATCH 3/4] implement multiple queries into starter example --- .../fragments/LayoutQuery.js | 26 +++ .../wp-templates/category.js | 186 +++++++++--------- .../wp-templates/front-page.js | 105 ++++------ .../wp-templates/page.js | 153 +++++++------- .../wp-templates/single.js | 176 +++++++---------- .../wp-templates/tag.js | 186 +++++++++--------- 6 files changed, 390 insertions(+), 442 deletions(-) create mode 100644 examples/next/faustwp-getting-started/fragments/LayoutQuery.js diff --git a/examples/next/faustwp-getting-started/fragments/LayoutQuery.js b/examples/next/faustwp-getting-started/fragments/LayoutQuery.js new file mode 100644 index 000000000..4e36d272a --- /dev/null +++ b/examples/next/faustwp-getting-started/fragments/LayoutQuery.js @@ -0,0 +1,26 @@ +import { gql } from '@apollo/client'; +import { BlogInfoFragment } from './GeneralSettings'; +import { NavigationMenu } from '../components'; + +export const GET_LAYOUT_QUERY = gql` + ${BlogInfoFragment} + ${NavigationMenu.fragments.entry} + query GetLayout( + $headerLocation: MenuLocationEnum + $footerLocation: MenuLocationEnum + ) { + generalSettings { + ...BlogInfoFragment + } + headerMenuItems: menuItems(where: { location: $headerLocation }) { + nodes { + ...NavigationMenuItemFragment + } + } + footerMenuItems: menuItems(where: { location: $footerLocation }) { + nodes { + ...NavigationMenuItemFragment + } + } + } +`; diff --git a/examples/next/faustwp-getting-started/wp-templates/category.js b/examples/next/faustwp-getting-started/wp-templates/category.js index cee90fe1b..dcfbe1a59 100644 --- a/examples/next/faustwp-getting-started/wp-templates/category.js +++ b/examples/next/faustwp-getting-started/wp-templates/category.js @@ -1,106 +1,98 @@ import { gql } from '@apollo/client'; +import { useFaustQuery } from '@faustwp/core'; import * as MENUS from '../constants/menus'; -import { BlogInfoFragment } from '../fragments/GeneralSettings'; import { - Header, - Footer, - Main, - Container, - EntryHeader, - NavigationMenu, - Post, - FeaturedImage, - SEO, + Header, + Footer, + Main, + Container, + EntryHeader, + Post, + FeaturedImage, + SEO, } from '../components'; +import { GET_LAYOUT_QUERY } from '../fragments/LayoutQuery'; + +const GET_CATEGORY_QUERY = gql` + ${FeaturedImage.fragments.entry} + query GetCategory($uri: String!) { + nodeByUri(uri: $uri) { + ... on Category { + name + posts { + edges { + node { + id + title + content + date + uri + ...FeaturedImageFragment + author { + node { + name + } + } + } + } + } + } + } + } +`; export default function Component(props) { - const { title: siteTitle, description: siteDescription } = - props?.data?.generalSettings; - const primaryMenu = props?.data?.headerMenuItems?.nodes ?? []; - const footerMenu = props?.data?.footerMenuItems?.nodes ?? []; - const { name, posts } = props.data.nodeByUri; + const { generalSettings, headerMenuItems, footerMenuItems } = + useFaustQuery(GET_LAYOUT_QUERY); + const { nodeByUri } = useFaustQuery(GET_CATEGORY_QUERY); - return ( - <> - -
-
- <> - - - {posts.edges.map((post) => ( - - ))} - - -
-