3.2.0 • Published 6 years ago

generator-nodex v3.2.0

Weekly downloads
5
License
MIT
Repository
github
Last release
6 years ago

Yo Generator nodex NPM version Build Status Dependency Status

This generator is based on the generator-node with many extended features.

generator-nodex creates a base template to start a new Node.js module, with extended features.

It is also easily composed into your own generators so you can only target your efforts at your generator's specific features.

This generator-nodex can also use as a parent class and create your own generator (instead of subclass directly from yeoman-generator)

const Generator  = require('generator-nodex/lib');

module.exports = class extends Generator {
  constructor(args, opts) {
    super(args, opts);
  }
}

We are currently working on finishing the last feature before we start putting the full documentation together.


Different between generator-node and generator-nodex

  1. Added language option, currently support English (default) and Simplify Chinese. Pass --lang=cn flag will enable it.
  2. You can import this and, use in your own generator (more detail in the wiki soon).
  3. There are several additional sub generators, more detail below.
  • nginx - this is incorporated into the nodex generator
  • systemd - this is stand alone, you can call it via yo nodex:systemd
  • ncu - npm-check-updates integrate into the generator
  • webhook - create poort man webhook ci support github, gitee or gitlab

You can run yo nodex:help to see the full list of sub generators available.


Install

$ npm install --global generator-nodex

Usage

$ yo nodex

Note that this template will generate files in the current directory, so be sure to change to a new directory first if you don't want to overwrite existing files.

That'll generate a project with all the common tools setup. This includes:

  • Filled package.json file
  • jest unit test and code coverage (optionally tracked on Coveralls)
  • ESLint linting and code style checking
  • nsp known vulnerability check
  • Travis CI continuous integration (optional)
  • License

Running tests

Once the project is scaffolded, inside the project folder run:

$ npm test

You can also directly use jest to run test on single files:

$ npm -g install jest-cli
$ jest --watch

Publishing your code

Once your tests are passing (ideally with a Travis CI green run), you might be ready to publish your code to npm. We recommend you using npm version to tag release correctly.

$ npm version major
$ git push --follow-tags
# ATTENTION: There is no turning back here.
$ npm publish

Extend this generator

First of all, make sure you're comfortable with Yeoman composability feature. Then in your own generator:

var Generator = require('yeoman-generator');

module.exports = class extends Generator({
  default() {
    this.composeWith(require.resolve('generator-nodex/generators/app'), {
      /* provide the options you want */
    });
  }
});

Options

Here's a list of our supported options:

  • boilerplate (Boolean, default true) include or not the boilerplate files (lib/index.js, test/index.js).
  • cli (Boolean, default false) include or not a lib/cli.js file.
  • editorconfig (Boolean, default true) include or not a .editorconfig file.
  • git (Boolean, default true) include or not the git files (.gitattributes, .gitignore).
  • license (Boolean, default true) include or not a LICENSE file.
  • travis (Boolean, default true) include or not a .travis.yml file.
  • githubAccount (String) Account name for GitHub repo location.
  • readme (String) content of the README.md file. Given this option, generator-nodex will still generate the title (with badges) and the license section.

Sub generators

If you don't need all the features provided by the main generator, you can still use a limited set of features by composing with our sub generators directly.

Remember you can see the options of each sub generators by running yo nodex:sub --help.

  • nodex:boilerplate
  • nodex:cli
  • nodex:editorconfig
  • nodex:eslint
  • nodex:git
  • nodex:nsp
  • nodex:readme
  • nodex:systemd
  • nodex:webhook
  • nodex:nginx

License

MIT © Yeoman team (http://yeoman.io)

NEWBRAN.CH

3.2.0

6 years ago

3.2.0-beta.4

6 years ago

3.2.0-beta.3

6 years ago

3.2.0-beta.2

6 years ago

3.2.0-beta.1

6 years ago

3.1.16

6 years ago

3.1.15

6 years ago

3.1.14

6 years ago

3.1.13

6 years ago

3.1.12

6 years ago

3.1.11

6 years ago

3.1.10

6 years ago

3.1.9

6 years ago

3.1.8

6 years ago

3.1.7

6 years ago

3.1.6

6 years ago

3.1.5

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.17

6 years ago

3.0.15

6 years ago

3.0.14

6 years ago

3.0.13

6 years ago

3.0.11

6 years ago

3.0.10

6 years ago

3.0.9

6 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

3.0.0-beta.7

6 years ago

3.0.0-beta.6

6 years ago

3.0.0-beta.5

6 years ago

3.0.0-beta.4

6 years ago

3.0.0-beta.3

6 years ago

3.0.0-beta.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago