Skip to content

Commit

Permalink
feat(doc): complete readme and fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lenconda committed Jan 22, 2021
1 parent fa9e740 commit 7b595bb
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 23 deletions.
79 changes: 60 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,78 @@
# @lenconda/generator-react-app
# Dollie CLI

[![NPM version][npm-image]][npm-url]
![Shields Build Status](https://img.shields.io/circleci/build/github/dolliejs/dollie-cli/master)
![Circle CI Build](https://circleci.com/gh/dolliejs/dollie-cli.svg?style=svg)
![License](https://img.shields.io/github/license/dolliejs/dollie-cli)
![GitHub Version](https://img.shields.io/github/package-json/v/dolliejs/dollie-cli)

> A generator for React APP with Webpack
Dollie.js is a generator for generating everything, based on [Yeoman](http://yeoman.io). Dollie CLI is the command line interface for Dollie.js.

## Installation

First, install [Yeoman](http://yeoman.io) and generator-react-app using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)).

```bash
npm install -g yo
npm install -g @lenconda/generator-react-app
npm install -g @dollie/cli
```

and then it will create a binary link to `dollie`.

## Create Project

Just run:

```bash
yo @lenconda/react-app
dollie
```

then follow the prompt.

## Scaffolds

### Find a Template

Go to <https://github.com/lenconda?tab=repositories&q=yo-boilerplate-react->, find an appropriate template, and get the name without `yo-boilerplate-react-` prefix, and input into the CLI interface.
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.

## License
### Create a Template

- Create all of the essential files for your scaffold
- Rename file starts with `__` 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 `__package.json`
- Create a file named `.dollie.json`, put your questions in the `questions` param
- Contact [[email protected]](mailto:[email protected]), 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`

MIT © [Lenconda](https://lenconda.top)
It will be used by CLI's prompt. You can get the format schema from <https://github.com/SBoudrias/Inquirer.js/#documentation>

example:

```json
{
"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:

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

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

## License

[npm-image]: https://badge.fury.io/js/generator-react-app.svg
[npm-url]: https://npmjs.org/package/generator-react-app
[travis-image]: https://travis-ci.com/lenconda/generator-react-app.svg?branch=master
[travis-url]: https://travis-ci.com/lenconda/generator-react-app
[daviddm-image]: https://david-dm.org/lenconda/generator-react-app.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/lenconda/generator-react-app
[coveralls-image]: https://coveralls.io/repos/lenconda/generator-react-app/badge.svg
[coveralls-url]: https://coveralls.io/r/lenconda/generator-react-app
MIT © [Lenconda](https://lenconda.top) & [Dollie.js](https://github.com/dolliejs)
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
/**
* @file src/app/index.ts
* @author lenconda <[email protected]>
* @description this is the entry file for @dollies/cli generator
* @description this is the entry file for @dollie/cli generator
*
* For many reasons, the generator will be able to access all of the react boilerplate
* at https://github.com/dollies?q=scaffold-&tab=repositories, otherwise we can
* at https://github.com/dolliejs?q=scaffold-&tab=repositories, otherwise we can
* make the most little modification to this generator itself.
*
* So we made decisions to ask users to enter their favorite boilerplate's name, and then
* download it form GitHub.
*
* For details, please read https://github.com/dollies/dollies-cli#readme
* For details, please read https://github.com/dolliejs/dollie-cli#readme
*/

import path from 'path';
Expand Down Expand Up @@ -64,7 +64,7 @@ class DollieGenerator extends Generator {
type: 'input',
name: 'template',
message:
'Enter the template name from https://github.com/dolliejs?q=scaffold-&tab=repositories',
'Enter the scaffold name from https://github.com/dolliejs?q=scaffold-&tab=repositories',
default: 'react-typescript-sass',
},
];
Expand Down

0 comments on commit 7b595bb

Please sign in to comment.