Skip to content
This repository was archived by the owner on Sep 25, 2022. It is now read-only.

Commit 866dc57

Browse files
author
Zeno Rocha
committed
Create Hello World example based on Polymer
0 parents  commit 866dc57

31 files changed

+1185
-0
lines changed

.editorconfig

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# http://editorconfig.org
4+
5+
root = true
6+
7+
[*]
8+
# Change these settings to your own preference
9+
indent_style = space
10+
indent_size = 4
11+
12+
# We recommend you to keep these unchanged
13+
end_of_line = lf
14+
charset = utf-8
15+
trim_trailing_whitespace = true
16+
insert_final_newline = true
17+
18+
[*.md]
19+
trim_trailing_whitespace = false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

Gruntfile.js

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
module.exports = function(grunt) {
2+
3+
grunt.initConfig({
4+
connect: {
5+
demo: {
6+
options: {
7+
open: true,
8+
keepalive: true
9+
}
10+
}
11+
},
12+
replace: {
13+
example: {
14+
src: ['src/*'],
15+
dest: 'dist/',
16+
replacements: [{
17+
from: 'bower_components',
18+
to: '..'
19+
}]
20+
}
21+
},
22+
bump: {
23+
options: {
24+
commit: true,
25+
commitFiles: ['bower.json', 'package.json'],
26+
commitMessage: 'Release v%VERSION%',
27+
createTag: true,
28+
files: ['bower.json', 'package.json'],
29+
push: true,
30+
pushTo: 'origin gh-pages',
31+
tagMessage: '',
32+
tagName: 'v%VERSION%'
33+
}
34+
}
35+
});
36+
37+
grunt.loadNpmTasks('grunt-bump');
38+
grunt.loadNpmTasks('grunt-contrib-connect');
39+
grunt.loadNpmTasks('grunt-text-replace');
40+
41+
grunt.registerTask('default', ['connect']);
42+
grunt.registerTask('build', ['replace']);
43+
44+
};

