Fetch the current block height from multiple block explorers early on in
the sync process. This ensures that we get the correct block height in
the case where our BTCd node is still mid way through syncing. Do this
in the main process rather than in the render process.
Define an npm config variable in package.json to specify where the
stylesheets are that we want to lint and update our package scripts to
reference this.
It looks like we were a little hasty in #492 as rimraf is used directly
within package.json in the `flow-typed` script and so it needs to remain
as a dev dependency.
See https://github.com/LN-Zap/zap-desktop/pull/492
Concurrently v3.6.0 includes a number of improvements and fixes. Of
particular interest is the new npm command shortcut feature which we can
use to shorten our package scripts a little more.
See https://github.com/kimmobrunfeldt/concurrently/releases/tag/3.6.0
Remove the following project dependencies, which are not being used:
- express
- rimraf
- sinon
- bitcore-lib
- d3-force
- d3-selection
- d3-zoom
- split2
- xtend
Use `CspHtmlWebpackPlugin` to generate our content security policy
using code rather than hard coding meta tags on our html index page.
This provides us a more flexible means to configure our CSP dynamically.
Use `HtmlWebpackPlugin` to generate our final html file so that we can
remove our inline scripts and insert them dynamically based on our
webpack config.
This enables easy access to all lnd settings for development, and is a step
toward relying on an external configuration file that will be accessible to
users for whom the code is not.
Webpack v4 introduced a new `mode` setting, which - amongst other
things - automates the definition of the NODE_ENV environment variable.
We already had the `mode` settings set in our webpack configs so this
change is just to clean up some redundant code that is handled
automatically by this setting.
See:
- https://webpack.js.org/concepts/mode/
pass the `--raw` flag to concurrently so that we output the raw output
of processes. This disables concurrently prettifying and provides a more
legible output for our scripts.
Automatically validate commit messages according to the Conventional
Commit standard in a git commit-msg hook.
This functionality is optional and can be enabled by adding a .opt-in
file with a line `commit-msg`.
See:
- http://conventionalcommits.org/
- https://github.com/marionebl/commitlint
Currently we use eslint and prettier to lint and format code. However,
running the linter is a manual step that is easy to forget.
To improve this we run our lint scripts in a git pre-commit hook. This
functionality is optional and can be enabled by adding a .opt-in file
with a line `pre-commit`.
Currently we use eslint to lint code, but formatting the code according
to our ruleset is a manual process.
Implement `prettier` so that code is automatically formatted as part of
our development workflow.
See https://prettier.io/
Use debug-logger to provide a more comprehensive and flexible logging
solution. Use two separate log handlers to provide separation between
electron and and lnd logs.
There is an unneeded call to `concurrently` in the `npm run dev` script.
This causes things that should be output in colour (eg debug messages
when running with DEBUG=*) to not be output in colour which makes
debugging things harder than it should be.
This was in place because previously lnd was being started up externally
in the `npm run dev` script at the same time as starting up the app. But
we now use spawn from within the app to start up lnd.
The call to `concurrently` is no longer needed.
See d8c5623e01
Update all webpack packages to the latest v4.x compatible versions and
update supporting configs. This delivers noticeable performance
improvements to the DX.
The v5.2.0 includes (amongst other things) a fix for incorrectly reported
exit codes of child processes, which can prevent build build failures from
correctly halting a build, resulting in incomplete or invalid builds.
See https://github.com/kentcdodds/cross-env/issues/150#issuecomment-387737183
Update webpack and related packages to the latest 3.x versions. This
prevents errors from node-gyp when attempting to build fsevents (OSX),
which is an indirect dependency of webpack-dev-server (via chokidir)
See https://github.com/strongloop/fsevents/releases/tag/v1.1.0
The v20.15.1 release of electron-builder has been unpublished since its
original release and subsequently a newer v20.15.3 version has been
released. v20.15.3 resolves several critical issues found in v20.15.1,
one of which was causing `electron-builder install-app-deps` to hang
indefinitely when run without `DEBUG=electron-builder` being set
Update grpc to v1.12.3 in order to fix issues build issues due to the fact
that 1.12.1 doesn't contain node-pre-gyp as a bundled dependency.
See https://github.com/grpc/grpc-node/issues/365
The latest version of electron-builder lets us use file macros in the file
patterns such as `$platform`, which is useful for us to be able to
include platform specific files in the build as DRY as possible.
Only one of these files was being used, and they were going out of step
relative to one another.
Put rpc.proto in the resources directory for consistency with other
vendored resources, i.e. the lnd binary
Updated the def from:
https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto