Feature/VFX and animations #5

Merged
jusemon merged 4 commits from Feature/VFX-and-animations into main 2026-01-06 22:00:16 -05:00
Owner

TypeScript Migration & Code Quality Improvements

Overview

This PR migrates the entire codebase from JavaScript to TypeScript, introduces comprehensive code quality tooling, and improves the overall developer experience. This is a major refactoring that enhances type safety, maintainability, and code consistency across the project.

Key Changes

TypeScript Migration

  • Complete migration: All 47 JavaScript files (.js) converted to TypeScript (.ts)
  • Full type coverage: Removed all any types, replaced with proper TypeScript types
  • Type-safe interfaces: Created proper interfaces for events, items, and skill effects
  • Zero type errors: All code is fully typed with strict TypeScript configuration

Code Quality Improvements

  • ESLint configuration: Updated to use TypeScript ESLint with zero warnings policy
  • Prettier integration: Added code formatting with consistent style
  • Pre-commit hooks: Husky setup with lint-staged for automatic formatting/linting
  • CI-friendly: Pre-commit hooks automatically skip in CI environments

Visual Improvements

  • Glow effect fix: Replaced ugly square outline with proper pulsing bioluminescence glow effect
  • Better visual feedback: Enhanced mutation visual effects

Documentation

  • README update: Comprehensive update reflecting TypeScript migration and new tooling
  • Project structure: Updated documentation to match current codebase structure

Statistics

  • 108 files changed: 6,154 insertions(+), 3,716 deletions(-)
  • 47 files migrated: All .js files converted to .ts
  • 0 any types: Complete type safety achieved
  • 0 ESLint warnings: Strict linting enforced

Technical Details

Type System Improvements

  • Created proper interfaces for WeaponItem, ArmorItem, ConsumableItem
  • Added event data types (DamageDealtEvent, MutationGainedEvent, etc.)
  • Properly typed all system casts (removed any assertions)
  • Added isProjectile property to Health component
  • Created SkillEffect interface for type-safe skill effects

Developer Experience

  • Format script: npm run format - Format all files
  • Format check: npm run format:check - Check formatting
  • Lint: npm run lint - Lint with zero warnings
  • Lint fix: npm run lint:fix - Auto-fix linting issues
  • Pre-commit: Automatic formatting and linting before commits

Build & Tooling

  • TypeScript 5.9.3: Latest TypeScript with strict mode
  • ESLint 9.39.2: Modern flat config with TypeScript support
  • Prettier 3.7.4: Code formatting
  • Husky 9.1.7: Git hooks (skips in CI)
  • lint-staged 16.2.7: Run linters on staged files

Visual Changes

Bioluminescence Effect

  • Before: Ugly white square outline around character
  • After: Beautiful pulsing radial gradient glow with:
    • Smooth pulsing animation
    • Layered glow effect (outer + inner core)
    • Screen blend mode for proper glow appearance
    • Cyan/white color scheme matching bioluminescence theme

File Structure

All files migrated from .js to .ts:

  • Components: 14 files (Position, Health, Stats, Evolution, etc.)
  • Systems: 16 files (RenderSystem, CombatSystem, AISystem, etc.)
  • Core: 11 files (Engine, Entity, Component, System, etc.)
  • Skills: 6 files (Skill, SkillRegistry, individual skills)
  • Items: 2 files (Item, ItemRegistry)
  • Config: GameConfig, World, main entry point

Quality Assurance

  • All TypeScript compilation passes
  • Zero ESLint warnings
  • All code formatted with Prettier
  • No any types remaining
  • No non-null assertions (!)
  • Proper null checks throughout
  • Type-safe event system
  • Type-safe system interactions

Migration Benefits

  1. Type Safety: Catch errors at compile time instead of runtime
  2. Better IDE Support: Enhanced autocomplete, refactoring, and navigation
  3. Self-Documenting: Types serve as inline documentation
  4. Easier Refactoring: TypeScript makes large refactors safer
  5. Consistent Code Style: Prettier ensures uniform formatting
  6. Automated Quality Checks: Pre-commit hooks prevent bad code from being committed

Breaking Changes

None - this is a pure refactoring. All functionality remains identical, only the implementation language changed.

Notes

  • Pre-commit hooks automatically skip in CI environments (GitHub Actions, GitLab CI, Jenkins)
  • All old .js files have been removed
  • Import paths updated to use .ts extensions
  • tsconfig.json configured with strict mode and modern ES2020 target

Testing

  • Game runs successfully
  • All systems functional
  • No runtime errors
  • Visual effects working correctly
  • Type checking passes

Branch: Feature/VFX-and-animations
Base: main

