Skip to content

Commit 097529c

Browse files
authored
cleanup (#91)
1 parent d0dc130 commit 097529c

29 files changed

+806
-910
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: 6 additions & 14 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",
@@ -40,22 +31,23 @@
4031
"tailwindcss-animate": "^1.0.7",
4132
"uuid": "^11.0.3",
4233
"viem": "^2.21.56",
43-
"vite-plugin-node-polyfills": "^0.22.0"
34+
"vite": "^6.0.7"
4435
},
4536
"devDependencies": {
4637
"@biomejs/biome": "1.9.4",
4738
"@tanstack/router-devtools": "^1.62.1",
4839
"@tanstack/router-plugin": "^1.62.0",
49-
"@types/node": "^22.7.4",
40+
"@types/node": "^22.10.7",
5041
"@types/react": "^18.3.11",
5142
"@types/react-dom": "^18.3.0",
5243
"@types/uuid": "^10.0.0",
53-
"@vitejs/plugin-react": "^4.3.2",
44+
"@vitejs/plugin-react": "^4.3.4",
5445
"autoprefixer": "^10.4.20",
5546
"globals": "^15.10.0",
5647
"postcss": "^8.4.47",
5748
"tailwindcss": "^3.4.13",
49+
"vite-plugin-node-polyfills": "^0.22.0",
5850
"vite-plugin-top-level-await": "^1.4.4",
59-
"vite-plugin-wasm": "^3.3.0"
51+
"vite-plugin-wasm": "^3.4.1"
6052
}
6153
}

apps/events/src/components/auth.tsx

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

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

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

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

35-
if (wallets.length > 0) {
36-
getSigner();
35+
setSigner(newSigner);
36+
})();
3737
}
38-
// eslint-disable-next-line react-hooks/exhaustive-deps
39-
}, [wallets]);
38+
}, [wallets, setSigner, signMessage]);
4039

4140
return (
4241
<>

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
@@ -50,9 +50,11 @@ export const Route = createRootRoute({
5050
<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">
5151
<p className="text-xs text-gray-500 dark:text-gray-400">© 2023 Acme Events. All rights reserved.</p>
5252
<nav className="sm:ml-auto flex gap-4 sm:gap-6">
53+
{/* biome-ignore lint/a11y/useValidAnchor: todo */}
5354
<a className="text-xs hover:underline underline-offset-4" href="#">
5455
Terms of Service
5556
</a>
57+
{/* biome-ignore lint/a11y/useValidAnchor: todo */}
5658
<a className="text-xs hover:underline underline-offset-4" href="#">
5759
Privacy
5860
</a>

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
}

apps/events/tsconfig.json

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
{
2-
"files": [],
3-
"references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }],
4-
"compilerOptions": {
5-
/* Shadcn */
6-
"baseUrl": ".",
7-
"paths": {
8-
"@/*": ["./src/*"],
9-
"@graphprotocol/hypergraph": ["../../packages/hypergraph/src/index.js"],
10-
"@graphprotocol/hypergraph/*": ["../../packages/hypergraph/src/*.js"]
11-
}
12-
}
2+
"extends": "../../tsconfig.base.json",
3+
"include": [],
4+
"references": [
5+
{ "path": "./tsconfig.app.json" },
6+
{ "path": "./tsconfig.node.json" }
7+
]
138
}

apps/events/tsconfig.node.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": ["vite.config.ts"],
34
"compilerOptions": {
45
"target": "ES2022",
56
"lib": ["ES2023"],
@@ -24,6 +25,5 @@
2425
"noUnusedLocals": true,
2526
"noUnusedParameters": true,
2627
"noFallthroughCasesInSwitch": true
27-
},
28-
"include": ["vite.config.ts"]
28+
}
2929
}

0 commit comments

Comments
 (0)