gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: anastasis build instruction a


From: gnunet
Subject: [taler-wallet-core] branch master updated: anastasis build instruction and some fixes
Date: Mon, 27 Jun 2022 20:12:53 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new dfb385aa anastasis build instruction and some fixes
dfb385aa is described below

commit dfb385aac96a20fd36bd7f939e96c0b3aca2c022
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Mon Jun 27 15:12:44 2022 -0300

    anastasis build instruction and some fixes
---
 .gitignore                                         |  1 +
 README                                             | 79 ++++++++--------------
 build-system/Makefile                              |  8 +--
 packages/anastasis-webui/clean_and_build.sh        | 15 ++--
 packages/anastasis-webui/package.json              |  4 +-
 .../src/components/menu/NavigationBar.tsx          |  4 +-
 .../src/components/menu/SideBar.tsx                |  6 +-
 7 files changed, 52 insertions(+), 65 deletions(-)

diff --git a/.gitignore b/.gitignore
index c51d31ab..dac7021e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,6 +26,7 @@ prebuilt/
 
 
 taler-wallet-*.tar.gz
+anastasis-webui.zip
 
 # debian packaging leftovers
 packages/taler-wallet-cli/debian/.debhelper
diff --git a/README b/README
index 67c41d34..fc7a2e71 100644
--- a/README
+++ b/README
@@ -1,7 +1,7 @@
-# GNU Taler Wallet
+# GNU Taler Wallet & Anastasis Web UI
 
 This repository contains the implementation of a wallet for GNU Taler written
-in TypeScript.
+in TypeScript and Anastasis Web UI
 
 ## Dependencies
 
@@ -41,54 +41,6 @@ This will create the zip file with the WebExtension in the 
directory
 packages/taler-wallet-webextension/extension/
 ```
 
-We also provide a `Dockerfile` for a container that can build the
-WebExtension. After you install docker, make sure the user is in group
-`docker` and (re-)start the docker daemon:
-
-```shell
-# Make sure there is a docker group.
-$ grep docker: /etc/group
-$ sudo groupadd docker
-
-# Make sure USER is defined and is in the docker group.
-$ echo $USER
-$ sudo usermod -aG docker $USER
-
-# Restart the docker daemon.
-# (This command is OS-specific.)
-
-# Obtain a new shell.  Make sure it includes the `docker` group.
-$ newgrp docker
-$ id
-```
-
-Then, you can proceed with these instructions:
-
-```shell
-# Download wallet source code and unpack it
-(host)$ tar -xf wallet-core-$version.tar.gz
-
-# Build the image
-(host)$ docker build --tag walletbuilder 
wallet-core-$version/contrib/wallet-docker
-
-# Start the container
-(host)$ docker run -dti --name walletcontainer walletbuilder /bin/bash
-
-# Copy wallet source to container
-(host)$ docker cp ./wallet-core-$version/ walletcontainer:/
-
-# Attach to container
-(host)$ docker attach walletcontainer
-
-# Run build inside container
-(container)$ cd wallet-core-$version
-(container)$ ./configure && make webextension
-(container)$ exit
-
-# Copy build artefact(s) to host
-(host)$ docker cp 
walletcontainer:/wallet-core-$version/packages/taler-wallet-webextension/extension
 extension
-```
-
 ### Reviewing WebExtension UI examples
 
 The WebExtension can be tested using example stories.
@@ -153,3 +105,30 @@ from the source tree is executed, and not the globally 
installed one:
 PATH="$PWD/packages/taler-wallet-cli/bin:$PATH" \
   nyc ./packages/taler-integrationtests/testrunner '*'
 ```
+
+## 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` 
+
+
diff --git a/build-system/Makefile b/build-system/Makefile
index e39b7f20..8be5a055 100644
--- a/build-system/Makefile
+++ b/build-system/Makefile
@@ -61,10 +61,10 @@ anastasis-webui:
        pnpm install --frozen-lockfile --filter . --filter 
@gnu-taler/anastasis-webui...
        pnpm run --filter @gnu-taler/anastasis-webui... build
 
-.PHONY: anastasis-webui-dev
-anastasis-webui-dev:
-       pnpm install --frozen-lockfile --filter @gnu-taler/anastasis-webui...
-       pnpm run --filter @gnu-taler/anastasis-webui... dev
+.PHONY: anastasis-webui-dist
+anastasis-webui-dist: anastasis-webui
+       (cd packages/anastasis-webui/dist && zip -r - fonts ui.html) > 
anastasis-webui.zip
+
 
 .PHONY: webextension
 webextension:
diff --git a/packages/anastasis-webui/clean_and_build.sh 
b/packages/anastasis-webui/clean_and_build.sh
index 25e7bd99..dd8d0d19 100755
--- a/packages/anastasis-webui/clean_and_build.sh
+++ b/packages/anastasis-webui/clean_and_build.sh
@@ -10,14 +10,17 @@ cp \
        src/scss/fonts/materialdesignicons-webfont-4.9.95.woff2 \
        dist/fonts
 
