Databutton Firebase
This repo contains firestore types, functions and rules for Databutton.
Contributing
This repo runs TypeScript and is a pure ESM project. This basically means that you have to write import x from 'x';
and you can no longer write const x = require('x');
In addition, all imports needs to be relative paths and include file-ending (.js). This is also the case when importing TypeScript files because the imports are used after the TypeScript has been transpiled into JavaScript.
For more info, check out this guide on writing pure ESM packages
Developing
yarn install
Running tests
yarn test:rules
Linting
yarn lint
Running locally
Note: You need Google Credentials
yarn shell
Execute firebase scripts (for migration etch.)
Set up GOOGLE_APPLICATION_CREDENTIALS from the following guide: https://firebase.google.com/docs/admin/setup#initialize-sdk and add the environment variable to the file <PROJECT_ROOT>/.env
Modify the src/run.ts
-file to do what you want.
Execute the script running this command
yarn execute