Skip to content

dolliejs/dollie-cli

 
 

Repository files navigation

Dollie CLI

Shields Build Status Circle CI Build License GitHub Version

Dollie.js is a generator for generating everything, based on Yeoman. Dollie CLI is the command line interface for Dollie.js.

Installation

npm install -g @dollie/cli

and then it will create a binary link to dollie.

Create Project

Just run:

dollie

then follow the prompt.

Scaffolds

Find a Template

Go to https://github.com/dolliejs?tab=repositories&q=scaffold-, find an appropriate template, and get the name without scaffold- prefix, and input into the CLI interface.

Create a Template

  • Create all of the essential files for your scaffold
  • Rename file starts with __template. when you want to get the props from CLI's prompt to inject into it. For example, if you want to make package.json as a customizable file, you should rename it as __template.package.json
  • Create a file named .dollie.json, put your questions in the questions param
  • Contact i@lenconda.top, then we will fork your GitHub repository into our organization

.dollie.json

.dollie.json is the configuration file for Dollie.js, the configuration params are shown as below:

questions

It will be used by CLI's prompt. You can get the format schema from https://github.com/SBoudrias/Inquirer.js/#documentation

example:

{
  "questions": [
    {
      "type": "input",
      "name": "key1",
      "message": "Enter the key1"
    },
    {
      "type": "input",
      "name": "key2",
      "message": "Enter the key2"
    }
  ]
}

and Dollie CLI will get a data structure like:

{ key1: 'xxx', key2: 'xxx' }

which will be used by Dollie CLI to inject the templates starts with __ in your scaffold.

installers

There are three installer methods in original Yeoman:

  • generator.npmInstall
  • generator.yarnInstall
  • generator.bowerInstall

in Dollie CLI, we also provide a configuration param to describe the installers you want to use. Dollie CLI will traverse the installers array to map the installer:

{
  npm: npmInstall,
  yarn: yarnInstall,
  bower: bowerInstall
}

example:

{
  "installers": ["npm", "bower"]
}

and Dollie CLI will run npmInstall and bowerInstall when invoking install context method.

License

MIT © Lenconda & Dollie.js

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 55.2%
  • JavaScript 44.8%