Polymer is a library of polyfills and sugar which enable the use of Web Components in modern browsers. The project allows developers to build apps using the platform of tomorrow and inform the W3C of places where in-flight specifications can be further improved.
generator-tpa
provides Polymer scaffolding using Yeoman (a scaffolding tool for the web), letting you easily create and customize Polymer (custom) elements via the command-line and import them using HTML Imports. This saves you time writing boilerplate code so you can start writing up the logic to your components straight away.
- A TPA Polymer element tpa-seed that was forked from Polymer's seed-element
- Seed element contains examples such as unit testing, i18n, API mocking for a developer to contribute new functionality into the TPA Bootstrap application
This generator uses the tpa-seed template to create a new web component.
If you're having issues with the template files generated for this project, please raise them in that repository as they are the canonical source.
npm install -g generator-tpa
tpa:seed is the only available generator.
More can be [contributed](#Adding a new generator) to over time
Note: Generator is to be run from the root of your app
Generates a reusable polymer element based on the tpa-seed template.
To preview your new element you'll want to use the polyserve and Drakov tools that's executed via gulp
For further explanation of these tools, see the tpa-seed README
Example:
mkdir -p tpa-new-element && cd $_
yo tpa:seed tpa-new-element
npm install && bower install
gulp serve
See the contributing docs
When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
First clone this project to a local folder, and from that folder execute the following command:
npm install -g .\
This generator uses git submodules to generate the component. To update the submodules use the following command:
git submodule update --remote
Note: Push these updates back into source control
When you update the generator to the npm generator-tpa, it will need to be published to npm
Ensure you update the package.json
to a newer version following the semantic versioning pattern
npm version [patch|minor|major]
npm publish
As new patterns emerge, new TPA generators can be added to the solution
-
Create a new folder using the name that you want run. For example,
host
if you want a consumer to runtpa:host
-
Add an
index.js
to the root of folder, which you can either reuse fromseed
folder or create a new one following the yeoman guidelines -
Add your generator name to the
package.json
under the"files"
property -
Install the git submodule using the following convention if we were implementing a
host
generator fromtpa-host.git
git submodule add https://github.com/ING-Group/tpa-host.git host/templates/tpa-host
-
Add tests to the
test
folder -
Update the version number in the
package.json
-
Update and manually test the generator locally
npm install -g .\
-
Push to source control after validating behaviour
-
Publish to npm
Just as generators can be added, they can also be removed
-
Delete the git submodule, and using the previous
host
example heregit rm --cached host/templates/tpa-host
-
Delete the relevant section from the
.gitmodules
file
[submodule "host/templates/tpa-host"]
path = host/templates/tpa-host
url = https://github.com/ING-Group/tpa-host.git
-
Update the version number
-
Push to source control
-
Publish to npm