README.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# <hello-world> ![Bower Version](https://badge.fury.io/bo/hello-world-polymer.svg)
2+
3+
> Web Component example using [Polymer](http://www.polymer-project.org/).
4+
5+
## Demo
6+
7+
[Check it live!](http://webcomponents.github.io/hello-world-polymer)
8+
9+
## Usage
10+
11+
1. Install the component using [Bower](http://bower.io/):
12+
13+
```sh
14+
$ bower install hello-world-polymer --save
15+
```
16+
17+
2. Import Web Components' polyfill:
18+
19+
```html
20+
<script src="bower_components/platform/platform.js"></script>
21+
```
22+
23+
3. Import Custom Element:
24+
25+
```html
26+
<link rel="import" href="bower_components/hello-world/dist/hello-world.html">
27+
```
28+
29+
4. Start using it!
30+
31+
```html
32+
<hello-world></hello-world>
33+
```
34+
35+
## Options
36+
37+
Attribute | Options | Default | Description
38+
--- | --- | --- | ---
39+
`name` | *string* | `World` | Who do you want to say hello?
40+
41+
## Development
42+
43+
In order to run it locally you'll need to fetch some dependencies and a basic server setup.
44+
45+
1. Install [Bower](http://bower.io/) & [Grunt](http://gruntjs.com/):
46+
47+
```sh
48+
$ [sudo] npm install -g bower grunt-cli
49+
```
50+
51+
2. Install local dependencies:
52+
53+
```sh
54+
$ bower install && npm install
55+
```
56+
57+
3. To test your project, start the development server and open `http://localhost:8000`.
58+
59+
```sh
60+
$ grunt
61+
```
62+
63+
4. To publish a new version, build the distribution files, bump package version, create tag, commit and push.
64+
65+
```sh
66+
$ grunt build
67+
68+
$ grunt bump # v0.0.1
69+
$ grunt bump:minor # v0.1.0
70+
$ grunt bump:major # v1.0.0
71+
```
72+
73+
## Contributing
74+
75+
1. Fork it!
76+
2. Create your feature branch: `git checkout -b my-new-feature`
77+
3. Commit your changes: `git commit -m 'Add some feature'`
78+
4. Push to the branch: `git push origin my-new-feature`
79+
5. Submit a pull request :D
80+
81+
## History
82+
83+
For detailed changelog, check [Releases](https://github.com/webcomponents/hello-world-polymer/releases).
84+
85+
## License
86+
87+
[MIT License](http://webcomponentsorg.mit-license.org/) © WebComponents.org

bower.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "hello-world-polymer",
3+
"version": "0.0.0",
4+
"description": "Web Component example using Polymer",
5+
"authors": [
6+
"WebComponents.org"
7+
],
8+
"license": "MIT",
9+
"main": "dist/hello-world.html",
10+
"keywords": [
11+
"polymer",
12+
"web-components"
13+
],
14+
"ignore": [
15+
"**/.*",
16+
"node_modules",
17+
"bower_components"
18+
],
19+
"dependencies": {
20+
"platform": "Polymer/platform#~0.2.0",
21+
"polymer": "Polymer/polymer#~0.2.0"
22+
}
23+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "platform",
3+
"main": "platform.js",
4+
"homepage": "https://github.com/Polymer/platform",
5+
"authors": [
6+
"The Polymer Authors"
7+
],
8+
"description": "Integrate platform polyfills: load, build, test",
9+
"keywords": [
10+
"polymer",
11+
"web",
12+
"components"
13+
],
14+
"license": "BSD",
15+
"private": true,
16+
"version": "0.2.1",
17+
"_release": "0.2.1",
18+
"_resolution": {
19+
"type": "version",
20+
"tag": "0.2.1",
21+
"commit": "961d6f68848b9479d4d778466c37c0835837bc1c"
22+
},
23+
"_source": "git://github.com/Polymer/platform.git",
24+
"_target": "~0.2.0",
25+
"_originalSource": "Polymer/platform"
26+
}

bower_components/platform/AUTHORS

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Names should be added to this file with this pattern:
2+
#
3+
# For individuals:
4+
# Name <email address>
5+
#
6+
# For organizations:
7+
# Organization <fnmatch pattern>
8+
#
9+
Google Inc. <*@google.com>
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Contributing
2+
3+
Want to contribute to Polymer? Great!
4+
5+
We are more than happy to accept external contributions to the project in the form of [feedback](https://groups.google.com/forum/?fromgroups=#!forum/polymer-dev), [bug reports](../../issues), and pull requests.
6+
7+
## Contributor License Agreement
8+
9+
Before we can accept patches, there's a quick web form you need to fill out.
10+
11+
- If you're contributing as an individual (e.g. you own the intellectual property), fill out [this form](http://code.google.com/legal/individual-cla-v1.0.html).
12+
- If you're contributing under a company, fill out [this form](http://code.google.com/legal/corporate-cla-v1.0.html) instead.
13+
14+
This CLA asserts that contributions are owned by you and that we can license all work under our [license](LICENSE).
15+
16+
Other projects require a similar agreement: jQuery, Firefox, Apache, Node, and many more.
17+
18+
[More about CLAs](https://www.google.com/search?q=Contributor%20License%20Agreement)
19+
20+
## Initial setup
21+
22+
Here's an easy guide that should get you up and running:
23+
24+
1. Setup Grunt: `sudo npm install -g grunt-cli`
25+
1. Fork the project on github and pull down your copy.
26+
> replace the {{ username }} with your username and {{ repository }} with the repository name
27+
28+
git clone [email protected]:{{ username }}/{{ repository }}.git --recursive
29+
30+
Note the `--recursive`. This is necessary for submodules to initialize properly. If you don't do a recursive clone, you'll have to init them manually:
31+
32+
git submodule init
33+
git submodule update
34+
35+
Download and run the `pull-all.sh` script to install the sibling dependencies.
36+
37+
git clone git://github.com/Polymer/tools.git && tools/bin/pull-all.sh
38+
39+
1. Test your change
40+
> in the repo you've made changes to, run the tests:
41+
42+
cd $REPO
43+
npm install
44+
grunt test
45+
46+
1. Commit your code and make a pull request.
47+
48+
That's it for the one time setup. Now you're ready to make a change.
49+
50+
## Submitting a pull request
51+
52+
We iterate fast! To avoid potential merge conflicts, it's a good idea to pull from the main project before making a change and submitting a pull request. The easiest way to do this is setup a remote called `upstream` and do a pull before working on a change:
53+
54+
git remote add upstream git://github.com/Polymer/{{ repository }}.git
55+
56+
Then before making a change, do a pull from the upstream `master` branch:
57+
58+
git pull upstream master
59+
60+
To make life easier, add a "pull upstream" alias in your `.gitconfig`:
61+
62+
[alias]
63+
pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master"
64+
65+
That will pull in changes from your forked repo, the main (upstream) repo, and merge the two. Then it's just a matter of running `git pu` before a change and pushing to your repo:
66+
67+
git checkout master
68+
git pu
69+
# make change
70+
git commit -a -m 'Awesome things.'
71+
git push
72+
73+
Lastly, don't forget to submit the pull request.

bower_components/platform/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) 2012 The Polymer Authors. All rights reserved.
2+
//
3+
// Redistribution and use in source and binary forms, with or without
4+
// modification, are permitted provided that the following conditions are
5+
// met:
6+
//
7+
// * Redistributions of source code must retain the above copyright
8+
// notice, this list of conditions and the following disclaimer.
9+
// * Redistributions in binary form must reproduce the above
10+
// copyright notice, this list of conditions and the following disclaimer
11+
// in the documentation and/or other materials provided with the
12+
// distribution.
13+
// * Neither the name of Google Inc. nor the names of its
14+
// contributors may be used to endorse or promote products derived from
15+
// this software without specific prior written permission.
16+
//
17+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

bower_components/platform/PATENTS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Additional IP Rights Grant (Patents)
2+
3+
"This implementation" means the copyrightable works distributed by
4+
Google as part of the Polymer project.
5+
6+
Google hereby grants to You a perpetual, worldwide, non-exclusive,
7+
no-charge, royalty-free, irrevocable (except as stated in this section)
8+
patent license to make, have made, use, offer to sell, sell, import,
9+
transfer and otherwise run, modify and propagate the contents of this
10+
implementation of Polymer, where such license applies only to those
11+
patent claims, both currently owned or controlled by Google and acquired
12+
in the future, licensable by Google that are necessarily infringed by
13+
this implementation of Polymer. This grant does not include claims
14+
that would be infringed only as a consequence of further modification of
15+
this implementation. If you or your agent or exclusive licensee
16+
institute or order or agree to the institution of patent litigation
17+
against any entity (including a cross-claim or counterclaim in a
18+
lawsuit) alleging that this implementation of Polymer or any code
19+
incorporated within this implementation of Polymer constitutes
20+
direct or contributory patent infringement, or inducement of patent
21+
infringement, then any patent rights granted to you under this License
22+
for this implementation of Polymer shall terminate as of the date
23+
such litigation is filed.

0 commit comments

Comments
 (0)