Skip to content

Commit 67e8240

Browse files
authored
Merge pull request #57 from geobrowser/fix-build
fix frontend app build
2 parents 8d1ff5a + da7f862 commit 67e8240

File tree

8 files changed

+47
-21
lines changed

8 files changed

+47
-21
lines changed

apps/events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite --force",
8-
"build": "echo 'TODO'",
8+
"build": "tsc -b && vite build",
99
"lint": "pnpm biome lint src/*",
1010
"lint:fix": "pnpm biome lint --write src/*",
1111
"format": "pnpm biome format src/*",

apps/events/src/components/add-user.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export const AddUser: React.FC = () => {
1515
name: newUserName,
1616
age: 30,
1717
18+
badge: {
19+
name: 'Badge',
20+
},
1821
});
1922
setNewUserName('');
2023
}}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ const Login = () => {
1010

1111
const connectWallet = async () => {
1212
let newSigner = null;
13-
let provider;
13+
// biome-ignore lint/suspicious/noExplicitAny: can be improved
14+
let provider: any;
1415

1516
try {
16-
// @ts-expect-error ethereum is defined in the browser
1717
if (window.ethereum == null) {
1818
// If MetaMask is not installed, we use the default provider,
1919
// which is backed by a variety of third-party services (such
@@ -25,7 +25,6 @@ const Login = () => {
2525
// Connect to the MetaMask EIP-1193 object. This is a standard
2626
// protocol that allows Ethers access to make all read-only
2727
// requests through MetaMask.
28-
// @ts-expect-error ethereum is defined in the browser
2928
provider = new ethers.BrowserProvider(window.ethereum);
3029

3130
// It also provides an opportunity to request access to write
@@ -46,7 +45,6 @@ const Login = () => {
4645
async function runEffect() {
4746
const storedSignerAddress = localStorage.getItem('signerAddress');
4847
if (storedSignerAddress) {
49-
// @ts-expect-error ethereum is defined in the browser
5048
const provider = new ethers.BrowserProvider(window.ethereum);
5149
const newSigner = await provider.getSigner();
5250
setSigner(newSigner);
@@ -89,6 +87,7 @@ function XmtpLogin({ signer }: { signer: Signer }) {
8987
redirect({ to: '/space/$spaceId', params: { spaceId: 'abc' } });
9088
};
9189

90+
// biome-ignore lint/correctness/useExhaustiveDependencies: only should run once
9291
useEffect(() => {
9392
void initXmtpWithKeys();
9493
// eslint-disable-next-line react-hooks/exhaustive-deps

apps/events/src/types.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { SpaceEvent, SpaceState } from 'graph-framework';
2+
3+
export type SpaceStorageEntry = {
4+
id: string;
5+
events: SpaceEvent[];
6+
state: SpaceState | undefined;
7+
keys: { id: string; key: string }[];
8+
updates: Uint8Array[];
9+
lastUpdateClock: number;
10+
};

apps/events/tsconfig.app.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
4-
"target": "ES2020",
4+
"target": "ES2021",
55
"useDefineForClassFields": true,
6-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
6+
"lib": ["ES2021", "DOM", "DOM.Iterable"],
77
"module": "ESNext",
88
"skipLibCheck": true,
99

@@ -32,7 +32,19 @@
3232
"paths": {
3333
"@/*": ["./src/*"],
3434
"graph-framework": ["../../packages/graph-framework/src/index.js"],
35-
"graph-framework/*": ["../../packages/graph-framework/src/*.js"]
35+
"graph-framework/*": ["../../packages/graph-framework/src/*.js"],
36+
"graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"],
37+
"graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"],
38+
"graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"],
39+
"graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"],
40+
"graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"],
41+
"graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"],
42+
"graph-framework-key": ["../../packages/graph-framework-key/src/index.js"],
43+
"graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"],
44+
"graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"],
45+
"graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"],
46+
"graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"],
47+
"graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"]
3648
}
3749
},
3850
"include": ["src"]

apps/events/tsconfig.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,19 @@
77
"paths": {
88
"@/*": ["./src/*"],
99
"graph-framework": ["../../packages/graph-framework/src/index.js"],
10-
"graph-framework/*": ["../../packages/graph-framework/src/*.js"]
10+
"graph-framework/*": ["../../packages/graph-framework/src/*.js"],
11+
"graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"],
12+
"graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"],
13+
"graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"],
14+
"graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"],
15+
"graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"],
16+
"graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"],
17+
"graph-framework-key": ["../../packages/graph-framework-key/src/index.js"],
18+
"graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"],
19+
"graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"],
20+
"graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"],
21+
"graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"],
22+
"graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"]
1123
}
1224
}
1325
}

packages/graph-framework-identity/src/restore-identity.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ type Params = {
33
};
44

55
export const restoreIdentity = ({ preKey }: Params) => {
6+
console.log('preKey', preKey);
67
return {
78
signaturePublicKey: '',
89
signaturePrivateKey: '',

packages/graph-framework-schema/src/context.tsx

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
109109
(acc, type) => {
110110
const typeSchema = schema.types[type];
111111

112-
// @ts-expect-error
113112
for (const [key, prop] of Object.entries(typeSchema)) {
114113
if (isRelation(prop)) {
115114
// Handle Relation
@@ -224,11 +223,8 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
224223
const resultData = { ...data };
225224
for (const entityType of entityTypes) {
226225
const typeSchema = schema.types[entityType];
227-
// @ts-expect-error
228226
for (const key of Object.keys(typeSchema)) {
229-
// @ts-expect-error
230227
const prop = typeSchema[key];
231-
// @ts-expect-error
232228
if (isRelation(prop)) {
233229
const relationProp = prop as Relation<SchemaTypeUnknown, SchemaTypeUnknown>;
234230
const { types: relatedTypes, cardinality } = relationProp;
@@ -360,13 +356,7 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
360356
const visitedEntities = new Set<string>();
361357
for (const entityId in filteredEntities) {
362358
const entity = filteredEntities[entityId];
363-
const resolvedEntity = resolveEntity(
364-
entityId,
365-
entity,
366-
// @ts-expect-error
367-
entity.types,
368-
visitedEntities,
369-
);
359+
const resolvedEntity = resolveEntity(entityId, entity, entity.types, visitedEntities);
370360
filteredEntities[entityId] = resolvedEntity;
371361
}
372362

@@ -397,7 +387,6 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
397387
const typeSchema = schema.types[entityType];
398388
for (const key in typeSchema) {
399389
const prop = typeSchema[key];
400-
// @ts-expect-error
401390
if (isRelation(prop)) {
402391
const relationProp = prop as Relation<SchemaTypeUnknown, SchemaTypeUnknown>;
403392
const { cardinality } = relationProp;

0 commit comments

Comments
 (0)