diff --git a/.changeset/tiny-years-grin.md b/.changeset/tiny-years-grin.md new file mode 100644 index 000000000..0467d6172 --- /dev/null +++ b/.changeset/tiny-years-grin.md @@ -0,0 +1,5 @@ +--- +'@faustwp/core': patch +--- + +Fixes a bug where the WordPressTemplate component would return `null` on the server when `isPreview` was null. diff --git a/.changeset/wet-camels-lick.md b/.changeset/wet-camels-lick.md new file mode 100644 index 000000000..bd9197d97 --- /dev/null +++ b/.changeset/wet-camels-lick.md @@ -0,0 +1,5 @@ +--- +'@faustwp/cli': patch +--- + +Added "glob" as a dependency diff --git a/package-lock.json b/package-lock.json index 4afae33eb..eff344bd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3453,7 +3453,6 @@ }, "node_modules/@apollo/client": { "version": "3.8.6", - "dev": true, "license": "MIT", "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", @@ -7052,7 +7051,6 @@ "node_modules/@jridgewell/source-map": { "version": "0.3.5", "license": "MIT", - "optional": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -9165,7 +9163,6 @@ "node_modules/@types/eslint": { "version": "8.44.4", "license": "MIT", - "optional": true, "dependencies": { "@types/estree": "*", "@types/json-schema": "*" @@ -9174,7 +9171,6 @@ "node_modules/@types/eslint-scope": { "version": "3.7.5", "license": "MIT", - "optional": true, "dependencies": { "@types/eslint": "*", "@types/estree": "*" @@ -9182,8 +9178,7 @@ }, "node_modules/@types/estree": { "version": "1.0.2", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@types/express": { "version": "4.17.21", @@ -9353,7 +9348,6 @@ }, "node_modules/@types/json-schema": { "version": "7.0.13", - "devOptional": true, "license": "MIT" }, "node_modules/@types/json5": { @@ -9668,7 +9662,7 @@ }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.4.0", @@ -9701,7 +9695,7 @@ }, "node_modules/@typescript-eslint/parser": { "version": "5.62.0", - "dev": true, + "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "@typescript-eslint/scope-manager": "5.62.0", @@ -9743,7 +9737,7 @@ }, "node_modules/@typescript-eslint/type-utils": { "version": "5.62.0", - "dev": true, + "devOptional": true, "license": "MIT", "dependencies": { "@typescript-eslint/typescript-estree": "5.62.0", @@ -9863,7 +9857,6 @@ "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/helper-numbers": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6" @@ -9871,23 +9864,19 @@ }, "node_modules/@webassemblyjs/floating-point-hex-parser": { "version": "1.11.6", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-api-error": { "version": "1.11.6", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-buffer": { "version": "1.11.6", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-numbers": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/floating-point-hex-parser": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -9896,13 +9885,11 @@ }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { "version": "1.11.6", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@webassemblyjs/helper-wasm-section": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -9913,7 +9900,6 @@ "node_modules/@webassemblyjs/ieee754": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } @@ -9921,20 +9907,17 @@ "node_modules/@webassemblyjs/leb128": { "version": "1.11.6", "license": "Apache-2.0", - "optional": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { "version": "1.11.6", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/@webassemblyjs/wasm-edit": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -9949,7 +9932,6 @@ "node_modules/@webassemblyjs/wasm-gen": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-wasm-bytecode": "1.11.6", @@ -9961,7 +9943,6 @@ "node_modules/@webassemblyjs/wasm-opt": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-buffer": "1.11.6", @@ -9972,7 +9953,6 @@ "node_modules/@webassemblyjs/wasm-parser": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@webassemblyjs/helper-api-error": "1.11.6", @@ -9985,7 +9965,6 @@ "node_modules/@webassemblyjs/wast-printer": { "version": "1.11.6", "license": "MIT", - "optional": true, "dependencies": { "@webassemblyjs/ast": "1.11.6", "@xtuc/long": "4.2.2" @@ -11418,7 +11397,6 @@ }, "node_modules/@wry/trie": { "version": "0.4.3", - "dev": true, "license": "MIT", "dependencies": { "tslib": "^2.3.0" @@ -11429,13 +11407,11 @@ }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", - "license": "BSD-3-Clause", - "optional": true + "license": "BSD-3-Clause" }, "node_modules/@xtuc/long": { "version": "4.2.2", - "license": "Apache-2.0", - "optional": true + "license": "Apache-2.0" }, "node_modules/abab": { "version": "2.0.6", @@ -11457,7 +11433,6 @@ }, "node_modules/acorn": { "version": "8.10.0", - "devOptional": true, "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -11478,7 +11453,6 @@ "node_modules/acorn-import-assertions": { "version": "1.9.0", "license": "MIT", - "optional": true, "peerDependencies": { "acorn": "^8" } @@ -11521,7 +11495,6 @@ }, "node_modules/ajv": { "version": "6.12.6", - "devOptional": true, "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", @@ -11585,7 +11558,6 @@ "node_modules/ajv-keywords": { "version": "3.5.2", "license": "MIT", - "optional": true, "peerDependencies": { "ajv": "^6.9.1" } @@ -12454,7 +12426,6 @@ "version": "4.23.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", - "devOptional": true, "funding": [ { "type": "opencollective", @@ -12532,7 +12503,6 @@ }, "node_modules/buffer-from": { "version": "1.1.2", - "devOptional": true, "license": "MIT" }, "node_modules/builtin-modules": { @@ -12857,7 +12827,6 @@ "node_modules/chrome-trace-event": { "version": "1.0.3", "license": "MIT", - "optional": true, "engines": { "node": ">=6.0" } @@ -13038,8 +13007,7 @@ }, "node_modules/commander": { "version": "2.20.3", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/comment-parser": { "version": "1.4.1", @@ -14524,8 +14492,7 @@ "node_modules/electron-to-chromium": { "version": "1.4.810", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.810.tgz", - "integrity": "sha512-Kaxhu4T7SJGpRQx99tq216gCq2nMxJo+uuT6uzz9l8TVN2stL7M06MIIXAtr9jsrLs2Glflgf2vMQRepxawOdQ==", - "devOptional": true + "integrity": "sha512-Kaxhu4T7SJGpRQx99tq216gCq2nMxJo+uuT6uzz9l8TVN2stL7M06MIIXAtr9jsrLs2Glflgf2vMQRepxawOdQ==" }, "node_modules/emittery": { "version": "0.13.1", @@ -14587,7 +14554,6 @@ }, "node_modules/enhanced-resolve": { "version": "5.15.0", - "devOptional": true, "license": "MIT", "dependencies": { "graceful-fs": "^4.2.4", @@ -14750,8 +14716,7 @@ }, "node_modules/es-module-lexer": { "version": "1.3.1", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/es-set-tostringtag": { "version": "2.0.1", @@ -14794,7 +14759,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", - "devOptional": true, "engines": { "node": ">=6" } @@ -15266,7 +15230,6 @@ }, "node_modules/eslint-scope": { "version": "5.1.1", - "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "esrecurse": "^4.3.0", @@ -15278,7 +15241,6 @@ }, "node_modules/eslint-scope/node_modules/estraverse": { "version": "4.3.0", - "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -15499,7 +15461,6 @@ }, "node_modules/esrecurse": { "version": "4.3.0", - "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "estraverse": "^5.2.0" @@ -15510,7 +15471,6 @@ }, "node_modules/estraverse": { "version": "5.3.0", - "devOptional": true, "license": "BSD-2-Clause", "engines": { "node": ">=4.0" @@ -15542,7 +15502,6 @@ "node_modules/events": { "version": "3.3.0", "license": "MIT", - "optional": true, "engines": { "node": ">=0.8.x" } @@ -15789,7 +15748,6 @@ }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "devOptional": true, "license": "MIT" }, "node_modules/fast-levenshtein": { @@ -16623,7 +16581,6 @@ }, "node_modules/glob-to-regexp": { "version": "0.4.1", - "devOptional": true, "license": "BSD-2-Clause" }, "node_modules/glob/node_modules/brace-expansion": { @@ -20705,7 +20662,6 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "devOptional": true, "license": "MIT" }, "node_modules/json-stable-stringify-without-jsonify": { @@ -21113,7 +21069,6 @@ "node_modules/loader-runner": { "version": "4.3.0", "license": "MIT", - "optional": true, "engines": { "node": ">=6.11.5" } @@ -21683,7 +21638,6 @@ }, "node_modules/merge-stream": { "version": "2.0.0", - "devOptional": true, "license": "MIT" }, "node_modules/merge2": { @@ -22014,7 +21968,7 @@ }, "node_modules/natural-compare-lite": { "version": "1.4.0", - "dev": true, + "devOptional": true, "license": "MIT" }, "node_modules/negotiator": { @@ -22028,8 +21982,7 @@ }, "node_modules/neo-async": { "version": "2.6.2", - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/netmask": { "version": "2.0.2", @@ -22295,8 +22248,7 @@ "node_modules/node-releases": { "version": "2.0.14", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", - "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", - "devOptional": true + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==" }, "node_modules/normalize-package-data": { "version": "2.5.0", @@ -22883,7 +22835,6 @@ }, "node_modules/optimism": { "version": "0.17.5", - "dev": true, "license": "MIT", "dependencies": { "@wry/context": "^0.7.0", @@ -23732,7 +23683,6 @@ }, "node_modules/punycode": { "version": "2.3.0", - "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -23843,7 +23793,6 @@ }, "node_modules/randombytes": { "version": "2.1.0", - "devOptional": true, "license": "MIT", "dependencies": { "safe-buffer": "^5.1.0" @@ -24828,7 +24777,6 @@ "node_modules/schema-utils": { "version": "3.3.0", "license": "MIT", - "optional": true, "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -24961,7 +24909,6 @@ "node_modules/serialize-javascript": { "version": "6.0.1", "license": "BSD-3-Clause", - "optional": true, "dependencies": { "randombytes": "^2.1.0" } @@ -25714,7 +25661,6 @@ }, "node_modules/source-map": { "version": "0.6.1", - "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -26671,7 +26617,6 @@ }, "node_modules/tapable": { "version": "2.2.1", - "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -26739,7 +26684,6 @@ "node_modules/terser": { "version": "5.22.0", "license": "BSD-2-Clause", - "optional": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -26756,7 +26700,6 @@ "node_modules/terser-webpack-plugin": { "version": "5.3.9", "license": "MIT", - "optional": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", "jest-worker": "^27.4.5", @@ -26789,7 +26732,6 @@ "node_modules/terser-webpack-plugin/node_modules/has-flag": { "version": "4.0.0", "license": "MIT", - "optional": true, "engines": { "node": ">=8" } @@ -26797,7 +26739,6 @@ "node_modules/terser-webpack-plugin/node_modules/jest-worker": { "version": "27.5.1", "license": "MIT", - "optional": true, "dependencies": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -26810,7 +26751,6 @@ "node_modules/terser-webpack-plugin/node_modules/supports-color": { "version": "8.1.1", "license": "MIT", - "optional": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -26824,7 +26764,6 @@ "node_modules/terser/node_modules/source-map-support": { "version": "0.5.21", "license": "MIT", - "optional": true, "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -27446,7 +27385,7 @@ }, "node_modules/typescript": { "version": "4.9.5", - "dev": true, + "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -27575,7 +27514,6 @@ "version": "1.0.16", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", - "devOptional": true, "funding": [ { "type": "opencollective", @@ -27617,7 +27555,6 @@ }, "node_modules/uri-js": { "version": "4.4.1", - "devOptional": true, "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" @@ -27873,7 +27810,6 @@ "node_modules/watchpack": { "version": "2.4.0", "license": "MIT", - "optional": true, "dependencies": { "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.1.2" @@ -27916,7 +27852,6 @@ "node_modules/webpack": { "version": "5.89.0", "license": "MIT", - "optional": true, "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.0", @@ -28323,7 +28258,6 @@ "node_modules/webpack-sources": { "version": "3.2.3", "license": "MIT", - "optional": true, "engines": { "node": ">=10.13.0" } @@ -36202,66 +36136,6 @@ "plugins/faustwp": { "name": "@faustwp/wordpress-plugin", "version": "1.3.2" - }, - "packages/experimental-app-router/node_modules/@next/swc-android-arm-eabi": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.3.4.tgz", - "integrity": "sha512-cM42Cw6V4Bz/2+j/xIzO8nK/Q3Ly+VSlZJTa1vHzsocJRYz8KT6MrreXaci2++SIZCF1rVRCDgAg5PpqRibdIA==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/experimental-app-router/node_modules/@next/swc-android-arm64": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-android-arm64/-/swc-android-arm64-12.3.4.tgz", - "integrity": "sha512-5jf0dTBjL+rabWjGj3eghpLUxCukRhBcEJgwLedewEA/LJk2HyqCvGIwj5rH+iwmq1llCWbOky2dO3pVljrapg==", - "cpu": [ - "arm64" - ], - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/experimental-app-router/node_modules/@next/swc-freebsd-x64": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.3.4.tgz", - "integrity": "sha512-KM9JXRXi/U2PUM928z7l4tnfQ9u8bTco/jb939pdFUHqc28V43Ohd31MmZD1QzEK4aFlMRaIBQOWQZh4D/E5lQ==", - "cpu": [ - "x64" - ], - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10" - } - }, - "packages/experimental-app-router/node_modules/@next/swc-linux-arm-gnueabihf": { - "version": "12.3.4", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.3.4.tgz", - "integrity": "sha512-3zqD3pO+z5CZyxtKDTnOJ2XgFFRUBciOox6EWkoZvJfc9zcidNAQxuwonUeNts6Xbm8Wtm5YGIRC0x+12YH7kw==", - "cpu": [ - "arm" - ], - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10" - } } } } diff --git a/packages/faustwp-cli/package.json b/packages/faustwp-cli/package.json index 8baff5bac..c751d3c30 100644 --- a/packages/faustwp-cli/package.json +++ b/packages/faustwp-cli/package.json @@ -29,6 +29,7 @@ "dotenv-flow": "^3.2.0", "form-data": "^4.0.0", "fs-extra": "^11.1.1", + "glob": "^10.3", "glob-promise": "^6.0.5", "isomorphic-fetch": "^3.0.0", "lodash": "^4.17.21", diff --git a/packages/faustwp-core/src/components/WordPressTemplate.tsx b/packages/faustwp-core/src/components/WordPressTemplate.tsx index 9a57f57d5..dfa05c3cf 100644 --- a/packages/faustwp-core/src/components/WordPressTemplate.tsx +++ b/packages/faustwp-core/src/components/WordPressTemplate.tsx @@ -232,7 +232,7 @@ export function WordPressTemplate(props: WordPressTemplateProps) { return; } - if (isPreview === true && isAuthenticated !== true) { + if (isPreview && !isAuthenticated) { return; } @@ -288,11 +288,7 @@ export function WordPressTemplate(props: WordPressTemplateProps) { })(); }, [seedNode, isPreview, isAuthenticated, basePath]); - if ( - seedNode === null || - isPreview === null || - (isPreview && isAuthenticated === null) - ) { + if (!seedNode || (isPreview && !isAuthenticated)) { return null; } @@ -301,8 +297,8 @@ export function WordPressTemplate(props: WordPressTemplateProps) { // eslint-disable-next-line react/jsx-props-no-spreading {...props} seedNode={seedNode} - isPreview={isPreview} - isAuthenticated={isAuthenticated} + isPreview={isPreview === true} + isAuthenticated={isAuthenticated === true} loading={loading} setLoading={setLoading} />