grunt-init icon indicating copy to clipboard operation
grunt-init copied to clipboard

Template repository support

Open dploeger opened this issue 10 years ago • 1 comments

It would be nice, if grunt-init would support downloading templates from a central repository (npmjs for example), when the template isn't available locally.

This would mean:

  • Correctly labeling (i.e. grunt-init-template) all available packages in npmjs
  • Implementing a method of searching with npm, when the template isn't available locally
  • If only one template is returned from that search, install the package to ~/.grunt-init (after asking the user)
  • Use that template

dploeger avatar Nov 04 '15 15:11 dploeger

One could directly use npm for searching and installing. The bad side is, that you have to wrap around the cli as the api isn't considered stable.

The workflow would be:

  • Is the template available?
    • Yes: Install the template
    • No: Search using npm for a specific label (the filtering by label feature is currently missing from npm, though)
      • Is there at least one package?
        • Yes: Is it only one package?
          • Yes: Install it
          • No: Output the search result and let the user decide
        • No: Output error message

dploeger avatar Nov 04 '15 15:11 dploeger