diff --git a/.github/workflows/update-trusted-stack-stats.yml b/.github/workflows/update-trusted-stack-stats.yml new file mode 100644 index 0000000000..00da138413 --- /dev/null +++ b/.github/workflows/update-trusted-stack-stats.yml @@ -0,0 +1,56 @@ +name: Update trusted stack stats + +on: + schedule: + # Weekly: Monday 06:00 UTC + - cron: '0 6 * * 1' + workflow_dispatch: + +permissions: {} + +defaults: + run: + shell: bash + +jobs: + update: + if: github.repository == 'voidzero-dev/vite-plus' && github.event.repository.fork == false + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.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 + + - uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1 + id: app-token + with: + client-id: ${{ secrets.APP_ID }} + private-key: ${{ secrets.APP_PRIVATE_KEY }} + + - name: Create or update PR + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 + with: + base: main + branch: chore/docs-trusted-stack-stats + title: 'chore(docs): refresh trusted stack stats' + sign-commits: true + token: ${{ steps.app-token.outputs.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..ccc996b689 100644 --- a/docs/.vitepress/theme/components/home/ProductivityGrid.vue +++ b/docs/.vitepress/theme/components/home/ProductivityGrid.vue @@ -6,6 +6,12 @@ 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');