Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #523

Merged
merged 1 commit into from
Oct 5, 2021
Merged

Version Packages #523

merged 1 commit into from
Oct 5, 2021

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 30, 2021

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to canary, this PR will be updated.

Releases

@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:

    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:

    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:

    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.

    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

@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:

    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:

    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.

    import { client } from 'client';
    
    export default function Page() {
      const { isLoading, isAuthenticated, authResult } = client.auth.useAuth({
        shouldRedirect: false,
      });
    
      if (isLoading) {
        return <p>Loading...</p>;
      }
    
      if (!isAuthenticated) {
        return (
          <p>You need to be authenticated to see this content. Please login.</p>
        );
      }
    
      return <p>Authenticated content</p>;
    }

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

@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:

    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:

    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

@github-actions github-actions bot requested a review from a team September 30, 2021 22:12
@github-actions github-actions bot force-pushed the changeset-release/canary branch 5 times, most recently from 048a3e8 to de2a8ac Compare October 5, 2021 19:04
@wjohnsto wjohnsto merged commit 1b96b39 into canary Oct 5, 2021
@wjohnsto wjohnsto deleted the changeset-release/canary branch October 5, 2021 19:29
wjohnsto added a commit that referenced this pull request Oct 5, 2021
* fix: (#500) setting appropriate faust links from the plugin (#501)

* make: (#504) release `0.6.1` (#505)

* chore: update package-lock.json for 0.11.0 (#506)

* Use `.env.local` instead of `.env` (#512)

* Use `.env.local` instead of `.env`

* Exclude `.env.local.sample` from gitignore

* fix: (#503) remove refresh token logic (#507)

Remove the existing refresh token upon an unauthorized response from the fetch token endpoint

* Implement changesets (#521)

* Implement changesets

* Update changesets config

* Release faust packages in lockstep

* changeset commands

* Create version:status command

* Create release packages action

* Update contributing guide

* Include changeset to kick off PR

* Remove old version script

* Fix node version in release packages action (#522)

* Implement `logoutHandler` middleware (#525)

* Implment `logoutHandler` middleware

* Create changeset

* chore: include gqty as a monorepo dev dependency (#527)

* Add option to disable redirect in `useAuth` hook when a user is unauthenticated (#531)

* Add option to disable redirect in `useAuth` hook

Introduced `UseAuthOptions` that allows a user to specify the `shouldRedirect` property. This property defines if the `useAuth` hook should redirect to the appropriate url when unauthenticated.

* `UseAuthOptions` docs

Describe the new `UseAuthOptions` properties and provide examples

* `UseAuthOptions` changeset

* Changeset for `Content-Type` header fix

* Fix middleware tests

Added `setHeader` to res mock

* Use lodash defaults for `UseAuthOptions`

* e2e test improvements (#530)

* chore: avoid using default mysql port on host machine

* chore: update broken test

* chore: update broken preview test

* chore: update e2e test instructions

* docs: formatting and wording updates

* docs: .env.test.local -> .env.test

* Feat isr timing (#520)

* feat: (#516) adding a next config, moving nextConfig to withFaust

* fix: removing try/catch from getProps and adding beforeEach to getProps.test for creating config

* feat: (#516) configuration is separate per package

* feat: (#516) updating tests, docs, exports, and examples to use config instead of headlessConfig

* doc: (#516) adding changeset for ISR timing configuration

* Introduce `apiRouter` to handle Faust.js API endpoints (#532)

* Create API Router node handler for api middleware

Removed the `apiEndpoint` config option in exchange for `apiBasePath`. Additionally, the `pages/api/auth/wpe-headless.ts` file was deleted in exchange for the API route, `pages/api/faust/[[...route]].ts`

* Rename `faustApiRouter` to `apiRouter`

* Update preview docs to use `apiRouter`

* Import Faust API endpoint partials from config

* Do not expose the makeup of the Faust API  on 404

* feat: (#533) separating server and client exports, dynamically importing server code where necessary

* Use `headlessConfig` -> `config`

* Remove old params from `config()`

Co-authored-by: William Johnston <will@wwj.dev>

* Version Packages (#523)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix remove old publish script (#534)

* Remove old publish script

* Remove package-lock on release

* Remove package-lock.json in all actions

* Release Notes for 0.12.0 (#535)

* Authentication Docs (#484)

* WIP: Auth docs

* docs: auth strategies

* docs: auth hooks

* docs: misc auth fixes

* docs: making auth requests

* docs: auth final touches

* docs: update auth page desc

* Add pr to `0.11.0` release notes

* Update release notes for 0.12.0

* Make 0.12.0 breaking changes more clear

* make breaking changes clearer in 0.12.0

Co-authored-by: William Johnston <will@wwj.dev>

Co-authored-by: Will Johnston <wjohnsto@users.noreply.github.com>
Co-authored-by: Andrew Matthews <andrew.matthews@wpengine.com>
Co-authored-by: William Johnston <will@wwj.dev>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant