Development & Contributing Upstream


Here’s what you need to get started:

  • Source code for Ledger Reconciler.
  • Node.js >= 8.4.0 (needs async/await support).
  • Yarn package manager.
  • Ledger installed and available locally.
  • reckon Ruby gem installed and available locally.
  • A basic config file as per the installation docs.

Clone and install all the Ledger Reconciler dependencies. Git LFS here is used for the website images.

git clone https://github.com/marvinpinto/ledger-reconciler.git
cd ledger-reconciler
git lfs install
git lfs pull
yarn install

Be sure to use the --debug and --dry-run flags when testing and iterating on your program locally.

yarn run dev:dry-run

Before submitting a pull request, do make sure all the tests pass locally.

yarn run lint
yarn run all-tests

Plugin Development

The Ledger Reconciler plugin runner (index.js) was designed to execute any compatible plugins explicitly specified by the end user. What this means is that plugins can be loaded directly from the ledger-reconciler library, or from an external npm package.

The location of external or internal plugins is specified via the location key in the config file.

All plugins need to adhere to the following interface:

async scrapeTransactions() {
  // ...
}

getMostRecentTransactionDate() {
  // ...
}

getRemainingBalance() {
  // ...
}

They also need to set the page variable to that of a new browser instance, for example:

this.page = await this.browser.newPage();

Your best bet is to extend the BasePlugin class - have a look at the examples in the lib/plugins directory on GitHub.

While iterating on a plugin locally, you may find it useful to have Chrome take screenshots of what the webpage looks like at point in time.

await page.pdf({path: 'screenshot.pdf'});

Website Development

If you need to update the Ledger Reconciler documentation - under the website directory - you might find it useful to run the local dev server to see what your changes look like before submitting upstream.

yarn start

Getting Help

This project is not very active at the moment so your best bet is to open up a new issue with the problem you’re facing. You can also stop by the gitter.im chat room if you need synchronous help and I’ll do what I can.

Release Procedure

  1. On master, create a new release document with all relevant highlights. (e.g. content/releases/<NEW VERSION>.md)
  2. Update content/releases/_index.md to reflect the unreleased state.
  3. Cut a new release: yarn version --new-version <NEW VERSION>
  4. Update the release notes on GitHub to point back to the website release page.