https://github.com/bsorrentino/generator-polymerts
Scaffold out a PolymerTS's element
https://github.com/bsorrentino/generator-polymerts
Last synced: 5 months ago
JSON representation
Scaffold out a PolymerTS's element
- Host: GitHub
- URL: https://github.com/bsorrentino/generator-polymerts
- Owner: bsorrentino
- License: mit
- Created: 2015-08-01T17:06:07.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-01T15:39:47.000Z (over 9 years ago)
- Last Synced: 2024-11-13T01:42:52.570Z (11 months ago)
- Language: TypeScript
- Homepage: https://github.com/nippur72/PolymerTS
- Size: 120 KB
- Stars: 3
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Yeoman generator to scaffold out [Polymer 1.0](http://www.polymer-project.org/)'s elements using Typescript based on [PolymerTS](https://github.com/nippur72/PolymerTS) project
## Introduction
[PolymerTS](https://github.com/nippur72/PolymerTS) is a project that allow to develop [Polymer 1.0](http://www.polymer-project.org/) element using Typescript @decorated classes.
It is thought to work joined with [Polymer Starter Kit](https://developers.google.com/web/tools/polymer-starter-kit/)
## Features
* PolymerTS's element scaffold
## Installation
`` npm install -g generator-polymerts ``
## Generators
* [polymerts:el](#element-alias-el)
* [polymerts:gen](#generate-typescript-from-element)### Element (alias: El)
Generates a polymer element in `app/elements` and optionally appends an import to `app/elements/elements.html`.Example:
```
$ yo polymerts:el my-element [--path ] [--nodecorator]
```**Note: You must pass in an element name, and the name must contain a dash "-"**
#### Options
```
--path, element output path. By default is 'app' and will put your element in folder 'app/elements'.
--nodecorator, generate element without decorator. TS < 1.5 compatibility.
```### Generate Typescript from Element
Generates a Typescript definition (.d.ts) from an installed Polymer element present in `bower_components`.Example:
```
$ yo polymerts:gen polymer-element [--path ] [--elpath ] [--refpath true|false]
```**Note:**
> It generates also the related **Polymer Behaviors** but only if they are in the same element's folder (eg. iron-selector).> In other cases you have to generate each requested Behavior. So find it and rerun the generator.
#### Options
```
--path, element output path. By default generated element (and dependencies) will put in folder 'typings/polymer'.
--elpath, element source path. Just in case (eg. Behaviors ) the element folder hasn't the same name of the element
--refpath, generate reference path (default: false). The reference path will be generated using a path extracted from name prefix (eg. IronButtonState.d.ts will be referenced as ../iron/IronButtonState.d.ts).
```