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

Detect if the plugin was already invoked in the project #1907

Closed
pksunkara opened this issue Jul 20, 2018 · 8 comments
Closed

Detect if the plugin was already invoked in the project #1907

pksunkara opened this issue Jul 20, 2018 · 8 comments

Comments

@pksunkara
Copy link
Contributor

What problem does this feature solve?

Some plugins (for example: a plugin to setup a mini-framework) might want to differentiate when the plugin was run for the first time and when it isn't. Currently there's no way to do this.

What does the proposed API look like?

We could probably do this by adding 2 hooks (#1754) but I would vote do separate them normally since some plugins might not want any common code between the 2 modes

@Akryum
Copy link
Member

Akryum commented Jul 21, 2018

vue add and vue invoke are essentially the same commands. vue add just also installs the plugin.

@Akryum Akryum changed the title Differentiate the vue add and vue invoke modes for plugins Detect if the plugin was already invoked in the project Jul 21, 2018
@pksunkara
Copy link
Contributor Author

pksunkara commented Jul 21, 2018 via email

@yyx990803
Copy link
Member

This is done in ba43900

@pksunkara
Copy link
Contributor Author

@yyx990803 This hasn't been fixed. Your commit adds invoking, but the value of it is true for both vue add and vue invoke

@Akryum
Copy link
Member

Akryum commented Aug 3, 2018 via email

@pksunkara
Copy link
Contributor Author

Yeah, so, this issue isn't fixed by that commit since there's still no way to differentiate between vue add and vue invoke programmatically.

@yyx990803
Copy link
Member

As I understood your issue, "running for the first time" means the plugin was used as part of a preset during initial project creation, and both vue add and vue invoke are late invocations.

There's no way to tell whether a plugin has been invoked previously or not and I don't think that's something worth adding.

@pksunkara
Copy link
Contributor Author

I would argue it is since I am working on a plugin which could use it instead of having workarounds. But hey, you are the maintainer 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants