Skip to content

Consolidate CLI for different platforms #1459

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

Closed
9 tasks
yordis opened this issue Jun 4, 2018 · 4 comments
Closed
9 tasks

Consolidate CLI for different platforms #1459

yordis opened this issue Jun 4, 2018 · 4 comments

Comments

@yordis
Copy link

yordis commented Jun 4, 2018

What problem does this feature solve?

As Vue starts being used in more platform, platform specific features.

Splitting the community cross platform based CLIs or having more than one Vue project when we could be sharing a lot of code between platforms.

What does the proposed API look like?

Consolidate the CLI underline architecture for support multi-platform setup.

The proposal is really similar to what Weex CLI has today.

vue platform add ios
vue platform add android
vue platform add web
vue platform add electron
vue platform add [insert name here]
// or maybe everything global, depends of how people like it
yarn add @vue/cli
yarn add @vue/web-cli
yarn add @vue/android-cli
yarn add @vue/android-cli
yarn add @vue/electron-cli
yarn add @vue/[insert name here]-cli

Today there is always a public folder which would be what could be under platforms/web folder.

Because no everyone is using other platforms I think the tradeoff of just installing an extra dependency for the CLI.

Those dependencies should install extra commands to the CLI, example

vue web serve
vue ios run
vue android run

Those underline platform plugins could do some default Webpack transformation as it is required for some platform.

Also the vue-config.js should be pass somehow the platform that the CLI used for add some extra transformation.

Some inspiration about the plugin and CLI could be take from here https://github.com/infinitered/gluegun

Checklist

  • Be able to add platforms to the CLI
  • Be able to extend the CLI commands by installing platforms
  • Each platform should have the default Webpack pipeline.
  • vue-config.js should allow the developer to know the platform for be able to inject different pipelines
  • Consolidate the folders
    • Add ./platforms folder
    • Move ./public into ./platforms/web folder
    • ./dist folder should have the platform name as child, for example ./dist/web or ./dist/ios
  • Add entry points for each platform

cc: @yyx990803 @Akryum @erha19

@yyx990803
Copy link
Member

Thanks for the ideas, but I don't think we will consider this until Vue 3 / CLI 4. The current focus of the CLI is on web applications only.

@yordis
Copy link
Author

yordis commented Jun 5, 2018

@yyx990803 why closing the issue if you will considerate this until v3/v4 ?

Also, why to see the CLI as web only when you have weex code in the vue repo, or when there is definitely people that could benefit from this.

@erha19 is putting doing some work for Weex folks when it could be replaced in the future, I see more value on working together on this.

This issue is close, which means, let's forget about it. I hope you change your mind for the greater of many.

@yyx990803
Copy link
Member

Because we have to plan for what we are able to focus on for a given period of time. This proposal is broadening the scope of the CLI tremendously and I don't see this being worked on any time soon, so I'd avoid it cluttering the current issues. We will open a new issue when we are ready to work on it.

@yyx990803
Copy link
Member

Also, closing doesn't mean let's forget it - remember issues are used to manage work. This is just me saying: interesting idea, but please don't leave it on my plate just yet.

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

No branches or pull requests

2 participants