Skip to content

Commit

Permalink
add w bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianscatularo committed Jun 20, 2024
1 parent 4e7321a commit 4cb5812
Show file tree
Hide file tree
Showing 42 changed files with 29,941 additions and 1 deletion.
55 changes: 54 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ on:
pkg-version:
description: "NPM Package Version"
value: ${{ jobs.token-bridge.outputs.pkg-version }}

jobs:
docs:
name: "Documentation"
Expand Down Expand Up @@ -140,6 +141,7 @@ jobs:
with:
name: build-redirects
path: apps/redirects/dist

rewards-dashboard:
name: "Rewards Dashboard"
runs-on: "ubuntu-latest"
Expand Down Expand Up @@ -301,13 +303,59 @@ jobs:
name: build-token-bridge
path: connect-loader/apps/connect/dist

w-bridge:
name: "W Bridge"
runs-on: "ubuntu-latest"
concurrency:
group: ${{ github.ref }}-${{inputs.name}}-w-bridge
cancel-in-progress: true
environment: ${{inputs.environment}}
outputs:
pkg-version: ${{ steps.set-version.outputs._PKG_VERSION }}
steps:
- name: Set up Node environment
uses: actions/setup-node@v3
with:
node-version: v18.17.1
- name: Checkout Custom Wormhole Connect Loader
uses: actions/checkout@v3
with:
ref: ${{ inputs.project-branch }}
path: connect-loader
- name: Setup Git
run: |
pushd connect-loader
git config user.name "xLabs CI"
git config user.email "devops@xlabs.xyz"
- name: Set Portal Bridge Version
id: set-version
run: |
pushd connect-loader/apps/w-bridge
echo "_PKG_VERSION=$(node -p -e "require('./package.json').version")-${{inputs.separator}}$(echo ${{ github.sha }} | cut -c -10)" >> "${GITHUB_OUTPUT}"
- name: Build Custom Wormhole Connect Loader
env:
PUBLIC_URL: "${{ inputs.public-url }}"
VITE_APP_VERSION: ${{ steps.set-version.outputs._PKG_VERSION }}
VITE_APP_CLUSTER: ${{ vars.REACT_APP_CLUSTER }}
VITE_APP_WALLET_CONNECT_PROJECT_ID: ${{ secrets.REACT_APP_WALLET_CONNECT_PROJECT_ID }}
run: |
pushd connect-loader/apps/w-bridge
npm ci
echo 'VITE_APP_VERSION=$npm_package_version' > .env
npm run build:token-bridge
- name: Upload Portal Bridge Artifact
uses: actions/upload-artifact@v3
with:
name: build-w-bridge
path: connect-loader/apps/w-bridge/dist

publish:
name: "Publish"
needs:
- advanced-tools
- usdc-bridge
- token-bridge
- rewards-dashboard
- w-bridge
- redirects
- docs
runs-on: "ubuntu-latest"
Expand All @@ -327,6 +375,11 @@ jobs:
with:
name: build-usdc-bridge
path: usdc-bridge
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: build-w-bridge
path: w-bridge
- name: Download Artifact
uses: actions/download-artifact@v3
with:
Expand Down
18 changes: 18 additions & 0 deletions apps/w-bridge/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
36 changes: 36 additions & 0 deletions apps/w-bridge/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

.idea/
# dependencies
/node_modules
/.pnp
.pnp.js
.vscode
.env

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# ethereum contracts
/contracts
/src/ethers-contracts

.yalc
yalc.lock
public/wormhole-connect/
wormhole-connect/node_modules/
dist/
13 changes: 13 additions & 0 deletions apps/w-bridge/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always"
}
69 changes: 69 additions & 0 deletions apps/w-bridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list


## Create a new banner

Go to `apps/connect/public/data/banners.json` and add a new item with this format:

```
[
{
"id": "string",
"background": "red",
"content": {
"text": "Lorem ipsum",
"color": "papayawhip",
"size": "30px"
},
"button": {
"label": "Click here!",
"background": "red",
"href": "https://portalbridge.com"
},
"since": "2023-12-22T01:06:52.211Z",
"until": "2023-12-25T01:06:52.211Z"
},
{
"id": "string",
"background": "yellow",
"content": {
"text": "Lorem ipsum",
"color": "white",
"size": "15px"
},
"button": {
"label": "Click here!",
"background": "green",
"href": "https://portalbridge.com"
},
"since": "2023-12-22T01:06:52.211Z",
"until": "2023-12-25T01:06:52.211Z"
}
]
```
38 changes: 38 additions & 0 deletions apps/w-bridge/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Portal is a bridge that offers unlimited transfers across chains for tokens and NFTs wrapped by Wormhole."
/>
<meta property="og:title" content="Portal Token Bridge" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://portalbridge.com" />
<meta property="og:image" content="wormhole.png" />
<meta property="og:image:alt" content="Wormhole logo" />
<meta
property="og:description"
content="Portal is a bridge that offers unlimited transfers across chains for tokens and NFTs wrapped by Wormhole."
/>
<meta name="twitter:site" content="@portalbridge_" />
<meta name="twitter:creator" content="@portalbridge_" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="apple-touch-icon" href="logo192.png" />
<link rel="manifest" href="manifest.json" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<title>Portal Token Bridge</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 4cb5812

Please sign in to comment.