zoba-ui 中文文档教程
zoba-ui
- 一个 React 组件库,它抽象了实现,但同时为您提供了按照您想要的方式设计样式的能力
:警告:为了使标准组件样式正常工作,您应该在项目中使用我们的
reset.scss
文件。
分区:
zoba-ui/components
zoba-ui/form-components
zoba-ui/typography-components
开始使用
安装全部与 npm 的依赖关系,运行
npm install
。请注意,我们此处不支持yarn
。要拥有开发环境,请运行
npm runstorybook
。要在项目中添加新的
svg
,请将其添加到./assets/svgs
文件夹中,然后运行 npm run svgr
来生成 SVG 的 React 组件。要构建库,请运行
npm run rollup
。要在 npm 中发布库的新版本,请更新
package.json
中的项目版本,然后运行 npmpublish
。
发布新版本
目前,我们没有发布新库版本的协议,因为它仍在开发中,但将来我们将创建一个工作流程来正确执行此操作。
我们需要以下工具:
- 单元测试,可能使用 Jest 和测试库
- 用于更新
CHANGELOG.md
文件的变更日志生成器 - 充分了解 语义版本控制
zoba-ui
- A React component library that abstracts the implementations but at the same time gives you the power of styling the way you want
:warning: For the standard component styles to work properly, you should use our
reset.scss
file in your project.
Division:
zoba-ui/components
zoba-ui/form-components
zoba-ui/typography-components
Getting started
To install all the dependencies with npm, run
npm install
. Be aware that we do not supportyarn
here.To have a development environment, run
npm run storybook
.To add a new
svg
in the project, add it in the./assets/svgs
folder and then runnpm run svgr
to generate SVG's React Components.To build the library, run
npm run rollup
.To publish a new version of the library in the npm, update the project version in the
package.json
and then runnpm publish
.
Publishing new versions
Currently we don't have a protocol to release a new library version since it's still under development, but in the future we'll create a workflow to do it properly.
We'll need the following tools:
- Unit tests, probably with Jest and Testing Library
- A changelog generator for updating the
CHANGELOG.md
file - A good knowledge of Semantic Versioning