aboutsummaryrefslogtreecommitdiff
path: root/packages/challenger-ui
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-11-14 00:14:27 -0300
committerSebastian <sebasjm@gmail.com>2023-11-14 00:14:27 -0300
commitfeddec9b5493d01cdfd07f6aa8073cb14cb1a0ab (patch)
treef4f7c4a3f1e5383abcef07ce85ad08017233efbc /packages/challenger-ui
parentcd87d4c0b78525d428b10011446b6f510f9f6736 (diff)
downloadwallet-core-feddec9b5493d01cdfd07f6aa8073cb14cb1a0ab.tar.xz
build challenger
Diffstat (limited to 'packages/challenger-ui')
-rwxr-xr-xpackages/challenger-ui/build.mjs40
-rwxr-xr-xpackages/challenger-ui/create_must.sh15
-rw-r--r--packages/challenger-ui/package.json4
3 files changed, 57 insertions, 2 deletions
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
+}