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

Downloading template from npm registry #311

Closed
egoist opened this issue Jan 29, 2017 · 11 comments
Closed

Downloading template from npm registry #311

egoist opened this issue Jan 29, 2017 · 11 comments

Comments

@egoist
Copy link
Collaborator

egoist commented Jan 29, 2017

Currently something like vue init webpack will make vue-cli download git repo vuejs-template/webpack, I thought instead we can make it download from npm registry if the template name does not contain /. For example vue init webpack would install package vue-template-webpack, thus everyone can type less to generate from their own template 🤗 just like sao

@posva
Copy link
Member

posva commented Jan 29, 2017

But wouldn't that mean we need to publish the templates to the npm registry, making it more complicated?

@egoist
Copy link
Collaborator Author

egoist commented Jan 29, 2017

People can still use git repo if they feel publishing a package a bit complicated.

@posva
Copy link
Member

posva commented Jan 29, 2017

Oh right, we only need to publish our templates as packages
But isn't it easier to just pushing to github 😄

@LinusBorg
Copy link
Member

LinusBorg commented Jan 30, 2017

@posva Sure it's easier for us, but We already see that the continous upgrades leave people confused, because with our github releases its not really clear which feature / dependency is part of the template since when etc.

I think publishing templates via npm would lead to a better maintainability as we would release explicit versions and could also analyse which version users were using when they report a problem.

@posva
Copy link
Member

posva commented Jan 30, 2017

Makes sense. I see the interest, people, I know @kazupon does release versions of his templates (I don't know if he publishes them), and has a nice changelog.

@kazupon
Copy link
Member

kazupon commented Jan 31, 2017

In general, I think that we create the templates and use it by oneself, so I don't always think we want to release to npm. Actually, I also don't publish to npm. However, it's rather troublesome to type the long template name everytime.

@skiano
Copy link

skiano commented Nov 6, 2017

This sounds like a great feature to me :) I have a repo with a bunch of build helpers for a group of related projects, and the idea of separating out a repo just for the cli template (vs just publishing from inside a folder in my build tools repo) seems cumbersome.

@fcroce
Copy link

fcroce commented Mar 6, 2019

I hate to come back on a closed issue, but I have a similar problem:

Our company uses Verdaccio and we have a number of packages and now templates published there, but "vue init" doesn't seem to offer the option to use a custom mirror and download the template from NPM.

The template is specific for my company, so I can't publish it on vuejs-template

The only solution I found so far, (ugly though...), is to git clone and use the template from local with ./

Is there a way to use a mirror that is not documented, or is it worth a feature in the vue-init project?

Any suggestion is appreciated @egoist , @posva

@LinusBorg
Copy link
Member

LinusBorg commented Mar 6, 2019

you can install the template from npm and then run init with a local path:

vue init ../node_nodules/your-template name-of-project

@fcroce
Copy link

fcroce commented Mar 6, 2019

@LinusBorg it's more or less the same as we do now:

git clone ...
vue init ./my-template

I was curious if there was a better way.

Something like vue init npm@my-template my-project would be nice and because it's using NPM we can have a private package manager in .npmrc

registry = http://verdaccio.on.docker:4873/

If it's overkill I guess git clone or using the node_modules folder will do.

Thank you!

@LinusBorg
Copy link
Member

Yeah we don't intend to change anything about the init feature in the foreeable future as we see it as a legacy feature. We focus on the new plugin-base approach of vue create

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

7 participants