- Run
npm install
to install dependencies. - Edit
src/firebase_config.ts
to specify yourPROJECT_ID
andAPI_KEY
. (not required if you only want to use the Firestore emulator). - Edit
src/run_the_test.ts
to run whatever code you want to run.
- Run
npm run build
to generate the compiled JavaScript. - Run
npm run serve
to start an HTTP server. - Open
http://localhost:9080/
in a web browser. - Click the "Run Test" button.
- Run
npm run run
to run the code in Node.
To connect to the Firestore emulator, specify -e
,
for example npm run run -- -e
To enable Firestore debug logging, specify -v
,
for example npm run run -- -v
As a convenience, run npm run run:emulator
to launch an emulator,
run the test, then stop the emulator.
- Install the Firebase CLI (see link below for details).
- Run
firebase init hosting
to configure the directory for hosting. - Run
npm run build
to compile the browser bundle. - Run
firebase deploy --only hosting
to deploy.
For more details, see https://firebase.google.com/docs/hosting/quickstart.
git clone https://github.com/firebase/firebase-js-sdk
cd firebase-js-sdk
yarn
yarn build
cd packages/firestore
yarn build:debug
yarn pack # this creates a tar file (e.g. firebase-firestore-v3.4.4.tgz)
cd ~/firestore-team/web
npm install firebase-firestore-v3.4.4.tgz
This repository uses "prettier" to format the code. To run the code formatter, simply run
npm run prettier
Note that importing the Firebase modules is done using the firebase/firestore
import, rather than the @firebase/firestore
import. That is, the leading @
is omitted. This is the recommended best practice.
See go/firebase-js-sdk-module-resolution for details.