|
1 |
| -# simple-init-react-preact |
| 1 | +# simple-init-react-angular-preact-vue |
2 | 2 |
|
3 | 3 | This project is an example of current framework cli-build processes work and appear side by side. Once the initial files are created, you can experiment in each of the apps to see how interchangeable they actually are.
|
4 | 4 |
|
5 | 5 | ## instructions
|
6 | 6 |
|
7 |
| -Each framework has its own installation and launch scripts. To begin, download this repo and run yarn or npm install. Once the repo is installed, yarn is used in the script files. |
| 7 | +Each framework has its own installation and launch scripts. It is recommended that you use yarn for package management and running scripts. If the build process is not successful, |
8 | 8 |
|
9 | 9 | ```
|
10 | 10 | git clone git@github.com:KevinEverywhere/simple-init-react-angular-preact-vue.git
|
11 | 11 | cd simple-init-react-angular-preact-vue
|
12 | 12 | npm install
|
13 | 13 | ```
|
14 | 14 |
|
15 |
| -### react |
| 15 | +### Run All Four |
16 | 16 |
|
17 |
| -Running the startReact script will first test to see if it has ever been run before (testReact). After the directory has been recognized or created, the startReact script changes to the my-react-app directory and runs yarn start. When you run yarn start, it will install or check for updates in the repo's dependencies. From the root directory (simple-init-react-angular-preact-vue), run the following script and the application will launch in the browser. |
| 17 | +Running the startAll script will execute startReact, startPreact, startAngular, and startVue. Please look to the individual script to see cli specifics. |
18 | 18 |
|
19 |
| -If you have not previously installed yarn: |
| 19 | +Ensure that you have previously installed yarn and then run this line of code. |
20 | 20 | ```
|
21 |
| -npm run startReact |
| 21 | +yarn run startAll |
22 | 22 | ```
|
| 23 | +The most typical errors when they occur come from already having ports 3000, 8080, 6789 and 4200 already being used; and yarn not being installed. If you do not have yarn installed, run the following line of code. |
23 | 24 |
|
24 |
| -If you have previously installed yarn: |
25 | 25 | ```
|
26 |
| -yarn run startReact |
| 26 | +npm install -g yarn |
27 | 27 | ```
|
28 | 28 |
|
29 |
| -To use the yarn package bundled with this repo: |
| 29 | +### react |
| 30 | + |
| 31 | +Running the startReact script will first test to see if it has ever been run before (testReact). After the directory has been recognized or created, the startReact script runs yarn start in the my-react-app directory. When you run yarn start, it will install or check for updates in the repo's dependencies. From the root directory (simple-init-react-angular-preact-vue), run the following script and the application will launch in the browser at http://localhost:3000. |
| 32 | + |
30 | 33 | ```
|
31 |
| -node_modules/.bin/yarn run startReact |
| 34 | +yarn run startReact |
32 | 35 | ```
|
33 |
| -You can use npm or yarn in for installation and running of package.json dependency and script content. Yarn is recommended for performance and dependency management reasons. |
34 | 36 |
|
35 |
| -### preact |
36 |
| - |
37 |
| -Running the startPreact script will first test to see if it has ever been run before (testPreact). After the directory has been recognized or created, the startPreact script changes to the my-preact-app directory and runs yarn start. When you run yarn start, it will install or check for updates in the repo's dependencies. From the root directory (simple-init-react-preact), run the following script and once it creates the application, you can find it at http://localhost:8080. |
| 37 | +### angular |
38 | 38 |
|
| 39 | +Running the startAngular script will first test to see if it has ever been run before (testAngular). After the directory has been recognized or created, the startAngular runs ng serve |
| 40 | +in the my-angular-app directory. When you run ng serve, it will launch the app in port 4200. From the root directory (simple-init-react-preact), run the following script and it will launch at http://localhost:4200. |
39 | 41 |
|
40 |
| -If you have not previously installed yarn: |
41 | 42 | ```
|
42 |
| -npm run startPreact |
| 43 | +yarn run startAngular |
43 | 44 | ```
|
44 | 45 |
|
45 |
| -If you have previously installed yarn: |
| 46 | +### preact |
| 47 | + |
| 48 | +Running the startPreact script will first test to see if it has ever been run before (testPreact). After the directory has been recognized or created, the startPreact runs preact watch -p 6789 |
| 49 | +in the my-preact-app directory. When you run yarn start, it will install or check for updates in the repo's dependencies. From the root directory (simple-init-react-preact), run the following script and once it creates the application, you can find it at http://localhost:6789. |
| 50 | + |
46 | 51 | ```
|
47 | 52 | yarn run startPreact
|
48 | 53 | ```
|
49 | 54 |
|
50 |
| -To use the yarn package bundled with this repo: |
| 55 | +### vue |
| 56 | + |
| 57 | +Unlike the other CLI tools, the vue-cli will require some interactivity during the creation process. You can easily just hit return and accept the defaults at the command line which will create a new vue app titled my-vue-app. Once the startVue script calls testVue to see if it has ever been run and creates the app and directory if it has not, it then runs yarn start from the my-vue-app directory. When you run yarn start, it installs and checks for updates in the repo's dependencies. From the root directory (simple-init-react-angular-preact-vue), run the following script and the application will launch in the browser at http://localhost:8080. |
| 58 | + |
51 | 59 | ```
|
52 |
| -node_modules/.bin/yarn run startPreact |
| 60 | +yarn run startVue |
53 | 61 | ```
|
54 |
| -You can use npm or yarn in for installation and running of package.json dependency and script content. Yarn is recommended for performance and dependency management reasons. |
55 |
| - |
56 | 62 |
|
57 | 63 | ## summary
|
58 | 64 |
|
59 | 65 | This truly is meant as nothing more than a way to quickly see the state of react and preact development the first day of autumn, 2017. This should save some time for those wanting to have a quick view of how the two look under the hood.
|
60 | 66 |
|
61 | 67 | ## reference
|
62 | 68 |
|
63 |
| -This repo uses the initialization scripts described in the [preact-cli][preact-cli] for preact and [create-react-app][create-react-app] for react repos to create a base application. For more information, please use the links below to discover best practices and state of the moment examples and documentation. |
| 69 | +This repo uses the initialization scripts described in the [preact-cli][preact-cli], for preact, [create-react-app][create-react-app] for react, [angular-cli][angular-cli], for angular, and [vue-cli][vue-cli] for vue to create a base applications. For more information, please use the links below to discover best practices and state of the moment examples and documentation. |
| 70 | + |
| 71 | +[What's new in Create React App][whatsnew] |
| 72 | + |
| 73 | +[angular][angular] |
64 | 74 |
|
65 | 75 | [preact][preact]
|
66 | 76 |
|
67 |
| -[What's new in Create React App][whatsnew] |
| 77 | +[vue][vue] |
68 | 78 |
|
69 | 79 | -------------
|
70 | 80 |
|
| 81 | +[whatsnew]: https://facebook.github.io/react/blog/2017/05/18/whats-new-in-create-react-app.html |
| 82 | +[create-react-app]: https://github.com/facebookincubator/create-react-app |
| 83 | + |
| 84 | +[angular][https://github.com/angular/angular] |
| 85 | +[angular-cli]: https://github.com/angular/angular-cli |
| 86 | + |
71 | 87 | [preact]: https://preactjs.com/
|
72 | 88 | [preact-cli]: https://github.com/developit/preact-cli
|
73 | 89 |
|
74 |
| -[whatsnew]: https://facebook.github.io/react/blog/2017/05/18/whats-new-in-create-react-app.html |
75 |
| -[create-react-app]: https://github.com/facebookincubator/create-react-app |
| 90 | +[vue]: https://vuejs.org/v2/guide/ |
| 91 | +[vue-cli]: https://github.com/vuejs/vue-cli |
0 commit comments