Contributing
Simplify type logic and remove dead code.
Implement latest Typescript features.
Cover more type tests and run time tests.
Better documentation.
Implement
mandatory field type
, a special type that mark keys asrequired
inupdate
operations. Practical usage is to mark a key likeupdatedAt
.Query Constraint type change Read type. For example for query
where('a', '==', true)
, we can further narrow down the type of fielda
to onlytrue
.New Logo
Running The Source Code
This library is tested against both emulators and live database, so please allow for unrestricted read and write access in your Firestore rules. Also, make sure to use a dummy Firebase project.
To get started, run npm i
. Then, create a .env
file in the project root directory and add the following line:
For Web:
PROJECT_ID="your-firebase-project-id"
Do not upload PROJECT_ID because we do not restrict any access to Firestore for smooth testing purposes!
For Admin:
TYPE="xxx"
PROJECT_ID="xxx"
PRIVATE_KEY_ID="xxx"
# must enclosed private key with single quotes
# copy everything of private key including the double quotes
PRIVATE_KEY='"-----BEGIN PRIVATE KEY-----\nSOME_SUPERLONG_STRING\n-----END PRIVATE KEY-----\n"'
CLIENT_EMAIL="xxx"
CLIENT_ID="xxx"
AUTH_URI="xxx"
TOKEN_URI="xxx"
AUTH_PROVIDER_X509_CERT_URL="xxx"
CLIENT_X509_CERT_URL="xxx"
Do not expose admin secrets.
Final Step:
Once you have your .env
file set up, place a copy of it into the codeForDoc
directory(for both web and admin). Then, you can run the following commands:
npm run d-test
to test development code.npm run b-q-test
to test built code.npm run p-q-test
to test published code(You can specify which version to test by changing theversion
inpackage.json
).