changed types around

This commit is contained in:
Bojan Kucera 2025-06-03 17:52:02 -04:00
parent 24e82bbb78
commit f61d1aa0c3
75 changed files with 3625 additions and 34314 deletions

View file

@ -157,7 +157,7 @@ Market Data Gateway
├── ✅ Hono (Web framework)
├── ✅ ioredis (Redis client)
├── ✅ @stock-bot/config (Workspace package)
├── ✅ @stock-bot/shared-types (Workspace package)
├── ✅ @stock-bot/types (Workspace package)
└── ✅ ws (WebSocket library)
Trading Dashboard

View file

@ -6,12 +6,12 @@ This guide describes how the project architecture has been improved to better se
We've reorganized the project's shared libraries for improved maintainability:
### 1. Shared Types (`@stock-bot/shared-types`)
### 1. Shared Types (`@stock-bot/types`)
Types are now organized by domain:
```
libs/shared-types/
libs/types/
├── src/
│ ├── market/ # Market data types (OHLCV, OrderBook)
│ ├── trading/ # Trading types (Orders, Positions)

View file

@ -8,8 +8,8 @@ This guide will help you migrate your service to use the new library structure f
```diff
"dependencies": {
- "@stock-bot/shared-types": "workspace:*",
+ "@stock-bot/shared-types": "workspace:*",
- "@stock-bot/types": "workspace:*",
+ "@stock-bot/types": "workspace:*",
+ "@stock-bot/utils": "workspace:*",
+ "@stock-bot/event-bus": "workspace:*",
+ "@stock-bot/api-client": "workspace:*",
@ -20,10 +20,10 @@ This guide will help you migrate your service to use the new library structure f
2. Update your imports to use the domain-specific modules:
```diff
- import { OHLCV, Strategy, Order } from '@stock-bot/shared-types';
+ import { OHLCV } from '@stock-bot/shared-types';
+ import { Strategy } from '@stock-bot/shared-types';
+ import { Order } from '@stock-bot/shared-types';
- import { OHLCV, Strategy, Order } from '@stock-bot/types';
+ import { OHLCV } from '@stock-bot/types';
+ import { Strategy } from '@stock-bot/types';
+ import { Order } from '@stock-bot/types';
```
For logging:
@ -48,7 +48,7 @@ For event-based communication:
```diff
- // Manual Redis/Dragonfly usage
+ import { createEventBus } from '@stock-bot/event-bus';
+ import { MarketDataEvent } from '@stock-bot/shared-types';
+ import { MarketDataEvent } from '@stock-bot/types';
+
+ const eventBus = createEventBus({
+ redisHost: process.env.REDIS_HOST || 'localhost',
@ -64,12 +64,12 @@ For event-based communication:
```typescript
// Before
import { Strategy, BacktestConfig } from '@stock-bot/shared-types';
import { Strategy, BacktestConfig } from '@stock-bot/types';
import Redis from 'ioredis';
// After
import { Strategy } from '@stock-bot/shared-types';
import { BacktestConfig } from '@stock-bot/shared-types';
import { Strategy } from '@stock-bot/types';
import { BacktestConfig } from '@stock-bot/types';
import { createLogger } from '@stock-bot/utils';
import { createEventBus } from '@stock-bot/event-bus';
@ -88,8 +88,8 @@ If your turbo.json configuration references specific packages, update the depend
"backtest": {
"dependsOn": [
"^build",
- "packages/shared-types#build"
+ "libs/shared-types#build",
- "packages/types#build"
+ "libs/types#build",
+ "libs/utils#build",
+ "libs/event-bus#build",
+ "libs/api-client#build"