Skip to content

bugfix: add Props folder after running npm i #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,33 @@

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


### Installation


1. Clone the repo

```sh
git clone https://github.com/react-native-elements/playground.git
cd playground
```

2. Install NPM packages

```sh
npm i
```

3. Prepare (File path is UNIX based, might not work with Windows. PR Appreciated)

```sh
npm run prepare
```

4. Run the development server

```sh
npm start
```


## Releated Projects

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

## Documentation

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

## Contributing




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



### First Contributors

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


### Slack Community

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


70 changes: 45 additions & 25 deletions injectLatestProps.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
const { exec } = require("child_process");
exec(
"git clone https://github.com/react-native-elements/react-native-elements --depth=1",
(err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
return;
}
const { execSync } = require("child_process");
const findRemoveSync = require("find-remove");
const cpDir = require("copy-dir");

/*
* 1. find and delete any directory named react-native-elements
* 2. find and delete any directory named Props
* 3. clone the react-native-elements(https://github.com/react-native-elements/react-native-elements) repo
* 4. copy Props folder from cloned repo into our project
*/

try {
// Point 1. depth=1 required (to avoid deleting node_modules/react-native-elements)
let result = findRemoveSync(".", {
maxLevel: 1,
dir: "react-native-elements",
});
console.log("✔️ Removed ?: ", result);

// Point 2
result = findRemoveSync("./src/content", { dir: "Props" });
console.log("✔️ Removed ?: ", result);

// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
}
);
exec(
"cp -r ./react-native-elements/website/docs/main/props ./src/content/Props"
),
(err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
return;
// Point 3
execSync(
"git clone https://github.com/react-native-elements/react-native-elements --depth=1",
(err, stdout, stderr) => {
if (err) {
// node couldn't execute the command
return;
}
// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
}
);
console.log("✔️ Cloned react-native-elements");

// the *entire* stdout and stderr (buffered)
console.log(`stdout: ${stdout}`);
console.log(`stderr: ${stderr}`);
}
);
// Point 4
cpDir.sync(
"./react-native-elements/website/docs/main",
"./src/content/Props"
);
console.log("✔️ Copied Props to src/content/Props");
} catch (err) {
console.error(err);
return;
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/styles": "^4.10.0",
"@react-native-community/toolbar-android": "^0.1.0-rc.2",
"copy-dir": "^1.3.0",
"find-remove": "^3.0.0",
"history": "^5.0.0",
"mdx.macro": "^0.2.9",
"modal-react-native-web": "^0.2.0",
Expand Down