Skip to content
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

Add new Adapter and Action interfaces, add new Next.js handler implementation, remove middlewares #401

Draft
wants to merge 33 commits into
base: main
Choose a base branch
from

Conversation

witoszekdev
Copy link
Member

@witoszekdev witoszekdev commented Jan 28, 2025

This PR adds new interfaces for writing handlers:

  • Adapter
  • Action
  • Validator

It replaces Next.js handlers with these new abstractions.
It removes deprecated process-protected-handler, in favor of validator class.

It also removes middlewares and retes dependency, since they are no longer used by library code.

Copy link

changeset-bot bot commented Jan 28, 2025

🦋 Changeset detected

Latest commit: a3c50b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@saleor/app-sdk Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 93.40314% with 63 lines in your changes missing coverage. Please review.

Project coverage is 79.81%. Comparing base (d339a69) to head (a3c50b2).

Files with missing lines Patch % Lines
src/handlers/shared/saleor-webhook-validator.ts 81.16% 29 Missing ⚠️
src/handlers/actions/register-action-handler.ts 97.16% 9 Missing ⚠️
.../handlers/shared/generic-adapter-use-case-types.ts 0.00% 8 Missing and 1 partial ⚠️
src/handlers/shared/generic-saleor-webhook.ts 94.82% 6 Missing ⚠️
src/test-utils/mock-adapter.ts 85.18% 4 Missing ⚠️
src/handlers/actions/index.ts 0.00% 1 Missing and 1 partial ⚠️
src/handlers/platforms/next/index.ts 0.00% 2 Missing ⚠️
src/handlers/platforms/next/platform-adapter.ts 97.36% 1 Missing ⚠️
...forms/next/saleor-webhooks/saleor-async-webhook.ts 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #401      +/-   ##
==========================================
+ Coverage   73.07%   79.81%   +6.74%     
==========================================
  Files          82       79       -3     
  Lines        3034     3156     +122     
  Branches      456      513      +57     
==========================================
+ Hits         2217     2519     +302     
+ Misses        812      630     -182     
- Partials        5        7       +2     

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

@witoszekdev witoszekdev force-pushed the add-adapter-actions-new-handlers branch from 562f993 to 3bca89d Compare January 31, 2025 16:23
@witoszekdev witoszekdev marked this pull request as ready for review January 31, 2025 16:26
@witoszekdev witoszekdev requested a review from a team as a code owner January 31, 2025 16:26
@witoszekdev witoszekdev marked this pull request as draft January 31, 2025 16:39
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