From d2ab282596b723d086a662b490a5359946991d0c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Oct 2021 19:23:06 +0000 Subject: [PATCH] Version Packages --- .changeset/fresh-ads-know.md | 5 -- .changeset/large-humans-sing.md | 55 ------------- .changeset/six-dingos-shake.md | 27 ------- .changeset/tough-glasses-fix.md | 22 ------ .changeset/two-bugs-fix.md | 7 -- .changeset/weak-sheep-work.md | 5 -- examples/next/getting-started/package.json | 4 +- packages/core/CHANGELOG.md | 79 +++++++++++++++++++ packages/core/package.json | 2 +- packages/next/CHANGELOG.md | 89 ++++++++++++++++++++++ packages/next/package.json | 6 +- packages/react/CHANGELOG.md | 64 ++++++++++++++++ packages/react/package.json | 4 +- 13 files changed, 240 insertions(+), 129 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/tough-glasses-fix.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/tough-glasses-fix.md b/.changeset/tough-glasses-fix.md deleted file mode 100644 index 486b80b96..000000000 --- a/.changeset/tough-glasses-fix.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -'@faustjs/core': minor ---- - -Introduced the `apiRouter` that will handle all of the Faust.js related endpoints for you. - -## Breaking Changes - -With the introduction of `apiRouter` we have introduced a breaking change. You will need to remove your `pages/api/auth/wpe-headless.ts` file, and create a new file, `pages/api/faust/[[...route]].ts` with the following content: - -```ts -import 'faust.config'; -import { apiRouter } from '@faustjs/core/api'; - -export default apiRouter; -``` - -**Note**: The `[[...route]]` naming convention is a [Next.js convention for a catch-all route.](https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes) - -### Config changes - -The `apiEndpoint` and `apiUrl` config options have been removed in exchange for the `apiBasePath` option. This option specifies the base path for all of the Faust.js endpoints. The `blogUrlPrefix` is no longer necessary and has been removed from the config interface. 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..0bda709c7 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,79 @@ +# @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). + +- f0f2706: Introduced the `apiRouter` that will handle all of the Faust.js related endpoints for you. + + ## Breaking Changes + + With the introduction of `apiRouter` we have introduced a breaking change. You will need to remove your `pages/api/auth/wpe-headless.ts` file, and create a new file, `pages/api/faust/[[...route]].ts` with the following content: + + ```ts + import 'faust.config'; + import { apiRouter } from '@faustjs/core/api'; + + export default apiRouter; + ``` + + **Note**: The `[[...route]]` naming convention is a [Next.js convention for a catch-all route.](https://nextjs.org/docs/routing/dynamic-routes#optional-catch-all-routes) + + ### Config changes + + The `apiEndpoint` and `apiUrl` config options have been removed in exchange for the `apiBasePath` option. This option specifies the base path for all of the Faust.js endpoints. The `blogUrlPrefix` is no longer necessary and has been removed from the config interface. + +### 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 fbebdd781..6d54ac616 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..a8280fa0b 100644 --- a/packages/next/CHANGELOG.md +++ b/packages/next/CHANGELOG.md @@ -0,0 +1,89 @@ +# @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 [f0f2706] +- 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..a9af6457d 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -0,0 +1,64 @@ +# @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 [f0f2706] +- 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"