From d92182a1e811db8e3353bed2dfaefc230da09d24 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 4 Apr 2024 18:55:53 +0800 Subject: [PATCH] build: rm /bridge from base url --- .github/workflows/feature.yml | 4 ++-- .github/workflows/production.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- firebase.json | 2 +- nuxt.config.ts | 2 +- package.json | 6 ++--- plugins/redirects.client.ts | 12 +++++----- scripts/create-release-assets.sh | 12 +++++----- .../assetsPage/artifacts-emptyWallet.feature | 2 +- .../artifacts/bridgePage/artifacts.feature | 22 +++++++++---------- .../redirection/mainPage/redirection.feature | 2 +- .../bridge-deposit-with-blockchain.feature | 2 +- .../features/transactions/withdraw.feature | 2 +- 13 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml index 55fe77e5..20a5c9fb 100644 --- a/.github/workflows/feature.yml +++ b/.github/workflows/feature.yml @@ -42,8 +42,8 @@ jobs: - name: Reorganize Files run: | - mkdir -p dist/bridge - mv dist/_nuxt dist/bridge/_nuxt + mkdir -p dist + mv dist/_nuxt dist/_nuxt - name: Deploy uses: matter-labs/action-hosting-deploy@main diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index ca87c7be..83770ce0 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -44,8 +44,8 @@ jobs: - name: Reorganize Files run: | - mkdir -p dist/bridge - mv dist/_nuxt dist/bridge/_nuxt + mkdir -p dist + mv dist/_nuxt dist/_nuxt - name: Deploy to Production uses: matter-labs/action-hosting-deploy@main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2e88e57..33f7c7c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,8 +75,8 @@ jobs: - name: Reorganize Files run: | - mkdir -p dist/bridge - mv dist/_nuxt dist/bridge/_nuxt + mkdir -p dist + mv dist/_nuxt dist/_nuxt - name: Deploy uses: matter-labs/action-hosting-deploy@main diff --git a/firebase.json b/firebase.json index 1f73259b..fb4bcfe7 100644 --- a/firebase.json +++ b/firebase.json @@ -6,7 +6,7 @@ "ignore": ["firebase.json", "**/.*", "**/node_modules/**", "**/*.map"], "rewrites": [ { - "source": "/bridge/**", + "source": "/**", "destination": "/index.html" } ], diff --git a/nuxt.config.ts b/nuxt.config.ts index 9c7f4ccb..af2e1ae7 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -3,7 +3,7 @@ import { portal as portalMeta } from "./data/meta"; // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ app: { - baseURL: "/bridge", + // baseURL: "/", head: { htmlAttrs: { lang: "en", diff --git a/package.json b/package.json index 41650e9a..3c4ddc0d 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "generate": "nuxt generate && npm run generate-meta", "generate:node:memory": "cross-env NODE_TYPE=memory npm run generate", "generate:node:docker": "cross-env NODE_TYPE=dockerized npm run generate", - "generate:node:nexus": "cross-env NODE_TYPE=nexus npm run generate && mkdir -p dist/bridge && mv dist/_nuxt dist/bridge/_nuxt", - "generate:node:nexus-goerli": "cross-env NODE_TYPE=nexus-goerli npm run generate && mkdir -p dist/bridge && mv dist/_nuxt dist/bridge/_nuxt", - "generate:node:nexus-sepolia": "cross-env NODE_TYPE=nexus-sepolia npm run generate && mkdir -p dist/bridge && mv dist/_nuxt dist/bridge/_nuxt", + "generate:node:nexus": "cross-env NODE_TYPE=nexus npm run generate", + "generate:node:nexus-goerli": "cross-env NODE_TYPE=nexus-goerli npm run generate", + "generate:node:nexus-sepolia": "cross-env NODE_TYPE=nexus-sepolia npm run generate", "generate:node:hyperchain": "ts-node --transpile-only scripts/hyperchains/empty-check.ts && cross-env NODE_TYPE=hyperchain npm run generate", "generate-meta": "ts-node --transpile-only scripts/updateBridgeMetaTags.ts", "hyperchain:create": "ts-node --transpile-only scripts/hyperchains/create.ts", diff --git a/plugins/redirects.client.ts b/plugins/redirects.client.ts index 51c42dbd..525f64b3 100644 --- a/plugins/redirects.client.ts +++ b/plugins/redirects.client.ts @@ -1,12 +1,12 @@ export default defineNuxtPlugin(() => { const currentUrl = new URL(window.location.href); - if (currentUrl.pathname === "/") { - const newUrl = new URL(currentUrl.href); - newUrl.pathname = "/bridge"; - navigateTo(newUrl.href, { external: true }); - return; - } + // if (currentUrl.pathname === "/") { + // const newUrl = new URL(currentUrl.href); + // newUrl.pathname = "/"; + // navigateTo(newUrl.href, { external: true }); + // return; + // } const redirectNetworks = ["goerli", "sepolia"]; for (const network of redirectNetworks) { diff --git a/scripts/create-release-assets.sh b/scripts/create-release-assets.sh index 2e4403a1..6428f197 100644 --- a/scripts/create-release-assets.sh +++ b/scripts/create-release-assets.sh @@ -5,17 +5,17 @@ set -e # Run the first npm command and move folder npm run generate:node:memory -mkdir -p dist/bridge -mv dist/_nuxt dist/bridge/_nuxt +mkdir -p dist +mv dist/_nuxt dist/_nuxt mv .output/public ./dist-node-memory # Run the second npm command and move folder npm run generate:node:docker -mkdir -p dist/bridge -mv dist/_nuxt dist/bridge/_nuxt +mkdir -p dist +mv dist/_nuxt dist/_nuxt mv .output/public ./dist-node-docker # Run the final npm command npm run generate -mkdir -p dist/bridge -mv dist/_nuxt dist/bridge/_nuxt \ No newline at end of file +mkdir -p dist +mv dist/_nuxt dist/_nuxt \ No newline at end of file diff --git a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature index 18f8c49f..14a87bc6 100644 --- a/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature +++ b/tests/e2e/features/artifacts/assetsPage/artifacts-emptyWallet.feature @@ -39,7 +39,7 @@ Feature: Artifacts - UI @id1678 Scenario: Check "Insufficient balance" warning message (Zero token balance) (Bridge) Then A wallet should be "empty" - When I go to page "/bridge?network=era-goerli" + When I go to page "/?network=era-goerli" When I click by text "Withdraw" When I choose "ETH" as token and insert "1000" as amount Then Message " Insufficient balance " should be visible diff --git a/tests/e2e/features/artifacts/bridgePage/artifacts.feature b/tests/e2e/features/artifacts/bridgePage/artifacts.feature index 4b721e5d..b39457d0 100644 --- a/tests/e2e/features/artifacts/bridgePage/artifacts.feature +++ b/tests/e2e/features/artifacts/bridgePage/artifacts.feature @@ -6,7 +6,7 @@ Feature: Withdraw @id1602 Scenario: Check the Account Dropdown Artifacts on the Bridge Page - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" #click on the account dropdown When I click by partial text "..." Then Modal card element with the "//*[contains(@class, 'address-avatar')]" xpath should be "visible" @@ -24,7 +24,7 @@ Feature: Withdraw @id1603 Scenario: Check the Network Switcher Artifacts on the Bridge Page - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" #click on the account dropdown When I click by partial text "..." Then Element with "text" "Bridge network" should be "visible" @@ -35,7 +35,7 @@ Feature: Withdraw @id1604:I Scenario: Check the View on Explorer Artifacts on the Bridge Page (Testnet) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" #click on the account dropdown When I click by partial text "..." Then Element with "text" "View on Explorer" should be "visible" @@ -51,7 +51,7 @@ Feature: Withdraw @id1604:II Scenario: Check the View on Explorer Artifacts on the Bridge Page (Mainnet) - Given I go to page "/bridge?network=era-mainnet" + Given I go to page "/?network=era-mainnet" #click on the account dropdown When I click by partial text "..." Then Element with "text" "View on Explorer" should be "visible" @@ -67,7 +67,7 @@ Feature: Withdraw @id1597 Scenario: Check the Bridge artifacts on Withdraw (Testnet) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Withdraw" Then Element with "text" "Bridge" should be "visible" Then Element with "partial text" "Recent withdrawals" should be "visible" @@ -100,7 +100,7 @@ Feature: Withdraw @id1613 Scenario: Check the Bridge To artifacts on Withdraw (Testnet) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Withdraw" When I click by "text" with "Your Ethereum Goerli Testnet account" value Then Element with "text" "Bridge to" should be "visible" @@ -120,7 +120,7 @@ Feature: Withdraw @id1599 Scenario: Check the Bridge artifacts on Withdraw: a wallet is not connected Given I'm logged out - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" Then Element with "text" "Bridge" should be "visible" When I click by text "Withdraw" Then Element with "text" " Connect wallet " should be "visible" @@ -135,7 +135,7 @@ Feature: Withdraw @id1612 Scenario: Check the editing recipient address in Bridge (Withdraw) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Withdraw" When I click by "text" with "Your Ethereum Goerli Testnet account" value Then Element with "text" "Bridge to" should be "visible" @@ -146,7 +146,7 @@ Feature: Withdraw @id756 Scenario: Check the Bridge artifacts on Deposit (Testnet) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" Then Element with "text" "Bridge" should be "visible" Then Element with "text" "Deposit" should be "visible" Then Element with "text" "Withdraw" should be "visible" @@ -182,7 +182,7 @@ Feature: Withdraw @id1598 Scenario: Check the Bridge artifacts on Deposit: a wallet is not connected Given I'm logged out - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" Then Element with "text" "Bridge" should be "visible" When I click by text "Deposit" Then Element with "text" " Connect wallet " should be "visible" @@ -197,7 +197,7 @@ Feature: Withdraw @id1611 Scenario: Check the editing recipient address in Bridge (Deposit) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Deposit" When I click by "text" with "Your zkSync Era Testnet account" value Then Element with "text" "Bridge to" should be "visible" diff --git a/tests/e2e/features/redirection/mainPage/redirection.feature b/tests/e2e/features/redirection/mainPage/redirection.feature index fbaee794..aad49a0e 100644 --- a/tests/e2e/features/redirection/mainPage/redirection.feature +++ b/tests/e2e/features/redirection/mainPage/redirection.feature @@ -298,7 +298,7 @@ Feature: External Redirection on the Main Page @id1610 Scenario: Check redirection for the "Explore ecosystem" button (Withdraw Bridge) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Withdraw" When I choose "ETH" as token and insert "0.0000000001" as amount When I "confirm" transaction after clicking "Send to Ethereum Goerli Testnet" button diff --git a/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature b/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature index 5342499d..8a2308bc 100644 --- a/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature +++ b/tests/e2e/features/transactions/deposit/bridge-deposit-with-blockchain.feature @@ -6,7 +6,7 @@ Feature: Deposit @id785 @id1609 @id1607 Scenario: Make a deposit on Bridge (Deposit) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Deposit" Then Element with "id" "amount-input" should have "" "value" Then Element with "testId" "fee-amount" should be "visible" diff --git a/tests/e2e/features/transactions/withdraw.feature b/tests/e2e/features/transactions/withdraw.feature index 6ed98753..1c2295b0 100644 --- a/tests/e2e/features/transactions/withdraw.feature +++ b/tests/e2e/features/transactions/withdraw.feature @@ -64,7 +64,7 @@ Feature: Withdraw @id1601 @id1608 @id1694 Scenario: make a Withdraw (Bridge) - Given I go to page "/bridge?network=era-goerli" + Given I go to page "/?network=era-goerli" When I click by text "Withdraw" When I choose "ETH" as token and insert "0.0000000001" as amount When I "confirm" transaction after clicking "Send to Ethereum Goerli Testnet" button