Merge branch 'deploying-static-site-2' into react-upstream

This commit is contained in:
dannyrb 2019-04-30 09:59:16 -04:00
commit 140c0b48e7
4 changed files with 51 additions and 51 deletions

View File

@ -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)

View File

@ -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]()

View File

@ -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
...
<!-- prettier-ignore-start -->
[circleci]: https://circleci.com/gh/OHIF/Viewers
[circleci-config]: https://github.com/OHIF/Viewers/blob/react/.circleci/config.yml

11
src/utils/index.test.js Normal file
View File

@ -0,0 +1,11 @@
import * as utils from './index.js'
describe('utils', () => {
it('has the expected exports', () => {
const utilExports = Object.keys(utils).sort()
expect(utilExports).toEqual(
['getUserManagerForOpenIdConnectClient', 'initWebWorkers'].sort()
)
})
})