Skip to content

Too Many TypeScript errors #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 6, 2025
Merged

Conversation

mikechu-optimizely
Copy link
Collaborator

I'm merging this into main which I'll rename to main-old and try attempt 3 with a better plan.

I'll use a .gitignored copy of `master` for Windsurf's ref
- Add proper request/response type interfaces
- Update tsconfig.json with better module resolution
- Clean up adapter imports and type usage
- Remove redundant CDNSettings imports
- Improve CloudflareAdapter type safety
Keep Decision interface in OptimizelyProvider as it's a core Optimizely concept
…pt versions

- Removed duplicate JavaScript files that have TypeScript equivalents:
  - coreLogic.js -> CoreLogic.ts
  - optimizelyProvider.js -> OptimizelyProvider.ts
  - userProfileService.js -> UserProfileService.ts
  - eventListeners.js -> EventListeners.ts
  - registeredListeners.js -> RegisteredListeners.ts

- Updated imports in affected files to use TypeScript versions:
  - CoreLogic.ts
  - CloudflareAdapter.ts
  - index.js
- Created new TypeScript API types in src/types/api.ts
- Migrated API handlers to TypeScript:
  - apiRouter.js -> ApiRouter.ts
  - handlers/datafile.js -> handlers/Datafile.ts
  - handlers/flagKeys.js -> handlers/FlagKeys.ts
  - handlers/sdk.js -> handlers/Sdk.ts
  - handlers/variationChanges.js -> handlers/VariationChanges.ts
- Created handlers/index.ts to export all handlers
- Updated index.js to use new TypeScript API router
- Removed old JavaScript API files
- Removed 'I' prefix from type names following TypeScript best practices
- Converted interfaces to type aliases where appropriate
- Updated type exports to use explicit named exports
- Updated type documentation to reflect changes
- Maintained consistent type naming across the codebase
- Remove unused optlyHelper dependency
- Replace helper functions with native JSON methods
- Add proper error handling for JSON parsing
- Fix parameter reassignment with proper variable scoping
- Use TypeScript idiomatic type checking
- Convert regular imports to type imports where appropriate
- Rename extractCdnSettings to extractDecisionSettings
- Update DefaultSettings export to named export
- Fix trailingComma to trailingCommas in biome config
@mikechu-optimizely mikechu-optimizely merged commit 6c6a902 into main Jan 6, 2025
1 check was pending
@mikechu-optimizely mikechu-optimizely deleted the feature/fix-static-errors branch January 6, 2025 16:50
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.

1 participant