diff --git a/docs/.config/lychee.toml b/.config/lychee.toml similarity index 50% rename from docs/.config/lychee.toml rename to .config/lychee.toml index 75ec001d9783..7470adcf3ed0 100644 --- a/docs/.config/lychee.toml +++ b/.config/lychee.toml @@ -4,8 +4,20 @@ verbose = "debug" no_progress = true -# Requires CAPTCHA verification -exclude = ["https://faucet.calibnet.chainsafe-fil.io/funds.html"] -timeout = 60 +exclude_path = [ + "./node_modules", + "./docs/node_modules", + "./documentation", + "./target" +] +exclude = [ + # Avoid Github rate limits + "github.com/ChainSafe/forest", + # Requires CAPTCHA verification + "faucet.calibnet.chainsafe-fil.io/funds.html" +] +timeout = 30 max_retries = 6 retry_wait_time = 10 + +output = "lychee-report.md" \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 6e646d1a2e57..000000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Docs - -# Cancel workflow if there is a new change to the branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -on: - push: - branches: - - main - paths: - - '**.md' - - '.github/workflows/docs.yml' - merge_group: - pull_request: - branches: - - main - paths: - - '**.md' - - '.github/workflows/docs.yml' - -jobs: - check-docs: - name: Markdown Lint - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Lint Markdown - run: make md-check - - name: Link check - uses: lycheeverse/lychee-action@v2.1.0 - with: - args: '*.md .github/*.md .github/**/*.md .config/*.md' - # Fail action on broken links - fail: true diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 000000000000..cb08d8fdfbb1 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,51 @@ +name: Link Checker + +on: + workflow_dispatch: + schedule: + # Run daily at 9am + - cron: "00 9 * * *" + push: + branches: + - main + paths: + - "**.md" + - "**.mdx" + - "**.html" + - ".github/workflows/link-check.yml" + merge_group: + pull_request: + branches: + - main + paths: + - "**.md" + - "**.mdx" + - "**.html" + - ".github/workflows/link-check.yml" + +jobs: + link-check: + name: Link Check + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + args: --config ./.config/lychee.toml './**/*.md' './**/*.mdx' './**/*.html' + + - name: Create Issue From File + if: env.lychee_exit_code != 0 && github.event_name == 'schedule' + uses: peter-evans/create-issue-from-file@v5 + with: + title: Link Checker Report + content-filepath: ./lychee-report.md + + - name: Fail job on error + if: env.lychee_exit_code != 0 && github.event_name != 'schedule' + run: exit 1 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 367b7bd99bcc..b43bcd96de3a 100644 --- a/.gitignore +++ b/.gitignore @@ -388,3 +388,5 @@ rust-project.json # .pnp.* # End of https://www.toptal.com/developers/gitignore/api/go,rust,rust-analyzer,osx,visualstudiocode,intellij+all,yarn,node,ruby + +lychee-report.md \ No newline at end of file diff --git a/.lycheeignore b/.lycheeignore deleted file mode 100644 index 3267ed33694d..000000000000 --- a/.lycheeignore +++ /dev/null @@ -1,2 +0,0 @@ -http://open-rpc.org/ -https://github.com/ diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 36565a92e421..fd8b2b05ba05 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,9 +1,10 @@ { // This file is not used in compilation. It is here just for a nice editor experience. - "extends": "@tsconfig/docusaurus/tsconfig.json", + "extends": "@docusaurus/tsconfig", "compilerOptions": { "baseUrl": ".", "skipLibCheck": true, "module": "Node16" } } + diff --git a/lychee.toml b/lychee.toml deleted file mode 100644 index 5c67cac2047d..000000000000 --- a/lychee.toml +++ /dev/null @@ -1,10 +0,0 @@ -# This is the common config used by lychee, our dead html link checker -# See the github actions workflows to see the inputs -# https://github.com/lycheeverse/lychee/blob/2109470dc380eaf66944b6bcfa86230e0a58e58f/lychee-bin/src/options.rs#L152 - -verbose = "debug" -no_progress = true -exclude = ["twitter.com"] -timeout = 60 -max_retries = 6 -retry_wait_time = 10 diff --git a/package.json b/package.json index 2eecc62d2e1f..979fb00a4e57 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "root", "private": true, "devDependencies": { + "@docusaurus/tsconfig": "^3.6.3", "prettier": "^3.3.3" }, "scripts": { diff --git a/yarn.lock b/yarn.lock index 920ccee94b7e..468ac49d701c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,23 +1,13 @@ -# This file is generated by running "yarn install" inside your project. -# Manual changes might be lost - proceed with caution! +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 -__metadata: - version: 8 - cacheKey: 10c0 -"prettier@npm:^3.3.3": - version: 3.3.3 - resolution: "prettier@npm:3.3.3" - bin: - prettier: bin/prettier.cjs - checksum: 10c0/b85828b08e7505716324e4245549b9205c0cacb25342a030ba8885aba2039a115dbcf75a0b7ca3b37bc9d101ee61fab8113fc69ca3359f2a226f1ecc07ad2e26 - languageName: node - linkType: hard +"@docusaurus/tsconfig@^3.6.3": + version "3.6.3" + resolved "https://registry.yarnpkg.com/@docusaurus/tsconfig/-/tsconfig-3.6.3.tgz#8af20c45f0a67e193debedcb341c0a1e78b1dd63" + integrity sha512-1pT/rTrRpMV15E4tJH95W5PrjboMn5JkKF+Ys8cTjMegetiXjs0gPFOSDA5hdTlberKQLDO50xPjMJHondLuzA== -"root@workspace:.": - version: 0.0.0-use.local - resolution: "root@workspace:." - dependencies: - prettier: "npm:^3.3.3" - languageName: unknown - linkType: soft +prettier@^3.3.3: + version "3.4.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.4.2.tgz#a5ce1fb522a588bf2b78ca44c6e6fe5aa5a2b13f" + integrity sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==