-
Notifications
You must be signed in to change notification settings - Fork 402
Typescript conversion #22
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
Open
TonyCasey
wants to merge
6
commits into
disler:main
Choose a base branch
from
TonyCasey:typescript-conversion
base: main
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.
Open
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
- Replace Python + uv dependency with pure Node.js/TypeScript runtime - Convert 18 Python scripts: hooks, utilities, status lines, and apps - Implement TypeScript equivalents with full functionality preservation: * Anthropic, OpenAI, and Ollama LLM integrations using modern SDKs * Cross-platform TTS support (ElevenLabs, OpenAI, native system TTS) * All Claude Code hook scripts with enhanced type safety * Status line scripts with git integration and session tracking - Add comprehensive TypeScript project setup (package.json, tsconfig.json) - Maintain exact CLI interfaces and behavior compatibility - Improve error handling and cross-platform support - Remove original Python files after successful conversion Benefits: - Single runtime environment (Node.js only) - Better IDE support with TypeScript - Improved type safety and development experience - Modern SDK usage and dependency management 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Updated all Python script references to use npx ts-node with .ts extensions - Converted Python code examples to TypeScript equivalents - Replaced Python validation example with TypeScript implementation - Updated script paths in hook configurations and documentation - Converted bash format_code.sh to TypeScript format_code.ts - Removed Python-specific formatting tools (black, autopep8, isort) - Enhanced TypeScript/JavaScript formatting support - Updated debugging references and script execution commands 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Create comprehensive TypeScript type definitions for all hooks - Add TTS functionality to notification.ts with multi-provider support - Implement structured logging with timestamps - Add environment variable and CLI flag support for TTS 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add comprehensive build automation with npm scripts - Create migration script for Python to TypeScript transition - Configure ESLint and Prettier for code quality - Document breaking changes and migration guide in README - Replace ts-node with tsx for better performance - Add Jest testing infrastructure with sample tests - Create make-hooks-executable script for post-build processing - Update dependencies to modern versions - Add TypeScript architecture documentation BREAKING CHANGE: Project now requires Node.js 18+ and npm instead of Python 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix type guard logic errors by properly handling null/undefined values - Create tsconfig.test.json and update ESLint config to resolve test file parsing - Fix linting errors in apps/hello.ts and test files - Ensure all 11 tests pass successfully - Verify hook execution works properly with tsx 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add detailed TypeScript code examples and type definitions - Include complete development workflow with npm scripts - Update all configuration examples to use tsx instead of ts-node - Add CLI testing examples for direct hook execution - Expand migration guide with benefits and compatibility notes - Include comprehensive test suite instructions - Emphasize type safety and modern tooling advantages 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
I converted it to TypeScript for myself and decided to create a PR and make it available for others |
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.
🚀 Complete Python to TypeScript Migration
This PR represents a comprehensive migration of the entire Claude Code
hooks ecosystem from Python to TypeScript, delivering significant
improvements in type safety, performance, and developer experience.
📊 Migration Summary
equivalents
testing
✅ What's Included
Core Migration
management, etc.
TTS providers
types/index.tsProduction Tooling
rules
classes
build:hooksDeveloper Experience
issues
execution
🔧 Technical Highlights
Type System Architecture