From 5b85900da3147a8b437c492067a8f74a1e440484 Mon Sep 17 00:00:00 2001 From: Takadenoshi Date: Wed, 19 Jul 2023 15:21:07 +0300 Subject: [PATCH 1/2] Changed default export at index to named export --- ...-client-change-default-export_2023-07-19-12-19.json | 10 ++++++++++ packages/libs/chainweb-stream-client/README.md | 2 +- .../etc/chainweb-stream-client.api.md | 3 +-- packages/libs/chainweb-stream-client/package.json | 2 +- .../libs/chainweb-stream-client/src/examples/index.ts | 2 +- packages/libs/chainweb-stream-client/src/index.ts | 4 +--- 6 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json diff --git a/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json b/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json new file mode 100644 index 00000000000..d5efbfbfc32 --- /dev/null +++ b/common/changes/@kadena/chainweb-stream-client/chore-chainweb-stream-client-change-default-export_2023-07-19-12-19.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@kadena/chainweb-stream-client", + "comment": "Changed default export at index to named export", + "type": "patch" + } + ], + "packageName": "@kadena/chainweb-stream-client" +} \ No newline at end of file diff --git a/packages/libs/chainweb-stream-client/README.md b/packages/libs/chainweb-stream-client/README.md index c4aab7e03b1..aa85f0c7e75 100644 --- a/packages/libs/chainweb-stream-client/README.md +++ b/packages/libs/chainweb-stream-client/README.md @@ -45,7 +45,7 @@ yarn add @kadena/chainweb-stream-client ## Usage ```js -import ChainwebStreamClient from '@kadena/chainweb-stream-client'; +import { ChainwebStreamClient } from '@kadena/chainweb-stream-client'; const client = new ChainwebStreamClient({ network: 'mainnet01', diff --git a/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md b/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md index 5c86f63889c..879becedf80 100644 --- a/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md +++ b/packages/libs/chainweb-stream-client/etc/chainweb-stream-client.api.md @@ -7,7 +7,7 @@ import EventEmitter from 'eventemitter2'; // @alpha (undocumented) -class ChainwebStream extends EventEmitter { +export class ChainwebStreamClient extends EventEmitter { constructor({ network, host, type, id, limit, connectTimeout, maxReconnects, heartbeatTimeout, confirmationDepth, }: IChainwebStreamConstructorArgs); // (undocumented) confirmationDepth: number; @@ -31,7 +31,6 @@ class ChainwebStream extends EventEmitter { // (undocumented) type: ChainwebStreamType; } -export default ChainwebStream; // @alpha (undocumented) export type ChainwebStreamType = 'event' | 'account'; diff --git a/packages/libs/chainweb-stream-client/package.json b/packages/libs/chainweb-stream-client/package.json index 0abf8b42f27..e99f1056452 100644 --- a/packages/libs/chainweb-stream-client/package.json +++ b/packages/libs/chainweb-stream-client/package.json @@ -1,6 +1,6 @@ { "name": "@kadena/chainweb-stream-client", - "version": "0.0.9", + "version": "0.0.10", "description": "Chainweb-stream client for browsers and node.js", "keywords": [], "repository": { diff --git a/packages/libs/chainweb-stream-client/src/examples/index.ts b/packages/libs/chainweb-stream-client/src/examples/index.ts index d6639759128..89869dcff09 100644 --- a/packages/libs/chainweb-stream-client/src/examples/index.ts +++ b/packages/libs/chainweb-stream-client/src/examples/index.ts @@ -1,4 +1,4 @@ -import ChainwebStreamClient, { ITransaction } from '../'; +import { ChainwebStreamClient, ITransaction } from '../'; const client: ChainwebStreamClient = new ChainwebStreamClient({ // required diff --git a/packages/libs/chainweb-stream-client/src/index.ts b/packages/libs/chainweb-stream-client/src/index.ts index 40a9634d403..41fc6eb1b6e 100644 --- a/packages/libs/chainweb-stream-client/src/index.ts +++ b/packages/libs/chainweb-stream-client/src/index.ts @@ -34,7 +34,7 @@ const DEFAULT_LIMIT: number = 100; /** * @alpha */ -class ChainwebStream extends EventEmitter { +export class ChainwebStreamClient extends EventEmitter { // chainweb network, e.g. mainnet01 public network: string; @@ -493,5 +493,3 @@ class ChainwebStream extends EventEmitter { this.emit('debug', debugMsg); } } - -export default ChainwebStream; From 5d5c3396daa3d10adf68682852ddea704508d401 Mon Sep 17 00:00:00 2001 From: Takadenoshi Date: Wed, 19 Jul 2023 17:01:51 +0300 Subject: [PATCH 2/2] README table fix, was broken by autoformatter --- .../libs/chainweb-stream-client/README.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/libs/chainweb-stream-client/README.md b/packages/libs/chainweb-stream-client/README.md index aa85f0c7e75..6893b184b2e 100644 --- a/packages/libs/chainweb-stream-client/README.md +++ b/packages/libs/chainweb-stream-client/README.md @@ -63,17 +63,17 @@ Find more detailed examples under `src/examples`. ## Constructor Options -| Key | Required | Description | Example Values | | | -| ----------------- | :------: | --------------------------------------------------------------- | ----------------------- | --------- | ----- | -| network | Yes | Chainweb network | \`mainnet01 | testnet04 | ...\` | -| type | Yes | Transaction type to stream (event/account) | \`event | account\` | | -| id | Yes | Account ID or module/event name | `k:abcdef01234..` | | | -| host | Yes | Chainweb-stream backend URL | `http://localhost:4000` | | | -| limit | No | Initial data load limit | 100 | | | -| connectTimeout | No | Connection timeout in ms | 10_000 | | | -| heartbeatTimeout | No | Stale connection timeout in ms | 30_000 | | | -| maxReconnects | No | How many reconnections to attempt before giving up | 5 | | | -| confirmationDepth | No | How many confirmations for a transaction to be considered final | 6 | | | +| Key | Required | Description | Example Values | +| ----------------- | :------: | --------------------------------------------------------------- | --------------------------- | +| network | Yes | Chainweb network | `mainnet01`/`testnet04`/... | +| type | Yes | Transaction type to stream (event/account) | `event`/`account` | +| id | Yes | Account ID or module/event name | `k:abcdef01234..` | +| host | Yes | Chainweb-stream backend URL | `http://localhost:4000` | +| limit | No | Initial data load limit | 100 | +| connectTimeout | No | Connection timeout in ms | 10_000 | +| heartbeatTimeout | No | Stale connection timeout in ms | 30_000 | +| maxReconnects | No | How many reconnections to attempt before giving up | 5 | +| confirmationDepth | No | How many confirmations for a transaction to be considered final | 6 | ## Considerations ⚠️