1.0.3 • Published 2 years ago

cupshe-flow v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Cupshe-flow

cupshe 工作流. 覆盖项目全链路生命周期,在于统一脚手架、同构化方案、命令,集中维护、管理,更具语义化

脚手架

创建项目

cupshe init <template-name> [project-name]

模板列表

cupshe list

构建器

# 启动项目
cupshe dev

# 项目打包
cupshe build

Git

  1. 分支操作

    # 创建分支
    cupshe branch <branch-name>
    
    # 创建并切换新分支
    cupshe -b branch <branch-name>

    ⚠️注意:功能分支以"feature-"开头, 修复分支以"fix-"开头

  1. 切换分支

    cupshe switch <branch-name>
  2. 暂存

    # 暂存所有修改
    cupshe add .
    
    # 暂存指定文件
    cupshe add file1.js file2.js
  3. 提交

    # 提交修改
    cupshe commit -m <message>
  4. 合并

    # 合并分支并删除名为 branch-name 的远程分支
    cupshe merge <branch-name>
  5. 推送

    # 推送远程
    cupshe push
    # 创建远程分支并推送
    cupshe push origin
  6. 拉取合并

    cupshe pull
  7. 拉取更新

    cupshe fetch

校验

# 检查代码风格问题
cupshe eslint

# 自动格式化代码
cupshe eslint --fix

# 检查样式代码风格问题
cupshe stylelint

# 自动格式化样式代码
cupshe stylelint --fix

插件

Eslint

cupshe install eslint

主要流程: 1. git 前置操作
1.1 暂存当前文件的变更
1.2 切换到 master 分支
1.3 拉取最新代码
2. 开始配置
2.1 删除.eslintrc.js外的文件或配置,如下: - .eslintrc.yaml - .eslintrc.yml - .eslintrc.json - .eslintrc - package.json 中的 eslintConfig 属性

2.2 安装 eslint 插件 和 cupshe-eslint-config 配置包

2.3 判断是否有.eslintrc.js,没有则创建

2.4. 询问用户是否是全量覆盖配置 还是 增量配置 3. 首次代码格式化 4. 提交本次所有修改

Stylelint

cupshe install stylelint

Commitlint

cupshe install commitlint

Vscode

插件:Settings Sync

可以一键轻松实现上传下载跨多台机器同步设置、代码片段、主题、文件图标、启动、快捷键配置、工作区、VSCode插件和插件配置

  • Guist ID: 2c25224b6d8916672ab2e86dfb37e20a
  • Token: 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