Skip to content

Commit 3a083d4

Browse files
committed
chore: standardize repository config
1 parent 149568c commit 3a083d4

15 files changed

Lines changed: 259 additions & 111 deletions

.dumirc.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
1-
// more config: https://d.umijs.org/config
21
import { defineConfig } from 'dumi';
2+
import path from 'path';
3+
4+
const basePath = process.env.GH_PAGES ? '/switch/' : '/';
5+
const publicPath = process.env.GH_PAGES ? '/switch/' : '/';
36

47
export default defineConfig({
8+
alias: {
9+
'@rc-component/switch$': path.resolve('src'),
10+
'@rc-component/switch/es': path.resolve('src'),
11+
'@rc-component/switch/assets': path.resolve('assets'),
12+
},
13+
mfsu: false,
514
favicons: ['https://avatars0.githubusercontent.com/u/9441414?s=200&v=4'],
615
themeConfig: {
7-
name: 'rc-switch',
16+
name: 'Switch',
817
logo: 'https://avatars0.githubusercontent.com/u/9441414?s=200&v=4',
918
},
10-
outputPath: '.doc',
11-
exportStatic: {},
12-
base: '/switch',
13-
publicPath: '/switch/',
14-
hash: true,
19+
outputPath: 'docs-dist',
20+
base: basePath,
21+
publicPath,
1522
});

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.eslintrc.js
22
es/
33
lib/
4-
.doc/
4+
.doc/
5+
docs-dist/
6+
.vercel/

.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: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
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: less
11-
versions:
12-
- 4.1.0
3+
- package-ecosystem: npm
4+
directory: '/'
5+
schedule:
6+
interval: daily
7+
time: '21:00'
8+
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
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 }}'

.github/workflows/main.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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: inherit

.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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
24+
with:
25+
fetch-depth: 0
26+
persist-credentials: false
27+
- uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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+
statuses: write
15+
16+
jobs:
17+
preview:
18+
runs-on: ubuntu-latest
19+
env:
20+
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
21+
PREVIEW: true
22+
steps:
23+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
24+
with:
25+
persist-credentials: false
26+
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
27+
if: ${{ env.SURGE_TOKEN != '' }}
28+
with:
29+
surge_token: ${{ env.SURGE_TOKEN }}
30+
github_token: ${{ secrets.GITHUB_TOKEN }}
31+
dist: docs-dist
32+
failOnError: true
33+
setCommitStatus: true
34+
build: |
35+
npm install
36+
npm run build
37+
- name: Skip Surge preview
38+
if: ${{ env.SURGE_TOKEN == '' }}
39+
run: echo "SURGE_TOKEN is not configured; skip Surge preview."

.gitignore

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.iml
22
*.log
3+
*.log.*
34
.idea/
45
.ipr
56
.iws
@@ -20,20 +21,26 @@ Thumbs.db
2021
.build
2122
node_modules
2223
.cache
24+
dist
2325
assets/**/*.css
2426
build
2527
lib
2628
es
29+
/coverage
2730
yarn.lock
2831
package-lock.json
2932
pnpm-lock.yaml
30-
coverage/
33+
.doc
34+
docs-dist
35+
.vercel
36+
.storybook
3137

32-
# dumi
33-
.dumi/tmp
34-
.dumi/tmp-test
35-
.dumi/tmp-production
38+
# umi
39+
.umi
40+
.umi-production
41+
.umi-test
3642
.env.local
37-
.doc/
43+
.dumi/
3844

39-
bun.lockb
45+
bun.lockb
46+
bun.lock

0 commit comments

Comments
 (0)