From 8e4b0ac737daf2ff607cbd284bdd396015fc6f82 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 30 Apr 2019 09:52:51 -0400 Subject: [PATCH] Merge build and restore sections --- README-react.md | 32 ----------- docs/latest/SUMMARY.md | 3 +- .../recipes/build-for-production.md | 56 +++++++++++++------ 3 files changed, 40 insertions(+), 51 deletions(-) delete mode 100644 README-react.md diff --git a/README-react.md b/README-react.md deleted file mode 100644 index 9f4a1a5b8..000000000 --- a/README-react.md +++ /dev/null @@ -1,32 +0,0 @@ -# OHIF Viewer (React Version) - -Disclaimer: Work in Progress - -## To run locally - -1. `yarn install` -1. `yarn start` -1. `Go to http://localhost:5000` - -To user another DICOMWeb endpoint, adapt index.js - -## To include in your projects - -Please refer to the example in the example directory. To set the DICOMWeb -endpoint and do other customization, adapt index.html. - -### Build - -1. `yarn install` -1. `yarn build` - -### Run the example - -1. `cd example` -1. `yarn install` -1. `yarn start` -1. `Go to http://localhost:5000` - -## License - -MIT © [OHIF](https://github.com/OHIF) diff --git a/docs/latest/SUMMARY.md b/docs/latest/SUMMARY.md index 54581e9e8..89503f61e 100644 --- a/docs/latest/SUMMARY.md +++ b/docs/latest/SUMMARY.md @@ -36,7 +36,8 @@ - [Stand-alone](deployment/index.md#stand-alone-viewer) - [Data]() - Recipes - - [Embedding the Viewer](deployment/recipes/embedded-viewer.md)) + - [Embedding the Viewer](deployment/recipes/embedded-viewer.md) + - [Build for Production](deployment/recipes/build-for-production.md) - [PWA: Static]() - [PWA: Docker]() - [PWA: Nginx + Orthanc]() diff --git a/docs/latest/deployment/recipes/build-for-production.md b/docs/latest/deployment/recipes/build-for-production.md index 74ee3b552..3a0cea540 100644 --- a/docs/latest/deployment/recipes/build-for-production.md +++ b/docs/latest/deployment/recipes/build-for-production.md @@ -1,6 +1,8 @@ # Build for Production -Note about setting up for contributing, then skip X +> If you've already followed the +> ["Getting Started" Guide](/essentials/getting-started.md), you can skip ahead +> to [Configuration](#configuration) ## Overview? @@ -10,11 +12,11 @@ Note about setting up for contributing, then skip X - [Yarn](https://yarnpkg.com/lang/en/docs/install/) - [Git](https://www.atlassian.com/git/tutorials/install-git) -### Get a Copy of the source +### Getting the Code _With Git:_ -```shell +```bash # Clone the remote repository to your local machine git clone https://github.com/OHIF/Viewers.git @@ -29,11 +31,35 @@ _From .zip:_ [OHIF/Viewers: react.zip](https://github.com/OHIF/Viewers/archive/react.zip) -### Restore Dependencies? +### Restore Dependencies & Build -... +Open PowerShell, Terminal, or a Command Prompt, and navigate to the directory +containing the source files. Next run these commands: -### Configure? +```js +// Restore dependencies +yarn install + +// Build source code for production +yarn run build:web +``` + +If everything worked as expected, you should have a new `build/` directory in +the project's folder. It should roughly resemble the following: + +```bash +build +├── config/ +├── static/ +├── index.html +├── manifest.json +├── service-worker.js +└── ... +``` + +These files can be hosted using + +### Configuration ... @@ -41,18 +67,6 @@ _From .zip:_ - `REACT_APP_*` - config file(s) -### Build - -From your projects - -```js -yarn run build:web -``` - -```js -file tree of project, highlighting contents in `/buld` -``` - ## Next Steps ### Deploying our Production Build @@ -71,6 +85,12 @@ web application. For a starting point, check out this repository's own use of: [generateStaticSite.sh][generatestaticsite.sh] - [Semantic-Release][semantic-release]: [.releaserc][releaserc] +## Troubleshooting + +> Issues and resolutions for common GitHub issues will be summarized here + +... + [circleci]: https://circleci.com/gh/OHIF/Viewers [circleci-config]: https://github.com/OHIF/Viewers/blob/react/.circleci/config.yml