Skip to content

Latest commit

 

History

History
98 lines (61 loc) · 2.85 KB

DEVELOP.md

File metadata and controls

98 lines (61 loc) · 2.85 KB

How to start working on this project

To contribute to the code, we assume you already know how to use git and GitHub and you understand HTML, JavaScript and CSS.

Quick Guide

  1. Clone the repository.
git clone https://github.com/jobisoft/CategoryManager
  1. Open it in your favorite editor. (We will use vscode in this example)
code CategoryManager
  1. Install the dev dependencies. (Optional)

This step is optional but it could improve your development experience.

yarn install

Now you can run yarn lint to see if the code has any linting errors.

You can also install the ESLint extension for vscode to get live linting.

  1. Open Thunderbird and load the extension in debug mode.

It is recommended to use a new profile for this so that you don't mess up your existing profile.

  1. Open the inspector for this extension. And make your changes in your IDE. Reload the extension in the inspector to apply your changes.

  2. Debug your changes using whatever method you want.

Some helpful resources:

  1. When you are done, create a pull request if you want to contribute.

Fake Data

You can generate some fake data for your debugging purpose. You need to install python3 and a recent version of node.js.

First, install dependencies.

pip3 install names random-word

Then, generate the fake data (data.json):

python scripts/generate-fake-data.py 

And convert it to vCard format:

node scripts/fake-data-to-vcf.js

Now you can import output.vcf into ThunderBird.

Caveats

Sometimes the errors from background page won't be logged to the console. You can see them in your terminal if you launched the Thunderbird instance in a shell.

VSCode Debugger

Not Recommended. It has many bugs but I listed it here because it is cool. I only tested it on Linux.

Install the Command Variable extension in vscode and create dev.config.json in the root directory of this repo.

Fill in the path to thunderbird executable and your profile directory like the following example:

{
  "thunderbird": {
    "path": "/mnt/data/thunderbird/thunderbird-bin",
    "profile": "/home/kxxt/.thunderbird/test-profile"
  }
}

Hit F5 in vscode to start debugging and the extension will hot reload if your code changes.

Some bugs:

  • Sometimes messages from console.log/info/... get lost.
  • Sometimes the breakpoint won't hit.
  • You might get other weird bugs sometimes.