Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

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

Merged
pi0 merged 2 commits into
mainfrom
fix/nitro-build-types
Jul 21, 2022
Merged

fix(nuxt): always write nitro types when building#6035
pi0 merged 2 commits into
mainfrom
fix/nitro-build-types

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/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.

@danielroedanielroe 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 pi0July 21, 2022 13:34
@danielroedanielroe self-assigned this Jul 21, 2022
@netlify

netlifyBot commented Jul 21, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit6478474
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62d959714c5c5e00089f4668

Comment threadpackages/nuxt/src/core/nitro.ts Outdated
// Add typed route responses
nuxt.hook('prepare:types', async (opts) => {
if (nuxt.options._prepare) {
if (nuxt.options._prepare || !nuxt.options.dev) {

@pi0pi0Jul 21, 2022

Copy link
Copy Markdown
Member

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?

@danielroedanielroeJul 21, 2022

Copy link
Copy Markdown
MemberAuthor

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.

@pi0pi0 changed the title fix(nuxt): write nitro types when buildingfix(nuxt): always write nitro types when buildingJul 21, 2022
pi0
pi0 approved these changes Jul 21, 2022
@pi0
pi0 merged commit 54e672d into mainJul 21, 2022
@pi0
pi0 deleted the fix/nitro-build-types branch July 21, 2022 13:50
@pi0pi0 mentioned this pull request Aug 5, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't workingnitro🔨 p3-minor-bugPriority 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

@danielroe@pi0