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

feat(vue-app): add vetur helpers for components auto-complete on VS Code #4524

Merged
merged 6 commits into from Dec 19, 2018

Conversation

Atinux
Copy link
Member

@Atinux Atinux commented Dec 11, 2018

Add helpers to support auto-complete on VS Code.

Fixes #3174

One thing left, @octref needs to confirm that it can work since @nuxt/vue-app is a dependency of nuxt and is not a direct dependency of a nuxt project.

@codecov-io
Copy link

codecov-io commented Dec 11, 2018

Codecov Report

Merging #4524 into dev will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev    #4524   +/-   ##
=======================================
  Coverage   91.07%   91.07%           
=======================================
  Files          61       61           
  Lines        2184     2184           
  Branches      527      527           
=======================================
  Hits         1989     1989           
  Misses        177      177           
  Partials       18       18

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eda33bc...39b4684. Read the comment docs.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Should we also include new NLink and NChild aliases?

@Atinux
Copy link
Member Author

Atinux commented Dec 11, 2018

I already did @pi0 :)

@octref
Copy link

octref commented Dec 12, 2018

I'll add a manual check for vue-app dependency (it's not explicitly stated in pacakge.jsos's dependencies, and I want to avoid checking all node_modules).

Does that mean https://github.com/nuxt-community/nuxt-helper-json can be archived?

@pi0
Copy link
Member

pi0 commented Dec 12, 2018

@octref I think we would need that repo for backward compatibility.

galvez
galvez previously approved these changes Dec 13, 2018
@octref
Copy link

octref commented Dec 14, 2018

  • You didn't include them in files in package.json. They won't be published.
  • These JSON will be importable from @nuxt/vue-app/helpers/vetur/nuxt-tags.json, correct?
  • You don't need the vetur key in package.json anymore.

@octref
Copy link

octref commented Dec 14, 2018

One more question. What's the version below which @nuxt/vue-app won't be available, so I can fallback to https://github.com/nuxt-community/nuxt-helper-json?

@pi0
Copy link
Member

pi0 commented Dec 15, 2018

@octref Thanks for your patient review. I've tried to apply the required changes.

The helpers should be importable from either:

  • @nuxt/vue-app-edge/vetur/nuxt-{tags,attributes}.json
  • @nuxt/vue-app/vetur/nuxt-{tags,attributes}.json

The new vue-app package with helpers included should be available from next minor release (v2.4.0)

@galvez galvez changed the title feat(vue-app): Add vetur helpers for components auto-complete on VS Code feat(vue-app): add vetur helpers for components auto-complete on VS Code Dec 15, 2018
@octref
Copy link

octref commented Dec 16, 2018

From what @Atinux told me, nuxt, nuxt-legacy, nuxt-edge all depends on @nuxt/vue-app, where nuxt wants to ship those JSONs. What is @nuxt/vue-app-edge?

My plan was to check for node_modules/@nuxt/vue-app for the two JSON when I see nuxt, nuxt-legacy, nuxt-edge on deps or dev deps.

@pi0
Copy link
Member

pi0 commented Dec 16, 2018

@octref Every nuxt mono-repo package has a version with -edge in front of it for edge release channel. (They are internally wired-up together) :) I somehow feel it would be easier to keep using a standalone repository for vetur integration. /cc @Atinux

@octref
Copy link

octref commented Dec 17, 2018

The problem is versioning. Let's say you shipped <nuxt-new-component>. The only way to ensure users who can use it in runtime also gets the updated IntelliSense is to ship the definitions with the runtime library.

So if I'm reading correct, is the situation:

  • One nuxt app will have either @nuxt/vue-app or @nuext/vue-app-edge in node_modules
  • nuxt and nuxt-legacy depends on @nuxt/vue-app
  • nuxt-edge depends on @nuxt/vue-app-edge

@pi0
Copy link
Member

pi0 commented Dec 17, 2018

@octref Yes, you are right. checking either @nuxt/vue-app or @nuxt/vue-app-edge in node_modules should do the trick :)

@Atinux
Copy link
Member Author

Atinux commented Dec 18, 2018

Thank you @octref for your help on this :)

I validate @pi0 last comment:

checking either @nuxt/vue-app or @nuxt/vue-app-edge in node_modules should do the trick :)

For people living on the edge (lol) and having the last definitions, it's good if vetur can also look to @nuxt/vue-app-edge too.

Is it good for you @octref ?

@octref
Copy link

octref commented Dec 18, 2018

OK, I'll do it this way:

  • If nuxt/nuxt-legacy/nuxt-edge < 2.4.0 found in package.json, I'll fall back to use https://github.com/nuxt-community/nuxt-helper-json
  • If nuxt/nuxt-legacy/nuxt-edge > 2.4.0 found in package.json, I'll check @nuxt/vue-app or @nuxt/vue-app-edge for the definitions.

@Atinux
Copy link
Member Author

Atinux commented Dec 19, 2018

Perfect @octref

I am merging this PR then :)

@Atinux Atinux merged commit 59aee74 into dev Dec 19, 2018
@Atinux Atinux deleted the feat-vetur branch December 19, 2018 16:31
octref added a commit to vuejs/vetur that referenced this pull request Dec 26, 2018
octref added a commit to vuejs/vetur that referenced this pull request Dec 26, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nuxt.js auto completion in Vetur
7 participants