wallet-core/README

169 lines
4.2 KiB
Plaintext
Raw Normal View History

# GNU Taler Wallet & Anastasis Web UI
2016-04-08 15:20:05 +02:00
2020-08-10 13:32:08 +02:00
This repository contains the implementation of a wallet for GNU Taler written
in TypeScript and Anastasis Web UI
2016-04-08 15:20:05 +02:00
2020-11-16 16:51:09 +01:00
## Dependencies
2020-11-04 14:16:28 +01:00
2020-11-25 16:30:31 +01:00
The following dependencies are required to build the wallet:
2022-04-25 20:38:45 +02:00
- python>=3.8
- nodejs>=12
- jq
- npm
- pnpm
- zip
2020-11-04 14:16:28 +01:00
2020-11-16 16:51:09 +01:00
## Installation
2016-03-18 15:47:17 +01:00
2020-11-16 16:51:09 +01:00
The CLI version of the wallet supports the normal GNU installation process.
2020-11-16 16:51:09 +01:00
```shell
./configure [ --prefix=$PREFIX ] && make install
```
### Compiling from Git
If you are compiling the code from git, you have to run `./bootstrap` before
running `./configure`.
2020-11-16 16:51:09 +01:00
### Building the WebExtension
2020-11-04 14:16:28 +01:00
The WebExtension can be built via the 'webextension' make target:
2020-11-16 16:51:09 +01:00
```shell
./configure && make webextension
```
2020-11-04 14:16:28 +01:00
2020-11-25 18:27:58 +01:00
This will create the zip file with the WebExtension in the directory
2020-11-04 14:16:28 +01:00
2020-11-16 16:51:09 +01:00
```
2020-11-25 18:27:58 +01:00
packages/taler-wallet-webextension/extension/
2020-11-16 16:51:09 +01:00
```
### Installing local WebExtension
Firefox:
- Settings
- Add-ons
- Manage your extension -> Debug Add-ons
- Load temporary Add-on...
- Look for the zip file under './packages/taler-wallet-webextension/extension/' folder
Chrome:
- Settings
- More tools
- Extensions
- Load unpacked
- Look for the folder under './packages/taler-wallet-webextension/extension/'
You may need to use manifest v2 or v3 depending on the browser version:
https://blog.mozilla.org/addons/2022/05/18/manifest-v3-in-firefox-recap-next-steps/
https://developer.chrome.com/docs/extensions/mv3/mv2-sunset/
### Reviewing WebExtension UI examples
2020-11-25 16:30:31 +01:00
2022-04-25 20:38:45 +02:00
The WebExtension can be tested using example stories.
To run a live server use the 'dev-view' target
```shell
2021-07-14 17:50:49 +02:00
make webextension-dev-view
```
2022-04-25 20:38:45 +02:00
Stories are defined with a \*.stories.tsx file [1], you are free to create new or edit
some and commit them in order to create a more complete set of examples.
2020-11-04 14:16:28 +01:00
2022-04-25 20:38:45 +02:00
[1] look for them at packages/taler-wallet-webextension/src/\*_/_.stories.tsx
### WebExtension UI Components
Every group of component have a directory and a README.
Testing component is based in two main category:
- UI testing
- State transition testing
For UI testing, every story example will be taken as a unit test.
For State testing, every stateful component should have an `useStateComponent` function that will be tested in a \*.test.ts file.
### Testing WebExtension
After building the WebExtension look for the folder `extension`
Inside you will find v2 and v3 version referring to the manifest version being used.
Firefox users:
- Go to about:addons
- Then `debug addon` (or about:debugging#/runtime/this-firefox)
- Then `Load temporary addon...`
- Select the `taler-wallet-webextension-*.zip`
Chrome users:
- Settings -> More tools -> Extensions (or go to chrome://extensions/)
- `Load unpacked` button in the upper left
- Selected the `unpacked` folder in v2 or v3
2020-11-16 16:51:09 +01:00
# Integration Tests
2016-04-08 15:20:05 +02:00
2022-04-25 20:38:45 +02:00
This repository comes with integration tests for GNU Taler. To run them,
install the wallet first. Then use the test runner from the
2020-08-10 13:32:08 +02:00
taler-integrationtests package:
2016-03-18 15:47:17 +01:00
2020-11-16 16:51:09 +01:00
```shell
2022-09-05 14:04:46 +02:00
# List available tests
taler-wallet-cli testing list-integrationtests
# Run all tests
taler-wallet-cli testing run-integrationtests
# Run all tests matching pattern
taler-wallet-cli testing run-integrationtests $GLOB
$ Run all tests from a suite
taler-wallet-cli testing run-integrationtests --suites=wallet
2020-11-16 16:51:09 +01:00
```
2016-03-18 15:47:17 +01:00
2022-04-25 20:38:45 +02:00
The test runner accepts a bash glob pattern as parameter. Individual tests can
2020-08-10 13:32:08 +02:00
be run by specifying their name.
2020-09-04 10:43:56 +02:00
To check coverage, use nyc from the root of the repository and make sure that the taler-wallet-cli
from the source tree is executed, and not the globally installed one:
2020-11-16 16:51:09 +01:00
```
2022-09-05 14:04:46 +02:00
nyc ./packages/taler-wallet-cli/bin/taler-wallet-cli '*'
2020-11-16 16:51:09 +01:00
```
2022-11-21 14:49:15 +01:00
## Minimum required browser for WebEx
2022-11-16 15:34:06 +01:00
Can be found in:
- packages/taler-wallet-webextension/manifest-v2.json
- packages/taler-wallet-webextension/manifest-v3.json
## Anastasis Web UI
## Building for deploy
To build the Anastasis SPA run:
```shell
make anastasis-webui
```
It will run the test suite and put everything into the dist folder under the project root (packages/anastasis-webui).
You can run the SPA directly using the file:// protocol.
```shell
firefox packages/anastasis-webui/dist/ui.html
```
Additionally you can create a zip file with the content to upload into a web server:
```shell
make anastasis-webui-dist
```
It creates the zip file named `anastasis-webui.zip`