Skip to content

Conversation

@Afshar07
Copy link
Contributor

@Afshar07 Afshar07 commented Sep 5, 2024

Implement image helper utilities usage in nitro endpoints, by adding image options and nitro compatible utils in server directory.
But to be honest, it's my first contribution and i might (probably am) mess with a wrong config, so, it will be so kind for anyone to point out if i have done anything wrong!

🔗 Linked issue

resolves #1447
resolves #1329

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ 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

Add an utility on server folder and auto import it into nitro, and also write image options into a virtual path in nitro.
Set a boolean to check if the utility is used in nitro environment, if it is, ignore prerendering static images.

@Afshar07 Afshar07 requested a review from danielroe as a code owner September 5, 2024 16:27
@codecov-commenter
Copy link

codecov-commenter commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 53.48837% with 20 lines in your changes missing coverage. Please review.

Project coverage is 62.93%. Comparing base (a12c220) to head (2b938b4).
Report is 67 commits behind head on main.

Files with missing lines Patch % Lines
src/runtime/server/utils/image.ts 7.14% 13 Missing ⚠️
src/module.ts 90.00% 1 Missing and 1 partial ⚠️
src/runtime/utils/prerender.ts 33.33% 2 Missing ⚠️
src/runtime/components/NuxtImg.vue 0.00% 1 Missing ⚠️
src/runtime/components/NuxtPicture.vue 0.00% 1 Missing ⚠️
src/runtime/image.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1473      +/-   ##
==========================================
- Coverage   63.01%   62.93%   -0.08%     
==========================================
  Files          80       81       +1     
  Lines        3742     3772      +30     
  Branches      426      429       +3     
==========================================
+ Hits         2358     2374      +16     
- Misses       1356     1369      +13     
- Partials       28       29       +1     

☔ 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.

@danielroe danielroe requested a review from pi0 March 22, 2025 10:20
@pkg-pr-new
Copy link

pkg-pr-new bot commented Apr 4, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@1473

commit: 2b938b4

@danielroe danielroe merged commit 3e5ac6e into nuxt:main Apr 4, 2025
6 checks passed
This was referenced Apr 4, 2025
danielroe added a commit that referenced this pull request Jul 30, 2025
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.

add support for image helpers in nitro endpoints Images cannot be parsed when obtained through event handlers

4 participants