Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): always write nitro types when building #6035

Merged
merged 2 commits into from
Jul 21, 2022
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

resolves nuxt/nuxt#14343

❓ 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 like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

If users are checking types on build, we should write nitro.d.ts then as well.

πŸ“ Checklist

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

@danielroe danielroe added bug Something isn't working nitro πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage labels Jul 21, 2022
@danielroe danielroe requested a review from pi0 July 21, 2022 13:34
@danielroe danielroe self-assigned this Jul 21, 2022
@netlify
Copy link

netlify bot commented Jul 21, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 6478474
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62d959714c5c5e00089f4668

@@ -141,7 +141,7 @@ export async function initNitro (nuxt: Nuxt) {

// Add typed route responses
nuxt.hook('prepare:types', async (opts) => {
if (nuxt.options._prepare) {
if (nuxt.options._prepare || !nuxt.options.dev) {
Copy link
Member

@pi0 pi0 Jul 21, 2022

Choose a reason for hiding this comment

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

Do we have dev: true + _prepare: true situation? If not maybe we can simplify condition with !dev?

Copy link
Member Author

@danielroe danielroe Jul 21, 2022

Choose a reason for hiding this comment

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

We also want to write types in development. edit: ah yes, nitro does it.

@pi0 pi0 changed the title fix(nuxt): write nitro types when building fix(nuxt): always write nitro types when building Jul 21, 2022
@pi0 pi0 merged commit 54e672d into main Jul 21, 2022
@pi0 pi0 deleted the fix/nitro-build-types branch July 21, 2022 13:50
@pi0 pi0 mentioned this pull request Aug 5, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working nitro πŸ”¨ p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

auto import is not working on server directory codes when build
2 participants