Skip to content

Commit

Permalink
revert all workspace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zaidarain1 committed Jul 26, 2024
1 parent a8cf125 commit 9d02d2d
Show file tree
Hide file tree
Showing 51 changed files with 101,712 additions and 9,488 deletions.
52 changes: 34 additions & 18 deletions .github/workflows/build-and-test-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,39 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: setup
uses: ./.github/actions/pr-setup

- name: Build Passport Example Projects
run: yarn build:passport-examples
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
registry-url: https://registry.npmjs.org/
cache: "yarn"

test:
name: Test
runs-on: ubuntu-latest-4-cores
env:
NODE_OPTIONS: --max-old-space-size=14366
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find all projects
id: find-projects
run: |
find ./examples/passport -name 'node_modules' -prune -o -name 'package.json' -exec dirname {} \; > project-dirs.txt
- name: Install Dependencies
run: |
while IFS= read -r dir; do
echo "Installing dependencies for $dir"
(cd "$dir" && yarn install --no-immutable)
done < project-dirs.txt
- name: Build Projects
run: |
while IFS= read -r dir; do
echo "Building $dir"
(cd "$dir" && yarn build)
done < project-dirs.txt
- name: setup
uses: ./.github/actions/pr-setup

- name: Run Passport Example Tests
run: yarn test:passport-examples
- name: Run Tests
run: |
while IFS= read -r dir; do
echo "Testing $dir"
if jq -e '.scripts.test' "$dir/package.json" > /dev/null; then
(cd "$dir" && yarn test)
else
echo "No test script found in $dir/package.json, skipping tests."
fi
done < project-dirs.txt
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.1.cjs

Large diffs are not rendered by default.

894 changes: 0 additions & 894 deletions .yarn/releases/yarn-4.3.1.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.3.1.cjs
yarnPath: .yarn/releases/yarn-3.6.1.cjs
16 changes: 8 additions & 8 deletions examples/passport/next-connect-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"name": "next-connect-kit",
"name": "next-wagmi",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@imtbl/sdk": "^1.35.0",
"@tanstack/react-query": "^5.37.1",
Expand All @@ -18,12 +25,5 @@
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5"
},
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "eslint src --ext .js,.jsx,.ts,.tsx",
"start": "next start"
}
}
4 changes: 2 additions & 2 deletions examples/passport/next-connect-kit/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Inter } from 'next/font/google';
import { Inter } from "next/font/google";

const inter = Inter({ subsets: ['latin'] });
const inter = Inter({ subsets: ["latin"] });

export default function RootLayout({
children,
Expand Down
4 changes: 2 additions & 2 deletions examples/passport/next-connect-kit/src/app/logout/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Page() {
const { push } = useRouter();

useEffect(() => {
push('/');
push('/');
}, [push]);
return <p />;
}
};
19 changes: 9 additions & 10 deletions examples/passport/next-connect-kit/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
'use client';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';
import { WagmiProvider, useDisconnect } from 'wagmi';
import { config } from './wagmi';
import { useEffect } from 'react';
import { passportInstance } from './passport';
import { Connect } from '@/components/Connect';
import { ConnectKitProvider } from 'connectkit';
import { passportInstance } from './passport';
import { config } from './wagmi';

const queryClient = new QueryClient();

export default function App() {
useEffect(() => {
if (!passportInstance) return;
passportInstance.connectEvm(); // EIP-6963
}, []);
if(!passportInstance) return
passportInstance.connectEvm() // EIP-6963
}, [])

return (
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<ConnectKitProvider onDisconnect={async () => {
const userinfo = await passportInstance.getUserInfo();
if (userinfo) await passportInstance.logout();
}}
>
const userinfo = await passportInstance.getUserInfo()
if (userinfo) await passportInstance.logout()
}}>
<Connect />
</ConnectKitProvider>
</QueryClientProvider>
Expand Down
4 changes: 2 additions & 2 deletions examples/passport/next-connect-kit/src/app/redirect/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use client';

import PassportRedirect from '@/components/PassportRedirect';
import { passportInstance } from '../passport';
import PassportRedirect from '@/components/PassportRedirect';

export default function Page() {
return <PassportRedirect passportInstance={passportInstance} />;
return <PassportRedirect passportInstance={passportInstance} />
}
6 changes: 3 additions & 3 deletions examples/passport/next-connect-kit/src/components/Connect.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConnectKitButton } from 'connectkit';
import { ConnectKitButton } from "connectkit";

export function Connect() {
return <ConnectKitButton />;
}
return <ConnectKitButton />
};
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { passport } from '@imtbl/sdk';
import { useEffect } from 'react';
import { passport } from '@imtbl/sdk'
import { useEffect } from 'react'

function PassportRedirect({
passportInstance,
passportInstance
}: { passportInstance: passport.Passport }) {

useEffect(() => {
passportInstance.loginCallback();
}, [passportInstance]);
}, [passportInstance])

return (
<div>Loading...</div>
);
)
}

export default PassportRedirect;
export default PassportRedirect
Loading

0 comments on commit 9d02d2d

Please sign in to comment.