Skip to content

Commit 05b9dd1

Browse files
authored
Merge pull request #1 from Palindrom/initial-reviewable-code
Initial reviewable code
2 parents 7047307 + 5602c7d commit 05b9dd1

File tree

12 files changed

+588
-0
lines changed

12 files changed

+588
-0
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### Steps to reproduce
2+
3+
#### Live Demo
4+
<!-- Fork this JSBin, or provide your own URL -->
5+
https://jsbin.com/ligimo/3/edit?html,output
6+
7+
### Expected result
8+
9+
### Actual result
10+
11+
### Browsers affected
12+
13+
<!-- Check all that apply -->
14+
- [ ] Chrome
15+
- [ ] Firefox
16+
- [ ] Edge
17+
- [ ] Safari 9
18+
- [ ] Safari 8
19+
- [ ] IE 11
20+
21+
### Screenshot

.travis.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
language: node_js
2+
sudo: required
3+
dist: trusty
4+
before_script:
5+
- npm install web-component-tester
6+
- npm install bower
7+
- export PATH=$PWD/node_modules/.bin:$PATH
8+
- bower install
9+
node_js: 8
10+
addons:
11+
apt:
12+
sources:
13+
- google-chrome
14+
packages:
15+
- google-chrome-stable
16+
script:
17+
- xvfb-run wct
18+
env:
19+
global:
20+
- secure: udu+o3NNMHha79ytgmQxCKH99hTEO2egjCPyy97cCMY0b7jkaMM87UtGvrdxJtZGpkSLRPDxIseafZ0Z9Kvn8splH/cNe23m34LuW97BOeI6R9/1HQBJAyG17luVI8wlW2aYq1xD0xJqpxdTyG/hAKB3D3/8KoAIe9r/fH53cNEHi0mfuOqfWuuQmvmrzKD+DFgPj4SmQPLMxBba6O83kmXZw5NIQYYuoEszPmA4wZxtQzNO0DS37g1N7bsoU6505CKzYaXVLApcpCnmz4s5no21TP+tFBPW9zCjul+J+0WR20PxiaGtI1PlnAAdr0LZPUuBxoRpFhoQwZV5ojsTo82JNjexvmEVY2xOLE3+LS1j9IMvK7Fuv1TbV4r9eufAqvYTt4pVVgo6FwuEfLiMx9Tye7GFlfYmJFsv2dSTDekFr1vDi5E28R2V5JVAT/y+q4eSEsgLDSc7Tpts/ME1nUG3wMTH8NaAqZr7opcfa3vBe+dkeXTw8p8DX6lsaUtLiVvpw4hZGG15h0x05proU2e+RBBDp1SX0bovBjzbxSkJklm5Gzc+lVcGWDJtf/szcwLp77+LvKIHHnLMswezF002OlhRPfNQ8xil9bk/GR5PWnrH/n1A8VLYPAaFwU1tf89I4dPhZVnHSj+y8RWkV+SG7FUbbWE4uFBZnX9oQ6I=
21+
- secure: R1ycV0k4ZbLsNrOhCTTBWzA39mYhH5DtDJ+3fUXvfuWKB97dFDBKgsIFCRketQ2y4uLQr9iNA2kMWjygQ1uwL5SscyYypyKCuVT7dAVa6E+wGO4UjxR/8E0VcgmkfHi9wD2neC3GNDumHH5SwZVLHmqSf0QFvB+Gem46ukDuS3wdgTv1+0oGFpQGbruBCTGxWZ2ydWuuC5zWZYoOguy/IZilDU+2wvG5wAFRz5cQuwSIy6iOsprIdtlgvDpBkwSS2KPs16f3j1xntrg995SXfUFDCyVJ3FGusDAAvIYJ25jls4zydUXDH1JrhiD1rhty1Nc3RI2hZ/yFdXll9J0Kl/nPMNpsECn65pn25AfxcPSChjIgXm+U1pcWEQEMGvhvqvVeZL3fp0o8srxtVssmLAQMMDR2vxe3McDrVnKLHEsbRHQEM0GIlRInsMuZ2RvyDpypGMYEkzZvGMVIUCDTS31xOz/Vtr8/WocqaW0wslvg2l4oKsw+ckWWDJbOXOCQ3RyrEl3+qknJ6a5KF7o4TQwxwpxndeEtgeJeHPwHHThV77SWViOtBgBSvmuZwVngVBaerhIUCsOvCdc9xBvHzfz8o94UbuFIPvV9p03yvdplRmIband0bL9tuerHxmNtVq/au2z21WOdsHVrqZEjhrv4XwTkLiw8QUGkPJ44W4I=

