fix: Re-add Quasar Framework pre v1 support #1273
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TLDR; I added support for the
vetur
Object in package.json (which specifies the location of Vetur's needed tags and attributes jsons) specifically for Quasar. A later change in Vetur code made this feature available for all frameworks, but removed Quasar support as a result, which is ironic. Quasar developers are missing the autocompletion feature since 5 November.Reasoning
This PR re-adds support for Quasar Framework (< v1) when using Quasar CLI.
I initially introduced the concept of using package.json > vetur Object to specify the location of vetur tags and attributes file with PR. This was done for Quasar Framework only.
Later on, this concept became the default way of dealing with any frameworks through PR by @Zenser . But while introducing this, Quasar became undetectable, so its support dropped.
In a Quasar CLI project folder, Quasar Framework pre v1 (eg: v0.17) is supplied by
quasar-cli
package which is specified in package.json > devDependencies throughquasar-framework
package (quasar-framework
is a dependency ofquasar-cli
, not of the project itself). This was missed by @Zenser 's PR, because Vetur ended up checking quasar-cli's package.json for thevetur
Object that I introduced -- which is not there. My initial code was detectingquasar-cli
package and then it was checkingnode_modules/quasar-framework/package.json
to get the details. My initial PR added a test-case specifically for Quasar, but it was directly usingquasar-framework
package as a dependency (as in Vue CLI usage of a project with Quasar), instead ofquasar-cli
. So the tests were successful -- sincequasar-framework
dependency was specified in the test project folder, which is the NPM package that has the vetur Object in its package.json.The current PR detects if
quasar-cli
is specified in a project's devDependencies and virtually addsquasar-framework
to the in-memory package.json > dependencies. This allows Vetur to correctly get the provider a few lines below this in thefor(dep in dependencies)
.