summaryrefslogtreecommitdiff
path: root/dev-wallet-wx.rst
diff options
context:
space:
mode:
Diffstat (limited to 'dev-wallet-wx.rst')
-rw-r--r--dev-wallet-wx.rst47
1 files changed, 46 insertions, 1 deletions
diff --git a/dev-wallet-wx.rst b/dev-wallet-wx.rst
index d5b7c21a..2fdc7252 100644
--- a/dev-wallet-wx.rst
+++ b/dev-wallet-wx.rst
@@ -39,6 +39,7 @@ Project Structure
**manifest.json** extension configuration
**package.json** node.js package configuration
**tsconfig.json** TypeScript compiler configuration
+ **gulpfile.js** Build tasks script
**lib/**
**vendor/** 3rd party libraries
**wallet/** actual application logic
@@ -53,6 +54,47 @@ Project Structure
**pages/** pages shown in browser tabs
**popup/** pages shown the extension popup
+
+-------------------
+Building the Wallet
+-------------------
+
+To build the extension for use during development, simply run the TypeScript compiler
+from the extension directory:
+
+.. code-block:: sh
+
+ $ cd wallet.git/wallet_webextension/extension/
+ $ tsc
+
+This will use the ``tsconfig.json`` with development options such as `source map`_ support.
+
+.. _`source map`: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
+
+When TypeScript source files are added or deleted to the project, make sure that the
+globs in ``gulpfile.js`` match them so that they will be compiled. The ``tsconfig.json``
+is generated by running:
+
+
+.. code-block:: sh
+
+ $ gulp tsconfig
+
+.. caution::
+
+ Do not edit the ``tsconfig.json`` manually. The source files should be defined in
+ one place, and that is ``gulpfile.js``.
+
+To pack the extension in a format that can be uploaded to the Google Webstore, run:
+
+.. code-block:: sh
+
+ $ gulp package
+
+This will build the wallet without source maps, copy resource files (which also need to be
+specified in ``gulpfile.js``) and create an archive.
+
+
----------
Emscripten
----------
@@ -62,6 +104,8 @@ to JavaScript compiler. Emscripten is used in the *wxwallet* to access
low-level cryptography from *libgcrypt*, and miscellaneous functionality from
*libgnunetutil* and *libtalerwallet*.
+TODO: say things about wrappers
+
--------------------------------------
Target Environments and Modularization
@@ -102,5 +146,6 @@ Test cases for the wallet are written in TypeScript and
run with `mochajs <http://mochajs.org/>`_ and the `better-assert <https://github.com/tj/better-assert>`_ assertion
library.
-Run the default test suite with ``XXX``.
+Run the default test suite with ``npm run test``, which will
+call `moch` with the right parameters.