Skip to content

Commit

Permalink
fixup! refactor!: hoist bufferChainSyncEvent to projection package
Browse files Browse the repository at this point in the history
  • Loading branch information
mkazlauskas committed Sep 24, 2024
1 parent 22e6824 commit 37436b1
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable prefer-spread */
import { Bootstrap, ProjectionEvent, logProjectionProgress, requestNext } from '@cardano-sdk/projection';
import { Cardano, ObservableCardanoNode } from '@cardano-sdk/core';
import {
Bootstrap,
ObservableCardanoNode,
ProjectionEvent,
logProjectionProgress,
requestNext
} from '@cardano-sdk/projection';
import { Cardano } from '@cardano-sdk/core';
import { Logger } from 'ts-log';
import { Observable, concat, defer, groupBy, mergeMap, take, takeWhile } from 'rxjs';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
HandleOwnerChangeError,
HandleProvider,
HealthCheckResponse,
ObservableCardanoNode,
ProviderError,
ProviderFailure,
SubmitTxArgs,
Expand All @@ -14,6 +13,7 @@ import {
} from '@cardano-sdk/core';
import { InMemoryCache } from '../InMemoryCache';
import { Logger } from 'ts-log';
import { ObservableCardanoNode } from '@cardano-sdk/projection';
import { WithLogger } from '@cardano-sdk/util';

