github: https://github.com/weidian-inc/bio-cli
npm: https://www.npmjs.com/package/bio-cli
Attention: Mac only for now
bio is a command cli tool for:
- creating project demo files
- compiling project without configuring
- stylelint / eslint
- local mock
- ...
-
Node.js(>= 8.9.1)
-
bio
[sudo] npm install bio-cli -g
-
make a blank directory
demo
mkdir demo cd demo
-
init project of different types
bio init vue
: initvue
projectbio init react
: initreact
projectbio init pure
: init project of other types
-
run task
dev-daily
bio run dev-daily
-
description
It will:
- init project files in current directory.
- run
npm install
automatically.
-
params
-
scaffoldName in npm registry
bio will search for scaffoldName from npm registry
-
scaffold short name
By default, bio provides shortName for scaffolds in npm as list:
vue
forbio-scaffold-vue
react
forbio-scaffold-react
pure
forbio-scaffold-pure
-
-
examples
init a vue project:
bio init bio-scaffold-vue
orbio init vue
init a react project:
bio init bio-scaffold-react
orbio init react
init a pure project:
bio init bio-scaffold-pure
orbio init pure
-
description
It will run task that is only supported by scaffold, which was defined in
bio init <scaffoldName>
. -
param
-
<taskName that scaffold supports>
By default, these tasks are supported in bio inside scaffolds as list:
dev-daily
: develop in daily envioronment.dev-pre
: develop in re envioronment.dev-prod
: develop in prod envioronment.build-daily
: build in daily envioronment.build-pre
: build in pre envioronment.build-prod
: build in prod envioronment.
-
-n, --no-watch
bio
will lanch a local server to watch file changes by default.-n, --no-watch
will close this server.
-
-
examples
- run task
dev-daily
and watch file changes:bio run dev-daily
- run task
dev-daily
and don't watch file changes:bio run dev-daily -n
- run task
build-daily
and don't watch file changes:bio run build-daily -n
- run task
bio
will lanch a local mock server and create a test file named as ./mock/test.json
.
7000
is the default server port, and it can be changed by offering port.
example:
bio mock 8000
bio lint init
examples:
- auto fixing and only run once:
bio lint --fix
- not auto fixing and only run once:
bio lint
- auto fixing and watching file changes:
bio lint --fix -w
- not auto fixing and watching file changes:
bio lint -w
It will show helps.
- add unitests
- CI
- complex demos
MIT