Skip to content

Commit

Permalink
chore: 🤖 Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
ianzone committed Feb 4, 2025
1 parent 0894ba2 commit c14b2c7
Show file tree
Hide file tree
Showing 17 changed files with 182 additions and 10,666 deletions.
48 changes: 8 additions & 40 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,48 +9,21 @@ permissions:
pull-requests: write

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: cache
uses: actions/cache@v4
with:
path: ~/.local/share/pnpm
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v4
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- name: Install
if: steps.cache.outputs.cache-hit != 'true'
run: pnpm i

release:
needs: prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ~/.local/share/pnpm
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
version: latest
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- run: pnpm i && pnpm run build
- run: pnpm run release
- run: bun i --frozen-lockfile && bun i -g @antfu/ni npm
- run: nr build
- run: nr release
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -67,18 +40,13 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v4
with:
path: ~/.local/share/pnpm
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v4
- uses: oven-sh/setup-bun@v2
with:
version: latest
bun-version: latest
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- run: pnpm i && pnpm run build:storybook
- run: bun i --frozen-lockfile && bun run build:storybook
- uses: chromaui/action@latest
with:
storybookBuildDir: storybook
Expand Down
5 changes: 4 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Preview } from "@storybook/react";
import type { Preview } from '@storybook/react';

const preview: Preview = {
parameters: {
Expand All @@ -9,6 +9,9 @@ const preview: Preview = {
},
},
},

// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],
};

export default preview;
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
npm i antd-enhanced
```

// TODO: storybook 8.5 发布的时候,将包管理器改为 bun
// TODO: 完善文档

hooks ref

Expand Down
Binary file added bun.lockb
Binary file not shown.
76 changes: 38 additions & 38 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
# yaml-language-server:$schema=./node_modules/lefthook/schema.json
# https://evilmartians.github.io/lefthook/configuration/

pre-commit:
piped: true
follow: true
commands:
staged:
priority: 1
run: echo {staged_files} | tr ' ' '\n'
security:
priority: 2
run: gitleaks protect --staged --no-banner
unused: # https://knip.dev/reference/cli
priority: 3
run: na knip --no-exit-code --no-config-hints
typescript:
priority: 4
glob: "*.{ts,tsx}"
run: na tsc --noEmit
biome:
priority: 5
jobs:
- name: Linting & Formatting
glob: "*.{ts,tsx,js,jsx,json,jsonc,css}"
run: na biome check --fix {staged_files} --reporter summary
stage_fixed: true
vitest:
priority: 6
glob: "*/{hooks,utils,services}*.{ts,js}"
run: na vitest related --run {staged_files}
storybook:
priority: 7
glob: "*/{components,containers,pages}*.{ts,tsx,js,jsx}"
run: echo 'use storybook'

- name: QA, Audit, Misc
group:
parallel: true
jobs:
# SECTION - QA
- name: typescript
glob: "*.{ts,tsx}"
run: na tsc
- name: vitest
glob: "*.{ts,tsx,js,jsx}"
run: na vitest related --run {staged_files}
- name: storybook
glob: "*.{tsx,jsx}"
run: echo 'use storybook'
# SECTION - Audit
- name: gitleaks
run: gitleaks protect --staged --no-banner
- name: audit
run: echo audit
- name: license
run: echo license
#SECTION - Misc
- name: knip
run: na knip --no-exit-code --no-config-hints

prepare-commit-msg:
commands:
commit:
interactive: true
run: na git-cz --hook
env:
LEFTHOOK: "0"
69 changes: 37 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,67 @@
"lint": "biome check --fix src",
"build": "vite build",
"build:storybook": "storybook build --docs --output-dir storybook",
"dev": "storybook dev -p 6006",
"dev:cc": "storybook dev -p 6006 --force-build-preview",
"dev": "storybook dev -p 6006 --no-open",
"dev:cc": "storybook dev -p 6006 --no-open --force-build-preview",
"test": "nr test:ts && nr test:tsx",
"test:ts": "vitest run --coverage",
"test:tsx": "concurrently -k \"na storybook dev --exact-port 6006 --ci --quiet\" \"nr test:story\"",
"test:story": "wait-on http://localhost:6006 && test-storybook --coverage",
"postinstall": "lefthook install",
"commit": "git add -A && git-cz",
"commit": "git add -A && git commit --no-edit",
"squash": "node ./squash.mjs && git commit --no-edit --no-verify",
"release": "semantic-release",
"update": "nlx storybook@latest upgrade",
"chromatic": "chromatic --exit-zero-on-changes"
},
"dependencies": {
"@rapideditor/country-coder": "^5.3.1",
"@twemoji/api": "^15.1.0",
"libphonenumber-js": "^1.11.17",
"es-toolkit": "^1.32.0",
"libphonenumber-js": "^1.11.19",
"react-error-boundary": "^5.0.0",
"react-icons": "^5.4.0"
},
"peerDependencies": {
"antd": "^5.22.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
"antd": "^5.23.3",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@chromatic-com/storybook": "^3.2.3",
"@semantic-release/exec": "^6.0.3",
"@storybook/addon-a11y": "^8.4.7",
"@chromatic-com/storybook": "^3.2.4",
"@semantic-release/exec": "^7.0.3",
"@storybook/addon-a11y": "^8.5.3",
"@storybook/addon-coverage": "^1.0.5",
"@storybook/addon-essentials": "^8.4.7",
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
"@storybook/react-vite": "^8.4.7",
"@storybook/test": "^8.4.7",
"@storybook/addon-essentials": "^8.5.3",
"@storybook/addon-interactions": "^8.5.3",
"@storybook/addon-links": "^8.5.3",
"@storybook/blocks": "^8.5.3",
"@storybook/react": "^8.5.3",
"@storybook/react-vite": "^8.5.3",
"@storybook/test": "^8.5.3",
"@storybook/test-runner": "^0.21.0",
"@testing-library/react": "^16.1.0",
"@types/react": "^18.3.18",
"@types/react-dom": "^18.3.5",
"@testing-library/react": "^16.2.0",
"@types/react": "^19.0.8",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react-swc": "^3.7.2",
"@vitest/coverage-v8": "^2.1.8",
"biome-extends": "^1.0.1",
"chromatic": "^11.22.0",
"@vitest/coverage-v8": "^3.0.5",
"ajv": "^8.17.1",
"biome-extends": "^1.1.0",
"chromatic": "^11.25.2",
"concurrently": "^9.1.2",
"git-cz": "^4.9.0",
"happy-dom": "^16.3.0",
"knip": "^5.41.1",
"lefthook": "^1.10.1",
"happy-dom": "^16.8.1",
"knip": "^5.43.6",
"lefthook": "^1.10.10",
"semantic-release": "^24.2.1",
"storybook": "^8.4.7",
"typescript": "^5.7.2",
"vite": "^6.0.7",
"vite-plugin-dts": "^4.4.0",
"vitest": "^2.1.8",
"wait-on": "^8.0.1"
"storybook": "^8.5.3",
"typescript": "^5.7.3",
"vite": "^6.0.11",
"vite-plugin-dts": "^4.5.0",
"vitest": "^3.0.5",
"wait-on": "^8.0.2",
"zx": "^8.3.2"
},
"engines": {
"node": ">=22",
Expand Down
Loading

0 comments on commit c14b2c7

Please sign in to comment.