diff --git a/.github/workflows/update-trusted-stack-stats.yml b/.github/workflows/update-trusted-stack-stats.yml new file mode 100644 index 0000000000..67b0ccb6e2 --- /dev/null +++ b/.github/workflows/update-trusted-stack-stats.yml @@ -0,0 +1,48 @@ +name: Update trusted stack stats + +on: + schedule: + # Weekly: Monday 06:00 UTC + - cron: '0 6 * * 1' + workflow_dispatch: + +defaults: + run: + shell: bash + +jobs: + update: + if: github.repository == 'voidzero-dev/vite-plus' && github.event.repository.fork == false + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version-file: .node-version + + - name: Fetch npm and GitHub stats + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: node docs/.vitepress/theme/data/fetch-trusted-stack-stats.ts + + - name: Create or update PR + uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11 + with: + base: main + branch: chore/docs-trusted-stack-stats + title: 'chore(docs): refresh trusted stack stats' + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: 'chore(docs): refresh trusted stack stats' + add-paths: | + docs/.vitepress/theme/data/trusted-stack-stats.json + body: | + Automated update of trusted stack statistics on the docs homepage. + + - npm weekly downloads (last-week): vite, vitest, oxlint + - GitHub stars: vitejs/vite, vitest-dev/vitest, oxc-project/oxc diff --git a/docs/.vitepress/theme/components/home/FeatureCheck.vue b/docs/.vitepress/theme/components/home/FeatureCheck.vue index ef5f36a95d..5abdf242c8 100644 --- a/docs/.vitepress/theme/components/home/FeatureCheck.vue +++ b/docs/.vitepress/theme/components/home/FeatureCheck.vue @@ -18,7 +18,7 @@ import oxcIcon from '@assets/icons/oxc-light.svg'; formatting
  • - 600+ ESLint compatible + 750+ ESLint compatible rules
  • diff --git a/docs/.vitepress/theme/components/home/ProductivityGrid.vue b/docs/.vitepress/theme/components/home/ProductivityGrid.vue index e747139e65..3e14266e1b 100644 --- a/docs/.vitepress/theme/components/home/ProductivityGrid.vue +++ b/docs/.vitepress/theme/components/home/ProductivityGrid.vue @@ -6,6 +6,11 @@ import productivitySecurityImage from '@local-assets/productivity-security.png'; import tileOxc from '@local-assets/tiles/oxc.png'; import tileVite from '@local-assets/tiles/vite.png'; import tileVitest from '@local-assets/tiles/vitest.png'; +import { trustedStackById } from '../../data/trusted-stack-stats'; + +const viteStack = trustedStackById('vite'); +const vitestStack = trustedStackById('vitest'); +const oxcStack = trustedStackById('oxc');