Skip to content

Commit

Permalink
Merge branch 'feat/cm-896-widget-cdn-loader' of github.com:immutable/…
Browse files Browse the repository at this point in the history
…ts-immutable-sdk into feat/cm-896-widget-cdn-loader
  • Loading branch information
jwhardwick committed Sep 25, 2024
2 parents 3f415c8 + 36aaf4c commit 1a4d87a
Show file tree
Hide file tree
Showing 103 changed files with 1,854 additions and 335 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- name: setup
uses: ./.github/actions/setup
- name: Build
run: yarn nx affected --target=build --parallel=5
run: yarn nx affected --target=build

typecheck-sdk:
name: Typecheck SDK
Expand Down
2 changes: 1 addition & 1 deletion build-dependents.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ try {

if (isDependent || changedProject === currentProject) {
// Rebuild the current project
const command = `nx run-many --target=d --projects=${currentProject} --parallel=5 --no-cloud`;
const command = `nx run-many --target=d --projects=${currentProject} --no-cloud`;

console.log(`Running command: ${command}`);
execSync(command, { stdio: 'inherit' });
Expand Down
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ fi

# Run nx commands with the selected or provided package name
echo "Running commands for package: $PACKAGE_NAME"
nx run $PACKAGE_NAME:d --parallel=5 --no-cloud
nx run $PACKAGE_NAME:d --no-cloud
nx watch --all -- node ./build-dependents.js \$NX_PROJECT_NAME $(echo $PACKAGE_NAME)
4 changes: 2 additions & 2 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default defineConfig({
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
workers: "80%",
reporter: "html",

use: {
Expand All @@ -280,7 +280,7 @@ export default defineConfig({
],

webServer: {
command: "yarn dev",
command: "yarn start",
url: "http://localhost:3000",
reuseExistingServer: !process.env.CI,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-connect-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-rainbow-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/next-web3-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@types/react-dom": "^18.0.11",
"eslint": "^8",
"eslint-config-next": "14.2.3",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-connect-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-rainbow-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-wagmi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/_deprecated/vite-web3-modal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.4",
"typescript": "^5.6.2",
"vite": "^5.2.14",
"vite-plugin-node-polyfills": "^0.22.0"
},
Expand Down
1 change: 1 addition & 0 deletions examples/orderbook/create-listing-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"dependencies": {
"@biom3/react": "^0.26.1",
"@ethersproject/providers": "^5.7.2",
"@imtbl/sdk": "latest",
"ethers": "^5.7.2",
"next": "14.2.7",
Expand Down
3 changes: 2 additions & 1 deletion examples/passport/identity-with-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
"name": "@examples/identity-with-nextjs",
"version": "0.1.0",
"dependencies": {
"@imtbl/sdk": "latest",
"ethers": "^5.7.2",
"next": "14.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@imtbl/sdk": "latest",
"@playwright/test": "^1.45.3",
"@types/node": "^20",
"@types/react": "^18.0.28",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import { useState } from 'react';
import { ProviderEvent } from '@imtbl/sdk/passport';
import { passportInstance } from '../utils';
import { passportInstance } from '../utils/passport';
import { Button, Heading, Link, Table } from '@biom3/react';
import NextLink from 'next/link';

export default function ConnectWithEtherJS() {
// setup the accounts state
Expand Down Expand Up @@ -48,39 +50,50 @@ export default function ConnectWithEtherJS() {

// render the view to login/logout and show the connected accounts
return (
<div className="flex flex-col items-center justify-center min-h-screen p-8">
<h1 className="text-3xl font-bold mb-8">Passport Connect with EIP-1193</h1>
<>
<Heading className="mb-1">Passport Connect with EIP-1193</Heading>
{accountsState.length === 0
&& (
<button
className="bg-black text-white py-2 px-4 rounded hover:bg-gray-800"
<Button
className="mb-1"
size="medium"
onClick={passportLogin}
disabled={loading}
>
disabled={loading}>
Passport Login
</button>
</Button>
)}
{accountsState.length >= 1
&& (
<button
className="bg-black text-white py-2 px-4 rounded hover:bg-gray-800"
<Button
className="mb-1"
size="medium"
onClick={passportLogout}
disabled={loading}
>
disabled={loading}>
Passport Logout
</button>
</Button>
)}
<br />
{loading
? <p>Loading...</p>
: (
<p>
Connected Account:
{accountsState.length >= 1 ? accountsState : '(not connected)'}
</p>
)}
<br />
<a href="/" className="underline">Return to Examples</a>
</div>
<Table>
<Table.Head>
<Table.Row>
<Table.Cell>Item</Table.Cell>
<Table.Cell>Value</Table.Cell>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.Row>
<Table.Cell><b>Connected Account</b></Table.Cell>
<Table.Cell>
{accountsState.length === 0 && (
<span>(not&nbsp;connected)</span>
)
}
{accountsState.length > 0 && accountsState[0]}
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
<br />
<Link rc={<NextLink href="/" />}>Return to Examples</Link>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import { useState } from 'react';
import { ethers } from 'ethers';
import { ProviderEvent } from '@imtbl/sdk/passport';
import { passportInstance } from '../utils';
import { passportInstance } from '../utils/passport';
import { Button, Heading, Link, Table } from '@biom3/react';
import NextLink from 'next/link';

export default function ConnectWithEtherJS() {
// setup the accounts state
Expand Down Expand Up @@ -53,39 +55,51 @@ export default function ConnectWithEtherJS() {

// render the view to login/logout and show the connected accounts
return (
<div className="flex flex-col items-center justify-center min-h-screen p-8">
<h1 className="text-3xl font-bold mb-8">Passport Connect with EtherJS</h1>
<>
<Heading className="mb-1">Passport Connect with EtherJS</Heading>
{accountsState.length === 0
&& (
<button
className="bg-black text-white py-2 px-4 rounded hover:bg-gray-800"
<Button
className="mb-1"
size="medium"
onClick={passportLogin}
disabled={loading}
>
disabled={loading}>
Passport Login
</button>
</Button>
)}
{accountsState.length >= 1
&& (
<button
className="bg-black text-white py-2 px-4 rounded hover:bg-gray-800"
<Button
className="mb-1"
size="medium"
onClick={passportLogout}
disabled={loading}
>
disabled={loading}>
Passport Logout
</button>
</Button>
)}
<br />
{loading
? <p>Loading...</p>
: (
<p>
Connected Account:
{accountsState.length >= 1 ? accountsState : '(not connected)'}
</p>
)}
<br />
<a href="/" className="underline">Return to Examples</a>
</div>
<Table>
<Table.Head>
<Table.Row>
<Table.Cell>Item</Table.Cell>
<Table.Cell>Value</Table.Cell>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.Row>
<Table.Cell><b>Connected Account</b></Table.Cell>
<Table.Cell>
{accountsState.length === 0 && (
<span>(not&nbsp;connected)</span>
)
}
{accountsState.length > 0 && accountsState[0]}
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
<br />
<Link rc={<NextLink href="/" />}>Return to Examples</Link>
</>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import {
useAccount, useDisconnect, useEnsName,
} from 'wagmi';
import { useState } from 'react';
import { passportInstance } from '../utils';
import { passportInstance } from '../utils/passport';
import { Button, Table } from '@biom3/react';

export function Account() {
const { address } = useAccount();
Expand All @@ -24,23 +25,36 @@ export function Account() {
// render the view to show the connected accounts and logout
return (
<>
<button
className="bg-black text-white py-2 px-4 rounded hover:bg-gray-800"
<Button
onClick={() => passportLogout()}
disabled={loading}
type="button"
>
Passport Logout
</button>
<br />
{loading
? <p>Loading...</p>
: (
<p>
Connected Account:
{address && <span>{ensName ? `${ensName} (${address})` : address}</span>}
</p>
)}
</Button>
<Table>
<Table.Head>
<Table.Row>
<Table.Cell>Item</Table.Cell>
<Table.Cell>Value</Table.Cell>
</Table.Row>
</Table.Head>
<Table.Body>
<Table.Row>
<Table.Cell><b>Connected Account</b></Table.Cell>
<Table.Cell>
{!address && (
<span>(not&nbsp;connected)</span>
)
}
{address && (
<span>{ensName ? `${ensName} (${address})` : address}</span>
)}
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>
<br />
</>
);
}
Loading

0 comments on commit 1a4d87a

Please sign in to comment.