From de2a8ac6512a5b82f77b70ba5cb8edafbb49ad3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Oct 2021 19:04:41 +0000 Subject: [PATCH] Version Packages --- .changeset/fresh-ads-know.md | 5 -- .changeset/large-humans-sing.md | 55 -------------- .changeset/six-dingos-shake.md | 27 ------- .changeset/two-bugs-fix.md | 7 -- .changeset/weak-sheep-work.md | 5 -- examples/next/getting-started/package.json | 4 +- packages/core/CHANGELOG.md | 60 +++++++++++++++ packages/core/package.json | 2 +- packages/next/CHANGELOG.md | 88 ++++++++++++++++++++++ packages/next/package.json | 6 +- packages/react/CHANGELOG.md | 63 ++++++++++++++++ packages/react/package.json | 4 +- 12 files changed, 219 insertions(+), 107 deletions(-) delete mode 100644 .changeset/fresh-ads-know.md delete mode 100644 .changeset/large-humans-sing.md delete mode 100644 .changeset/six-dingos-shake.md delete mode 100644 .changeset/two-bugs-fix.md delete mode 100644 .changeset/weak-sheep-work.md diff --git a/.changeset/fresh-ads-know.md b/.changeset/fresh-ads-know.md deleted file mode 100644 index 3c6c875a2..000000000 --- a/.changeset/fresh-ads-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@faustjs/core': minor ---- - -Implement `logoutHandler` middleware diff --git a/.changeset/large-humans-sing.md b/.changeset/large-humans-sing.md deleted file mode 100644 index ae42d8ae0..000000000 --- a/.changeset/large-humans-sing.md +++ /dev/null @@ -1,55 +0,0 @@ ---- -'@faustjs/core': minor -'@faustjs/next': minor -'@faustjs/react': minor ---- - -`headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. - -Your `faust.config.js` needs to change to look like this: - -```ts -import { config as coreConfig } from '@faustjs/core'; - -if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { - console.error( - 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', - ); -} - -/** - * @type {import("@faustjs/core").Config} - */ -export default coreConfig({ - wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, - apiClientSecret: process.env.WP_HEADLESS_SECRET, -}); -``` - -Or, to configure the global `revalidate` option in `@faustjs/next`: - - -```ts -import { config as coreConfig } from '@faustjs/core'; -import { config as nextConfig } from '@faustjs/next'; - -if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { - console.error( - 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', - ); -} - -nextConfig({ - revalidate: 60, // 1 minute -}); - -/** - * @type {import("@faustjs/core").Config} - */ -export default coreConfig({ - wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, - apiClientSecret: process.env.WP_HEADLESS_SECRET, -}); -``` - -> **NOTE**: `@faustjs/next` defaults to `revalidate: 900` (15 minutes). diff --git a/.changeset/six-dingos-shake.md b/.changeset/six-dingos-shake.md deleted file mode 100644 index 282e103a5..000000000 --- a/.changeset/six-dingos-shake.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -'@faustjs/next': minor ---- - -Introduced an argument to the `useAuth` hook, `UseAuthOptions`, to provide users the ability to disable automatic redirect from the `useAuth` hook upon an unauthenticated user. - -```tsx -import { client } from 'client'; - -export default function Page() { - const { isLoading, isAuthenticated, authResult } = client.auth.useAuth({ - shouldRedirect: false, - }); - - if (isLoading) { - return

Loading...

; - } - - if (!isAuthenticated) { - return ( -

You need to be authenticated to see this content. Please login.

- ); - } - - return

Authenticated content

; -} -``` diff --git a/.changeset/two-bugs-fix.md b/.changeset/two-bugs-fix.md deleted file mode 100644 index b9b1f044f..000000000 --- a/.changeset/two-bugs-fix.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@faustjs/core': patch -'@faustjs/next': patch -'@faustjs/react': patch ---- - -Implemented `changesets` 🦋 diff --git a/.changeset/weak-sheep-work.md b/.changeset/weak-sheep-work.md deleted file mode 100644 index d13f32799..000000000 --- a/.changeset/weak-sheep-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@faustjs/core': patch ---- - -Added the appropriate `Content-Type` response header to the `authorizeHandler` middleware diff --git a/examples/next/getting-started/package.json b/examples/next/getting-started/package.json index 4884f5d37..ca6e931fa 100644 --- a/examples/next/getting-started/package.json +++ b/examples/next/getting-started/package.json @@ -12,8 +12,8 @@ "wpe-build": "next build" }, "dependencies": { - "@faustjs/core": "^0.11.0", - "@faustjs/next": "^0.11.0", + "@faustjs/core": "^0.12.0", + "@faustjs/next": "^0.12.0", "next": "^11.1.2", "normalize.css": "^8.0.1", "react": "^17.0.2", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index e69de29bb..9c98e127c 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,60 @@ +# @faustjs/core + +## 0.12.0 + +### Minor Changes + +- 4ded997: Implement `logoutHandler` middleware +- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. + + Your `faust.config.js` needs to change to look like this: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + Or, to configure the global `revalidate` option in `@faustjs/next`: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + import { config as nextConfig } from '@faustjs/next'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + nextConfig({ + revalidate: 60, // 1 minute + }); + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + > **NOTE**: `@faustjs/next` defaults to `revalidate: 900` (15 minutes). + +### Patch Changes + +- c4b205a: Implemented `changesets` 🦋 +- 5c7f662: Added the appropriate `Content-Type` response header to the `authorizeHandler` middleware diff --git a/packages/core/package.json b/packages/core/package.json index 26b8d019a..5816d12c6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@faustjs/core", - "version": "0.11.0", + "version": "0.12.0", "description": "This module helps you use WordPress as a Headless CMS", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js", diff --git a/packages/next/CHANGELOG.md b/packages/next/CHANGELOG.md index e69de29bb..c37892d00 100644 --- a/packages/next/CHANGELOG.md +++ b/packages/next/CHANGELOG.md @@ -0,0 +1,88 @@ +# @faustjs/next + +## 0.12.0 + +### Minor Changes + +- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. + + Your `faust.config.js` needs to change to look like this: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + Or, to configure the global `revalidate` option in `@faustjs/next`: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + import { config as nextConfig } from '@faustjs/next'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + nextConfig({ + revalidate: 60, // 1 minute + }); + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + > **NOTE**: `@faustjs/next` defaults to `revalidate: 900` (15 minutes). + +- 5c7f662: Introduced an argument to the `useAuth` hook, `UseAuthOptions`, to provide users the ability to disable automatic redirect from the `useAuth` hook upon an unauthenticated user. + + ```tsx + import { client } from 'client'; + + export default function Page() { + const { isLoading, isAuthenticated, authResult } = client.auth.useAuth({ + shouldRedirect: false, + }); + + if (isLoading) { + return

Loading...

; + } + + if (!isAuthenticated) { + return ( +

You need to be authenticated to see this content. Please login.

+ ); + } + + return

Authenticated content

; + } + ``` + +### Patch Changes + +- c4b205a: Implemented `changesets` 🦋 +- Updated dependencies [4ded997] +- Updated dependencies [8243e9f] +- Updated dependencies [c4b205a] +- Updated dependencies [5c7f662] + - @faustjs/core@0.12.0 + - @faustjs/react@0.12.0 diff --git a/packages/next/package.json b/packages/next/package.json index 164be222a..abf4d6d29 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@faustjs/next", - "version": "0.11.0", + "version": "0.12.0", "description": "This module helps you use WordPress as a Headless CMS with Next.js", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js", @@ -84,8 +84,8 @@ "dependencies": { "@gqty/logger": "^2.0.0", "@gqty/react": "^2.0.0", - "@faustjs/core": "^0.11.0", - "@faustjs/react": "^0.11.0", + "@faustjs/core": "^0.12.0", + "@faustjs/react": "^0.12.0", "graphql": ">=15.6", "lodash": "^4.17.21" } diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index e69de29bb..3c33588d2 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -0,0 +1,63 @@ +# @faustjs/react + +## 0.12.0 + +### Minor Changes + +- 8243e9f: `headlessConfig` from `@faustjs/core` is now just `config`, and `@faustjs/next` has its own `config` with a global revalidate option. + + Your `faust.config.js` needs to change to look like this: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + Or, to configure the global `revalidate` option in `@faustjs/next`: + + ```ts + import { config as coreConfig } from '@faustjs/core'; + import { config as nextConfig } from '@faustjs/next'; + + if (!process.env.NEXT_PUBLIC_WORDPRESS_URL) { + console.error( + 'You must provide a NEXT_PUBLIC_WORDPRESS_URL environment variable, did you forget to load your .env.local file?', + ); + } + + nextConfig({ + revalidate: 60, // 1 minute + }); + + /** + * @type {import("@faustjs/core").Config} + */ + export default coreConfig({ + wpUrl: process.env.NEXT_PUBLIC_WORDPRESS_URL, + apiClientSecret: process.env.WP_HEADLESS_SECRET, + }); + ``` + + > **NOTE**: `@faustjs/next` defaults to `revalidate: 900` (15 minutes). + +### Patch Changes + +- c4b205a: Implemented `changesets` 🦋 +- Updated dependencies [4ded997] +- Updated dependencies [8243e9f] +- Updated dependencies [c4b205a] +- Updated dependencies [5c7f662] + - @faustjs/core@0.12.0 diff --git a/packages/react/package.json b/packages/react/package.json index 8c038b987..303a28bc9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@faustjs/react", - "version": "0.11.0", + "version": "0.12.0", "description": "This module helps you use WordPress as a Headless CMS with React", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js", @@ -79,7 +79,7 @@ }, "dependencies": { "@gqty/react": "^2.0.0", - "@faustjs/core": "^0.11.0", + "@faustjs/core": "^0.12.0", "gqty": "^2.0.1", "graphql": ">=15.6", "lodash": "^4.17.21"