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): include external layers in tsconfig.json scope #21917

Merged
merged 2 commits into from
Jul 3, 2023
Merged

fix(nuxt): include external layers in tsconfig.json scope #21917

merged 2 commits into from
Jul 3, 2023

Conversation

agenordebriat
Copy link
Contributor

@agenordebriat agenordebriat commented Jul 3, 2023

πŸ”— Linked issue

#21877

❓ 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)

Not sure which type(s) apply.

πŸ“š Description

Volar 1.8.2 introduced a breaking change regarding the way it handles tsconfig.

Until this PR, we needed to manually add our layer(s) paths to the include section, that'd override the default one, on our project tsconfig to get support for things like autocompletion. Something like:

"include": [
    ".nuxt/nuxt.d.ts",
    "**/*",
    "<path to layer files>"
],

What this PR does is check nuxt.options._layers for paths that are different than nuxt.options.rootDir and add them, with a trailing **/* to the include array, next to ./nuxt.d.ts and all the other ones.

There's probably a better way to do it, but it works for now.

πŸ“ Checklist

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

I don't think documentation should mention it, as it's transparent for the user like the rest of the tsconfig file.

@danielroe danielroe changed the title feat(nuxt): include layers in tsconfig to accomodate Volar update fix(nuxt): include any external layers in tsconfig.json scope Jul 3, 2023
@danielroe danielroe changed the title fix(nuxt): include any external layers in tsconfig.json scope fix(nuxt): include external layers in tsconfig.json scope Jul 3, 2023
@danielroe danielroe merged commit a9904a3 into nuxt:main Jul 3, 2023
28 checks passed
@github-actions github-actions bot mentioned this pull request Jul 3, 2023
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.

None yet

2 participants