This is a mono-repo
It is set up using yarn workspaces
, meaning any command you would normally run inside a package can
be run from the root directory using yarn workspace @tupaia/package-name command
, e.g.
yarn workspace @tupaia/meditrak-server start-dev
The easiest way to open the packages in vscode is to double click 'tupaia-packages.code-workspace'. This opens all packages as roots in the workspace, and means linting etc. will work correctly.
See also https://docs.beyondessential.com.au/books/software-development/page/internal-dependencies
Most packages will require a .env file, which can usually be found in lastpass. Use the LOCAL entry if one exists for the package, otherwise use the DEV entry.
We use yarn workspaces to manage our packages, which allows us to run yarn
once at the project
root, and it will install dependencies everywhere.
We use codeship for the admin-panel, meditrak-server, web-config-server, and web-frontend packages.
For codeship to use our environment variables, we store them encrypted and committed to the repo as ci-env-vars.encrypted inside each package. In order to update an environment variable:
- modify your local .env file
- download the codeship encryption key (either from LastPass or codeship itself) and save as codeship.aes in the root directory
- run
yarn update-codeship-env-vars
Note that environment variables are also stored in AWS parameter store for new dev and feature deployments to pull from, so if you've updated the environment variables here, you probably also need to persist them across there
- ssh into the aws instance (cannot be run locally at this stage)
- update the .env file (if it hasn't been updated automatically by the CI/CD process)
- run
ENVIRONMENT=dev yarn update-paramater-store-env-vars
(setting environment to either dev or production)
Most of the packages support the following scripts for testing:
yarn test # runs the tests
yarn test-coverage # runs the tests and displays code coverage
See also the docs page on Test setup (mocha)