Skip to content

Commit cbb46b5

Browse files
authored
chore: standardize repository config (#627)
* chore: standardize repository config * chore: address review feedback * chore: fix surge preview inputs * chore: address AI review feedback * docs: standardize README release details * docs: clarify Ant Design ecosystem note * 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 * ci: update GitHub Actions versions * ci: use resolvable CodeQL action ref * ci: use test-utoo workflow from main * ci: use actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * docs: localize Chinese README descriptions * chore: refine preview workflow ignores * chore: add father config * docs: document dumi dev server port * chore: standardize husky configuration * chore: standardize package type entry * docs: normalize readme badges * ci: limit reusable workflow secrets * ci: restore reusable workflow compatibility * chore: limit reusable workflow secrets
1 parent 97703ff commit cbb46b5

20 files changed

Lines changed: 447 additions & 321 deletions

.dumirc.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { defineConfig } from 'dumi';
22
import path from 'path';
33

4+
const basePath = process.env.GH_PAGES ? '/trigger/' : '/';
5+
const publicPath = basePath;
6+
47
export default defineConfig({
58
alias: {
6-
'rc-trigger$': path.resolve('src'),
7-
'rc-trigger/es': path.resolve('src'),
9+
'@rc-component/trigger$': path.resolve(__dirname, 'src'),
10+
'@rc-component/trigger/es': path.resolve(__dirname, 'src'),
11+
'@rc-component/trigger/assets': path.resolve(__dirname, 'assets'),
812
},
913
mfsu: false,
1014
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
@@ -20,4 +24,7 @@ export default defineConfig({
2024
}
2125
`,
2226
],
27+
outputPath: 'docs-dist',
28+
base: basePath,
29+
publicPath,
2330
});

.fatherrc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from 'father';
2+
3+
export default defineConfig({
4+
plugins: ['@rc-component/father-plugin'],
5+
});

.github/FUNDING.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
# These are supported funding model platforms
2-
3-
github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4-
patreon: # Replace with a single Patreon username
5-
open_collective: ant-design # Replace with a single Open Collective username
6-
ko_fi: # Replace with a single Ko-fi username
7-
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8-
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9-
liberapay: # Replace with a single Liberapay username
10-
issuehunt: # Replace with a single IssueHunt username
11-
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12-
polar: # Replace with a single Polar username
13-
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14-
thanks_dev: # Replace with a single thanks.dev username
15-
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
1+
github: ant-design
2+
open_collective: ant-design

.github/dependabot.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,17 @@ updates:
33
- package-ecosystem: npm
44
directory: '/'
55
schedule:
6-
interval: daily
6+
interval: weekly
7+
day: monday
78
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
819
open-pull-requests-limit: 10
9-
ignore:
10-
- dependency-name: np
11-
versions:
12-
- 7.2.0
13-
- 7.3.0
14-
- 7.4.0
15-
- dependency-name: '@types/react-dom'
16-
versions:
17-
- 17.0.0
18-
- 17.0.1
19-
- 17.0.2
20-
- dependency-name: '@types/react'
21-
versions:
22-
- 17.0.0
23-
- 17.0.1
24-
- 17.0.2
25-
- 17.0.3
26-
- dependency-name: typescript
27-
versions:
28-
- 4.1.3
29-
- 4.1.4
30-
- 4.1.5

.github/workflows/codeql.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
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:
99
- cron: '40 12 * * 0'
1010

@@ -24,18 +24,20 @@ jobs:
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:
4143
category: '/language:${{ matrix.language }}'

.github/workflows/main.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: ✅ test
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/react-doctor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: React Doctor
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
concurrency:
12+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
react-doctor:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v7
20+
with:
21+
persist-credentials: false
22+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
23+
with:
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Surge Preview
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
statuses: write
11+
12+
concurrency:
13+
group: surge-preview-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
preview:
18+
runs-on: ubuntu-latest
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: Install dependencies
34+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
35+
run: npm install --ignore-scripts --no-audit --loglevel=warn
36+
- name: Build preview
37+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
38+
run: npm run build
39+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
40+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
41+
env:
42+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
43+
with:
44+
dist: docs-dist
45+
failOnError: false
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
surge_token: ${{ env.SURGE_TOKEN }}

.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ package-lock.json
3030
pnpm-lock.yaml
3131
bun.lockb
3232
.vscode
33-
3433
# dumi
3534
.umi
3635
.umi-production
3736
.umi-test
3837
.docs
39-
40-
41-
# dumi
4238
.dumi/tmp
4339
.dumi/tmp-production
44-
dist/
40+
dist/
41+
docs-dist
42+
.vercel

0 commit comments

Comments
 (0)