0.3.4 • Published 3 years ago

cra-template-level v0.3.4

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

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

  • 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: 修复bug
  • test: 单元测试
  • 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 版本的变更
@babel/core@babel/plugin-proposal-function-bind@babel/plugin-transform-react-constant-elements@babel/plugin-transform-react-inline-elements@emotion/css@emotion/react@emotion/styled@material-ui/core@material-ui/icons@material-ui/lab@material-ui/styled-engine-sc@material-ui/styles@pmmmwh/react-refresh-webpack-plugin@svgr/webpack@testing-library/jest-dom@testing-library/react@testing-library/user-event@types/cors@types/express@types/jest@types/lodash@types/node@types/react@types/react-dom@types/react-router-dom@typescript-eslint/eslint-plugin@typescript-eslint/parserbabel-eslintbabel-jestbabel-loaderbabel-plugin-dev-expressionbabel-plugin-named-asset-importbabel-preset-react-appbfjbluebirdcamelcasecase-sensitive-paths-webpack-plugincorscross-envcss-loaderd3dotenvdotenv-expandeslinteslint-config-airbnb-typescripteslint-config-react-appeslint-plugin-flowtypeeslint-plugin-importeslint-plugin-jesteslint-plugin-jsx-a11yeslint-plugin-reacteslint-plugin-react-hookseslint-plugin-testing-libraryeslint-webpack-pluginexpressfile-loaderfs-extrahighchartshtml-webpack-pluginhttpidentity-obj-proxyimmutableisomorphic-fetchjestjest-circusjest-resolvejest-watch-typeaheadlocalforagelodashmathjsmini-css-extract-pluginmobxmobx-reactmomentoptimize-css-assets-webpack-pluginpnp-webpack-pluginpostcsspostcss-cssnextpostcss-flexbugs-fixespostcss-loaderpostcss-normalizepostcss-pluginpostcss-preset-envpostcss-safe-parserpostcss-scsspromptsramdareactreact-app-polyfillreact-dev-utilsreact-domreact-playerreact-refreshreact-router-domresolveresolve-url-loaderrxjssasssass-loadersemverstyle-loaderstyled-componentsstylelint-orderterser-webpack-plugints-pnptypescripturijsurl-loaderuuidviewerjsweb-vitalswebpackwebpack-dev-serverwebpack-manifest-pluginwhatwg-fetchworkbox-webpack-plugin
0.3.4

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.0

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago