Skip to content

Commit

Permalink
✨ feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
rustin01 committed Jul 4, 2024
0 parents commit 13cca18
Show file tree
Hide file tree
Showing 125 changed files with 8,788 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name-template: "v$RESOLVED_VERSION 🌈"
tag-template: "v$RESOLVED_VERSION"
categories:
- title: "💥 Breaking Changes"
label: "💥 Breaking Change"

- title: "🌟 New Features"
label: "🌟 New Feature"

- title: "⭐ Features"
label: "⭐ Feature"

- title: "🐞 Bug Fixes"
label: "🐞 Bug Fix"

- title: "🛠 Improvements"
label: "🛠 Improvement"

- title: "🌀 External Changes"
label: "🔌 3rd Party Plugin"

- title: "📖 Documentation"
label: "📖 Docs"

- title: "🌍 Localization"
label: "🌍 i18n"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
exclude-labels:
- 'skip-changelog'
version-resolver:
major:
labels:
- "major"
minor:
labels:
- "minor"
patch:
labels:
- "patch"
default: patch
template: |
## Changes
$CHANGES
43 changes: 43 additions & 0 deletions .github/workflows/hibit_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: deploy tagged website
on:
push:
branches:
- 'v*'
- 'release'
tags:
- 'v*'
jobs:
deploy_1:
runs-on: ubuntu-latest
timeout-minutes: 30
environment:
name: hibit
url: https://www.hibit.app
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: build
run: |
export VITE_RELEASE_VERSION=${{ github.ref }}
./scripts/build_hibit_1.sh
- uses: amondnet/[email protected] #deploy
with:
scope: ${{ secrets.TEAM_ID_1 }}
vercel-token: ${{ secrets.VERCEL_TOKEN_1 }} # Required
vercel-args: '--prod'
vercel-org-id: ${{ secrets.ORG_ID_1}} #Required
vercel-project-id: ${{ secrets.PROJECT_ID_1}} #Required
- name: Feishu Robot Message
run: |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"ex3web hk published\nrepository: ${{ github.repository }}\ncommitter: ${{ github.actor }}\ncompare: ${{ github.event.compare }}\njob status: ${{ job.status }}"}}' ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
# url: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
# title: "ex3web images published"
# text: |
# ex3web images published
# repository: ${{ github.repository }}
# committer: ${{ github.actor }}
# compare: ${{ github.event.compare }}
# job status: ${{ job.status }}
30 changes: 30 additions & 0 deletions .github/workflows/pr_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: deploy pr website
on: [pull_request]

permissions:
contents: read
issues: read
checks: write
pull-requests: write

jobs:
deploy:
timeout-minutes: 90
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: build
run: ./scripts/build_staging_1.sh
- uses: amondnet/[email protected] #deploy
id: vercel_deploy
with:
scope: ${{ secrets.TEAM_ID_1 }}
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN_1 }} # Required
# vercel-args: '--prebuilt'
vercel-org-id: ${{ secrets.ORG_ID_1}} #Required
vercel-project-id: ${{ secrets.PROJECT_ID_1}} #Required
38 changes: 38 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Drafter

on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
pull_request:
# Only following types are handled by the action, but one can default to all as well
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/staging_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: deploy staging website
on:
push:
branches:
- 'main'

jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
environment:
name: beta
url: https://beta.ex3.one
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: build
run: |
export VITE_RELEASE_VERSION=${{ github.ref }}
./scripts/build_staging_1.sh
- uses: amondnet/[email protected] #deploy
with:
scope: ${{ secrets.TEAM_ID_1 }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN_1 }} # Required
# vercel-args: '--prebuilt'
vercel-org-id: ${{ secrets.ORG_ID_1}} #Required
vercel-project-id: ${{ secrets.PROJECT_ID_1}} #Required
- name: Feishu Robot Message
run: |
curl -X POST -H "Content-Type: application/json" -d '{"msg_type":"text","content":{"text":"ex3web beta published\nrepository: ${{ github.repository }}\ncommitter: ${{ github.actor }}\ncompare: ${{ github.event.compare }}\njob status: ${{ job.status }}"}}' ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
# url: ${{ secrets.FEISHU_ROBOT_WEBHOOK_URL }}
# title: "ex3web images published"
# text: |
# ex3web images published
# repository: ${{ github.repository }}
# committer: ${{ github.actor }}
# compare: ${{ github.event.compare }}
# job status: ${{ job.status }}
38 changes: 38 additions & 0 deletions .github/workflows/web_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Playwright test for web
on:
workflow_dispatch:
inputs:
test_url:
description: 'Test Url'
required: true
type: string
filter:
description: 'Test Filter'
required: false
type: string

