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

Refactor handlers, remove deprecated exports, v1 #399

Merged
merged 17 commits into from
Jan 28, 2025

Conversation

witoszekdev
Copy link
Member

@witoszekdev witoszekdev commented Jan 28, 2025

  • Separated shared types to separate shared folder
  • Moved platform handlers to platform folder, leaving public imports unchanged
  • Removed re-exports added in Refactor handlers folder structure #396
  • Added @/ alias, updated tests to support it

Note

There are multiple files visible as "changed" in handlers/next and handlers/platform/next, but this is wrong, these files were simply moved to a different folder

Copy link

changeset-bot bot commented Jan 28, 2025

⚠️ No Changeset found

Latest commit: c2b892c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

codecov bot commented Jan 28, 2025

Codecov Report

Attention: Patch coverage is 58.19672% with 51 lines in your changes missing coverage. Please review.

Project coverage is 73.07%. Comparing base (003b1ca) to head (c2b892c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...andlers/platforms/next/create-protected-handler.ts 3.12% 31 Missing ⚠️
src/handlers/shared/protected-handler.ts 10.00% 9 Missing ⚠️
...handlers/platforms/next/create-manifest-handler.ts 79.16% 5 Missing ⚠️
src/handlers/shared/index.ts 0.00% 4 Missing and 1 partial ⚠️
src/handlers/platforms/next/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #399      +/-   ##
==========================================
+ Coverage   73.04%   73.07%   +0.02%     
==========================================
  Files          78       82       +4     
  Lines        3024     3034      +10     
  Branches      454      456       +2     
==========================================
+ Hits         2209     2217       +8     
- Misses        810      812       +2     
  Partials        5        5              

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

@witoszekdev witoszekdev marked this pull request as ready for review January 28, 2025 15:17
@witoszekdev witoszekdev requested a review from a team as a code owner January 28, 2025 15:17
Comment on lines +4 to +25
entry: {
const: "src/const.ts",
types: "src/types.ts",
urls: "src/urls.ts",
headers: "src/headers.ts",
"saleor-app": "src/saleor-app.ts",
"verify-jwt": "src/verify-jwt.ts",
"verify-signature": "src/verify-signature.ts",
"APL/index": "src/APL/index.ts",
"APL/redis/index": "src/APL/redis/index.ts",
"APL/vercel-kv/index": "src/APL/vercel-kv/index.ts",
"app-bridge/index": "src/app-bridge/index.ts",
"app-bridge/next/index": "src/app-bridge/next/index.ts",
"settings-manager/index": "src/settings-manager/index.ts",
"handlers/shared/index": "src/handlers/shared/index.ts",

// Deprecated
"middleware/index": "src/middleware/index.ts",

// Mapped exports
"handlers/next/index": "src/handlers/platforms/next/index.ts",
},
Copy link
Member

Choose a reason for hiding this comment

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

What does mean this api change - from array to object? Should keys include /index?

Copy link
Member Author

@witoszekdev witoszekdev Jan 28, 2025

Choose a reason for hiding this comment

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

Yes, otherwise we wouldn't be able to do mapped exports in tsup, see: https://tsup.egoist.dev/#multiple-entrypoints

So for example:

[
  "src/headers.ts"
]

is the same as:

{
  headers: "src/headers.ts"
}

Copy link
Member

Choose a reason for hiding this comment

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

is file name still valid? it contains random things

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, this should have been in a single file for all saleor webhook types, I combined them 👍🏻

@witoszekdev witoszekdev enabled auto-merge (squash) January 28, 2025 16:01
@witoszekdev witoszekdev merged commit d339a69 into main Jan 28, 2025
6 checks passed
@witoszekdev witoszekdev deleted the add-new-handlers-logic-v1 branch January 28, 2025 16:02
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.

2 participants