# bobi-ui React组件库 **Repository Path**: battm/bobi-ui ## Basic Information - **Project Name**: bobi-ui React组件库 - **Description**: 尝试搭建完美架构的react组件库,第一次尝试深入前端架构的学习,希望能从中学到很多 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2023-10-16 - **Last Updated**: 2023-12-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # bobi-ui [![NPM version](https://img.shields.io/npm/v/bobi-ui.svg?style=flat)](https://npmjs.org/package/bobi-ui) [![NPM downloads](http://img.shields.io/npm/dm/bobi-ui.svg?style=flat)](https://npmjs.org/package/bobi-ui) A react library developed with dumi ## Usage TODO ## Options TODO ## Development ```bash # install dependencies $ npm install # develop library by docs demo $ npm start # build library source code $ npm run build # build library source code in watch mode $ npm run build:watch # build docs $ npm run docs:build # check your project for potential problems $ npm run doctor ``` ## LICENSE MIT ## 我学到的 const ButtonTypes=['xx','xxx','xxxx'] as const export const ButtonType = typeof ButtonType[number] '这种导入方式是默认导入方式' ### less 学习 ### 架构完善 #### lerna 实现 monorepo 的第一步 err: Cannot initialize lerna because your package manager has not been configured to use `workspaces`, and you have not explicitly specified any packages to operate on resolve: 在 package.json 添加 workspaces 选项,为了让其子目录成为单独的项目 流程: lerna init 别忘了在 package.json 里设置工作区是哪个文件夹 lerna create xxx 在工作区下的文件夹添加项目包 #### husky+eslint+prettier+commitizen+changelog】 ##### eslint ```yarn add --dev @typescript-eslint/parser @typescript-eslint/eslint-plugin ``` @typescript-eslint/parser 是解析器,先让eslint识别ts代码 这里可以使用推荐的 airbnb 风格的 lint 包 首先是要安装 airbnb 的包,先看看 airbnb 的依赖 `npm info eslint-config-airbnb@least peerDependencies ` `yarn add --dev eslint-plugin-import@^2.25.3 eslint-plugin-jsx-a11y@^6.5.1 eslint-plugin-react@^7.28.0 eslint-plugin-react-hooks@^4.3.0 -W ` `yarn add --dev eslint-config-airbnb eslint-config-airbnb-typescript ` 安装完 airbnb 和 airbnb 所需的依赖 #### commitlint 首先是安装 commitlint @commitlint/cli @commitlint/config-conventional(这个是 commitlint 的普遍规则 type: description) 然后安装 一直提交信息插件 用 cz-customizable 來代替 git commit 提交信息 `npm i -D cz-customizable ` 然后安装 commitlint 来使用 agular 规则来规范,在 cz-config 配置文件添加响应的扩展 `npm i -D @commitlint/cli @commitlint/config-conventional ` 然后安装 husky 来添加 git hooks `npm install --save-dev husky npx husky add .husky/commit-msg 'npx --no-install commitlint --edit "$1"' ` 因为不支持 emoji 所以下插件