ne-create-project

1.0.1 • Public • Published

ne-create-project

前端脚手架工程,包含不限于dashboard、nservice。

1 快速开始

全局安装该模块 $ npm install ne-create-project -g

1.1 获取使用帮助

通过ne-create-project -hne-create-project --help查看使用帮助

$ ne-create-project -h
 
 Usage: ne-create-project [Commend] [Options] 
 
  Options:
 
   
    --name [project name] set project name you want.         
    -v, --version   output the version number
    -h, --help      output usage information
 
  Commands:
 
    init [options]  init an project

1.2 获取版本号

通过ne-create-project -vne-create-project --version查看版本号

$ ne-create-project -v
 
 v1.0.0 

1.3 生成骨架工程

1.3.1 指定工程名

通过ne-create-project init --name [project name]开始初始化

$ ne-create-project init --name test-project

其中project name是将生成的文件夹名称,禁止和当前命令的执行文件夹下的子文件夹重名

1.3.2 选择要生成的工程类型

通过键盘上的选择工程类型

$ ne-create-project init --name test-project
 ? select this project's type (Use arrow keys)
 > nservice
   dashboard

目前仅支持两种类型

  • nservice
    运营管理系统后端,以eggjs为基础框架
  • dashboard
    运营管理系统前端,以vuejs为基础框架,可转到dashboard查看基础架构

1.3.3 指定所有者

$ ne-create-project init --name test-project
 ? select this project's type dashboard
 ? input this project's author [author name]

author name为所有者,必填

1.3.4 设定工程说明

$ ne-create-project init --name test-project
 ? select this project's type dashboard
 ? input this project's author [author name]
 ? input this project's description [description]

description为工程描述,可回车跳过

1.3.5 查看结果

当控制台输出SUCCESS! nservice Project [project name] initalized!表示执行成功。可以通过ls或检查当前文件夹查看

2 更新与支持

你可以阅读 更新与支持 查看该脚手架工程的更新记录和支持计划

3 测试相关

单元测试框架为mocha,采用mochawesome生成单元测试报告,采用istanbul生成测试覆盖率报告
你可以进入到该脚手架工程的安装目录,进入该工程文件夹查看相关测试报告
该工程文件夹下有有两个文件夹,分别是 reportercoverage,存放了单元测试报告和测试覆盖率报告

你也可以执行 npm run test 重新生成相关测试报告
如果你想在window环境下获取linux环境下的相关测试报告,可以在删除 node_modules/package-lock.json 文件后,在docker容器中进行测试,运行命令为
docker run -it --rm --name ne-create-project-test -v [所在文件夹]/ne-create-project:/usr/src/ne-create-project --user="root" -w /usr/src/ne-create-project node sh -c "npm install && npm run test"

Readme

Keywords

none

Package Sidebar

Install

npm i ne-create-project

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

1.63 MB

Total Files

181

Last publish

Collaborators

  • ne.fe