Template for creating BrightspaceUI Polymer
2.x hybrid elements.
Looking for our Polymer 2 element generator? It's over here.
With the template, you get:
- Project boilerplate including:
- A basic Polymer hybrid element scaffold
- Demo page for the element
- Test page for the element
- Travis CI ready-to-go
- Local tests that do linting using ESLint,
polymer lintand unit tests using Chrome headless
- Cross-browser testing from Travis CI using Sauce Labs
Assuming you have Node.js already, install
polymer-cli, Bower and the hybrid element generator globally:
npm install -g polymer-cli npm install -g generator-polymer-init-d2l-hybrid-element
In an empty project directory, run the CLI's
mkdir my-element cd my-element polymer init
d2l-hybrid-element from the list and follow the prompts.
Alternately, you can jump right into the wizard:
polymer init d2l-hybrid-element
That's it! Follow the instructions in the
README to learn how to get a local development server running and run the tests.
To do cross-browser testing using Sauce Labs, the API key needs to be encrypted into the
To learn more about how to set this up, see the Testing section of The Guide.
Developing and Contributing
Pull requests welcome!
After cloning the repo, install dependencies:
To run unit tests:
Running the generator locally
To avoid having to publish to NPM just to test out your local changes, you can run a local copy.
First, from the root of the
That's pretty much it. Now create a new empty project to try it out and run
polymer init. Choosing the generator from the list should run your local code.
Publishing to NPM
Publishing happens automatically from Travis CI whenever there's a tagged commit. The easiest way to kick that off is through GitHub's "Releases" tab.
Just make sure you've incremented the