Duo UI (英语)
Duo UI是一个库,是所有Duo组件的所在地,它们由多个Host系统共享.
故事书
最新主要分支: https://gitlab-org.gitlab.io/duo-ui/ 页面存档备份,存于互联网档案馆
使用量
-
要在您的工程中使用 Duo UI, 请添加为依赖 :
yarn add @gitlab/duo-ui说明: 确保同时安装 Duo UI 的对等依赖性 。 参见
package.json用于对等关系依赖及其预期版本的列表.
快速启动 - 开发
说明: Duo UI不是设计在Windows本土上建造的. 无论是 WSL 维基月球 或者说 GitPod 图像 可用于设置 类似UNIX的环境来建造它.
确保你有 节点 16.x(LTS)和 雅伦 1.22 联合国 或更新.
# Clone the project
git clone [email protected]:gitlab-org/duo-ui.git
# Navigate to the root of the project
cd duo-ui
# Install all the dependencies of the project
yarn # or yarn install
# Build and launch storybook to see the components in the browser
yarn storybook
转到 http://localhost:9001/ (英语)
测试
单位测试
组件单位测试在 tests/components测试按以下顺序进行:
用于组织组件的目录结构.
-
yarn test:unit运行所有单位测试. -
yarn test:unit:watch在监视模式下运行所有单元测试. -
yarn test:unit:debug运行所有单元测试,并允许将调试器附加到测试跑道中. -
yarn jest [name_pattern]运行符合指定名称模式的 spec 文件.
实例
-
yarn jest datepicker将所有 spec 文件匹配到包含单词的名称 选取日期。 。 。 . -
yarn jest datepicker -t "when draw event is emitted"更远一步,只进行测试 带有一个符合向t旗帜.
视觉回归测试
Duo UI 使用可视快照测试来防止带 CSS 和 组件的布局变化。 更多关于这一点,请在 视觉测试文件。 。 。 .
释放
见 更新 Duo UI 软件包 如何使用
@gitlab/duo-ui 在各种项目中不断更新软件包.
贡献指南
请参考 捐款额 详细介绍如何添加新的组件和 普遍向Duo UI捐款.
问题
有问题吗? 看看我们 财务问题你也许能找到答案.