Skip to content

Commit

Permalink
Merge branch 'dev' into 0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Nov 30, 2023
2 parents 8a3096f + 186dd89 commit 59fce25
Show file tree
Hide file tree
Showing 87 changed files with 2,209 additions and 1,383 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "0.x",
"updateInternalDependencies": "patch",
"ignore": ["example-nextjs", "example-vite", "example-test", "website"]
"ignore": ["example-nextjs", "example-vite", "website"]
}
5 changes: 5 additions & 0 deletions .changeset/late-birds-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@totejs/walletkit': patch
---

Fixed `WalletConnect` automatic connection issue in the follow scenario: connect the WalletConnect -> close browser -> reopen browser -> disconnect -> select WalletConnect, will automatically connect.
11 changes: 11 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"example-nextjs": "0.0.1",
"example-vite": "0.0.1",
"@totejs/walletkit": "1.0.7-alpha.1",
"website": "0.0.1"
},
"changesets": []
}
5 changes: 0 additions & 5 deletions .changeset/shiny-eggs-grin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/smooth-drinks-walk.md

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.next
dist
CHANGELOG.md
build.cjs
.changeset/*.md
25 changes: 25 additions & 0 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'setup'
description: Prepare the environment

runs:
using: composite
steps:
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

- name: Setup pnpm config
shell: bash
run: pnpm config set store-dir .pnpm-store

- name: Install dependencies
shell: bash
run: pnpm install
38 changes: 38 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy docs
on:
push:
branches:
- main
- alpha

jobs:
release:
name: deploy docs
if: github.repository == 'node-real/walletkit'
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: ./.github/actions/setup

- name: Build docs
run: pnpm build:docs

- name: Redirect
run: |
mkdir -p ./website/dist/website/dist
cat << EOF > "./website/dist/website/dist/index.html"
<script>window.location.href='https://node-real.github.io/walletkit'</script>
EOF
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: ./website/dist
branch: 'docs'
clean: true
force: true
30 changes: 6 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,26 @@ on:
push:
branches:
- main
- alpha
- 0.x

env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store
- 0.x-alpha

jobs:
release:
name: release
if: github.repository == 'node-real/walletkit'
timeout-minutes: 15
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: 16
- uses: ./.github/actions/setup

- name: Setup pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false
- name: Build packages
run: pnpm build

- name: Creating .npmrc
run: |
Expand All @@ -41,15 +32,6 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: Install dependencies
run: pnpm install

- name: Build packages
run: pnpm --filter "@totejs/**" build

- name: Create and publish versions
uses: changesets/action@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.next
dist
CHANGELOG.md
CHANGELOG.md
.changeset/*.md
18 changes: 10 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pnpm install
pnpm dev
```

In default, this will run the [test example](./examples/test/), you can use this example for
In default, this will run a [vite example](./packages/walletkit/dev), you can use this example for
development and debugging. Any changes in `packages/walletkit` will trigger a refresh.

## Coding standards
Expand Down Expand Up @@ -68,9 +68,9 @@ Then you can add it to project by following steps:
2. Create an icon file `icon.tsx`:

```tsx
export const TrustWalletLightIcon = (props: React.SVGProps<SVGSVGElement>) => {
export const TrustWalletLightIcon = (props: SVGIconProps) => {
return (
<svg width="52" height="52" viewBox="0 0 52 52">
<svg width="52" height="52" viewBox="0 0 52 52" {...props}>
...
</svg>
)
Expand All @@ -84,8 +84,8 @@ import { Chain } from 'wagmi';
import {
TrustWalletDarkIcon,
TrustWalletLightIcon,
TrustWalletMobileDarkIcon,
TrustWalletMobileLightIcon,
TrustWalletTransparentDarkIcon,
TrustWalletTransparentLightIcon,
} from './icon';
import { PartialWalletProps, WalletProps } from '../types';
import { TrustWalletConnector, TrustWalletConnectorOptions } from '../trustWallet/connector';
Expand Down Expand Up @@ -127,7 +127,7 @@ export function trustWallet(props: TrustWalletProps = {}): WalletProps {
},
});
},
getUri: () => {
getDeepLink: () => {
const dappPath = `https://link.trustwallet.com/open_url?coin_id=60&url=${encodeURIComponent(
window.location.href,
)}`;
Expand Down Expand Up @@ -156,15 +156,17 @@ export interface WalletProps {
name: string;
logos: {
default: ReactElement | { [x in ColorMode]: ReactElement };
mobile?: ReactElement | { [x in ColorMode]: ReactElement };
transparent?: ReactElement | { [x in ColorMode]: ReactElement };
};
downloadUrls: {
default: string | undefined;
};
spinnerColor?: string;
showQRCode?: boolean;
installed: boolean | undefined;
createConnector: (chains: Chain[]) => Connector;
getUri: () => string | undefined;
getDeepLink: () => string | undefined;
getQRCodeUri?: (uri: string) => string;
}
```
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ WalletKit is a React component library for easily connecting a wallet to your dA

## Documentation

For full documentation, visit [here](https://node-real.github.io/walletkit/website/dist/#/index).
For full documentation, visit [here](https://node-real.github.io/walletkit).

## Examples

The following examples are provided in the [examples](./examples/) folder of this repo.

- [nextjs](https://github.com/node-real/walletkit/tree/main/examples/nextjs)
- [vite](https://github.com/node-real/walletkit/tree/main/examples/vite)
- [nextjs](./examples/nextjs/)
- [vite](./examples/vite/)

## Installation

Expand Down
18 changes: 9 additions & 9 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"lint": "next lint"
},
"dependencies": {
"react": "^18",
"react-dom": "^18",
"next": "^13",
"@totejs/walletkit": "workspace:*",
"wagmi": "^0",
"ethers": "^5"
"ethers": "^5.7.2",
"next": "^13.5.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"wagmi": "^0.12.19"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18"
"@types/node": "^20.10.1",
"@types/react": "^18.2.39",
"@types/react-dom": "^18.2.17",
"typescript": "^5.3.2"
}
}
7 changes: 2 additions & 5 deletions examples/nextjs/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,13 @@ const client = createClient(
);

const options: WalletKitOptions = {
initialChainId: 56,
initialChainId: 1,
};

export default function App({ Component, pageProps }: AppProps) {
return (
<WagmiConfig client={client}>
<WalletKitProvider
options={options}
mode="light"
>
<WalletKitProvider options={options} mode="light">
<WalletKitButton />
<Component {...pageProps} />
<SwitchNetworkModal />
Expand Down
36 changes: 0 additions & 36 deletions examples/test/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions examples/test/README.md

This file was deleted.

6 changes: 0 additions & 6 deletions examples/test/next.config.js

This file was deleted.

Loading

0 comments on commit 59fce25

Please sign in to comment.