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

fix(nuxt): apply more import protections for nitro runtime #25162

Merged
merged 10 commits into from
Jan 12, 2024

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Jan 11, 2024

πŸ”— Linked issue

one issue nuxt-modules/security#335

❓ 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

Previously we were not fully protecting nitro runtime imports for @nuxt/kit and other nuxt-relevant imports. This PR also refactors import protection plugin rules to be maintained in one place more easily.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@pi0 pi0 requested a review from danielroe January 11, 2024 22:04
Copy link

stackblitz bot commented Jan 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe changed the title fix: apply more import protections for nitro runtime fix(nuxt): apply more import protections for nitro runtime Jan 12, 2024
@danielroe danielroe merged commit c4b6560 into main Jan 12, 2024
34 checks passed
@danielroe danielroe deleted the fix/nitro-protection branch January 12, 2024 11:22
This was referenced Jan 12, 2024
@chenyuncai
Copy link

That's means we cannot use "useLogger" anymore but Consola directly.

@danielroe
Copy link
Member

Exactly πŸ‘Œ useLogger is only for nuxt config/module code, not for vue or nitro runtime code.

@fabianwohlfart
Copy link

Hi guys,
Is this why I cannot import { runCommand } from 'nuxi' anylonger?
nuxt/cli#331

I need and want to run a nuxi command server side.
How can I deal with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants