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

Commit ebc361c

Browse files
committed
feat: integrate changes from yo polymer:seed element
1 parent f5bc1b4 commit ebc361c

13 files changed

+168
-11647
lines changed

.travis.yml

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
sudo: false
21
language: node_js
2+
sudo: false
33
cache:
44
directories:
55
- node_modules
6-
notifications:
7-
email: false
8-
node_js:
9-
- iojs
10-
- "0.12"
11-
before_install:
12-
- npm i -g npm@^2.0.0
13-
- npm install -g bower
14-
- bower install
15-
- npm install -g web-component-tester
16-
- export DISPLAY=:99.0
17-
- sh -e /etc/init.d/xvfb start
186
before_script:
19-
- npm prune
20-
script: "wct"
7+
- npm install -g bower polylint web-component-tester
8+
- bower install
9+
- polylint
10+
env:
11+
global:
12+
- secure: gZ5vpMlc9fuKSZeMmT6xf4+FIVWxET6f6Lkp6l5Qo9vL2X/KC/bMJF1v2w5xXFLFTdm/hPUDkeQRDUBBJhGcsXhJeWIvAXdPkObV9ZPRwpDnnN1qU5lOqVIy6gFjDm2Wm6UNXcRnyP1TrGpMwbG13EUtD0rF8LZqBm3B833sKS4=
13+
- secure: DObDewETPYiIsASeC3UETPbQ6YBniRZdNV2eTM1xULvuFNDxXJD09KKyWOiMduublEIJRXLjBIXmD8cbVsgrbRUYA4bxcXffDeuc6q6HaQGU9HvIbLz6o3/oxi4fX2G9GwrZtijW2p2Rgw2l9koR3ovjcM97CSTWFUMh5rtXag8=
14+
- CXX=g++-4.8
15+
node_js: stable
16+
addons:
17+
firefox: latest
18+
apt:
19+
sources:
20+
- google-chrome
21+
- ubuntu-toolchain-r-test
22+
packages:
23+
- google-chrome-stable
24+
- g++-4.8
25+
sauce_connect: true
26+
script:
27+
- xvfb-run wct
28+
- "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi"
2129
after_success:
2230
- npm run semantic-release

.yo-rc.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"generator-polymer": {
3+
"ghUser": "timblack1"
4+
}
5+
}

README.md

+57
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,60 @@ A Polymer element providing access to Hoodie. Typically hoodie-service is not
77
used directly, but is a dependency of https://github.com/timblack1/hoodie-accountbar.
88

