changed types around
This commit is contained in:
parent
24e82bbb78
commit
f61d1aa0c3
75 changed files with 3625 additions and 34314 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue