Nick Vanderbilt
Nick Vanderbilt

Reputation: 2535

yo polymer is generating polyer 0.4.0 version

When I execute yo polymer this is what I get in my bower.json.

{ "name": "flatiron2", "version": "0.0.0", "dependencies": { "core-elements": "Polymer/core-elements#^0.4.0", "paper-elements": "Polymer/paper-elements#^0.4.0", "polymer": "Polymer/polymer#^0.4.0" }, "devDependencies": { "polymer-test-tools": "Polymer/polymer-test-tools#^0.4.0" } }

How do I get the latest version of the polymer using yo.

I can see that https://github.com/yeoman/generator-polymer has been updated to use polymer 0.5 but how do I update to the latest generator on my mac machine.

Upvotes: 1

Views: 53

Answers (1)

germ13
germ13

Reputation: 531

I do not believe there is an upgraded generator available...yet.

This does not update the generator, but it will "upgrade" your generated code to polymers most recent version, as of now. So, this is a workaround, but it works, and does what you need:

  1. Completely delete bower_components folder, so you get a clean start.
  2. Make the following changes to your bower.json file:

    "dependencies": {
      "core-elements": "Polymer/core-elements#^0.5.1",
      "paper-elements": "Polymer/paper-elements#^0.5.1",
      "polymer": "Polymer/polymer#^0.5.1"
    },
    "devDependencies": {
      "polymer-test-tools": "Polymer/polymer-test-tools#^0.5.1"
    }, 
    
  3. run bower install from the command line where your bower.json file is located.
  4. Change the line in your app/index.html file from:

    <script src="bower_components/platform/platform.js"></script>
    

    to

    <script src="bower_components/webcomponentsjs/webcomponents.js"></script>
    

They have renamed the platform.js file to webcomponents.js

  1. run grunt server and enjoy.

That should do it, you should be running the most current version of Polymer.

Upvotes: 1

Related Questions