基于xs-components-lib搭建的vue3+TS组件库。
- 获取项目代码(https or ssh)
git clone https://github.com/xmweijh/xm-components.git
git clone [email protected]:xmweijh/xm-components.git
- 安装依赖
npm install --legacy-peer-deps
- 组件库调试
npm run dev
- 运行 VitePress 文档
npm run docs:dev
- 创建组件模板
npm run ct '组件名称'
在packages中的tests文件夹中进行测试代码的书写。
测试命令:
# 运行test测试
npm run test
# 覆盖率输出
npm run test:coverage
- 打包组件库
npm run build
- 打包 VitePress 文档
npm run docs:build
运行npm run docs:dev
即可查看使用教程
-
参考 vue 规范
feat
新增功能fix
修复缺陷docs
文档变更style
代码格式refactor
代码重构perf
性能优化test
添加疏漏测试或已有测试改动build
构建流程、外部依赖变更 (如升级 npm 包、修改打包配置等)ci
修改 CI 配置、脚本revert
回滚 commitchore
对构建过程或辅助工具和库的更改 (不影响源文件)wip
正在开发中types
类型定义文件修改
-
或使用指令提交
npm run cz
- EsLint - js 语法检测
- StyleLint - 样式语法检测
- CommitLint - git commit 提交规范检测
.
├── LICENSE
├── README.md
├── build
├── commitlint.config.js
├── docs # vitepress文档目录
├── effect # 调试模板
├── lib
├── node_modules
├── package-lock.json
├── package.json
├── packages # 公共组件目录
│ ├── components # 组件存放目录
│ ├── hooks # hooks存放目录
│ ├── theme-default # 组件样式存放目录
│ ├── utils # 公共方法存放目录
├── postcss.config.js
├── prettier.config.js
├── script
├── stylelint.config.js
├── tsconfig.json
└── typings