I'm in the process of putting up better developer's documentation, but you should be able to figure it out from the [[file:../.github/workflows/main.yml][Github Actions pipeline]].

* Run backend
   During development, the easiest way to run =promnesia= as =scripts/promnesia=. Alternatively, you can use =pip install -e .=.

   # TODO reuse doc from pymplate?

* Build extension

   : cd extension
   : ./build --firefox # you can also use --chrome
   :         --lint    # [optional], run webext linter
   :         --release # [optional], build in the release mode (with optimizations)
   :         --publish # [optional], release to the Chrome Web Store/Mozilla addons

   You'll find the result in =dist/=. After that, you can load it in your browser and develop.

   - on Firefox, the temporary loaded extensions only persist until the browser restart. Chrome doesn't have that issue.
   - on Firefox for Android, web extensions on Android are mostly broken at the moment, see [[https://discourse.mozilla.org/t/add-on-support-in-new-firefox-for-android/53488][here]] (unless you're using [[https://blog.mozilla.org/addons/2020/09/29/expanded-extension-support-in-firefox-for-android-nightly][Firefox Nightly]])

* Run end-to-end tests

End-to-end test go throught the full cycle from indexing & backend to automated extension tests, and are very helpful to make sure you don't break things.

You need:

- firefox + =geckodriver=, or chrome + =chromedriver=
- =pip3 install pyautogui= for keyboard automation

Example of running a test:

: PYTHONPATH=src python3 -m pytest -s 'tests/end2end_test.py::test_add_to_blacklist[chrome]'
