forked from mac-s-g/react-json-view
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,116 additions
and
581 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ MAINTAINER mac <[email protected]> | |
# install the node modules at container build time | ||
RUN mkdir -p /react | ||
ADD package.json /react/package.json | ||
RUN cd /react && npm install --silent | ||
RUN cd /react && npm install --save-dev --silent | ||
|
||
# Now add our project code | ||
ADD . /react | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,40 +108,32 @@ The following object will be passed to your method: | |
Returning `false` from a callback method will prevent the src from being affected. | ||
|
||
### Contributing to the source code | ||
#### Linux and Docker (Recommended) | ||
Use Docker to run the source code in a local development environment: | ||
1. Clone this repo | ||
2. Build the docker image | ||
* `cd react-json-view` | ||
* `./docker/build-container.sh` | ||
* *note:* you may need to use `sudo` to run docker commands | ||
3. Run the docker container on port 2000. This will run the webpack-dev-server with hot-reloading enabled. | ||
* `./docker/dev-server.sh` | ||
* *note:* you may need to use `sudo` to run the server file | ||
4. Open port 2000 in your browser | ||
* navigate to localhost:2000 | ||
#### Run the Dev Server | ||
|
||
Your source code will be mounted inside the docker container. The container is built on the latest `Node:slim` image. | ||
```bash | ||
# clone this repository | ||
git clone [email protected]:mac-s-g/react-json-view.git && cd react-json-view | ||
# install dependencies | ||
npm install --save-dev | ||
# run the dev server with hot reloading | ||
npm run dev | ||
``` | ||
Webpack Dev Server should automatically open up http://localhost:2000 in your web browser. If it does not, open a browser and navigate to port 2000. The hot reloader will automatically reload when files are modified in the `/src/` directory. | ||
|
||
Webpack-dev-server is running in the container and hot-reloading when changes are made locally. | ||
#### Run the Production Build | ||
|
||
All node modules are installed within the container, so make sure to rebuild your container if you make changes to package.json (see step 2, above). | ||
```bash | ||
# run the build (note: you may need to use `sudo` priveledges to run the build successfully) | ||
npm run build | ||
``` | ||
Please add tests for your code before posting a pull request. You can run the test suite in with hot-reloading with `npm run test:watch`. | ||
|
||
For more information about contributing with Docker, see the [README in ./docker](https://github.com/mac-s-g/react-json-view/blob/master/docker/README.md). | ||
#### Docker Tools | ||
|
||
#### Standard Workflow | ||
Development workflow is setup for linux users with Docker installed. You can contribute with other configurations but I have not tested them. | ||
I recommend using docker for development because it enforces environmental consistency. | ||
|
||
For information about contributing with Docker, see the [README in ./docker](https://github.com/mac-s-g/react-json-view/blob/master/docker/README.md#contributing-to-this-project). | ||
|
||
1. Clone this repo | ||
2. Install npm dependencies | ||
``` | ||
cd react-json-view | ||
npm install --save-dev | ||
``` | ||
3. Run webpack to start webpack-dev-server with hot-reloading enabled | ||
* `npm run dev:hot` | ||
4. Open port 2000 in your browser | ||
* navigate to localhost:2000 | ||
|
||
### Inspiration | ||
I drew a ton of design ideas from [react-json-tree](https://github.com/alexkuz/react-json-tree). Thanks to the RJT contributors for putting together an awesome component! | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,6 @@ export NODE_ENV=${NODE_ENV:-production} | |
|
||
echo Building RJV Demo... | ||
|
||
npm install --silent \ | ||
[email protected] | ||
|
||
# remove dist files if they exist, | ||
# otherwise create the dist directory | ||
if [ -d /react/demo/dist/main.js ]; then | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.