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
electronstarts an electron process with the built application.electron-devstarts an electron process with the current code.- Note that the script waits for http://localhost:3000 to be available before launching the electron process.
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.
Firebase
firebase:emulators:startstarts the Firebase emulators with the data found inemulator_data/firebase:emulators:savesaves 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:downloadruns thefirebase-download-script.jsscript, 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:homeexecutesnpm run devwith equipment disabled (env/.env.home)dev:home:videoexecutesnpm run devwith equipment disabled (env/.env.home) and video enabled (env/.env.video)dev:clinicexecutesnpm run devwith equipment enabled (env/.env.clinic)dev:clinic:videoexecutesnpm run devwith equipment enabled (env/.env.clinic) and video enabled (env/.env.video)dev:firebaseexecutesnpm run start:browserwith Firebase enabled (env/.env.firebase)infofirebase:emulators:startmust be run in its own terminal in order fornpm run firebase:devto 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:homeexecutesnpm run buildwith equipment disabled (env/.env.home)dev:home:videoexecutesnpm run buildwith equipment disabled (env/.env.home) and video enabled (env/.env.video)dev:clinicexecutesnpm run buildwith equipment enabled (env/.env.clinic)dev:clinic:videoexecutesnpm run buildwith equipment enabled (env/.env.clinic) and video enabled (env/.env.video)dev:firebaseexecutesnpm run buildwith 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:windowsnpm run package:linuxnpm run package:mac
Packaging for windows on a non-windows machine requires mono and wine to be installed.
Miscellaneous
commitruns commitizen in the console. It is useful for ensuring your Git commit messages are easy to follow.lintuses Eslint to find problems in the codeformatuses Eslint to find and fix problems in the code that it can automaticallytestlaunches the test runner in the interactive watch mode. See running tests for more information.