Skip to content

Commit c225f3f

Browse files
msiebertclaude
andcommitted
Convert OpenFeature provider to TypeScript with npm workspaces setup
- Move openfeature-server-provider to packages/ as an npm workspace - Convert all source and tests from JavaScript to TypeScript - Add README adapted from the Java OpenFeature provider - Bump main SDK version to 0.21.0 for shutdown method support - Add shutdown() and areFlagsReady() to flag provider type declarations - Add workspace scripts (test:all, build:workspaces) to root package.json - Exclude packages/ from main SDK npm tarball via .npmignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bde91e7 commit c225f3f

18 files changed

Lines changed: 614 additions & 1556 deletions

File tree

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
test/
22
.github/
3+
packages/

lib/flags/local_flags.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,14 @@ export default class LocalFeatureFlagsProvider {
7777
* @param context - Evaluation context (must include distinct_id)
7878
*/
7979
getAllVariants(context: FlagContext): { [key: string]: SelectedVariant };
80+
81+
/**
82+
* Stop polling and clean up resources
83+
*/
84+
shutdown(): void;
85+
86+
/**
87+
* Returns a promise that resolves when flag definitions have been fetched
88+
*/
89+
areFlagsReady(): Promise<void>;
8090
}

lib/flags/remote_flags.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,9 @@ export default class RemoteFeatureFlagsProvider {
7171
getAllVariants(
7272
context: FlagContext,
7373
): Promise<{ [key: string]: SelectedVariant } | null>;
74+
75+
/**
76+
* Clean up resources (no-op for remote provider)
77+
*/
78+
shutdown(): void;
7479
}

0 commit comments

Comments
 (0)