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(cloudflare-kv, cloudflare-r2): move getBindings to utils and add default BUCKET for r2 #292

Merged
merged 10 commits into from
Jan 12, 2024

Conversation

oritwoen
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The getBindings function was used in 2 files. This PR:

  • moves the getBindings function to utils
  • adds default binding value for R2
  • adds additional references in the documentation

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio
Copy link

nuxt-studio bot commented Aug 24, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
unstorage Edit on Studio β†—οΈŽ View Live Preview 16ebe9b

src/drivers/utils/index.ts Outdated Show resolved Hide resolved
@oritwoen oritwoen requested a review from pi0 August 25, 2023 21:53
@pi0
Copy link
Member

pi0 commented Aug 25, 2023

(sorry for delay on review. i will do it asap in next days to release πŸ‘πŸΌ overall looks nice!)

@pi0 pi0 changed the title refactor: move getBindings to utils refactor(cloudflare): move getBindings to utils Sep 28, 2023
@oritwoen
Copy link
Contributor Author

oritwoen commented Sep 30, 2023

@pi0

I've been thinking about additional changes lately. There will be more HTTP drivers for Cloudflare in the future. It would be good to put general functions and types in one place:

etc.

Creating a new PR at this point seems "problematic" because an identical file would be created as in this PR. So maybe change the title of this request and include generalized http functions for cloudflare here as well?

@oritwoen
Copy link
Contributor Author

@pi0 Can you address my comment above?

@pi0 pi0 changed the title refactor(cloudflare): move getBindings to utils refactor(cloudflare-kv, cloudflare-r2): move getBindings to utils Jan 12, 2024
@pi0 pi0 changed the title refactor(cloudflare-kv, cloudflare-r2): move getBindings to utils refactor(cloudflare-kv, cloudflare-r2): move getBindings to utils and add default BUCKET for r2 Jan 12, 2024
Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (78e1568) 64.06% compared to head (fa104f2) 64.26%.

Files Patch % Lines
src/drivers/utils/cloudflare.ts 63.15% 14 Missing ⚠️
src/drivers/cloudflare-r2-binding.ts 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #292      +/-   ##
==========================================
+ Coverage   64.06%   64.26%   +0.20%     
==========================================
  Files          41       42       +1     
  Lines        4121     4105      -16     
  Branches      493      490       -3     
==========================================
- Hits         2640     2638       -2     
+ Misses       1469     1455      -14     
  Partials       12       12              

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@pi0
Copy link
Member

pi0 commented Jan 12, 2024

Thanks again! I have made few more refactors to make types working.

PR also welcome to prepare types refactoring we might make utils/cloudflare.types.ts to make them more maintainable πŸ’―

@pi0 pi0 merged commit f7e7007 into unjs:main Jan 12, 2024
4 of 5 checks passed
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