Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite --force",
"build": "echo 'TODO'",
"build": "tsc -b && vite build",
"lint": "pnpm biome lint src/*",
"lint:fix": "pnpm biome lint --write src/*",
"format": "pnpm biome format src/*",
Expand Down
3 changes: 3 additions & 0 deletions apps/events/src/components/add-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ export const AddUser: React.FC = () => {
name: newUserName,
age: 30,
email: '[email protected]',
badge: {
name: 'Badge',
},
});
setNewUserName('');
}}
Expand Down
7 changes: 3 additions & 4 deletions apps/events/src/routes/login.lazy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ const Login = () => {

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

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

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

// biome-ignore lint/correctness/useExhaustiveDependencies: only should run once
useEffect(() => {
void initXmtpWithKeys();
// eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
10 changes: 10 additions & 0 deletions apps/events/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { SpaceEvent, SpaceState } from 'graph-framework';

export type SpaceStorageEntry = {
id: string;
events: SpaceEvent[];
state: SpaceState | undefined;
keys: { id: string; key: string }[];
updates: Uint8Array[];
lastUpdateClock: number;
};
18 changes: 15 additions & 3 deletions apps/events/tsconfig.app.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2020",
"target": "ES2021",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": ["ES2021", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,

Expand Down Expand Up @@ -32,7 +32,19 @@
"paths": {
"@/*": ["./src/*"],
"graph-framework": ["../../packages/graph-framework/src/index.js"],
"graph-framework/*": ["../../packages/graph-framework/src/*.js"]
"graph-framework/*": ["../../packages/graph-framework/src/*.js"],
"graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"],
"graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"],
"graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"],
"graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"],
"graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"],
"graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"],
"graph-framework-key": ["../../packages/graph-framework-key/src/index.js"],
"graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"],
"graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"],
"graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"],
"graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"],
"graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"]
}
},
"include": ["src"]
Expand Down
14 changes: 13 additions & 1 deletion apps/events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,19 @@
"paths": {
"@/*": ["./src/*"],
"graph-framework": ["../../packages/graph-framework/src/index.js"],
"graph-framework/*": ["../../packages/graph-framework/src/*.js"]
"graph-framework/*": ["../../packages/graph-framework/src/*.js"],
"graph-framework-space-events": ["../../packages/graph-framework-space-events/src/index.js"],
"graph-framework-space-events/*": ["../../packages/graph-framework-space-events/src/*.js"],
"graph-framework-messages": ["../../packages/graph-framework-messages/src/index.js"],
"graph-framework-messages/*": ["../../packages/graph-framework-messages/src/*.js"],
"graph-framework-identity": ["../../packages/graph-framework-identity/src/index.js"],
"graph-framework-identity/*": ["../../packages/graph-framework-identity/src/*.js"],
"graph-framework-key": ["../../packages/graph-framework-key/src/index.js"],
"graph-framework-key/*": ["../../packages/graph-framework-key/src/*.js"],
"graph-framework-schema": ["../../packages/graph-framework-schema/src/index.js"],
"graph-framework-schema/*": ["../../packages/graph-framework-schema/src/*.js"],
"graph-framework-utils": ["../../packages/graph-framework-utils/src/index.js"],
"graph-framework-utils/*": ["../../packages/graph-framework-utils/src/*.js"]
}
}
}
1 change: 1 addition & 0 deletions packages/graph-framework-identity/src/restore-identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type Params = {
};

export const restoreIdentity = ({ preKey }: Params) => {
console.log('preKey', preKey);
return {
signaturePublicKey: '',
signaturePrivateKey: '',
Expand Down
13 changes: 1 addition & 12 deletions packages/graph-framework-schema/src/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
(acc, type) => {
const typeSchema = schema.types[type];

// @ts-expect-error
for (const [key, prop] of Object.entries(typeSchema)) {
if (isRelation(prop)) {
// Handle Relation
Expand Down Expand Up @@ -224,11 +223,8 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
const resultData = { ...data };
for (const entityType of entityTypes) {
const typeSchema = schema.types[entityType];
// @ts-expect-error
for (const key of Object.keys(typeSchema)) {
// @ts-expect-error
const prop = typeSchema[key];
// @ts-expect-error
if (isRelation(prop)) {
const relationProp = prop as Relation<SchemaTypeUnknown, SchemaTypeUnknown>;
const { types: relatedTypes, cardinality } = relationProp;
Expand Down Expand Up @@ -360,13 +356,7 @@ export function createFunctions<T extends SchemaDefinition>(schema: T) {
const visitedEntities = new Set<string>();
for (const entityId in filteredEntities) {
const entity = filteredEntities[entityId];
const resolvedEntity = resolveEntity(
entityId,
entity,
// @ts-expect-error
entity.types,
visitedEntities,
);
const resolvedEntity = resolveEntity(entityId, entity, entity.types, visitedEntities);
filteredEntities[entityId] = resolvedEntity;
}

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