diff --git a/.github/workflows/site-build.yaml b/.github/workflows/site-build.yaml index 915940198..9b27734b9 100644 --- a/.github/workflows/site-build.yaml +++ b/.github/workflows/site-build.yaml @@ -37,6 +37,29 @@ jobs: env: NODE_OPTIONS: --max_old_space_size=8192 run: pnpm build + + linksCheck: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Use Node.js 22 + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install dependencies + run: pnpm install + + - name: Test build website + env: + NODE_OPTIONS: --max_old_space_size=8192 + run: pnpm run check-links deploy: runs-on: ubuntu-latest diff --git a/package.json b/package.json index e338ec826..3f953c9df 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ ], "scripts": { "build": "node --max_old_space_size=8192 ./node_modules/vuepress/bin/vuepress.js build src", + "check-links": "node --max_old_space_size=8192 ./node_modules/vuepress/bin/vuepress.js build src -c ./src/.vuepress/config_check_links.ts", "clean-dev": "vuepress dev src --clean-cache", "dev": "vuepress dev src", "update-package": "npx vp-update", @@ -23,6 +24,7 @@ "@vuepress/bundler-vite": "2.0.0-rc.19", "@vuepress/helper": "2.0.0-rc.66", "@vuepress/plugin-docsearch": "2.0.0-rc.67", + "@vuepress/plugin-links-check": "2.0.0-rc.68", "mathjax-full": "3.2.2", "sass-embedded": "1.83.0", "vue": "3.5.13", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 870fc6aa7..6aba59c2f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@vuepress/plugin-docsearch': specifier: 2.0.0-rc.67 version: 2.0.0-rc.67(@algolia/client-search@5.15.0)(search-insights@2.17.0)(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) + '@vuepress/plugin-links-check': + specifier: 2.0.0-rc.68 + version: 2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) mathjax-full: specifier: 3.2.2 version: 3.2.2 @@ -808,51 +811,61 @@ packages: resolution: {integrity: sha512-QAg11ZIt6mcmzpNE6JZBpKfJaKkqTm1A9+y9O+frdZJEuhQxiugM05gnCWiANHj4RmbgeVJpTdmKRmH/a+0QbA==} cpu: [arm] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm-musleabihf@4.28.1': resolution: {integrity: sha512-dRP9PEBfolq1dmMcFqbEPSd9VlRuVWEGSmbxVEfiq2cs2jlZAl0YNxFzAQS2OrQmsLBLAATDMb3Z6MFv5vOcXg==} cpu: [arm] os: [linux] + libc: [musl] '@rollup/rollup-linux-arm64-gnu@4.28.1': resolution: {integrity: sha512-uGr8khxO+CKT4XU8ZUH1TTEUtlktK6Kgtv0+6bIFSeiSlnGJHG1tSFSjm41uQ9sAO/5ULx9mWOz70jYLyv1QkA==} cpu: [arm64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-arm64-musl@4.28.1': resolution: {integrity: sha512-QF54q8MYGAqMLrX2t7tNpi01nvq5RI59UBNx+3+37zoKX5KViPo/gk2QLhsuqok05sSCRluj0D00LzCwBikb0A==} cpu: [arm64] os: [linux] + libc: [musl] '@rollup/rollup-linux-loongarch64-gnu@4.28.1': resolution: {integrity: sha512-vPul4uodvWvLhRco2w0GcyZcdyBfpfDRgNKU+p35AWEbJ/HPs1tOUrkSueVbBS0RQHAf/A+nNtDpvw95PeVKOA==} cpu: [loong64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-powerpc64le-gnu@4.28.1': resolution: {integrity: sha512-pTnTdBuC2+pt1Rmm2SV7JWRqzhYpEILML4PKODqLz+C7Ou2apEV52h19CR7es+u04KlqplggmN9sqZlekg3R1A==} cpu: [ppc64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-riscv64-gnu@4.28.1': resolution: {integrity: sha512-vWXy1Nfg7TPBSuAncfInmAI/WZDd5vOklyLJDdIRKABcZWojNDY0NJwruY2AcnCLnRJKSaBgf/GiJfauu8cQZA==} cpu: [riscv64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-s390x-gnu@4.28.1': resolution: {integrity: sha512-/yqC2Y53oZjb0yz8PVuGOQQNOTwxcizudunl/tFs1aLvObTclTwZ0JhXF2XcPT/zuaymemCDSuuUPXJJyqeDOg==} cpu: [s390x] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-gnu@4.28.1': resolution: {integrity: sha512-fzgeABz7rrAlKYB0y2kSEiURrI0691CSL0+KXwKwhxvj92VULEDQLpBYLHpF49MSiPG4sq5CK3qHMnb9tlCjBw==} cpu: [x64] os: [linux] + libc: [glibc] '@rollup/rollup-linux-x64-musl@4.28.1': resolution: {integrity: sha512-xQTDVzSGiMlSshpJCtudbWyRfLaNiVPXt1WgdWTwWz9n0U12cI2ZVtWe/Jgwyv/6wjL7b66uu61Vg0POWVfz4g==} cpu: [x64] os: [linux] + libc: [musl] '@rollup/rollup-win32-arm64-msvc@4.28.1': resolution: {integrity: sha512-wSXmDRVupJstFP7elGMgv+2HqXelQhuNf+IS4V+nUpNVi/GUiBgDmfwD0UGN3pcAnWsgKG3I52wMOBnk1VHr/A==} @@ -1083,6 +1096,11 @@ packages: peerDependencies: vuepress: 2.0.0-rc.19 + '@vuepress/helper@2.0.0-rc.68': + resolution: {integrity: sha512-4TlvjNQEiwDCCzb6m5bgfTBGdcMXW+78kevkOBW+1bksYjX0B4Gp8tKfJvzz3YwuHr/FCZ92zhPfSvhsvC5c0g==} + peerDependencies: + vuepress: 2.0.0-rc.19 + '@vuepress/highlighter-helper@2.0.0-rc.66': resolution: {integrity: sha512-RxhUIR+GFXXjCy5aFHHLvIKPcyyDhyzmka7shV+xr/vaU+EDbnQFrF67qo9pLDfzJc0KKTL9cKo4CcjkAoZ/tQ==} peerDependencies: @@ -1155,6 +1173,11 @@ packages: peerDependencies: vuepress: 2.0.0-rc.19 + '@vuepress/plugin-links-check@2.0.0-rc.68': + resolution: {integrity: sha512-ZA4YZO2lms31/GBS97bmezO3B6wjXDGJTKciJSd1Yv6nmYnoV6X7TH/xJeMCOSAg7XlZrvYZ2I+LMx33ELQ7Fg==} + peerDependencies: + vuepress: 2.0.0-rc.19 + '@vuepress/plugin-markdown-ext@2.0.0-rc.66': resolution: {integrity: sha512-heSwOXrgh0hGDxDD6zCfi4xe1Uaz4GgguWdnWEMl1ewhssjjhC07be/FNt9wwWKjTJkkKHsdTUwyKV0R+mL3Gw==} peerDependencies: @@ -1272,12 +1295,21 @@ packages: '@vueuse/core@12.0.0': resolution: {integrity: sha512-C12RukhXiJCbx4MGhjmd/gH52TjJsc3G0E0kQj/kb19H3Nt6n1CA4DRWuTdWWcaFRdlTe0npWDS942mvacvNBw==} + '@vueuse/core@12.3.0': + resolution: {integrity: sha512-cnV8QDKZrsyKC7tWjPbeEUz2cD9sa9faxF2YkR8QqNwfofgbOhmfIgvSYmkp+ttSvfOw4E6hLcQx15mRPr0yBA==} + '@vueuse/metadata@12.0.0': resolution: {integrity: sha512-Yzimd1D3sjxTDOlF05HekU5aSGdKjxhuhRFHA7gDWLn57PRbBIh+SF5NmjhJ0WRgF3my7T8LBucyxdFJjIfRJQ==} + '@vueuse/metadata@12.3.0': + resolution: {integrity: sha512-M/iQHHjMffOv2npsw2ihlUx1CTiBwPEgb7DzByLq7zpg1+Ke8r7s9p5ybUWc5OIeGewtpY4Xy0R2cKqFqM8hFg==} + '@vueuse/shared@12.0.0': resolution: {integrity: sha512-3i6qtcq2PIio5i/vVYidkkcgvmTjCqrf26u+Fd4LhnbBmIT6FN8y6q/GJERp8lfcB9zVEfjdV0Br0443qZuJpw==} + '@vueuse/shared@12.3.0': + resolution: {integrity: sha512-X3YD35GUeW0d5Gajcwv9jdLAJTV2Jdb/Ll6Ii2JIYcKLYZqv5wxyLeKtiQkqWmHg3v0J0ZWjDUMVOw2E7RCXfA==} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3889,6 +3921,18 @@ snapshots: transitivePeerDependencies: - typescript + '@vuepress/helper@2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': + dependencies: + '@vue/shared': 3.5.13 + '@vueuse/core': 12.3.0(typescript@5.5.4) + cheerio: 1.0.0 + fflate: 0.8.2 + gray-matter: 4.0.3 + vue: 3.5.13(typescript@5.5.4) + vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) + transitivePeerDependencies: + - typescript + '@vuepress/highlighter-helper@2.0.0-rc.66(@vueuse/core@12.0.0(typescript@5.5.4))(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': dependencies: vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) @@ -4007,6 +4051,13 @@ snapshots: transitivePeerDependencies: - typescript + '@vuepress/plugin-links-check@2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': + dependencies: + '@vuepress/helper': 2.0.0-rc.68(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4))) + vuepress: 2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)) + transitivePeerDependencies: + - typescript + '@vuepress/plugin-markdown-ext@2.0.0-rc.66(markdown-it@14.1.0)(typescript@5.5.4)(vuepress@2.0.0-rc.19(@vuepress/bundler-vite@2.0.0-rc.19(@types/node@22.5.0)(sass-embedded@1.83.0)(typescript@5.5.4))(typescript@5.5.4)(vue@3.5.13(typescript@5.5.4)))': dependencies: '@mdit/plugin-container': 0.14.0(markdown-it@14.1.0) @@ -4225,14 +4276,31 @@ snapshots: transitivePeerDependencies: - typescript + '@vueuse/core@12.3.0(typescript@5.5.4)': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 12.3.0 + '@vueuse/shared': 12.3.0(typescript@5.5.4) + vue: 3.5.13(typescript@5.5.4) + transitivePeerDependencies: + - typescript + '@vueuse/metadata@12.0.0': {} + '@vueuse/metadata@12.3.0': {} + '@vueuse/shared@12.0.0(typescript@5.5.4)': dependencies: vue: 3.5.13(typescript@5.5.4) transitivePeerDependencies: - typescript + '@vueuse/shared@12.3.0(typescript@5.5.4)': + dependencies: + vue: 3.5.13(typescript@5.5.4) + transitivePeerDependencies: + - typescript + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: acorn: 8.12.1 diff --git a/src/.vuepress/config_check_links.ts b/src/.vuepress/config_check_links.ts new file mode 100644 index 000000000..537fa449d --- /dev/null +++ b/src/.vuepress/config_check_links.ts @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { linksCheckPlugin } from '@vuepress/plugin-links-check' +import { defineUserConfig } from 'vuepress'; +import config from './config.js'; + +if(config.plugins === undefined) config.plugins = []; +config.plugins = [...config.plugins,linksCheckPlugin({build: 'error'})]; + +export default defineUserConfig(config);