Skip to content

Commit e89d5c8

Browse files
committed
adding library install methods
1 parent 5363823 commit e89d5c8

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Inspired by:
2121
- [x] [Redux DevTools Extension](https://github.com/zalmoxisus/redux-devtools-extension)
2222
- [x] [TodoMVC example](http://todomvc.com)
2323
- [x] PWA Support
24+
- [x] Local Project Library (/lib)
2425

2526
## Roadmap
2627

@@ -29,6 +30,34 @@ Inspired by:
2930
- [x] use react-redux hooks
3031
- [ ] Hot Reloading -> Waiting for official support of react-scripts
3132

33+
## Important notice:
34+
35+
This project contains another lib project in its files. This lib project is included via the 'file' operator in the package.json. This leads to problems with react and material ui and updating the package-lock.json
36+
37+
To solve this Problems the install and start commands are altered
38+
39+
### To Install:
40+
41+
```npm run-script installLocal```
42+
43+
What it does:
44+
45+
- removes package-lock.json
46+
- removes **lib** module from node_modules in **main project**
47+
- installs npm modules in **lib**
48+
- builds **lib**
49+
- installs npm modules in **main project**
50+
51+
### To start:
52+
53+
```npm start```
54+
55+
What it does:
56+
57+
- links react in main to react in **lib** node_modules
58+
- removes **@material-ui** package from **lib** projects node_modules
59+
- starts application
60+
3261
## How to use
3362

3463
Download or clone this repo

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"dependencies": {
55
"@material-ui/core": "4.9.0",
66
"@material-ui/icons": "4.5.1",
7-
"create-react-app-lib": "file:lib",
87
"localforage": "1.7.3",
98
"react": "16.12.0",
109
"react-dom": "16.12.0",
@@ -15,14 +14,15 @@
1514
"redux-logger": "3.0.6",
1615
"redux-persist": "6.0.0",
1716
"redux-thunk": "2.3.0",
18-
"typescript": "3.7.5"
17+
"typescript": "3.7.5",
18+
"create-react-app-lib": "file:lib"
1919
},
2020
"scripts": {
21-
"start": "npm link ./lib/node_modules/react; react-scripts start",
22-
"build": "react-scripts build",
21+
"start": "npm link ./lib/node_modules/react; rm -R ./lib/node_modules/@material-ui; react-scripts start",
22+
"build": "rm -R ./lib/node_modules/@material-ui; react-scripts build",
2323
"test": "react-scripts test",
2424
"eject": "react-scripts eject",
25-
"installLocal": "rm ./package-lock.json; npm i"
25+
"installLocal": "rm ./package-lock.json; rm -R ./node_modules/create-react-app-lib; cd ./lib; npm i; npm run-script build; cd ..; npm i"
2626
},
2727
"browserslist": [
2828
">0.2%",
@@ -41,4 +41,4 @@
4141
"@types/webpack-env": "1.15.1",
4242
"@types/react-redux": "7.1.7"
4343
}
44-
}
44+
}

0 commit comments

Comments
 (0)