Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add typecheck workflow #540

Merged
merged 8 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: last fix
Signed-off-by: Sacha Froment <[email protected]>
  • Loading branch information
sfroment committed Mar 7, 2025
commit fd52c615a215b2ea5d482bc4ca5a59df92660226
4 changes: 2 additions & 2 deletions examples/grid/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DRPNode, type DRPNodeConfig } from "@ts-drp/node";
import { DRPNode } from "@ts-drp/node";
import { enableTracing, OpentelemetryMetrics } from "@ts-drp/tracer";
import { type IMetrics } from "@ts-drp/types";
import { type DRPNodeConfig, type IMetrics } from "@ts-drp/types";

import { env } from "./env";
import { Grid } from "./objects/grid";
Expand Down
11 changes: 5 additions & 6 deletions packages/blueprints/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"compilerOptions": {
"outDir": "dist"
},
"references": [
{
"path": "../object"
}
"include": [
"src/**/*.ts"
],
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.asc.ts"]
"exclude": [
"src/**/*.asc.ts"
]
}
1 change: 0 additions & 1 deletion packages/network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
"devDependencies": {
"@ts-drp/keychain": "0.8.5",
"@ts-drp/node": "0.8.5",
"race-event": "^1.3.0"
},
"dependencies": {
Expand Down
8 changes: 4 additions & 4 deletions packages/network/tests/network.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import {
type Libp2p,
type SubscriptionChangeData,
} from "@libp2p/interface";
import { loadConfig } from "@ts-drp/node";
import { Message } from "@ts-drp/types";
import { type DRPNodeConfig, Message } from "@ts-drp/types";
import { raceEvent } from "race-event";
import { beforeAll, describe, expect, test, afterAll } from "vitest";

import rawConfig from "../../../configs/local-bootstrap.json" with { type: "json" };
import { DRPNetworkNode, type DRPNetworkNodeConfig, streamToUint8Array } from "../src/node.js";

describe("DRPNetworkNode can connect & send messages", () => {
Expand Down Expand Up @@ -42,9 +42,9 @@ describe("DRPNetworkNode can connect & send messages", () => {
};

beforeAll(async () => {
const configPath = `${__dirname}/../../../configs/local-bootstrap.json`;
const config: DRPNodeConfig = rawConfig;
const bootstrapConfig: DRPNetworkNodeConfig = {
...loadConfig(configPath)?.network_config,
...config.network_config,
log_config: { level: "silent" },
};
bootstrapNode = new DRPNetworkNode(bootstrapConfig);
Expand Down
3 changes: 1 addition & 2 deletions packages/node/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import type { DRPNodeConfig } from "@ts-drp/types";
import * as dotenv from "dotenv";
import fs from "node:fs";

import type { DRPNodeConfig } from "./index.js";

export function loadConfig(configPath?: string | undefined): DRPNodeConfig | undefined {
let config: DRPNodeConfig | undefined;

Expand Down
13 changes: 3 additions & 10 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import type { GossipsubMessage } from "@chainsafe/libp2p-gossipsub";
import type { EventCallback, IncomingStreamData, StreamHandler } from "@libp2p/interface";
import { type KeychainConfig, Keychain } from "@ts-drp/keychain";
import { Keychain } from "@ts-drp/keychain";
import { Logger } from "@ts-drp/logger";
import { DRPNetworkNode, type DRPNetworkNodeConfig } from "@ts-drp/network";
import { DRPNetworkNode } from "@ts-drp/network";
import { DRPObject } from "@ts-drp/object";
import {
type IMetrics,
type DRPNodeConfig,
Message,
MessageType,
type IACL,
type IDRP,
type LoggerOptions,
type IDRPObject,
} from "@ts-drp/types";

Expand All @@ -25,13 +25,6 @@ export { loadConfig };

export { serializeStateMessage, deserializeStateMessage };

// snake_casing to match the JSON config
export interface DRPNodeConfig {
log_config?: LoggerOptions;
network_config?: DRPNetworkNodeConfig;
keychain_config?: KeychainConfig;
}

export class DRPNode {
config?: DRPNodeConfig;
objectStore: DRPObjectStore;
Expand Down
4 changes: 3 additions & 1 deletion packages/node/src/run.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { type DRPNodeConfig } from "@ts-drp/types";

import { program } from "./cli/index.js";
import { loadConfig } from "./config.js";
import { type DRPNodeConfig, DRPNode } from "./index.js";
import { DRPNode } from "./index.js";
import { init as rpc_init } from "./rpc/index.js";

export const run = async (port: number = 6969): Promise<void> => {
Expand Down
4 changes: 2 additions & 2 deletions packages/object/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"devDependencies": {
"@bufbuild/protobuf": "^2.0.0",
"@ts-drp/blueprints": "^0.8.5",
"@ts-drp/keychain": "workspace:0.8.5",
"@ts-drp/node": "workspace:0.8.5",
"@ts-drp/keychain": "^0.8.5",
"@ts-drp/node": "^0.8.5",
"@types/benchmark": "^2.1.5",
"benchmark": "^2.1.4",
"pprof": "^4.0.0",
Expand Down
73 changes: 35 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading