Skip to content

Development Process

Joe Pickert edited this page Aug 30, 2021 · 9 revisions

Developing Locally

Introduction

Use npm link to develop Mirage and Thor locally.

Goal is to quickly make Mirage changes and see them appear on local Thor server, while conveniently pushing those changes to GitHub.

Strategy tells Thor to use @rocketsofawesome/mirage package from local Mirage build folder.

Setup

Go into local mirage folder, prepare project, and initialize npm link:

cd mirage

nvm use 10.15.3
npm install

# Compile project into build folder
npm run predeploy

# Initialize linking
sudo npm link

Go into local thor folder, prepare project, and link to local mirage:

cd thor

nvm use 10.15.3
npm install

# Finalize linking
npm link @rocketsofawesome/mirage

Development

Run Thor server:

npm run dev

Make change in local Mirage and then rebuild:

# Run in local mirage
npm run predeploy

Local Thor server should pick up changes and restart automatically.

Testing

Make sure you've installed watchman by running brew install watchman

Run npm test to run the test suite

If you've made changes to any components that rely on snapshot testing, you'll need to generate new snapshots as the old ones will be stale. Run npm test -- -u

Versioning

When the feature is ready, run npm version patch in local mirage, to add commit that updates version in package.json.

Push to GitHub, merge PR, and wait for new version to get published.

After published, update package in local thor:

# Updates package.json and package-lock.json
npm install @rocketsofawesome/mirage@latest --save

Feel free to improve guide!

Clone this wiki locally