1.1.4 • Published 4 years ago

genfe-cli v1.1.4

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Genfe-cli

初衷不想一遍遍写这该死的配置文件,重复的东西都该想办法消除
通过命令行快速生成配置、基础代码、以及相关生态
要可以同步本地已有配置,保留自定义改动
可以选择性的生成某个配置

使用

npx gen-fe [-d|--default]
           [--no-install]
           [--no-generator]

配置清单

  • typescript
    • tsconfig.json
  • husky
    • .huskyrc
  • lint-staged
    • .lintstagedrc
  • commitlint
    • commitlint.config.js
  • prettier
    • .prettierrc
  • eslint
    • .eslintignore
    • .eslintrc.js
  • babel
    • babel.config.js
  • browserslist
    • .browserslistrc
  • nodemon
    • nodemon.json
  • npm
    • .npmignore
    • .npmrc
  • vscode
    • .vscode
    • jsconfig.json
    • .editorconfig
  • git
    • .gitignore

项目清单

  • react
  • react-native
  • vue

react-native

提供了 react-native 的模板项目

合并方式

使用 git-merge-file 三路文件合并命令合并文件

usage: git merge-file [<options>] [-L <name1> [-L <orig> [-L <name2>]]] <file1> <orig-file> <file2>

    -p, --stdout          send results to standard output
    --diff3               use a diff3 based merge
    --ours                for conflicts, use our version
    --theirs              for conflicts, use their version
    --union               for conflicts, use a union version
    --marker-size <n>     for conflicts, use this marker size
    -q, --quiet           do not warn about conflicts
    -L <name>             set labels for file1/orig-file/file2

规则为合并 file1、file2 到 file1 文件中,file1、file2 以 orig-file 为原始文件,这里可以给一个空文件
file1 指定为用户目录下的文件,file2 指定项目中要 merge 的文件,orig-file 为 lib 下的空文件
调用 bash 命令执行合并

合并命令

使用/dev/null 代替空文件

git merge-file file1 /dev/null file2

TODO

  • 基础代码,先完善目前定义的所有的配置
  • 提供 cli,可一键生成,或自定义
  • 增加 vscode 配置
  • 如何使用 git merge 的形式合并配置文件
  • 支持写入 package 里的配置
  • 优化配置,补充参考业内好的配置
  • 考虑如何生成项目模板代码

参考项目

参考文档

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago