Skip to content

Commit

Permalink
Merge pull request #145 from vu3th/feat/monorepo
Browse files Browse the repository at this point in the history
Feat/monorepo
  • Loading branch information
johnson86tw authored Oct 3, 2023
2 parents 13ae9b8 + fa8b425 commit b2ac47e
Show file tree
Hide file tree
Showing 79 changed files with 11,914 additions and 9,777 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom: ['https://explorer.gitcoin.co/#/round/10/0x8de918f0163b2021839a8d84954dd7e8e151326d/0x8de918f0163b2021839a8d84954dd7e8e151326d-43']
custom: ['https://arbiscan.io/address/0x9D75F4EbcB8e7669E59dcc27CBadC698E0F77187#internaltx']
65 changes: 21 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,27 @@
name: CI

on:
push:
branches: [main, dev]
push:
branches: [main]

pull_request:
branches: [main, dev]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v2
with:
path: ~/.yarn
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- run: npm install -g yarn
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn build:demo
- run: yarn build:docs
release:
name: Release
environment: release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- run: npm install -g yarn
- name: Install dependencies
run: yarn install --forzen-lockfile
- name: Build dist
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-
- run: npm install -g pnpm
- run: pnpm i
- run: pnpm -F vue-dapp build
- run: pnpm -F demo build
- run: pnpm -F docs build
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ dist
.env
.idea
.DS_Store
build

# docs
docs/docs/
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
23 changes: 0 additions & 23 deletions .releaserc.json

This file was deleted.

File renamed without changes.
File renamed without changes.
113 changes: 113 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
{
"name": "@vue-dapp/demo",
"version": "1.0.0",
"description": "Vue 3 library for building Dapps on Ethereum",
"repository": "https://github.com/vu3th/vue-dapp",
"bugs": {
"url": "https://github.com/vu3th/vue-dapp/issues"
},
"homepage": "https://github.com/vu3th/vue-dapp#readme",
"author": "Johnson Chen <https://twitter.com/chnejohnson>",
"license": "MIT",
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"lint": "eslint './src/**/*.{js,ts}'",
"prettier-check": "prettier -c --parser typescript \"{src,__tests__,e2e}/**/*.[jt]s?(x)\"",
"format": "yarn run lint --write",
"test:types": "tsc --build tsconfig.json",
"test:unit": "vitest --environment jsdom",
"test": "yarn run test:types && yarn run test:unit",
"semantic-release": "semantic-release"
},
"peerDependencies": {
"@coinbase/wallet-sdk": ">=3.1.0",
"@gnosis.pm/safe-apps-provider": ">=0.15.1",
"@gnosis.pm/safe-apps-sdk": ">=7.8.0",
"@walletconnect/ethereum-provider": "^2.10.1",
"@walletconnect/modal": "^2.6.2",
"@web3modal/standalone": "^2.4.3",
"ethers": ">=5.6.8",
"vue": ">=3.2.0"
},
"peerDependenciesMeta": {
"@coinbase/wallet-sdk": {
"optional": true
},
"@walletconnect/ethereum-provider": {
"optional": true
},
"@walletconnect/modal": {
"optional": true
},
"@web3modal/standalone": {
"optional": true
},
"@gnosis.pm/safe-apps-provider": {
"optional": true
},
"@gnosis.pm/safe-apps-sdk": {
"optional": true
}
},
"devDependencies": {
"@coinbase/wallet-sdk": "^3.1.0",
"@gnosis.pm/safe-apps-provider": "^0.15.1",
"@gnosis.pm/safe-apps-sdk": "^7.8.0",
"@rollup/plugin-inject": "^5.0.3",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-replace": "^4.0.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/git": "^10.0.1",
"@types/jest": "^27.5.1",
"@typescript-eslint/eslint-plugin": "^5.45.1",
"@typescript-eslint/parser": "^5.45.1",
"@vitejs/plugin-vue": "3.2.0",
"@vue/compiler-sfc": "^3.2.36",
"@vue/test-utils": "^2.2.6",
"@vuedx/typecheck": "^0.7.5",
"@vuedx/typescript-plugin-vue": "^0.7.5",
"@walletconnect/ethereum-provider": "^2.10.1",
"@walletconnect/modal": "^2.6.2",
"@web3modal/standalone": "^2.4.3",
"autoprefixer": "^10.4.13",
"eslint": "^8.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.1",
"jsdom": "^20.0.3",
"lint-staged": "^12.4.2",
"node-stdlib-browser": "^1.2.0",
"pascalcase": "^2.0.0",
"postcss": "^8.4.20",
"prettier": "^2.6.2",
"rollup": "^2.74.1",
"rollup-plugin-dts": "^4.2.1",
"rollup-plugin-peer-deps-external": "^2.2.4",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-typescript2": "^0.31.2",
"rollup-plugin-vue": "^6.0.0",
"semantic-release": "^19.0.5",
"tailwindcss": "^3.2.4",
"ts-jest": "^28.0.3",
"tslib": "^2.4.0",
"typescript": "^5.1.3",
"vite": "3.2.4",
"vitest": "^0.25.5"
},
"lint-staged": {
"**/*.{js,ts,json,scss,css,vue}": [
"prettier --write"
]
},
"keywords": [
"vue",
"vue3",
"dapp",
"web3",
"ethereum",
"hook",
"composable"
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion tailwind.config.js → demo/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./demo/index.html', './demo/src/**/*.{vue,js,ts,jsx,tsx}'],
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: {
extend: {},
},
Expand Down
50 changes: 50 additions & 0 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"include": [
"src/types/global.d.ts",
"src/**/*.ts",
"tests/**/*.ts",
"demo/**/*.ts",
"demo/**/*.d.ts",
"demo/**/*.tsx",
"demo/**/*.vue"
],
"exclude": ["dist", "node_modules"],
"compilerOptions": {
"baseUrl": ".",
"rootDir": ".",
"outDir": "dist",
"sourceMap": false,
"noEmit": true,

"target": "es2015",
"module": "es2020",
"moduleResolution": "node",
"skipLibCheck": true,

"noUnusedLocals": true,
"strictNullChecks": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"strict": true,
"isolatedModules": false,

"experimentalDecorators": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"removeComments": false,
"jsx": "preserve",
"lib": ["es2015", "dom"],
"types": ["node", "jest", "vite/client"],
"plugins": [
{
"name": "@vuedx/typescript-plugin-vue"
}
],
"paths": {
"vue-dapp": ["./src/index.ts"],
"vue-dapp/*": ["./src/*"],
"@/*": ["./src/*"]
}
}
}
47 changes: 47 additions & 0 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import nodeStdlibBrowser from 'node-stdlib-browser'
import inject from '@rollup/plugin-inject'

export default defineConfig({
root: process.cwd(),
plugins: [vue()],
resolve: {
alias: {
'vue-dapp': path.resolve(__dirname, '../packages/legacy/src/index.ts'),
...nodeStdlibBrowser, // Add browser polyfills of Node.js built-in libraries for Vite projects
},
},
optimizeDeps: {
esbuildOptions: {
inject: [require.resolve('node-stdlib-browser/helpers/esbuild/shim')],
target: 'esnext', // Enable Big integer literals
},
},
build: {
target: 'esnext', // Enable Big integer literals
commonjsOptions: {
transformMixedEsModules: true, // Enable @walletconnect/web3-provider which has some code in CommonJS
},
rollupOptions: {
plugins: [
// @ts-ignore
inject({
global: [
require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
'global',
],
process: [
require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
'process',
],
Buffer: [
require.resolve('node-stdlib-browser/helpers/esbuild/shim'),
'Buffer',
],
}),
],
},
},
})
16 changes: 16 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@vue-dapp/docs",
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "vitepress dev",
"build": "vitepress build",
"serve": "vitepress serve"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vitepress": "1.0.0-beta.2"
}
}
13 changes: 0 additions & 13 deletions docs/vite.config.ts

This file was deleted.

Loading

0 comments on commit b2ac47e

Please sign in to comment.