yeoman / generator-polymer

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

running yo polymer creates directories outside of the directory you ran the command #45

Closed akc42 closed 10 years ago

akc42 commented 10 years ago

I am not entirely sure what this generator is supposed to do, because according to the article at http://www.html5rocks.com/en/tutorials/webcomponents/yeoman/ the next thing to do after running yo polymer is to run grunt server.

HOWEVER, there is no gruntfile, and no directories within the directory I ran yo polymer in.

.bowerrc has a ../ as its directory, which causes bower to install components in the level above the directory I have just entered.

akc42 commented 10 years ago

Having seen some of the issues and looked at the "experiment" branch, I think I understand more what has happened. This is now supposed to be a new element generator inside an already existing project whereas the original experiment branch is more of what I was expecting and what the tutorial I refer to above describes this generator as..

Can you at least put something in the readme.md file about this - and preferably some sort of pre-run check that the expected full project scaffolding is already in place. To have this generator spew files all over my file system was annoying to say the least.

What is more there is now no generator that can set up a boilerplace build and test environment.

Maybe you guys can also get some comment put on the original article at http://www.html5rocks.com/en/tutorials/webcomponents/yeoman/ as well?

dbroadhurst commented 10 years ago

Agreed, I've wasted hours thinking I missed a step. I guess I need to scaffold a webapp and use the polymer generator to add components. Hopefully I'm still able to create a dist build.

chrisekelley commented 10 years ago

I'm hitting the same problem. I created a new directory for the polymer project (polymer-test) and cd'd to it. I init'd the project w/ yo polymer. Entered my gh id and accepted the default element name, polymer-test. It created the .css, .html, and bower-related files in polymer-test. When it ran bower install, it placed polymer, core-component-page, platform, and pouchdb installation directories in the parent directory.

The .bowerrc file contains "directory": "../" - I believe it should be "directory": "app/bower_components" After changing .bowerrc to point to app/bower_components, I ran bower install and it placed those components in app/bower_components.

I then tried to create an element:

yo polymer:el test-element

It asked me again for my github username, which I entered, and for the element's name, showing the project name polymer-test as default. I entered test-element instead. It overwrote my bower.json, .bowerrc, demo.html, and README.md and created a test-element .css and test-element .html. It did not create this new element in the app/elements as the README suggests.

beriberikix commented 10 years ago

@robdodson is this fixed in your latest changes?

xueeinstein commented 10 years ago

@robdodson I have met the same problem as chrisekelley, yo polymer:el cannot work! It just guide me to do the same work as yo polymer.

astericky commented 10 years ago

I have this same problem as well. Not sure what I can do to rectify this myself.

robdodson commented 10 years ago

We haven't pushed out the new tag yet so I'm assuming everyone is still running the previous version. We'll try to get the tag out today

robdodson commented 10 years ago

This is fixed in the new release: https://github.com/yeoman/generator-polymer/releases/tag/v0.3.0

Running yo polymer will now generate an app scaffold and ask if you want to include core and paper elements. If it asks for your github username then you're running the old version and need to update:

npm update -g generator-polymer