Polymer / tools

Polymer Tools Monorepo
BSD 3-Clause "New" or "Revised" License
430 stars 200 forks source link

CLI doesn't use description for generator #2212

Open robdodson opened 8 years ago

robdodson commented 8 years ago

Description

Creating a custom generator, the CLI doesn't display its description when I run polymer init

Generator repo: https://github.com/PolymerElements/generator-polymer-init-custom-build

Screenshot: screen shot 2016-08-08 at 1 32 36 pm

Versions & Environment

node v6.3.0

Steps to Reproduce

Clone the generator Run npm link Runpolymer init

Expected Results

Should see a description of the generator, maybe pulled from package.json?

Actual Results

No description

FredKSchott commented 8 years ago

Run with verbose, you get:

debug:   problem reading/parsing package.json for generator 
{ generator: 'polymer-init-vaadin-charts-app:app',
  err: 'EISDIR: illegal operation on a directory, read' }
FredKSchott commented 8 years ago

Looks like even yo doesn't get a description, it just "title-izes" the generator name.

pkg.prettyName = titleize(humanizeString(namespaceToName(generator.namespace)));

Instead of implementing something similar that doesn't add any new info, lets just hide the description for custom generators. @justinfagnani @robdodson savvy?

justinfagnani commented 8 years ago

I swear that at one point I had descriptions coming from package.json, I just can't recall what happened to it. Doesn't seem like it should be very difficult.

FredKSchott commented 8 years ago

Here's where my globally installed generator lives

{ 
  resolved: '/Users/fschott/.nvm/versions/node/v5.10.1/lib/node_modules/generator-polymer-init-vaadin-charts-app/generators/app/index.js',
  namespace: 'polymer-init-vaadin-charts-app:app' 
}
FredKSchott commented 8 years ago

I think the fact that yeoman doesn't do this is a good sign that we shouldn't either. I wasn't able to get it working but @addyosmani might have some good insight here.

justinfagnani commented 8 years ago

I kind of remember looking into Yeoman and thinking it was just a bug, but it was so long ago that my memory is fuzzy.

FredKSchott commented 8 years ago

In the interest of maximizing effort:results, I recommend merging fix #360 in the short term so that we get rid of that "undefined" now. We can then investigate bringing the description back when we have more time and potentially even help contribute a fix to the yeoman cli.

OrenBochman commented 8 years ago

ps there is also the issue of listing and adding descriptions for sub-generators they are all listed same as the parents - multiple times with no description

FredKSchott commented 8 years ago

@OrenBochman can you link to the issue?

OrenBochman commented 8 years ago

Sorry, I did not mean that there is an open item in the bug tracker - I meant that this was a related problem - I have created sub-generators - e.g. add a polymer 2.0 element to the current project, but the sub-generator names and description show the default value and there is no documentation on how a sub-generator metadata should be provided.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.