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(cli): add ability to add vuex and vue-router internal plugins (#1202) #1204

Closed
wants to merge 1 commit into from

Conversation

dhensche
Copy link
Contributor

@dhensche dhensche commented May 1, 2018

custom handling for vuex and router when invoking vue add to simply add the dependencies to package.json and point the user to documentation about integrating the libraries into their app

@Akryum
Copy link
Member

Akryum commented May 2, 2018

I think it would be better to extract the vue-router and vuex generator logics from cli-service into their own builtin plugins.

@dhensche
Copy link
Contributor Author

dhensche commented May 2, 2018

@Akryum are you thinking they should be separate packages or some sort of new internal plugin structure? It sounded like the desire was to not create new packages for vuex/vue-router #1202 (comment) and they should be treated differently than other plugins

@yyx990803
Copy link
Member

yyx990803 commented May 2, 2018

So the idea here is:

  1. Split out the router/vuex parts inside cli-service/generator/index.js into separate files. Each of them can be a "sub generator" that exposes the same (api, options) => {} signature, and the main generator will just require and call them.

  2. Extract the logic of invoking a required generator module into an exported function in cli/lib/invoke.js

  3. In cli/lib/add.js when router or vuex special cases are encountered, require the sub-generators from cli-service and invoke them using the function extracted in (2).

@Akryum
Copy link
Member

Akryum commented May 2, 2018

Having builtin plugins would allow reusing the same UI for installing plugins. Or else we will need to work on specific UI for this.

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

3 participants