Skip to content
This repository was archived by the owner on Jan 10, 2025. It is now read-only.

Commit e2b3c65

Browse files
committed
docs for o11y and enable type check
1 parent f391a0e commit e2b3c65

File tree

10 files changed

+19
-6
lines changed

10 files changed

+19
-6
lines changed

.github/workflows/ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
matrix:
1616
check:
1717
- format
18+
- types
1819
name: Check ${{ matrix.check }}
1920
runs-on: ubuntu-latest
2021
steps:

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Here is a high-level overview of what different directories in this repository d
1414
- [**`substream-listener`**](./substream-listener/): A Node.js service that subscribes an Event Stream from a Substream for a webhook user project and pushes the data to SVIX project configured for the User.
1515
- [**`utils`**](./substream-listener/): Shared utilities and types between the different services.
1616
- [**`deployments`**](./deployments/): Pulumi code to deploy infrastructure and services to various providers.
17+
- [**`prometheus`**](./prometheus/): Local development Prometheus setup to monitor the services.
18+
- [**`grafana`**](./grafana/): Local development Grafana setup to visualize the metrics from Prometheus.
1719

1820
## Running the project
1921

management-api/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dev": "wrangler dev --port 8787",
88
"deploy": "wrangler deploy",
99
"cf-typegen": "wrangler types",
10+
"check:types": "tsc --noEmit",
1011
"generate:graphql": "tsx ./scripts/generate-schema.ts",
1112
"generate:sqlite": "drizzle-kit generate:sqlite",
1213
"generate": "pnpm run generate:graphql && pnpm run generate:sqlite"

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"scripts": {
99
"postinstall": "cd erc721-substream && make pack",
1010
"format": "prettier --write .",
11+
"check:types": "pnpm --filter substream-listener --filter management-api --filter web check:types",
1112
"check:format": "prettier --check .",
1213
"dev": "pnpm --filter substream-listener --filter management-api --filter web dev",
1314
"docker:build": "docker build -t graphwebhooks-base:local . && docker buildx bake -f docker/docker.hcl --load build --set service-base.args.BASE_IMAGE=graphwebhooks-base:local"

substream-listener/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "0.0.1",
44
"scripts": {
55
"start": "tsx ./src/index.mts",
6-
"dev": "tsx --env-file .env --watch ./src/index.mts | pino-pretty"
6+
"dev": "tsx --env-file .env --watch ./src/index.mts | pino-pretty",
7+
"check:types": "tsc --noEmit"
78
},
89
"dependencies": {
910
"@connectrpc/connect-node": "1.4.0",

substream-listener/src/index.mts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createRouter, Response } from "fets";
22
import { App } from "uWebSockets.js";
3-
import { isAddress } from "viem";
3+
import { Address, isAddress } from "viem";
44
import {
55
invalidHttpRequests,
66
registry,
@@ -139,7 +139,7 @@ const router = createRouter({
139139
const job = await schedule({
140140
appId,
141141
startBlock,
142-
contractAddress: contractAddress.toLowerCase(),
142+
contractAddress: contractAddress.toLowerCase() as Address,
143143
token: substreamsToken,
144144
outputModule: OUTPUT_MODULE,
145145
substreamsEndpoint: BASE_URL,

substream-listener/src/scheduler.mts

+3
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ export function createScheduler(config: {
139139
const transport = createGrpcWebTransport({
140140
baseUrl: substreamsEndpoint,
141141
httpVersion: "2",
142+
// @ts-ignore - not sure what the issue is here
142143
interceptors: [createAuthInterceptor(token)],
143144
jsonOptions: {
145+
// @ts-ignore - not sure what the issue is here
144146
typeRegistry: registry,
145147
},
146148
});
@@ -156,6 +158,7 @@ export function createScheduler(config: {
156158
});
157159

158160
// NodeJS Events
161+
// @ts-ignore - not sure what the issue is here
159162
const emitter = new BlockEmitter(transport, request, registry);
160163

161164
// Setup tracing of metrics for Prometheus

substream-listener/tsconfig.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
{
2-
"extends": "@tsconfig/node20/tsconfig.json"
2+
"extends": "@tsconfig/node20/tsconfig.json",
3+
"compilerOptions": {
4+
"skipLibCheck": true
5+
}
36
}

web/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
1111
"preview": "vite preview",
1212
"relay": "relay-compiler",
13-
"relay:clean": "rimraf $(find . -type d -name __generated__)"
13+
"relay:clean": "rimraf $(find . -type d -name __generated__)",
14+
"check:types": "tsc --noEmit"
1415
},
1516
"relay": {
1617
"src": "./src",

web/src/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "./global.css";
22
import React from "react";
33
import ReactDOM from "react-dom/client";
4-
import { LogtoProvider, LogtoConfig, Prompt, UserScope } from "@logto/react";
4+
import { LogtoProvider, LogtoConfig, Prompt } from "@logto/react";
55
import { RelayEnvironmentProvider } from "react-relay";
66
import { RouterProvider, createRouter } from "@tanstack/react-router";
77

0 commit comments

Comments
 (0)