Skip to content

Commit a04ba08

Browse files
authored
chore: standardize repository setup (#247)
* chore: standardize repository setup * chore: address review feedback * 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 * fix: align dropdown docs and open class handling * fix: preserve dropdown fallback wrapper class * fix: simplify dropdown fallback child handling * ci: use actions checkout v7 * chore: standardize package metadata * ci: standardize dependabot updates * chore: refine preview workflow ignores * 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 * ci: narrow surge preview permissions * chore: limit reusable workflow secrets
1 parent d26d860 commit a04ba08

18 files changed

Lines changed: 410 additions & 213 deletions

.dumirc.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
// more config: https://d.umijs.org/config
22
import { defineConfig } from 'dumi';
33

4+
const basePath = process.env.GH_PAGES ? '/dropdown/' : '/';
5+
const publicPath = basePath;
6+
47
export default defineConfig({
58
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
69
themeConfig: {
710
name: 'rc-dropdown',
811
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
912
},
10-
outputPath: '.docs',
13+
outputPath: 'docs-dist',
14+
base: basePath,
15+
publicPath,
1116
exportStatic: {},
1217
styles: [
1318
`

.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: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1-
# To get started with Dependabot version updates, you'll need to specify which
2-
# package ecosystems to update and where the package manifests are located.
3-
# Please see the documentation for all configuration options:
4-
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5-
61
version: 2
72
updates:
8-
- package-ecosystem: "" # See documentation for possible values
9-
directory: "/" # Location of package manifests
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: '/'
1014
schedule:
11-
interval: "weekly"
15+
interval: weekly
16+
day: monday
17+
time: '21:00'
18+
timezone: Asia/Shanghai
19+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: CI
22

33
on: ['push', 'pull_request']
44

5+
permissions:
6+
contents: read
57
jobs:
68
CI:
7-
uses: react-component/rc-test/.github/workflows/test.yml@main
8-
secrets: inherit
9+
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
10+
secrets:
11+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.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: "38 3 * * 6"
9+
- cron: '38 3 * * 6'
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/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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ pnpm-lock.yaml
3636
.dumi/tmp-test
3737
.dumi/tmp-production
3838
.docs
39+
docs-dist

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
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)