cra-template-level
v0.3.4
Published
cra-template-level template for react, typescript, mobx, material-ui, sass
Downloads
4
Maintainers
Readme
cra-template-level
Usage
npx create-react-app [project-name] --template level
git repository
https://github.com/w-lianfu/cra-template-level.git
You can publish this for your own cra-template-*
npm login
npm publish --access public
npm link
- https://www.npmjs.com/package/husky
submodule address
https://github.com/react-level/level-base.git
qiankun
qiankun main config
- qiankun project demo
https://github.com/qiankun-react
- default support as
qiankun sub app
registerMicroApps(
[
{
name: 'sub1',
entry: '//localhost:5001',
container: '#sub1',
activeRule: '/sub1',
},
{
name: 'sub2',
entry: '//localhost:5004',
container: '#sub2',
activeRule: '/sub2',
},
],
{
beforeLoad: [
// @ts-ignore
app => {
console.log('Before load -- ', app);
},
],
beforeMount: [
// @ts-ignore
app => {
console.log('Before mount -- ', app);
},
],
afterMount: [
// @ts-ignore
app => {
console.log('After mount -- ', app);
},
],
beforeUnmount: [
// @ts-ignore
app => {
console.log('Before unmount -- ', app);
},
],
afterUnmount: [
// @ts-ignore
app => {
console.log('After unmount -- ', app);
},
],
},
);
setDefaultMountApp('/home');
start();
qian-sub config
/** qiankun lifecycle */
// bootstarp
const bootstrap = async () => {
console.log('salary-web-home ~~~ bootstraped ~~~');
};
// mount
const mount = async (props: any) => {
console.log('salary-web-home ~~~ mount ~~~');
const container = document.getElementById('root');
// @ts-ignore
const root = ReactDOM.createRoot(container);
root.render(<AppRoot />);
};
// unmount
const unmount = async (props: any) => {
console.log('salary-web-home ~~~ unmount ~~~ ', props);
ReactDOM.unmountComponentAtNode(props.container);
};
// update
const update = async (props: any) => {
console.log('salary-web-home ~~~ update ~~~ props', props);
};
export {
bootstrap,
mount,
unmount,
update,
};
git commit 提交规范
约定式提交: https://www.conventionalcommits.org/zh-hans/v1.0.0-beta.4/
feat
: 新增功能/完成任务 (feature)fix
: 修复bugtest
: 单元测试docs
: 文档 (documentation)style
: 样式refactor
: 代码重构pref
: 优化相关,比如提升性能/体验ci
: CI/CD相关chore
: 辅助/其它revert
: 恢复变更/回滚到上一个版本little
: 微不足道的变更try
: 尝试
scope:
#task
: 完成的任务加任务编号#bug
: 修复的bug加bug号#test
: 单元测试加任务编号self-test
: 自测sub-**
: 变更了sub模块的**功能!
: 包含破环性变更
重点
- Bug 修复了bug的,带bug号,例:
fix(#11): 修复样式bug
- Feat 完成了任务/新增了功能的,带任务编号,例:
feat(#12): 完成任务-添加视频宣传
- Test 完成了单元测试功能的,加任务编号,例:
test(#13): 登录模块增加单元测试
- Log 通过 git log 查看:
git log --grep=feat
git log --grep fix
!
会触发MAJOR
版本的变更feat
会触发MINOR
版本的变更fix
会触发PATCH
版本的变更