diff --git a/.dumirc.ts b/.dumirc.ts index 95ecbc3..f31cdc8 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -2,10 +2,11 @@ import { defineConfig } from 'dumi'; import path from 'path'; -const basePath = process.env.GITHUB_ACTIONS ? '/collapse/' : '/'; -const publicPath = process.env.GITHUB_ACTIONS ? '/collapse/' : '/'; +const basePath = process.env.GH_PAGES ? '/collapse/' : '/'; +const publicPath = basePath; export default defineConfig({ + outputPath: 'docs-dist', alias: { 'rc-collapse$': path.resolve('src'), 'rc-collapse/es': path.resolve('src'), diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..758659a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +github: ant-design +open_collective: ant-design diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6745ced..3b730ef 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,28 +1,19 @@ version: 2 updates: -- package-ecosystem: npm - directory: "/" - schedule: - interval: daily - time: "21:00" - open-pull-requests-limit: 10 - ignore: - - dependency-name: "@types/react-dom" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - dependency-name: "@types/react" - versions: - - 17.0.0 - - 17.0.1 - - 17.0.2 - - 17.0.3 - - dependency-name: np - versions: - - 7.2.0 - - 7.3.0 - - 7.4.0 - - dependency-name: less - versions: - - 4.1.0 + - package-ecosystem: npm + directory: '/' + schedule: + 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 diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index 5735e2d..36dacae 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 0000000..097eb88 --- /dev/null +++ b/.github/workflows/react-doctor.yml @@ -0,0 +1,27 @@ +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/site-deploy.yml b/.github/workflows/site-deploy.yml index 8f12507..c5de830 100644 --- a/.github/workflows/site-deploy.yml +++ b/.github/workflows/site-deploy.yml @@ -13,12 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v7 + with: + persist-credentials: false - name: setup node - uses: actions/setup-node@v1 + uses: actions/setup-node@v6 with: - node-version: 14 + node-version: 20 - name: create package-lock.json run: npm i --package-lock-only --ignore-scripts @@ -30,10 +32,10 @@ jobs: run: npm run build - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@329bcc8f12caed2cefe5a5b80781499a6f3b361b with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + publish_dir: ./docs-dist force_orphan: true user_name: 'github-actions[bot]' user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/.github/workflows/surge-preview.yml b/.github/workflows/surge-preview.yml new file mode 100644 index 0000000..cffac6c --- /dev/null +++ b/.github/workflows/surge-preview.yml @@ -0,0 +1,50 @@ +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 + env: + PREVIEW: 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 e1c3a36..f01a997 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,8 @@ pnpm-lock.yaml .dumi/tmp .dumi/tmp-production .dumi/tmp-test +docs-dist .env.local src/.umi -bun.lockb \ No newline at end of file +bun.lockb diff --git a/.husky/pre-commit b/.husky/pre-commit index c27d889..2312dc5 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -lint-staged +npx lint-staged diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..c466d87 --- /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/LICENSE b/LICENSE new file mode 100644 index 0000000..bd0a1f7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019-present react-component + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 96ceda1..57f91a1 100644 --- a/README.md +++ b/README.md @@ -1,250 +1,114 @@ -# rc-collapse - -rc-collapse ui component for react - -[![NPM version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url] [![Test coverage][codecov-image]][codecov-url] [![npm download][download-image]][download-url] - -[npm-image]: http://img.shields.io/npm/v/rc-collapse.svg?style=flat-square -[npm-url]: http://npmjs.org/package/rc-collapse -[github-actions-image]: https://github.com/react-component/collapse/workflows/CI/badge.svg -[github-actions-url]: https://github.com/react-component/collapse/actions -[codecov-image]: https://img.shields.io/codecov/c/github/react-component/collapse/master.svg?style=flat-square -[codecov-url]: https://app.codecov.io/gh/react-component/collapse -[download-image]: https://img.shields.io/npm/dm/rc-collapse.svg?style=flat-square -[download-url]: https://npmjs.org/package/rc-collapse - -## Live Demo - -https://collapse-react-component.vercel.app +
+

@rc-component/collapse

+

Ant Design Part of the Ant Design ecosystem.

+

🪗 A flexible collapse and accordion component for React.

+ +

+ NPM version + npm downloads + build status + Codecov + bundle size + dumi +

+
+ +

English | 简体中文

+ +## Highlights + +- Supports accordion and multi-panel collapse modes. +- Prefer the `items` API for declarative panel configuration. +- Keeps `Collapse.Panel` for compatibility. It is deprecated and will be removed in v4. +- Supports custom expand icons, semantic class names, semantic styles, and motion. ## Install -[![rc-collapse](https://nodei.co/npm/rc-collapse.png)](https://npmjs.org/package/rc-collapse) +```bash +npm install @rc-component/collapse +``` ## Usage -```js -var Collapse = require('rc-collapse'); -var Panel = Collapse.Panel; -var React = require('react'); -var ReactDOM = require('react-dom'); -require('rc-collapse/assets/index.css'); - -var App = ( - - - this is panel content - - this is panel content2 or other - -); -ReactDOM.render(App, container); +```tsx | pure +import Collapse from '@rc-component/collapse'; +import '@rc-component/collapse/assets/index.css'; + +export default function App() { + return ( + + ); +} ``` -## Features - -- support ie8,ie8+,chrome,firefox,safari - -## API - -### Collapse props - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
activeKeyString|ArrayThe first panel keycurrent active Panel key
classNameString or objectcustom className to apply
defaultActiveKeyString|Arraynulldefault active key
destroyOnHiddenBooleanfalseIf destroy the panel which not active, default false.
accordionBooleanfalseaccordion mode, default is null, is collapse mode
onChangeFunction(key)noopcalled when collapse Panel is changed
expandIcon(props: PanelProps) => ReactNodespecific the custom expand icon.
collapsible'header' | 'icon' | 'disabled'-specify whether the panel of children is collapsible or the area of collapsible.
items - interface.ts#ItemType - -collapse items content
- -If `accordion` is null or false, every panel can open. Opening another panel will not close any of the other panels. `activeKey` should be an string, if passing an array (the first item in the array will be used). +## Examples -If `accordion` is true, only one panel can be open. Opening another panel will cause the previously opened panel to close. `activeKey` should be an string, if passing an array (the first item in the array will be used). +Run the local dumi site: -### Collapse.Panel props - -> **deprecated** use `items` instead, will be removed in `v4.0.0` - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
nametypedefaultdescription
headerString or nodeheader content of Panel
headerClassString' 'custom className to apply to header
showArrowbooleantrueshow arrow beside header
classNameString or objectcustom className to apply
classNames{ header?: string, body?: string }Semantic structure className
styleobjectcustom style
styles{ header?: React.CSSProperties, body?: React.CSSProperties }Semantic structure styles
openMotionobjectset the animation of open behavior, [more](https://github.com/react-component/motion). Different with v2, closed pane use a `rc-collapse-content-hidden` class to set `display: none` for hidden.
forceRenderbooleanfalseforced render of content in panel, not lazy render after clicking on header
extraString | ReactNodeContent to render in the right of the panel header
collapsible'header' | 'icon' | 'disabled'-specify whether the panel be collapsible or the area of collapsible.
- -> `disabled` is removed since 3.0.0, please use `collapsible=disabled` replace it. - -#### key - -If `key` is not provided, the panel's index will be used instead. - -#### KeyBoard Event +```bash +npm install +npm start +``` -By default, Collapse will listen `onKeyDown`(<3.7.0 `onKeyPress`) event with `enter` key to toggle panel's active state when `collapsible` is not `disabled`. If you want to disable this behavior, you can prevent the event from bubbling like this: +Then open `http://localhost:8000`. -```tsx | pure -const App = () => { - const items: CollapseProps['items'] = [ - { - label: e.stopPropagation()} />, - children: 'content', - }, - { - label: ( -
e.stopPropagation()}> - -
- ), - children: 'content', - }, - { - label: 'title 2', - children: 'content 2', - collapsible: 'disabled', - }, - { - label: 'title 3', - children: 'content 3', - onItemClick: console.log, - }, - ]; +## API - return ; -}; -``` +### Collapse + +| Property | Description | Type | Default | +| --- | --- | --- | --- | +| accordion | Only one panel can be opened at a time | boolean | false | +| activeKey | Current active panel key | `React.Key \| React.Key[]` | - | +| className | Additional class name | string | - | +| classNames | Semantic class names | `Partial>` | - | +| collapsible | Specify whether panel trigger area is collapsible | `header` \| `icon` \| `disabled` | - | +| defaultActiveKey | Initial active panel key | `React.Key \| React.Key[]` | - | +| destroyOnHidden | Destroy inactive panel content | boolean | false | +| expandIcon | Custom expand icon | `(props: object) => React.ReactNode` | - | +| items | Collapse items content | `ItemType[]` | - | +| openMotion | Custom open motion | `CSSMotionProps` | - | +| prefixCls | Component class name prefix | string | `rc-collapse` | +| style | Inline style | object | - | +| styles | Semantic styles | `Partial>` | - | +| onChange | Callback when active panels change | `(key: React.Key[]) => void` | - | + +### ItemType + +| Property | Description | Type | Default | +| --- | --- | --- | --- | +| key | Panel key | `React.Key` | - | +| label | Panel header content | `React.ReactNode` | - | +| ref | Panel DOM ref | `React.RefObject` | - | +| children | Panel body content | `React.ReactNode` | - | +| className | Additional panel class name | string | - | +| classNames | Semantic class names | `Partial>` | - | +| collapsible | Specify whether the panel is collapsible | `header` \| `icon` \| `disabled` | - | +| destroyOnHidden | Destroy inactive panel content | boolean | false | +| extra | Extra content in the panel header | `React.ReactNode` | - | +| forceRender | Render panel content before it is opened | boolean | false | +| showArrow | Show arrow beside header | boolean | true | +| style | Inline panel style | object | - | +| styles | Semantic styles | `Partial>` | - | +| onItemClick | Callback when this panel is clicked | `(panelKey: React.Key) => void` | - | + +### Collapse.Panel + +`Collapse.Panel` is deprecated. Use `items` instead. ## Development @@ -253,18 +117,24 @@ npm install npm start ``` -## Test Case +The dumi site runs at `http://localhost:8000` by default. ```bash npm test +npm run tsc +npm run lint +npm run compile +npm run build ``` -## Coverage +## Release ```bash -npm test -- --coverage +npm run prepublishOnly ``` +The release flow is handled by `@rc-component/np` through the `rc-np` command after the package build. + ## License -rc-collapse is released under the MIT license. +@rc-component/collapse is released under the [MIT](./LICENSE) license. diff --git a/README.zh-CN.md b/README.zh-CN.md new file mode 100644 index 0000000..9751c16 --- /dev/null +++ b/README.zh-CN.md @@ -0,0 +1,140 @@ +
+

