From 26dbbaf8190c282df2f3e7d0c5c52e243b1ea619 Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Wed, 11 Dec 2024 20:37:46 -0500 Subject: [PATCH 01/12] feat: adding logging hook and tests feat: adds info and debug implementations to DefaultLogger Signed-off-by: Kevin Long --- packages/shared/src/hooks/logging-hook.ts | 70 ++++++++ packages/shared/src/logger/default-logger.ts | 10 +- packages/shared/test/logger-hook.spec.ts | 160 +++++++++++++++++++ 3 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 packages/shared/src/hooks/logging-hook.ts create mode 100644 packages/shared/test/logger-hook.spec.ts diff --git a/packages/shared/src/hooks/logging-hook.ts b/packages/shared/src/hooks/logging-hook.ts new file mode 100644 index 000000000..d4cb9353e --- /dev/null +++ b/packages/shared/src/hooks/logging-hook.ts @@ -0,0 +1,70 @@ +import type { OpenFeatureError } from '../errors'; +import type { BaseHook } from './hook'; +import type { BeforeHookContext, HookContext, HookHints } from './hooks'; +import type { FlagValue, EvaluationDetails } from '../evaluation'; + +import { DefaultLogger, SafeLogger } from '../logger'; + +type LoggerPayload = Record; + +const DOMAIN_KEY = 'domain'; +const PROVIDER_NAME_KEY = 'provider_name'; +const FLAG_KEY_KEY = 'flag_key'; +const DEFAULT_VALUE_KEY = 'default_value'; +const EVALUATION_CONTEXT_KEY = 'evaluation_context'; +const ERROR_CODE_KEY = 'error_code'; +const ERROR_MESSAGE_KEY = 'error_message'; +const REASON_KEY = 'reason'; +const VARIANT_KEY = 'variant'; +const VALUE_KEY = 'value'; + +export class LoggingHook implements BaseHook { + readonly includeEvaluationContext: boolean = false; + readonly logger = new SafeLogger(new DefaultLogger()); + + constructor(includeEvaluationContext: boolean = false) { + this.includeEvaluationContext = !!includeEvaluationContext; + } + + before(hookContext: BeforeHookContext): void { + const payload: LoggerPayload = { stage: 'before' }; + this.addCommonProps(payload, hookContext); + this.logger.debug(payload); + } + + after(hookContext: Readonly>, evaluationDetails: EvaluationDetails): void { + const payload: LoggerPayload = { stage: 'after' }; + + payload[REASON_KEY] = evaluationDetails.reason; + payload[VARIANT_KEY] = evaluationDetails.variant; + payload[VALUE_KEY] = evaluationDetails.value; + + this.addCommonProps(payload, hookContext); + this.logger.debug(payload); + } + + error(hookContext: Readonly>, error: OpenFeatureError): void { + const payload: LoggerPayload = { stage: 'error' }; + + payload[ERROR_MESSAGE_KEY] = error.message; + payload[ERROR_CODE_KEY] = error.code; + + this.addCommonProps(payload, hookContext); + this.logger.error(payload); + } + + finally(hookContext: Readonly>, hookHints?: HookHints): void { + this.logger.info(hookContext, hookHints); + } + + private addCommonProps(payload: LoggerPayload, hookContext: HookContext): void { + payload[DOMAIN_KEY] = hookContext.clientMetadata.domain; + payload[PROVIDER_NAME_KEY] = hookContext.providerMetadata.name; + payload[FLAG_KEY_KEY] = hookContext.flagKey; + payload[DEFAULT_VALUE_KEY] = hookContext.defaultValue; + + if (this.includeEvaluationContext) { + payload[EVALUATION_CONTEXT_KEY] = hookContext.context; + } + } +} diff --git a/packages/shared/src/logger/default-logger.ts b/packages/shared/src/logger/default-logger.ts index 111ef6125..287c6ca99 100644 --- a/packages/shared/src/logger/default-logger.ts +++ b/packages/shared/src/logger/default-logger.ts @@ -11,7 +11,11 @@ export class DefaultLogger implements Logger { console.warn(...args); } - info(): void {} - - debug(): void {} + info(...args: unknown[]): void { + console.info(...args); + } + + debug(...args: unknown[]): void { + console.debug(...args); + } } diff --git a/packages/shared/test/logger-hook.spec.ts b/packages/shared/test/logger-hook.spec.ts new file mode 100644 index 000000000..b4df3ea19 --- /dev/null +++ b/packages/shared/test/logger-hook.spec.ts @@ -0,0 +1,160 @@ +import { GeneralError } from '../src/errors'; +import type { HookContext } from '../src/hooks/hooks'; +import { LoggingHook } from '../src/hooks/logging-hook'; +import type { SafeLogger } from '../src/logger'; + +describe('LoggingHook', () => { + const FLAG_KEY = 'some-key'; + const DEFAULT_VALUE = 'default'; + const DOMAIN = 'some-domain'; + const PROVIDER_NAME = 'some-provider'; + const REASON = 'some-reason'; + const VALUE = 'some-value'; + const VARIANT = 'some-variant'; + const ERROR_MESSAGE = 'some fake error!'; + const DOMAIN_KEY = 'domain'; + const PROVIDER_NAME_KEY = 'provider_name'; + const FLAG_KEY_KEY = 'flag_key'; + const DEFAULT_VALUE_KEY = 'default_value'; + const EVALUATION_CONTEXT_KEY = 'evaluation_context'; + const ERROR_CODE_KEY = 'error_code'; + const ERROR_MESSAGE_KEY = 'error_message'; + + // const ERROR_CODE = 'GENERAL'; + + let hookContext: HookContext; + let logger: SafeLogger; + + beforeEach(() => { + const mockProviderMetaData = { name: PROVIDER_NAME }; + + // Mock the hook context + hookContext = { + flagKey: FLAG_KEY, + defaultValue: DEFAULT_VALUE, + flagValueType: 'boolean', + context: { targetingKey: 'some-targeting-key' }, + logger: logger, + clientMetadata: { domain: DOMAIN, providerMetadata: mockProviderMetaData }, + providerMetadata: mockProviderMetaData, + }; + + console.debug = jest.fn(); + console.warn = jest.fn(); + console.info = jest.fn(); + console.error = jest.fn(); + }); + + afterEach(() => { + jest.restoreAllMocks(); + }); + + test('should log all props except evaluation context in before hook', () => { + const hook = new LoggingHook(false); + + hook.before(hookContext); + + expect(console.debug).toHaveBeenCalled(); + + expect((console.debug as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'before', + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue + }); + + }); + + test('should log all props and evaluation context in before hook when enabled', () => { + const hook = new LoggingHook(true); + + hook.before(hookContext); + + expect(console.debug).toHaveBeenCalled(); + + expect((console.debug as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'before', + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue, + [EVALUATION_CONTEXT_KEY]: hookContext.context + }); + + }); + + test('should log all props except evaluation context in after hook', () => { + const hook = new LoggingHook(false); + const details = { flagKey: FLAG_KEY, flagMetadata: {}, reason: REASON, variant: VARIANT, value: VALUE }; + + hook.after(hookContext, details); + + expect(console.debug).toHaveBeenCalled(); + + expect((console.debug as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'after', + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue + }); + }); + + test('should log all props and evaluation context in after hook when enabled', () => { + const hook = new LoggingHook(true); + const details = { flagKey: FLAG_KEY, flagMetadata: {}, reason: REASON, variant: VARIANT, value: VALUE }; + + hook.after(hookContext, details); + + expect(console.debug).toHaveBeenCalled(); + + expect((console.debug as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'after', + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue, + [EVALUATION_CONTEXT_KEY]: hookContext.context + }); + }); + + test('should log all props except evaluation context in error hook', () => { + const hook = new LoggingHook(false); + const error = new GeneralError(ERROR_MESSAGE); + + hook.error(hookContext, error); + + expect(console.error).toHaveBeenCalled(); + + expect((console.error as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'error', + [ERROR_MESSAGE_KEY]: error.message, + [ERROR_CODE_KEY]: error.code, + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue, + }); + }); + + test('should log all props and evaluation context in error hook when enabled', () => { + const hook = new LoggingHook(true); + const error = new GeneralError(ERROR_MESSAGE); + + hook.error(hookContext, error); + + expect(console.error).toHaveBeenCalled(); + + expect((console.error as jest.Mock).mock.calls[0][0]).toMatchObject({ + stage: 'error', + [ERROR_MESSAGE_KEY]: error.message, + [ERROR_CODE_KEY]: error.code, + [DOMAIN_KEY]: hookContext.clientMetadata.domain, + [PROVIDER_NAME_KEY]: hookContext.providerMetadata.name, + [FLAG_KEY_KEY]: hookContext.flagKey, + [DEFAULT_VALUE_KEY]: hookContext.defaultValue, + [EVALUATION_CONTEXT_KEY]: hookContext.context + }); + }); +}); From 4112a0e372dfebcfe2febc8d91b8506c021cc345 Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Wed, 11 Dec 2024 21:16:04 -0500 Subject: [PATCH 02/12] feat: adding VerboseLogger to avoid restrictions on DefaultLogger Signed-off-by: Kevin Long --- packages/shared/src/hooks/logging-hook.ts | 4 ++-- packages/shared/src/logger/default-logger.ts | 8 ++------ packages/shared/src/logger/index.ts | 1 + packages/shared/src/logger/verbose-logger.ts | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 packages/shared/src/logger/verbose-logger.ts diff --git a/packages/shared/src/hooks/logging-hook.ts b/packages/shared/src/hooks/logging-hook.ts index d4cb9353e..4cea51040 100644 --- a/packages/shared/src/hooks/logging-hook.ts +++ b/packages/shared/src/hooks/logging-hook.ts @@ -3,7 +3,7 @@ import type { BaseHook } from './hook'; import type { BeforeHookContext, HookContext, HookHints } from './hooks'; import type { FlagValue, EvaluationDetails } from '../evaluation'; -import { DefaultLogger, SafeLogger } from '../logger'; +import { VerboseLogger, SafeLogger } from '../logger'; type LoggerPayload = Record; @@ -20,7 +20,7 @@ const VALUE_KEY = 'value'; export class LoggingHook implements BaseHook { readonly includeEvaluationContext: boolean = false; - readonly logger = new SafeLogger(new DefaultLogger()); + readonly logger = new SafeLogger(new VerboseLogger()); constructor(includeEvaluationContext: boolean = false) { this.includeEvaluationContext = !!includeEvaluationContext; diff --git a/packages/shared/src/logger/default-logger.ts b/packages/shared/src/logger/default-logger.ts index 287c6ca99..dc5325466 100644 --- a/packages/shared/src/logger/default-logger.ts +++ b/packages/shared/src/logger/default-logger.ts @@ -11,11 +11,7 @@ export class DefaultLogger implements Logger { console.warn(...args); } - info(...args: unknown[]): void { - console.info(...args); - } + info(): void {} - debug(...args: unknown[]): void { - console.debug(...args); - } + debug(): void {} } diff --git a/packages/shared/src/logger/index.ts b/packages/shared/src/logger/index.ts index 2c09cfaf4..ad83067ea 100644 --- a/packages/shared/src/logger/index.ts +++ b/packages/shared/src/logger/index.ts @@ -1,3 +1,4 @@ export * from './logger'; export * from './default-logger'; export * from './safe-logger'; +export * from './verbose-logger'; diff --git a/packages/shared/src/logger/verbose-logger.ts b/packages/shared/src/logger/verbose-logger.ts new file mode 100644 index 000000000..f327463d8 --- /dev/null +++ b/packages/shared/src/logger/verbose-logger.ts @@ -0,0 +1,19 @@ +import type { Logger } from './logger'; + +export class VerboseLogger implements Logger { + error(...args: unknown[]): void { + console.error(...args); + } + + warn(...args: unknown[]): void { + console.warn(...args); + } + + info(...args: unknown[]): void { + console.info(...args); + } + + debug(...args: unknown[]): void { + console.debug(...args); + } +} From 730a57d40772d844faabc913711ee8201011d1ed Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Wed, 11 Dec 2024 21:22:33 -0500 Subject: [PATCH 03/12] fix: removing commented coded and implementing SafeLogger with Verbose Logger Signed-off-by: Kevin Long --- packages/shared/test/logger-hook.spec.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/shared/test/logger-hook.spec.ts b/packages/shared/test/logger-hook.spec.ts index b4df3ea19..86ec9040d 100644 --- a/packages/shared/test/logger-hook.spec.ts +++ b/packages/shared/test/logger-hook.spec.ts @@ -1,7 +1,8 @@ import { GeneralError } from '../src/errors'; import type { HookContext } from '../src/hooks/hooks'; import { LoggingHook } from '../src/hooks/logging-hook'; -import type { SafeLogger } from '../src/logger'; +import { SafeLogger } from '../src/logger'; +import { VerboseLogger } from '../src/logger'; describe('LoggingHook', () => { const FLAG_KEY = 'some-key'; @@ -20,10 +21,8 @@ describe('LoggingHook', () => { const ERROR_CODE_KEY = 'error_code'; const ERROR_MESSAGE_KEY = 'error_message'; - // const ERROR_CODE = 'GENERAL'; - let hookContext: HookContext; - let logger: SafeLogger; + const logger : SafeLogger = new SafeLogger(new VerboseLogger()); beforeEach(() => { const mockProviderMetaData = { name: PROVIDER_NAME }; From ab62ee41f350fc6a238f5eed5b1761d6abd8f5fe Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Wed, 18 Dec 2024 20:24:53 -0500 Subject: [PATCH 04/12] feat: updates DefaultLogger per GitHub issue thread Signed-off-by: Kevin Long --- packages/shared/src/hooks/logging-hook.ts | 4 ++-- packages/shared/src/logger/default-logger.ts | 21 ++++++++++++++++++-- packages/shared/src/logger/index.ts | 1 - packages/shared/src/logger/verbose-logger.ts | 19 ------------------ packages/shared/test/logger-hook.spec.ts | 5 ++--- 5 files changed, 23 insertions(+), 27 deletions(-) delete mode 100644 packages/shared/src/logger/verbose-logger.ts diff --git a/packages/shared/src/hooks/logging-hook.ts b/packages/shared/src/hooks/logging-hook.ts index 4cea51040..18c2ad2a7 100644 --- a/packages/shared/src/hooks/logging-hook.ts +++ b/packages/shared/src/hooks/logging-hook.ts @@ -3,7 +3,7 @@ import type { BaseHook } from './hook'; import type { BeforeHookContext, HookContext, HookHints } from './hooks'; import type { FlagValue, EvaluationDetails } from '../evaluation'; -import { VerboseLogger, SafeLogger } from '../logger'; +import { DefaultLogger, SafeLogger } from '../logger'; type LoggerPayload = Record; @@ -20,7 +20,7 @@ const VALUE_KEY = 'value'; export class LoggingHook implements BaseHook { readonly includeEvaluationContext: boolean = false; - readonly logger = new SafeLogger(new VerboseLogger()); + readonly logger = new SafeLogger(new DefaultLogger(true, true)); constructor(includeEvaluationContext: boolean = false) { this.includeEvaluationContext = !!includeEvaluationContext; diff --git a/packages/shared/src/logger/default-logger.ts b/packages/shared/src/logger/default-logger.ts index dc5325466..f390dffa9 100644 --- a/packages/shared/src/logger/default-logger.ts +++ b/packages/shared/src/logger/default-logger.ts @@ -3,6 +3,15 @@ import type { Logger } from './logger'; export class DefaultLogger implements Logger { + + private readonly showInfo : boolean = false; + private readonly showDebug : boolean = false; + + constructor(showInfo: boolean = false, showDebug: boolean = false){ + this.showInfo = showInfo; + this.showDebug = showDebug; + } + error(...args: unknown[]): void { console.error(...args); } @@ -11,7 +20,15 @@ export class DefaultLogger implements Logger { console.warn(...args); } - info(): void {} + info(...args: unknown[]): void { + if(this.showInfo) { + console.info(...args); + } + } - debug(): void {} + debug(...args: unknown[]): void { + if(this.showDebug) { + console.debug(...args); + } + } } diff --git a/packages/shared/src/logger/index.ts b/packages/shared/src/logger/index.ts index ad83067ea..2c09cfaf4 100644 --- a/packages/shared/src/logger/index.ts +++ b/packages/shared/src/logger/index.ts @@ -1,4 +1,3 @@ export * from './logger'; export * from './default-logger'; export * from './safe-logger'; -export * from './verbose-logger'; diff --git a/packages/shared/src/logger/verbose-logger.ts b/packages/shared/src/logger/verbose-logger.ts deleted file mode 100644 index f327463d8..000000000 --- a/packages/shared/src/logger/verbose-logger.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Logger } from './logger'; - -export class VerboseLogger implements Logger { - error(...args: unknown[]): void { - console.error(...args); - } - - warn(...args: unknown[]): void { - console.warn(...args); - } - - info(...args: unknown[]): void { - console.info(...args); - } - - debug(...args: unknown[]): void { - console.debug(...args); - } -} diff --git a/packages/shared/test/logger-hook.spec.ts b/packages/shared/test/logger-hook.spec.ts index 86ec9040d..9adbf11d3 100644 --- a/packages/shared/test/logger-hook.spec.ts +++ b/packages/shared/test/logger-hook.spec.ts @@ -1,8 +1,7 @@ import { GeneralError } from '../src/errors'; import type { HookContext } from '../src/hooks/hooks'; import { LoggingHook } from '../src/hooks/logging-hook'; -import { SafeLogger } from '../src/logger'; -import { VerboseLogger } from '../src/logger'; +import { DefaultLogger, SafeLogger } from '../src/logger'; describe('LoggingHook', () => { const FLAG_KEY = 'some-key'; @@ -22,7 +21,7 @@ describe('LoggingHook', () => { const ERROR_MESSAGE_KEY = 'error_message'; let hookContext: HookContext; - const logger : SafeLogger = new SafeLogger(new VerboseLogger()); + const logger : SafeLogger = new SafeLogger(new DefaultLogger(true, true)); beforeEach(() => { const mockProviderMetaData = { name: PROVIDER_NAME }; From ae87eebe49a696c7af4a8930fe30055731b9f67e Mon Sep 17 00:00:00 2001 From: Michael Beemer Date: Thu, 12 Dec 2024 08:49:09 -0500 Subject: [PATCH 05/12] feat: add evaluation details to finally hook (#1087) ## This PR - adds evaluation details to the `finally` stage in hooks. ### Notes This breaks the signature of the `finally` stages based on [this spec enhancement](https://github.com/open-feature/spec/pull/280). It is **not** considered a breaking change to the SDK because hooks are marked as experimental in the spec, and the change has no impact on known hooks. The noteworthy change to the interface is: ```diff - finally?(hookContext: Readonly>, hookHints?: HookHints): HooksReturn; + finally?(hookContext: Readonly>, evaluationDetails: EvaluationDetails, hookHints?: HookHints): HooksReturn; ``` ### Follow-up Tasks - Update the JS contribs repo --------- Signed-off-by: Michael Beemer --- .../client/internal/open-feature-client.ts | 42 ++++++++++++------- packages/server/test/hooks.spec.ts | 28 ++++++++++++- packages/shared/src/hooks/hook.ts | 8 +++- .../client/internal/open-feature-client.ts | 41 +++++++++++------- packages/web/test/hooks.spec.ts | 38 ++++++++++------- 5 files changed, 106 insertions(+), 51 deletions(-) diff --git a/packages/server/src/client/internal/open-feature-client.ts b/packages/server/src/client/internal/open-feature-client.ts index bd9a4e5a4..6d2174df8 100644 --- a/packages/server/src/client/internal/open-feature-client.ts +++ b/packages/server/src/client/internal/open-feature-client.ts @@ -10,7 +10,9 @@ import type { Logger, TrackingEventDetails, OpenFeatureError, - ResolutionDetails} from '@openfeature/core'; + FlagMetadata, + ResolutionDetails, +} from '@openfeature/core'; import { ErrorCode, ProviderFatalError, @@ -24,7 +26,7 @@ import type { FlagEvaluationOptions } from '../../evaluation'; import type { ProviderEvents } from '../../events'; import type { InternalEventEmitter } from '../../events/internal/internal-event-emitter'; import type { Hook } from '../../hooks'; -import type { Provider} from '../../provider'; +import type { Provider } from '../../provider'; import { ProviderStatus } from '../../provider'; import type { Client } from './../client'; @@ -279,6 +281,8 @@ export class OpenFeatureClient implements Client { logger: this._logger, }; + let evaluationDetails: EvaluationDetails; + try { const frozenContext = await this.beforeHooks(allHooks, hookContext, options); @@ -287,27 +291,27 @@ export class OpenFeatureClient implements Client { // run the referenced resolver, binding the provider. const resolution = await resolver.call(this._provider, flagKey, defaultValue, frozenContext, this._logger); - const evaluationDetails = { + const resolutionDetails = { ...resolution, flagMetadata: Object.freeze(resolution.flagMetadata ?? {}), flagKey, }; - if (evaluationDetails.errorCode) { - const err = instantiateErrorByErrorCode(evaluationDetails.errorCode); + if (resolutionDetails.errorCode) { + const err = instantiateErrorByErrorCode(resolutionDetails.errorCode); await this.errorHooks(allHooksReversed, hookContext, err, options); - return this.getErrorEvaluationDetails(flagKey, defaultValue, err); + evaluationDetails = this.getErrorEvaluationDetails(flagKey, defaultValue, err, resolutionDetails.flagMetadata); + } else { + await this.afterHooks(allHooksReversed, hookContext, resolutionDetails, options); + evaluationDetails = resolutionDetails; } - - await this.afterHooks(allHooksReversed, hookContext, evaluationDetails, options); - - return evaluationDetails; } catch (err: unknown) { await this.errorHooks(allHooksReversed, hookContext, err, options); - return this.getErrorEvaluationDetails(flagKey, defaultValue, err); - } finally { - await this.finallyHooks(allHooksReversed, hookContext, options); + evaluationDetails = this.getErrorEvaluationDetails(flagKey, defaultValue, err); } + + await this.finallyHooks(allHooksReversed, hookContext, evaluationDetails, options); + return evaluationDetails; } private async beforeHooks(hooks: Hook[], hookContext: HookContext, options: FlagEvaluationOptions) { @@ -353,11 +357,16 @@ export class OpenFeatureClient implements Client { } } - private async finallyHooks(hooks: Hook[], hookContext: HookContext, options: FlagEvaluationOptions) { + private async finallyHooks( + hooks: Hook[], + hookContext: HookContext, + evaluationDetails: EvaluationDetails, + options: FlagEvaluationOptions, + ) { // run "finally" hooks sequentially for (const hook of hooks) { try { - await hook?.finally?.(hookContext, options.hookHints); + await hook?.finally?.(hookContext, evaluationDetails, options.hookHints); } catch (err) { this._logger.error(`Unhandled error during 'finally' hook: ${err}`); if (err instanceof Error) { @@ -403,6 +412,7 @@ export class OpenFeatureClient implements Client { flagKey: string, defaultValue: T, err: unknown, + flagMetadata: FlagMetadata = {}, ): EvaluationDetails { const errorMessage: string = (err as Error)?.message; const errorCode: ErrorCode = (err as OpenFeatureError)?.code || ErrorCode.GENERAL; @@ -412,7 +422,7 @@ export class OpenFeatureClient implements Client { errorMessage, value: defaultValue, reason: StandardResolutionReasons.ERROR, - flagMetadata: Object.freeze({}), + flagMetadata: Object.freeze(flagMetadata), flagKey, }; } diff --git a/packages/server/test/hooks.spec.ts b/packages/server/test/hooks.spec.ts index 006144f2f..542a042ba 100644 --- a/packages/server/test/hooks.spec.ts +++ b/packages/server/test/hooks.spec.ts @@ -439,6 +439,30 @@ describe('Hooks', () => { }); }); }); + + describe('Requirement 4.3.8', () => { + it('"evaluation details" passed to the "finally" stage matches the evaluation details returned to the application author', async () => { + OpenFeature.setProvider(MOCK_PROVIDER); + let evaluationDetailsHooks; + + const evaluationDetails = await client.getBooleanDetails( + FLAG_KEY, + false, + {}, + { + hooks: [ + { + finally: (_, details) => { + evaluationDetailsHooks = details; + }, + }, + ], + }, + ); + + expect(evaluationDetailsHooks).toEqual(evaluationDetails); + }); + }); }); describe('Requirement 4.4.2', () => { @@ -922,14 +946,14 @@ describe('Hooks', () => { done(err); } }, - after: (_hookContext, _evaluationDetils, hookHints) => { + after: (_hookContext, _evaluationDetails, hookHints) => { try { expect(hookHints?.hint).toBeTruthy(); } catch (err) { done(err); } }, - finally: (_, hookHints) => { + finally: (_, _evaluationDetails, hookHints) => { try { expect(hookHints?.hint).toBeTruthy(); done(); diff --git a/packages/shared/src/hooks/hook.ts b/packages/shared/src/hooks/hook.ts index 54233b80f..7c3c63376 100644 --- a/packages/shared/src/hooks/hook.ts +++ b/packages/shared/src/hooks/hook.ts @@ -32,9 +32,13 @@ export interface BaseHook>, hookHints?: HookHints): HooksReturn; + finally?( + hookContext: Readonly>, + evaluationDetails: EvaluationDetails, + hookHints?: HookHints, + ): HooksReturn; } diff --git a/packages/web/src/client/internal/open-feature-client.ts b/packages/web/src/client/internal/open-feature-client.ts index 43f646f8c..d46b82a1b 100644 --- a/packages/web/src/client/internal/open-feature-client.ts +++ b/packages/web/src/client/internal/open-feature-client.ts @@ -10,7 +10,9 @@ import type { Logger, TrackingEventDetails, OpenFeatureError, - ResolutionDetails } from '@openfeature/core'; + FlagMetadata, + ResolutionDetails, +} from '@openfeature/core'; import { ErrorCode, ProviderFatalError, @@ -24,7 +26,7 @@ import type { FlagEvaluationOptions } from '../../evaluation'; import type { ProviderEvents } from '../../events'; import type { InternalEventEmitter } from '../../events/internal/internal-event-emitter'; import type { Hook } from '../../hooks'; -import type { Provider} from '../../provider'; +import type { Provider } from '../../provider'; import { ProviderStatus } from '../../provider'; import type { Client } from './../client'; @@ -234,6 +236,8 @@ export class OpenFeatureClient implements Client { logger: this._logger, }; + let evaluationDetails: EvaluationDetails; + try { this.beforeHooks(allHooks, hookContext, options); @@ -242,27 +246,26 @@ export class OpenFeatureClient implements Client { // run the referenced resolver, binding the provider. const resolution = resolver.call(this._provider, flagKey, defaultValue, context, this._logger); - const evaluationDetails = { + const resolutionDetails = { ...resolution, flagMetadata: Object.freeze(resolution.flagMetadata ?? {}), flagKey, }; - if (evaluationDetails.errorCode) { - const err = instantiateErrorByErrorCode(evaluationDetails.errorCode); + if (resolutionDetails.errorCode) { + const err = instantiateErrorByErrorCode(resolutionDetails.errorCode); this.errorHooks(allHooksReversed, hookContext, err, options); - return this.getErrorEvaluationDetails(flagKey, defaultValue, err); + evaluationDetails = this.getErrorEvaluationDetails(flagKey, defaultValue, err, resolutionDetails.flagMetadata); + } else { + this.afterHooks(allHooksReversed, hookContext, resolutionDetails, options); + evaluationDetails = resolutionDetails; } - - this.afterHooks(allHooksReversed, hookContext, evaluationDetails, options); - - return evaluationDetails; } catch (err: unknown) { this.errorHooks(allHooksReversed, hookContext, err, options); - return this.getErrorEvaluationDetails(flagKey, defaultValue, err); - } finally { - this.finallyHooks(allHooksReversed, hookContext, options); + evaluationDetails = this.getErrorEvaluationDetails(flagKey, defaultValue, err); } + this.finallyHooks(allHooksReversed, hookContext, evaluationDetails, options); + return evaluationDetails; } private beforeHooks(hooks: Hook[], hookContext: HookContext, options: FlagEvaluationOptions) { @@ -301,11 +304,16 @@ export class OpenFeatureClient implements Client { } } - private finallyHooks(hooks: Hook[], hookContext: HookContext, options: FlagEvaluationOptions) { + private finallyHooks( + hooks: Hook[], + hookContext: HookContext, + evaluationDetails: EvaluationDetails, + options: FlagEvaluationOptions, + ) { // run "finally" hooks sequentially for (const hook of hooks) { try { - hook?.finally?.(hookContext, options.hookHints); + hook?.finally?.(hookContext, evaluationDetails, options.hookHints); } catch (err) { this._logger.error(`Unhandled error during 'finally' hook: ${err}`); if (err instanceof Error) { @@ -337,6 +345,7 @@ export class OpenFeatureClient implements Client { flagKey: string, defaultValue: T, err: unknown, + flagMetadata: FlagMetadata = {}, ): EvaluationDetails { const errorMessage: string = (err as Error)?.message; const errorCode: ErrorCode = (err as OpenFeatureError)?.code || ErrorCode.GENERAL; @@ -346,7 +355,7 @@ export class OpenFeatureClient implements Client { errorMessage, value: defaultValue, reason: StandardResolutionReasons.ERROR, - flagMetadata: Object.freeze({}), + flagMetadata: Object.freeze(flagMetadata), flagKey, }; } diff --git a/packages/web/test/hooks.spec.ts b/packages/web/test/hooks.spec.ts index 20583a310..bb849c388 100644 --- a/packages/web/test/hooks.spec.ts +++ b/packages/web/test/hooks.spec.ts @@ -1,16 +1,5 @@ -import type { - Provider, - ResolutionDetails, - Client, - FlagValueType, - EvaluationContext, - Hook} from '../src'; -import { - GeneralError, - OpenFeature, - StandardResolutionReasons, - ErrorCode, -} from '../src'; +import type { Provider, ResolutionDetails, Client, FlagValueType, EvaluationContext, Hook } from '../src'; +import { GeneralError, OpenFeature, StandardResolutionReasons, ErrorCode } from '../src'; const BOOLEAN_VALUE = true; @@ -282,6 +271,25 @@ describe('Hooks', () => { }); }); }); + + describe('Requirement 4.3.8', () => { + it('"evaluation details" passed to the "finally" stage matches the evaluation details returned to the application author', () => { + OpenFeature.setProvider(MOCK_PROVIDER); + let evaluationDetailsHooks; + + const evaluationDetails = client.getBooleanDetails(FLAG_KEY, false, { + hooks: [ + { + finally: (_, details) => { + evaluationDetailsHooks = details; + }, + }, + ], + }); + + expect(evaluationDetailsHooks).toEqual(evaluationDetails); + }); + }); }); describe('Requirement 4.4.2', () => { @@ -759,14 +767,14 @@ describe('Hooks', () => { done(err); } }, - after: (_hookContext, _evaluationDetils, hookHints) => { + after: (_hookContext, _evaluationDetails, hookHints) => { try { expect(hookHints?.hint).toBeTruthy(); } catch (err) { done(err); } }, - finally: (_, hookHints) => { + finally: (_, _evaluationDetails, hookHints) => { try { expect(hookHints?.hint).toBeTruthy(); done(); From 4efe485ae96409b63559ec8bbd46e0a7f388a5b4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:51:55 -0500 Subject: [PATCH 06/12] chore(deps): update typescript-eslint monorepo to v7.18.0 (#1065) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@typescript-eslint/eslint-plugin](https://typescript-eslint.io/packages/eslint-plugin) ([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin)) | [`7.11.0` -> `7.18.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2feslint-plugin/7.11.0/7.18.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2feslint-plugin/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2feslint-plugin/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2feslint-plugin/7.11.0/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2feslint-plugin/7.11.0/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@typescript-eslint/parser](https://typescript-eslint.io/packages/parser) ([source](https://redirect.github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser)) | [`7.11.0` -> `7.18.0`](https://renovatebot.com/diffs/npm/@typescript-eslint%2fparser/7.11.0/7.18.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@typescript-eslint%2fparser/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@typescript-eslint%2fparser/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@typescript-eslint%2fparser/7.11.0/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@typescript-eslint%2fparser/7.11.0/7.18.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
typescript-eslint/typescript-eslint (@​typescript-eslint/eslint-plugin) ### [`v7.18.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7180-2024-07-29) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.17.0...v7.18.0) ##### 🩹 Fixes - **eslint-plugin:** \[no-unnecessary-type-assertion] prevent runtime error when asserting a variable declared in default TS lib - **eslint-plugin:** \[unbound-method] report on destructuring in function parameters - **eslint-plugin:** \[no-duplicate-type-constituents] shouldn't report on error types - **eslint-plugin:** \[strict-boolean-expressions] support branded booleans ##### ❤️ Thank You - auvred - Oliver Salzburg - Vinccool96 - Yukihiro Hasegawa You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.17.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7170-2024-07-22) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.16.1...v7.17.0) ##### 🚀 Features - **eslint-plugin:** backport no-unsafe-function type, no-wrapper-object-types from v8 to v7 - **eslint-plugin:** \[return-await] add option to report in error-handling scenarios only, and deprecate "never" ##### 🩹 Fixes - **eslint-plugin:** \[no-floating-promises] check top-level type assertions (and more) - **eslint-plugin:** \[strict-boolean-expressions] consider assertion function argument a boolean context - **eslint-plugin:** \[no-unnecessary-condition] false positive on optional private field ##### ❤️ Thank You - Armano - Josh Goldberg ✨ - Kirk Waiblinger - StyleShit You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.16.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7161-2024-07-15) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.16.0...v7.16.1) ##### 🩹 Fixes - **eslint-plugin:** \[no-unnecessary-type-parameters] descend into all parts of mapped types in no-unnecessary-type-parameters ##### ❤️ Thank You - Dan Vanderkam You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.16.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7160-2024-07-08) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.15.0...v7.16.0) ##### 🚀 Features - **rule-tester:** stricter rule test validations - **eslint-plugin:** \[no-unnecessary-parameter-property-assignment] add new rule - **eslint-plugin:** add support for nested namespaces to unsafe-member-access - **eslint-plugin:** \[no-floating-promises] add checkThenables option ##### 🩹 Fixes - **deps:** update dependency [@​eslint-community/regexpp](https://redirect.github.com/eslint-community/regexpp) to v4.11.0 - **eslint-plugin:** \[no-floating-promises] add `suggestions` to tests from [#​9263](https://redirect.github.com/typescript-eslint/typescript-eslint/issues/9263) `checkThenables` - **website:** react key error on internal pages of website - **eslint-plugin:** \[restrict-template-expressions] don't report tuples if `allowArray` option is enabled ##### ❤️ Thank You - Abraham Guo - auvred - Josh Goldberg ✨ - Juan Sanchez - Vinccool96 - YeonJuan - Yukihiro Hasegawa You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.15.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7150-2024-07-01) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.14.1...v7.15.0) ##### 🚀 Features - **eslint-plugin:** \[array-type] detect `Readonly` case - **eslint-plugin:** back-port new rules around empty object types from v8 ##### 🩹 Fixes - disable `EXPERIMENTAL_useProjectService` in `disabled-type-checked` shared config - **eslint-plugin:** \[no-unsafe-return] differentiate a types-error any from a true any - **eslint-plugin:** \[no-unsafe-call] differentiate a types-error any from a true any ##### ❤️ Thank You - auvred - Kim Sang Du - rgehbt - Vinccool96 You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.14.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7141-2024-06-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.14.0...v7.14.1) ##### 🩹 Fixes - **eslint-plugin:** \[prefer-nullish-coalescing] treat enums and literals as their underlying primitive types - **eslint-plugin:** \[prefer-nullish-coalescing] ensure ternary fix does not remove parens ##### ❤️ Thank You - Jake Bailey You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.14.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7140-2024-06-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.13.1...v7.14.0) ##### 🚀 Features - support TypeScript 5.5 ##### 🩹 Fixes - **eslint-plugin:** \[no-extraneous-class] handle abstract members - **eslint-plugin:** \[prefer-nullish-coalescing] handle intersected primitive types - **eslint-plugin:** \[no-invalid-this] support AccessorProperty ##### ❤️ Thank You - Brad Zacher - cm-ayf - Jake Bailey - James Zhan - Joshua Chen - yoshi2no You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.13.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7131-2024-06-17) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.13.0...v7.13.1) ##### 🩹 Fixes - **eslint-plugin:** \[prefer-readonly] refine report locations - **eslint-plugin:** \[return-await] support explicit resource management - **eslint-plugin:** \[no-unsafe-member-access] differentiate a types-error any from a true any ##### ❤️ Thank You - Kirk Waiblinger - Yukihiro Hasegawa You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.13.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7130-2024-06-10) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.12.0...v7.13.0) ##### 🚀 Features - **typescript-estree:** require `import = require()` argument to be a string literal - **typescript-estree:** forbid `.body`, `.async`, `.generator` on `declare function` - **eslint-plugin:** \[no-dynamic-delete] allow all string literals as index ##### 🩹 Fixes - **ast-spec:** function-call-like callee should be Expression not LeftHandSideExpression - **scope-manager:** handle index signature in class - **eslint-plugin:** \[init-declarations] refine report locations - **eslint-plugin:** \[no-base-to-string] make error message more nuanced - **eslint-plugin:** \[no-unsafe-assignment] be more specific about error types - **eslint-plugin:** \[no-magic-numbers] fix implementation of the `ignore` option ##### ❤️ Thank You - Fotis Papadogeorgopoulos - Joshua Chen - Kirk Waiblinger - Tobiloba Adedeji - Vinccool96 - YeonJuan You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.12.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#7120-2024-06-03) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.11.0...v7.12.0) ##### 🚀 Features - **eslint-plugin:** \[no-useless-template-literals] rename to `no-useless-template-expression` (deprecate `no-useless-template-literals`) - **rule-tester:** check for parsing errors in suggestion fixes - **rule-tester:** port `checkDuplicateTestCases` from ESLint - **eslint-plugin:** \[no-floating-promises] add option 'allowForKnownSafePromises' ##### 🩹 Fixes - no-useless-template-expression -> no-unnecessary-template-expression - **eslint-plugin:** \[no-unnecessary-type-assertion] combine template literal check with `const` variable check - **eslint-plugin:** \[dot-notation] fix false positive when accessing private/protected property with optional chaining - **eslint-plugin:** \[explicit-member-accessibility] refine report locations - **eslint-plugin:** \[no-unnecessary-type-assertion] declares are always defined, so always check `declare`s - **eslint-plugin:** \[prefer-literal-enum-member] allow using member it self on allowBitwiseExpressions - **eslint-plugin:** \[return-await] clean up in-try-catch detection and make autofixes safe - **eslint-plugin:** \[member-ordering] also TSMethodSignature can be get/set ##### ❤️ Thank You - Abraham Guo - Han Yeong-woo - Joshua Chen - Kim Sang Du - Kirk Waiblinger - YeonJuan You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
typescript-eslint/typescript-eslint (@​typescript-eslint/parser) ### [`v7.18.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7180-2024-07-29) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.17.0...v7.18.0) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.17.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7170-2024-07-22) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.16.1...v7.17.0) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.16.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7161-2024-07-15) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.16.0...v7.16.1) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.16.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7160-2024-07-08) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.15.0...v7.16.0) ##### 🩹 Fixes - **deps:** update dependency [@​eslint-community/regexpp](https://redirect.github.com/eslint-community/regexpp) to v4.11.0 - **website:** react key error on internal pages of website ##### ❤️ Thank You - Abraham Guo - auvred - Josh Goldberg ✨ - Juan Sanchez - Vinccool96 - YeonJuan - Yukihiro Hasegawa You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.15.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7150-2024-07-01) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.14.1...v7.15.0) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.14.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7141-2024-06-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.14.0...v7.14.1) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.14.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7140-2024-06-24) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.13.1...v7.14.0) ##### 🚀 Features - support TypeScript 5.5 ##### ❤️ Thank You - Brad Zacher - cm-ayf - Jake Bailey - James Zhan - Joshua Chen - yoshi2no You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.13.1`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7131-2024-06-17) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.13.0...v7.13.1) This was a version bump only for parser to align it with other projects, there were no code changes. You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.13.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7130-2024-06-10) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.12.0...v7.13.0) ##### 🚀 Features - **parser, typescript-estree:** export withoutProjectParserOptions utility ##### ❤️ Thank You - Fotis Papadogeorgopoulos - Joshua Chen - Kirk Waiblinger - Tobiloba Adedeji - Vinccool96 - YeonJuan You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website. ### [`v7.12.0`](https://redirect.github.com/typescript-eslint/typescript-eslint/blob/HEAD/packages/parser/CHANGELOG.md#7120-2024-06-03) [Compare Source](https://redirect.github.com/typescript-eslint/typescript-eslint/compare/v7.11.0...v7.12.0) ##### 🩹 Fixes - **types:** correct typing ParserOptions ##### ❤️ Thank You - Abraham Guo - Han Yeong-woo - Joshua Chen - Kim Sang Du - Kirk Waiblinger - YeonJuan You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
--- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled because a matching PR was automerged previously. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/open-feature/js-sdk). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package-lock.json | 200 ++++++++++++++++++++-------------- packages/angular/package.json | 4 +- 2 files changed, 118 insertions(+), 86 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4ecedc2a..32ef2d03b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7232,16 +7232,17 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.11.0.tgz", - "integrity": "sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz", + "integrity": "sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/type-utils": "7.11.0", - "@typescript-eslint/utils": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/type-utils": "7.18.0", + "@typescript-eslint/utils": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -7265,13 +7266,14 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz", - "integrity": "sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -7282,10 +7284,11 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.11.0.tgz", - "integrity": "sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -7295,13 +7298,14 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz", - "integrity": "sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -7323,15 +7327,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.11.0.tgz", - "integrity": "sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0" + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -7345,12 +7350,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz", - "integrity": "sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", + "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -7366,6 +7372,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -7375,6 +7382,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7395,6 +7403,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -7410,20 +7419,22 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, "node_modules/@typescript-eslint/parser": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.11.0.tgz", - "integrity": "sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz", + "integrity": "sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4" }, "engines": { @@ -7443,13 +7454,14 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz", - "integrity": "sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -7460,10 +7472,11 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.11.0.tgz", - "integrity": "sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -7473,13 +7486,14 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz", - "integrity": "sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -7501,12 +7515,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz", - "integrity": "sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", + "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -7522,6 +7537,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -7531,6 +7547,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7551,6 +7568,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -7566,6 +7584,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -7588,13 +7607,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.11.0.tgz", - "integrity": "sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.18.0.tgz", + "integrity": "sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.11.0", - "@typescript-eslint/utils": "7.11.0", + "@typescript-eslint/typescript-estree": "7.18.0", + "@typescript-eslint/utils": "7.18.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -7615,13 +7635,14 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.11.0.tgz", - "integrity": "sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz", + "integrity": "sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0" + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -7632,10 +7653,11 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.11.0.tgz", - "integrity": "sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz", + "integrity": "sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==", "dev": true, + "license": "MIT", "engines": { "node": "^18.18.0 || >=20.0.0" }, @@ -7645,13 +7667,14 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.11.0.tgz", - "integrity": "sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.18.0.tgz", + "integrity": "sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==", "dev": true, + "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/visitor-keys": "7.11.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/visitor-keys": "7.18.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -7673,15 +7696,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.11.0.tgz", - "integrity": "sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.18.0.tgz", + "integrity": "sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==", "dev": true, + "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.11.0", - "@typescript-eslint/types": "7.11.0", - "@typescript-eslint/typescript-estree": "7.11.0" + "@typescript-eslint/scope-manager": "7.18.0", + "@typescript-eslint/types": "7.18.0", + "@typescript-eslint/typescript-estree": "7.18.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -7695,12 +7719,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.11.0.tgz", - "integrity": "sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==", + "version": "7.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.18.0.tgz", + "integrity": "sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==", "dev": true, + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.11.0", + "@typescript-eslint/types": "7.18.0", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -7716,6 +7741,7 @@ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, + "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } @@ -7725,6 +7751,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", "dev": true, + "license": "MIT", "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -7745,6 +7772,7 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, + "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -7760,6 +7788,7 @@ "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -8401,6 +8430,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -10395,6 +10425,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", "dev": true, + "license": "MIT", "dependencies": { "path-type": "^4.0.0" }, @@ -10407,6 +10438,7 @@ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "dev": true, + "license": "MIT", "engines": { "node": ">=8" } @@ -21868,8 +21900,8 @@ "@angular/platform-browser": "^19.0.0", "@angular/platform-browser-dynamic": "^19.0.0", "@angular/router": "^19.0.0", - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/parser": "7.11.0", + "@typescript-eslint/eslint-plugin": "7.18.0", + "@typescript-eslint/parser": "7.18.0", "eslint": "^8.57.0", "jest-preset-angular": "^14.2.4", "ng-packagr": "^19.0.0", diff --git a/packages/angular/package.json b/packages/angular/package.json index ab7654ae8..d79aef4c4 100644 --- a/packages/angular/package.json +++ b/packages/angular/package.json @@ -30,8 +30,8 @@ "@angular/platform-browser": "^19.0.0", "@angular/platform-browser-dynamic": "^19.0.0", "@angular/router": "^19.0.0", - "@typescript-eslint/eslint-plugin": "7.11.0", - "@typescript-eslint/parser": "7.11.0", + "@typescript-eslint/eslint-plugin": "7.18.0", + "@typescript-eslint/parser": "7.18.0", "eslint": "^8.57.0", "jest-preset-angular": "^14.2.4", "ng-packagr": "^19.0.0", From 8d6a353b1fdeda031672ed6c2efef9484a9f311e Mon Sep 17 00:00:00 2001 From: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:40:39 -0500 Subject: [PATCH 07/12] chore(main): release core 1.6.0 (#1107) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [1.6.0](https://github.com/open-feature/js-sdk/compare/core-v1.5.0...core-v1.6.0) (2024-12-12) ### ⚠ BREAKING CHANGES The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### ✨ New Features * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### 🔄 Refactoring * improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: Michael Beemer Co-authored-by: Michael Beemer --- .release-please-manifest.json | 2 +- packages/shared/CHANGELOG.md | 19 +++++++++++++++++++ packages/shared/package.json | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7fb2557c3..d29ce07ec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -4,6 +4,6 @@ "packages/angular": "0.0.1-experimental", "packages/web": "1.3.2", "packages/server": "1.16.2", - "packages/shared": "1.5.0", + "packages/shared": "1.6.0", "packages/angular/projects/angular-sdk": "0.0.9-experimental" } diff --git a/packages/shared/CHANGELOG.md b/packages/shared/CHANGELOG.md index 0dd452f31..17cf9c218 100644 --- a/packages/shared/CHANGELOG.md +++ b/packages/shared/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## [1.6.0](https://github.com/open-feature/js-sdk/compare/core-v1.5.0...core-v1.6.0) (2024-12-12) + +### ⚠ BREAKING CHANGES + +The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). +Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. +To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + +### ✨ New Features + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + + +### 🔄 Refactoring + +* improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) + ## [1.5.0](https://github.com/open-feature/js-sdk/compare/core-v1.4.0...core-v1.5.0) (2024-10-29) diff --git a/packages/shared/package.json b/packages/shared/package.json index ad38e1135..1c05ddeb1 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@openfeature/core", - "version": "1.5.0", + "version": "1.6.0", "description": "Shared OpenFeature JS components (server and web)", "main": "./dist/cjs/index.js", "files": [ From 64cc2ff1d528aa242f6259cc4f44e983d1f57e8d Mon Sep 17 00:00:00 2001 From: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:48:25 -0500 Subject: [PATCH 08/12] chore(main): release web-sdk 1.4.0 (#1106) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [1.4.0](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.3.2...web-sdk-v1.4.0) (2024-12-18) ### ⚠ BREAKING CHANGES The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### ✨ New Features * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### 📚 Documentation * fix comment in README for Hook’s after method ([#1102](https://github.com/open-feature/js-sdk/issues/1102)) ([ba8d1ae](https://github.com/open-feature/js-sdk/commit/ba8d1aeec837cb089cda3499d44ecc505ea0c947)) ### 🔄 Refactoring * improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: Michael Beemer Co-authored-by: Michael Beemer --- .release-please-manifest.json | 2 +- packages/web/CHANGELOG.md | 22 ++++++++++++++++++++++ packages/web/README.md | 4 ++-- packages/web/package.json | 6 +++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d29ce07ec..b153bda31 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -2,7 +2,7 @@ "packages/nest": "0.2.2", "packages/react": "0.4.9", "packages/angular": "0.0.1-experimental", - "packages/web": "1.3.2", + "packages/web": "1.4.0", "packages/server": "1.16.2", "packages/shared": "1.6.0", "packages/angular/projects/angular-sdk": "0.0.9-experimental" diff --git a/packages/web/CHANGELOG.md b/packages/web/CHANGELOG.md index 05c784188..cd2807156 100644 --- a/packages/web/CHANGELOG.md +++ b/packages/web/CHANGELOG.md @@ -1,6 +1,28 @@ # Changelog +## [1.4.0](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.3.2...web-sdk-v1.4.0) (2024-12-18) + +### ⚠ BREAKING CHANGES + +The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + +### ✨ New Features + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + + +### 📚 Documentation + +* fix comment in README for Hook’s after method ([#1102](https://github.com/open-feature/js-sdk/issues/1102)) ([ba8d1ae](https://github.com/open-feature/js-sdk/commit/ba8d1aeec837cb089cda3499d44ecc505ea0c947)) + + +### 🔄 Refactoring + +* improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) + ## [1.3.2](https://github.com/open-feature/js-sdk/compare/web-sdk-v1.3.1...web-sdk-v1.3.2) (2024-11-07) diff --git a/packages/web/README.md b/packages/web/README.md index f1f7d41f4..1253d14c7 100644 --- a/packages/web/README.md +++ b/packages/web/README.md @@ -16,8 +16,8 @@ Specification - - Release + + Release
diff --git a/packages/web/package.json b/packages/web/package.json index 20a404dfc..4a52b0117 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -1,6 +1,6 @@ { "name": "@openfeature/web-sdk", - "version": "1.3.2", + "version": "1.4.0", "description": "OpenFeature SDK for Web", "main": "./dist/cjs/index.js", "files": [ @@ -46,9 +46,9 @@ }, "homepage": "https://github.com/open-feature/js-sdk#readme", "peerDependencies": { - "@openfeature/core": "^1.5.0" + "@openfeature/core": "^1.6.0" }, "devDependencies": { - "@openfeature/core": "^1.5.0" + "@openfeature/core": "^1.6.0" } } From 97f4eb7dcf021b70377d95bc0b408141dfd47cd3 Mon Sep 17 00:00:00 2001 From: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:53:23 -0500 Subject: [PATCH 09/12] chore(main): release server-sdk 1.17.0 (#1104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [1.17.0](https://github.com/open-feature/js-sdk/compare/server-sdk-v1.16.2...server-sdk-v1.17.0) (2024-12-18) ### ⚠ BREAKING CHANGES The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### ✨ New Features * add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) ### 📚 Documentation * fix comment in README for Hook’s after method ([#1103](https://github.com/open-feature/js-sdk/issues/1103)) ([e335615](https://github.com/open-feature/js-sdk/commit/e3356157d5910d9196e8968c20d4c9a46c4de910)) ### 🔄 Refactoring * improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Signed-off-by: Michael Beemer Co-authored-by: Michael Beemer --- .release-please-manifest.json | 2 +- packages/server/CHANGELOG.md | 22 ++++++++++++++++++++++ packages/server/README.md | 4 ++-- packages/server/package.json | 6 +++--- 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b153bda31..3667a7491 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -3,7 +3,7 @@ "packages/react": "0.4.9", "packages/angular": "0.0.1-experimental", "packages/web": "1.4.0", - "packages/server": "1.16.2", + "packages/server": "1.17.0", "packages/shared": "1.6.0", "packages/angular/projects/angular-sdk": "0.0.9-experimental" } diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index f85b57058..8cacf4201 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## [1.17.0](https://github.com/open-feature/js-sdk/compare/server-sdk-v1.16.2...server-sdk-v1.17.0) (2024-12-18) + +### ⚠ BREAKING CHANGES + +The signature of the `finally` hook stage has been changed. The signature now includes the `evaluation details`, as per the [OpenFeature specification](https://openfeature.dev/specification/sections/hooks#requirement-438). Note that since hooks are still `experimental,` this does not constitute a change requiring a new major version. To migrate, update any hook that implements the `finally` stage to accept `evaluation details` as the second argument. + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + +### ✨ New Features + +* add evaluation details to finally hook ([#1087](https://github.com/open-feature/js-sdk/issues/1087)) ([2135254](https://github.com/open-feature/js-sdk/commit/2135254c4bee52b4bcadfbf8b99a896cfd930cca)) + + +### 📚 Documentation + +* fix comment in README for Hook’s after method ([#1103](https://github.com/open-feature/js-sdk/issues/1103)) ([e335615](https://github.com/open-feature/js-sdk/commit/e3356157d5910d9196e8968c20d4c9a46c4de910)) + + +### 🔄 Refactoring + +* improve track interface for providers ([#1100](https://github.com/open-feature/js-sdk/issues/1100)) ([5e5b160](https://github.com/open-feature/js-sdk/commit/5e5b16022122b71760634ac90e3fd962aa831c74)) + ## [1.16.2](https://github.com/open-feature/js-sdk/compare/server-sdk-v1.16.1...server-sdk-v1.16.2) (2024-11-07) diff --git a/packages/server/README.md b/packages/server/README.md index 8b6cf8dc1..37ffcc6cb 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -16,8 +16,8 @@ Specification - - Release + + Release
diff --git a/packages/server/package.json b/packages/server/package.json index b62bf8506..e7bce3a9d 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@openfeature/server-sdk", - "version": "1.16.2", + "version": "1.17.0", "description": "OpenFeature SDK for JavaScript", "main": "./dist/cjs/index.js", "files": [ @@ -48,9 +48,9 @@ "node": ">=18" }, "peerDependencies": { - "@openfeature/core": "^1.5.0" + "@openfeature/core": "^1.6.0" }, "devDependencies": { - "@openfeature/core": "^1.5.0" + "@openfeature/core": "^1.6.0" } } From 3277412a61a8aa91118e34f423d01cbdd7536c44 Mon Sep 17 00:00:00 2001 From: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:58:49 -0500 Subject: [PATCH 10/12] chore(main): release react-sdk 0.4.10 (#1105) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :robot: I have created a release *beep* *boop* --- ## [0.4.10](https://github.com/open-feature/js-sdk/compare/react-sdk-v0.4.9...react-sdk-v0.4.10) (2024-12-18) ### 🔄 Refactoring * export public option types ([#1101](https://github.com/open-feature/js-sdk/issues/1101)) ([16321c3](https://github.com/open-feature/js-sdk/commit/16321c31f27c5fce2c8e2adea893cf6e7e8ce3de)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Signed-off-by: OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com> Co-authored-by: Michael Beemer --- .release-please-manifest.json | 2 +- packages/react/CHANGELOG.md | 7 +++++++ packages/react/README.md | 4 ++-- packages/react/package.json | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3667a7491..a6d9739c8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,6 +1,6 @@ { "packages/nest": "0.2.2", - "packages/react": "0.4.9", + "packages/react": "0.4.10", "packages/angular": "0.0.1-experimental", "packages/web": "1.4.0", "packages/server": "1.17.0", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 0cc474678..93681cb66 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.4.10](https://github.com/open-feature/js-sdk/compare/react-sdk-v0.4.9...react-sdk-v0.4.10) (2024-12-18) + + +### 🔄 Refactoring + +* export public option types ([#1101](https://github.com/open-feature/js-sdk/issues/1101)) ([16321c3](https://github.com/open-feature/js-sdk/commit/16321c31f27c5fce2c8e2adea893cf6e7e8ce3de)) + ## [0.4.9](https://github.com/open-feature/js-sdk/compare/react-sdk-v0.4.8...react-sdk-v0.4.9) (2024-12-04) diff --git a/packages/react/README.md b/packages/react/README.md index fb3d8d1a8..3acbff03b 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -16,8 +16,8 @@ Specification - - Release + + Release
diff --git a/packages/react/package.json b/packages/react/package.json index 000d32f64..077328501 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@openfeature/react-sdk", - "version": "0.4.9", + "version": "0.4.10", "description": "OpenFeature React SDK", "main": "./dist/cjs/index.js", "files": [ From 587bf1a7bb3b61d9e9eabf2ad8cf48fc91374c18 Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Fri, 20 Dec 2024 21:16:57 -0500 Subject: [PATCH 11/12] feat: moving to a LogLevel argument for DefaultLogger defaulted to warn Signed-off-by: Kevin Long --- packages/shared/src/hooks/logging-hook.ts | 8 ++++--- packages/shared/src/logger/default-logger.ts | 23 +++++++++++--------- packages/shared/src/logger/logger.ts | 7 ++++++ 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/packages/shared/src/hooks/logging-hook.ts b/packages/shared/src/hooks/logging-hook.ts index 18c2ad2a7..3c85033ca 100644 --- a/packages/shared/src/hooks/logging-hook.ts +++ b/packages/shared/src/hooks/logging-hook.ts @@ -2,8 +2,9 @@ import type { OpenFeatureError } from '../errors'; import type { BaseHook } from './hook'; import type { BeforeHookContext, HookContext, HookHints } from './hooks'; import type { FlagValue, EvaluationDetails } from '../evaluation'; +import type { Logger } from '../logger'; +import { DefaultLogger, LogLevel, SafeLogger } from '../logger'; -import { DefaultLogger, SafeLogger } from '../logger'; type LoggerPayload = Record; @@ -20,10 +21,11 @@ const VALUE_KEY = 'value'; export class LoggingHook implements BaseHook { readonly includeEvaluationContext: boolean = false; - readonly logger = new SafeLogger(new DefaultLogger(true, true)); + readonly logger: Logger; - constructor(includeEvaluationContext: boolean = false) { + constructor(includeEvaluationContext: boolean = false, logger?: Logger) { this.includeEvaluationContext = !!includeEvaluationContext; + this.logger = logger || new SafeLogger(new DefaultLogger(LogLevel.DEBUG)); } before(hookContext: BeforeHookContext): void { diff --git a/packages/shared/src/logger/default-logger.ts b/packages/shared/src/logger/default-logger.ts index f390dffa9..62be655a1 100644 --- a/packages/shared/src/logger/default-logger.ts +++ b/packages/shared/src/logger/default-logger.ts @@ -1,33 +1,36 @@ /* eslint-disable @typescript-eslint/no-empty-function */ -import type { Logger } from './logger'; +import type { Logger} from './logger'; +import { LogLevel } from './logger'; export class DefaultLogger implements Logger { - private readonly showInfo : boolean = false; - private readonly showDebug : boolean = false; + private readonly logLevel : LogLevel; - constructor(showInfo: boolean = false, showDebug: boolean = false){ - this.showInfo = showInfo; - this.showDebug = showDebug; + constructor(logLevel: LogLevel = LogLevel.WARN){ + this.logLevel = logLevel; } error(...args: unknown[]): void { - console.error(...args); + if(this.logLevel >= LogLevel.ERROR) { + console.error(...args); + } } warn(...args: unknown[]): void { - console.warn(...args); + if(this.logLevel >= LogLevel.WARN) { + console.warn(...args); + } } info(...args: unknown[]): void { - if(this.showInfo) { + if(this.logLevel >= LogLevel.INFO) { console.info(...args); } } debug(...args: unknown[]): void { - if(this.showDebug) { + if(this.logLevel === LogLevel.DEBUG) { console.debug(...args); } } diff --git a/packages/shared/src/logger/logger.ts b/packages/shared/src/logger/logger.ts index 04d9c06b8..db40847a5 100644 --- a/packages/shared/src/logger/logger.ts +++ b/packages/shared/src/logger/logger.ts @@ -20,3 +20,10 @@ export interface ManageLogger { */ setLogger(logger: Logger): T; } + +export enum LogLevel { + ERROR = 1, + WARN = 2, + INFO = 3, + DEBUG = 4, +} From c4c4620e205a5ad73e3c7d10237638e1a3f7abf7 Mon Sep 17 00:00:00 2001 From: Kevin Long Date: Fri, 20 Dec 2024 21:25:14 -0500 Subject: [PATCH 12/12] fix: updating tests based on new DefaultLogger constructor signature Signed-off-by: Kevin Long --- packages/shared/src/hooks/logging-hook.ts | 3 ++- packages/shared/test/logger-hook.spec.ts | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/hooks/logging-hook.ts b/packages/shared/src/hooks/logging-hook.ts index 3c85033ca..4511e8baf 100644 --- a/packages/shared/src/hooks/logging-hook.ts +++ b/packages/shared/src/hooks/logging-hook.ts @@ -55,7 +55,8 @@ export class LoggingHook implements BaseHook { this.logger.error(payload); } - finally(hookContext: Readonly>, hookHints?: HookHints): void { + + finally(hookContext: Readonly>, evaluationDetails: EvaluationDetails, hookHints?: HookHints): void { this.logger.info(hookContext, hookHints); } diff --git a/packages/shared/test/logger-hook.spec.ts b/packages/shared/test/logger-hook.spec.ts index 9adbf11d3..9b2c660b6 100644 --- a/packages/shared/test/logger-hook.spec.ts +++ b/packages/shared/test/logger-hook.spec.ts @@ -1,7 +1,7 @@ import { GeneralError } from '../src/errors'; import type { HookContext } from '../src/hooks/hooks'; import { LoggingHook } from '../src/hooks/logging-hook'; -import { DefaultLogger, SafeLogger } from '../src/logger'; +import { DefaultLogger, LOG_LEVELS, LogLevel, SafeLogger } from '../src/logger'; describe('LoggingHook', () => { const FLAG_KEY = 'some-key'; @@ -21,7 +21,7 @@ describe('LoggingHook', () => { const ERROR_MESSAGE_KEY = 'error_message'; let hookContext: HookContext; - const logger : SafeLogger = new SafeLogger(new DefaultLogger(true, true)); + const logger : SafeLogger = new SafeLogger(new DefaultLogger(LogLevel.DEBUG)); beforeEach(() => { const mockProviderMetaData = { name: PROVIDER_NAME };