Skip to content

Commit 91e09db

Browse files
committed
[Feature] Updated README.md
1 parent ee2867a commit 91e09db

File tree

5 files changed

+70
-8
lines changed

5 files changed

+70
-8
lines changed

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,53 @@
11
# flow-react-cli
22

3+
![npm](https://img.shields.io/npm/v/flow-react-cli)
4+
![NPM](https://img.shields.io/npm/l/flow-react-cli)
5+
![npm](https://img.shields.io/npm/dt/flow-react-cli)
6+
7+
![logo](./design/logo.jpg)
8+
9+
This CLI program is a package that creates the boilerplate and components needed to develop React.
10+
Using flow-react-cli, you can increase the productivity of React.
11+
12+
The two main features of this CLI program are as follows:
13+
14+
1. Create a React or Next.js project that has completed the installation and setup of the Typescip, Eslint, Pretty, and CSS libraries (styled-components or Tailwind CSS).
15+
2. When you create a functional component page, you can create a page where the boilerplate was created.
16+
17+
# 📢 Notes
18+
19+
> This program was inspired by [dooboo-cli](https://github.com/dooboolab/dooboo-cli) and created by referring to the code in the dooboo-cli.
20+
>
21+
> The difference between flow-react-cli and dooboo-cli is shown below.
22+
>
23+
> 1. When you create a project, you can automatically update and use the most recent update of the packages that have dependencies.the name.
24+
> 2. When you create a React project, you can install the CSS library together.
25+
> 3. You can create any project when you create a component. This means that you can create components, even if they are not projects created using that package.
26+
> 4. When creating a project or component, there is no restriction on
27+
28+
> flow-react-cli updates packages for dependencies using the [npm-check-updates]() package when you create or update a project.
29+
30+
# Installation
31+
32+
`npm install -g flow-react-cli`
33+
or `yarn global add flow-react-cli`
34+
35+
# Usage
36+
37+
```
38+
Usage: flow [command]
39+
40+
Options:
41+
-V, --version output the version number
42+
-h, --help display help for command
43+
44+
Commands:
45+
init Initialize the React or Next.js project, including the Boilerplate.
46+
update Use the npm-check-updates package to update the package in the project.
47+
page <fileName> <filePath> Generate page(screen) component.
48+
help [command] display help for command
49+
```
50+
51+
# Preview
52+
53+
![interface](./design/interface.png)

bin/init.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ enum TYPE_OF_STYLE {
1818
STYLED_COMPONENTS = "styled-components"
1919
}
2020

21-
2221
const selectShellStyle = {
2322
pointer: " ▸ ",
2423
pointerColor: "yellow",
@@ -78,7 +77,12 @@ async function isWantStyle() {
7877
])
7978
}
8079

81-
function createApp(selectApp: number, nameOfApp: string, defaultNodePackageName: string, style: string) {
80+
function createApp(
81+
selectApp: number,
82+
nameOfApp: string,
83+
defaultNodePackageName: string,
84+
style: string
85+
) {
8286
const gitDownSpinner = ora("Creating app: " + nameOfApp + "...\n")
8387
gitDownSpinner.start()
8488
const gitURL = getGitURL(selectApp, style)
@@ -93,7 +97,12 @@ function createApp(selectApp: number, nameOfApp: string, defaultNodePackageName:
9397
})
9498
}
9599

96-
function flowUp(selectApp:number, nameOfApp: string, defaultNodePackageName: string, style: string) {
100+
function flowUp(
101+
selectApp: number,
102+
nameOfApp: string,
103+
defaultNodePackageName: string,
104+
style: string
105+
) {
97106
const projectCleanupSpinner = ora("Project Cleanup...\n")
98107
projectCleanupSpinner.start()
99108

@@ -114,7 +123,7 @@ function flowUp(selectApp:number, nameOfApp: string, defaultNodePackageName: str
114123
}, 2000)
115124
}
116125

117-
function reinstallAutotprefixcer(selectApp:number, style: string) {
126+
function reinstallAutotprefixcer(selectApp: number, style: string) {
118127
if (style == TYPE_OF_STYLE.TAILWIND && selectApp == TYPE_OF_APP.REACT) {
119128
const tailwindSpinner = ora("autotprefixcer setting for tailwindcss...\n").start()
120129
shell.exec("npm install autoprefixer@^9.8.6")
@@ -193,7 +202,7 @@ const init = () => {
193202
program
194203
.version(pkg.version)
195204
.command("init")
196-
.description("Initialize boilerplate for React.")
205+
.description("Initialize the React or Next.js project, including the Boilerplate.")
197206
.action(() => {
198207
shell.echo(chalk.yellow("Select which boilerplate you want to generate from flow-react-cli."))
199208

bin/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,19 @@ const printWelcomeMessage = () => {
1717
shell.echo(chalk.cyanBright(welcome))
1818
}
1919

20-
2120
const checkPkgUpdate = () => {
2221
const notifier = updateNotifier({
2322
pkg,
2423
updateCheckInterval: 1000 * 60 * 60 * 24 // 1 day
2524
})
26-
notifier.notify({isGlobal: true})
25+
notifier.notify({ isGlobal: true })
2726
}
2827

2928
printWelcomeMessage()
3029
checkPkgUpdate()
30+
31+
program.name("flow").usage("[command]")
32+
3133
init()
3234
update()
3335
page()

bin/update.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ora from "ora"
55
const update = () => {
66
program
77
.command("update")
8-
.description("Update packages.")
8+
.description("Use the npm-check-updates package to update the package in the project.")
99
.action(() => {
1010
const updateCheckSpinner = ora("Check package updates...\n").start()
1111
try {

design/logo.jpg

52.3 KB
Loading

0 commit comments

Comments
 (0)