📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 1adcbb9d..45828866 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,6 +1,7 @@
@rc-component/upload
Ant Design 生态的一部分。
+
📤 React 文件上传基础组件,支持拖拽、请求定制和上传列表。
From 21d03ef829582d160222d2115be366b2df0e694c Mon Sep 17 00:00:00 2001
From: afc163
Date: Sat, 27 Jun 2026 23:04:26 +0800
Subject: [PATCH 10/28] docs: refine bilingual README branding
---
README.md | 3 +-
README.zh-CN.md | 77 ++++++++++++++++++++++++-------------------------
2 files changed, 39 insertions(+), 41 deletions(-)
diff --git a/README.md b/README.md
index 39c6ba1a..1cdc2f9d 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
@rc-component/upload
-
Part of the Ant Design ecosystem.
-

+
Part of the Ant Design ecosystem.
📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests.
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 45828866..bd165c87 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -1,7 +1,6 @@
@rc-component/upload
-
Ant Design 生态的一部分。
-

+
Ant Design 生态的一部分。
📤 React 文件上传基础组件,支持拖拽、请求定制和上传列表。
@@ -19,10 +18,10 @@
## 特性
-- 支持 Ajax uploads with progress, headers, credentials, and custom request overrides.
-- 支持 directory, drag, paste, async action, and before-upload flows.
-- 暴露 `abort(file)` through the component instance for active requests.
-- 提供 semantic `classNames` and `styles` slots for the hidden input.
+- 支持带进度、请求头、凭证和自定义请求覆盖的 Ajax 上传。
+- 支持目录上传、拖拽、粘贴、异步 action 和上传前处理流程。
+- 通过组件实例暴露 `abort(file)`,用于中止进行中的请求。
+- 为隐藏 input 提供语义化 `classNames` 和 `styles` 插槽。
## 安装
@@ -50,7 +49,7 @@ export default () => (
);
```
-Online preview: https://upload.react-component.vercel.app/
+在线预览:https://upload.react-component.vercel.app/
## API
@@ -58,39 +57,39 @@ Online preview: https://upload.react-component.vercel.app/
| 名称 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
-| `accept` | string \| AcceptConfig | - | Input accept config. |
-| `action` | string \| `(file) => string \| PromiseLike` | - | Upload URL or async resolver. |
-| `beforeUpload` | `(file, fileList) => BeforeUploadFileType \| Promise \| void` | - | Validate or transform before upload. Return false to stop upload. |
-| `className` | string | - | Root class name. |
-| `classNames` | `{ input?: string }` | - | Semantic class names. |
-| `component` | React.ComponentType \| string | `'span'` | Root component. |
-| `customRequest` | CustomUploadRequestOption | - | Override default request behavior. |
-| `data` | object \| `(file) => object` | `{}` | Extra upload data. |
-| `directory` | boolean | false | Enable directory upload. |
-| `disabled` | boolean | false | Disable upload trigger. |
-| `hasControlInside` | boolean | false | Whether child already contains a control element. |
-| `headers` | Record | `{}` | Request headers. |
-| `id` | string | - | Input id. |
-| `method` | `'POST' \| 'PUT' \| 'PATCH' \| 'post' \| 'put' \| 'patch'` | `'post'` | Request method. |
-| `multiple` | boolean | false | Allow multiple file selection. |
-| `name` | string | `'file'` | File field name. |
-| `onBatchStart` | `(fileList) => void` | - | Called when a batch starts. |
-| `onError` | `(error, response, file) => void` | - | Upload error callback. |
-| `onProgress` | `(event, file) => void` | - | Upload progress callback. |
-| `onStart` | `(file) => void` | - | Upload start callback. |
-| `onSuccess` | `(response, file, xhr) => void` | - | Upload success callback. |
-| `openFileDialogOnClick` | boolean | true | Open file dialog when root is clicked. |
-| `pastable` | boolean | false | Enable paste upload. |
-| `prefixCls` | string | `'rc-upload'` | Prefix class name. |
-| `style` | React.CSSProperties | - | Root style. |
-| `styles` | `{ input?: React.CSSProperties }` | - | Semantic styles. |
-| `withCredentials` | boolean | false | Send credentials with Ajax upload. |
-
-### Methods
+| `accept` | string \| AcceptConfig | - | input accept 配置。 |
+| `action` | string \| `(file) => string \| PromiseLike` | - | 上传地址或异步解析函数。 |
+| `beforeUpload` | `(file, fileList) => BeforeUploadFileType \| Promise \| void` | - | 上传前校验或转换文件。返回 false 可阻止上传。 |
+| `className` | string | - | 根className。 |
+| `classNames` | `{ input?: string }` | - | 语义className。 |
+| `component` | React.ComponentType \| string | `'span'` | 根组件。 |
+| `customRequest` | CustomUploadRequestOption | - | 覆盖默认请求行为。 |
+| `data` | object \| `(file) => object` | `{}` | 额外上传数据。 |
+| `directory` | boolean | false | 启用目录上传。 |
+| `disabled` | boolean | false | 禁用上传触发器。 |
+| `hasControlInside` | boolean | false | 子节点是否已包含控制元素。 |
+| `headers` | Record | `{}` | 请求头。 |
+| `id` | string | - | Input id。 |
+| `method` | `'POST' \| 'PUT' \| 'PATCH' \| 'post' \| 'put' \| 'patch'` | `'post'` | 请求方法。 |
+| `multiple` | boolean | false | 允许多文件选择。 |
+| `name` | string | `'file'` | 文件字段名。 |
+| `onBatchStart` | `(fileList) => void` | - | 批量开始时调用。 |
+| `onError` | `(error, response, file) => void` | - | 上传错误回调。 |
+| `onProgress` | `(event, file) => void` | - | 上传进度回调。 |
+| `onStart` | `(file) => void` | - | 上传开始回调。 |
+| `onSuccess` | `(response, file, xhr) => void` | - | 上传成功回调。 |
+| `openFileDialogOnClick` | boolean | true | 点击根节点时打开文件选择框。 |
+| `pastable` | boolean | false | 启用粘贴上传。 |
+| `prefixCls` | string | `'rc-upload'` | 前缀className。 |
+| `style` | React.CSSProperties | - | 根样式。 |
+| `styles` | `{ input?: React.CSSProperties }` | - | 语义化样式。 |
+| `withCredentials` | boolean | false | 随 Ajax 上传发送凭证。 |
+
+### 方法
| 名称 | 类型 | 说明 |
| ------- | ------------------------- | ----------------------- |
-| `abort` | `(file?: RcFile) => void` | Abort an active upload. |
+| `abort` | `(file?: RcFile) => void` | 中止进行中的上传。 |
## 本地开发
@@ -109,8 +108,8 @@ npm run build
npm run prepublishOnly
```
-The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.
+包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。
## 许可证
-@rc-component/upload is released under the [MIT](./LICENSE) license.
+@rc-component/upload 基于 [MIT](./LICENSE) 许可证发布。
From febbe3676c67662b23f6c9d702361877bb675124 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 01:28:45 +0800
Subject: [PATCH 11/28] chore: standardize rc tooling and docs
---
.dumirc.ts | 2 +-
README.md | 11 +++++++++++
README.zh-CN.md | 11 +++++++++++
package.json | 30 +++++++++++++++---------------
tsconfig.json | 36 ++++++++++++++++++++++++++++--------
5 files changed, 66 insertions(+), 24 deletions(-)
diff --git a/.dumirc.ts b/.dumirc.ts
index f20f77e3..40ccb7c7 100644
--- a/.dumirc.ts
+++ b/.dumirc.ts
@@ -2,7 +2,7 @@ import { defineConfig } from 'dumi';
import path from 'path';
const basePath = process.env.GH_PAGES ? '/upload/' : '/';
-const publicPath = process.env.GH_PAGES ? '/upload/' : '/';
+const publicPath = basePath;
export default defineConfig({
alias: {
diff --git a/README.md b/README.md
index 1cdc2f9d..7224044e 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,17 @@ export default () => (
Online preview: https://upload.react-component.vercel.app/
+## Examples
+
+Run the local dumi site:
+
+```bash
+npm install
+npm start
+```
+
+Then open `http://localhost:8000`.
+
## API
### Upload
diff --git a/README.zh-CN.md b/README.zh-CN.md
index bd165c87..bc865a7e 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -51,6 +51,17 @@ export default () => (
在线预览:https://upload.react-component.vercel.app/
+## 示例
+
+运行本地 dumi 站点:
+
+```bash
+npm install
+npm start
+```
+
+然后打开 `http://localhost:8000`。
+
## API
### Upload
diff --git a/package.json b/package.json
index f670c3d7..14faa029 100644
--- a/package.json
+++ b/package.json
@@ -46,25 +46,25 @@
"devDependencies": {
"@rc-component/father-plugin": "^2.2.0",
"@rc-component/np": "^1.0.4",
- "@testing-library/jest-dom": "^6.1.5",
- "@testing-library/react": "^16.2.0",
- "@types/jest": "^30.0.0",
- "@types/node": "^25.0.1",
- "@types/react": "^19.2.2",
- "@types/react-dom": "^19.2.2",
+ "@testing-library/jest-dom": "^6.9.1",
+ "@testing-library/react": "^15.0.7",
+ "@types/jest": "^29.5.14",
+ "@types/node": "^26.0.1",
+ "@types/react": "^18.3.31",
+ "@types/react-dom": "^18.3.7",
"@umijs/fabric": "^4.0.1",
"axios": "^1.9.0",
- "cross-env": "^7.0.0",
- "dumi": "^2.1.0",
- "eslint": "^8.0.0",
- "father": "^4.0.0",
- "gh-pages": "^6.1.1",
- "rc-test": "^7.0.13",
- "react": "^18.0.0",
- "react-dom": "^18.0.0",
+ "cross-env": "^10.1.0",
+ "dumi": "^2.4.35",
+ "eslint": "^8.57.1",
+ "father": "^4.6.23",
+ "gh-pages": "^6.3.0",
+ "rc-test": "^7.1.3",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"regenerator-runtime": "^0.14.1",
"sinon": "^9.0.2",
- "typescript": "^5.3.3"
+ "typescript": "^5.9.3"
},
"peerDependencies": {
"react": ">=16.9.0",
diff --git a/tsconfig.json b/tsconfig.json
index 1f8949df..27cc41ca 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -8,13 +8,33 @@
"skipLibCheck": true,
"esModuleInterop": true,
"paths": {
- "@/*": ["src/*"],
- "@@/*": [".dumi/tmp/*"],
- "@rc-component/upload": ["src/index.ts"],
- "@rc-component/upload/es": ["src"],
- "@rc-component/upload/es/*": ["src/*"]
- }
+ "@/*": [
+ "src/*"
+ ],
+ "@@/*": [
+ ".dumi/tmp/*"
+ ],
+ "@rc-component/upload": [
+ "src/index.ts"
+ ],
+ "@rc-component/upload/es": [
+ "src"
+ ],
+ "@rc-component/upload/es/*": [
+ "src/*"
+ ]
+ },
+ "ignoreDeprecations": "5.0"
},
- "include": [".dumirc.ts", "src", "tests", "docs/examples"],
- "exclude": ["docs-dist", "lib", "es"]
+ "include": [
+ ".dumirc.ts",
+ "src",
+ "tests",
+ "docs/examples"
+ ],
+ "exclude": [
+ "docs-dist",
+ "lib",
+ "es"
+ ]
}
From 6f019d2a0c49fbe24c6a10728940969bad30d9d2 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 02:01:09 +0800
Subject: [PATCH 12/28] chore: address standardization review comments
---
.github/workflows/surge-preview.yml | 16 +++++++++++++---
README.md | 2 +-
README.zh-CN.md | 8 ++++----
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index faf6b8bd..cb6c8c4a 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -22,13 +22,23 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
+ - name: Check Surge token
+ id: surge-token
+ env:
+ SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
+ run: |
+ if [ -n "$SURGE_TOKEN" ]; then
+ echo "enabled=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "enabled=false" >> "$GITHUB_OUTPUT"
+ fi
- name: Build preview
- if: ${{ secrets.SURGE_TOKEN != '' }}
+ if: ${{ steps.surge-token.outputs.enabled == 'true' }}
run: |
npm install
npm run build
- uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
- if: ${{ secrets.SURGE_TOKEN != '' }}
+ if: ${{ steps.surge-token.outputs.enabled == 'true' }}
env:
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
with:
@@ -38,5 +48,5 @@ jobs:
failOnError: false
setCommitStatus: false
- name: Skip Surge preview
- if: ${{ secrets.SURGE_TOKEN == '' }}
+ if: ${{ steps.surge-token.outputs.enabled != 'true' }}
run: echo "SURGE_TOKEN is not configured; skip Surge preview."
diff --git a/README.md b/README.md
index 7224044e..f3b92b67 100644
--- a/README.md
+++ b/README.md
@@ -100,7 +100,7 @@ Then open `http://localhost:8000`.
| Name | Type | Description |
| ------- | ------------------------- | ----------------------- |
-| `abort` | `(file?: RcFile) => void` | Abort an active upload. |
+| `abort` | `(file: RcFile) => void` | Abort an active upload. |
## Development
diff --git a/README.zh-CN.md b/README.zh-CN.md
index bc865a7e..f465e081 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -71,8 +71,8 @@ npm start
| `accept` | string \| AcceptConfig | - | input accept 配置。 |
| `action` | string \| `(file) => string \| PromiseLike` | - | 上传地址或异步解析函数。 |
| `beforeUpload` | `(file, fileList) => BeforeUploadFileType \| Promise \| void` | - | 上传前校验或转换文件。返回 false 可阻止上传。 |
-| `className` | string | - | 根className。 |
-| `classNames` | `{ input?: string }` | - | 语义className。 |
+| `className` | string | - | 根 className。 |
+| `classNames` | `{ input?: string }` | - | 语义化类名。 |
| `component` | React.ComponentType \| string | `'span'` | 根组件。 |
| `customRequest` | CustomUploadRequestOption | - | 覆盖默认请求行为。 |
| `data` | object \| `(file) => object` | `{}` | 额外上传数据。 |
@@ -91,7 +91,7 @@ npm start
| `onSuccess` | `(response, file, xhr) => void` | - | 上传成功回调。 |
| `openFileDialogOnClick` | boolean | true | 点击根节点时打开文件选择框。 |
| `pastable` | boolean | false | 启用粘贴上传。 |
-| `prefixCls` | string | `'rc-upload'` | 前缀className。 |
+| `prefixCls` | string | `'rc-upload'` | 前缀 className。 |
| `style` | React.CSSProperties | - | 根样式。 |
| `styles` | `{ input?: React.CSSProperties }` | - | 语义化样式。 |
| `withCredentials` | boolean | false | 随 Ajax 上传发送凭证。 |
@@ -100,7 +100,7 @@ npm start
| 名称 | 类型 | 说明 |
| ------- | ------------------------- | ----------------------- |
-| `abort` | `(file?: RcFile) => void` | 中止进行中的上传。 |
+| `abort` | `(file: RcFile) => void` | 中止进行中的上传。 |
## 本地开发
From 8ae34edee7356eb3290a2cf15a5cb3963746a11d Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 12:24:56 +0800
Subject: [PATCH 13/28] ci: update GitHub Actions versions
---
.github/workflows/codeql.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 23f424a8..6999184b 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -29,15 +29,15 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
- uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
- uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
+ uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444
with:
category: '/language:${{ matrix.language }}'
From c1861ae88f69489a995117fd48933e7fbc3e85d9 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 12:30:31 +0800
Subject: [PATCH 14/28] ci: use resolvable CodeQL action ref
---
.github/workflows/codeql.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 6999184b..23f424a8 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -29,15 +29,15 @@ jobs:
persist-credentials: false
- name: Initialize CodeQL
- uses: github/codeql-action/init@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
- uses: github/codeql-action/autobuild@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
- name: Perform CodeQL Analysis
- uses: github/codeql-action/analyze@a0853c24544627f65ddf259abe73b1d18a591444
+ uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e
with:
category: '/language:${{ matrix.language }}'
From 0bd3ea3b5ca054eedf75763bbd2b2bcfc3b47fe1 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:03:34 +0800
Subject: [PATCH 15/28] ci: use actions checkout v7
---
.github/workflows/codeql.yml | 2 +-
.github/workflows/react-doctor.yml | 2 +-
.github/workflows/surge-preview.yml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 23f424a8..82242dfd 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ uses: actions/checkout@v7
with:
persist-credentials: false
diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml
index f68281c8..097eb883 100644
--- a/.github/workflows/react-doctor.yml
+++ b/.github/workflows/react-doctor.yml
@@ -20,7 +20,7 @@ jobs:
react-doctor:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ - uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index cb6c8c4a..ebfecd53 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -19,7 +19,7 @@ jobs:
env:
PREVIEW: true
steps:
- - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
+ - uses: actions/checkout@v7
with:
persist-credentials: false
- name: Check Surge token
From fe74f77d7fd8967ce8a9e0677c59a535dac1fcdf Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:32:41 +0800
Subject: [PATCH 16/28] chore: standardize package metadata
---
package.json | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/package.json b/package.json
index 14faa029..3277a233 100644
--- a/package.json
+++ b/package.json
@@ -10,11 +10,11 @@
],
"homepage": "https://react-component.github.io/upload",
"bugs": {
- "url": "http://github.com/react-component/upload/issues"
+ "url": "https://github.com/react-component/upload/issues"
},
"repository": {
"type": "git",
- "url": "git@github.com:react-component/upload.git"
+ "url": "https://github.com/react-component/upload.git"
},
"license": "MIT",
"main": "./lib/index",
@@ -69,5 +69,8 @@
"peerDependencies": {
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
+ },
+ "publishConfig": {
+ "access": "public"
}
}
From 27edb6289fc392867fc544a29b14c23200536ac0 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 14:39:02 +0800
Subject: [PATCH 17/28] ci: standardize dependabot updates
---
.github/dependabot.yml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 07575c02..3b730ef9 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -3,6 +3,17 @@ updates:
- package-ecosystem: npm
directory: '/'
schedule:
- interval: daily
+ interval: weekly
+ day: monday
time: '21:00'
+ timezone: Asia/Shanghai
+ open-pull-requests-limit: 10
+
+ - package-ecosystem: github-actions
+ directory: '/'
+ schedule:
+ interval: weekly
+ day: monday
+ time: '21:00'
+ timezone: Asia/Shanghai
open-pull-requests-limit: 10
From 946035ca3a53b9235f47e2bcb329d403d36a7861 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 15:07:43 +0800
Subject: [PATCH 18/28] chore: ignore generated docs artifacts
---
.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.gitignore b/.gitignore
index 4597fc50..f0882bba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,6 @@ tmp/
bun.lockb
bun.lock
+coverage
+.dumi/tmp
+.dumi/tmp-production
From 0f86b276520d2033eea58deef79e087bc8d7f9c0 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 17:17:05 +0800
Subject: [PATCH 19/28] chore: refine preview workflow ignores
---
.github/workflows/surge-preview.yml | 3 +++
.prettierignore | 14 ++++++++++++++
2 files changed, 17 insertions(+)
create mode 100644 .prettierignore
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index ebfecd53..eaff160a 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -16,6 +16,9 @@ permissions:
jobs:
preview:
runs-on: ubuntu-latest
+ concurrency:
+ group: surge-preview-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
env:
PREVIEW: true
steps:
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..c466d872
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,14 @@
+node_modules
+coverage
+docs-dist
+dist
+es
+lib
+.dumi/tmp
+.dumi/tmp-production
+.vercel
+package-lock.json
+pnpm-lock.yaml
+yarn.lock
+bun.lockb
+*.log
From 018ebc23f5e5b881d668f74128e3a008cc1e906d Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 18:19:39 +0800
Subject: [PATCH 20/28] chore: add missing prettier dependency
---
package.json | 1 +
1 file changed, 1 insertion(+)
diff --git a/package.json b/package.json
index 3277a233..8d4598bb 100644
--- a/package.json
+++ b/package.json
@@ -45,6 +45,7 @@
},
"devDependencies": {
"@rc-component/father-plugin": "^2.2.0",
+ "prettier": "^3.9.0",
"@rc-component/np": "^1.0.4",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^15.0.7",
From 1cf2284cd8e5be17d9cec1c5085d8a1b45f7f112 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 19:14:35 +0800
Subject: [PATCH 21/28] chore: add father config
---
.fatherrc.ts | 5 +++++
tsconfig.json | 1 +
2 files changed, 6 insertions(+)
create mode 100644 .fatherrc.ts
diff --git a/.fatherrc.ts b/.fatherrc.ts
new file mode 100644
index 00000000..96268ae1
--- /dev/null
+++ b/.fatherrc.ts
@@ -0,0 +1,5 @@
+import { defineConfig } from 'father';
+
+export default defineConfig({
+ plugins: ['@rc-component/father-plugin'],
+});
diff --git a/tsconfig.json b/tsconfig.json
index 27cc41ca..d4e3e1a0 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -28,6 +28,7 @@
},
"include": [
".dumirc.ts",
+ ".fatherrc.ts",
"src",
"tests",
"docs/examples"
From d5a69f18bb7f059572ae7e97808f2f51c9ccdb48 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 19:39:57 +0800
Subject: [PATCH 22/28] docs: document dumi dev server port
---
README.md | 2 ++
README.zh-CN.md | 2 ++
2 files changed, 4 insertions(+)
diff --git a/README.md b/README.md
index f3b92b67..41998010 100644
--- a/README.md
+++ b/README.md
@@ -113,6 +113,8 @@ npm run compile
npm run build
```
+The dumi site runs at `http://localhost:8000` by default.
+
## Release
```bash
diff --git a/README.zh-CN.md b/README.zh-CN.md
index f465e081..5b76c719 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -113,6 +113,8 @@ npm run compile
npm run build
```
+dumi 站点默认运行在 `http://localhost:8000`。
+
## 发布
```bash
From 248dd9eb34ca8682f8a9c8270298cf21c5f5aaf4 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 19:59:40 +0800
Subject: [PATCH 23/28] chore: standardize husky configuration
---
.husky/pre-commit | 1 +
package.json | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
create mode 100755 .husky/pre-commit
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000..2312dc58
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1 @@
+npx lint-staged
diff --git a/package.json b/package.json
index 8d4598bb..e36f1195 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,8 @@
"prettier": "prettier --write --ignore-unknown .",
"start": "dumi dev",
"test": "rc-test",
- "tsc": "tsc --noEmit"
+ "tsc": "tsc --noEmit",
+ "prepare": "husky"
},
"dependencies": {
"@rc-component/util": "^1.11.1",
@@ -65,7 +66,9 @@
"react-dom": "^18.3.1",
"regenerator-runtime": "^0.14.1",
"sinon": "^9.0.2",
- "typescript": "^5.9.3"
+ "typescript": "^5.9.3",
+ "husky": "^9.1.7",
+ "lint-staged": "^16.4.0"
},
"peerDependencies": {
"react": ">=16.9.0",
@@ -73,5 +76,8 @@
},
"publishConfig": {
"access": "public"
+ },
+ "lint-staged": {
+ "*": "prettier --write --ignore-unknown"
}
}
From 00e53717088f459e631d032451bbf8446ebdf2d3 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 20:33:46 +0800
Subject: [PATCH 24/28] chore: standardize package type entry
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index e36f1195..ceb6737a 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"license": "MIT",
"main": "./lib/index",
"module": "./es/index",
- "types": "./lib/index.d.ts",
+ "types": "./es/index.d.ts",
"files": [
"lib",
"es"
From 12ac35ad3372d4071bc8ea65d4aee82faaf92d40 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:02:00 +0800
Subject: [PATCH 25/28] docs: normalize readme badges
---
README.md | 12 ++++++------
README.zh-CN.md | 12 ++++++------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
index 41998010..ae8ad8dc 100644
--- a/README.md
+++ b/README.md
@@ -4,12 +4,12 @@
📤 Low-level React upload primitive for Ajax, drag, paste, directory, and custom requests.
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/README.zh-CN.md b/README.zh-CN.md
index 5b76c719..fa00a14b 100644
--- a/README.zh-CN.md
+++ b/README.zh-CN.md
@@ -4,12 +4,12 @@
📤 React 文件上传基础组件,支持拖拽、请求定制和上传列表。
-
-
-
-
-
-
+
+
+
+
+
+
From 5737b11970a2a66d015dfdbc356e5985c56f4597 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:21:50 +0800
Subject: [PATCH 26/28] ci: limit reusable workflow secrets
---
.github/workflows/react-component-ci.yml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index 1ed64209..cf754afa 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -9,4 +9,6 @@ permissions:
jobs:
test:
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
- secrets: inherit
+ secrets:
+
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
From a1d855e975dfc74a992328c2c920a1ff38a8a6a9 Mon Sep 17 00:00:00 2001
From: afc163
Date: Sun, 28 Jun 2026 21:30:35 +0800
Subject: [PATCH 27/28] ci: restore reusable workflow compatibility
---
.github/workflows/react-component-ci.yml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index cf754afa..1ed64209 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -9,6 +9,4 @@ permissions:
jobs:
test:
uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
- secrets:
-
- CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
+ secrets: inherit
From 0fdcc9dcc09bd3c2d84da08a4c973ebf00da3235 Mon Sep 17 00:00:00 2001
From: afc163
Date: Mon, 29 Jun 2026 01:21:18 +0800
Subject: [PATCH 28/28] ci: narrow surge preview permissions
---
.github/workflows/surge-preview.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
index eaff160a..4c2f17ed 100644
--- a/.github/workflows/surge-preview.yml
+++ b/.github/workflows/surge-preview.yml
@@ -11,7 +11,6 @@ permissions:
contents: read
pull-requests: write
checks: write
- statuses: write
jobs:
preview: