0.1.7 • Published 3 years ago
yoking-ship v0.1.7
react+ts+hook 构建属于自己的组件库
12 发布npm,添加CI/CD自动化部署
1)
提交之前要lint检查
"lint": "eslint --ext js,ts,tsx,src --max-warnings 5",
提交之前通过测试安装(用cross-env设置环境变量)
"test:nowatch": "cross-env CI=true react-scripts test",
可以在发布之前检测代码是否通过及发布之前进行commit 检查
用到的库:husky
配置:
"husky": {
"hooks": {
"pre-commit": "npm run test:nowatch && npm run lint"
}
},
发布之前的代码如下:
"prepublish": "npm run test:nowatch && npm run lint && npm run build"
2)
生成静态storybook文档页面