Skip to content

[FSSDK-12454] cleanup#329

Open
junaed-optimizely wants to merge 4 commits intomasterfrom
junaed/fssdk-12454-cleanup
Open

[FSSDK-12454] cleanup#329
junaed-optimizely wants to merge 4 commits intomasterfrom
junaed/fssdk-12454-cleanup

Conversation

@junaed-optimizely
Copy link
Copy Markdown
Collaborator

Summary

  • Remove all legacy top-level source files from src/ (24 files) that were superseded by the new subdirectory-based modules (client/, hooks/, logger/, provider/, utils/)
  • Remove Jest and related packages (jest, jest-environment-jsdom, ts-jest, @types/jest), config (jest.config.js), and the test:legacy script - all tests now run exclusively via Vitest
  • Update all internal import paths to remove explicit /index suffixes, preventing accidental resolution to old top-level files
  • Simplify Vitest config by removing the per-subdirectory include list (no longer needed since old spec files are gone)
  • Re-enable lint-staged with eslint --fix (was temporarily disabled during v6 migration)
  • Remove Jest-specific .vscode/launch.json and jest: true from .eslintrc.js env

Test plan

  • All 249 tests pass across 14 test files via vitest run

Issues

  • FSSDK-12454

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /index suffixes 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants