Skip to content

Commit 6aac89c

Browse files
authored
chore: standardize repository setup (#299)
* chore: standardize repository setup * chore: simplify lint-staged prettier command * ci: allow surge preview status updates * chore: remove cloudflare preview and now-build * docs: standardize README release details * ci: make surge preview non-blocking * ci: keep surge preview as fallback * docs: refine README usage and ecosystem note * ci: isolate surge preview token * docs: add Chinese README * docs: add Ant Design logo to README * docs: refine bilingual README branding * chore: standardize rc tooling and docs * chore: address standardization review comments * chore: include father config in type checks * ci: update GitHub Actions versions * ci: use resolvable CodeQL action ref * chore: ignore dumi build output * docs: add license file * ci: use actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * chore: refine preview workflow ignores * chore: add missing prettier dependency * docs: document dumi dev server port * chore: standardize husky configuration * docs: align readme badge layout * chore: standardize package type entry * docs: normalize readme badges * ci: limit reusable workflow secrets * ci: restore reusable workflow compatibility * docs: polish zh-CN readme wording * ci: narrow surge preview permissions * chore: limit reusable workflow secrets
1 parent 8678193 commit 6aac89c

16 files changed

Lines changed: 420 additions & 162 deletions

.dumirc.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import { defineConfig } from 'dumi';
22

3+
const basePath = process.env.GH_PAGES ? '/checkbox/' : '/';
4+
const publicPath = basePath;
5+
36
export default defineConfig({
7+
outputPath: 'docs-dist',
8+
base: basePath,
9+
publicPath,
410
themeConfig: {
511
name: 'Checkbox',
612
},

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: ant-design
2+
open_collective: ant-design

.github/dependabot.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
version: 2
22
updates:
3-
- package-ecosystem: npm
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "21:00"
8-
open-pull-requests-limit: 10
9-
ignore:
10-
- dependency-name: react-dom
11-
versions:
12-
- 17.0.1
13-
- dependency-name: np
14-
versions:
15-
- 7.2.0
16-
- 7.3.0
17-
- 7.4.0
18-
- dependency-name: less
19-
versions:
20-
- 4.1.0
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: weekly
7+
day: monday
8+
time: '21:00'
9+
timezone: Asia/Shanghai
10+
open-pull-requests-limit: 10
11+
12+
- package-ecosystem: github-actions
13+
directory: '/'
14+
schedule:
15+
interval: weekly
16+
day: monday
17+
time: '21:00'
18+
timezone: Asia/Shanghai
19+
open-pull-requests-limit: 10

.github/workflows/codeql.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
name: "CodeQL"
1+
name: 'CodeQL'
22

33
on:
44
push:
5-
branches: [ "master" ]
5+
branches: ['master']
66
pull_request:
7-
branches: [ "master" ]
7+
branches: ['master']
88
schedule:
9-
- cron: "8 20 * * 1"
9+
- cron: '8 20 * * 1'
1010

1111
jobs:
1212
analyze:
@@ -20,22 +20,24 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
language: [ javascript ]
23+
language: [javascript]
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@v7
28+
with:
29+
persist-credentials: false
2830

2931
- name: Initialize CodeQL
30-
uses: github/codeql-action/init@v2
32+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3133
with:
3234
languages: ${{ matrix.language }}
3335
queries: +security-and-quality
3436

3537
- name: Autobuild
36-
uses: github/codeql-action/autobuild@v2
38+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
3739

3840
- name: Perform CodeQL Analysis
39-
uses: github/codeql-action/analyze@v2
41+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
4042
with:
41-
category: "/language:${{ matrix.language }}"
43+
category: '/language:${{ matrix.language }}'

.github/workflows/main.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: ✅ test
22
on: [push, pull_request]
3+
permissions:
4+
contents: read
35
jobs:
46
test:
5-
uses: react-component/rc-test/.github/workflows/test.yml@main
6-
secrets: inherit
7+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
8+
secrets:
9+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/react-doctor.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: React Doctor
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
push:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
issues: write
13+
statuses: write
14+
15+
concurrency:
16+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
react-doctor:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v7
24+
with:
25+
fetch-depth: 0
26+
persist-credentials: false
27+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
checks: write
10+
11+
jobs:
12+
preview:
13+
runs-on: ubuntu-latest
14+
concurrency:
15+
group: surge-preview-${{ github.event.pull_request.number }}
16+
cancel-in-progress: true
17+
env:
18+
PREVIEW: true
19+
steps:
20+
- uses: actions/checkout@v7
21+
with:
22+
persist-credentials: false
23+
- name: Check Surge token
24+
id: surge-token
25+
env:
26+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
27+
run: |
28+
if [ -n "$SURGE_TOKEN" ]; then
29+
echo "enabled=true" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "enabled=false" >> "$GITHUB_OUTPUT"
32+
fi
33+
- name: Build preview
34+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
35+
run: |
36+
npm install
37+
npm run build
38+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
39+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
40+
env:
41+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
42+
with:
43+
surge_token: ${{ env.SURGE_TOKEN }}
44+
github_token: ${{ secrets.GITHUB_TOKEN }}
45+
dist: docs-dist
46+
failOnError: false
47+
setCommitStatus: false
48+
- name: Skip Surge preview
49+
if: ${{ steps.surge-token.outputs.enabled != 'true' }}
50+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ package-lock.json
3939
.umi-production
4040
.umi-test
4141
.docs
42+
docs-dist
4243

4344
pnpm-lock.yaml
4445

45-
bun.lockb
46+
bun.lockb

.husky/pre-commit

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
4-
npx --no-install lint-staged --quiet
1+
npx lint-staged

.prettierignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
node_modules
2+
coverage
3+
docs-dist
4+
dist
5+
es
6+
lib
7+
.dumi/tmp
8+
.dumi/tmp-production
9+
.vercel
10+
package-lock.json
11+
pnpm-lock.yaml
12+
yarn.lock
13+
bun.lockb
14+
*.log

0 commit comments

Comments
 (0)