All this is no longer necessary. The frontend has been integrated with the rest of the PIH EMR distribution. The configs live in the site config repositories.
This repository is the basis for the the PIH Single-SPA frontend.
It contains two packages: frontend-package and pih-esm-root-config.
It manages this multi-package setup using Lerna.
This package uses Packmap to build the PIH Single-SPA frontend as a single deployable artifact.
The package.json
is a manifest for building it. First you use npm install
to download all the pieces. Then, npm run build
uses
Packmap to bundle it all together.
The result is a directory that can be used as the frontend
subdirectory
of your OpenMRS server's application data directory.
This is the Single-SPA Root Config for PIH EMR. It is a customized version of the OpenMRS Root Config, on which it depends.
npm run bootstrap
cd packages/frontend-package
npm run build
rm -rf ~/openmrs/<my-server>/frontend # or move it to a backup
ln -s $(realpath openmrs/frontend) ~/openmrs/<my-server>/frontend
- Make sure the SPA OpenMRS Module is part of your distribution.
- Clone this repo and follow the "Building the SPA package" instructions above (you will need npm)
- Start your server and try navigating to
/openmrs/spa/login
- Follow the instructions to set up local SPA development
Once you've got some changes of some ESM into master, you will probably want to create a release with those changes.
- Version and release that module
cd packages/frontend-package
npm install my-module@latest
- Verify in your browser that nothing broke (see below)
- Commit your changes
cd ../..
to go back to the root directory of this repository- Do
lerna publish
to version and publish the packages. Your changes will be picked up by the Bamboo CI job. The release artifact will be in spa-repo/pih-spa-frontend/unstable.
You can examine the app contained in a package locally like this:
- Run
npm package
to build the zip file - Unzip the package
- Copy its
frontend/
directory into your server'sconfiguration/
directory - Open your browser and check it out
If you want to develop against a local server which has the latest commit of all
modules, as one would expect from a CI server, cd
to packages/frontend-package
and run ./dev_install.sh
. You will
need to re-run that scipt to download new updates. package.json
will continue
to point to released versions.