From d0fac9195f098cb53889f97d7e574e3ff5988cdf Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Sun, 31 Mar 2024 15:51:50 -0700 Subject: [PATCH 1/6] feat: chrome extension support --- .typos.toml | 2 ++ bun.lockb | Bin 0 -> 32339 bytes index.html | 20 ++++++------- manifest.json | 78 ++++++++++++++++++++++++-------------------------- post_build.sh | 12 ++++++-- 5 files changed, 58 insertions(+), 54 deletions(-) create mode 100644 .typos.toml create mode 100755 bun.lockb diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..dfb2ddd --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[files] +extend-exclude = ["bun.lockb"] diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..4f3efa9c2bda029f5baae6c46f4a297e53bae7d6 GIT binary patch literal 32339 zcmeIb2|QKZ_dkB=mQqQjBq=nZt~pUOAQ_4>6p5!B7nkc^?og;SDGJT=pjm^bK_!}% zG!L32QE5(SQjzGt*130cs^_`%`TV~B-}m+UwR>&*oW1vYueH}+d!N1cJ+0GI$4DX) z8cpW%jX3-%+LI-GWr!@EARsJ=%j2+u1j2B(m^H;%S&_kDOpO+FW1ePy;f%H%r7rT? zbjiD|Rx=;pFH0s_MaQ0v8lE!)DnS@0O&BeIN@vOLW4&Y-^+^Y~YRzEG5=jDtY!QdC zOM$^qgZl`skS*qj7~wI}s_`HO))R+t_}rjqhCp^718G~xUk!BaAr0mUCL@J5lfh7h zdjUUygZEQ~?1+eH216b4TS0#3<_tzVNMj&XhLi`X3Zz_q2uH{ji@5wC9yd5d+y?3+ z-$j6rbW+@4gfJ2AQSXQ08rz#HtG5ACtXB!jLcGaB zb^vq>BMg*_`RR}%UNcZWmWOi1Tp(d^MJ%c-vLGMpB|skH&V&@}g>!_#98(5^n92MxHa=xwmg8Y5my`7a~9`sPX8o-JU8lPOz)yH*2?v>Jv*uO?aUOZsC zc1;vp`P_#4*ZWSNQqx26iT~J&iU^<670ow1EZ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?|JP9^|VQUPk~5_=`Ou-QUS!)^K)-MD+)ml%S1`3i7f9P?Ad+6Y#bKN(h4$ zmOgAD9FW18iyR5a@jKN_=~s!ViMcWE_#nkk7Xux+1n#nPGdcWz6bz_;%%E(D%z`LB z%rYG6*hJo3C~Im%UBLY%51<==;F8}^0DxRVvl{P6c&7zPgu&F4pfTnBe1r|8^~c!& z(72et9<&1lb>I&BcX%-eO#n}#SfVMxtU$JyjT`qNHq_=od-`;3>R=N#3UJ&R5yCb! ak<($nzyPOT^1xutrCg;y6#Vb|`~LyV9b7a3 literal 0 HcmV?d00001 diff --git a/index.html b/index.html index a2b9626..3817995 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,13 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/manifest.json b/manifest.json index acf7076..7082d3c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,46 +1,42 @@ { - "name": "Webimint Fedimint Client", - "short_name": "Webimint", - "start_url": "/", - "display": "standalone", - "background_color": "#ffffff", - "theme_color": "#ffffff", - "icons": [ - { - "src": "\/assets\/icons\/android-icon-36x36.png", - "sizes": "36x36", - "type": "image\/png", - "density": "0.75" + "manifest_version": 3, + "__chrome__manifest_version": 3, + "name": "Webimint Fedimint Client", + "short_name": "Webimint", + "version": "0.1.0", + "description": "Webimint is an experimental Fedimint wallet using the Leptos web framework.", + "action": { + "default_popup": "index.html", + "default_icon": { + "48": "/assets/icons/android-icon-48x48.png", + "96": "/assets/icons/android-icon-96x96.png", + "192": "/assets/icons/android-icon-192x192.png" + } }, - { - "src": "\/assets\/icons\/android-icon-48x48.png", - "sizes": "48x48", - "type": "image\/png", - "density": "1.0" + "background": { + "service_worker": "service-worker.js" }, - { - "src": "\/assets\/icons\/android-icon-72x72.png", - "sizes": "72x72", - "type": "image\/png", - "density": "1.5" + "permissions": ["storage", "activeTab"], + "content_scripts": [ + { + "matches": [""], + "js": ["webimint-{{buildVersion}}.js"] + } + ], + "__chrome__host_permissions": ["*://*/*"], + "content_security_policy": { + "extension_pages": "script-src 'self' 'wasm-unsafe-eval'; object-src 'self';" }, - { - "src": "\/assets\/icons\/android-icon-96x96.png", - "sizes": "96x96", - "type": "image\/png", - "density": "2.0" - }, - { - "src": "\/assets\/icons\/android-icon-144x144.png", - "sizes": "144x144", - "type": "image\/png", - "density": "3.0" - }, - { - "src": "\/assets\/icons\/android-icon-192x192.png", - "sizes": "192x192", - "type": "image\/png", - "density": "4.0" + "start_url": "/", + "display": "standalone", + "background_color": "#ffffff", + "theme_color": "#ffffff", + "icons": { + "36": "/assets/icons/android-icon-36x36.png", + "48": "/assets/icons/android-icon-48x48.png", + "72": "/assets/icons/android-icon-72x72.png", + "96": "/assets/icons/android-icon-96x96.png", + "144": "/assets/icons/android-icon-144x144.png", + "192": "/assets/icons/android-icon-192x192.png" } - ] -} \ No newline at end of file +} diff --git a/post_build.sh b/post_build.sh index 724fde7..32d8a98 100755 --- a/post_build.sh +++ b/post_build.sh @@ -24,15 +24,21 @@ echo "Build-Version is: ${buildVersion}" # Replace placeholder in service-worker.js serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{buildVersion}} placeholder in: ${serviceWorkerJsFile}" -sed "s/{{buildVersion}}/${buildVersion}/g" "${serviceWorkerJsFile}" > "${serviceWorkerJsFile}.modified" +sed "s/{{buildVersion}}/${buildVersion}/g" "${serviceWorkerJsFile}" >"${serviceWorkerJsFile}.modified" mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" # Replace placeholder in index.html indexHtmlFile=$(find ./dist/.stage -iname "index.html") echo "Replacing {{buildVersion}} placeholder in: ${indexHtmlFile}" -sed "s/{{buildVersion}}/${buildVersion}/g" "${indexHtmlFile}" > "${indexHtmlFile}.modified" +sed "s/{{buildVersion}}/${buildVersion}/g" "${indexHtmlFile}" >"${indexHtmlFile}.modified" mv -f "${indexHtmlFile}.modified" "${indexHtmlFile}" +# Replace placeholder in manifest.json +manifestJsonFile=$(find ./dist/.stage -iname "manifest.json") +echo "Replacing {{buildVersion}} placeholder in: ${manifestJsonFile}" +sed "s/{{buildVersion}}/${buildVersion}/g" "${manifestJsonFile}" >"${manifestJsonFile}.modified" +mv -f "${manifestJsonFile}.modified" "${manifestJsonFile}" + # Extract CSS build version indexJsFile=$(find ./dist/.stage -iname "${stylePrefix}-*.${styleFormat}") echo "Extracting style build version from file: ${indexJsFile}" @@ -52,5 +58,5 @@ echo "CSS Build-Version is: ${cssBuildVersion}" # Replace placeholder in service-worker.js serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{cssBuildVersion}} placeholder in: ${serviceWorkerJsFile}" -sed "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" > "${serviceWorkerJsFile}.modified" +sed "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" >"${serviceWorkerJsFile}.modified" mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" From 524c9c1821b5e81ea0dbc5a7929a83a2eef7e1f0 Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Sun, 31 Mar 2024 20:30:11 -0700 Subject: [PATCH 2/6] fix: move inline script into separate initWebimint.js --- post_build.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/post_build.sh b/post_build.sh index 32d8a98..b6b3b82 100755 --- a/post_build.sh +++ b/post_build.sh @@ -60,3 +60,10 @@ serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{cssBuildVersion}} placeholder in: ${serviceWorkerJsFile}" sed "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" >"${serviceWorkerJsFile}.modified" mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" + +### Required for chrome extension, no inline scripting +echo "Extracting script content from index.html and creating initWebimint.js" +scriptContent=$(grep -oP '(?<=)' "${indexHtmlFile}") +echo "${scriptContent}" >./dist/.stage/initWebimint.js +echo "Replacing original script tag in index.html with reference to initWebimint.js" +sed -i 's|||' "${indexHtmlFile}" From 7db33087bef49c390082d426a8d17a66e8d3aeee Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Sun, 31 Mar 2024 20:36:31 -0700 Subject: [PATCH 3/6] fix: min width of app --- src/components/app.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/app.rs b/src/components/app.rs index f158624..5055e02 100644 --- a/src/components/app.rs +++ b/src/components/app.rs @@ -71,7 +71,7 @@ pub fn App() -> impl IntoView {
-
+
From b925aaf1d995dec2a2d47340d9da4785c588b920 Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Mon, 1 Apr 2024 10:45:51 -0700 Subject: [PATCH 4/6] fix: use sed not grep + -euo --- post_build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post_build.sh b/post_build.sh index b6b3b82..9ad0b81 100755 --- a/post_build.sh +++ b/post_build.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -e +set -euo pipefail appName="webimint" stylePrefix="index" @@ -63,7 +63,7 @@ mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" ### Required for chrome extension, no inline scripting echo "Extracting script content from index.html and creating initWebimint.js" -scriptContent=$(grep -oP '(?<=)' "${indexHtmlFile}") +scriptContent=$(sed -n 's|.*.*|\1|p' "${indexHtmlFile}") echo "${scriptContent}" >./dist/.stage/initWebimint.js echo "Replacing original script tag in index.html with reference to initWebimint.js" sed -i 's|||' "${indexHtmlFile}" From e9c422e4396292a9a396d3293c315812cceb0d20 Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Mon, 1 Apr 2024 10:49:06 -0700 Subject: [PATCH 5/6] fix: sed -i --- post_build.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/post_build.sh b/post_build.sh index 9ad0b81..6c81b56 100755 --- a/post_build.sh +++ b/post_build.sh @@ -24,20 +24,17 @@ echo "Build-Version is: ${buildVersion}" # Replace placeholder in service-worker.js serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{buildVersion}} placeholder in: ${serviceWorkerJsFile}" -sed "s/{{buildVersion}}/${buildVersion}/g" "${serviceWorkerJsFile}" >"${serviceWorkerJsFile}.modified" -mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" +sed -i "s/{{buildVersion}}/${buildVersion}/g" "${serviceWorkerJsFile}" # Replace placeholder in index.html indexHtmlFile=$(find ./dist/.stage -iname "index.html") echo "Replacing {{buildVersion}} placeholder in: ${indexHtmlFile}" -sed "s/{{buildVersion}}/${buildVersion}/g" "${indexHtmlFile}" >"${indexHtmlFile}.modified" -mv -f "${indexHtmlFile}.modified" "${indexHtmlFile}" +sed -i "s/{{buildVersion}}/${buildVersion}/g" "${indexHtmlFile}" # Replace placeholder in manifest.json manifestJsonFile=$(find ./dist/.stage -iname "manifest.json") echo "Replacing {{buildVersion}} placeholder in: ${manifestJsonFile}" -sed "s/{{buildVersion}}/${buildVersion}/g" "${manifestJsonFile}" >"${manifestJsonFile}.modified" -mv -f "${manifestJsonFile}.modified" "${manifestJsonFile}" +sed -i "s/{{buildVersion}}/${buildVersion}/g" "${manifestJsonFile}" # Extract CSS build version indexJsFile=$(find ./dist/.stage -iname "${stylePrefix}-*.${styleFormat}") @@ -58,8 +55,7 @@ echo "CSS Build-Version is: ${cssBuildVersion}" # Replace placeholder in service-worker.js serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{cssBuildVersion}} placeholder in: ${serviceWorkerJsFile}" -sed "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" >"${serviceWorkerJsFile}.modified" -mv -f "${serviceWorkerJsFile}.modified" "${serviceWorkerJsFile}" +sed -i "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" ### Required for chrome extension, no inline scripting echo "Extracting script content from index.html and creating initWebimint.js" From df3307b2982da5b2a6589d5013d98b2b0603ddbf Mon Sep 17 00:00:00 2001 From: "kody.low" Date: Mon, 1 Apr 2024 19:08:15 -0700 Subject: [PATCH 6/6] fix: post_build handling for trunk serve --- post_build.sh | 65 +++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/post_build.sh b/post_build.sh index 6c81b56..c7300ef 100755 --- a/post_build.sh +++ b/post_build.sh @@ -57,9 +57,66 @@ serviceWorkerJsFile=$(find ./dist/.stage -iname "service-worker.js") echo "Replacing {{cssBuildVersion}} placeholder in: ${serviceWorkerJsFile}" sed -i "s/{{cssBuildVersion}}/${cssBuildVersion}/g" "${serviceWorkerJsFile}" -### Required for chrome extension, no inline scripting +# ### Required for chrome extension, no inline scripting echo "Extracting script content from index.html and creating initWebimint.js" scriptContent=$(sed -n 's|.*.*|\1|p' "${indexHtmlFile}") -echo "${scriptContent}" >./dist/.stage/initWebimint.js -echo "Replacing original script tag in index.html with reference to initWebimint.js" -sed -i 's|||' "${indexHtmlFile}" +if [ -n "${scriptContent}" ]; then + echo "${scriptContent}" >./dist/.stage/initWebimint.js + echo "Replacing original script tag in index.html with reference to initWebimint.js" + sed -i 's|||' "${indexHtmlFile}" +else # using trunk serve, multiline script tags, have to extract line by line + echo "Using trunk serve, multiline script tags, have to extract line by line" + echo "Extracting script content from index.html and creating separate .js files" + # Directory where the new JS files will be stored + JS_DIR="./dist/.stage/js" + mkdir -p "$JS_DIR" + # Counter to name the extracted JS files uniquely + COUNTER=1 + # Temporary file to hold the modified HTML content + TMP_HTML=$(mktemp) + # Initialize SCRIPT_OPEN to 0 before the loop + SCRIPT_OPEN=0 + # Read the index.html file line by line + while IFS= read -r line || [[ -n "$line" ]]; do + if [[ $line =~ \\ ]]; then + # Inline script tag with no content, just copy the line + echo "$line" >>"$TMP_HTML" + elif [[ $line =~ \(.*) ]]; then + # Opening script tag with potential inline content + SCRIPT_OPEN=1 + # Capture any content on the same line as the opening script tag + SCRIPT_CONTENT="${BASH_REMATCH[1]}" + if [[ $SCRIPT_CONTENT ]]; then + # If there's inline content right after the script tag, add a newline to start accumulating correctly + SCRIPT_CONTENT+=$'\n' + fi + elif [[ $line =~ \ ]]; then + # Closing script tag, write content to a new JS file + SCRIPT_FILE="$JS_DIR/extracted_$COUNTER.js" + echo "$SCRIPT_CONTENT" >"$SCRIPT_FILE" + # Replace the script tag in HTML with a reference to the new JS file + echo "" >>"$TMP_HTML" + COUNTER=$((COUNTER + 1)) + SCRIPT_OPEN=0 + SCRIPT_CONTENT="" # Reset SCRIPT_CONTENT for the next script + elif [[ $SCRIPT_OPEN -eq 1 ]]; then + # Inside a script tag, accumulate the content + SCRIPT_CONTENT+="$line"$'\n' + else + # Outside script tags, just copy the line + echo "$line" >>"$TMP_HTML" + fi + done <"${indexHtmlFile}" + # Replace the original HTML file with the modified one + mv "$TMP_HTML" "${indexHtmlFile}" + # Clean up + rm -f "$TMP_HTML" + # Replace placeholder trunk address in JavaScript files + echo "Replacing {{__TRUNK_ADDRESS__}} placeholder in extracted JavaScript files" + jsFiles=$(find ./dist/.stage/js -iname "*.js") + TRUNK_ADDRESS=127.0.0.1:8080 + for file in $jsFiles; do + sed -i "s/{{__TRUNK_ADDRESS__}}/${TRUNK_ADDRESS}/g" "$file" + echo "Replaced in: $file" + done +fi