NPM Scripts
Node package manager (NPM) ships with functionality to combine common shell commands into custom scripts. These scripts are defined in package.json
. All of the commands needed to develop, build, and deploy Honeycomb are written out as scripts.
Additional scripts can be created if desired but we generally recommend against changing or deleting the scripts Honeycomb ships with.
Scripts are run using the following terminal command:
npm run <script>
Start
electron
starts an electron process with the built application.electron-dev
starts an electron process with the current code.- Note that the script waits for http://localhost:3000 to be available before launching the electron process.
start
runs 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:browser
runs 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.
Firebase
firebase:emulators:start
starts the Firebase emulators with the data found inemulator_data/
firebase:emulators:save
saves the current state of the Firebase emulators intoemulator_data/
cautionThere's no way to revert to what used to be in `emulator_data/ once it's overwritten!
firebase:download
runs thefirebase-download-script.js
script, saving certain data in Firebase to your local machine.
Dev
npm run dev
runs the task in development mode on Electron. It executes npm start
and npm run electron-dev
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 task.
dev:home
executesnpm run dev
with equipment disabled (env/.env.home
)dev:home:video
executesnpm run dev
with equipment disabled (env/.env.home
) and video enabled (env/.env.video
)dev:clinic
executesnpm run dev
with equipment enabled (env/.env.clinic
)dev:clinic:video
executesnpm run dev
with equipment enabled (env/.env.clinic
) and video enabled (env/.env.video
)dev:firebase
executesnpm run start:browser
with Firebase enabled (env/.env.firebase
)infofirebase:emulators:start
must be run in its own terminal in order fornpm run firebase:dev
to work
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 task.
dev:home
executesnpm run build
with equipment disabled (env/.env.home
)dev:home:video
executesnpm run build
with equipment disabled (env/.env.home
) and video enabled (env/.env.video
)dev:clinic
executesnpm run build
with equipment enabled (env/.env.clinic
)dev:clinic:video
executesnpm run build
with equipment enabled (env/.env.clinic
) and video enabled (env/.env.video
)dev:firebase
executesnpm run build
with Firebase enabled (env/.env.firebase
)
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:windows
npm run package:linux
npm run package:mac
Packaging for windows on a non-windows machine requires mono
and wine
to be installed.
Miscellaneous
commit
runs commitizen in the console. It is useful for ensuring your Git commit messages are easy to follow.lint
uses Eslint to find problems in the codeformat
uses Eslint to find and fix problems in the code that it can automaticallytest
launches the test runner in the interactive watch mode. See running tests for more information.