@rc-component/collapse

+

Ant Design Ant Design 生态的一部分。

+

🪗 灵活的 React 折叠面板和手风琴组件。

+ +

+ NPM version + npm downloads + build status + Codecov + bundle size + dumi +

+
+ +

English | 简体中文

+ +## 特性 + +- 支持手风琴和多面板折叠模式。 +- 推荐使用 `items` API 声明式配置面板。 +- 保留 `Collapse.Panel` 以实现兼容性。它已被弃用,并将在 v4 中删除。 +- 支持自定义展开图标、语义化类名、语义样式和动画。 + +## 安装 + +```bash +npm install @rc-component/collapse +``` + +## 使用 + +```tsx | pure +import Collapse from '@rc-component/collapse'; +import '@rc-component/collapse/assets/index.css'; + +export default function App() { + return ( + + ); +} +``` + +## 示例 + +运行本地 dumi 站点: + +```bash +npm install +npm start +``` + +然后打开 `http://localhost:8000`。 + +## API + +### Collapse + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| accordion | 一次只能打开一个面板 | boolean | false | +| activeKey | 当前活动面板键 | `React.Key \| React.Key[]` | - | +| className | 附加 className | string | - | +| classNames | 语义化类名 | `Partial>` | - | +| collapsible | 指定面板触发区域是否可折叠 | `header` \| `icon` \| `disabled` | - | +| defaultActiveKey | 初始活动面板键 | `React.Key \| React.Key[]` | - | +| destroyOnHidden | 销毁非活动面板内容 | boolean | false | +| expandIcon | 自定义展开图标 | `(props: object) => React.ReactNode` | - | +| items | 折叠条目内容 | `ItemType[]` | - | +| openMotion | 自定义展开动画 | `CSSMotionProps` | - | +| prefixCls | 组件 className 前缀 | string | `rc-collapse` | +| style | 内联样式 | object | - | +| styles | 语义化样式 | `Partial>` | - | +| onChange | 活动面板更改时的回调 | `(key: React.Key[]) => void` | - | + +### ItemType + +| 参数 | 说明 | 类型 | 默认值 | +| --- | --- | --- | --- | +| key | 面板键值 | `React.Key` | - | +| label | 面板标题内容 | `React.ReactNode` | - | +| ref | 面板 DOM 引用 | `React.RefObject` | - | +| children | 面板主体内容 | `React.ReactNode` | - | +| className | 附加面板 className | string | - | +| classNames | 语义化类名 | `Partial>` | - | +| collapsible | 指定面板是否可折叠 | `header` \| `icon` \| `disabled` | - | +| destroyOnHidden | 销毁非活动面板内容 | boolean | false | +| extra | 面板标题中的额外内容 | `React.ReactNode` | - | +| forceRender | 在打开面板之前渲染面板内容 | boolean | false | +| showArrow | 在标题旁边显示箭头 | boolean | true | +| style | 内联面板样式 | object | - | +| styles | 语义化样式 | `Partial>` | - | +| onItemClick | 点击该面板时的回调 | `(panelKey: React.Key) => void` | - | + +### 折叠面板 + +`Collapse.Panel` 已弃用。请改用 `items`。 + +## 本地开发 + +```bash +npm install +npm start +``` + +dumi 站点默认运行在 `http://localhost:8000`。 + +```bash +npm test +npm run tsc +npm run lint +npm run compile +npm run build +``` + +## 发布 + +```bash +npm run prepublishOnly +``` + +包构建完成后,发布流程由 `@rc-component/np` 通过 `rc-np` 命令处理。 + +## 许可证 + +@rc-component/collapse 基于 [MIT](./LICENSE) 许可证发布。 diff --git a/package.json b/package.json index e936676..662fb76 100644 --- a/package.json +++ b/package.json @@ -10,39 +10,40 @@ "collapse", "accordion" ], - "homepage": "http://github.com/react-component/collapse", + "homepage": "https://react-component.github.io/collapse", "bugs": { - "url": "http://github.com/react-component/collapse/issues" + "url": "https://github.com/react-component/collapse/issues" }, "repository": { "type": "git", - "url": "git@github.com:react-component/collapse.git" + "url": "https://github.com/react-component/collapse.git" }, "license": "MIT", "main": "./lib/index", "module": "./es/index", - "typings": "es/index.d.ts", "files": [ "lib", "es", "assets/*.css" ], "scripts": { + "build": "npm run docs:build", "compile": "father build && lessc assets/index.less assets/index.css", "coverage": "rc-test --coverage", "docs:build": "dumi build", - "docs:deploy": "npm run docs:build && gh-pages -d dist", + "docs:deploy": "gh-pages -d docs-dist", "lint": "eslint src/ --ext .ts,.tsx,.jsx,.js,.md", "prepare": "husky", - "now-build": "npm run docs:build", "prepublishOnly": "npm run compile && rc-np", - "prettier": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"", - "postpublish": "npm run docs:deploy", + "prettier": "prettier --write --ignore-unknown .", + "postpublish": "npm run docs:build:gh-pages && npm run docs:deploy", "start": "dumi dev", - "test": "rc-test" + "test": "rc-test", + "tsc": "tsc --noEmit", + "docs:build:gh-pages": "GH_PAGES=1 npm run docs:build" }, "lint-staged": { - "**/*.{ts,tsx,js,jsx,json,md}": "npm run prettier" + "*": "prettier --write --ignore-unknown" }, "dependencies": { "@babel/runtime": "^7.10.1", @@ -53,31 +54,35 @@ "devDependencies": { "@rc-component/father-plugin": "^2.2.0", "@rc-component/np": "^1.0.4", - "@testing-library/jest-dom": "^6.1.4", - "@testing-library/react": "^16.3.0", - "@types/jest": "^29.4.0", - "@types/node": "^24.2.0", - "@types/react": "^19.1.4", - "@types/react-dom": "^19.1.5", - "@umijs/fabric": "^4.0.0", - "dumi": "^2.1.1", - "eslint": "^8.55.0", - "eslint-plugin-jest": "^29.0.1", - "eslint-plugin-unicorn": "^49.0.0", - "father": "^4.1.3", - "gh-pages": "^6.2.0", - "husky": "^9.0.0", - "jest": "^30.0.3", - "less": "^4.2.0", - "lint-staged": "^16.0.0", - "prettier": "^3.0.3", - "rc-test": "^7.0.14", - "react": "^19.1.0", - "react-dom": "^19.1.0", - "typescript": "^5.0.0" + "@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", + "dumi": "^2.4.35", + "eslint": "^8.57.1", + "eslint-plugin-jest": "^27.9.0", + "eslint-plugin-unicorn": "^56.0.1", + "father": "^4.6.23", + "gh-pages": "^6.3.0", + "husky": "^9.1.7", + "jest": "^29.7.0", + "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", + "typescript": "^5.9.3" }, "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" - } + }, + "publishConfig": { + "access": "public" + }, + "types": "./es/index.d.ts" } diff --git a/tsconfig.json b/tsconfig.json index bc68db4..7886929 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,12 +8,20 @@ "skipLibCheck": true, "esModuleInterop": true, "paths": { - "@/*": ["src/*"], - "@@/*": ["src/.dumi/*"], - "rc-collapse": ["src/index.tsx"] - } + "@/*": [ + "src/*" + ], + "@@/*": [ + "src/.dumi/*" + ], + "rc-collapse": [ + "src/index.tsx" + ] + }, + "ignoreDeprecations": "5.0" }, "include": [ + ".fatherrc.ts", ".dumirc.ts", "./src/**/*.ts", "./src/**/*.tsx", diff --git a/vercel.json b/vercel.json index cc12e40..5f9139e 100644 --- a/vercel.json +++ b/vercel.json @@ -1,3 +1,6 @@ { - "framework": "umijs" + "framework": "umijs", + "installCommand": "npm install", + "buildCommand": "npm run build", + "outputDirectory": "docs-dist" }