This commit is contained in:
Yangguang Li 2019-04-15 17:30:57 -07:00
Родитель f99898a2bc
Коммит 63095fd3e7
9 изменённых файлов: 10 добавлений и 164 удалений

Просмотреть файл

@ -40,10 +40,6 @@ The `FIREBASE_SERVER_KEY` is the Firebase server key obtained from the [Firebase
npm run start
```
#### Watch web component rollup job
If you are developing web components under `/static/elements`, run `npm run watch` to watch changes and bundle web components into `/static/js/component-bundle.js`
#### FCM setup
If you want to test push notification features, you'll need to create a file named
@ -77,12 +73,6 @@ of globals for debugging and running the site locally.
### Deploying
#### Build all web components
```shell
npm run build
```
#### Deploy
**Note** you need to have admin privileges on the `cr-status` cloud project to be

Просмотреть файл

@ -41,8 +41,6 @@ function license() {
gulp.task('lint', () => {
return gulp.src([
'static/**/*.js',
'!static/js/component-bundle.js', // Exclude files generated by Rollup
'!static/js/component-bundle-entry.js' // Exclude Rollup entry
])
.pipe($.eslint())
.pipe($.eslint.format())
@ -74,6 +72,7 @@ gulp.task('js', () => {
//'static/elements/*.vulcanize.js',
'static/js/**/*.es6.js',
'static/js/shared.js',
'!static/static/elements' // Exclude web components
])
.pipe($.babel()) // Defaults are in .babelrc
.pipe(uglifyJS())

132
package-lock.json сгенерированный
Просмотреть файл

@ -66,12 +66,6 @@
"integrity": "sha1-5zZWSMG0ITalnH1QQGN7O1yDthQ=",
"dev": true
},
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
},
"@types/node": {
"version": "11.13.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.13.1.tgz",
@ -87,15 +81,6 @@
"@types/node": "11.13.1"
}
},
"@types/resolve": {
"version": "0.0.8",
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-0.0.8.tgz",
"integrity": "sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==",
"dev": true,
"requires": {
"@types/node": "11.13.1"
}
},
"abbrev": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz",
@ -1306,12 +1291,6 @@
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
"dev": true
},
"builtin-modules": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz",
"integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==",
"dev": true
},
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
@ -2696,12 +2675,6 @@
"integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
"dev": true
},
"estree-walker": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.0.tgz",
"integrity": "sha512-peq1RfVAVzr3PU/jL31RaOjUKLoZJpObQWJJ+LgfcxDUifyLZ1RjPQZTl0pzj2uJ45b7A7XpyppXvxdEqzo4rw==",
"dev": true
},
"esutils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz",
@ -5481,12 +5454,6 @@
"is-path-inside": "1.0.1"
}
},
"is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
"dev": true
},
"is-negated-glob": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-negated-glob/-/is-negated-glob-1.0.0.tgz",
@ -5660,27 +5627,6 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"dev": true
},
"jest-worker": {
"version": "24.6.0",
"resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz",
"integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==",
"dev": true,
"requires": {
"merge-stream": "1.0.1",
"supports-color": "6.1.0"
},
"dependencies": {
"supports-color": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
"integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
"dev": true,
"requires": {
"has-flag": "3.0.0"
}
}
}
},
"js-base64": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz",
@ -6134,15 +6080,6 @@
"es5-ext": "0.10.49"
}
},
"magic-string": {
"version": "0.25.2",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.2.tgz",
"integrity": "sha512-iLs9mPjh9IuTtRsqqhNGYcZXGei0Nh/A4xirrsqW7c+QhKVFL2vm7U09ru6cHRD22azaP/wMDgI+HCqbETMTtg==",
"dev": true,
"requires": {
"sourcemap-codec": "1.4.4"
}
},
"make-dir": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
@ -7741,63 +7678,6 @@
"glob": "7.1.3"
}
},
"rollup": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-1.9.0.tgz",
"integrity": "sha512-cNZx9MLpKFMSaObdVFeu8nXw8gfw6yjuxWjt5mRCJcBZrAJ0NHAYwemKjayvYvhLaNNkf3+kS2DKRKS5J6NRVg==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"@types/node": "11.13.1",
"acorn": "6.1.1"
}
},
"rollup-plugin-commonjs": {
"version": "9.3.4",
"resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.3.4.tgz",
"integrity": "sha512-DTZOvRoiVIHHLFBCL4pFxOaJt8pagxsVldEXBOn6wl3/V21wVaj17HFfyzTsQUuou3sZL3lEJZVWKPFblJfI6w==",
"dev": true,
"requires": {
"estree-walker": "0.6.0",
"magic-string": "0.25.2",
"resolve": "1.10.0",
"rollup-pluginutils": "2.6.0"
}
},
"rollup-plugin-node-resolve": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.1.tgz",
"integrity": "sha512-zf2dcKBSv9KSnNbAPDYzwLpeI4Lc4bOsNlaRsq3ud80zquxWdu9iYA0ZgmHxFjBkbt8uHzXCGC4FkkejtngKng==",
"dev": true,
"requires": {
"@types/resolve": "0.0.8",
"builtin-modules": "3.1.0",
"is-module": "1.0.0",
"resolve": "1.10.0"
}
},
"rollup-plugin-terser": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/rollup-plugin-terser/-/rollup-plugin-terser-4.0.4.tgz",
"integrity": "sha512-wPANT5XKVJJ8RDUN0+wIr7UPd0lIXBo4UdJ59VmlPCtlFsE20AM+14pe+tk7YunCsWEiuzkDBY3QIkSCjtrPXg==",
"dev": true,
"requires": {
"@babel/code-frame": "7.0.0",
"jest-worker": "24.6.0",
"serialize-javascript": "1.6.1",
"terser": "3.17.0"
}
},
"rollup-pluginutils": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.6.0.tgz",
"integrity": "sha512-aGQwspEF8oPKvg37u3p7h0cYNwmJR1sCBMZGZ5b9qy8HGtETknqjzcxrDRrcAnJNXN18lBH4Q9vZYth/p4n8jQ==",
"dev": true,
"requires": {
"estree-walker": "0.6.0",
"micromatch": "3.1.10"
}
},
"run-async": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
@ -7894,12 +7774,6 @@
"sver-compat": "1.5.0"
}
},
"serialize-javascript": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz",
"integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==",
"dev": true
},
"serviceworker-cache-polyfill": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/serviceworker-cache-polyfill/-/serviceworker-cache-polyfill-4.0.0.tgz",
@ -8138,12 +8012,6 @@
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=",
"dev": true
},
"sourcemap-codec": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.4.tgz",
"integrity": "sha512-CYAPYdBu34781kLHkaW3m6b/uUSyMOC2R61gcYMWooeuaGtjof86ZA/8T+qVPPt7np1085CR9hmMGrySwEc8Xg==",
"dev": true
},
"sparkles": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz",

Просмотреть файл

@ -10,10 +10,9 @@
"postinstall": "npm run deps && npm run build",
"deps": "rm -rf static/bower_components && bower install && pip install -t lib -r requirements.txt",
"lint": "gulp lint",
"build": "gulp && rollup -c",
"build": "gulp",
"deploy": "./scripts/deploy_site.sh",
"start": "./scripts/start_server.sh",
"watch": "rollup -c -w"
"start": "./scripts/start_server.sh"
},
"repository": {
"type": "git",
@ -48,9 +47,6 @@
"http2-push-manifest": "^1.0.0",
"lighthouse-ci": "https://github.com/ebidel/lighthouse-ci",
"load-grunt-tasks": "^4.0.0",
"rollup": "^1.9.0",
"rollup-plugin-node-resolve": "^4.2.1",
"rollup-plugin-terser": "^4.0.4",
"sw-precache": "^5.2.1",
"sw-toolbox": "^3.6.0"
},

Просмотреть файл

@ -1,4 +1,6 @@
import { LitElement, html } from 'lit-element';
import {LitElement, html} from 'https://unpkg.com/@polymer/lit-element@latest/lit-element.js?module';
const CYAN = 120;
class ChromedashColorStatus extends LitElement {
static get properties() {
@ -8,7 +10,7 @@ class ChromedashColorStatus extends LitElement {
},
value: {
type: Number,
}
},
};
}
@ -18,17 +20,12 @@ class ChromedashColorStatus extends LitElement {
}
render() {
const color = `hsl(${Math.round(CYAN - this.value * CYAN / this.max)}, 100%, 50%)`;
return html`
<link rel="stylesheet" href="/static/css/elements/chromedash-color-status.css">
<span id="status" style="background-color: ${this._getColor()}"></span>
<span id="status" style="background-color: ${color}"></span>
`;
}
_getColor() {
const cyan = 120;
const hue = Math.round(cyan - this.value * cyan / this.max);
return `hsl(${hue}, 100%, 50%)`;
}
}
customElements.define('chromedash-color-status', ChromedashColorStatus);

Просмотреть файл

@ -1,6 +1,7 @@
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../bower_components/iron-icon/iron-icon.html">
<link rel="import" href="../bower_components/paper-styles/color.html">
<script type="module" src="/static/elements/chromedash-color-status.js"></script>
<!-- https://github.com/ljosa/urlize.js -->
<script src="urlize.js"></script>

Просмотреть файл

@ -1 +0,0 @@
import '../elements/chromedash-color-status.mjs';

Просмотреть файл

@ -40,8 +40,6 @@ limitations under the License.
<!-- <link rel="dns-prefetch" href="https://fonts.googleapis.com"> -->
<!-- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> -->
<script src="/static/js/component-bundle.js"></script>
{% block meta %}{% endblock %}
<!-- <link rel="stylesheet"

Просмотреть файл

@ -39,8 +39,6 @@ limitations under the License.
<link rel="preconnect" href="https://www.google-analytics.com" crossorigin>
{% block meta %}{% endblock %}
<script src="/static/js/component-bundle.js"></script>
<style>{% inline_file "/static/css/main.css" %}</style>
{% block css %}{% endblock %}