yeoman / generator-polymer

Scaffold out a Polymer project
http://polymer-project.org
926 stars 150 forks source link

Auto generate imports in elements.html #49

Closed robdodson closed 10 years ago

robdodson commented 10 years ago

This creates an app/elements/elements.html file that holds all of the imports for the site. When you run yo polymer:el x-foo it will add the element's import to app/elements/elements.html so you don't have to wire anything up. @addyosmani PTAL

addyosmani commented 10 years ago

LGTM. We had this in an earlier version of the generator and it worked well. Like the addition. Merging.

robdodson commented 10 years ago

Can you point me to the previous implementation. I'm curious if there's a better way to append the import that deals with newlines better. I'm just tossing a \n on the end of it, but I wasn't sure if there was some yeoman magic to make this a little cleaner

ragingwind commented 10 years ago

I think this is yeoman magic(excepted newline) for cleaning, https://github.com/yeoman/generator/blob/master/lib/actions/wiring.js#L85

robdodson commented 10 years ago

Yeah I was looking at that. It requires a tagName though and an import doesn't have any kind of root tag (like 'body' or 'html') to work off of.

On Wed, Jul 16, 2014 at 3:44 PM, Jimmy Moon notifications@github.com wrote:

I think this is yeoman magic for cleaning, https://github.com/yeoman/generator/blob/master/lib/actions/wiring.js#L85

— Reply to this email directly or view it on GitHub https://github.com/yeoman/generator-polymer/pull/49#issuecomment-49237862 .

JosefJezek commented 10 years ago

Could you add this pull to generator based on gulp?

https://github.com/NicoArbogast/generator-polymer-gulp