jobs:
test:
timeout-minutes: 90
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
- name: install
run: ./scripts/install_testnet.sh
- name: run playwright test
env:
VITE_PLAYWRIGHT_TEST_URL: ${{ inputs.test_url }}
run: |
cd apps/web
npx playwright install --with-deps chromium
npx playwright test ${{ inputs.filter }}
- name: upload test result artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: web-test-report-${{ github.run_number }}-${{ github.run_attempt }}
path: ./apps/web/playwright-report/index.html
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.turbo
.dfx
coverage/
.husky/_/
tmp-*/
test-results/
playwright-report/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@deland-labs:registry=https://gitlab.com/api/v4/projects/37663507/packages/npm/
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EX3 dapp
EX3 frontend monorepo based on React, Typescript, and [Turbo](https://turbo.build/)
## Develop
```
yarn install
yarn dev:<workspace_name>
```
## Build
```
yarn build:<workspace_name>
```
## Workspaces
- apps
- `web`: EX3 frontend project, built with ReactBootstrap and less
- `new-web`: EX3 new UI frontend project, built with Tailwindcss and DaisyUI
- packages
- `common`: common shared package
16 changes: 16 additions & 0 deletions apps/wallet/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VITE_APP_NAME=EX3
VITE_APP_ENV=Mainnet
VITE_FAUCET_CODE=niceex3
VITE_IC_PORT=11180
VITE_IC_HOST=https://ic0.app
VITE_BASE_API=https://alphaapi.ex3.one/
VITE_WS_BASE_API=https://alphaws.ex3.one/
VITE_RELEASE_VERSION=v1.0
VITE_PLAYWRIGHT_TEST_URL=http://localhost:5173
VITE_PARTICLE_NETWORK_PROJECT_ID=c367136a-fba4-442b-a2c5-a33bd531e1ae
VITE_PARTICLE_NETWORK_CLIENT_KEY=cYyiQKCmpGy3ImFbJB13d9SLC1PJ6Q6afcF8sYtN
VITE_PARTICLE_NETWORK_APP_ID=978e069b-2c7b-4408-b710-de9b5cab95a9
VITE_WALLET_CONNECT_PROJECT_ID=bf0eb26798023896e9839e9929243cfd
VITE_OKX_TEST_PROJECT_ID=8a6a31db3eac2dcc73a98d8d1dfc38a7
VITE_OKX_TEST_API_KEY=0130ea7d-341b-4416-bb85-f31129f91dea
VITE_OKX_TEST_SECRET_KEY=8A01CB7FD91CDFEB56379B320DB3CEF8
16 changes: 16 additions & 0 deletions apps/wallet/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
VITE_APP_NAME=EX3
VITE_APP_ENV=Local
VITE_FAUCET_CODE=niceex3
VITE_IC_PORT=11180
VITE_IC_HOST=https://ic0.app
VITE_BASE_API=https://alphaapi.ex3.one/
VITE_WS_BASE_API=https://alphaws.ex3.one/
VITE_RELEASE_VERSION=v1.0
VITE_PLAYWRIGHT_TEST_URL=http://localhost:5173
VITE_PARTICLE_NETWORK_PROJECT_ID=c367136a-fba4-442b-a2c5-a33bd531e1ae
VITE_PARTICLE_NETWORK_CLIENT_KEY=cYyiQKCmpGy3ImFbJB13d9SLC1PJ6Q6afcF8sYtN
VITE_PARTICLE_NETWORK_APP_ID=978e069b-2c7b-4408-b710-de9b5cab95a9
VITE_WALLET_CONNECT_PROJECT_ID=bf0eb26798023896e9839e9929243cfd
VITE_OKX_TEST_PROJECT_ID=8a6a31db3eac2dcc73a98d8d1dfc38a7
VITE_OKX_TEST_API_KEY=0130ea7d-341b-4416-bb85-f31129f91dea
VITE_OKX_TEST_SECRET_KEY=8A01CB7FD91CDFEB56379B320DB3CEF8
18 changes: 18 additions & 0 deletions apps/wallet/.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 },
],
},
}
30 changes: 30 additions & 0 deletions apps/wallet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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
export default {
// other rules...
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
13 changes: 13 additions & 0 deletions apps/wallet/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en" style="background: transparent;">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HiBit Wallet</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit 13cca18

Please sign in to comment.