Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.
/ spa-frontend Public archive

Deprecated - PIH Single-SPA frontend packager and SPA root config

Notifications You must be signed in to change notification settings

PIH/spa-frontend

Repository files navigation

DEPRECATED - PIH EMR SPA Frontend

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.

Old docs

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.

packages/frontend-package

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.

packages/pih-esm-root-config

This is the Single-SPA Root Config for PIH EMR. It is a customized version of the OpenMRS Root Config, on which it depends.

Building the SPA package

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

Setting up SPA in PIH EMR

  1. Make sure the SPA OpenMRS Module is part of your distribution.
  2. Clone this repo and follow the "Building the SPA package" instructions above (you will need npm)
  3. Start your server and try navigating to /openmrs/spa/login
  4. Follow the instructions to set up local SPA development

Releasing

Once you've got some changes of some ESM into master, you will probably want to create a release with those changes.

  1. Version and release that module
  2. cd packages/frontend-package
  3. npm install my-module@latest
  4. Verify in your browser that nothing broke (see below)
  5. Commit your changes
  6. cd ../.. to go back to the root directory of this repository
  7. 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.

Checking the SPA package locally

You can examine the app contained in a package locally like this:

  1. Run npm package to build the zip file
  2. Unzip the package
  3. Copy its frontend/ directory into your server's configuration/ directory
  4. Open your browser and check it out

Running all modules from master

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.

About

Deprecated - PIH Single-SPA frontend packager and SPA root config

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •