Skip to content

Commit

Permalink
Develop (#44)
Browse files Browse the repository at this point in the history
* feat: remove mapps from justverified

* fix yarn.lock

* fix

* feat: efp

* feat: efp and storybook for react sdk

* chore(release): publish

- project: justweb3-efp-plugin 0.1.0

* chore(release): publish

- project: justweb3-efp-plugin 0.1.1

* chore(release): publish

- project: justweb3-efp-plugin 0.1.2

* chore(release): publish

- project: justweb3-efp-plugin 0.1.3

* feat: console fixes

* chore(release): publish

- project: justweb3-efp-plugin 0.1.4

* feat: added docs and the sign in should only show ens set to default resolver or justaname resolver only

* feat: add verbose to the test in ci

* trial

* trial

* trial

* trial

* Trial (#42)

* trial

* trial

* trial

* trial

* trial

* fix: lint fix on react and package json of projects

* fix: lint fix on react and package json of projects

* Console (#43)

* fix: naming app name

* fix: packages

* fix(console): deployment

* fix: trial

* fix(console): trial

* trial

* trial

* trial

* trial

* trial

* trial

* trial

---------

Co-authored-by: anthony2399 <[email protected]>

* fix: error from useEnsWalletClient

---------

Co-authored-by: anthony2399 <[email protected]>
  • Loading branch information
HadiKhai and anthony23991 authored Oct 31, 2024
1 parent ad23861 commit 2081267
Show file tree
Hide file tree
Showing 21 changed files with 558 additions and 105 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- uses: nrwl/nx-set-shas@v3
- run: yarn install
- run: npx nx reset
- run: rm -rf node_modules/.cache/rollup-plugin-typescript2
- name: Run Tests
env:
SDK_JUSTANAME_TEST_API_KEY: ${{ secrets.SDK_JUSTANAME_TEST_API_KEY }}
Expand All @@ -41,5 +42,6 @@ jobs:
SIWENS_PRIVATE_KEY: ${{ secrets.SIWENS_PRIVATE_KEY }}
SIWENS_PROVIDER_URL: ${{ secrets.SIWENS_PROVIDER_URL }}
SIWENS_VALID_ENS: ${{ secrets.SIWENS_VALID_ENS }}
run: npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk,console
- run: npx nx affected -t build --exclude=justaname-mono-sdk,console
run: npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk,console --parallel=1
- run: rm -rf node_modules/.cache/rollup-plugin-typescript2
- run: npx nx affected -t build --exclude=justaname-mono-sdk,console --parallel=1
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
run: |
yarn install --immutable
- run: npx nx reset
- run: rm -rf node_modules/.cache/rollup-plugin-typescript2
- name: Build and Test
env:
SDK_JUSTANAME_TEST_API_KEY: ${{ secrets.SDK_JUSTANAME_TEST_API_KEY }}
Expand All @@ -49,7 +50,7 @@ jobs:
SIWENS_PROVIDER_URL: ${{ secrets.SIWENS_PROVIDER_URL }}
SIWENS_VALID_ENS: ${{ secrets.SIWENS_VALID_ENS }}
run: |
npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk,console
npx nx affected -t test --configuration=ci --passWithNoTests --exclude=justaname-mono-sdk,console --parallel=1
- name: Pull latest changes from main
run: git pull origin main
Expand All @@ -63,6 +64,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- run: rm -rf node_modules/.cache/rollup-plugin-typescript2
- name: Release
run: |
npx nx release --specifier=patch --yes
Expand Down
1 change: 1 addition & 0 deletions apps/console/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const { composePlugins, withNx } = require('@nx/next');
* @type {import('@nx/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
// distDir: '../../dist/apps/console',
nx: {
// Set this to true if you would like to use SVGR
// See: https://github.com/gregberge/svgr
Expand Down
1 change: 0 additions & 1 deletion apps/console/src/app/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export const Providers: React.FC<ProviderProps> = (props) => {
};

const queryClient = new QueryClient();

return (
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
Expand Down
45 changes: 33 additions & 12 deletions apps/console/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,37 @@
"resolveJsonModule": true,
"isolatedModules": true,
"incremental": true,

"plugins": [
{
"name": "next"
}
],
"types": ["jest", "node"],
"types": [
"jest",
"node"
],
"paths": {
"@justweb3/widget": ["packages/@justweb3/widget"],
"@justweb3/ui": ["packages/@justweb3/ui"],
"@justaname.id/react": ["packages/@justaname.id/react"],
"@justaname.id/sdk": ["packages/@justaname.id/sdk"],
"@justaname.id/siwens": ["packages/@justaname.id/siwens"],
"@justverified/plugin": ["packages/@justverified/plugin"],
"@justweb3/efp-plugin": ["packages/@justweb3/efp-plugin"],

"@justweb3/widget": [
"packages/@justweb3/widget"
],
"@justweb3/ui": [
"packages/@justweb3/ui"
],
"@justaname.id/react": [
"packages/@justaname.id/react"
],
"@justaname.id/sdk": [
"packages/@justaname.id/sdk"
],
"@justaname.id/siwens": [
"packages/@justaname.id/siwens"
],
"@justverified/plugin": [
"packages/@justverified/plugin"
],
"@justweb3/efp-plugin": [
"packages/@justweb3/efp-plugin"
]
}
},
"include": [
Expand All @@ -37,7 +52,13 @@
"../../apps/console/.next/types/**/*.ts",
"../../dist/apps/console/.next/types/**/*.ts",
"next-env.d.ts",
".next/types/**/*.ts"
".next/types/**/*.ts",
"../../dist/dist/apps/console/types/**/*.ts"
],
"exclude": ["node_modules", "jest.config.ts", "**/*.spec.ts", "**/*.test.ts"]
"exclude": [
"node_modules",
"jest.config.ts",
"**/*.spec.ts",
"**/*.test.ts"
]
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"author": "JustaLab",
"license": "MIT",
"private": true,
"scripts": {
"remove:cache": "rm -rf node_modules/.cache/rollup-plugin-typescript2",
"build:all": "yarn remove:cache && nx run-many -t build --all --parallel=1",
"test:all": "yarn remove:cache && nx run-many -t test --all --parallel=1"
},
"dependencies": {
"@docusaurus/eslint-plugin": "^3.5.2",
"@ensdomains/address-encoder": "^1.1.2",
Expand Down
3 changes: 3 additions & 0 deletions packages/@justaname.id/react/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
},
{
"command": "node update-package-json.js"
},
{
"command": "rm -rf node_modules"
}
],
"cwd": "packages/@justaname.id/react",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,50 @@
import { useWalletClient } from 'wagmi';
import { WalletClient, Transport, Account, Chain, RpcSchema } from 'viem';
import { Account, Chain, RpcSchema, Transport, WalletClient } from 'viem';
import { addEnsContracts } from '@ensdomains/ensjs';
import { CheckedChainWithEns } from '@ensdomains/ensjs/contracts';

export interface UseEnsWalletClientResult {
ensWalletClient: WalletClient<Transport, CheckedChainWithEns<Chain>, Account, RpcSchema> | undefined
isEnsWalletClientPending: boolean
ensWalletClient:
| WalletClient<Transport, CheckedChainWithEns<Chain>, Account, RpcSchema>
| undefined;
isEnsWalletClientPending: boolean;
}

export interface UseEnsWalletClientParams {}

export const useEnsWalletClient = (params?: UseEnsWalletClientParams): UseEnsWalletClientResult => {
const query = useWalletClient()
export const useEnsWalletClient = (
params?: UseEnsWalletClientParams
): UseEnsWalletClientResult => {
const query = useWalletClient();

const transformWalletToEnsWallet = (wallet: WalletClient<Transport, Chain, Account, RpcSchema> | undefined): WalletClient<Transport, CheckedChainWithEns<Chain>, Account, RpcSchema> | undefined => {
const transformWalletToEnsWallet = (
wallet: WalletClient<Transport, Chain, Account, RpcSchema> | undefined
):
| WalletClient<Transport, CheckedChainWithEns<Chain>, Account, RpcSchema>
| undefined => {
if (!wallet) {
return
return;
}

if (wallet?.chain.id !== 1 && wallet?.chain.id !== 11155111) {
return;
}

return {
...wallet,
chain: addEnsContracts(wallet.chain as Chain)
} as WalletClient<Transport, CheckedChainWithEns<Chain>, Account, RpcSchema>
}
chain: addEnsContracts(wallet.chain as Chain),
} as WalletClient<
Transport,
CheckedChainWithEns<Chain>,
Account,
RpcSchema
>;
};

return {
ensWalletClient: transformWalletToEnsWallet(query.data as WalletClient<Transport, Chain, Account, RpcSchema>),
isEnsWalletClientPending: query.isPending
}
}
ensWalletClient: transformWalletToEnsWallet(
query.data as WalletClient<Transport, Chain, Account, RpcSchema>
),
isEnsWalletClientPending: query.isPending,
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export const useUpdateSubname = (
);
} else {
if (!ensWalletClient) {
throw new Error('No wallet client found');
throw new Error(
'No Wallet Client found, chain not supported, only mainnet and sepolia are supported'
);
}

const changeIsValid = await checkIfUpdateIsValid(_params);
Expand Down
Loading

0 comments on commit 2081267

Please sign in to comment.