blob: 471815c0b9f9010b97ccf5aee7728fd2bdda13ca (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# GNU Taler Wallet & Anastasis Web UI
This repository contains the implementation of a wallet for GNU Taler written
in TypeScript and Anastasis Web UI
## Dependencies
The following dependencies are required to build the wallet:
- python>=3.8
- nodejs>=12
- jq
- npm
- pnpm
- zip
## Installation
The CLI version of the wallet supports the normal GNU installation process.
```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`.
## Pushing a new prebuilt version
After compiling run
```shell
make prebuilt
```
This will create a directory `prebuilt` with a git subtree,
compile every prebuilt project, copy everything into this subtree
and create a commit with the default message mentioning from
which revision the prebuilt was created.
When the script completes the prebuilt version can should
be manually pushed.
```shell
cd prebuilt
git push
```
### Building the WebExtension
The WebExtension can be built via the 'webextension' make target:
```shell
./configure && make webextension
```
This will create the zip file with the WebExtension in the directory
```
packages/taler-wallet-webextension/extension/
```
### 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
The WebExtension can be tested using example stories.
To run a live server use the 'dev-view' target
```shell
make webextension-dev-view
```
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.
[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
# Integration Tests
This repository comes with integration tests for GNU Taler. To run them,
install the wallet first. Then use the test runner from the
taler-integrationtests package:
```shell
# 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
```
The test runner accepts a bash glob pattern as parameter. Individual tests can
be run by specifying their name.
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:
```
nyc ./packages/taler-wallet-cli/bin/taler-wallet-cli '*'
```
## Minimum required browser for WebEx
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`
|