diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..5124ac7 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["bloq", "prettier"], + "ignorePatterns": ["site/out"], + "overrides": [ + { + "extends": ["bloq/node", "prettier"], + "files": ["packages/**/*.js"] + }, + { + "extends": ["bloq/mocha", "prettier"], + "files": ["*.spec.js"] + }, + { + "extends": ["bloq/next", "prettier"], + "files": ["site/**/*.js"], + "rules": { + "@next/next/no-html-link-for-pages": ["warn", "site/pages"], + "complexity": ["warn", 20] + } + } + ], + "rules": { + "promise/no-nesting": "off" + } +} diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 0000000..94e6430 --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,41 @@ +name: Deployment + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + purefinance-build-and-deploy: + runs-on: ubuntu-latest + steps: + - uses: bloq/actions/notify-deploy-to-slack@v1 + with: + app-name: Hemi Pure Finance + environment: production + reference: ${{ github.event.head_commit.message }} + slack-mention: ${{ vars.SLACK_MENTION }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + status: 'started :stopwatch:' + - uses: actions/checkout@v4 + - uses: bloq/actions/setup-node-env@v1 + - run: npm run build + - uses: appleboy/scp-action@master + with: + host: ${{ secrets.HOSTINGER_HOST }} + username: ${{ secrets.HOSTINGER_USER }} + port: ${{ secrets.HOSTINGER_PORT }} + key: ${{ secrets.HOSTINGER_SSH_KEY }} + source: site/out/* + target: public_html/pure.finance + rm: true + strip_components: 2 + - if: ${{ !cancelled() }} + uses: bloq/actions/notify-deploy-to-slack@v1 + with: + app-name: Hemi Pure Finance + environment: production + slack-mention: ${{ vars.SLACK_MENTION }} + slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} + status: ${{ job.status == 'failure' && 'failed :boom:' || 'finished :ok:' }} diff --git a/.github/workflows/purefinance_deployment.yaml b/.github/workflows/purefinance_deployment.yaml deleted file mode 100644 index d89478a..0000000 --- a/.github/workflows/purefinance_deployment.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Deploy Purefinance - -on: - workflow_dispatch: - push: - branches: - - master - -jobs: - purefinance-build-and-deploy: - runs-on: ubuntu-latest - - steps: - - name: Check out repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Install Dependencies - run: npm ci - - - name: Build site - run: | - cd site - npm run build - - - name: Copy files to Hostinger - uses: appleboy/scp-action@master - with: - host: ${{ secrets.HOSTINGER_HOST }} - username: ${{ secrets.HOSTINGER_USER }} - port: ${{ secrets.HOSTINGER_PORT }} - key: ${{ secrets.HOSTINGER_SSH_KEY }} - source: site/out/* - target: public_html/pure.finance - rm: true - strip_components: 2 diff --git a/.huskyrc.json b/.huskyrc.json new file mode 100644 index 0000000..1331908 --- /dev/null +++ b/.huskyrc.json @@ -0,0 +1,6 @@ +{ + "hooks": { + "pre-commit": "lint-staged", + "pre-push": "npm run test && npm run deps:check" + } +} diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..e0e2d85 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,4 @@ +{ + "!(*.js)": ["prettier --ignore-unknown --write"], + "*.js": ["eslint --cache --fix --quiet", "prettier --write"] +} diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..7536a43 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "arrowParens": "avoid", + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none" +} diff --git a/README.md b/README.md index dba7697..7c7f126 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,3 @@ Then run the tests: ```sh npm run test:e2e ``` - -## Deployment - -```sh -npm ci -cd site -npm run build -``` - -Then upload the folder `site/out` to the hosting server. diff --git a/package.json b/package.json index b5bcdfc..ae8a362 100644 --- a/package.json +++ b/package.json @@ -30,78 +30,5 @@ "prettier": "^2.3.1", "prettier-plugin-tailwind": "^2.2.12", "tailwindcss": "^2.2.7" - }, - "eslintConfig": { - "extends": [ - "bloq", - "prettier" - ], - "ignorePatterns": [ - "site/out" - ], - "overrides": [ - { - "extends": [ - "bloq/node", - "prettier" - ], - "files": [ - "packages/**/*.js" - ] - }, - { - "extends": [ - "bloq/mocha", - "prettier" - ], - "files": [ - "*.spec.js" - ] - }, - { - "extends": [ - "bloq/next", - "prettier" - ], - "files": [ - "site/**/*.js" - ], - "rules": { - "@next/next/no-html-link-for-pages": [ - "warn", - "site/pages" - ], - "complexity": [ - "warn", - 20 - ] - } - } - ], - "rules": { - "promise/no-nesting": "off" - } - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged", - "pre-push": "npm run test && npm run deps:check" - } - }, - "lint-staged": { - "!(*.js)": [ - "prettier --ignore-unknown --write" - ], - "*.js": [ - "eslint --cache --fix --quiet", - "prettier --write" - ] - }, - "prettier": { - "arrowParens": "avoid", - "semi": false, - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "none" } } diff --git a/packages/token-list/package-lock.json b/packages/token-list/package-lock.json index 6c4f65e..49143fb 100644 --- a/packages/token-list/package-lock.json +++ b/packages/token-list/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@hemilabs/token-list": "^1.0.0", + "@hemilabs/token-list": "^1.1.1", "@sushiswap/default-token-list": "^18.3.0", "@uniswap/default-token-list": "^2.1.0", "lodash": "4.17.21", @@ -21,9 +21,9 @@ } }, "node_modules/@hemilabs/token-list": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@hemilabs/token-list/-/token-list-1.0.0.tgz", - "integrity": "sha512-/NPwqln1A7I0Rwv7Owvl/n2QmsYrV+Sdmu6Nb9iXZ5ZUaZJgAeVYMuVcyF0cYB9ApoRDV99/DmoLzcVe1xR6Gw==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@hemilabs/token-list/-/token-list-1.1.1.tgz", + "integrity": "sha512-JOFlfyZrhsKdYTkFID8X5KWdQE8OGIWr3ojj216rqiRVH4TjKEZOsoD+n7oBo2UiE6yzG/PPBDyyc6KVSLOVUw==" }, "node_modules/@sushiswap/default-token-list": { "version": "18.19.0", diff --git a/packages/token-list/package.json b/packages/token-list/package.json index 1f0153d..565b73e 100644 --- a/packages/token-list/package.json +++ b/packages/token-list/package.json @@ -10,7 +10,7 @@ "deps:check": "dependency-check --no-dev ." }, "dependencies": { - "@hemilabs/token-list": "^1.0.0", + "@hemilabs/token-list": "^1.1.1", "@sushiswap/default-token-list": "^18.3.0", "@uniswap/default-token-list": "^2.1.0", "lodash": "4.17.21", diff --git a/site/components/svg/Chevron.js b/site/components/svg/Chevron.js index e249ed0..ec8486a 100644 --- a/site/components/svg/Chevron.js +++ b/site/components/svg/Chevron.js @@ -1,10 +1,10 @@ const Chevron = props => ( ) diff --git a/site/messages/en.json b/site/messages/en.json index 597241a..95f248b 100644 --- a/site/messages/en.json +++ b/site/messages/en.json @@ -41,7 +41,7 @@ "error-no-ethereum-provider": "No Ethereum browser extension detected, install MetaMask on desktop or visit from a dApp browser on mobile.", "error-rejected-wallet-connection": "Please authorize this website to access your Ethereum account.", "error-unknown": "An unknown error occurred.", - "error-unsupported-network": "You're connected to an unsupported network.", + "error-unsupported-network": "Only Hemi networks are supported.", "error": "Error", "estimated-tx-fee": "Estimated network fee", "floored": "Floored", diff --git a/site/messages/zh.json b/site/messages/zh.json index 4ae9d5f..ba18f86 100644 --- a/site/messages/zh.json +++ b/site/messages/zh.json @@ -41,7 +41,7 @@ "error-no-ethereum-provider": "未检测到以太坊浏览器扩展,请在桌面上安装 MetaMask 或从移动设备上的 dApp 浏览器访问。", "error-rejected-wallet-connection": "请授权本网站访问您的以太坊账户。", "error-unknown": "出现未知错误。", - "error-unsupported-network": "您连接到不受支持的网络。", + "error-unsupported-network": "仅支持 Hemi 网络。", "error": "错误", "estimated-tx-fee": "预估网络费用", "floored": "有地板的", diff --git a/site/utils/utilsConfig.json b/site/utils/utilsConfig.json index e5a9cd8..17ed80c 100644 --- a/site/utils/utilsConfig.json +++ b/site/utils/utilsConfig.json @@ -1,17 +1,7 @@ { "43111": { - "dp-auctions": { - "address": "" - }, - "merkle": { - "address": "" - }, - "payment-streams": { - "address": "", - "birthblock": "" - }, - "sablier": { - "address": "" + "merkleClaim": { + "address": "0x112de51b708c77C628532120Ffe2c0200f067399" } }, "743111": {