Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Reorganize npm scripts #105

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions docs/project_organization/npm_scripts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ npm run <script>
- `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.
- `start:electron`: Waits for the app to be running (from `start`) and then starts an electron process.

## Firebase

- `firebase:emulators:start` starts the Firebase emulators with the data found in `emulator_data/`.
- `firebase:emulators:save` saves the current state of the Firebase emulators into `emulator_data/`.
- `firebase:download` runs the `firebase-download-script.js` script, saving certain data in Firebase to your local machine.

## Dev

`npm run dev` runs the app in development mode on Electron. It executes `start` and `start:electron` concurrently.
Expand All @@ -37,7 +31,11 @@ Note that this is a base script that other scripts build on top of - you should
- `dev:clinic:video` runs the app with equipment enabled and video enabled.
- `dev:turk-prolific` runs the app with prolific and PsiTurk enabled.

### Firebase
### Firebase Development

- `dev:firebase` runs the app with Firebase enabled.
- `firebase:emulators:start` starts the Firebase emulators with the data found in `emulator_data/`.
- `firebase:emulators:save` saves the current state of the Firebase emulators into `emulator_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](https://localhost:3000).

Expand Down Expand Up @@ -78,7 +76,10 @@ Packaging for Windows on a non-Windows machine requires `mono` and `wine` to be

## Miscellaneous

- `cli` runs the [Firebase CLI](firebase#using-the-cli-script) script.
- `commit` runs [Commitizen](https://commitizen-tools.github.io/commitizen/) in the console. It is useful for ensuring your Git commit messages are easy to follow.
- `lint` uses [Eslint](https://eslint.org/) to find problems in the code.
- `format` uses [Prettier](https://prettier.io) to style code in a consistent format.
- `test` launches the test runner in the interactive watch mode. See [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
- `lint` uses [Eslint](https://eslint.org/) to find problems in the code.
- `postinstall` is run automatically after `npm install` and is used to rebuild the Electron dependencies
- `prepare` is run automatically before the project is packaged/installed and is used to set up the project's pre-commit hooks
- `prebuild` is run automatically before `npm run build` and is used to rebuild the Electron dependencies
Loading