type ObservableTxSubmitter = Pick<ObservableCardanoNode, 'healthCheck$' | 'submitTx'>;
Expand Down
3 changes: 3 additions & 0 deletions packages/ogmios/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
{
"path": "../../util-rxjs/src"
},
{
"path": "../../projection/src"
},
{
"path": "../../crypto/src"
}
Expand Down
35 changes: 17 additions & 18 deletions packages/projection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
"name": "@cardano-sdk/projection",
"version": "0.11.36",
"description": "Chain Sync event projection",
"engines": {
"node": ">=16.20.2"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"repository": "https://github.com/input-output-hk/cardano-js-sdk",
"license": "Apache-2.0",
"sideEffects": false,
"exports": {
".": {
"development": "./src/index.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"repository": "https://github.com/input-output-hk/cardano-js-sdk",
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"license": "Apache-2.0",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"files": [
"dist/*",
"!dist/tsconfig.tsbuildinfo",
"LICENSE",
"NOTICE"
],
"scripts": {
"build": "yarn build:cjs && tsc -p src/tsconfig.json --outDir ./dist/esm --module es2020 && tsc-alias -p src/tsconfig.json --outDir ./dist/esm && cp ../../build/esm-package.json ./dist/esm/package.json",
"build:cjs": "tsc --build src && cp ../../build/cjs-package.json ./dist/cjs/package.json",
Expand Down Expand Up @@ -49,7 +49,6 @@
"tsc-alias": "^1.8.10"
},
"devDependencies": {
"@cardano-sdk/ogmios": "workspace:~",
"@cardano-sdk/util-dev": "workspace:~",
"eslint": "^7.32.0",
"jest": "^28.1.3",
Expand All @@ -58,10 +57,10 @@
"ts-jest": "^28.0.7",
"typescript": "^4.7.4"
},
"files": [
"dist/*",
"!dist/tsconfig.tsbuildinfo",
"LICENSE",
"NOTICE"
]
"engines": {
"node": ">=16.20.2"
},
"publishConfig": {
"access": "public"
}
}
59 changes: 30 additions & 29 deletions packages/util-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
"name": "@cardano-sdk/util-dev",
"version": "0.22.10",
"description": "Utilities for tests in other packages",
"engines": {
"node": ">=16.20.2"
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"repository": "https://github.com/input-output-hk/cardano-js-sdk",
"license": "Apache-2.0",
"sideEffects": false,
"exports": {
".": {
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
}
},
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"browser": {
"./dist/cjs/docker.js": false,
"./dist/esm/docker.js": false
},
"repository": "https://github.com/input-output-hk/cardano-js-sdk",
"publishConfig": {
"access": "public"
},
"sideEffects": false,
"license": "Apache-2.0",
"files": [
"dist/*",
"!dist/tsconfig.tsbuildinfo",
"LICENSE",
"NOTICE"
],
"scripts": {
"build": "yarn build:cjs && tsc -p src/tsconfig.json --outDir ./dist/esm --module es2020 && tsc-alias -p src/tsconfig.json --outDir ./dist/esm && cp ./esm-package.json ./dist/esm/package.json && cp -rf src/chainSync/data dist/esm/chainSync/",
"build:cjs": "tsc --build src && cp ../../build/cjs-package.json ./dist/cjs/package.json && cp -rf src/chainSync/data dist/cjs/chainSync/",
Expand All @@ -40,18 +40,6 @@
"test:debug": "DEBUG=true yarn test",
"test:e2e": "echo 'test:e2e' command not implemented yet"
},
"devDependencies": {
"@types/dockerode": "^3.3.8",
"@types/jest": "^26.0.24",
"@types/k6": "^0.53.1",
"eslint": "^7.32.0",
"jest": "^28.1.3",
"madge": "^5.0.1",
"npm-run-all": "^4.1.5",
"ts-jest": "^28.0.7",
"tsc-alias": "^1.8.10",
"typescript": "^4.7.4"
},
"dependencies": {
"@cardano-sdk/core": "workspace:~",
"@cardano-sdk/crypto": "workspace:~",
Expand All @@ -70,10 +58,23 @@
"rxjs": "^7.4.0",
"ts-log": "^2.2.4"
},
"files": [
"dist/*",
"!dist/tsconfig.tsbuildinfo",
"LICENSE",
"NOTICE"
]
"devDependencies": {
"@cardano-sdk/projection": "workspace:~",
"@types/dockerode": "^3.3.8",
"@types/jest": "^26.0.24",
"@types/k6": "^0.53.1",
"eslint": "^7.32.0",
"jest": "^28.1.3",
"madge": "^5.0.1",
"npm-run-all": "^4.1.5",
"ts-jest": "^28.0.7",
"tsc-alias": "^1.8.10",
"typescript": "^4.7.4"
},
"engines": {
"node": ">=16.20.2"
},
"publishConfig": {
"access": "public"
}
}
2 changes: 1 addition & 1 deletion packages/util-dev/src/chainSync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import {
GeneralCardanoNodeError,
GeneralCardanoNodeErrorCode,
Intersection,
ObservableCardanoNode,
Point,
PointOrOrigin
} from '@cardano-sdk/core';
import { Observable, of, throwError } from 'rxjs';
import { fromSerializableObject } from '@cardano-sdk/util';
import { genesisToEraSummary } from './genesisToEraSummary';
import memoize from 'lodash/memoize.js';
import type { ObservableCardanoNode } from '@cardano-sdk/projection';

export type SerializedChainSyncEvent =
| Omit<ChainSyncRollForward, 'requestNext'>
Expand Down
3 changes: 3 additions & 0 deletions packages/util-dev/src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"references": [
{
"path": "../../core/src"
},
{
"path": "../../projection/src"
}
]
}
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3923,7 +3923,6 @@ __metadata:
dependencies:
"@cardano-sdk/core": "workspace:~"
"@cardano-sdk/crypto": "workspace:~"
"@cardano-sdk/ogmios": "workspace:~"
"@cardano-sdk/util": "workspace:~"
"@cardano-sdk/util-dev": "workspace:~"
"@cardano-sdk/util-rxjs": "workspace:~"
Expand Down Expand Up @@ -3976,6 +3975,7 @@ __metadata:
"@cardano-sdk/core": "workspace:~"
"@cardano-sdk/crypto": "workspace:~"
"@cardano-sdk/key-management": "workspace:~"
"@cardano-sdk/projection": "workspace:~"
"@cardano-sdk/util": "workspace:~"
"@types/dockerode": ^3.3.8
"@types/jest": ^26.0.24
Expand Down

0 comments on commit 37436b1

Please sign in to comment.