Skip to content

Commit a18c60d

Browse files
committed
bugfix: add Props folder after running npm i
1 parent 95b420c commit a18c60d

File tree

3 files changed

+42
-18
lines changed

3 files changed

+42
-18
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,33 @@
3232

3333
![React Native Elements UI Toolkit](https://github.com/react-native-elements/playground/blob/master/public/thumbnail.png)
3434

35-
3635
### Installation
3736

38-
3937
1. Clone the repo
38+
4039
```sh
4140
git clone https://github.com/react-native-elements/playground.git
4241
cd playground
4342
```
43+
4444
2. Install NPM packages
45+
4546
```sh
4647
npm i
4748
```
49+
4850
3. Prepare (File path is UNIX based, might not work with Windows. PR Appreciated)
51+
4952
```sh
5053
npm run prepare
5154
```
55+
5256
4. Run the development server
57+
5358
```sh
5459
npm start
5560
```
5661

57-
5862
## Releated Projects
5963

6064
<a href="https://github.com/react-native-elements/react-native-elements">
@@ -69,19 +73,14 @@ npm start
6973

7074
## Documentation
7175

72-
[View the full docs of React Native elements here](https://reactnativeelements.com/docs/overview)
76+
[View the full docs of React Native elements here](https://reactnativeelements.com/docs/overview)
7377

7478
## Contributing
7579

76-
77-
78-
7980
Interested in contributing to this repo? Check out our
8081
[Contributing Guide](https://reactnativeelements.com/docs/contributing)
8182
and submit a PR for a new feature/bug fix.
8283

83-
84-
8584
### First Contributors
8685

8786
We encourage everyone to contribute & submit PR's especially first-time
@@ -95,7 +94,6 @@ an
9594
or a
9695
[pull request](https://github.com/react-native-elements/playground/pulls).
9796

98-
9997
### Slack Community
10098

10199
In case you have any other question or would like to come say **Hi!** to the RNE
@@ -161,5 +159,3 @@ Do you use React Native Elements in production? If so, consider supporting this
161159
[![React Native Elements Backer](https://opencollective.com/react-native-elements/sponsor/17/avatar)](https://opencollective.com/react-native-elements/sponsor/17/website)
162160
[![React Native Elements Backer](https://opencollective.com/react-native-elements/sponsor/18/avatar)](https://opencollective.com/react-native-elements/sponsor/18/website)
163161
[![React Native Elements Backer](https://opencollective.com/react-native-elements/sponsor/19/avatar)](https://opencollective.com/react-native-elements/sponsor/19/website)
164-
165-

injectLatestProps.js

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
const { exec } = require("child_process");
2-
exec(
3-
"git clone https://github.com/react-native-elements/react-native-elements --depth=1",
1+
const { execSync } = require("child_process");
2+
const cpDir = require("copy-dir");
3+
4+
// find and will delete any directory named react-native-elements
5+
// at depth 1 only (if not provided will delete react-native-elements from node_modules as well)
6+
execSync(
7+
"find . -maxdepth 1 -type d -name react-native-elements -exec rimraf {} +",
48
(err, stdout, stderr) => {
59
if (err) {
610
// node couldn't execute the command
@@ -12,7 +16,10 @@ exec(
1216
console.log(`stderr: ${stderr}`);
1317
}
1418
);
15-
exec("cp -r ./react-native-elements/website/docs/props ./src/content/Props"),
19+
20+
// find and will delete any directory named Props
21+
execSync(
22+
"find . -type d -name Props -exec rimraf {} +",
1623
(err, stdout, stderr) => {
1724
if (err) {
1825
// node couldn't execute the command
@@ -22,4 +29,22 @@ exec("cp -r ./react-native-elements/website/docs/props ./src/content/Props"),
2229
// the *entire* stdout and stderr (buffered)
2330
console.log(`stdout: ${stdout}`);
2431
console.log(`stderr: ${stderr}`);
25-
};
32+
}
33+
);
34+
35+
// clone the react-native-elements repo
36+
execSync(
37+
"git clone https://github.com/react-native-elements/react-native-elements --depth=1",
38+
(err, stdout, stderr) => {
39+
if (err) {
40+
// node couldn't execute the command
41+
return;
42+
}
43+
// the *entire* stdout and stderr (buffered)
44+
console.log(`stdout: ${stdout}`);
45+
console.log(`stderr: ${stderr}`);
46+
}
47+
);
48+
49+
// copies Props folder from clones repo into our project
50+
cpDir.sync("./react-native-elements/website/docs/props", "./src/content/Props");

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"@material-ui/icons": "^4.9.1",
99
"@material-ui/styles": "^4.10.0",
1010
"@react-native-community/toolbar-android": "^0.1.0-rc.2",
11+
"copy-dir": "^1.3.0",
1112
"history": "^5.0.0",
1213
"mdx.macro": "^0.2.9",
1314
"modal-react-native-web": "^0.2.0",
@@ -22,7 +23,8 @@
2223
"react-native-web-linear-gradient": "^1.1.1",
2324
"react-router-dom": "^5.2.0",
2425
"react-scripts": "3.4.1",
25-
"react-view": "^2.3.2"
26+
"react-view": "^2.3.2",
27+
"rimraf": "^3.0.2"
2628
},
2729
"scripts": {
2830
"start": "react-app-rewired start",
@@ -51,6 +53,7 @@
5153
},
5254
"devDependencies": {
5355
"@babel/plugin-proposal-class-properties": "^7.10.4",
56+
"@babel/preset-env": "^7.13.12",
5457
"customize-cra": "^1.0.0",
5558
"gh-pages": "^3.1.0",
5659
"patch-package": "^6.2.2",

0 commit comments

Comments
 (0)