From 17164dfe85a112b9ed6573772215f151fedacb80 Mon Sep 17 00:00:00 2001
From: neil
Date: Wed, 9 Nov 2022 20:16:24 +0800
Subject: [PATCH 01/62] #184 fuzzy filter on packages
---
src/layouts/partials/package-grid.html | 83 +++++++++++++++++++--
src/layouts/partials/package-thumbnail.html | 2 +-
2 files changed, 79 insertions(+), 6 deletions(-)
diff --git a/src/layouts/partials/package-grid.html b/src/layouts/partials/package-grid.html
index decb6a2..8503904 100644
--- a/src/layouts/partials/package-grid.html
+++ b/src/layouts/partials/package-grid.html
@@ -5,9 +5,12 @@
@@ -89,7 +92,29 @@
border: 0px;
overflow: hidden;
}
+
+ #searchBar {
+ display: flex;
+ }
+ #searchBar .sorting-container {
+ min-width: 260px;
+ }
+ #searchBar input {
+ min-width: 260px;
+ height: 60px;
+ padding: 5px 10px;
+ background-color: #1a1a1a !important;
+ color: #949494;
+ outline: none;
+ border: 2px solid #949494;
+ border-radius: 0px;
+ }
+ #searchBar input::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
+ color: white;
+ opacity: 1; /* Firefox */
+ }
+
+
-
+
@@ -146,19 +145,6 @@ integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+
rdt('track', 'ViewContent');
-
-
+
\ No newline at end of file
From d5fb13f09fa696969e866aedd93d7e10a959b3d9 Mon Sep 17 00:00:00 2001
From: Jacob Heider
Date: Fri, 11 Nov 2022 17:01:23 -0500
Subject: [PATCH 09/62] +linkableWhitePapers
---
src/layouts/page/white-paper.html | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/layouts/page/white-paper.html b/src/layouts/page/white-paper.html
index 213b5c0..daec87e 100644
--- a/src/layouts/page/white-paper.html
+++ b/src/layouts/page/white-paper.html
@@ -97,23 +97,21 @@
}
const adobeDCView = getAdobeDcView();
- adobeDCView.previewFile({
- content:{
- location: {
- url: getWhitePaperUrl(),
- }
- },
- metaData:{
- fileName: "tea.white-paper.pdf"
- }
- }, { embedMode: "IN_LINE" });
+ const hash = window.location.hash.replace(/^#/, '_')
+ const suffix = versions.find(v => v[1] === hash) || ''
+ viewWhitepaper(suffix)
} catch (error) {
console.error('test:', error);
}
});
-
function viewWhitepaper(suffix) {
+ if (suffix.length) {
+ window.location.hash = '#' + suffix.substr(1)
+ } else{
+ // https://stackoverflow.com/questions/1397329/how-to-remove-the-hash-from-window-location-url-with-javascript-without-page-r/5298684#5298684
+ history.pushState("", document.title, window.location.pathname + window.location.search)
+ }
const adobeDCView = getAdobeDcView();
const url = getWhitePaperUrl(suffix);
adobeDCView.previewFile({
From b9e3576eb671ac3d725710e247612e391ccd0cc9 Mon Sep 17 00:00:00 2001
From: neil
Date: Mon, 14 Nov 2022 19:50:04 +0800
Subject: [PATCH 10/62] #190 package details page path should be /+full_name/
---
.github/build-package-pages.sh | 13 ++++++++++---
.gitignore | 4 +++-
README.md | 5 +++--
src/content/packages/_sample.md | 15 ---------------
src/layouts/partials/package-thumbnail.html | 4 ++--
5 files changed, 18 insertions(+), 23 deletions(-)
delete mode 100644 src/content/packages/_sample.md
diff --git a/.github/build-package-pages.sh b/.github/build-package-pages.sh
index 8be2bd4..8f94f8e 100755
--- a/.github/build-package-pages.sh
+++ b/.github/build-package-pages.sh
@@ -1,12 +1,19 @@
#!/bin/bash
# cmd: $ ./build-package-pages.sh srcJson targetPath
-# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/packages'
+# sample: $ .github/build-package-pages.sh src/data/packages.json src/content/'
for row in $(jq -r '.[] | @base64' < "$1"); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
- touch "$2"/"$(_jq '.slug')".md
+ full_name=$(_jq '.full_name')
+
+ if [[ "$full_name" == *\/* ]] || [[ "$full_name" == *\\* ]]
+ then
+ mkdir -p "$2/+$full_name"
+ rm -rf "$2/+$full_name"
+ fi
+ touch "$2"/"+$(_jq '.full_name')".md
content="---
type: page
title: \"$(_jq '.name')\"
@@ -14,5 +21,5 @@ maintainer: \"$(_jq '.maintainer')\"
Description: \"$(_jq '.desc' | tr '\"' "'")\"
layout: \"package-detail\"
---"
- echo "$content" > "$2"/"$(_jq '.slug')".md
+ echo "$content" > "$2"/"+$(_jq '.full_name')".md
done
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index a142cf4..79a2bcb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -27,4 +27,6 @@ cdk.out
# initially committed _sample.md only the rest will be ignored
src/content/packages/*
-src/static/Images/packages/*
\ No newline at end of file
+src/static/Images/packages/*
+
+src/content/+*
\ No newline at end of file
diff --git a/README.md b/README.md
index 80eed6b..7d22d9d 100644
--- a/README.md
+++ b/README.md
@@ -29,10 +29,11 @@ The detail pages of each package are not committed to the repository for the
simple reason of that would be too much repeating data.
Execute the following command just once per version of
`/src/data/packages.json`. This will create the package detail pages in
-`/src/content/packages/[package_slug].md`.
+`/src/content/+[package.full_name].md`.
+Which resembles the installation tag in tea cli
```sh
-.github/build-package-pages.sh src/data/packages.json src/content/packages
+.github/build-package-pages.sh src/data/packages.json src/content
```
diff --git a/src/content/packages/_sample.md b/src/content/packages/_sample.md
deleted file mode 100644
index 4695330..0000000
--- a/src/content/packages/_sample.md
+++ /dev/null
@@ -1,15 +0,0 @@
-
----
-type: page
-title: "mpdecimal"
-Description: "mpdecimal"
-layout: "package-detail"
----
-
diff --git a/src/layouts/partials/package-thumbnail.html b/src/layouts/partials/package-thumbnail.html
index 263f7bc..d40a6b3 100644
--- a/src/layouts/partials/package-thumbnail.html
+++ b/src/layouts/partials/package-thumbnail.html
@@ -19,12 +19,12 @@
>{{- .installs -}} installs -->
-
+
{{- partial "detail-btn.html" . -}}
From 9f2f479eb7935fd65ed70b98065bf2427034c474 Mon Sep 17 00:00:00 2001
From: neil
Date: Mon, 14 Nov 2022 19:55:33 +0800
Subject: [PATCH 11/62] #190 apply correct dir to create pages
---
.github/workflows/cd.yml | 2 +-
.github/workflows/staging.yml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index 9f74149..700ceff 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -37,7 +37,7 @@ jobs:
uses: getneil/jq-action@v1
id: version
with:
- cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages'
+ cmd: '.github/build-package-pages.sh src/data/packages.json src/content'
- name: Download package thumbnails from Airtable
uses: getneil/jq-action@v1
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 1da2b30..01cc9f5 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -45,7 +45,7 @@ jobs:
- name: Create Package Detail Pages from packages.json
uses: getneil/jq-action@v1
with:
- cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages'
+ cmd: '.github/build-package-pages.sh src/data/packages.json src/content'
- name: Download package thumbnails from Airtable
uses: getneil/jq-action@v1
From 1dedd671d7e5e9a3504572bcfa9f5f2d46ef961d Mon Sep 17 00:00:00 2001
From: neil
Date: Tue, 15 Nov 2022 10:23:07 +0800
Subject: [PATCH 12/62] #190 add a package list page at '/+/'
---
src/content/+.md | 5 ++++
src/layouts/page/packages.html | 33 ++++++++++++++++++++++++++
src/layouts/partials/package-grid.html | 11 +++++++--
3 files changed, 47 insertions(+), 2 deletions(-)
create mode 100644 src/content/+.md
create mode 100644 src/layouts/page/packages.html
diff --git a/src/content/+.md b/src/content/+.md
new file mode 100644
index 0000000..4403dec
--- /dev/null
+++ b/src/content/+.md
@@ -0,0 +1,5 @@
+---
+type: page
+title: "packages"
+layout: "packages"
+---
diff --git a/src/layouts/page/packages.html b/src/layouts/page/packages.html
new file mode 100644
index 0000000..83a0da0
--- /dev/null
+++ b/src/layouts/page/packages.html
@@ -0,0 +1,33 @@
+{{ define "main" }}
+
+
+
+
+
+
+
+
+ {{- partial "package-grid.html" . -}}
+
+
+
+
+
+ {{- partial "swiper.html" . -}}
+
+
+
+
+
+
+{{ end }}
diff --git a/src/layouts/partials/package-grid.html b/src/layouts/partials/package-grid.html
index 7c1cab6..913f6ff 100644
--- a/src/layouts/partials/package-grid.html
+++ b/src/layouts/partials/package-grid.html
@@ -39,7 +39,7 @@
}
.package-grid {
display: grid;
- grid-template-columns: auto auto;
+ grid-template-columns: auto;
}
#loadMorePackagesBtn {
cursor: pointer;
@@ -98,6 +98,8 @@
popularity: 'popularity',
last_modified: 'last_modified',
}
+ const showAllPackages = window.location.pathname.includes("/+/");
+
let sortBy = sortOptions.popularity; // last_modified
let sortDirection = 'desc'; // asc
let limit = 16;
@@ -186,7 +188,7 @@
const packages = getPackageThumbs();
let i = 0;
for(const sp of packages) {
- if (i >= limit) {
+ if (i >= limit && !showAllPackages) {
sp.classList.add('hidden');
} else {
sp.classList.remove('hidden');
@@ -204,6 +206,11 @@
}
const loadMoreButton = document.getElementById('loadMorePackagesBtn');
+ if (showAllPackages) {
+ loadMoreSection.classList.add('hidden');
+ } else {
+ loadMoreSection.classList.remove('hidden');
+ }
loadMoreButton.addEventListener('click',() => {
limit += 16;
refreshDisplayedPackages();
From f907b23acca15629c9d6d5f81e19904f6c2630d2 Mon Sep 17 00:00:00 2001
From: neil
Date: Fri, 18 Nov 2022 20:32:58 +0800
Subject: [PATCH 13/62] airtable has changed hosting pattern
---
.github/prepare-thumb-images.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/prepare-thumb-images.sh b/.github/prepare-thumb-images.sh
index 1a8d9c8..d9fdeba 100755
--- a/.github/prepare-thumb-images.sh
+++ b/.github/prepare-thumb-images.sh
@@ -13,7 +13,7 @@ for row in $($packages | jq -r '.[] | @base64'); do
}
dl_url=$(_jq '.thumb_image_url')
- if [[ $dl_url == *"https://dl.airtable.com/.attachments"* ]]; then
+ if [[ $dl_url == *"airtable"* ]]; then
filename=$(basename -- "$dl_url")
extension="${filename##*.}"
filename="${filename%.*}"
From a1f11758ae7493f1c60bacb373d0951cbf6542cf Mon Sep 17 00:00:00 2001
From: neil
Date: Fri, 18 Nov 2022 20:47:15 +0800
Subject: [PATCH 14/62] add default .jpg extension because at removed
extensions
---
.github/prepare-thumb-images.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/prepare-thumb-images.sh b/.github/prepare-thumb-images.sh
index d9fdeba..079c935 100755
--- a/.github/prepare-thumb-images.sh
+++ b/.github/prepare-thumb-images.sh
@@ -19,8 +19,8 @@ for row in $($packages | jq -r '.[] | @base64'); do
filename="${filename%.*}"
slug=$(_jq '.slug')
outputPath=$2/$(_jq '.slug').$extension
- new_thumb_image_url="https://tea.xyz/Images/packages/$slug.$extension"
- curl $dl_url -o ./packages_thumbs_images/$slug.$extension
+ new_thumb_image_url="https://tea.xyz/Images/packages/$slug.jpg"
+ curl $dl_url -o ./packages_thumbs_images/$slug.jpg
updated_packages=$(jq '(.[] | select(.slug == "'$slug'") | .thumb_image_url) |= "'$new_thumb_image_url'"' ./src/data/temp.json)
echo $updated_packages > $temp_packages
echo "update $slug"
From 0f1883a78cf66cc35cd4465d8e0e2367d0b56863 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 13:00:03 +0800
Subject: [PATCH 15/62] #195 rely completely in packages.json data for images
---
.github/prepare-thumb-images.sh | 31 -------------------------------
.github/workflows/cd.yml | 18 +-----------------
.github/workflows/staging.yml | 15 ---------------
3 files changed, 1 insertion(+), 63 deletions(-)
delete mode 100755 .github/prepare-thumb-images.sh
diff --git a/.github/prepare-thumb-images.sh b/.github/prepare-thumb-images.sh
deleted file mode 100755
index 079c935..0000000
--- a/.github/prepare-thumb-images.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# cmd: $ ./prepare-thumb-images.sh srcJson targetPath
-# sample: $ .github/prepare-thumb-images.sh src/data/packages.json src/static/Images/packages/
-
-# create packages folder: where airtable images will be DLd
-mkdir -p ./packages_thumbs_images
-packages="cat $1"
-temp_packages="./src/data/temp.json"
-cp $1 $temp_packages
-for row in $($packages | jq -r '.[] | @base64'); do
- _jq() {
- echo ${row} | base64 --decode | jq -r ${1}
- }
-
- dl_url=$(_jq '.thumb_image_url')
- if [[ $dl_url == *"airtable"* ]]; then
- filename=$(basename -- "$dl_url")
- extension="${filename##*.}"
- filename="${filename%.*}"
- slug=$(_jq '.slug')
- outputPath=$2/$(_jq '.slug').$extension
- new_thumb_image_url="https://tea.xyz/Images/packages/$slug.jpg"
- curl $dl_url -o ./packages_thumbs_images/$slug.jpg
- updated_packages=$(jq '(.[] | select(.slug == "'$slug'") | .thumb_image_url) |= "'$new_thumb_image_url'"' ./src/data/temp.json)
- echo $updated_packages > $temp_packages
- echo "update $slug"
- fi
-done
-
-# replace packages.json with the updated version with localized image links
-mv $temp_packages $1
\ No newline at end of file
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index 700ceff..2d7e93c 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -39,21 +39,6 @@ jobs:
with:
cmd: '.github/build-package-pages.sh src/data/packages.json src/content'
- - name: Download package thumbnails from Airtable
- uses: getneil/jq-action@v1
- with:
- cmd: '.github/prepare-thumb-images.sh src/data/packages.json'
-
- - name: Upload package thumbnails to AWS S3
- uses: jakejarvis/s3-sync-action@master
- env:
- AWS_S3_BUCKET: www.tea.xyz
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: 'us-east-1'
- SOURCE_DIR: 'packages_thumbs_images'
- DEST_DIR: 'Images/packages'
-
- run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
- uses: teaxyz/setup@v0
with:
@@ -75,8 +60,6 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
-
- - run: cp -R packages_thumbs_images public/Images/packages
# cache-control of 10 mins because we *need* to be able to update
# this and have people see the results can be fixed well with a static site builder
@@ -85,6 +68,7 @@ jobs:
--metadata-directive REPLACE \
--cache-control max-age=600 \
--exclude '.git/*' --exclude '.github/*' \
+ --exclude 'Images/packages/*' \
--exclude 'pour.sh' \
--exclude 'tea.white-paper*.pdf' \
--exclude '*.md' \
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 01cc9f5..62b5221 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -47,21 +47,6 @@ jobs:
with:
cmd: '.github/build-package-pages.sh src/data/packages.json src/content'
- - name: Download package thumbnails from Airtable
- uses: getneil/jq-action@v1
- with:
- cmd: '.github/prepare-thumb-images.sh src/data/packages.json'
-
- - name: Upload package thumbnails to AWS S3
- uses: jakejarvis/s3-sync-action@master
- env:
- AWS_S3_BUCKET: www.tea.xyz
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- AWS_REGION: 'us-east-1'
- SOURCE_DIR: 'packages_thumbs_images'
- DEST_DIR: 'Images/packages'
-
- run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
- uses: teaxyz/setup@v0
From b7f8ee5b2cafac86d4b8925ae5cd50b4a18c2c32 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 13:29:19 +0800
Subject: [PATCH 16/62] test env
---
.github/sync-thumb-images.sh | 31 +++++++++++++++++++++++++++++++
.github/workflows/staging.yml | 6 +++++-
2 files changed, 36 insertions(+), 1 deletion(-)
create mode 100755 .github/sync-thumb-images.sh
diff --git a/.github/sync-thumb-images.sh b/.github/sync-thumb-images.sh
new file mode 100755
index 0000000..079c935
--- /dev/null
+++ b/.github/sync-thumb-images.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+# cmd: $ ./prepare-thumb-images.sh srcJson targetPath
+# sample: $ .github/prepare-thumb-images.sh src/data/packages.json src/static/Images/packages/
+
+# create packages folder: where airtable images will be DLd
+mkdir -p ./packages_thumbs_images
+packages="cat $1"
+temp_packages="./src/data/temp.json"
+cp $1 $temp_packages
+for row in $($packages | jq -r '.[] | @base64'); do
+ _jq() {
+ echo ${row} | base64 --decode | jq -r ${1}
+ }
+
+ dl_url=$(_jq '.thumb_image_url')
+ if [[ $dl_url == *"airtable"* ]]; then
+ filename=$(basename -- "$dl_url")
+ extension="${filename##*.}"
+ filename="${filename%.*}"
+ slug=$(_jq '.slug')
+ outputPath=$2/$(_jq '.slug').$extension
+ new_thumb_image_url="https://tea.xyz/Images/packages/$slug.jpg"
+ curl $dl_url -o ./packages_thumbs_images/$slug.jpg
+ updated_packages=$(jq '(.[] | select(.slug == "'$slug'") | .thumb_image_url) |= "'$new_thumb_image_url'"' ./src/data/temp.json)
+ echo $updated_packages > $temp_packages
+ echo "update $slug"
+ fi
+done
+
+# replace packages.json with the updated version with localized image links
+mv $temp_packages $1
\ No newline at end of file
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 62b5221..591be00 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -61,6 +61,8 @@ jobs:
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+ # update packages json data and rebuild again
+ - run: echo "TeaXYZ-${STAGE}"
- uses: actions/setup-node@v3
with:
node-version: 14
@@ -78,7 +80,9 @@ jobs:
id: cdk_deploy
run: yarn deploy
working-directory: .cdk
-
+
+ # sync images from www.tea.xyz/Images/packages to wherever bucket you are
+ - run: echo "TeaXYZ-${STAGE}"
- name: Seal Deployment
uses: bobheadxi/deployments@v1
if: always()
From 6c2a28e207f421019dad36736c67429fe4ef61ef Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 13:48:37 +0800
Subject: [PATCH 17/62] sync images from www.tea.xyz/Images/packages to
pr-bucket/Images/packages
---
.github/sync-thumb-images.sh | 14 ++++++++------
.github/workflows/staging.yml | 16 +++++++++++++++-
2 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/.github/sync-thumb-images.sh b/.github/sync-thumb-images.sh
index 079c935..ddfb726 100755
--- a/.github/sync-thumb-images.sh
+++ b/.github/sync-thumb-images.sh
@@ -1,9 +1,12 @@
#!/bin/bash
+# update packages.json data with relative thumb image url path
+# rebuild pages
+# download images from www.tea.xyz/Images/packages to
+
# cmd: $ ./prepare-thumb-images.sh srcJson targetPath
# sample: $ .github/prepare-thumb-images.sh src/data/packages.json src/static/Images/packages/
# create packages folder: where airtable images will be DLd
-mkdir -p ./packages_thumbs_images
packages="cat $1"
temp_packages="./src/data/temp.json"
cp $1 $temp_packages
@@ -11,16 +14,15 @@ for row in $($packages | jq -r '.[] | @base64'); do
_jq() {
echo ${row} | base64 --decode | jq -r ${1}
}
-
dl_url=$(_jq '.thumb_image_url')
- if [[ $dl_url == *"airtable"* ]]; then
+ if [[ $dl_url == *"tea.xyz"* ]]; then
filename=$(basename -- "$dl_url")
extension="${filename##*.}"
filename="${filename%.*}"
slug=$(_jq '.slug')
- outputPath=$2/$(_jq '.slug').$extension
- new_thumb_image_url="https://tea.xyz/Images/packages/$slug.jpg"
- curl $dl_url -o ./packages_thumbs_images/$slug.jpg
+
+ new_thumb_image_url="/Images/packages/$filename.$extension"
+
updated_packages=$(jq '(.[] | select(.slug == "'$slug'") | .thumb_image_url) |= "'$new_thumb_image_url'"' ./src/data/temp.json)
echo $updated_packages > $temp_packages
echo "update $slug"
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 591be00..43c5f7a 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -62,6 +62,17 @@ jobs:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# update packages json data and rebuild again
+ - name: make images relative path to preview site
+ uses: getneil/jq-action@v1
+ with:
+ cmd: '.github/sync-thumb-images.sh src/data/packages.json'
+
+ # intentional to rebuild packages again with relative image data
+ # the first one to test it against prod resources via lychee
+ - uses: teaxyz/setup@v0
+ with:
+ target: build
+
- run: echo "TeaXYZ-${STAGE}"
- uses: actions/setup-node@v3
with:
@@ -82,7 +93,10 @@ jobs:
working-directory: .cdk
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
- - run: echo "TeaXYZ-${STAGE}"
+ - run: |
+ aws s3 sync s3://www.tea.xyz/Images/packages \
+ s3://TeaXYZ-${STAGE}/Images/packages
+
- name: Seal Deployment
uses: bobheadxi/deployments@v1
if: always()
From bd13c42be64c1c606912a30b5efd8525f10a718e Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 13:52:56 +0800
Subject: [PATCH 18/62] log cdk.out.json
---
.github/workflows/staging.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 43c5f7a..d063b9c 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -92,6 +92,8 @@ jobs:
run: yarn deploy
working-directory: .cdk
+ - run: cat .cdk/cdk.out.json
+
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
- run: |
aws s3 sync s3://www.tea.xyz/Images/packages \
From bb74a4c9134a22054117b3abde4ace82f7df0968 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:06:10 +0800
Subject: [PATCH 19/62] test log
---
.cdk/lib/tea.xyz.ts | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.cdk/lib/tea.xyz.ts b/.cdk/lib/tea.xyz.ts
index 13dc0ff..649c601 100644
--- a/.cdk/lib/tea.xyz.ts
+++ b/.cdk/lib/tea.xyz.ts
@@ -9,6 +9,7 @@ import {
RemovalPolicy,
CfnOutput } from "aws-cdk-lib";
import { Construct } from "constructs";
+import fs from "fs";
/**
* The CloudFormation stack holding all our resources
@@ -24,6 +25,10 @@ export default class TeaXYZ extends Stack {
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
+ console.log("BUCKET NAME:", bucket.bucketName)
+ fs.writeFile('../bucket.txt', bucket.bucketName, () => {
+ console.log('bucket name shared');
+ })
const edgeLambda = lambda.Version.fromVersionArn(this, "Lambda", "arn:aws:lambda:us-east-1:640264234305:function:www-redirect:10");
From f1a132b1c841de362aed9517d0786a362ab20610 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:08:09 +0800
Subject: [PATCH 20/62] test again
---
.cdk/lib/tea.xyz.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.cdk/lib/tea.xyz.ts b/.cdk/lib/tea.xyz.ts
index 649c601..de5f660 100644
--- a/.cdk/lib/tea.xyz.ts
+++ b/.cdk/lib/tea.xyz.ts
@@ -10,6 +10,7 @@ import {
CfnOutput } from "aws-cdk-lib";
import { Construct } from "constructs";
import fs from "fs";
+import path from "path";
/**
* The CloudFormation stack holding all our resources
@@ -26,7 +27,7 @@ export default class TeaXYZ extends Stack {
removalPolicy: RemovalPolicy.DESTROY,
});
console.log("BUCKET NAME:", bucket.bucketName)
- fs.writeFile('../bucket.txt', bucket.bucketName, () => {
+ fs.writeFile(path.join(process.cwd(), "bucket.txt"), bucket.bucketName, () => {
console.log('bucket name shared');
})
From 54ffcf9b12e1a7ed3a6d0254ade4e8b876f388f1 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:14:13 +0800
Subject: [PATCH 21/62] test log
---
.cdk/lib/tea.xyz.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.cdk/lib/tea.xyz.ts b/.cdk/lib/tea.xyz.ts
index de5f660..1cf3d53 100644
--- a/.cdk/lib/tea.xyz.ts
+++ b/.cdk/lib/tea.xyz.ts
@@ -26,7 +26,7 @@ export default class TeaXYZ extends Stack {
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
- console.log("BUCKET NAME:", bucket.bucketName)
+ console.log("BUCKET ARN:", bucket.bucketArn)
fs.writeFile(path.join(process.cwd(), "bucket.txt"), bucket.bucketName, () => {
console.log('bucket name shared');
})
From fee0eb2fd6aa1775c7410ed20a421bd05660abd4 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:26:24 +0800
Subject: [PATCH 22/62] log bucket
---
.cdk/lib/tea.xyz.ts | 6 ------
.github/workflows/staging.yml | 14 ++++++++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/.cdk/lib/tea.xyz.ts b/.cdk/lib/tea.xyz.ts
index 1cf3d53..13dc0ff 100644
--- a/.cdk/lib/tea.xyz.ts
+++ b/.cdk/lib/tea.xyz.ts
@@ -9,8 +9,6 @@ import {
RemovalPolicy,
CfnOutput } from "aws-cdk-lib";
import { Construct } from "constructs";
-import fs from "fs";
-import path from "path";
/**
* The CloudFormation stack holding all our resources
@@ -26,10 +24,6 @@ export default class TeaXYZ extends Stack {
autoDeleteObjects: true,
removalPolicy: RemovalPolicy.DESTROY,
});
- console.log("BUCKET ARN:", bucket.bucketArn)
- fs.writeFile(path.join(process.cwd(), "bucket.txt"), bucket.bucketName, () => {
- console.log('bucket name shared');
- })
const edgeLambda = lambda.Version.fromVersionArn(this, "Lambda", "arn:aws:lambda:us-east-1:640264234305:function:www-redirect:10");
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index d063b9c..32d60ae 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -92,12 +92,18 @@ jobs:
run: yarn deploy
working-directory: .cdk
- - run: cat .cdk/cdk.out.json
+ - uses: 8BitJonny/gh-get-current-pr@2.1.3
+ id: PR
+
+ - name: get cdk bucket
+ run: |
+ aws s3 ls | grep teaxyz-pr-${{ steps.PR.outputs.number }}
+
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
- - run: |
- aws s3 sync s3://www.tea.xyz/Images/packages \
- s3://TeaXYZ-${STAGE}/Images/packages
+ # - run: |
+ # aws s3 sync s3://www.tea.xyz/Images/packages \
+ # s3://TeaXYZ-${STAGE}/Images/packages
- name: Seal Deployment
uses: bobheadxi/deployments@v1
From cbb71d81aaf56de29178ec7a6c3174aad95e30a5 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:30:14 +0800
Subject: [PATCH 23/62] test
---
.github/workflows/staging.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 32d60ae..f7778c5 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -73,7 +73,6 @@ jobs:
with:
target: build
- - run: echo "TeaXYZ-${STAGE}"
- uses: actions/setup-node@v3
with:
node-version: 14
@@ -97,7 +96,7 @@ jobs:
- name: get cdk bucket
run: |
- aws s3 ls | grep teaxyz-pr-${{ steps.PR.outputs.number }}
+ aws s3 ls | "grep teaxyz-pr-${{ steps.PR.outputs.number }}"
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
From fbbff52968391adbe07c61a05d4f5fba81adf802 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:33:15 +0800
Subject: [PATCH 24/62] log bucket
---
.github/workflows/staging.yml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index f7778c5..daf9ae2 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -86,17 +86,17 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- - name: Deploy to AWS
- id: cdk_deploy
- run: yarn deploy
- working-directory: .cdk
+ # - name: Deploy to AWS
+ # id: cdk_deploy
+ # run: yarn deploy
+ # working-directory: .cdk
- uses: 8BitJonny/gh-get-current-pr@2.1.3
id: PR
- name: get cdk bucket
run: |
- aws s3 ls | "grep teaxyz-pr-${{ steps.PR.outputs.number }}"
+ aws s3 ls | grep "teaxyz-pr-${{ steps.PR.outputs.number }}"
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
From 138f4bba2c888c6676fd2d377e70c47ed99e03a6 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:39:50 +0800
Subject: [PATCH 25/62] log again
---
.github/workflows/staging.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index daf9ae2..42563dc 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -95,8 +95,11 @@ jobs:
id: PR
- name: get cdk bucket
+ if: steps.PR.outcome == 'success'
+ env:
+ prNumber: ${{ steps.PR.outputs.number }}
run: |
- aws s3 ls | grep "teaxyz-pr-${{ steps.PR.outputs.number }}"
+ aws s3 ls | grep "teaxyz-pr-${prNumber}"
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
From e6e08d5bb5248074d99e03d0e27f3c0714cd9129 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 14:50:30 +0800
Subject: [PATCH 26/62] test using REF slug
---
.github/workflows/staging.yml | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 42563dc..85e557d 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -91,15 +91,9 @@ jobs:
# run: yarn deploy
# working-directory: .cdk
- - uses: 8BitJonny/gh-get-current-pr@2.1.3
- id: PR
-
- name: get cdk bucket
- if: steps.PR.outcome == 'success'
- env:
- prNumber: ${{ steps.PR.outputs.number }}
run: |
- aws s3 ls | grep "teaxyz-pr-${prNumber}"
+ aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//")
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
From d64dd5e8fde763548336f2a845b57d4b2e02630d Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 15:04:01 +0800
Subject: [PATCH 27/62] test sync bucket
---
.github/workflows/staging.yml | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 85e557d..5e3540b 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -92,9 +92,17 @@ jobs:
# working-directory: .cdk
- name: get cdk bucket
+ id: DEPLOY_BUCKET
run: |
- aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//")
+ BUCKET=$(aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//") | grep -o '[^ ]*$')
+ echo "bucket=$BUCKET" >> $GITHUB_OUTPUT
+ - name: sync package images from prod to preview bucket
+ run: |
+ aws s3 sync s3://www.tea.xyz/Images/packages \
+ s3://$NEW_BUCKET/Images/packages
+ env:
+ NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }}
# sync images from www.tea.xyz/Images/packages to wherever bucket you are
# - run: |
From 875e931dd1db6a3982fb4abb2ed9a48e6ff1dd49 Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 15:07:29 +0800
Subject: [PATCH 28/62] bring back cdk deploy
---
.github/workflows/staging.yml | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 5e3540b..371c807 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -86,10 +86,10 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- # - name: Deploy to AWS
- # id: cdk_deploy
- # run: yarn deploy
- # working-directory: .cdk
+ - name: Deploy to AWS
+ id: cdk_deploy
+ run: yarn deploy
+ working-directory: .cdk
- name: get cdk bucket
id: DEPLOY_BUCKET
@@ -104,11 +104,6 @@ jobs:
env:
NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }}
- # sync images from www.tea.xyz/Images/packages to wherever bucket you are
- # - run: |
- # aws s3 sync s3://www.tea.xyz/Images/packages \
- # s3://TeaXYZ-${STAGE}/Images/packages
-
- name: Seal Deployment
uses: bobheadxi/deployments@v1
if: always()
From c61111822cbc35667dd7c63ec64bb7d2ef077c9c Mon Sep 17 00:00:00 2001
From: neil
Date: Sat, 19 Nov 2022 15:10:11 +0800
Subject: [PATCH 29/62] change from sync to cp
---
.github/workflows/staging.yml | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml
index 371c807..7b7cd66 100644
--- a/.github/workflows/staging.yml
+++ b/.github/workflows/staging.yml
@@ -97,10 +97,11 @@ jobs:
BUCKET=$(aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//") | grep -o '[^ ]*$')
echo "bucket=$BUCKET" >> $GITHUB_OUTPUT
- - name: sync package images from prod to preview bucket
+ - name: cp package images from prod to preview bucket
run: |
- aws s3 sync s3://www.tea.xyz/Images/packages \
- s3://$NEW_BUCKET/Images/packages
+ aws s3 cp s3://www.tea.xyz/Images/packages \
+ s3://$NEW_BUCKET/Images/packages \
+ --recursive
env:
NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }}
From eb9449cddc1a032bde1a8f7eb718627bc3a41c84 Mon Sep 17 00:00:00 2001
From: Thomas Smith <49042513+tsmitty11@users.noreply.github.com>
Date: Sat, 19 Nov 2022 11:45:06 -0500
Subject: [PATCH 30/62] sh <(curl https://tea.xyz) > sh <(curl tea.xyz)
---
src/layouts/partials/clipboard-copy.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/layouts/partials/clipboard-copy.html b/src/layouts/partials/clipboard-copy.html
index ec4f5d9..799698e 100644
--- a/src/layouts/partials/clipboard-copy.html
+++ b/src/layouts/partials/clipboard-copy.html
@@ -1,6 +1,6 @@
+
From dd66800c9fea5d7b7627beb06a190d83cb9b9256 Mon Sep 17 00:00:00 2001
From: Thomas Smith <49042513+tsmitty11@users.noreply.github.com>
Date: Fri, 25 Nov 2022 09:26:02 -0500
Subject: [PATCH 35/62] Default placeholder value sans 'https'
---
src/layouts/partials/clipboard-copy.html | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/layouts/partials/clipboard-copy.html b/src/layouts/partials/clipboard-copy.html
index 799698e..e8fa1be 100644
--- a/src/layouts/partials/clipboard-copy.html
+++ b/src/layouts/partials/clipboard-copy.html
@@ -1,6 +1,6 @@