Skip to content

Commit 8ba6ee3

Browse files
committed
cleanup and build process
1 parent 5ea4aae commit 8ba6ee3

32 files changed

+148
-291
lines changed

.github/workflows/tests-and-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
- name: Generate Prisma Types
2626
run: cd apps/server && pnpm prisma generate
2727
- name: Typecheck
28-
run: pnpm ts:check
29-
- name: Linting & Formatting
3028
run: pnpm check
29+
- name: Linting & Formatting
30+
run: pnpm lint
3131
- name: Test
3232
run: pnpm test

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
dist
22
build
3+
publish
34
output
45

56
# Logs
@@ -10,6 +11,9 @@ yarn-debug.log*
1011
yarn-error.log*
1112
lerna-debug.log*
1213

14+
# Local database
15+
*.db
16+
1317
# Runtime data
1418
pids
1519
*.pid

apps/events/.gitignore

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/events/package.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite --force",
8-
"build": "tsc -b && vite build",
9-
"lint": "pnpm biome lint src/*",
10-
"lint:fix": "pnpm biome lint --write src/*",
11-
"format": "pnpm biome format src/*",
12-
"format:fix": "pnpm biome format --write src/*",
13-
"check": "pnpm biome check src/*",
14-
"check:fix": "pnpm biome check --write src/*",
15-
"preview": "vite preview",
16-
"test": "vitest run",
17-
"ts:check": "tsc --noEmit"
8+
"preview": "vite preview"
189
},
1910
"dependencies": {
2011
"@automerge/automerge": "^v2.2.9-alpha.3",
@@ -39,8 +30,7 @@
3930
"tailwind-merge": "^2.5.3",
4031
"tailwindcss-animate": "^1.0.7",
4132
"uuid": "^11.0.3",
42-
"viem": "^2.21.56",
43-
"vite-plugin-node-polyfills": "^0.22.0"
33+
"viem": "^2.21.56"
4434
},
4535
"devDependencies": {
4636
"@biomejs/biome": "1.9.4",
@@ -55,6 +45,7 @@
5545
"globals": "^15.10.0",
5646
"postcss": "^8.4.47",
5747
"tailwindcss": "^3.4.13",
48+
"vite-plugin-node-polyfills": "^0.22.0",
5849
"vite-plugin-top-level-await": "^1.4.4",
5950
"vite-plugin-wasm": "^3.3.0"
6051
}

apps/events/src/components/auth.tsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function DoGraphLogin() {
88
useEffect(() => {
99
console.log('Logging in to The Graph');
1010
login();
11-
}, []);
11+
}, [login]);
1212
return <div />;
1313
}
1414

@@ -17,27 +17,26 @@ function Auth({ children }: { children: React.ReactNode }) {
1717
const { wallets } = useWallets();
1818
const [signer, setSigner] = useState<Identity.Signer | null>(null);
1919

20+
// biome-ignore lint/correctness/useExhaustiveDependencies: todo [this is kinda ugly]
2021
useEffect(() => {
21-
const getSigner = async () => {
22-
const embeddedWallet = wallets.find((wallet) => wallet.walletClientType === 'privy') || wallets[0];
23-
const provider = await embeddedWallet.getEthersProvider();
24-
const newSigner = provider.getSigner();
25-
if (embeddedWallet.walletClientType === 'privy') {
26-
newSigner.signMessage = async (message) => {
27-
// @ts-expect-error signMessage is a string in this case
28-
const signature = await signMessage(message); //, uiConfig);
22+
if (wallets.length > 0) {
23+
(async () => {
24+
const embeddedWallet = wallets.find((wallet) => wallet.walletClientType === 'privy') || wallets[0];
25+
const provider = await embeddedWallet.getEthersProvider();
26+
const newSigner = provider.getSigner();
2927

30-
return signature;
31-
};
32-
}
33-
setSigner(newSigner);
34-
};
28+
if (embeddedWallet.walletClientType === 'privy') {
29+
newSigner.signMessage = async (message) => {
30+
// @ts-expect-error signMessage is a string in this case
31+
const signature = await signMessage(message); //, uiConfig);
32+
return signature;
33+
};
34+
}
3535

36-
if (wallets.length > 0) {
37-
getSigner();
36+
setSigner(newSigner);
37+
})();
3838
}
39-
// eslint-disable-next-line react-hooks/exhaustive-deps
40-
}, [wallets]);
39+
}, [wallets, setSigner, signMessage]);
4140

4241
return (
4342
<>

apps/events/src/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createRoot } from 'react-dom/client';
22
import { Boot } from './Boot.js';
33
import './index.css';
44

5+
// biome-ignore lint/style/noNonNullAssertion: root element is always there
56
createRoot(document.getElementById('root')!).render(
67
// <StrictMode>
78
<Boot />,

apps/events/src/routes/__root.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export const Route = createRootRoute({
3030
<footer className="flex flex-col gap-2 sm:flex-row py-6 w-full shrink-0 items-center px-4 md:px-6 border-t">
3131
<p className="text-xs text-gray-500 dark:text-gray-400">© 2023 Acme Events. All rights reserved.</p>
3232
<nav className="sm:ml-auto flex gap-4 sm:gap-6">
33+
{/* biome-ignore lint/a11y/useValidAnchor: todo */}
3334
<a className="text-xs hover:underline underline-offset-4" href="#">
3435
Terms of Service
3536
</a>
37+
{/* biome-ignore lint/a11y/useValidAnchor: todo */}
3638
<a className="text-xs hover:underline underline-offset-4" href="#">
3739
Privacy
3840
</a>

apps/events/src/routes/login.lazy.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,17 @@ function Login() {
1414
const disableLogin = !ready || (ready && authenticated);
1515
const { authenticated: graphAuthenticated } = Identity.useGraphLogin();
1616
const router = useRouter();
17-
const redirectToPlayground = () => {
18-
router.navigate({
19-
to: '/playground',
20-
});
21-
};
2217

2318
useEffect(() => {
2419
console.log('Privy Authenticated', authenticated);
2520
console.log('The Graph Authenticated', graphAuthenticated);
2621
if (authenticated && graphAuthenticated) {
27-
redirectToPlayground();
22+
router.navigate({
23+
to: '/playground',
24+
});
2825
}
29-
}, [authenticated, graphAuthenticated]);
26+
}, [authenticated, router, graphAuthenticated]);
27+
3028
return (
3129
<div className="flex flex-1 justify-center items-center flex-col gap-4">
3230
{(!ready || !authenticated) && (

apps/events/src/routes/playground.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const App = ({
6363
console.log('Authenticated: ', isAuthenticated());
6464
console.log('Session Token: ', getSessionToken());
6565
console.log('Identity: ', getIdentity());
66-
}, [accountId]);
66+
}, [accountId, isAuthenticated, getSessionToken, getIdentity]);
6767
return (
6868
<>
6969
<div>

apps/events/tsconfig.app.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"extends": "../../tsconfig.base.json",
3+
"include": ["src"],
34
"compilerOptions": {
45
"target": "ES2021",
56
"useDefineForClassFields": true,
@@ -34,6 +35,5 @@
3435
"@graphprotocol/hypergraph": ["../../packages/hypergraph/src/index.js"],
3536
"@graphprotocol/hypergraph/*": ["../../packages/hypergraph/src/*.js"]
3637
}
37-
},
38-
"include": ["src"]
38+
}
3939
}

0 commit comments

Comments
 (0)