Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes superseded legacy top-level modules and Jest-era tooling, standardizing the codebase on the newer subdirectory-based modules (client/, provider/, hooks/, logger/, utils/) and Vitest-only testing.
Changes:
- Deleted legacy top-level
src/*modules and their Jest-based specs that have been replaced by the subdirectory module structure. - Removed Jest tooling/config and updated configs/scripts to rely exclusively on Vitest.
- Updated internal imports to avoid explicit
/indexsuffixes and simplified Vitest coverage include paths.
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.mts | Simplifies test config by removing the per-subdirectory test include list and broadening coverage include to src/**. |
| src/index.ts | Updates public exports to reference module directories (no explicit /index suffix). |
| src/utils/UserContextManager.ts | Updates imports to use directory entrypoints (no explicit /index). |
| src/utils/UserContextManager.spec.ts | Updates imports to use directory entrypoints (no explicit /index). |
| src/provider/OptimizelyProvider.spec.tsx | Updates imports to use directory entrypoints (no explicit /index). |
| src/hooks/useProviderState.ts | Updates provider type imports to use directory entrypoints (no explicit /index). |
| src/hooks/useOptimizelyContext.ts | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useOptimizelyClient.spec.tsx | Updates provider/client imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecideForKeysAsync.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecideForKeys.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecideAsync.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecideAllAsync.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecideAll.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useDecide.spec.tsx | Updates provider imports to use directory entrypoints (no explicit /index). |
| src/hooks/useAsyncDecision.ts | Updates provider type imports to use directory entrypoints (no explicit /index). |
| src/hooks/testUtils.tsx | Updates provider/client imports to use directory entrypoints (no explicit /index). |
| package.json | Removes Jest-related scripts/deps and re-enables lint-staged to run eslint --fix. |
| .eslintrc.js | Removes jest: true env now that Jest is removed. |
| jest.config.js | Removes Jest configuration file. |
| .vscode/launch.json | Removes Jest-specific VS Code launch configuration. |
| src/withOptimizely.tsx | Removes legacy top-level HOC implementation file. |
| src/withOptimizely.spec.tsx | Removes legacy top-level Jest test for withOptimizely. |
| src/Variation.tsx | Removes legacy top-level Variation component file. |
| src/utils.tsx | Removes legacy top-level utilities module (superseded by src/utils/*). |
| src/utils.spec.tsx | Removes legacy top-level Jest test for src/utils.tsx. |
| src/Provider.tsx | Removes legacy top-level Provider implementation file. |
| src/Provider.spec.tsx | Removes legacy top-level Jest test for src/Provider.tsx. |
| src/notifier.ts | Removes legacy top-level notifier implementation file. |
| src/notifier.spec.ts | Removes legacy top-level Jest test for notifier. |
| src/logOnlyEventDispatcher.ts | Removes legacy top-level event dispatcher implementation file. |
| src/logOnlyEventDispatcher.spec.ts | Removes legacy top-level Jest test for the dispatcher. |
| src/logger.tsx | Removes legacy top-level logger facade file. |
| src/logger.spec.ts | Removes legacy top-level Jest test for the logger. |
| src/index.cjs.ts | Removes legacy CommonJS entry shim. |
| src/hooks.ts | Removes legacy top-level hooks module file. |
| src/hooks.spec.tsx | Removes legacy top-level Jest test suite for hooks. |
| src/Feature.tsx | Removes legacy top-level Feature component file. |
| src/Feature.spec.tsx | Removes legacy top-level Jest test for Feature component. |
| src/Experiment.tsx | Removes legacy top-level Experiment component file. |
| src/Experiment.spec.tsx | Removes legacy top-level Jest test for Experiment component. |
| src/Context.ts | Removes legacy top-level Context module file. |
| src/client.ts | Removes legacy top-level client implementation file. |
| src/client.spec.ts | Removes legacy top-level Jest test for src/client.ts. |
| src/autoUpdate.ts | Removes legacy top-level auto-update helper file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
client/,hooks/,logger/,provider/,utils/)jest, jest-environment-jsdom, ts-jest, @types/jest), config (jest.config.js), and thetest:legacyscript - all tests now run exclusively viaVitest/indexsuffixes, preventing accidental resolution to old top-level filesVitestconfig by removing the per-subdirectory include list (no longer needed since old spec files are gone)lint-stagedwitheslint --fix(was temporarily disabled during v6 migration).vscode/launch.jsonandjest: truefrom.eslintrc.jsenvTest plan
Issues