Skip to content

Commit

Permalink
Force to work with polymer-cli and prpl-server
Browse files Browse the repository at this point in the history
  • Loading branch information
keanulee committed Apr 6, 2018
1 parent faf298e commit 73b982c
Show file tree
Hide file tree
Showing 11 changed files with 14,517 additions and 12 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
bower_components
node_modules
build
4 changes: 4 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
runtime: nodejs
env: flex
automatic_scaling:
min_num_instances: 1
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="src/shop-app.js"></script>

<script>
<!-- <script>
window.performance && performance.mark && performance.mark('index.html');
</script>
</script> -->

</body>
</html>
14,434 changes: 14,434 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,16 @@
"contributors": [
"The Polymer Authors"
],
"scripts": {
"start": "prpl-server --root build/ --host 0.0.0.0 --https-redirect --bot-proxy https://render-tron.appspot.com/render",
"build": "polymer build",
"rename": "LC_ALL=C find build -type f -exec sed -i '' s/node_modules/node_assets/g {} + && mv build/es5-bundled/node_modules build/es5-bundled/node_assets && mv build/es6-bundled/node_modules build/es6-bundled/node_assets && mv build/esm-bundled/node_modules build/esm-bundled/node_assets",
"deploy": "gcloud app deploy --project polymer-shop --version 3-prpl-node-server --no-promote"
},
"engines": {
"node": ">=6.0.0"
},
"dependencies": {
"@polymer/polymer": "^3.0.0-pre.12",
"@polymer/app-layout": "^3.0.0-pre.12",
"@polymer/app-route": "^3.0.0-pre.12",
"@polymer/app-storage": "^3.0.0-pre.12",
Expand All @@ -20,7 +28,10 @@
"@polymer/iron-selector": "^3.0.0-pre.12",
"@polymer/paper-behaviors": "^3.0.0-pre.12",
"@polymer/paper-icon-button": "^3.0.0-pre.12",
"@polymer/paper-spinner": "^3.0.0-pre.12"
"@polymer/paper-spinner": "^3.0.0-pre.12",
"@polymer/polymer": "^3.0.0-pre.12",
"polymer-cli": "^1.7.0-pre.4",
"prpl-server": "^1.0.0"
},
"devDependencies": {}
}
59 changes: 58 additions & 1 deletion polymer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,64 @@
],
"builds": [
{
"preset": "es6-unbundled",
"name": "esm-bundled",
"basePath": true,
"browserCapabilities": [
"es2015",
"modules"
],
"js": {
"minify": true
},
"css": {
"minify": true
},
"html": {
"minify": true
},
"bundle": {
"inlineScripts": false
},
"addServiceWorker": true
},
{
"name": "es6-bundled",
"basePath": true,
"browserCapabilities": [
"es2015"
],
"js": {
"minify": true,
"transformModulesToAmd": true
},
"css": {
"minify": true
},
"html": {
"minify": true
},
"bundle": {
"inlineScripts": false
},
"addServiceWorker": true
},
{
"name": "es5-bundled",
"basePath": true,
"js": {
"minify": true,
"compile": true,
"transformModulesToAmd": true
},
"css": {
"minify": true
},
"html": {
"minify": true
},
"bundle": {
"inlineScripts": false
},
"addServiceWorker": true
}
],
Expand Down
2 changes: 1 addition & 1 deletion src/shop-cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './shop-button.js';
import './shop-common-styles.js';
import './shop-form-styles.js';

class ShopCart extends PolymerElement {
export class ShopCart extends PolymerElement {
static get template() {
return html`
<style include="shop-common-styles shop-button shop-form-styles">
Expand Down
2 changes: 1 addition & 1 deletion src/shop-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import './shop-checkbox.js';
import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';
import { timeOut } from '@polymer/polymer/lib/utils/async.js';

class ShopCheckout extends PolymerElement {
export class ShopCheckout extends PolymerElement {
static get template() {
return html`
<style include="shop-common-styles shop-button shop-form-styles shop-input shop-select shop-checkbox">
Expand Down
2 changes: 1 addition & 1 deletion src/shop-detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import './shop-select.js';
import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';
import { microTask } from '@polymer/polymer/lib/utils/async.js';

class ShopDetail extends PolymerElement {
export class ShopDetail extends PolymerElement {
static get template() {
return html`
<style include="shop-common-styles shop-button shop-select">
Expand Down
2 changes: 1 addition & 1 deletion src/shop-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Debouncer } from '@polymer/polymer/lib/utils/debounce.js';
import { microTask } from '@polymer/polymer/lib/utils/async.js';


class ShopList extends PolymerElement {
export class ShopList extends PolymerElement {
static get template() {
return html`
<style include="shop-common-styles">
Expand Down
4 changes: 2 additions & 2 deletions sw-precache-config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module.exports = {
staticFileGlobs: [
'manifest.json',
'bower_components/webcomponentsjs/webcomponents-loader.js',
'node_modules/webcomponentsjs/webcomponents-loader.js',
'images/*'
],
runtimeCaching: [
{
urlPattern: /\/bower_components\/webcomponentsjs\/.*.js/,
urlPattern: /\/node_modules\/webcomponentsjs\/.*.js/,
handler: 'fastest',
options: {
cache: {
Expand Down

0 comments on commit 73b982c

Please sign in to comment.