diff --git a/.dumirc.ts b/.dumirc.ts
index 263f4161..c5182571 100644
--- a/.dumirc.ts
+++ b/.dumirc.ts
@@ -1,7 +1,13 @@
import { defineConfig } from 'dumi';
import path from 'path';
+const basePath = process.env.GH_PAGES ? '/drawer/' : '/';
+const publicPath = basePath;
+
export default defineConfig({
+ outputPath: 'docs-dist',
+ base: basePath,
+ publicPath,
alias: {
'rc-drawer$': path.resolve('src'),
'rc-drawer/es': path.resolve('src'),
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/.github/FUNDING.yml b/.github/FUNDING.yml
index 33b1999c..758659af 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,15 +1,2 @@
-# These are supported funding model platforms
-
-github: ant-design # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # Replace with a single Patreon username
-open_collective: ant-design # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
-polar: # Replace with a single Polar username
-buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
-thanks_dev: # Replace with a single thanks.dev username
-custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+github: ant-design
+open_collective: ant-design
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 2e210cb6..3b730ef9 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -3,29 +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
- ignore:
- - dependency-name: np
- versions:
- - 7.2.0
- - 7.3.0
- - 7.4.0
- - dependency-name: '@types/react'
- versions:
- - 17.0.0
- - 17.0.1
- - 17.0.2
- - 17.0.3
- - dependency-name: '@types/react-dom'
- versions:
- - 17.0.0
- - 17.0.1
- - 17.0.2
- - dependency-name: react
- versions:
- - 17.0.1
- - dependency-name: less
- versions:
- - 4.1.0
diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml
index 5735e2d2..36dacae4 100644
--- a/.github/workflows/react-component-ci.yml
+++ b/.github/workflows/react-component-ci.yml
@@ -1,6 +1,9 @@
name: ✅ test
on: [push, pull_request]
+permissions:
+ contents: read
jobs:
test:
- uses: react-component/rc-test/.github/workflows/test.yml@main
- secrets: inherit
\ No newline at end of file
+ uses: react-component/rc-test/.github/workflows/test-utoo.yml@main
+ secrets:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
diff --git a/.github/workflows/react-doctor.yml b/.github/workflows/react-doctor.yml
new file mode 100644
index 00000000..01760580
--- /dev/null
+++ b/.github/workflows/react-doctor.yml
@@ -0,0 +1,26 @@
+name: React Doctor
+on:
+ pull_request:
+ types: [opened, synchronize, reopened, ready_for_review]
+ push:
+ branches: [master]
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+ statuses: write
+
+concurrency:
+ group: react-doctor-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ react-doctor:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: millionco/react-doctor@0b4f4f4bd248a154e64eb508a48347f71154b3f3
diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml
new file mode 100644
index 00000000..394f2b02
--- /dev/null
+++ b/.github/workflows/surge-preview.yml
@@ -0,0 +1,48 @@
+name: Surge Preview
+
+on:
+ pull_request:
+
+permissions:
+ contents: read
+ pull-requests: write
+ checks: write
+
+jobs:
+ preview:
+ runs-on: ubuntu-latest
+ concurrency:
+ group: surge-preview-${{ github.event.pull_request.number }}
+ cancel-in-progress: true
+ steps:
+ - uses: actions/checkout@v7
+ 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: ${{ steps.surge-token.outputs.enabled == 'true' }}
+ run: |
+ npm install
+ npm run build
+ - uses: afc163/surge-preview@bf90a5a86111f6311ca42f0a5a0f80fb0fb03cec
+ if: ${{ steps.surge-token.outputs.enabled == 'true' }}
+ env:
+ SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
+ with:
+ surge_token: ${{ env.SURGE_TOKEN }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ dist: docs-dist
+ failOnError: false
+ setCommitStatus: false
+ - name: Skip Surge preview
+ if: ${{ steps.surge-token.outputs.enabled != 'true' }}
+ run: echo "SURGE_TOKEN is not configured; skip Surge preview."
diff --git a/.gitignore b/.gitignore
index 37c54b7a..298b598f 100755
--- a/.gitignore
+++ b/.gitignore
@@ -39,6 +39,7 @@ storybook
# dumi
.dumi/tmp
.dumi/tmp-production
+docs-dist
pnpm-lock.yaml
-bun.lockb
\ No newline at end of file
+bun.lockb
diff --git a/.husky/pre-commit b/.husky/pre-commit
index d0a77842..2312dc58 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-npx lint-staged
\ No newline at end of file
+npx lint-staged
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
diff --git a/README.md b/README.md
old mode 100755
new mode 100644
index 70f3e8ae..75e44649
--- a/README.md
+++ b/README.md
@@ -1,91 +1,127 @@
-# @rc-component/drawer
+
+
@rc-component/drawer
+
Part of the Ant Design ecosystem.
+
🚪 Accessible React drawer component with portal rendering, masks, nested push behavior, keyboard close handling, focus management, and optional resizable panels.
+
+
+
+
+
+
+
+
+
+
+
+English | 简体中文
+
+## Highlights
+
+| Area | Support |
+| ----------- | ------------------------------------------------------ |
+| Placement | Left, right, top, and bottom drawers |
+| Interaction | Mask click, keyboard close, focus management |
+| Composition | Nested drawers with push behavior |
+| Layout | Fixed drawer size, resizable panels, custom containers |
+| Motion | Configurable open and close transitions |
-[![NPM version][npm-image]][npm-url]
-[![npm download][download-image]][download-url]
-[![build status][github-actions-image]][github-actions-url]
-[![codecov][codecov-image]][codecov-url]
-[![dumi][dumi-image]][dumi-url]
-
-[npm-image]: http://img.shields.io/npm/v/@rc-component/drawer.svg?style=flat-square
-[npm-url]: http://npmjs.org/package/@rc-component/drawer
-[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
-[dumi-url]: https://github.com/umijs/dumi
-[github-actions-image]: https://github.com/react-component/drawer/actions/workflows/react-component-ci.yml/badge.svg
-[github-actions-url]: https://github.com/react-component/drawer/actions/workflows/react-component-ci.yml
-[download-image]: https://img.shields.io/npm/dm/@rc-component/drawer.svg?style=flat-square
-[download-url]: https://npmjs.org/package/@rc-component/drawer
-[codecov-image]: https://codecov.io/gh/react-component/drawer/branch/master/graph/badge.svg
-[codecov-url]: https://codecov.io/gh/react-component/drawer
-
-
-## Example
+## Install
-https://drawer-react-component.vercel.app/
+```bash
+npm install @rc-component/drawer
+```
## Usage
-```js
+```tsx | pure
import Drawer from '@rc-component/drawer';
-import React from 'react';
-import ReactDom from 'react-dom';
-ReactDom.render(
-
- {menu children}
+export default () => (
+ {}}>
+ Drawer content
-, mountNode);
+);
```
-## Install
+## Examples
-[](https://npmjs.org/package/@rc-component/drawer)
+Run the local dumi site:
-## Browser Support
+```bash
+npm install
+npm start
+```
-|  |  |  |  |  |
-| ------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
-| IE 10+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |
+Then open `http://localhost:8000`.
## API
-| props | type | default | description |
-| ------------------ | --------------------------------------------------------------------------- | -------------------------------------- | ----------------------------------------------------------------------------- |
-| className | string | null | - |
-| classNames | { mask?: string; content?: string; wrapper?: string; } | - | pass className to target area |
-| styles | { mask?: CSSProperties; content?: CSSProperties; wrapper?: CSSProperties; } | `rc-drawer` | pass style to target area |
-| prefixCls | string | 'drawer' | prefix class |
-| width | string \| number | null | drawer content wrapper width, drawer level transition width |
-| height | string \| number | null | drawer content wrapper height, drawer level transition height |
-| defaultWidth | string \| number | null | default width for uncontrolled resizable drawer |
-| defaultHeight | string \| number | null | default height for uncontrolled resizable drawer |
-| open | boolean | false | open or close menu |
-| defaultOpen | boolean | false | default open menu |
-| placement | string | `left` | `left` `top` `right` `bottom` |
-| level | string \| array | `all` | With the drawer level element. `all`/ null / className / id / tagName / array |
-| levelMove | number \| array \| func | null | level move value. default is drawer width |
-| duration | string | `.3s` | level animation duration |
-| ease | string | `cubic-bezier(0.78, 0.14, 0.15, 0.86)` | level animation timing function |
-| getContainer | string \| func \| HTMLElement | `body` | Return the mount node for Drawer. if is `null` use React.creactElement |
-| showMask | boolean | true | mask is show |
-| maskClosable | boolean | true | Clicking on the mask (area outside the Drawer) to close the Drawer or not. |
-| maskStyle | CSSProperties | null | mask style |
-| afterOpenChange | func | null | transition end callback(open) |
-| onClose | func | null | close click function |
-| keyboard | boolean | true | Whether support press esc to close |
-| autoFocus | boolean | true | Whether focusing on the drawer after it opened |
-| resizable | { onResize?: (size: number) => void; onResizeStart?: () => void; onResizeEnd?: () => void; } | - | Resizable configuration with optional callbacks |
-| onMouseEnter | React.MouseEventHandler\ | - | Trigger when mouse enter drawer panel |
-| onMouseOver | React.MouseEventHandler\ | - | Trigger when mouse over drawer panel |
-| onMouseLeave | React.MouseEventHandler\ | - | Trigger when mouse leave drawer panel |
-| onClick | React.MouseEventHandler\ | - | Trigger when mouse click drawer panel |
-| onKeyDown | React.MouseEventHandler\ | - | Trigger when mouse keydown on drawer panel |
-| onKeyUp | React.MouseEventHandler\ | - | Trigger when mouse keyup on drawer panel |
-
-> 2.0 Rename `onMaskClick` -> `onClose`, add `maskClosable`.
+| Property | Type | Default | Description |
+| ---------------------- | -------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------- |
+| afterOpenChange | `(open: boolean) => void` | - | Called after the open or close animation ends. |
+| autoFocus | boolean | true | Whether to focus the drawer after it opens. |
+| children | ReactNode | - | Drawer content. |
+| className | string | - | Class name for the drawer panel. |
+| classNames | `{ mask?: string; wrapper?: string; section?: string; dragger?: string }` | - | Semantic class names for internal drawer elements. |
+| defaultSize | number \| string | - | Default size for uncontrolled resizable drawer. |
+| destroyOnHidden | boolean | false | Unmount the drawer after it is fully closed. |
+| drawerRender | `(node: ReactNode) => ReactNode` | - | Customize rendered drawer panel content. |
+| focusTrap | boolean | - | Whether to trap focus inside the drawer. |
+| focusTriggerAfterClose | boolean | true | Whether to return focus to the trigger after closing. |
+| forceRender | boolean | false | Render the drawer before it is opened. |
+| getContainer | HTMLElement \| `() => HTMLElement` \| string \| false | `body` | Return the mount node. Set to `false` to render inline. |
+| height | number \| string | - | Deprecated. Use `size` for top or bottom placement. |
+| keyboard | boolean | true | Whether pressing Esc closes the drawer. |
+| mask | boolean | true | Whether to show the mask. |
+| maskClassName | string | - | Class name for the mask. |
+| maskClosable | boolean | true | Whether clicking the mask closes the drawer. |
+| maskMotion | CSSMotionProps | - | Motion config for the mask. |
+| maskStyle | CSSProperties | - | Style for the mask. |
+| maxSize | number | - | Maximum size for a resizable drawer. |
+| motion | CSSMotionProps \| `(placement: Placement) => CSSMotionProps` | - | Motion config for the drawer panel. |
+| onClose | `(event: MouseEvent \| KeyboardEvent) => void` | - | Called when the drawer requests to close. |
+| open | boolean | false | Whether the drawer is open. |
+| panelRef | Ref | - | Ref for the drawer panel. |
+| placement | `left` \| `right` \| `top` \| `bottom` | `right` | Drawer placement. |
+| prefixCls | string | `rc-drawer` | Class name prefix. |
+| push | boolean \| `{ distance?: number \| string }` | - | Push parent drawers when nested. |
+| resizable | boolean \| `{ onResize?: (size: number) => void; onResizeStart?: () => void; onResizeEnd?: () => void }` | false | Enable resizing and optional resize callbacks. |
+| rootClassName | string | - | Class name for the root wrapper. |
+| rootStyle | CSSProperties | - | Style for the root wrapper. |
+| size | number \| string | `378` for left/right | Drawer size. Controls width for left/right and height for top/bottom placement. |
+| style | CSSProperties | - | Style for the drawer panel. |
+| styles | `{ mask?: CSSProperties; wrapper?: CSSProperties; section?: CSSProperties; dragger?: CSSProperties }` | - | Semantic styles for internal drawer elements. |
+| width | number \| string | - | Deprecated. Use `size` for left or right placement. |
+| zIndex | number | - | Root wrapper z-index. |
+
+Mouse and keyboard event handlers such as `onClick`, `onMouseEnter`, `onMouseLeave`, `onKeyDown`, and `onKeyUp` are passed to the drawer panel.
## Development
-```
+```bash
npm install
npm start
```
+
+The dumi site runs at `http://localhost:8000` by default.
+
+Common commands:
+
+```bash
+npm run lint
+npm test
+npm run tsc
+npm run compile
+```
+
+## Release
+
+```bash
+npm run prepublishOnly
+```
+
+The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build.
+
+## License
+
+@rc-component/drawer is released under the [MIT](./LICENSE) license.
diff --git a/README.zh-CN.md b/README.zh-CN.md
new file mode 100644
index 00000000..38b105ed
--- /dev/null
+++ b/README.zh-CN.md
@@ -0,0 +1,127 @@
+
+
@rc-component/drawer
+
Ant Design 生态的一部分。
+
🚪 React 抽屉组件,支持遮罩、动画、自定义容器和语义化样式。
+
+
+
+
+
+
+
+
+
+
+
+English | 简体中文
+
+## 特性
+
+| 范围 | 支持 |
+| ---- | ---------------------------------------- |
+| 位置 | 左、右、上、下四个方向的抽屉 |
+| 交互 | 遮罩点击、键盘关闭和焦点管理 |
+| 组合 | 支持带 push 行为的嵌套抽屉 |
+| 布局 | 固定抽屉尺寸、可调整大小面板和自定义容器 |
+| 运动 | 可配置打开和关闭动画 |
+
+## 安装
+
+```bash
+npm install @rc-component/drawer
+```
+
+## 使用
+
+```tsx | pure
+import Drawer from '@rc-component/drawer';
+
+export default () => (
+ {}}>
+ Drawer content
+
+);
+```
+
+## 示例
+
+运行本地 dumi 站点:
+
+```bash
+npm install
+npm start
+```
+
+然后打开 `http://localhost:8000`。
+
+## API
+
+| 参数 | 类型 | 默认值 | 说明 |
+| ---------------------- | -------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------ |
+| afterOpenChange | `(open: boolean) => void` | - | 打开或关闭动画结束后调用。 |
+| autoFocus | boolean | true | 抽屉打开后是否聚焦。 |
+| children | ReactNode | - | 抽屉内容。 |
+| className | string | - | 抽屉面板的 className。 |
+| classNames | `{ mask?: string; wrapper?: string; section?: string; dragger?: string }` | - | 内部抽屉元素的语义 className。 |
+| defaultSize | number \| string | - | 非受控可调整大小抽屉的默认尺寸。 |
+| destroyOnHidden | boolean | false | 抽屉完全关闭后将其卸下。 |
+| drawerRender | `(node: ReactNode) => ReactNode` | - | 自定义渲染的抽屉面板内容。 |
+| focusTrap | boolean | - | 是否将焦点限制在抽屉内。 |
+| focusTriggerAfterClose | boolean | true | 关闭后是否将焦点返回到触发器。 |
+| forceRender | boolean | false | 在抽屉打开之前对其进行渲染。 |
+| getContainer | HTMLElement \| `() => HTMLElement` \| string \| false | `body` | 返回挂载节点。设置为 `false` 时内联渲染。 |
+| height | number \| string | - | 已废弃。顶部或底部位置请使用 `size`。 |
+| keyboard | boolean | true | 按 Esc 是否关闭抽屉。 |
+| mask | boolean | true | 是否显示遮罩。 |
+| maskClassName | string | - | 掩码的 className。 |
+| maskClosable | boolean | true | 单击蒙版是否会关闭抽屉。 |
+| maskMotion | CSSMotionProps | - | 遮罩动画配置。 |
+| maskStyle | CSSProperties | - | 遮罩样式。 |
+| maxSize | number | - | 可调整大小的抽屉的最大尺寸。 |
+| motion | CSSMotionProps \| `(placement: Placement) => CSSMotionProps` | - | 抽屉面板动画配置。 |
+| onClose | `(event: MouseEvent \| KeyboardEvent) => void` | - | 当抽屉请求关闭时调用。 |
+| open | boolean | false | 抽屉是否打开。 |
+| panelRef | Ref | - | 抽屉面板参考。 |
+| placement | `left` \| `right` \| `top` \| `bottom` | `right` | 抽屉位置。 |
+| prefixCls | string | `rc-drawer` | className 前缀。 |
+| push | boolean \| `{ distance?: number \| string }` | - | 嵌套时推动父抽屉。 |
+| resizable | boolean \| `{ onResize?: (size: number) => void; onResizeStart?: () => void; onResizeEnd?: () => void }` | false | 启用调整大小和可选的调整大小回调。 |
+| rootClassName | string | - | 根包装器的 className。 |
+| rootStyle | CSSProperties | - | 根包装器的样式。 |
+| size | number \| string | `378` for left/right | 抽屉尺寸。控制左/右的宽度和顶部/底部放置的高度。 |
+| style | CSSProperties | - | 抽屉面板的样式。 |
+| styles | `{ mask?: CSSProperties; wrapper?: CSSProperties; section?: CSSProperties; dragger?: CSSProperties }` | - | 内部抽屉元素的语义样式。 |
+| width | number \| string | - | 已废弃。请使用 `size` 进行左侧或右侧放置。 |
+| zIndex | number | - | 根包装器 z 索引。 |
+
+鼠标和键盘事件处理程序(例如 `onClick` 、 `onMouseEnter` 、 `onMouseLeave` 、 `onKeyDown` 和 `onKeyUp`)将传递到抽屉面板。
+
+## 本地开发
+
+```bash
+npm install
+npm start
+```
+
+dumi 站点默认运行在 `http://localhost:8000`。
+
+Common commands:
+
+```bash
+npm run lint
+npm test
+npm run tsc
+npm run compile
+```
+
+## 发布
+
+```bash
+npm run prepublishOnly
+```
+
+包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。
+
+## 许可证
+
+@rc-component/drawer 基于 [MIT](./LICENSE) 许可证发布。
diff --git a/package.json b/package.json
index 012cca3d..691b715b 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"drawer-motion",
"drawer-animation"
],
- "homepage": "https://github.com/react-component/drawer",
+ "homepage": "https://react-component.github.io/drawer",
"bugs": {
"url": "https://github.com/react-component/drawer/issues"
},
@@ -34,12 +34,12 @@
"scripts": {
"build": "dumi build",
"compile": "father build && lessc assets/index.less assets/index.css",
- "lint": "eslint src/ --ext .tsx,.ts",
- "now-build": "npm run build",
+ "lint": "eslint src/ docs/ tests/ --ext .tsx,.ts,.jsx,.js",
"prepublishOnly": "npm run compile && rc-np",
"start": "dumi dev",
"test": "rc-test",
- "prettier": "prettier --write .",
+ "tsc": "tsc --noEmit",
+ "prettier": "prettier --write --ignore-unknown .",
"prepare": "husky"
},
"dependencies": {
@@ -51,40 +51,42 @@
"devDependencies": {
"@ant-design/icons": "^6.2.5",
"@rc-component/father-plugin": "^2.2.0",
- "@rc-component/np": "^1.0.0",
- "@testing-library/jest-dom": "^6.2.0",
- "@testing-library/react": "^16.3.0",
- "@types/jest": "^29.5.11",
- "@types/node": "^25.0.0",
+ "@rc-component/np": "^1.0.4",
+ "@testing-library/jest-dom": "^6.9.1",
+ "@testing-library/react": "^15.0.7",
+ "@types/jest": "^29.5.14",
+ "@types/node": "^26.0.1",
"@types/raf": "^3.4.0",
- "@types/react": "^19.0.0",
- "@types/react-dom": "^19.0.0",
- "@types/warning": "^3.0.0",
+ "@types/react": "^18.3.31",
+ "@types/react-dom": "^18.3.7",
+ "@types/warning": "^3.0.4",
"antd": "^6.3.4",
- "dumi": "^2.2.0",
- "eslint": "^8.56.0",
- "eslint-plugin-jest": "^29.0.1",
- "eslint-plugin-unicorn": "^51.0.1",
- "father": "^4.0.0",
- "glob": "^10.3.10",
- "husky": "^9.0.10",
- "less": "^4.2.0",
- "lint-staged": "^16.1.5",
- "prettier": "^3.0.0",
- "rc-test": "^7.0.9",
- "react": "^19.0.0",
- "react-dom": "^19.0.0",
+ "dumi": "^2.4.35",
+ "eslint": "^8.57.1",
+ "eslint-plugin-jest": "^27.9.0",
+ "eslint-plugin-unicorn": "^56.0.1",
+ "father": "^4.6.23",
+ "glob": "^13.0.6",
+ "husky": "^9.1.7",
+ "less": "^4.6.7",
+ "lint-staged": "^16.4.0",
+ "prettier": "^3.9.0",
+ "rc-test": "^7.1.3",
+ "react": "^18.3.1",
+ "react-dom": "^18.3.1",
"stylelint": "^17.1.0",
"stylelint-config-standard-less": "^4.0.0",
- "typescript": "^5.3.3"
+ "typescript": "^5.9.3"
},
"peerDependencies": {
"react": ">=18.0.0",
"react-dom": ">=18.0.0"
},
"lint-staged": {
- "*.{js,jsx,ts,tsx}": "eslint --fix",
- "*.{css,less}": "stylelint --fix",
- "*.{js,jsx,ts,tsx,json,less,css,md}": "prettier --write"
- }
+ "*": "prettier --write --ignore-unknown"
+ },
+ "publishConfig": {
+ "access": "public"
+ },
+ "types": "./es/index.d.ts"
}
diff --git a/tsconfig.json b/tsconfig.json
index 2045db31..ae2a1570 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -11,7 +11,8 @@
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"@rc-component/drawer": ["src/index.ts"]
- }
+ },
+ "ignoreDeprecations": "5.0"
},
- "include": [".dumirc.ts", "**/*.ts", "**/*.tsx"]
+ "include": [".dumirc.ts", ".fatherrc.ts", "**/*.ts", "**/*.tsx"]
}
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 00000000..5f9139ef
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,6 @@
+{
+ "framework": "umijs",
+ "installCommand": "npm install",
+ "buildCommand": "npm run build",
+ "outputDirectory": "docs-dist"
+}