/cli

⚡A scaffolding tool with command `der go`

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

der


star GPL

⚡𝓓𝓮𝓻 - A scaffolding tool for FE

What's 𝓓𝓮𝓻?

A scaffolding tool to improve development efficiency for FE, build with Node.js.

𝓓𝓮𝓻 can do

  • Create a new project
  • Auto commit & create a remote repo(github/gitee)
  • Version control(Git Flow)
  • Specification submission code

Quick Start

Install CLI

$ npm install @der-cli/core -g
# or
$ yarn global add @der-cli/core

Create a project with 'der init'

$ mikdir mytest && cd mytest

$ der init test-demo

Before initialization, you can execute the der tpl command to see which templates are available(Network dependent).

Commit to Github/Gitee with 'der go'

This command initializes the repo locally (.git) and commits the code to the remote repo.

Please check:

  • package.json
  • App Token
$ der go

Note: der go will commit the code to the remote repo with the same name of the project ( repo name is the name attribute value of package.json). If the remote repo does not exist, it will be created automatically. This requires you to prepare your remote repo APP Token in advance. GitHub users can apply for a token here. For Gitee users, see App Token.

If you have created a remote repo, check package.json file, you can use this command directly.

After executing the command, a dev / x.x.x branch will be generated remotely.

Release tag with 'der go -re'

$ der go --release
# or abbreviation
$ der go -re

该命令会将代码合并到 master 分发删除当前版本开发分支,创建同版本 tag 分支合并到远程 master 分支,然后提交至远程仓库(远程与本地操作同步)。

例: dev/1.0.1 => release/1.0.1,详见 Git_Flow.

每次执行 der go [-re] 时,脚手架会检查代码冲突,检查通过则正常提交, 未通过会退出命令进程,这需要你手动解决代码冲突,控制台会将冲突代码位置打印出来,解决冲突再次执行即可。

More Commands

View template list

$ der tpl

# Or only project template
$ der tpl --pro
# Or only component template
$ der tpl --com

View local cache

$ der cache --all

# or
$ der cache --git [--token]
# or
$ der cache --template
# or
$ der cache --dependencies

Empty local cache

For scaffold cache, see Cache.

# Default: clean all
$ der clean
$ der clean --all

# or just clean dependencies
$ der clean --dep

DEBUG Mode

$ der --debug
# or
$ der -d

More Commands here.

Debug local package

see docs

TODOs

  • Add feat: choice yarn/npm
  • Add feat: add page cmd(may)
  • Add feat: add component cmd(may)
  • Add feat: Commit code to GitHub and gitee at the same time

Documents

详情参考: docs

Change Log

CHANGELOG

Q & A

1.Can I Commit code directly after initialization?

A: Sure. The premise is to prepare your App Token.

2.Can I use the 'der go' command for projects I create directly?

A: Sure. der go will be based on your package.json content creates a repository and commits branch code.

Licence

Der cli is open source software licensed as GPL