gnunet-svn
[Top][All Lists]
Advanced

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

[taler-wallet-core] 02/02: build challenger


From: gnunet
Subject: [taler-wallet-core] 02/02: build challenger
Date: Tue, 14 Nov 2023 11:12:12 +0100

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

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

commit feddec9b5493d01cdfd07f6aa8073cb14cb1a0ab
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Nov 14 00:14:27 2023 -0300

    build challenger
---
 Makefile                                 |  6 +++++
 contrib/copy-challenger-into-prebuilt.sh | 10 ++++++++
 packages/challenger-ui/build.mjs         | 40 ++++++++++++++++++++++++++++++++
 packages/challenger-ui/create_must.sh    | 15 ++++++++++++
 packages/challenger-ui/package.json      |  4 ++--
 5 files changed, 73 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index e4a7abb54..3357747b9 100644
--- a/Makefile
+++ b/Makefile
@@ -60,6 +60,12 @@ aml-backoffice-prebuilt:
        pnpm run --filter @gnu-taler/aml-backoffice-ui... build
        ./contrib/copy-aml-backoffice-into-prebuilt.sh
 
+.PHONY: challenger-prebuilt
+challenger-prebuilt:
+       pnpm install --frozen-lockfile --filter @gnu-taler/challenger-ui...
+       pnpm run --filter @gnu-taler/challenger-ui... build
+       ./contrib/copy-challenger-into-prebuilt.sh
+
 .PHONY: demobank-prebuilt
 demobank-prebuilt:
        pnpm install --frozen-lockfile --filter @gnu-taler/demobank-ui...
diff --git a/contrib/copy-challenger-into-prebuilt.sh 
b/contrib/copy-challenger-into-prebuilt.sh
new file mode 100755
index 000000000..ebc39192c
--- /dev/null
+++ b/contrib/copy-challenger-into-prebuilt.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+[ ! -d prebuilt ] && git worktree add -f prebuilt prebuilt && exit 1
+
+find packages/challenger-ui/dist/prod/ -type f -printf '%P\n' | sort > 
prebuilt/challenger/bof
+
+while IFS= read -r file; do
+  cp packages/challenger-ui/dist/prod/$file prebuilt/challenger/$file
+done < prebuilt/challenger/bof
+
diff --git a/packages/challenger-ui/build.mjs b/packages/challenger-ui/build.mjs
new file mode 100755
index 000000000..548afe2e4
--- /dev/null
+++ b/packages/challenger-ui/build.mjs
@@ -0,0 +1,40 @@
+#!/usr/bin/env node
+/*
+ This file is part of GNU Taler
+ (C) 2022 Taler Systems S.A.
+
+ GNU Taler is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
+import { build } from "@gnu-taler/web-util/build";
+
+await build({
+  type: "production",
+  source: {
+    js: ["src/main.js"],
+    assets: [{
+      base: "src",
+      files: [
+        "src/attempts-exhausted.html",
+        "src/enter-address-form.html",
+        "src/enter-tan-form.html",
+        "src/internal-error.html",
+        "src/invalid-pin.html",
+        "src/invalid-request.html",
+        "src/validation-unknown.html",
+      ]
+    }],
+  },
+  destination: "./dist/prod",
+  css: "postcss",
+});
+
diff --git a/packages/challenger-ui/create_must.sh 
b/packages/challenger-ui/create_must.sh
new file mode 100755
index 000000000..6a6c71719
--- /dev/null
+++ b/packages/challenger-ui/create_must.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+cd dist/prod
+for file in *.html; do
+
+  #remove the js reference used for dev
+  sed /main.js/d -i $file
+
+  #rename the extension to must template
+  mv $file ${file:0:-5}.must
+done
+
+#delete unsued files
+rm main.js main.js.map main.css.map
+
diff --git a/packages/challenger-ui/package.json 
b/packages/challenger-ui/package.json
index bfac108a7..e797b12db 100644
--- a/packages/challenger-ui/package.json
+++ b/packages/challenger-ui/package.json
@@ -7,7 +7,7 @@
   "description": "UI for GNU Challenger.",
   "type": "module",
   "scripts": {
-    "build": "./build.mjs",
+    "build": "./build.mjs && ./create_must.sh",
     "check": "tsc",
     "clean": "rm -rf dist lib",
     "i18n:extract": "pogen extract",
@@ -45,4 +45,4 @@
   "pogen": {
     "domain": "aml-backoffice"
   }
-}
\ No newline at end of file
+}

-- 
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]