Skip to content

Conversation

wasabeef
Copy link
Owner

@wasabeef wasabeef commented Jun 25, 2025

Summary

This PR improves code quality and modernizes the project toolchain through several key changes:

Code Quality Improvements

  • Eliminate code duplication: Created _BaseHookResult<T> base class to consolidate shared functionality between hook result classes
  • Extract constants and helpers: Added _kEmptyWidget, _kDeprecationMessage constants and _applyWrapper helper function
  • Remove meaningless APIs: Deleted empty debug() methods that provided no actual debugging functionality
  • Fix documentation accuracy: Updated DartDoc comments to match actual implementation behavior

Toolchain Modernization

  • Migrate npm → bun: Replace npm with bun for faster package management
  • Replace Husky with Lefthook: More performant git hooks with better cross-platform support
  • Setup automated releases: Add GitHub Actions workflow for automated pub.dev publishing with conventional commits

Documentation Improvements

  • Fix terminology: Replace React terminology (component) with Flutter terminology (widget)
  • Accurate error messages: Update example error messages to match actual Flutter hooks errors
  • Improve installation guide: Add proper YAML syntax and version specification

Test Plan

  • All existing tests pass without modification
  • Dart analyzer reports no issues
  • Code formatting is consistent
  • No breaking changes to public API
  • Backward compatibility maintained

Breaking Changes

None. All changes are internal refactoring and toolchain updates that maintain full API compatibility.

wasabeef added 7 commits June 26, 2025 00:13
  - Create _BaseHookResult<T> base class for common functionality
  - Extract _applyWrapper helper function for wrapper logic
  - Add _kEmptyWidget and _kDeprecationMessage constants
  - Remove empty debug() implementation from HookResult
  - Remove empty debug() implementation from _HookTestingAction
  - Update test to focus on actual functionality instead of debug calls
  - Fix React terminology (component → widget) for Flutter context
  - Update error message to actual Flutter hooks error
  - Improve installation example with proper YAML syntax and version
  - Remove overly promotional language
  - Add GitHub Actions for automated releases with pub.dev publishing
  - Configure git-cliff for conventional commit changelog generation
  - Update CI workflow to use bun instead of npm
  - Replace npm with bun for package management
  - Switch from Husky to Lefthook for git hooks
  - Update package.json scripts and dependencies
  - Update melos and pubspec configurations
  - Add project documentation and guidelines
  - Update renovate and prettier configurations
@wasabeef wasabeef force-pushed the refactor-code-quality-improvements branch from a53b89f to 7c4ac66 Compare June 25, 2025 15:13
@wasabeef wasabeef changed the title refactor: eliminate code duplication with base class refactor: improve code quality and modernize toolchain Jun 25, 2025
@wasabeef wasabeef marked this pull request as ready for review June 25, 2025 15:17
@wasabeef wasabeef merged commit 2b64440 into main Jun 25, 2025
2 checks passed
@wasabeef wasabeef deleted the refactor-code-quality-improvements branch June 25, 2025 15:26
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