From 72666b2dc00beb6cc226cd67c9b0d8dbc05675d0 Mon Sep 17 00:00:00 2001 From: Marko Locher Date: Wed, 17 Jan 2024 15:06:24 +0100 Subject: [PATCH 1/3] Check links on deployments, as well as via cron --- .github/workflows/linkcheck.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/linkcheck.yml diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 00000000..b392b796 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,31 @@ +name: Check Links + +on: + # Allow manually triggering this workflow. + workflow_dispatch: + + # Run onn deployments + deployment_status: + + # Also run it every day at 4.15am UTC + schedule: + - cron: '15 4 * * *' + +env: + SITE_URL: "https://fusedata.dev/" + +jobs: + linkcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set site URL from the deployment status information + if: ${{ github.event_name == 'deployment_status' }} + run: | + echo "SITE_URL=${{github.event.deployment_status.environment_url}}" >> "$GITHUB_ENV" + + - name: Check links on the live site + uses: filiph/linkcheck@3.0.0 + with: + arguments: --external --nice $SITE_URL From e8073d14d5f91f78e79fb7cb173ff1bd0f9b738e Mon Sep 17 00:00:00 2001 From: Max Stoiber Date: Fri, 19 Jan 2024 06:57:08 -0800 Subject: [PATCH 2/3] Fix links --- website/src/pages/docs/client/index.mdx | 8 ++++---- website/src/pages/docs/client/javascript/nextjs.mdx | 2 +- website/src/pages/docs/index.mdx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/website/src/pages/docs/client/index.mdx b/website/src/pages/docs/client/index.mdx index 188e4f4e..344bbbeb 100644 --- a/website/src/pages/docs/client/index.mdx +++ b/website/src/pages/docs/client/index.mdx @@ -29,18 +29,18 @@ help with typing your results, variables and facilitating the client-methods. Let's go over each file: -- [`fuse/client.ts`](/docs/basics/client/client-components): This is the main entry-point for React client components (including `'use client'` in Next.js's App Router). It exports the `useQuery`/... hooks which you can use in your +- [`fuse/client.ts`](/docs/client/javascript/nextjs#client-components): This is the main entry-point for React client components (including `'use client'` in Next.js's App Router). It exports the `useQuery`/... hooks which you can use in your client components to talk to your API. -- [`fuse/server.ts`](/docs/basics/client/server-components): This is the main entry-point for React server components and server actions. It exports an `execute` function +- [`fuse/server.ts`](/docs/client/javascript/nextjs#server-components): This is the main entry-point for React server components and server actions. It exports an `execute` function which takes a `Document` and `variables` and will execute the operation in-process without an extra HTTP request to the API. -- [`fuse/fragment-masking.ts`](/docs/basics/client/best-practices): The `readFragment` and `FragmentOf` helpers are exported from here, +- [`fuse/fragment-masking.ts`](/docs/client/best-practices): The `readFragment` and `FragmentOf` helpers are exported from here, these helpers basically ensure that the props you pass in will be reduced to the selection of fields of your fragment. - `fuse/gql.ts`: The `graphql()` function is exported from here, this helper ensures that both the `Result` and `Variables` are typed correctly for a given `Document`. - `fuse/graphql.ts`: This file contains a translation of your GraphQL schema to TypeScript types. It also contains the `Document` type which is a helper type to type your GraphQL documents. -- [`fuse/pages.ts`](/docs/basics/client/page-components) (Next.js-only): This is the main entry-point for the Next.js `/pages` router. +- [`fuse/pages.ts`](/docs/client/javascript/nextjs#pages-router) (Next.js-only): This is the main entry-point for the Next.js `/pages` router. It exports the `withUrqlClinet` and `initUrqlClient` to work with `getServerSideProps`, ... As well as React hooks which you can use in your components. diff --git a/website/src/pages/docs/client/javascript/nextjs.mdx b/website/src/pages/docs/client/javascript/nextjs.mdx index 563c37ce..7c91eb3d 100644 --- a/website/src/pages/docs/client/javascript/nextjs.mdx +++ b/website/src/pages/docs/client/javascript/nextjs.mdx @@ -182,7 +182,7 @@ pass on the data to child components. ### Server actions -We can also invoke mutations as part of a [`server-action`](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations#how-server-actions-work) +We can also invoke mutations as part of a [`server-action`](https://nextjs.org/docs/app/building-your-application/data-fetching/forms-and-mutations) This requires us to create a new file, for example in this example we'll call a mutation with a name argument that returns us `Hello ${args.name}`. diff --git a/website/src/pages/docs/index.mdx b/website/src/pages/docs/index.mdx index 1be3e24a..a399c728 100644 --- a/website/src/pages/docs/index.mdx +++ b/website/src/pages/docs/index.mdx @@ -72,4 +72,4 @@ Now, run `npx fuse dev` (or `pnpm fuse dev`, `yarn fuse dev`, or `bun fuse dev`) -You've now got Fuse setup! 🎉 Next, learn how to [query your Fuse API from the client](/docs/basics/client) and learn more about [the Fuse Method for managing APIs](/docs/fuse-method). \ No newline at end of file +You've now got Fuse setup! 🎉 Next, learn how to [query your Fuse API from the client](/docs/client) and learn more about [the Fuse Method for managing APIs](/docs/fuse-method). \ No newline at end of file From 4e4633e5f6d365eb41393faf6c32192c18f199e6 Mon Sep 17 00:00:00 2001 From: Max Stoiber Date: Fri, 19 Jan 2024 08:11:09 -0800 Subject: [PATCH 3/3] Add ignore file for the .css files --- .github/workflows/linkcheck.yml | 2 +- linkcheck-ignore.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 linkcheck-ignore.txt diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index b392b796..e1de1c3f 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -28,4 +28,4 @@ jobs: - name: Check links on the live site uses: filiph/linkcheck@3.0.0 with: - arguments: --external --nice $SITE_URL + arguments: --external --nice $SITE_URL --skip-file linkcheck-ignore.txt diff --git a/linkcheck-ignore.txt b/linkcheck-ignore.txt new file mode 100644 index 00000000..3754cbe1 --- /dev/null +++ b/linkcheck-ignore.txt @@ -0,0 +1 @@ +\.css$