Skip to content

feat: (breaking) moving to hookified v2#434

Merged
jaredwray merged 5 commits intomainfrom
feat-(breaking)-moving-to-hookified-v2
Mar 16, 2026
Merged

feat: (breaking) moving to hookified v2#434
jaredwray merged 5 commits intomainfrom
feat-(breaking)-moving-to-hookified-v2

Conversation

@jaredwray
Copy link
Copy Markdown
Owner

@jaredwray jaredwray commented Mar 16, 2026

Please check if the PR fulfills these requirements

  • Followed the Contributing and Code of Conduct guidelines.
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage.

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
feat: (breaking) moving to hookified v2

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a breaking change by upgrading the writr package to version 6.0.0. The core of this update involves migrating to version 2 of the hookified dependency, which significantly refactors the internal error handling and options management. This change streamlines the error propagation mechanism by leveraging the hookified base class's capabilities, leading to a more consistent and centralized approach to managing errors and configuration.

Highlights

  • Major Version Bump: The writr package has been updated from version 5.0.4 to 6.0.0, indicating a breaking change.
  • Hookified V2 Upgrade: The hookified dependency has been upgraded to version 2.1.0, moving to its v2 API which introduces changes to how options and error handling are managed.
  • Unified Error Handling: The WritrOptions type now extends HookifiedOptions, and the throwErrors option has been removed. Error throwing behavior is now controlled by hookified's throwOnEmitError property.
  • Refactored Constructor and Error Emission: The Writr constructor has been updated to properly pass HookifiedOptions to the super() call. A new private emitError method was introduced to ensure error events are always emitted, even when throwOnEmitError is enabled, by temporarily disabling it before emitting and then restoring its state.
  • Removed Redundant Error Checks: Explicit checks for this._options.throwErrors within catch blocks have been removed, as error propagation is now handled by the underlying hookified mechanism.
Changelog
  • package.json
    • Updated the project's major version to 6.0.0.
    • Upgraded the hookified dependency to version 2.1.0.
  • pnpm-lock.yaml
    • Updated the hookified dependency entry to version 2.1.0 and its corresponding integrity hash.
    • Removed the old hookified@1.15.1 entry from the packages and snapshots sections.
  • src/types.ts
    • Removed the throwErrors property from the WritrOptions type.
    • Extended WritrOptions with HookifiedOptions to inherit error handling properties from the base class.
    • Imported HookifiedOptions from the hookified package.
  • src/writr.ts
    • Removed the throwErrors initialization from the _options private property.
    • Modified the constructor to parse WritrOptions and pass relevant HookifiedOptions (like throwOnEmitError) to the super constructor.
    • Replaced direct calls to this.emit("error", error) with a new private this.emitError(error) method.
    • Removed conditional throw error statements that relied on the _options.throwErrors flag.
    • Updated the mergeOptions method to manage this.throwOnEmitError instead of current.throwErrors.
    • Added a new private emitError method to handle error emission, ensuring the error event is always emitted regardless of throwOnEmitError state.
  • test/writr.test.ts
    • Updated test cases to use throwOnEmitError instead of the removed throwErrors property when setting Writr options.
Activity
  • The pull request description indicates that the contributing and code of conduct guidelines have been followed.
  • The author noted that tests for the changes have not yet been added or do not have 100% code coverage.
  • The change is categorized as a 'feat: (breaking) moving to hookified v2'.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2af68e2) to head (998eb1a).
⚠️ Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #434   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          444       453    +9     
  Branches        94        98    +4     
=========================================
+ Hits           444       453    +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request successfully updates the hookified dependency to v2 and refactors the Writr class to align with the new API, including changes to options handling and error emission. The version bump in package.json and corresponding lock file updates are appropriate for a breaking change. The type definitions and constructor logic have been correctly adjusted to integrate HookifiedOptions.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f41c96339

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jaredwray jaredwray merged commit 368905e into main Mar 16, 2026
9 checks passed
@jaredwray jaredwray deleted the feat-(breaking)-moving-to-hookified-v2 branch March 16, 2026 20:57
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