Skip to content

Commit

Permalink
fix: upgrade all dependant packages with yarn upgrade-interactive
Browse files Browse the repository at this point in the history
* remove loggerfactory from library for now, as it gave compatibility issues when imported in other projects

Signed-off-by: Amar Tumballi <[email protected]>
  • Loading branch information
amarts committed Feb 14, 2024
1 parent be68f0e commit 42b7f10
Show file tree
Hide file tree
Showing 20 changed files with 1,018 additions and 1,000 deletions.
52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,36 +38,36 @@
]
},
"devDependencies": {
"@babel/core": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@commitlint/cli": "^9.0.1",
"@commitlint/config-conventional": "^9.0.1",
"@playwright/test": "^1.21.1",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^5.7.0",
"@typescript-eslint/parser": "^5.7.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-jsdoc": "^37.2.0",
"eslint-plugin-license-header": "^0.2.1",
"eslint-plugin-prettier": "^4.0.0",
"husky": "^7.0.0",
"jest": "^29.6.1",
"moment": "^2.29.1",
"prettier": "^2.4.1",
"rimraf": "^3.0.2",
"testcontainers": "^9.0.0",
"ts-jest": "^29.1.1",
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@playwright/test": "^1.41.2",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^37.9.7",
"eslint-plugin-license-header": "^0.6.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^9.0.10",
"jest": "^29.7.0",
"moment": "^2.30.1",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"testcontainers": "^10.7.1",
"ts-jest": "^29.1.2",
"ts-jest-resolver": "^2.0.1",
"tsx": "^3.4.3",
"typedoc": "^0.25.3",
"typescript": "^5.3.0"
"tsx": "^4.7.1",
"typedoc": "^0.25.8",
"typescript": "^5.3.3"
},
"resolutions": {
"typescript": "^5.3.3"
},
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"packageManager": "[email protected]"
}
6 changes: 3 additions & 3 deletions packages/asset/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/asset",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "CORD Asset Management",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -29,8 +29,8 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/config": "workspace:*",
Expand Down
24 changes: 12 additions & 12 deletions packages/augment-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/augment-api",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "",
"types": "./lib/index.d.ts",
"type": "module",
Expand Down Expand Up @@ -40,19 +40,19 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"@polkadot/api": "^10.11.1",
"@polkadot/typegen": "^10.11.1",
"@types/node": "^20.10.5",
"rimraf": "^3.0.2",
"ts-node": "^10.9.1",
"typescript": "^5.3.0",
"yargs": "^16.2.0"
"@polkadot/api": "^10.11.2",
"@polkadot/typegen": "^10.11.2",
"@types/node": "^20.11.17",
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"typescript": "^5.3.3",
"yargs": "^17.7.2"
},
"dependencies": {
"@cord.network/type-definitions": "workspace:*",
"@polkadot/rpc-augment": "^10.11.1",
"@polkadot/rpc-core": "^10.11.1",
"@polkadot/rpc-provider": "^10.11.1",
"glob": "^7.1.1"
"@polkadot/rpc-augment": "^10.11.2",
"@polkadot/rpc-core": "^10.11.2",
"@polkadot/rpc-provider": "^10.11.2",
"glob": "^10.3.10"
}
}
6 changes: 3 additions & 3 deletions packages/chain-space/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/chain-space",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "CORD Chain Space",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -29,8 +29,8 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/config": "workspace:*",
Expand Down
9 changes: 4 additions & 5 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/config",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "",
"type": "commonjs",
"main": "./lib/index.js",
Expand Down Expand Up @@ -31,13 +31,12 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/type-definitions": "workspace:*",
"@cord.network/types": "workspace:*",
"@cord.network/utils": "workspace:*",
"typescript-logging": "^1.0.0"
"@cord.network/utils": "workspace:*"
}
}
3 changes: 0 additions & 3 deletions packages/config/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import * as ConfigService from './Service.js'
* ```typescript
* import { init } from './CordConfig';
*
* const config = { logLevel: 2 };
* init(config).then(() => {
* console.log('CORD SDK initialized and ready.');
* }).catch(error => {
Expand Down Expand Up @@ -82,7 +81,6 @@ export async function init<K extends Partial<ConfigService.configOpts>>(
export async function connect(
blockchainRpcWsUrl: string,
{
noInitWarn = ConfigService.get('logLevel') > 3, // by default warnings are disabled on log level error and higher
...apiOpts
}: Omit<ApiOptions, 'provider'> = {}
): Promise<ApiPromise> {
Expand All @@ -92,7 +90,6 @@ export async function connect(
provider,
typesBundle,
signedExtensions: cordSignedExtensions,
noInitWarn,
...apiOpts,
})

Expand Down
82 changes: 2 additions & 80 deletions packages/config/src/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
*
* Key functionalities include:
* - Setting and retrieving configuration options for the SDK.
* - Modifying log levels to control the verbosity of SDK logging.
* - Resetting configurations to their default values.
* - Checking the presence of specific configuration settings.
*
Expand All @@ -26,62 +25,15 @@

import type { ApiPromise } from '@cord.network/types'

import {
LFService,
LoggerFactoryOptions,
LogGroupRule,
LogLevel,
getLogControl,
LogGroupControlSettings,
} from 'typescript-logging'
import { SDKErrors } from '@cord.network/utils'
import { SubscriptionPromise } from '@cord.network/types'

const DEFAULT_DEBUG_LEVEL =
typeof process !== 'undefined' &&
process.env?.DEBUG &&
process.env.DEBUG === 'true'
? LogLevel.Debug
: LogLevel.Error

export type configOpts = {
api: ApiPromise
logLevel: LogLevel
submitTxResolveOn: SubscriptionPromise.ResultEvaluator
} & { [key: string]: any }

/**
* Modifies the log level for all existing loggers in the default factory.
*
* @remarks
* The log level is constrained between 0 (Trace) and 5 (Fatal).
* If an out-of-range level is provided, it is clamped to the nearest valid value.
*
* @example
* ```typescript
* // Set the log level to Debug
* modifyLogLevel(LogLevel.Debug);
* ```
*
* @param level - The intended log level.
* @returns The actual log level that was set.
*/
export function modifyLogLevel(level: LogLevel): LogLevel {
// eslint-disable-next-line no-nested-ternary
const actualLevel = level > 0 ? (level > 5 ? 5 : level) : 0
getLogControl()
.getLoggerFactoryControl(0)
.change({
group: 'all',
logLevel: LogLevel[actualLevel],
} as LogGroupControlSettings)
return actualLevel
}

const defaultConfig: Partial<configOpts> = {
logLevel: DEFAULT_DEBUG_LEVEL,
}

const defaultConfig: Partial<configOpts> = {}
let configuration: Partial<configOpts> = { ...defaultConfig }

/**
Expand Down Expand Up @@ -112,11 +64,6 @@ export function get<K extends keyof configOpts>(configOpt: K): configOpts[K] {
return configuration[configOpt]
}

function setLogLevel(logLevel: LogLevel | undefined): void {
if (logLevel !== undefined) {
modifyLogLevel(logLevel)
}
}

/**
* Sets one or more configuration options.
Expand All @@ -127,14 +74,13 @@ function setLogLevel(logLevel: LogLevel | undefined): void {
* @example
* ```typescript
* // Set multiple configuration options
* set({ logLevel: LogLevel.Info, customConfig: 'myValue' });
* set({ customConfig: 'myValue' });
* ```
*
* @param opts - An object containing key-value pairs of configuration options.
*/
export function set<K extends Partial<configOpts>>(opts: K): void {
configuration = { ...configuration, ...opts }
setLogLevel(configuration.logLevel)
}

/**
Expand Down Expand Up @@ -178,27 +124,3 @@ export function unset<K extends keyof configOpts>(key: K): void {
export function isSet<K extends keyof configOpts>(key: K): boolean {
return typeof configuration[key] !== 'undefined'
}

// Create options instance and specify 1 LogGroupRule:
// * LogLevel Error on default, env DEBUG = 'true' changes Level to Debug.throws
const options = new LoggerFactoryOptions().addLogGroupRule(
new LogGroupRule(new RegExp('.+'), get('logLevel'))
)

/**
* Factory for creating loggers with predefined log group rules.
*
* @remarks
* This factory is configured based on the defined log level. It supports dynamic log level adjustment.
*
* @example
* ```typescript
* // Create a logger and log an informational message
* const logger = LoggingFactory.getLogger('myLogger');
* logger.info('This is an informational message');
* ```
*/
export const LoggingFactory = LFService.createNamedLoggerFactory(
'LoggerFactory',
options
)
20 changes: 10 additions & 10 deletions packages/did/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/did",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -30,20 +30,20 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/augment-api": "workspace:*",
"@cord.network/config": "workspace:*",
"@cord.network/types": "workspace:*",
"@cord.network/utils": "workspace:*",
"@digitalbazaar/security-context": "^1.0.0",
"@polkadot/api": "^10.11.1",
"@polkadot/keyring": "^12.6.1",
"@polkadot/types": "^10.11.1",
"@polkadot/types-codec": "^10.11.1",
"@polkadot/util": "^12.6.1",
"@polkadot/util-crypto": "^12.6.1"
"@digitalbazaar/security-context": "^1.0.1",
"@polkadot/api": "^10.11.2",
"@polkadot/keyring": "^12.6.2",
"@polkadot/types": "^10.11.2",
"@polkadot/types-codec": "^10.11.2",
"@polkadot/util": "^12.6.2",
"@polkadot/util-crypto": "^12.6.2"
}
}
6 changes: 3 additions & 3 deletions packages/identifier/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/identifier",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "CORD Identifier",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -29,8 +29,8 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/types": "workspace:*",
Expand Down
6 changes: 3 additions & 3 deletions packages/network-score/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cord.network/network-score",
"version": "0.9.0-1beta5",
"version": "0.9.3-1rc4",
"description": "CORD Network Score",
"main": "./lib/cjs/index.js",
"module": "./lib/esm/index.js",
Expand Down Expand Up @@ -29,8 +29,8 @@
"bugs": "https://github.com/dhiway/cord.js/issues",
"homepage": "https://github.com/dhiway/cord.js#readme",
"devDependencies": {
"rimraf": "^3.0.2",
"typescript": "^5.3.0"
"rimraf": "^5.0.5",
"typescript": "^5.3.3"
},
"dependencies": {
"@cord.network/config": "workspace:*",
Expand Down
Loading

0 comments on commit 42b7f10

Please sign in to comment.