# TypeScript Migration & Code Quality Improvements ## Overview This PR migrates the entire codebase from JavaScript to TypeScript, introduces comprehensive code quality tooling, and improves the overall developer experience. This is a major refactoring that enhances type safety, maintainability, and code consistency across the project. ## Key Changes ### TypeScript Migration - **Complete migration**: All 47 JavaScript files (`.js`) converted to TypeScript (`.ts`) - **Full type coverage**: Removed all `any` types, replaced with proper TypeScript types - **Type-safe interfaces**: Created proper interfaces for events, items, and skill effects - **Zero type errors**: All code is fully typed with strict TypeScript configuration ### Code Quality Improvements - **ESLint configuration**: Updated to use TypeScript ESLint with zero warnings policy - **Prettier integration**: Added code formatting with consistent style - **Pre-commit hooks**: Husky setup with lint-staged for automatic formatting/linting - **CI-friendly**: Pre-commit hooks automatically skip in CI environments ### Visual Improvements - **Glow effect fix**: Replaced ugly square outline with proper pulsing bioluminescence glow effect - **Better visual feedback**: Enhanced mutation visual effects ### Documentation - **README update**: Comprehensive update reflecting TypeScript migration and new tooling - **Project structure**: Updated documentation to match current codebase structure ## Statistics - **108 files changed**: 6,154 insertions(+), 3,716 deletions(-) - **47 files migrated**: All `.js` files converted to `.ts` - **0 `any` types**: Complete type safety achieved - **0 ESLint warnings**: Strict linting enforced ## Technical Details ### Type System Improvements - Created proper interfaces for `WeaponItem`, `ArmorItem`, `ConsumableItem` - Added event data types (`DamageDealtEvent`, `MutationGainedEvent`, etc.) - Properly typed all system casts (removed `any` assertions) - Added `isProjectile` property to `Health` component - Created `SkillEffect` interface for type-safe skill effects ### Developer Experience - **Format script**: `npm run format` - Format all files - **Format check**: `npm run format:check` - Check formatting - **Lint**: `npm run lint` - Lint with zero warnings - **Lint fix**: `npm run lint:fix` - Auto-fix linting issues - **Pre-commit**: Automatic formatting and linting before commits ### Build & Tooling - **TypeScript 5.9.3**: Latest TypeScript with strict mode - **ESLint 9.39.2**: Modern flat config with TypeScript support - **Prettier 3.7.4**: Code formatting - **Husky 9.1.7**: Git hooks (skips in CI) - **lint-staged 16.2.7**: Run linters on staged files ## Visual Changes ### Bioluminescence Effect - **Before**: Ugly white square outline around character - **After**: Beautiful pulsing radial gradient glow with: - Smooth pulsing animation - Layered glow effect (outer + inner core) - Screen blend mode for proper glow appearance - Cyan/white color scheme matching bioluminescence theme ## File Structure All files migrated from `.js` to `.ts`: - **Components**: 14 files (Position, Health, Stats, Evolution, etc.) - **Systems**: 16 files (RenderSystem, CombatSystem, AISystem, etc.) - **Core**: 11 files (Engine, Entity, Component, System, etc.) - **Skills**: 6 files (Skill, SkillRegistry, individual skills) - **Items**: 2 files (Item, ItemRegistry) - **Config**: GameConfig, World, main entry point ## Quality Assurance - All TypeScript compilation passes - Zero ESLint warnings - All code formatted with Prettier - No `any` types remaining - No non-null assertions (`!`) - Proper null checks throughout - Type-safe event system - Type-safe system interactions ## Migration Benefits 1. **Type Safety**: Catch errors at compile time instead of runtime 2. **Better IDE Support**: Enhanced autocomplete, refactoring, and navigation 3. **Self-Documenting**: Types serve as inline documentation 4. **Easier Refactoring**: TypeScript makes large refactors safer 5. **Consistent Code Style**: Prettier ensures uniform formatting 6. **Automated Quality Checks**: Pre-commit hooks prevent bad code from being committed ## Breaking Changes None - this is a pure refactoring. All functionality remains identical, only the implementation language changed. ## Notes - Pre-commit hooks automatically skip in CI environments (GitHub Actions, GitLab CI, Jenkins) - All old `.js` files have been removed - Import paths updated to use `.ts` extensions - `tsconfig.json` configured with strict mode and modern ES2020 target ## Testing - Game runs successfully - All systems functional - No runtime errors - Visual effects working correctly - Type checking passes --- **Branch**: `Feature/VFX-and-animations` **Base**: `main`
jusemon added 4 commits 2026-01-06 21:57:42 -05:00
jusemon merged commit 0d3bce4d4f into main 2026-01-06 22:00:16 -05:00
jusemon deleted branch Feature/VFX-and-animations 2026-01-06 22:00:16 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: jusemon/slime#5
No description provided.