diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000000..356b09af08 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,51 @@ +name: Check links with Lychee + +on: + push: + paths: + - "docs/**" + - "*.md" + branches: + - main + pull_request: + paths: + - "docs/**" + - "*.md" + branches: + - main + +# Remove default permissions of GITHUB_TOKEN for security +# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs +permissions: {} + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + # Cache lychee results (e.g. to avoid hitting rate limits) + - name: Restore lychee cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + # check links with Lychee + - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + + - name: Lychee link checker + uses: lycheeverse/lychee-action@ec7614d7605b47efb08dc370f6d0a71884cba944 # for v1.8.0 + with: + # arguments with file types to check + args: >- + --cache + --verbose + --no-progress + --max-cache-age=1d + './**/*.md' + './**/*.html' + # fail the action on broken links + fail: true + env: + # to be used in case rate limits are surpassed + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.gitignore b/.gitignore index a71c96a954..35388c4fd2 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,9 @@ packages/*/LICENSE .tmp .cache +# Lychee cache +.lycheecache + # Generated dirs dist .nuxt diff --git a/docs/3.api/4.advanced/2.kit.md b/docs/3.api/4.advanced/2.kit.md index 6cd6c3a525..57e5ae0c7f 100644 --- a/docs/3.api/4.advanced/2.kit.md +++ b/docs/3.api/4.advanced/2.kit.md @@ -123,7 +123,7 @@ Some examples of projects doing this already: - [histoire](https://github.com/histoire-dev/histoire/blob/main/packages/histoire-plugin-nuxt/src/index.ts) - [nuxt-vitest](https://github.com/danielroe/nuxt-vitest/blob/main/packages/nuxt-vitest/src/config.ts) -- [@storybook-vue/nuxt](https://github.com/storybook-vue/nuxt/blob/main/src/preset.ts) +- [@storybook-vue/nuxt](https://github.com/storybook-vue/storybook-nuxt/blob/main/packages/storybook-nuxt/src/preset.ts) Here is a brief example of how you might access the Vite config from a project; you could implement a similar approach to get the webpack configuration. diff --git a/docs/7.migration/2.configuration.md b/docs/7.migration/2.configuration.md index 46ec26e510..1f7aba5334 100644 --- a/docs/7.migration/2.configuration.md +++ b/docs/7.migration/2.configuration.md @@ -106,7 +106,7 @@ It will be much easier to migrate your application if you use Nuxt's TypeScript You can read more about Nuxt's TypeScript support [in the docs](/docs/guide/concepts/typescript). ::alert{icon=📦} -Nuxt can type-check your app using [`vue-tsc`](https://github.com/johnsoncodehk/volar/tree/master/vue-language-tools/vue-tsc) with `nuxi typecheck` command. +Nuxt can type-check your app using [`vue-tsc`](https://github.com/vuejs/language-tools/tree/master/packages/vue-tsc) with `nuxi typecheck` command. :: ### Migration diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000000..29a2267486 --- /dev/null +++ b/lychee.toml @@ -0,0 +1,13 @@ +# Cache the results of Lychee if ran locally in order to minimise the chance of rate limiting +cache = true +# Ignore all private link (such as localhost) to avoid errors +exclude_all_private = true +# HTTP status code: 429 (Too Many Requests) will also be treated as a valid link if Lychee gets rate limited +accept = [200, 429] +# Explicitly exclude some URLs +exclude = [ + "https://twitter.nuxt.dev/", + "https://github.com/nuxt/nuxt.com", + "https://github.com/nuxt/translations/discussions/4", + '(https?:\/\/github\.com\/)(.*\/)(generate)' +]