4.5.4 • Published 3d ago
@zat-design/sisyphus-react
Licence
MIT
Version
4.5.4
Deps
12
Size
1.7 MB
Vulns
0
Weekly
1.7K
快速上手
西西弗4 基于 antd@6 版本开发
React 版本支持
本组件库支持 React 18.0+ 和 React 19.x:
- React 18.0.0 - 18.x.x(最低支持版本)
- React 19.0.0+(最新版本)
推荐版本:
- 生产环境:React 18.3.1 或 React 19.x
- 开发环境:React 19.x(本地验证最新特性)
peerDependencies:
{
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"ahooks": ">=3.9.5"
}注意(v4.2.0+):
ahooks已从dependencies移至peerDependencies,需要在消费者项目中单独安装:npm install ahooks # 或 yarn add ahooks
安装
npm 或 yarn 安装
# npm
$ npm install @zat-design/sisyphus-react --save
# yarn
$ yarn add @zat-design/sisyphus-react按需加载
自动 Tree-Shaking
本组件库已配置 sideEffects,现代打包器(Webpack 5+、Vite、Rollup)会自动进行 tree-shaking,无需额外配置:
// 只会打包 ProForm 相关代码,其他组件会被自动剔除
import { ProForm } from '@zat-design/sisyphus-react';使用示例
import React from 'react';
import { createRoot } from 'react-dom/client';
import { ProForm } from '@zat-design/sisyphus-react';
const App = () => {
return (
<ProForm
columns={[
{
type: 'Input',
label: '姓名',
name: 'name',
rules: [{ required: true, message: '请输入姓名!' }],
},
]}
/>
);
};
createRoot(document.getElementById('root')!).render(<App />);开发指南
本地开发
yarn install
yarn start运行测试
yarn test
yarn test:coverage # 带覆盖率组件库打包发布
# 1. 构建(生成 es/lib/dist 目录)
yarn build
# 2. 发布到 npm
yarn release # 正式版
yarn release:beta # beta 版本- 执行发布(使用域账号登录):
npm publish技术栈
- React 18.3+ / React 19
- Ant Design 6.x
- TypeScript
- Less