Open
Conversation
efahk
reviewed
Apr 7, 2026
Contributor
|
hmm we need docs for how to use it? also for this new sub-package, i think it's more appropriate to make it 100% ts native as well, can skip the complicated .d.ts and define all types inline |
c225f3f to
fa9572f
Compare
Implement an OpenFeature provider for the Mixpanel Node SDK as a separate package in openfeature-server-provider/. Wraps either LocalFeatureFlagsProvider or RemoteFeatureFlagsProvider via the shared getVariant() API. Key design decisions: - Uses Symbol sentinel for fallback detection (flag-not-found) - Context set globally via initialize(), per-evaluation context ignored - targetingKey has no special meaning - Handles both sync (local) and async (remote) providers via await - Reason codes: STATIC for success, ERROR for failures - Error codes: PROVIDER_NOT_READY, FLAG_NOT_FOUND, TYPE_MISMATCH - onClose() is a no-op - Returns default value on all errors Includes 32 tests covering all flag types, error cases, async providers, context handling, and edge cases. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds PROVIDER_NOT_READY tests for string, number, and object types (boolean was already covered), and SDK exception handling tests verifying that getVariant failures return defaults with error codes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge per-evaluation context on top of init context so callers can override or extend context at each flag evaluation, matching the OpenFeature specification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- shutdown() now delegates to underlying flags provider - Add areFlagsReady() to LocalFlagsProvider, check before evaluation - Return ErrorCode.GENERAL (not PROVIDER_NOT_READY) for exceptions - Add context value unwrapping with whole-number float→int conversion - Update tests for new error codes and add shutdown/readiness tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract shared _resolveTypedFlag helper to eliminate ~70 lines of duplicated type-checking across 4 resolve methods. Fix misplaced shutdown() that broke JSDoc association. Remove dead integer truncation code. Fix inconsistent snake_case naming and simplify null checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove dangerous {value: X} unwrapping heuristic that silently destroyed
legitimate context data. Add Date-to-ISO-string conversion. Add await to
onClose shutdown. Update TypeScript declarations with optional methods.
Add files field to package.json. Add 6 context-building tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Required by repo policy — actions must be pinned to full-length commit SHAs rather than version tags. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Track openfeature-server-provider/package-lock.json so npm ci works in CI - Fix prettier formatting in test file Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
areFlagsReady() previously checked flagDefinitions.size > 0, which incorrectly reported "not ready" when the API returned an empty flags array. Now returns a promise that resolves after the first successful fetch, regardless of whether flags were returned. The OpenFeature provider awaits this promise during initialize() instead of using a simple boolean. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MixpanelProvider.createLocal and createRemote accept a token and config, create the Mixpanel client internally, auto-start polling for local configs, and expose the client via the mixpanel property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… flag not found Updates OpenFeature provider reason codes to match the updated spec: - Success: STATIC → TARGETING_MATCH - Flag not found: ERROR → DEFAULT Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…essages, fix CI - Add JSDoc comments to MixpanelProvider public methods - Bind @openfeature/server-sdk peer dependency to ^1.17.0 - Use npm test with coverage in CI openfeature job - Remove unnecessary article from type mismatch error messages - Fix areFlagsReady return type in index.d.ts (Promise<void>, not boolean) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 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>
fa9572f to
4da0720
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All publishable targets now live under packages/. The root becomes a private workspace orchestrator while the mixpanel npm package ships from packages/mixpanel/ with an explicit files allowlist. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| @@ -0,0 +1,17 @@ | |||
| { | |||
Contributor
There was a problem hiding this comment.
i tsconfig and vitest thing should be on root dir
| @@ -0,0 +1,2 @@ | |||
| dist/ | |||
- Collapse CI into single job using npm run test:all + tsc --build from root; drop working-directory in favor of npm workspaces - Add root tsconfig.json solution file with project references to both packages; both package tsconfigs are now composite - Hoist .gitignore to repo root (adds dist/, *.tsbuildinfo); delete the per-package .gitignore - Bind mixpanel peerDep to ^0.21.0; devDep uses workspace (*) - Add --coverage to both packages' test scripts for parity - Add concise JSDoc to MixpanelProvider public methods Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Both workspace test scripts now emit coverage-final.json; wire it up to codecov-action so PRs get a coverage delta comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move vitest and @vitest/coverage-v8 to root devDependencies so both workspaces share a single version. Also drop typescript from the openfeature package (already in root). Per-package devDeps now contain only package-specific test helpers (nock, proxyquire for mixpanel; @openfeature/core, @openfeature/server-sdk, mixpanel workspace pin for openfeature-server-provider). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hans-lizihan
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Design
🤖 Generated with Claude Code