@ne_fe/boot
ne front end basic module
Last updated a year ago by ne.fe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ne_fe/boot 
SYNC missed versions from official npm registry.

@ne_fe/boot

简介

ne 前端基础工程

安装&配置

全局安装该模块 $ npm install @ne_fe/boot -g$ npm install @ne_fe/boot -g --production

使用

1 获取使用帮助

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

$ ne -h
Usage: ne run [command] [option]

Options:

  -v, --version    output the version number
  -e --env [env]   what env do you want set
  --senv [senv]    what egg environment do you want
  -h, --help       output usage information

Commands:

  dev [options]    run project in dev mode
  build [options]  Only effective in dashboard or h5.
  lint             lint project code follow your eslint file
  packageName      echo project name
  packageVersion   echo project version
  startup:docker   startup. Only effective in docker container
  test             Only effective in service(egg.js)
  cov              Only effective in service(egg.js)
  ci               Only effective in service(egg.js)

2 获取版本号

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

$ ne-create-project -v

 v1.4.1

3 指令说明

3.1 dev

开发模式启动当前工程

$ ne run dev

3.2 build

编译当前工程

$ ne run build

3.3 lint

对当前工程进行语法检测

$ ne run lint

3.4 packageName

输出当前工程的名称

$ ne run packageName

3.5 packageVersion

输出当前工程的版本号

$ ne run packageVersion

3.6 startup:docker

容器中启动该工程的命令

$ ne run startup:docker

3.7 test

对当前工程进行单元测试,只在eggjs为基础的后端工程中有效

$ ne run test

3.8 cov

生成当前工程的测试覆盖率报告,只在eggjs为基础的后端工程中有效

$ ne run cov

3.9 ci

对当前工程进行语法检测并生成当前工程的测试覆盖率报告,只在eggjs为基础的后端工程中有效

$ ne run ci

4 设置环境变量

优先读取第一种方式设定的环境变量

4.1 运行时注入

4.1.1 -e --env

注入环境变量,可以用 process.env.k1 获取到

$ ne run dev -e k1=v1,k2=v2
$ ne run dev --env k1=v1,k2=v2
4.1.2 senv

注入eggjs启动参数,只在eggjs为基础的后端工程中有效

$ ne run dev --senv port=7002

4.2 在当前工程的package.json中写入

在当前工程的package.json中写入,格式为 默认在dev指令中注入了NODE_ENV=development

  "ne-env-[command]": {
    "k1": "v1",
    "k2": "v2"
  },
  "ne-senv-[command]": {
    "k1": "v1",
    "k2": "v2"
  }

其中 ne-senv-[command] 只在以eggjs为基础的后端工程中有效
例如

  "ne-env-dev": {
    "NODE_SYS": "dealer"
  },
  "ne-senv-dev": {
    "port": "7002"
  }

本地安装

工程目类下安装该模块 $ npm install @ne_fe/boot --save-dev
提供基于githook的相关语法检查与commit信息检查

相关功能基于yorkielint-staged进行修改

测试相关

请参照yorkielint-staged

Current Tags

  • 1.4.1                                ...           latest (a year ago)

25 Versions

  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.1                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.22                                ...           2 years ago
  • 1.1.21                                ...           2 years ago
  • 1.1.20                                ...           2 years ago
  • 1.1.19                                ...           2 years ago
  • 1.1.18                                ...           2 years ago
  • 1.1.17                                ...           2 years ago
  • 1.1.16                                ...           2 years ago
  • 1.1.15                                ...           2 years ago
  • 1.1.14                                ...           2 years ago
  • 1.1.13                                ...           2 years ago
  • 1.1.12                                ...           2 years ago
  • 1.1.10                                ...           2 years ago
  • 1.1.11                                ...           2 years ago
  • 1.1.9                                ...           2 years ago
  • 1.1.8                                ...           2 years ago
  • 1.1.7                                ...           2 years ago
  • 1.1.6                                ...           2 years ago
  • 1.1.5                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 6
Last Week 304
Last Month 980
Dependencies (33)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |