Skip to content

Commit f0fca53

Browse files
ready for upload
1 parent 772fa5f commit f0fca53

File tree

4 files changed

+8444
-43
lines changed

4 files changed

+8444
-43
lines changed

ReadMe.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,91 @@
1-
# simple-init-react-preact
1+
# simple-init-react-angular-preact-vue
22

33
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.
44

55
## instructions
66

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,
88

99
```
1010
git clone git@github.com:KevinEverywhere/simple-init-react-angular-preact-vue.git
1111
cd simple-init-react-angular-preact-vue
1212
npm install
1313
```
1414

15-
### react
15+
### Run All Four
1616

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.
1818

19-
If you have not previously installed yarn:
19+
Ensure that you have previously installed yarn and then run this line of code.
2020
```
21-
npm run startReact
21+
yarn run startAll
2222
```
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.
2324

24-
If you have previously installed yarn:
2525
```
26-
yarn run startReact
26+
npm install -g yarn
2727
```
2828

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+
3033
```
31-
node_modules/.bin/yarn run startReact
34+
yarn run startReact
3235
```
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.
3436

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
3838

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.
3941

40-
If you have not previously installed yarn:
4142
```
42-
npm run startPreact
43+
yarn run startAngular
4344
```
4445

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+
4651
```
4752
yarn run startPreact
4853
```
4954

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+
5159
```
52-
node_modules/.bin/yarn run startPreact
60+
yarn run startVue
5361
```
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-
5662

5763
## summary
5864

5965
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.
6066

6167
## reference
6268

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]
6474

6575
[preact][preact]
6676

67-
[What's new in Create React App][whatsnew]
77+
[vue][vue]
6878

6979
-------------
7080

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+
7187
[preact]: https://preactjs.com/
7288
[preact-cli]: https://github.com/developit/preact-cli
7389

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

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
"scripts": {
88
"firstRunPreact": "node_modules/.bin/preact create my-preact-app",
99
"testPreact": "if [ ! -f my-preact-app/package.json ]; then yarn run firstRunPreact; fi",
10-
"prestartPreact": "npm install && yarn run testPreact",
11-
"startPreact": "cd my-preact-app && yarn start",
10+
"prestartPreact": "yarn install && yarn run testPreact",
11+
"startPreact": "cd my-preact-app && node_modules/.bin/preact watch -p 6789",
1212
"namePkgReturn": "mv package.json replacement.package.json && mv temp.package.json package.json",
1313
"namePkgTemp": "mv package.json temp.package.json && mv replacement.package.json package.json",
14-
"firstRunAngular": "npm run namePkgTemp && ng new my-angular-app && npm run namePkgReturn",
15-
"testAngular": "if [ ! -f my-angular-app/package.json ]; then npm run firstRunAngular; fi",
16-
"prestartAngular": "npm install && npm run testAngular",
14+
"firstRunAngular": "yarn run namePkgTemp && ng new my-angular-app && yarn run namePkgReturn",
15+
"testAngular": "if [ ! -f my-angular-app/package.json ]; then yarn run firstRunAngular; fi",
16+
"prestartAngular": "yarn install && yarn run testAngular",
1717
"startAngular": "cd my-angular-app && node_modules/.bin/ng serve",
1818
"firstRunVue": "node_modules/.bin/vue init webpack my-vue-app",
1919
"testVue": "if [ ! -f my-vue-app/package.json ]; then yarn run firstRunVue; fi",
20-
"prestartVue": "npm install && yarn run testVue",
21-
"startVue": "cd my-vue-app && npm install && npm run dev",
20+
"prestartVue": "yarn install && yarn run testVue",
21+
"startVue": "cd my-vue-app && yarn install && yarn run dev",
2222
"firstRunReact": "node_modules/.bin/create-react-app my-react-app",
2323
"testReact": "if [ ! -f my-react-app/package.json ]; then yarn run firstRunReact; fi",
24-
"prestartReact": "npm install && yarn run testReact",
24+
"prestartReact": "yarn install && yarn run testReact",
2525
"startReact": "cd my-react-app && yarn start",
2626
"startAll": "parallelshell 'yarn run startReact' 'yarn run startPreact' 'yarn run startVue' 'yarn run startAngular'"
2727
},

replacement.package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@
77
"scripts": {
88
"firstRunPreact": "node_modules/.bin/preact create my-preact-app",
99
"testPreact": "if [ ! -f my-preact-app/package.json ]; then yarn run firstRunPreact; fi",
10-
"prestartPreact": "yarn run testPreact",
11-
"startPreact": "cd my-preact-app && yarn start",
10+
"prestartPreact": "yarn install && yarn run testPreact",
11+
"startPreact": "cd my-preact-app && node_modules/.bin/preact watch -p 6789",
1212
"namePkgReturn": "mv package.json replacement.package.json && mv temp.package.json package.json",
1313
"namePkgTemp": "mv package.json temp.package.json && mv replacement.package.json package.json",
14-
"firstRunAngular": "npm run namePkgTemp && ng new my-angular-app && npm run namePkgReturn",
15-
"testAngular": "if [ ! -f my-angular-app/package.json ]; then npm run firstRunAngular; fi",
16-
"prestartAngular": "npm run testAngular",
14+
"firstRunAngular": "yarn run namePkgTemp && ng new my-angular-app && yarn run namePkgReturn",
15+
"testAngular": "if [ ! -f my-angular-app/package.json ]; then yarn run firstRunAngular; fi",
16+
"prestartAngular": "yarn install && yarn run testAngular",
1717
"startAngular": "cd my-angular-app && node_modules/.bin/ng serve",
1818
"firstRunVue": "node_modules/.bin/vue init webpack my-vue-app",
1919
"testVue": "if [ ! -f my-vue-app/package.json ]; then yarn run firstRunVue; fi",
20-
"prestartVue": "yarn run testVue",
21-
"startVue": "cd my-vue-app && npm install && npm run dev",
20+
"prestartVue": "yarn install && yarn run testVue",
21+
"startVue": "cd my-vue-app && yarn install && yarn run dev",
2222
"firstRunReact": "node_modules/.bin/create-react-app my-react-app",
2323
"testReact": "if [ ! -f my-react-app/package.json ]; then yarn run firstRunReact; fi",
24-
"prestartReact": "yarn run testReact",
24+
"prestartReact": "yarn install && yarn run testReact",
2525
"startReact": "cd my-react-app && yarn start",
26-
"startAll": "npm install && parallelshell 'yarn run startReact' 'yarn run startPreact' 'yarn run startVue' 'yarn run startAngular'"
26+
"startAll": "parallelshell 'yarn run startReact' 'yarn run startPreact' 'yarn run startVue' 'yarn run startAngular'"
2727
},
2828
"peerDependencies": {
2929
"@angular/cli": "^1.4.3",

0 commit comments

Comments
 (0)