Dollie.js is a generator for generating everything, based on Yeoman. Dollie CLI is the command line interface for Dollie.js.
npm install -g @dollie/cli
and then it will create a binary link to dollie
.
Just run:
dollie
then follow the prompt.
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 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 makepackage.json
as a customizable file, you should rename it as__template.package.json
- Create a file named
.dollie.json
, put your questions in thequestions
param - Contact [email protected], then we will fork your GitHub repository into our organization
.dollie.json
is the configuration file for Dollie.js, the configuration params are shown as below:
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.
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.