From a4e65c462ab71244eff01d7d172866ab71709143 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 20 Dec 2021 01:38:20 -0300 Subject: [PATCH] split extension v2 & v3 --- contrib/build-fast-web.sh | 7 +++ .../clean_and_build.sh | 5 +- .../clean_and_build_fast.sh | 9 +++- .../{manifest.json => manifest-v2.json} | 12 +---- .../manifest-v3.json | 51 +++++++++++++++++++ packages/taler-wallet-webextension/pack.sh | 24 +++++++-- vendor | 2 +- 7 files changed, 92 insertions(+), 18 deletions(-) rename packages/taler-wallet-webextension/{manifest.json => manifest-v2.json} (97%) create mode 100644 packages/taler-wallet-webextension/manifest-v3.json diff --git a/contrib/build-fast-web.sh b/contrib/build-fast-web.sh index ddc9f10f3..2f213e5f6 100755 --- a/contrib/build-fast-web.sh +++ b/contrib/build-fast-web.sh @@ -84,6 +84,12 @@ function build_preact_compat() { esbuild $BUNDLE_OPTIONS --loader:.js=jsx vendor/preact/test-utils/src/index.js > $DIST/react-dom/test-utils/index.js } +function build_qrcode() { + mkdir -p $DIST/qrcode-generator + + esbuild $BUNDLE_OPTIONS vendor/qrcode-generator/js/qrcode.js > $DIST/qrcode-generator/index.js +} + function build_history() { mkdir -p $DIST/{history,resolve-pathname,value-equal,tiny-warning,tiny-invariant} @@ -133,6 +139,7 @@ build_preact build_preact-router build_preact_compat +build_qrcode build_history build_linaria diff --git a/packages/taler-wallet-webextension/clean_and_build.sh b/packages/taler-wallet-webextension/clean_and_build.sh index fb8b31c7e..be20d80d9 100755 --- a/packages/taler-wallet-webextension/clean_and_build.sh +++ b/packages/taler-wallet-webextension/clean_and_build.sh @@ -2,5 +2,8 @@ # This file is in the public domain. [ "also-wallet" == "$1" ] && { pnpm -C ../taler-wallet-core/ compile || exit 1; } [ "also-util" == "$1" ] && { pnpm -C ../taler-util/ prepare || exit 1; } -pnpm clean && pnpm compile && rm -rf extension/ && ./pack.sh && (cd extension/ && unzip taler*.zip) +pnpm clean && pnpm compile && rm -rf extension/ && ./pack.sh +(cd extension/v2 && unzip taler*.zip) +(cd extension/v3 && unzip taler*.zip) + diff --git a/packages/taler-wallet-webextension/clean_and_build_fast.sh b/packages/taler-wallet-webextension/clean_and_build_fast.sh index 707070437..bac758c92 100755 --- a/packages/taler-wallet-webextension/clean_and_build_fast.sh +++ b/packages/taler-wallet-webextension/clean_and_build_fast.sh @@ -1,4 +1,11 @@ #!/usr/bin/env bash # This file is in the public domain. -rm -rf dist lib tsconfig.tsbuildinfo && (cd ../.. && rm -rf build/web && ./contrib/build-fast-web.sh) && rm -rf extension/ && ./pack.sh && (cd extension/ && unzip taler*.zip) +set -e + +rm -rf dist lib tsconfig.tsbuildinfo +(cd ../.. && rm -rf build/web && ./contrib/build-fast-web.sh) +rm -rf extension/ +./pack.sh +(cd extension/v2 && unzip taler*.zip) +(cd extension/v3 && unzip taler*.zip) diff --git a/packages/taler-wallet-webextension/manifest.json b/packages/taler-wallet-webextension/manifest-v2.json similarity index 97% rename from packages/taler-wallet-webextension/manifest.json rename to packages/taler-wallet-webextension/manifest-v2.json index 5746ef93c..91dd04cee 100644 --- a/packages/taler-wallet-webextension/manifest.json +++ b/packages/taler-wallet-webextension/manifest-v2.json @@ -1,39 +1,32 @@ { "manifest_version": 2, - "name": "GNU Taler Wallet (git)", "description": "Privacy preserving and transparent payments", "author": "GNU Taler Developers", "version": "0.8.1.15", "version_name": "0.8.1-dev.15", - "minimum_chrome_version": "51", "minimum_opera_version": "36", - "applications": { "gecko": { "id": "wallet@taler.net", "strict_min_version": "57.0" } }, - "icons": { "32": "static/img/icon.png", "128": "static/img/logo.png" }, - "permissions": [ - "storage", + "unlimitedStorage", "activeTab" ], - "optional_permissions": [ "webRequest", "webRequestBlocking", "http://*/*", "https://*/*" ], - "browser_action": { "default_icon": { "32": "static/img/icon.png" @@ -41,9 +34,8 @@ "default_title": "Taler", "default_popup": "static/popup.html" }, - "background": { "page": "static/background.html", "persistent": true } -} +} \ No newline at end of file diff --git a/packages/taler-wallet-webextension/manifest-v3.json b/packages/taler-wallet-webextension/manifest-v3.json new file mode 100644 index 000000000..b7f7c9026 --- /dev/null +++ b/packages/taler-wallet-webextension/manifest-v3.json @@ -0,0 +1,51 @@ +{ + "manifest_version": 3, + + "name": "GNU Taler Wallet (git)", + "description": "Privacy preserving and transparent payments", + "author": "GNU Taler Developers", + "version": "0.8.1.15", + "version_name": "0.8.1-dev.15", + + "minimum_chrome_version": "88", + + "applications": { + "gecko": { + "id": "wallet@taler.net", + "strict_min_version": "57.0" + } + }, + + "icons": { + "32": "static/img/icon.png", + "128": "static/img/logo.png" + }, + + "permissions": [ + "unlimitedStorage", + "activeTab" + ], + + "optional_permissions": [ + "webRequest", + "webRequestBlocking" + ], + + "host_permissions":[ + "http://*/*", + "https://*/*" + ], + + "action": { + "default_icon": { + "32": "static/img/icon.png" + }, + "default_title": "Taler", + "default_popup": "static/popup.html" + }, + + "background": { + "page": "static/background.html", + "persistent": true + } +} diff --git a/packages/taler-wallet-webextension/pack.sh b/packages/taler-wallet-webextension/pack.sh index e762ab867..e96c5d673 100755 --- a/packages/taler-wallet-webextension/pack.sh +++ b/packages/taler-wallet-webextension/pack.sh @@ -8,15 +8,29 @@ if [[ ! -e package.json ]]; then exit 1 fi -vers_manifest=$(jq -r '.version' manifest.json) +vers_manifest=$(jq -r '.version' manifest-v2.json) zipfile="taler-wallet-webextension-${vers_manifest}.zip" TEMP_DIR=$(mktemp -d) -jq '. | .name = "GNU Taler Wallet" ' manifest.json > $TEMP_DIR/manifest.json +jq '. | .name = "GNU Taler Wallet" ' manifest-v2.json > $TEMP_DIR/manifest.json cp -r dist static $TEMP_DIR (cd $TEMP_DIR && zip -r "$zipfile" dist static manifest.json) -mkdir -p extension -mv "$TEMP_DIR/$zipfile" ./extension/ +mkdir -p extension/v2 +mv "$TEMP_DIR/$zipfile" ./extension/v2/ rm -rf $TEMP_DIR -echo "Packed webextension: extension/$zipfile" +echo "Packed webextension: extension/v2/$zipfile" + + +vers_manifest=$(jq -r '.version' manifest-v3.json) + +zipfile="taler-wallet-webextension-${vers_manifest}.zip" + +TEMP_DIR=$(mktemp -d) +jq '. | .name = "GNU Taler Wallet" ' manifest-v3.json > $TEMP_DIR/manifest.json +cp -r dist static $TEMP_DIR +(cd $TEMP_DIR && zip -r "$zipfile" dist static manifest.json) +mkdir -p extension/v3 +mv "$TEMP_DIR/$zipfile" ./extension/v3/ +rm -rf $TEMP_DIR +echo "Packed webextension: extension/v3/$zipfile" diff --git a/vendor b/vendor index 38acabfa6..8b5f75904 160000 --- a/vendor +++ b/vendor @@ -1 +1 @@ -Subproject commit 38acabfa6089ab8ac469c12b5f55022fb96935e5 +Subproject commit 8b5f7590449f68a529e56caec647d55d119799d6