99
Online docs & demo are at http://timblack1.github.io/hoodie-service/.
10+
11+
## Dependencies
12+
13+
Element dependencies are managed via [Bower](http://bower.io/). You can
14+
install that via:
15+
16+
npm install -g bower
17+
18+
Then, go ahead and download the element's dependencies:
19+
20+
bower install
21+
22+
23+
## Playing With Your Element
24+
25+
If you wish to work on your element in isolation, we recommend that you use
26+
[Polyserve](https://github.com/PolymerLabs/polyserve) to keep your element's
27+
bower dependencies in line. You can install it via:
28+
29+
npm install -g polyserve
30+
31+
And you can run it via:
32+
33+
polyserve
34+
35+
Once running, you can preview your element at
36+
`http://localhost:8080/components/hoodie-service/`, where `hoodie-service` is the name of the directory containing it.
37+
38+
39+
## Testing Your Element
40+
41+
Simply navigate to the `/test` directory of your element to run its tests. If
42+
you are using Polyserve: `http://localhost:8080/components/hoodie-service/test/`
43+
44+
### web-component-tester
45+
46+
The tests are compatible with [web-component-tester](https://github.com/Polymer/web-component-tester).
47+
Install it via:
48+
49+
npm install -g web-component-tester
50+
51+
Then, you can run your tests on _all_ of your local browsers via:
52+
53+
wct
54+
55+
#### WCT Tips
56+
57+
`wct -l chrome` will only run tests in chrome.
58+
59+
`wct -p` will keep the browsers alive after test runs (refresh to re-run).
60+
61+
`wct test/some-file.html` will test only the files you specify.
62+
63+
64+
## Yeoman support
65+
66+
If you'd like to use Yeoman to scaffold your element that's possible. The official [`generator-polymer`](https://github.com/yeoman/generator-polymer) generator has a [`seed`](https://github.com/yeoman/generator-polymer#seed) subgenerator.

bower.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
"description": "A Polymer element providing access to Hoodie.",
88
"keywords": [
99
"web-component",
10-
"web-components",
1110
"polymer",
1211
"hoodie",
1312
"service"
1413
],
15-
"main": "An element providing access to Hoodie..html",
14+
"main": "hoodie-service.html",
1615
"license": "MIT",
1716
"homepage": "https://github.com/timblack1/hoodie-service/",
1817
"ignore": [
@@ -21,10 +20,10 @@
2120
"/demo/"
2221
],
2322
"dependencies": {
24-
"polymer": "Polymer/polymer#^1.0.0"
23+
"polymer": "Polymer/polymer#^1.2.0"
2524
},
2625
"devDependencies": {
2726
"iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
28-
"web-component-tester": "*"
27+
"web-component-tester": "^4.0.0"
2928
}
3029
}

demo/index.html

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
<!doctype html>
2+
<!--
3+
@license
4+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8+
Code distributed by Google as part of the polymer project is also
9+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
10+
-->
211
<html>
312
<head>
413
<meta charset="utf-8">
514
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
6-
<title>seed-element Demo</title>
7-
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
15+
<title>hoodie-service Demo</title>
16+
<script src="../../webcomponentsjs/webcomponents-lite.min.js"></script>
817
<link rel="import" href="../hoodie-service.html">
918
</head>
10-
<body>
19+
<body unresolved>
1120

1221
<p>An example of <code>&lt;hoodie-service&gt;</code>.</p>
1322

gp.sh

-53
This file was deleted.

hoodie-service.html

+36-28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
<!--
2+
@license
3+
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4+
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5+
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6+
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7+
Code distributed by Google as part of the polymer project is also
8+
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9+
-->
10+
111
<link rel="import" href="../polymer/polymer.html">
212
<script src="/hoodie/client.js"></script>
313

@@ -10,40 +20,38 @@
1020
1121
<hoodie-service id="hoodie_service" hoodie={{hoodie}}></hoodie-service>
1222
13-
@demo
23+
@demo demo/index.html
1424
-->
1525
<dom-module id="hoodie-service">
1626

17-
<style>
18-
:host {
19-
display: none;
20-
}
21-
</style>
22-
23-
<template></template>
27+
<template>
28+
<style>
29+
:host {
30+
display: none;
31+
}
32+
</style>
33+
</template>
2434
<script>
2535
'use strict';
26-
(function () {
27-
28-
Polymer({
29-
is: 'hoodie-service',
30-
properties: {
31-
// Permits you to access hoodie's API via `document.querySelector('hoodie-service').hoodie`.
32-
hoodie: {
33-
type: Object,
34-
value: function(){
35-
var hoodie = new Hoodie();
36-
return hoodie;
37-
},
38-
reflectToAttribute: true,
39-
readOnly: true,
40-
notify: true
41-
}
42-
},
43-
ready:function(){
36+
37+
Polymer({
38+
is: 'hoodie-service',
39+
properties: {
40+
// Permits you to access hoodie's API via `document.querySelector('hoodie-service').hoodie`.
41+
hoodie: {
42+
type: Object,
43+
value: function(){
44+
var hoodie = new Hoodie();
45+
return hoodie;
46+
},
47+
reflectToAttribute: true,
48+
readOnly: true,
49+
notify: true
4450
}
45-
});
51+
},
52+
ready:function(){
53+
}
54+
});
4655

47-
})();
4856
</script>
4957
</dom-module>

0 commit comments

Comments
 (0)