Skip to content

Commit 56a1695

Browse files
authored
chore: standardize repository config (#328)
* chore: standardize repository config * fix: make preview build generate styles * fix: address review feedback * fix: keep rc-test secrets inheritance * fix: align test workflow triggers * 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 * 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 * docs: add license file * ci: use actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * docs: fix Chinese README API names * chore: refine preview workflow ignores * docs: polish Chinese README wording * chore: align tooling ignores and typescript * docs: polish Chinese README wording * docs: document dumi dev server port * chore: standardize husky configuration * 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 d628c9b commit 56a1695

26 files changed

Lines changed: 453 additions & 137 deletions

.dumirc.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@ import { defineConfig } from 'dumi';
22
import path from 'path';
33

44
const basePath = process.env.GH_PAGES ? '/segmented/' : '/';
5-
const publicPath = process.env.GH_PAGES ? '/segmented/' : '/';
5+
const publicPath = basePath;
66

77
export default defineConfig({
88
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
99
themeConfig: {
1010
name: 'Segmented',
1111
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
1212
},
13-
outputPath: '.doc',
13+
outputPath: 'docs-dist',
1414
exportStatic: {},
1515
base: basePath,
1616
publicPath,
1717
alias: {
18-
'rc-segmented': path.resolve(__dirname, 'src/index.tsx'),
18+
'@rc-component/segmented$': path.resolve(__dirname, 'src/index.tsx'),
19+
'@rc-component/segmented/es': path.resolve(__dirname, 'src'),
20+
'@rc-component/segmented/assets': path.resolve(__dirname, 'assets'),
1921
},
2022
});

.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: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +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

.github/workflows/main.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/preview.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: ✅ test
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
branches: [master]
7+
permissions:
8+
contents: read
9+
jobs:
10+
test:
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
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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ package-lock.json
3030
pnpm-lock.yaml
3131
coverage/
3232
.doc
33+
docs-dist
34+
.vercel
3335

3436
# umi
3537
.umi

.husky/pre-commit

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

0 commit comments

Comments
 (0)