yeoman / generator-polymer

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

Option to use an empty boilerplate for seed-element #254

Open Zecat opened 8 years ago

Zecat commented 8 years ago

Hello, about yo polymer:seed, I'm a big fan of the fancy laser gun and the tutorials comments but it's pretty annoying to have to erase these hundreds of lines each time. Would it be possible to have the option to use a less crowded boilerplate ? Something simple like :

my-element.html

<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../polymer/polymer.html">

<!--
An element providing a solution to no problem in particular.

Example:

    <my-element></my-element>

@demo demo/index.html
@hero hero.svg
-->

<dom-module id="my-element">
  <template>
    <style>
      :host {
        display: block;
        box-sizing: border-box;
      }
    </style>
  </template>

  <script>
    Polymer({
      is: 'my-element',

      properties: {

      }
    });
  </script>
</dom-module>

demo/index.html

<!doctype html>
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
    <title>my-element Demo</title>
    <script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
    <link rel="import" href="../my-element.html">
  </head>
  <body unresolved>

    <my-element>
    </my-element>

  </body>
</html>

That's basically the point where I would do an 'init commit'.

robdodson commented 8 years ago

Hm yeah i see what you're saying. One of the things we've tried to do with the generator is not create our own templates but instead pull in other canonical projects. We used to have all of our own templates and keeping everything in sync was annoying (and meant bugs got filed in two places). I'm going to have to think about this for a bit.