diff --git a/CHANGES.txt b/CHANGES.txt index dd8f5e6..d4571ce 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,14 +1,18 @@ -1.0.0 -- First release. Up to date with spec 0.4.0, and @openfeature/nodejs-sdk v0.2.0 -1.0.1 -- Fixes issues with flag details and error codes in negative cases, adds unit tests -- Up to date with spec 0.4.0 and @openfeature/nodejs-sdk v0.3.2 -1.0.2 -- Changes name from Node-specific implementation to generic JSON -- Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0 +1.1.0 (June 16, 2025) +- Uses renamed @openfeature/js-sdk to @openfeature/server-sdk +- Up to date with spec 0.8.0 and @openfeature/server-sdk 1.18.0 +- Uses split sdk 11.4.0 +1.0.4 +- Fixes issue with TS build +- Up to date with spec 0.5.0 and @openfeature/js-sdk 0.5.0 1.0.3 - Adds types definitions for TypeScript - Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0 -1.0.4 -- Fixes issue with TS build -- Up to date with spec 0.5.0 and @openfeature/js-sdk 0.5.0 \ No newline at end of file +1.0.2 +- Changes name from Node-specific implementation to generic JSON +- Up to date with spec 0.4.0 and @openfeature/js-sdk 0.4.0 +1.0.1 +- Fixes issues with flag details and error codes in negative cases, adds unit tests +- Up to date with spec 0.4.0 and @openfeature/nodejs-sdk v0.3.2 +1.0.0 +- First release. Up to date with spec 0.4.0, and @openfeature/nodejs-sdk v0.2.0 diff --git a/README.md b/README.md index 4f1d77e..16471f2 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ npm install @splitsoftware/openfeature-js-split-provider ### Confirm peer dependencies are installed ```sh npm install @splitsoftware/splitio -npm install @openfeature/js-sdk +npm install @openfeature/server-sdk ``` ### Register the Split provider with OpenFeature ```js -const OpenFeature = require('@openfeature/js-sdk').OpenFeature; +const OpenFeature = require('@openfeature/server-sdk').OpenFeature; const SplitFactory = require('@splitsoftware/splitio').SplitFactory; const OpenFeatureSplitProvider = require('@splitsoftware/openfeature-js-split-provider').OpenFeatureSplitProvider; diff --git a/package.json b/package.json index 9866777..5a0ba98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@splitsoftware/openfeature-js-split-provider", - "version": "1.0.6", + "version": "1.1.0", "description": "Split OpenFeature Provider", "files": [ "README.md", @@ -25,12 +25,12 @@ }, "dependencies": {}, "peerDependencies": { - "@openfeature/js-sdk": "^1.0.0", - "@splitsoftware/splitio": "^10.22.1" + "@openfeature/server-sdk": "^1.18.0", + "@splitsoftware/splitio": "^11.4.0" }, "devDependencies": { - "@openfeature/js-sdk": "^1.0.0", - "@splitsoftware/splitio": "^10.22.1", + "@openfeature/server-sdk": "^1.18.0", + "@splitsoftware/splitio": "^11.4.0", "copyfiles": "^2.4.1", "cross-env": "^7.0.3", "replace": "^1.2.1", @@ -39,7 +39,7 @@ "tape": "4.13.2", "tape-catch": "1.0.6", "ts-node": "^10.5.0", - "typescript": "4.4.4" + "typescript": "^4.9.5" }, "scripts": { "build-esm": "rimraf es && tsc -outDir es", diff --git a/src/__tests__/nodeSuites/client.spec.js b/src/__tests__/nodeSuites/client.spec.js index 53b3184..e134e64 100644 --- a/src/__tests__/nodeSuites/client.spec.js +++ b/src/__tests__/nodeSuites/client.spec.js @@ -1,4 +1,4 @@ -const OpenFeature = require('@openfeature/js-sdk').OpenFeature; +const OpenFeature = require('@openfeature/server-sdk').OpenFeature; const SplitFactory = require('@splitsoftware/splitio').SplitFactory; import { OpenFeatureSplitProvider } from '../..'; diff --git a/src/lib/js-split-provider.ts b/src/lib/js-split-provider.ts index c38d3b4..6fdaf55 100644 --- a/src/lib/js-split-provider.ts +++ b/src/lib/js-split-provider.ts @@ -7,7 +7,7 @@ import { JsonValue, TargetingKeyMissingError, StandardResolutionReasons, -} from "@openfeature/js-sdk"; +} from "@openfeature/server-sdk"; import type SplitIO from "@splitsoftware/splitio/types/splitio"; export interface SplitProviderOptions { @@ -31,10 +31,15 @@ export class OpenFeatureSplitProvider implements Provider { constructor(options: SplitProviderOptions) { this.client = options.splitClient; this.initialized = new Promise((resolve) => { - this.client.on(this.client.Event.SDK_READY, () => { + if ((this.client as any).__getStatus().isReady) { console.log(`${this.metadata.name} provider initialized`); resolve(); - }); + } else { + this.client.on(this.client.Event.SDK_READY, () => { + console.log(`${this.metadata.name} provider initialized`); + resolve(); + }); + } }); } diff --git a/tsconfig.json b/tsconfig.json index df0cd75..e0d54cb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -48,7 +48,8 @@ // "typeRoots": [], /* List of folders to include type definitions from. */ // "types": [], /* Type declaration files to be included in compilation. */ "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ - "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + "skipLibCheck": true /* Skip type checking of declaration files. */ // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */