Contributing to Auspice development
July 2, 2026 · View on GitHub
Thank you for helping us to improve Nextstrain!
To get started, please see the contributing guide for useful information about how to pick an issue, submit your contributions, and so on.
This project strictly adheres to the Contributor Covenant Code of Conduct.
Please see the project boards for currently available issues.
Developer Installation
This is useful for debugging, modifying the source code, or using an unpublished feature branch.
The following steps assume you are using an environment with a suitable nodejs version such as a conda environment. Check the engines section of Auspice's package.json for the currently supported nodejs versions.
git clone https://github.com/nextstrain/auspice.git
cd auspice
# install dependencies and build auspice
npm ci
# make `auspice` available globally
npm install --global .
When you update Auspice (e.g. via source code modifications or git pull) you may need to (i) update dependencies via npm ci and (ii) rebuild the client bundles via auspice build / npm run build.
Contributing code
Please comment on an open issue if you are working on it. For changes unrelated to an open issue, please make an issue outlining what you would like to change/add.
Where possible, please rebase your work onto master rather than merging changes from master into your PR.
From a fork: git pull --rebase upstream master
Typescript
Auspice is in the process of moving to typescript, and currently supports both .js(x) and .ts(x) files.
New code should ideally be written in TS.
This guide is helpful to understand the bigger picture of migrating a JS project to TS.
Typescript is supposed to help us, so there's no problem using any types as we move code from JS to TS, however new code would ideally be typed.
You can check the types via npm type-check or run npm type-check:watch; alternatively your editor should be able to show this.
Our CI (GitHub action) will type-check the project.
The various moving parts involved are:
typescript(tsccommand) is used bynpm run type-checkas well as other plugins/libraries@typescript-eslint/eslint-plugin,@typescript-eslint/parserallow ESLint to parse TypeScript syntax@babel/preset-typescriptis used by babel-loader (via webpack) to parse.ts(x)files
Tests
Auspice has various tests in place, although test coverage is sporadic. When you submit a pull request to the auspice repository, certain tests will need to pass before it can be merged. These tests can be run locally:
Unit tests
Unit tests use Jest and can be run via npm test.
These tests rely on datasets which need to be fetched ahead of time via npm run fetch-test-data.
General advice for writing tests:
-
Run a single
describe(),it(), ortest()within a file, add.only():E.g.,
describe.only(),it.only(), ortest.only() -
You can run a single test file like so:
E.g.,
npx jest test/dates.test.js
Smoke tests
Smoke tests are currently very limited but we may expand these in the future
- Fetch datasets with
npm run get-data. - Install the testing browser with
npx playwright install chromium. - Run
npm run smoke-test.
For integration tests
Auspice used to have integration testing using jest + puppeteer, however this was removed in PR 1672. Ideally this functionality will be brought back, and that PR would be a good place to start. If embarking on this journey, consider using Playwright since it is already used for smoke tests.
Linting & type-checking
Linting via eslint: npm run lint, typechecking via npm type-check
Offline use
Auspice can register a service worker for use without a network connection.
This is opt-in and primarily intended for auspice.us; it is enabled by setting the environment variable AUSPICE_ENABLE_SERVICE_WORKER=true at build time.
It is disabled by default and is always disabled in dev mode (a caching service worker would interfere with hot-reloading).
When enabled, the service worker is registered at the site root with a scope of the whole origin.
What it intercepts:
- The build's static assets –
index.htmland referenced JS/CSS bundles. - Navigation requests to the root path
/.
What it does not intercept:
- Charon API requests
- Map tiles
These are runtime fetch() requests with no caching configured, so they always go to the network and will fail when offline.
Removing a registered service worker
There are two options for removal:
-
Automatic – the easiest option for configurable origins (e.g.
localhost:4000).Instructions: rebuild without
AUSPICE_ENABLE_SERVICE_WORKER, serve the build at the same origin, and open a page. The service worker will be unregistered and Workbox caches removed. The service worker will be fully removed when all pages at the origin have been closed. -
Manual – useful for ephemeral review apps (e.g.
*.herokuapp.com).Instructions: find and remove the service worker and Workbox caches in browser developer tools. For Chromium-based browsers, this is typically under the "Application" tab > "Service workers" and "Cache storage".
Heroku review apps
A Heroku pipeline for this repository is connected to GitHub under the nextstrain-bot user account. The Review Apps feature facilitates manual review of changes by automatically creating a test instance from the PR source branch and adding a link to it on the GitHub PR page. These apps are based on configuration in app.json.
Test on downstream repositories
Additionally, a GitHub Actions workflow has been set up to generate PRs in downstream repositories that reflect the new changes in Auspice. To use it, add the label preview on auspice.us and/or preview on nextstrain.org.
git-lfs
Git Large File Storage was removed in PR 1672.
You may uninstall it via git lfs uninstall if needed.
Contributing to Documentation
The main Nextstrain documentation is available at docs.nextstrain.org. That documentation is built from the docs.nextstrain.org GitHub repo -- see the contributing page for docs.nextstrain.org for more details on how to contribute to that documentation.
The Auspice technical reference guide is available at docs.nextstrain.org/projects/auspice. That documentation is built from the files in this repo in the ./docs folder.
To preview the Auspice documentation locally,
-
Create and activate a Conda environment from
docs/conda.yml. Example:conda env create --file docs/conda.yml conda activate auspice-docs -
Build the docs from a clean slate.
make -C docs clean livehtml -
Open the preview link (http://127.0.0.1:8000) in a browser.
Changes to documentation source files (.md and .rst files under docs/) should automatically be reflected upon page refresh.
Contributing to Internationalization and Localization (i18n/l18n)
If you can assist in efforts to translate the Auspice interface to more languages your assistance would be very much appreciated. The currently available languages are displayed via a drop-down at the bottom of the sidebar.
Adding a new language
- Add the language to the
getlanguageOptionsfunction in this file - If this is a new language, copy the folder (and the JSONs within it)
src/locales/enand name it to match the language code for the new translation -- e.g. for Spanish this would besrc/locales/es - For each key-value in the JSONs, translate the english phrase to the new locale. (Do not modify the parts formatted as
{{...}}or<...>...</...>.)
For example, a spanish translation would change the English:
"sampled between {{from}} and {{to}}": "sampled between {{from}} and {{to}}",
"and comprising": "and comprising",
to
"sampled between {{from}} and {{to}}": "aislados entre {{from}} y {{to}}",
"and comprising": "y compuesto de",
Helper script to check what parts of a translation are out-of-date or missing
Run npm run diff-lang -- X, where X is the language you wish to check, for instance es.
This will display the strings which:
- need to be added to the translation
- are present but should be removed as they are no longer used
- are present but are simply a copy of the English version & need to be translated
Running
npm run diff-langwill check all available languages.
Improving an existing translation
If a translation of a particular string is not yet available, then auspice will fall-back to the english version.
- Find the relevant key in the (EN) JSONs in this directory
- Add the key to the JSON with the same name, but in the directory corresponding to the language you are translating into (see above for an example).
Releases & versioning
Releasing Auspice requires a few manual steps as there are so many downstream targets which are each to be updated with the new version.
- Compare the git history against the previous release (e.g. view master vs release branch on GitHub) and ensure all changes are reflected in
CHANGELOG.md. If new entries are needed, commit these and push them to the remote (GitHub). - Ensure you are on the master branch and up to date with the remote, have
nodeandnpmin your environment, and are logged into the GitHub CLI (gh auth status). - Run the
./releaseNewVersion.shscript. This will prompt you for the version number increase and push changes to both the master and release branches.- Auspice's CI Action will publish the new version to npm.
It takes some time for the new version to appear in the npm registry.
To check if it has been released run
npm view auspice versions --json | tail; you may wish to wait for the email to the slack channel#nextstrain-adminbut it's unclear if there is still a lag after the email arrives before it's available tonpmAPIs. None of the following numbered steps will work until the new version is available on npm. - The release script will automatically create an entry on github.com/nextstrain/auspice/releases containing information from the changelog.
- Ensure the docker-base CI action triggered by nextstrain-bot runs successfully. (This action in nextstrain/docker-base is triggered by Auspice's CI action and installs Auspice from the release branch such that it's not dependant on availability in npm.)
- Auspice's CI Action will publish the new version to npm.
It takes some time for the new version to appear in the npm registry.
To check if it has been released run
- Updates to nextstrain sites which depend on Auspice:
- Nextstrain.org will check daily for a new version of Auspice and automatically merge the resulting PR, which results in the canary site being updated.
- You can trigger this check as soon as the new version is available on npm if you wish.
- To see the updated Auspice on nextstrain.org you'll need to promote the canary server.
- Auspice.us will similarly check daily for a new version however the resulting PR must be merged manually.
- Nextclade uses the same approach as auspice.us and is usually merged by Ivan.
- Nextstrain.org will check daily for a new version of Auspice and automatically merge the resulting PR, which results in the canary site being updated.
- Update the version on Bioconda:
- Click to edit the Bioconda recipe. Or, consider using the Nextstrain fork to create PRs that other team members can contribute to.
- Make the following changes:
-
Update the version number in the first line.
-
Change
source.sha256to thesha256hash of the file atsource.url. You can get the value using the following command:curl -s https://registry.npmjs.com/auspice/latest \ | jq -r ".dist.tarball" \ | xargs curl -s \ | shasum -a 256 \ | cut -f 1 -d " "
-
- Click through to create a Pull Request to the Bioconda GitHub repository.
- When the new version of Auspice is available on Bioconda, manually run the conda-base CI workflow on the
mainbranch.