Skip to content

Commit 766604a

Browse files
authored
chore: standardize repository config (#523)
* chore: standardize repository config * chore: address AI review feedback * 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 * chore: address review comments * 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 actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * chore: ignore generated docs artifacts * 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 * ci: narrow surge preview permissions * chore: limit reusable workflow secrets
1 parent b537679 commit 766604a

26 files changed

Lines changed: 461 additions & 278 deletions

.dumirc.ts

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

4-
// const isProdSite =
5-
// // 不是预览模式 同时是生产环境
6-
// process.env.PREVIEW !== 'true' && process.env.NODE_ENV === 'production';
7-
8-
// const name = 'tooltip';
4+
const basePath = process.env.GH_PAGES ? '/tooltip/' : '/';
5+
const publicPath = basePath;
96

107
export default defineConfig({
118
alias: {
12-
'rc-tooltip$': path.resolve('src'),
13-
'rc-tooltip/es': path.resolve('src'),
9+
'@rc-component/tooltip$': path.resolve('src'),
10+
'@rc-component/tooltip/assets': path.resolve('assets'),
11+
'@rc-component/tooltip/es': path.resolve('src'),
1412
},
1513
mfsu: false,
1614
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
1715
themeConfig: {
1816
name: 'Tooltip',
1917
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
2018
},
21-
// base: isProdSite ? `/${name}/` : '/',
22-
// publicPath: isProdSite ? `/${name}/` : '/',
19+
outputPath: 'docs-dist',
20+
base: basePath,
21+
publicPath,
2322
});

.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 & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +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: "@types/react"
11-
versions:
12-
- 17.0.0
13-
- 17.0.1
14-
- 17.0.2
15-
- 17.0.3
16-
- dependency-name: "@types/react-dom"
17-
versions:
18-
- 17.0.0
19-
- 17.0.1
20-
- 17.0.2
21-
- dependency-name: less
22-
versions:
23-
- 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: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: 'CodeQL'
2+
3+
on:
4+
push:
5+
branches: ['master']
6+
pull_request:
7+
branches: ['master']
8+
schedule:
9+
- cron: '17 10 * * 1'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze
14+
runs-on: ubuntu-latest
15+
permissions:
16+
actions: read
17+
contents: read
18+
security-events: write
19+
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
language: [javascript]
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v7
28+
with:
29+
persist-credentials: false
30+
31+
- name: Initialize CodeQL
32+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
33+
with:
34+
languages: ${{ matrix.language }}
35+
queries: +security-and-quality
36+
37+
- name: Autobuild
38+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
39+
40+
- name: Perform CodeQL Analysis
41+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
42+
with:
43+
category: '/language:${{ matrix.language }}'
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: ✅ test
2-
on: [push, pull_request]
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
permissions:
8+
contents: read
39
jobs:
410
test:
5-
uses: react-component/rc-test/.github/workflows/test.yml@main
6-
secrets: inherit
11+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
12+
secrets:
13+
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

.github/workflows/site-deploy.yml

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

.gitignore

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.storybook
21
*.iml
32
*.log
43
*.log.*
@@ -27,19 +26,26 @@ assets/**/*.css
2726
build
2827
lib
2928
es
30-
coverage
29+
/coverage
3130
yarn.lock
3231
package-lock.json
3332
pnpm-lock.yaml
33+
.doc
34+
docs-dist
35+
.vercel
36+
.storybook
37+
tmp/
38+
.history
3439

3540
# umi
3641
.umi
3742
.umi-production
3843
.umi-test
3944
.env.local
45+
.dumi/
4046

41-
# dumi
47+
bun.lockb
48+
bun.lock
49+
coverage
4250
.dumi/tmp
4351
.dumi/tmp-production
44-
45-
bun.lockb

0 commit comments

Comments
 (0)