From 9a477ae469a8872310882411911d81e18df65a2c Mon Sep 17 00:00:00 2001 From: Roy Scheeren Date: Wed, 15 May 2024 14:36:28 +0200 Subject: [PATCH 1/5] fix(siwt.xyz): server deployment (#59) * fix(siwt.xyz): server deployment * Update edge lambda deployment --------- Signed-off-by: Roy Scheeren --- .github/workflows/deploy-demo.yml | 6 +++--- packages/siwt.xyz/next.config.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 67359ce..7d969aa 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -55,8 +55,8 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }} aws-region: 'eu-central-1' - - run: npx nx run-many --target=build --parallel=3 --exclude=acq,core,discord,discord-bot-ui,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --skip-nx-cache - - run: npx nx run-many --target=build-server --parallel=3 --exclude=acq,core,discord,discord-bot-ui,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --skip-nx-cache + - run: npx nx build siwt.xyz --skip-nx-cache + - run: npx nx build-server siwt.xyz --skip-nx-cache - name: Setup staging env file if: github.ref == 'refs/heads/develop' @@ -81,7 +81,7 @@ jobs: echo ENV=$ENV >> .env cat .env - name: Deploy - run: npx nx run-many --target=deploy --exclude=acq,core,discord,discord-bot-ui,discord-bot-ui-e2e,react,sdk,docs.siwt.xyz,siwt.xyz-e2e,smart-contracts --production --skip-nx-cache + run: npx nx deploy siwt.xyz --production --skip-nx-cache - name: Invalidate Staging Distribution if: github.ref == 'refs/heads/develop' env: diff --git a/packages/siwt.xyz/next.config.js b/packages/siwt.xyz/next.config.js index 92fac91..5e8b60e 100644 --- a/packages/siwt.xyz/next.config.js +++ b/packages/siwt.xyz/next.config.js @@ -8,7 +8,7 @@ const { withNx } = require('@nx/next/plugins/with-nx') **/ const nextConfig = { output: 'export', - distDir: '../../dist/packages/siwt.xyz', + distDir: '../../dist/packages/siwt.xyz/exported', nx: { // Set this to true if you would like to to use SVGR // See: https://github.com/gregberge/svgr From 974bfc3a393cd399e3fd9d87b245a84624265109 Mon Sep 17 00:00:00 2001 From: Roy Scheeren Date: Wed, 15 May 2024 18:07:44 +0200 Subject: [PATCH 2/5] refactor(siwt.xyz): remove staging workflow (#60) Signed-off-by: Roy Scheeren --- .github/workflows/deploy-demo.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-demo.yml b/.github/workflows/deploy-demo.yml index 7d969aa..473addc 100644 --- a/.github/workflows/deploy-demo.yml +++ b/.github/workflows/deploy-demo.yml @@ -58,19 +58,8 @@ jobs: - run: npx nx build siwt.xyz --skip-nx-cache - run: npx nx build-server siwt.xyz --skip-nx-cache - - name: Setup staging env file - if: github.ref == 'refs/heads/develop' - env: - CERTIFICATE_ARN: ${{ secrets.STAGING_SIWT_XYZ_SSL_CERTIFICATE_ARN }} - ENV: staging - CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_SIWT_XYZ_DISTRIBUTION_ID }} - run: | - touch .env - echo SSL_CERTIFICATE_ARN=$CERTIFICATE_ARN >> .env - echo ENV=$ENV >> .env - cat .env - name: Setup production env file - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/develop' env: CERTIFICATE_ARN: ${{ secrets.SIWT_XYZ_SSL_CERTIFICATE_ARN }} ENV: production @@ -82,13 +71,8 @@ jobs: cat .env - name: Deploy run: npx nx deploy siwt.xyz --production --skip-nx-cache - - name: Invalidate Staging Distribution + - name: Invalidate Distribution if: github.ref == 'refs/heads/develop' - env: - CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.STAGING_SIWT_XYZ_DISTRIBUTION_ID }} - run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths '/*' - - name: Invalidate Production Distribution - if: github.ref == 'refs/heads/main' env: CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.SIWT_XYZ_DISTRIBUTION_ID }} run: aws cloudfront create-invalidation --distribution-id=$CLOUDFRONT_DISTRIBUTION_ID --paths '/*' From 305889956b8024bb326aab5bc81951b2254109c5 Mon Sep 17 00:00:00 2001 From: Carlo van Driesten Date: Wed, 15 May 2024 19:21:58 +0200 Subject: [PATCH 3/5] Increment version (#61) Signed-off-by: Carlo van Driesten --- packages/acq/package.json | 2 +- packages/core/package.json | 2 +- packages/react/package.json | 2 +- packages/sdk/package.json | 2 +- packages/smart-contracts/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/acq/package.json b/packages/acq/package.json index d9eec08..3d97c0c 100644 --- a/packages/acq/package.json +++ b/packages/acq/package.json @@ -1,5 +1,5 @@ { "name": "@siwt/acq", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT" } diff --git a/packages/core/package.json b/packages/core/package.json index 257be4a..97e65d5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,5 +1,5 @@ { "name": "@siwt/core", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT" } diff --git a/packages/react/package.json b/packages/react/package.json index 676a0d5..8af89fc 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@siwt/react", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT", "main": "./index.js", "types": "./index.d.ts", diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 30db189..8372b8e 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,5 +1,5 @@ { "name": "@siwt/sdk", - "version": "0.0.6", + "version": "0.0.7", "license": "MIT" } diff --git a/packages/smart-contracts/package.json b/packages/smart-contracts/package.json index b9ccde0..2ace7d8 100644 --- a/packages/smart-contracts/package.json +++ b/packages/smart-contracts/package.json @@ -1,6 +1,6 @@ { "name": "@siwt/smart-contracts", - "version": "0.0.6", + "version": "0.0.7", "type": "commonjs", "scripts": { "tzgen": "tzgen", From 1ac92f28d00405177f25c4f703efabbefc77a7b1 Mon Sep 17 00:00:00 2001 From: Roy Scheeren Date: Wed, 15 May 2024 20:44:41 +0200 Subject: [PATCH 4/5] fix: reference environment (#62) Signed-off-by: Roy Scheeren --- .github/workflows/release-packages.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 895f2b7..1bfa024 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -8,6 +8,7 @@ on: jobs: build-and-release: runs-on: ubuntu-latest + environment: Packages steps: - uses: actions/checkout@v4 - name: Set up Node.js From 9378a1d259825f7f901a64db271d5bc1c228cd9a Mon Sep 17 00:00:00 2001 From: Roy Scheeren Date: Thu, 16 May 2024 12:33:22 +0200 Subject: [PATCH 5/5] refactor(siwt.xyz): policy names to policy urls (#63) * CAIP requires the resources to be urls, the demo site is updated to provide urls instead of plain text --------- Signed-off-by: Roy Scheeren --- packages/siwt.xyz/components/Try/Try.tsx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/siwt.xyz/components/Try/Try.tsx b/packages/siwt.xyz/components/Try/Try.tsx index 7033b47..440622f 100644 --- a/packages/siwt.xyz/components/Try/Try.tsx +++ b/packages/siwt.xyz/components/Try/Try.tsx @@ -46,7 +46,7 @@ export const Try = () => { const [isAllowlistInputValid, setIsAllowlistInputValid] = useState(true) const [selectedPolicies, setSelectedPolicies] = useState([]) const [customPolicies, setCustomPolicies] = useState('') - const [isCustomPoliciesValid, setIsCustomPoliciesValid] = useState(true) + const [areCustomPoliciesValid, setAreCustomPoliciesValid] = useState(true) const [activeAccount, setActiveAccount] = useState({} as AccountInfo) const [message, setMessage] = useState('') const [signature, setSignature] = useState('') @@ -139,9 +139,12 @@ export const Try = () => { const onChangeCustomPolicies = (event: ChangeEvent) => { setCustomPolicies(event.currentTarget.value) - test(/^([A-Za-z0-9]+, )*[A-Za-z0-9]+$/, event.currentTarget.value) || event.currentTarget.value === '' - ? setIsCustomPoliciesValid(true) - : setIsCustomPoliciesValid(false) + test( + /^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/, + event.currentTarget.value, + ) || event.currentTarget.value === '' + ? setAreCustomPoliciesValid(true) + : setAreCustomPoliciesValid(false) } const onChangeSelectedPolicies = (id: string) => { @@ -347,7 +350,7 @@ export const Try = () => { @@ -357,8 +360,8 @@ export const Try = () => { id="other-policies" value={customPolicies} onChange={onChangeCustomPolicies} - explainer="Comma separated list of other policies your dApp may have. For example: 'Cookie policy, Refund policy'" - hasValidInput={isCustomPoliciesValid} + explainer="Comma separated list of urls to other policies your dApp may have." + hasValidInput={areCustomPoliciesValid} />