+VERSION=$(jq -r .version package.json)
+GIT_HASH=$(git rev-parse --short HEAD)
+
 function build_css() {
        pnpm exec sass -I . ./src/scss/main.scss dist/main.css
 }
 function build_js() {
-       pnpm exec esbuild --log-level=error --bundle $1 --outdir=dist 
--target=es6 --loader:.svg=dataurl --format=iife --sourcemap --jsx-factory=h 
--jsx-fragment=Fragment --platform=browser
+       pnpm exec esbuild --log-level=error 
--define:process.env.__VERSION__=\"${VERSION}\" 
--define:process.env.__GIT_HASH__=\"${GIT_HASH}\"  --bundle $1 --outdir=dist 
--target=es6 --loader:.svg=dataurl --format=iife --sourcemap --jsx-factory=h 
--jsx-fragment=Fragment --platform=browser --minify
 }
 
-function bundle() {
+function bundle_html() {
        cat html/$1.html \
          | sed -e '/ANASTASIS_SCRIPT_CONTENT/ {' -e 'r dist/main.js' -e 'd' -e 
'}' \
          | sed -e '/ANASTASIS_STYLE_CONTENT/ {' -e 'r dist/main.css' -e 'd' -e 
'}' \
@@ -27,12 +30,13 @@ function bundle() {
 function cleanup {
  trap - SIGHUP SIGINT SIGTERM SIGQUIT
  echo -n "Cleaning up... "
+ wait
  kill -- -$$
  exit 1
 }
 trap cleanup SIGHUP SIGINT SIGTERM SIGQUIT
 
-
+set -e
 echo compile
 build_css &
 build_js src/main.ts &
@@ -45,9 +49,8 @@ wait -n
 pnpm run --silent test -- -R dot
 
 echo html
-bundle ui
-bundle ui-dev
-
+bundle_html ui
+bundle_html ui-dev
 
 if [ "WATCH" == "$1" ]; then
 
diff --git a/packages/anastasis-webui/package.json 
b/packages/anastasis-webui/package.json
index 949440bc..df50a8a8 100644
--- a/packages/anastasis-webui/package.json
+++ b/packages/anastasis-webui/package.json
@@ -1,7 +1,7 @@
 {
   "private": true,
   "name": "@gnu-taler/anastasis-webui",
-  "version": "0.0.2",
+  "version": "0.2.99",
   "license": "MIT",
   "scripts": {
     "build": "./clean_and_build.sh",
@@ -49,4 +49,4 @@
     "typescript": "^4.5.4",
     "ws": "7.4.5"
   }
-}
\ No newline at end of file
+}
diff --git a/packages/anastasis-webui/src/components/menu/NavigationBar.tsx 
b/packages/anastasis-webui/src/components/menu/NavigationBar.tsx
index ca5191da..42b7a23e 100644
--- a/packages/anastasis-webui/src/components/menu/NavigationBar.tsx
+++ b/packages/anastasis-webui/src/components/menu/NavigationBar.tsx
@@ -49,14 +49,14 @@ export function NavigationBar({ onMobileMenu, title }: 
Props): VNode {
         >
           Report a bug
         </a>
-        <a
+        {/* <a
           style={{
             alignSelf: "center",
             padding: "0.5em",
           }}
         >
           Settings
-        </a>
+        </a> */}
         {/* <a
           role="button"
           class="navbar-burger"
diff --git a/packages/anastasis-webui/src/components/menu/SideBar.tsx 
b/packages/anastasis-webui/src/components/menu/SideBar.tsx
index 45d447d3..7cc65a62 100644
--- a/packages/anastasis-webui/src/components/menu/SideBar.tsx
+++ b/packages/anastasis-webui/src/components/menu/SideBar.tsx
@@ -28,6 +28,10 @@ interface Props {
   mobile?: boolean;
 }
 
+const VERSION: string = process.env.__VERSION__ || "dev";
+const GIT_HASH: string | undefined = process.env.__GIT_HASH__;
+const VERSION_WITH_HASH = GIT_HASH ? `${VERSION}-${GIT_HASH}` : VERSION;
+
 export function Sidebar({ mobile }: Props): VNode {
   // const config = useConfigContext();
   const config = { version: "none" };
@@ -57,7 +61,7 @@ export function Sidebar({ mobile }: Props): VNode {
             class="is-size-7 has-text-right"
             style={{ lineHeight: 0, marginTop: -10 }}
           >
-            Version {process.env.__VERSION__} ({config.version})
+            Version {VERSION_WITH_HASH}
           </div>
         </div>
       </div>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]