CONTRIBUTING.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Contributing
2+
3+
We welcome and truly appreciate contribution in all forms - issues, pull requests, questions, or fancy examples of apps/elements build on to of your elements.
4+
5+
## Filing bugs
6+
7+
Our team heavily uses Github for all of our software management. We use Github issues to track all bugs and features.
8+
9+
If you find an issue, please do file it on the repository.
10+
11+
We love examples for addressing issues - issues with a Plunkr, [jsFiddle](http://jsfiddle.net), or [jsBin](http://jsbin.com) will be much easier for us to work on quickly.
12+
13+
Occasionally we'll close issues if they appear stale or are too vague - please don't take this personally! Please feel free to re-open issues we've closed if there's something we've missed and they still need to be addressed.
14+
15+
## Developing the element
16+
17+
If you would like to start to fiddle with element's code, here is the flow we use.
18+
19+
- Make a local clone of this repo: `git clone [email protected]:Palindrom/palindrom-error-catcher.git`
20+
21+
In order to develop it locally we suggest to use [polyserve](https://npmjs.com/polyserve) tool to handle bower paths gently.
22+
23+
0. Go to the repo's directory: `cd palindrom-error-catcher`
24+
1. Install [bower](http://bower.io/) & [polyserve](https://npmjs.com/polyserve): `$ npm install -g bower polyserve`
25+
2. Install local dependencies: `$ bower install`
26+
3. Start development server `$ polyserve -p 8000`
27+
4. Open the demo/preview: [http://localhost:8000/components/palindrom-error-catcher/](http://localhost:8000/components/palindrom-error-catcher/)
28+
5. Open the test suite: [http://localhost:8000/components/palindrom-error-catcher/test/](http://localhost:8000/components/palindrom-error-catcher/test/)
29+
30+
## Contributing Pull Requests
31+
32+
1. Fork it!
33+
2. Create your feature branch: `git checkout -b my-new-feature`
34+
3. Commit your changes: `git commit -m 'Add some feature'`
35+
4. Push to the branch: `git push origin my-new-feature`
36+
5. Open corresponding issue if needed
37+
6. Submit a pull request :D
38+
39+
40+
## Unit tests
41+
42+
This project uses [`web-component-tester`](https://github.com/Polymer/web-component-tester) for unit tests.
43+
The [`polyserve`](https://github.com/PolymerLabs/polyserve) utility is helpful for running tests in the browser](#developing-the-element).
44+
45+
46+
### Running element unit tests from CLI
47+
48+
To run the element unit tests from CLI, you need to:
49+
50+
0. Install `web-component-tester` globally: `npm install -g web-component-tester`
51+
1. Clone the element repo.
52+
2. Install the dependencies. `bower install`
53+
3. Run the tests: `wct`
54+
55+
#### Configuring `web-component-tester`
56+
57+
By default, `web-component-tester` runs tests on all installed browsers. You can configure it
58+
to run tests on a subset of available browsers, or to run tests remotely using Sauce Labs.
59+
60+
See the [`web-component-tester` README](https://github.com/Polymer/web-component-tester) for
61+
information on configuring the tool.
62+
63+
## Releasing a new version
64+
65+
**The release is done from `master` branch.**
66+
67+
1. Make sure that the browser tests pass in Chrome, Firefox, Edge and IE. This can be done manually or using `npm run test` (see instructions above).
68+
2. Call `git status` to verify that there are no uncommited files in the directory
69+
3. Call `grunt bump:patch`, `grunt bump:minor` or `grunt bump:major`. This command:
70+
- increments the version number in the relevant files
71+
- commits changes to Git with the version number as the commit message
72+
- creates a Git tag wit the version
73+
4. Call `git push` to push the changes to `origin master`
74+
5. Call `git push --tags` to push the tag to `origin master`
75+
6. Explain the changes (at least an summary of the commit log) in [GitHub Releases](https://github.com/Palindrom/palindrom-error-catcher).

Gruntfile.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = function(grunt) {
2+
3+
grunt.initConfig({
4+
bump: {
5+
options: {
6+
files: ['bower.json', 'palindrom-error-catcher.html'],
7+
commit: true,
8+
commitMessage: '%VERSION%',
9+
commitFiles: ['bower.json', 'palindrom-error-catcher.html'],
10+
createTag: true,
11+
tagName: '%VERSION%',
12+
tagMessage: 'Version %VERSION%',
13+
push: false,
14+
globalReplace: false,
15+
prereleaseName: false,
16+
regExp: false
17+
}
18+
}
19+
});
20+
21+
22+
grunt.loadNpmTasks('grunt-contrib-watch');
23+
grunt.loadNpmTasks('grunt-bump');
24+
25+
grunt.registerTask('default', ['watch']);
26+
27+
};

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# &lt;palindrom-error-catcher&gt; [![Build Status](https://travis-ci.org/Palindrom/palindrom-error-catcher.svg?branch=gh-pages)](https://travis-ci.org/Palindrom/palindrom-error-catcher)
2+
3+
---
4+
5+
> Handles palindrom-client disconnection events and creates the needed UI to give the user control over them
6+
7+
Custom Element that binds with [palindrom-client](https://github.com/Palindrom/palindrom-client) connection events and shows a simple UI that allows the user to interact with the events. It is can be used as an example of designing your own error-preseting UI.
8+
9+
Please check the code at `palindrom-error-catcher.html` file to see how events are handled.
10+
11+
## Creating your own
12+
13+
If you want to gain control over the appearance of your errors UI. You can fork this element, put it in the `wwwroot/sys/` folder of your app. And edit it as desired. Once you have an element in this folder with the same name, it will supersede the default one and your UI will be shows.
14+
15+
## Install
16+
17+
Install the component using [Bower](http://bower.io/):
18+
19+
```sh
20+
$ bower install palindrom-error-catcher --save
21+
```
22+
23+
Or [download as ZIP](https://github.com/Palindrom/palindrom-error-catcher/archive/master.zip).
24+
25+
## Usage
26+
27+
1. Import polyfill:
28+
29+
```html
30+
<script src="bower_components/webcomponentsjs/webcomponent-lite.js"></script>
31+
```
32+
33+
2. Import custom element:
34+
35+
```html
36+
<link rel="import" href="bower_components/palindrom-error-catcher/palindrom-error-catcher.html">
37+
```
38+
39+
3. Start using it!
40+
41+
```html
42+
<palindrom-error-catcher></palindrom-error-catcher>
43+
```
44+
45+
## Options
46+
47+
Attribute | Options | Default | Description
48+
--- | --- | --- | ---
49+
`target-selector` | *string* | `palindrom-client` | CSS selector of `palindrom-client` element.
50+
51+
## Methods
52+
53+
Method | Parameters | Returns | Description
54+
--- | --- | --- | ---
55+
`cancelReloading()` | None. | Nothing. | Cancels reloading timer and hides the disconnection bar.
56+
57+
## [Contributing and Development](CONTRIBUTING.md)
58+
59+
## History
60+
61+
For detailed changelog, check [Releases](https://github.com/Palindrom/palindrom-error-catcher/releases).
62+
63+
## License
64+
65+
MIT

bower.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "palindrom-error-catcher",
3+
"version": "1.0.0",
4+
"description":
5+
"Handles palindrom-client disconnection events and creates the needed UI to give the user control over them",
6+
"private": true,
7+
"authors": ["Omar Alshaker"],
8+
"keywords": [
9+
"web-components",
10+
"polymer",
11+
"json-patch",
12+
"palindrom",
13+
"binding",
14+
"puppetjs",
15+
"template",
16+
"web-socket",
17+
"http",
18+
"json"
19+
],
20+
"main": "palindrom-error-catcher.html",
21+
"repository": {
22+
"type": "git",
23+
"url": "git://github.com/Palindrom/palindrom-error-catcher.git"
24+
},
25+
"license": "MIT",
26+
"homepage": "https://github.com/Palindrom/palindrom-error-catcher",
27+
"ignore": ["**/.*", "node_modules", "bower_components", "test/"],
28+
"devDependencies": {
29+
"test-fixture": "PolymerElements/test-fixture#^3.0.0",
30+
"web-component-tester": "^6.0.0",
31+
"webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0"
32+
}
33+
}

index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!doctype html>
2+
<html>
3+
4+
<head>
5+
<meta http-equiv="refresh" content="0;URL='/components/palindrom-error-catcher/test/" />
6+
</head>
7+
8+
</html>

0 commit comments

Comments
 (0)