1.0.0 • Published 10 months ago

umi3-dtd-ts v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

环境准备

安装 node_modules:

npm install

or

yarn

开始项目

npm start

构建项目

npm run build

检查代码样式

npm run lint

你也可以使用脚本自动修复一些 lint 错误:

npm run lint:fix

测试代码

npm test

commit 规范

工程中配置了 commit-msg 钩子,在提交代码前,会检查所提交代代码的 commit 规范,不符合规范将报错

借助commitizen工具

  1. 全局安装 commitizen

  2. commit 时,使用命令 cz commit 代替 git commit

  3. 根据提示,输入 commit 信息

不借助 commitizen 工具

commit 格式需遵循如下规范:参考

Commit message 包括三个部分:Header、Body 和 Footer。

<type>(<scope>): <subject>
// 空一行
<body>
// 空一行
<footer>

Header 是必需的,Body 和 Footer 可以省略

  • Header

    Header 部分为一行,包括:type(必需)、scope(可选)和subject(必需)

    • type:

      feat:  新功能(feature)
      fix:  修补bug
      improve: 现有功能的改善
      docs:  文档(documentation)
      style:  格式(不影响代码运行的变动)
      refactor:  重构(即不是新增功能,也不是修改bug的代码变动)
      perf:  性能优化
      test:  增加测试
      chore:  构建过程或辅助工具的变动
      revert: revert 之前的提交
    • scope: 用于说明 影响范围

    • subject: commit 的简短描述
  • Body: 对本次 commit 的详细描述,可以分成多行

  • Footer: 关闭 issue

    eg: closes #123, #345

分支

  • 长期分支:master , release

  • 分支命名

    <feature | pre-release | fix | hotfix>-<name | tag>

    Eg: feature-V1.2.3

  • tag 命名

    <version | name>

    Eg: V1.2.3

其他

  • 命名空间统一加上前缀 MODULENAMESPACE,后续可用作宏替换
  • 书写样式应避免全局污染