- Clone this repo and
cdinto it - Run
npm installto pull dependencies - Run
npm startto runwebpack-dev-serverin development mode with hot module replacement
Additional steps are required to run using HTTPS.
- install mkcert :
brew install mkcert(install using Scoop or Chocolatey on Windows) - Create and install the trusted CA in keychain if it doesn't already exist:
mkcert -install - Ensure you have a
.localhost-sslcertificate directory in your home directory (create if needed, typicallyC:\Users\UserNameon Windows) and cd into that directory - Make the cert files:
mkcert -cert-file localhost.pem -key-file localhost.key localhost 127.0.0.1 ::1 - Run
npm run start:secureto runwebpack-dev-serverin development mode with hot module replacement
Alternately, you can run secure without certificates in Chrome:
- Enter
chrome://flags/#allow-insecure-localhostin Chrome URL bar - Change flag from disabled to enabled
- Run
npm run start:secure:no-certsto runwebpack-dev-serverin development mode with hot module replacement
If you want to build a local version run npm build, it will create the files in the dist folder.
You do not need to build to deploy the code, that is automatic. See more info in the Deployment section below.
- Make sure if you are using Visual Studio Code that you use the workspace version of TypeScript.
To ensure that you are open a TypeScript file in VSC and then click on the version number next to
TypeScript Reactin the status bar and select 'Use Workspace Version' in the popup menu.
S3 deployment is handled automatically by GitHub Actions using OIDC for AWS authentication. See doc/deploy.md for details on how deployment works and doc/deploy-setup.md for the initial AWS setup.
Production releases to S3 are based on the contents of the /dist folder and are built automatically by GitHub Actions for each branch and tag pushed to GitHub.
Branches are deployed to https://models-resources.concord.org/neural-pathways/branch/. If the branch name starts or ends with a number this number is stripped off.
Tags are deployed to https://models-resources.concord.org/neural-pathways/version/.
To deploy a production release:
- Increment version number in package.json
- Create new entry in CHANGELOG.md
- Run
git log --pretty=oneline --reverse <last release tag>...HEAD | grep '#' | grep -v Mergeand add contents (after edits if needed to CHANGELOG.md) - Run
npm run build - Copy asset size markdown table from previous release and change sizes to match new sizes in
dist - Create
release-<version>branch and commit changes, push to GitHub, create PR and merge - Checkout main and pull
- Create an annotated tag for the version, of the form
v[x].[y].[z], include at least the version in the tag message. On the command line this can be done with a command likegit tag -a v1.2.3 -m "1.2.3 some info about this version" - Push the tag to GitHub with a command like:
git push origin v1.2.3. - Use https://github.com/concord-consortium/neural-pathways/releases to make this tag into a GitHub release.
- Run the release workflow to update https://models-resources.concord.org/neural-pathways/index.html.
- Navigate to the actions page in GitHub and the click the "Release" workflow. This should take you to this page: https://github.com/concord-consortium/neural-pathways/actions/workflows/release.yml.
- Click the "Run workflow" menu button.
- Type in the tag name you want to release for example
v1.2.3. (Note this won't work until the PR has been merged to main) - Click the
Run Workflowbutton.
Run npm test to run Jest unit tests. Run npm run test:full to run both Jest and Playwright tests.
End-to-end tests use Playwright. To run them locally:
- Start the dev server:
npm start - In another terminal:
npm run test:playwright
Or use npm run test:playwright:open to open the interactive test runner.
When writing Playwright tests, prefer accessible locators over CSS selectors or data-testid attributes.
See the Playwright locator guide for the recommended priority:
getByRole > getByText > getByLabel > getByPlaceholder > getByTestId.
Neural Pathways is Copyright 2018 (c) by the Concord Consortium and is distributed under the MIT license.
See license.md for the complete license text.