|
1 | 1 | ## Reactful |
2 | 2 |
|
3 | | -An opinionated CLI for full-stack server-rendered React applications. |
4 | | -You can use it to generate an independent React application that's |
5 | | -fully-configured to render on both client and server. |
| 3 | +An opinionated CLI for full-stack server-rendered React applications. You can use it to generate an independent React application that's fully-configured to render on both client and server. |
6 | 4 |
|
7 | 5 | [](https://badge.fury.io/js/reactful) |
8 | 6 |
|
9 | 7 | This CLI requires Node >= 8.x. |
10 | 8 |
|
11 | | -### Create New React App |
| 9 | +### Creating New App |
12 | 10 |
|
13 | | - npx reactful my-awesome-react-app |
| 11 | +```sh |
| 12 | +npx reactful my-awesome-react-app |
| 13 | +``` |
14 | 14 |
|
15 | | -Once created, you'll see instructions on how to start it: |
| 15 | +Once created, you'll see instructions on how to use it: |
16 | 16 |
|
17 | | - cd my-awesome-react-app |
| 17 | +```sh |
| 18 | +cd my-awesome-react-app |
18 | 19 |
|
19 | | - ### To start the app (for development): |
20 | | - npm start |
| 20 | +# To start the app for development (watchers for node/webpack) |
| 21 | +npm start |
21 | 22 |
|
22 | | - # The start command starts a watcher process |
23 | | - # which will restart node/webpack on save |
| 23 | +# To open the app in browser (default is localhost:4242) |
| 24 | +npx reactful open |
24 | 25 |
|
25 | | - ### Open the app in browser: |
26 | | - npx reactful open |
| 26 | +# To run all tests |
| 27 | +npm test |
27 | 28 |
|
28 | | - # The app will be running on localhost:4242 by default |
| 29 | +# To build for production |
| 30 | +npm run build-all |
29 | 31 |
|
30 | | - ### To run tests: |
31 | | - npm test |
| 32 | +# To start the app for production |
| 33 | +npm run prod-start |
| 34 | +``` |
32 | 35 |
|
33 | | - ### To build for production: |
34 | | - npm run build-all |
| 36 | +The generated app is completely independent from the reactful package. At this point you can part ways with the package and do your own thing. |
35 | 37 |
|
36 | | - ### To start the app for production: |
37 | | - npm run prod-start |
| 38 | +If you keep the folder structure initialized by the package, you can use a few handy commands. For example: |
38 | 39 |
|
39 | | -The generated app is completely independent from the reactful package. At this |
40 | | -point you can part ways with the reactful package and do your own thing, but if |
41 | | -you follow the patterns initialized by the package, you can use a few handy |
42 | | -commands from the global react command. |
43 | | - |
44 | | -### Update Existing React App |
45 | | - |
46 | | -While in a React application that's created with this tool, you can always |
47 | | -revert things back the default configurations with the init command. You can |
48 | | -also use this command in an empty directory. |
| 40 | +- Create a New (Function) Component: `npx reactful c ComponentName` |
| 41 | +- Create a New Class Component: `npx reactful cc ComponentName` |
| 42 | +- Create a New Pure Component: `npx reactful pc ComponentName` |
49 | 43 |
|
50 | | - cd my-awesome-react-app |
51 | | - npx reactful init |
| 44 | +All of these commands will also create a jest snapshot test for the generated component. |
52 | 45 |
|
53 | | -If that directory already has files, reactful will ask you if you want to |
54 | | -override them. |
| 46 | +### Updating Existing React App |
55 | 47 |
|
56 | | -### Creating Components |
| 48 | +While in a React application that's created with this tool, you can always revert things back the default configurations with the init command. You can also use this command in an empty directory. |
57 | 49 |
|
58 | | -- Create a New Component: `npx reactful c ComponentName` |
59 | | -- Create a New Class Component: `npx reactful cc ComponentName` |
60 | | -- Create a New Pure Component: `npx reactful pc ComponentName` |
| 50 | +```sh |
| 51 | +cd my-awesome-react-app |
| 52 | +npx reactful init |
| 53 | +``` |
61 | 54 |
|
62 | | -All of these commands will also create a jest snapshot test for the generated |
63 | | -component. |
| 55 | +If that directory already has files, reactful will ask you if you want to override them. |
64 | 56 |
|
65 | 57 | ### License |
66 | 58 |
|
|
0 commit comments