-
Notifications
You must be signed in to change notification settings - Fork 13
refactor: go typescript #306
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
Draft
erikfried
wants to merge
9
commits into
schibsted:master
Choose a base branch
from
erikfried:feat/ts-claude-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
- Add TypeScript configuration (tsconfig.json) with moderate strictness - Add type declarations for tiny-emitter library - Convert all source files to TypeScript: - Remove 'use strict' directives - Change imports from .js to extensionless - Add type annotations to functions, classes, and properties - Update build tooling: - Add TypeScript compilation step to build.sh - Update jest.config.js for TypeScript support - Update .eslintrc.yml with TypeScript rules - Update package.json with TypeScript dependencies and scripts - Delete manual .d.ts files (TypeScript will generate them) - Add CLAUDE.md for repository documentation All files now compile successfully with TypeScript.
Fixed a bug introduced during TypeScript conversion where RESTClient was being instantiated with pre-mapped URLs, causing urlMapper to be called twice (once in setter methods, then again in RESTClient constructor). Changes: - Fixed RESTClient instantiation in Identity, Monetization, and Payment classes to pass envDic parameter instead of pre-mapping URLs with urlMapper - Restored complete RESTClient mock implementation with proper makeUrl, get, and go methods to match original JavaScript version - Mock now includes URL encoding logic and Fixtures integration for test data All 264 tests now passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Reverted the import statements to use .js extensions as they were in the original JavaScript codebase. TypeScript supports .js extensions in imports when targeting ES modules, and this maintains consistency with the original code structure. Changed all imports from: import foo from './bar' to: import foo from './bar.js' All tests, type-checking, and linting still pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace any types with generic type parameter T in the Cache class to improve type safety. Consumers can now optionally specify the cached value type when creating Cache instances. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Convert all @typedef declarations in identity.ts to proper TypeScript interfaces - Add CachedObject<T> interface in cache.ts for typed cache storage - Remove redundant JSDoc type annotations (replaced by TypeScript types) - Keep descriptive comments in JSDoc format for documentation - Export all interfaces for use by consumers This improves type safety and enables better IDE support with proper TypeScript types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Create IdentityOptions interface for Identity constructor parameters - Update Identity class properties with proper types (Cache<any>, RESTClient, Window) - Add default parameter to RESTClient.get() method signature - Add null check for optional callbackBeforeRedirect before invocation - Remove redundant JSDoc type annotations replaced by TypeScript types This improves type safety and IDE support for Identity class usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Create IdentityOptions interface for Identity constructor parameters - Update Identity class properties with proper types (Cache<any>, RESTClient, Window) - Add default parameter to RESTClient.get() method signature - Add null check for optional callbackBeforeRedirect before invocation - Remove redundant JSDoc type annotations replaced by TypeScript types This improves type safety and IDE support for Identity class usage. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
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.
No description provided.