Skip to content

Commit

Permalink
Merge branch 'main' into refactor-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenvechain committed Oct 25, 2023
2 parents d636ab5 + 159d0de commit 556c605
Show file tree
Hide file tree
Showing 19 changed files with 16,833 additions and 14,062 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/lint-build-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint, Build & Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.head_ref || github.ref_name }}-build-test-scan
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-latest
name: Lint, Build & Test

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: "yarn"

- name: Install
run: yarn install:all

- name: Lint
run: yarn run lint

- name: Build
run: yarn run build
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.16.1
56 changes: 48 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,71 @@
# vechain-dapp-kit

This is a DApp Kit for Vechain.
VeWorld WalletKit is a typescript library that facilitates seamless interaction between VeChain wallets (veworld, sync 2) and dApps, enhancing user experience and developer convenience.

## Why ?

- Allow easy interaction with all wallets.
- Currently, connex only plays nice with Sync / Sync2
- Enable a better UX for users

## Setting up the project
## Key features

### Install dependencies
Key Features a.k.a scope

1. wallet connectivity

key components that handle interaction with veworld and sync 2

2. customizable UI

ability to totally customize the UI of components

3. User Experience

Consistent experience with Ethereum and other chains

4. Developer friendly

Easy to adopt with proper documentation.

## Setting up the project (Common flow)

### Install & build dependencies

```bash
pnpm install
yarn install:all
```

### Build the packages & apps
### Run in Dev Mode

```bash
pnpm build
yarn dev
```

### Run in Dev Mode
## Useful scripts

### Clean project

```bash
yarn clean
```

### Install yarn packages

```bash
yarn
```

### Build dependencies

```bash
yarn build:deps
```

### Build release

```bash
pnpm dev
yarn build
```

### Future Work
Expand Down
1 change: 1 addition & 0 deletions apps/sample-react-app/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
extends: ["custom/react"],
ignorePatterns: ["src/hardhat/**/*"],
};
12 changes: 12 additions & 0 deletions apps/sample-react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Hardhat files
cache
artifacts
src/hardhat

22 changes: 22 additions & 0 deletions apps/sample-react-app/contracts/Counter.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

contract Counter {
uint256 public count;

event CounterUpdated(uint256 newValue);

constructor() {
count = 0;
}

function increment() public {
count += 1;
emit CounterUpdated(count);
}

function incrementBy(uint256 value) public {
count += value;
emit CounterUpdated(count);
}
}
11 changes: 11 additions & 0 deletions apps/sample-react-app/hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

const config: HardhatUserConfig = {
solidity: "0.8.19",
typechain: {
outDir: "src/hardhat",
},
};

export default config;
78 changes: 51 additions & 27 deletions apps/sample-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,51 @@
"homepage": ".",
"main": "src/index.js",
"scripts": {
"start": "HTTPS=true react-app-rewired start",
"build": "yarn compile && react-app-rewired build",
"clean": "rm -rf build node_modules .turbo cache artifacts src/hardhat",
"compile": "yarn hardhat compile",
"dev": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject",
"postinstall": "yarn compile",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"clean": "rm -rf build node_modules .turbo"
"start": "HTTPS=true react-app-rewired start",
"test": "echo 'Not yet testing'"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"dependencies": {
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@heroicons/react": "^2.0.18",
"@vechain/connex": "2.1.0",
"@vechain/hardhat-vechain": "^0.1.4",
"@vechain/hardhat-web3": "^0.1.4",
"@vechain/picasso": "^2.1.1",
"@vechain/react-wallet-kit": "workspace:*",
"@vechain/wallet-connect": "workspace:*",
"@vechain/wallet-kit": "workspace:*",
"@vechain/react-wallet-kit": "*",
"@vechain/wallet-connect": "*",
"@vechain/wallet-kit": "*",
"@vechain/web3-providers-connex": "^1.1.2",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"ethers": "^6.8.0",
"framer-motion": "3.10.6",
"https-browserify": "^1.0.0",
"os-browserify": "^0.3.0",
"process": "^0.11.10",
Expand All @@ -38,42 +64,40 @@
"web-vitals": "^2.1.2"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"@typechain/ethers-v6": "^0.4.0",
"@typechain/hardhat": "^8.0.0",
"@types/chai": "^4.2.0",
"@types/jest": "^27.0.3",
"@types/mocha": ">=9.1.0",
"@types/node": "^18.17.2",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@types/testing-library__jest-dom": "^5.14.5",
"chai": "^4.2.0",
"copy-webpack-plugin": "^11.0.0",
"customize-cra": "^1.0.0",
"eslint-config-custom": "workspace:*",
"eslint-config-custom": "*",
"ethers": "^6.4.0",
"filemanager-webpack-plugin": "^8.0.0",
"hardhat": "^2.18.2",
"hardhat-gas-reporter": "^1.0.8",
"mini-css-extract-plugin": "^2.7.6",
"react-app-rewired": "^2.2.1",
"solidity-coverage": "^0.8.1",
"ts-import-plugin": "^3.0.0",
"ts-loader": "^9.5.0",
"tsconfig": "workspace:*",
"ts-node": "^10.9.1",
"tsconfig": "*",
"typechain": "^8.2.0",
"typescript": "4.9.5",
"webpack": "^5.88.2"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
9 changes: 0 additions & 9 deletions apps/sample-react-app/src/App.test.tsx

This file was deleted.

45 changes: 24 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
{
"private": true,
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"clean": "turbo run clean; rm -rf node_modules .turbo",
"build:deps": "turbo build --no-daemon --filter='@vechain/**'",
"install:all": "pnpm i && pnpm run build:deps",
"reinstall": "pnpm clean && pnpm i && pnpm run build:deps",
"build": "turbo run build",
"build:deps": "turbo build --no-daemon --filter='@vechain/*'",
"clean": "npx turbo@latest run clean && rm -rf node_modules .turbo",
"dev": "turbo run dev --no-daemon",
"start": "turbo run start --no-daemon",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"install:all": "yarn && yarn run build:deps",
"lint": "turbo run lint",
"build": "turbo run build",
"test": "turbo run test",
"prepare": "husky install"
},
"devDependencies": {
"@commitlint/config-conventional": "^18.0.0",
"commitlint": "^18.0.0",
"eslint": "^8.4.1",
"eslint-config-custom": "workspace:*",
"eslint-plugin-prefer-arrow": "1.2.3",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"prettier": "^2.5.1",
"tsconfig": "workspace:*",
"turbo": "latest"
"prepare": "husky install",
"reinstall": "yarn clean && yarn && yarn run build:deps",
"test": "turbo run test"
},
"husky": {
"hooks": {
Expand All @@ -39,5 +30,17 @@
"eslint"
]
},
"packageManager": "[email protected]"
"devDependencies": {
"@commitlint/config-conventional": "^18.0.0",
"commitlint": "^18.0.0",
"eslint": "^8.4.1",
"eslint-config-custom": "*",
"eslint-plugin-prefer-arrow": "1.2.3",
"husky": "^8.0.0",
"lint-staged": "^15.0.2",
"prettier": "^2.5.1",
"tsconfig": "*",
"turbo": "latest"
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "eslint-config-custom",
"license": "MIT",
"version": "0.0.0",
"private": true,
"license": "MIT",
"devDependencies": {
"@vercel/style-guide": "^4.0.2",
"eslint-config-turbo": "^1.10.12"
"eslint-config-turbo": "latest"
}
}
8 changes: 4 additions & 4 deletions packages/react-wallet-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
"dependencies": {
"@vechain/connex": "2.1.0",
"@vechain/connex-framework": "2.1.0",
"@vechain/wallet-connect": "workspace:*",
"@vechain/wallet-kit": "workspace:*",
"@vechain/wallet-connect": "*",
"@vechain/wallet-kit": "*",
"thor-devkit": "^2.0.9"
},
"devDependencies": {
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"eslint": "^8.4.1",
"eslint-config-custom": "workspace:*",
"eslint-config-custom": "*",
"react": "^18.2.0",
"tsconfig": "workspace:*",
"tsconfig": "*",
"tsup": "^5.10.1",
"typescript": "4.9.5"
}
Expand Down
Loading

0 comments on commit 556c605

Please sign in to comment.