Skip to content

Latest commit

 

History

History
89 lines (70 loc) · 2.05 KB

File metadata and controls

89 lines (70 loc) · 2.05 KB

Contributing to Traceback

If you want to contribute or debug the extension we recommend:

1- Download the repository next to your test project

git clone git@github.com:InQBarna/firebase-traceback-extension.git traceback-extension

2.- Install locally using the CLI.

In order to load extension breakpoints correctly, we checkout the testing project inside the extension project. Can't get it working reversely, please let us know if you get it.

cd traceback-extension/functions/
ln -s ../../my-project/ my-project-tests
cd my-project-tests/functions
firebase ext:install ../../../

3.- Debug locally, usually with

firebase emulators:start --inspect-functions

4.- When ready, deploy

firebase deploy --only extensions

5.- When working locally, there are many hacks for the emulators to work. For example, working with local hosting is possible, but extension setup code only works with the remote hosting api. Serve a hosting by adding the hosting locally to your firebase configuration firebase.json:

  "hosting": [
    {
      "site": "{projectName}}-traceback",
      "public": "public",
      "appAssociation": "NONE",
      "ignore": [
        "firebase.json",
        "**/.*",
        "**/node_modules/**"
      ],
      "rewrites": [
        {
          "source": "**",
          "function": "ext-traceback-dynamichostingcontent",
          "region": "europe-west1"
        }
      ]
    }
  ],

6.- When working, you can uninstall from source and proceed with normal installation

firebase ext:uninstall traceback-extension
firebase ext:install traceback-extension

Using setup scripts

For development and testing, you can use the provided setup scripts:

# Create dummy links (emulator)
npm run init:links

# Create dummy links (production)
npm run init:links:prod

# Create API key (emulator)
npm run init:apikey

# Create API key (production)
npm run init:apikey:prod

# Create both links and API key (emulator)
npm run init:all

# Create both links and API key (production)
npm run init:all:prod