NPM Scripts
Custom scripts for common shell commands can be written in package.json and run via the node package manager (NPM). All of the commands needed to develop, build, and deploy Honeycomb are written as scripts.
Additional scripts can be created if desired but we generally recommend against changing or deleting the scripts Honeycomb ships with.
npm run <script>
Start
startruns the app in development mode and does NOT open a browser. This makes working with Electron easier as it creates its own browser for development.start:browserruns the app in development mode and automatically opens a new browser tab. It uses your system's default browser. The page will reload if you make edits.start:electron: Waits for the app to be running (fromstart) and then starts an electron process.
Dev
npm run dev runs the app in development mode on Electron. It executes start and start:electron concurrently.
Note that this is a base script that other scripts build on top of - you should always run one of the scripts below while developing your app. The additional scripts execute npm run dev with different environment variables.
dev:homeruns the app with equipment disabled.dev:home:videoruns the app with equipment disabled and video enabled.dev:clinicruns the app with equipment enabled.dev:clinic:videoruns the app with equipment enabled and video enabled.dev:turk-prolificruns the app with prolific and PsiTurk enabled.
Firebase Development
dev:firebaseruns the app with Firebase enabled.firebase:emulators:startstarts the Firebase emulators with the data found inemulator_data/.firebase:emulators:savesaves the current state of the Firebase emulators intoemulator_data/.
Working with Firebase is slightly different as it is meant to be run on the browser. npm run dev:firebase executes start:browser with Firebase enabled, which will automatically launch the running app in your default browser. It can be found on other browsers by navigating to localhost:3000.
dev:firebase must be run in conjunction with firebase:emulators:start to work properly. This runs the Firebase Emulators locally with some dummy data. The emulator data can be viewed at localhost:4000.
npm run firebase:emulators:start must be run in a separate terminal window that stays during development.
The dummy study is s1 and the dummy participant is p1.
Build
npm run build creates a production build of the app in the build/ folder.
Note that this is a base script that other scripts build on top of - you should always run one of the scripts below while developing your app. The additional scripts execute npm run build with different environment variables.
build:homebuilds the app with equipment disabledbuild:home:videobuilds the app with equipment disabled and video enabledbuild:clinicbuilds the app with equipment enabledbuild:clinic:videobuilds the app with equipment enabled and video enabledbuild:firebasebuilds the app with Firebase enabledbuild:turk-prolificbuilds the app with prolific and PsiTurk enabled
Package
npm run package:[platform] creates a standalone installer for the given platform using electron-forge. The installer is created in out/. Note that the scripts build the app before creating the installers
npm run package:windowsnpm run package:linuxnpm run package:mac
Packaging for Windows on a non-Windows machine requires mono and wine to be installed.
Miscellaneous
cliruns the Firebase CLI script.commitruns Commitizen in the console. It is useful for ensuring your Git commit messages are easy to follow.formatuses Prettier to style code in a consistent format.lintuses Eslint to find problems in the code.postinstallis run automatically afternpm installand is used to rebuild the Electron dependenciesprepareis run automatically before the project is packaged/installed and is used to set up the project's pre-commit hooksprebuildis run automatically beforenpm run buildand is used to rebuild the Electron dependencies