Skip to content

Commit b7492d2

Browse files
authored
chore: standardize repository tooling (#640)
* chore: standardize repository tooling * chore: remove cloudflare preview and now-build * docs: add Ant Design logo to README header * docs: standardize README release details * ci: make surge preview non-blocking * docs: clarify Ant Design ecosystem note * ci: keep surge preview as fallback * docs: refine README usage and ecosystem note * ci: isolate surge preview token * docs: update Ant Design logo * docs: add Chinese 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 * chore: ignore dumi build output * docs: add license file * ci: use actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * docs: localize Chinese README labels * docs: fix Chinese README API names * chore: refine preview workflow ignores * docs: polish Chinese README wording * docs: fix Chinese README wording * chore: align package scripts * chore: add father config * docs: document dumi dev server port * chore: standardize husky configuration * chore: standardize package type entry * ci: limit reusable workflow secrets * ci: restore reusable workflow compatibility * chore: limit reusable workflow secrets
1 parent e98fa3b commit b7492d2

19 files changed

Lines changed: 516 additions & 384 deletions

.dumirc.ts

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

4+
const basePath = process.env.GH_PAGES ? '/cascader/' : '/';
5+
const publicPath = basePath;
6+
47
export default defineConfig({
8+
outputPath: 'docs-dist',
9+
base: basePath,
10+
publicPath,
511
alias: {
612
'rc-cascader$': path.resolve('src'),
713
'rc-cascader/es': path.resolve('src'),

.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: 17 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +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: np
11-
versions:
12-
- 7.2.0
13-
- 7.3.0
14-
- 7.4.0
15-
- dependency-name: "@types/react"
16-
versions:
17-
- 17.0.0
18-
- 17.0.1
19-
- 17.0.2
20-
- 17.0.3
21-
- dependency-name: "@types/jest"
22-
versions:
23-
- 26.0.20
24-
- 26.0.21
25-
- 26.0.22
26-
- dependency-name: "@types/react-dom"
27-
versions:
28-
- 17.0.0
29-
- 17.0.1
30-
- 17.0.2
31-
- dependency-name: typescript
32-
versions:
33-
- 4.1.3
34-
- 4.1.4
35-
- 4.1.5
36-
- 4.2.2
37-
- 4.2.3
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 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-npm.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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: React Doctor
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, ready_for_review]
5+
push:
6+
branches: [master]
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
issues: write
12+
statuses: write
13+
14+
concurrency:
15+
group: react-doctor-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
react-doctor:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v7
23+
with:
24+
fetch-depth: 0
25+
persist-credentials: false
26+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
steps:
18+
- uses: actions/checkout@v7
19+
with:
20+
persist-credentials: false
21+
- name: Check Surge token
22+
id: surge-token
23+
env:
24+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
25+
run: |
26+
if [ -n "$SURGE_TOKEN" ]; then
27+
echo "enabled=true" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "enabled=false" >> "$GITHUB_OUTPUT"
30+
fi
31+
- name: Build preview
32+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
33+
run: |
34+
npm install
35+
npm run build
36+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
37+
if: ${{ steps.surge-token.outputs.enabled == 'true' }}
38+
env:
39+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
40+
with:
41+
surge_token: ${{ env.SURGE_TOKEN }}
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
dist: docs-dist
44+
failOnError: false
45+
setCommitStatus: false
46+
- name: Skip Surge preview
47+
if: ${{ steps.surge-token.outputs.enabled != 'true' }}
48+
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
@@ -38,7 +38,8 @@ coverage
3838
# dumi
3939
.dumi/tmp
4040
.dumi/tmp-production
41+
docs-dist
4142
dist
4243
.vscode
4344

44-
bun.lockb
45+
bun.lockb

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

0 commit comments

Comments
 (0)