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

Check links on deployments, as well as daily via cron #125

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -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 --skip-file linkcheck-ignore.txt
1 change: 1 addition & 0 deletions linkcheck-ignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\.css$
8 changes: 4 additions & 4 deletions website/src/pages/docs/client/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Explain term='documents'>`Document`</Explain> 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 <Explain term='fragments'>fragment</Explain>.
- `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 <Explain term='documents'>`Document`</Explain>.
- `fuse/graphql.ts`: This file contains a translation of your GraphQL schema to TypeScript types.
It also contains the <Explain term='documents'>`Document`</Explain> 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.

Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/docs/client/javascript/nextjs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`.

Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Now, run `npx fuse dev` (or `pnpm fuse dev`, `yarn fuse dev`, or `bun fuse dev`)

</Steps>

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).
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).