Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
pull_request:
branches: ["*"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -151,6 +155,41 @@ jobs:

- run: pnpm registry-deps:check

build:
runs-on: ubuntu-latest
name: pnpm build
steps:
- uses: actions/checkout@v6

# pnpm must be installed before setup-node so its built-in pnpm cache works
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.15.0
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install

- name: Restore Next.js build cache
uses: actions/cache@v4
with:
path: apps/www/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('apps/www/**/*.[jt]s', 'apps/www/**/*.[jt]sx', 'apps/www/**/*.mdx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('pnpm-lock.yaml') }}-

- name: Build
run: pnpm build
env:
NEXT_PUBLIC_APP_URL: https://magicui.design

registry-drift:
runs-on: ubuntu-latest
name: registry artifact drift check
Expand Down
3 changes: 3 additions & 0 deletions apps/www/.prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
registry/__index__.tsx
registry.json
public/registry.json
public/r/
32 changes: 21 additions & 11 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,31 @@ pre-commit:
commands:
build:registry:
glob: "**/registry/**/*.{ts,tsx}"
run: pnpm build:registry && git add --all
stage_fixed: true
typecheck:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm typecheck
stage_fixed: true
# www-scoped script only (the root build:registry also runs a
# whole-project lint:fix + format:fix). Stage generated artifacts
# by explicit path — never `git add --all`. CI's registry-drift job
# checks these same paths, so a new artifact path can't slip through.
run: >
pnpm --filter=www build:registry &&
git add apps/www/registry.json apps/www/registry/__index__.tsx
apps/www/public/registry.json apps/www/public/r
apps/www/public/llms.txt apps/www/public/llms-full.txt
lint:fix:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm lint:fix
root: "apps/www/"
glob: "*.{js,ts,cjs,mjs,jsx,tsx}"
run: pnpm exec eslint --fix --no-warn-ignored {staged_files}
stage_fixed: true
format:fix:silent:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm format:fix:silent
format:fix:
root: "apps/www/"
glob: "*.{js,ts,cjs,mjs,jsx,tsx,json,jsonc,mdx}"
run: pnpm exec prettier --log-level silent --write --cache {staged_files}
stage_fixed: true

pre-push:
commands:
typecheck:
run: pnpm typecheck

commit-msg:
commands:
"lint commit message":
Expand Down
Loading