Skip to content

feat: second generic for resolvers/transformer hooks for explicit type#26

Merged
fratzinger merged 2 commits intomainfrom
feat/second-generic-explicit-type
Mar 11, 2026
Merged

feat: second generic for resolvers/transformer hooks for explicit type#26
fratzinger merged 2 commits intomainfrom
feat/second-generic-explicit-type

Conversation

@fratzinger
Copy link
Member

@fratzinger fratzinger commented Mar 11, 2026

This pull request introduces several improvements and refactorings across the codebase, focusing on predicate naming consistency, enhanced documentation and utility metadata, improved type safety, and more flexible hook utilities. The most significant changes are grouped below:

Predicate and Hook Refactoring

  • Renamed the every and some predicates to and and or respectively, while retaining every and some as aliases for backward compatibility. Updated all relevant documentation, tests, and imports to reflect these changes. [1] [2] [3] [4] [5] [6] [7]

Utility Metadata and Documentation

  • Added support for an aliases property in the Utility type and ensured that utility discovery and documentation generation now include and display aliases. This helps users find utilities by alternative names. [1] [2] [3] [4]
  • Improved formatting and grouping in the VitePress documentation config for better readability and maintainability.

Type Safety and Testing

  • Added comprehensive type and runtime tests for the hasQuery guard, ensuring it properly narrows types and works as expected in various scenarios. [1] [2]

Hook Utility Improvements

  • Refactored multiple hooks (checkRequired, createRelated, disablePagination, onDelete, setField, softDelete, stashable) to use a new object-based signature for checkContext, improving readability and extensibility. [1] [2] [3] [4] [5] [6] [7]

API Flexibility

  • Enhanced the transformData and transformResult hooks to support generic transformer input types, increasing flexibility for advanced use cases. Also improved formatting in their type tests. [1] [2] [3] [4]

These changes collectively improve code consistency, documentation clarity, and developer ergonomics across the project.

@cloudflare-workers-and-pages
Copy link

Deploying feathers-utils with  Cloudflare Pages  Cloudflare Pages

Latest commit: c20bc97
Status: ✅  Deploy successful!
Preview URL: https://f574cd73.feathers-utils.pages.dev
Branch Preview URL: https://feat-second-generic-explicit.feathers-utils.pages.dev

View logs

@fratzinger fratzinger merged commit ad9896f into main Mar 11, 2026
11 checks passed
@fratzinger fratzinger deleted the feat/second-generic-explicit-type branch March 11, 2026 12:46
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