-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy polymer example from vercel/vercel (#1024)
- Loading branch information
1 parent
76ab21c
commit d1ec1f3
Showing
26 changed files
with
10,303 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
build/ | ||
node_modules/ | ||
.env | ||
.env.build | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
![Polymer Logo](https://github.com/vercel/vercel/blob/main/packages/frameworks/logos/polymer.svg) | ||
|
||
# Polymer Example | ||
|
||
This directory is a brief example of a [Polymer](https://www.polymer-project.org/) app that can be deployed to Vercel with zero configuration. | ||
|
||
## Deploy Your Own | ||
|
||
Deploy your own Polymer project with Vercel. | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/examples/tree/main/framework-boilerplates/polymer&template=polymer) | ||
|
||
_Live Example: https://polymer-template.vercel.app_ | ||
|
||
### How We Created This Example | ||
|
||
To get started with Polymer deployed with Vercel, you can use the [Polymer CLI](https://polymer-library.polymer-project.org/3.0/docs/tools/polymer-cli) to initialize the project: | ||
|
||
```shell | ||
$ polymer init | ||
``` |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<!-- | ||
@license | ||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved. | ||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
Code distributed by Google as part of the polymer project is also | ||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
--> | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="generator" content="Polymer Starter Kit"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> | ||
|
||
<title>My App</title> | ||
<meta name="description" content="My App description"> | ||
|
||
<!-- | ||
The `<base>` tag below is present to support two advanced deployment options: | ||
1) Differential serving. 2) Serving from a non-root path. | ||
Instead of manually editing the `<base>` tag yourself, you should generally either: | ||
a) Add a `basePath` property to the build configuration in your `polymer.json`. | ||
b) Use the `--base-path` command-line option for `polymer build`. | ||
Note: If you intend to serve from a non-root path, see [polymer-root-path] below. | ||
--> | ||
<base href="/"> | ||
|
||
<link rel="icon" href="images/favicon.ico"> | ||
|
||
<!-- See https://goo.gl/OOhYW5 --> | ||
<link rel="manifest" href="manifest.json"> | ||
|
||
<!-- See https://goo.gl/qRE0vM --> | ||
<meta name="theme-color" content="#3f51b5"> | ||
|
||
<!-- Add to homescreen for Chrome on Android. Fallback for manifest.json --> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<meta name="application-name" content="My App"> | ||
|
||
<!-- Add to homescreen for Safari on iOS --> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> | ||
<meta name="apple-mobile-web-app-title" content="My App"> | ||
|
||
<!-- Homescreen icons --> | ||
<link rel="apple-touch-icon" href="images/manifest/icon-48x48.png"> | ||
<link rel="apple-touch-icon" sizes="72x72" href="images/manifest/icon-72x72.png"> | ||
<link rel="apple-touch-icon" sizes="96x96" href="images/manifest/icon-96x96.png"> | ||
<link rel="apple-touch-icon" sizes="144x144" href="images/manifest/icon-144x144.png"> | ||
<link rel="apple-touch-icon" sizes="192x192" href="images/manifest/icon-192x192.png"> | ||
|
||
<!-- Tile icon for Windows 8 (144x144 + tile color) --> | ||
<meta name="msapplication-TileImage" content="images/manifest/icon-144x144.png"> | ||
<meta name="msapplication-TileColor" content="#3f51b5"> | ||
<meta name="msapplication-tap-highlight" content="no"> | ||
|
||
<script> | ||
/** | ||
* [polymer-root-path] | ||
* | ||
* Leave this line unchanged if you intend to serve your app from the root | ||
* path (e.g., with URLs like `my.domain/` and `my.domain/view1`). | ||
* | ||
* If you intend to serve your app from a non-root path (e.g., with URLs | ||
* like `my.domain/my-app/` and `my.domain/my-app/view1`), edit this line | ||
* to indicate the path from which you'll be serving, including leading | ||
* and trailing slashes (e.g., `/my-app/`). | ||
*/ | ||
window.MyAppGlobals = { rootPath: '/' }; | ||
|
||
// Load and register pre-caching Service Worker | ||
if ('serviceWorker' in navigator) { | ||
window.addEventListener('load', function() { | ||
navigator.serviceWorker.register('service-worker.js', { | ||
scope: MyAppGlobals.rootPath | ||
}); | ||
}); | ||
} | ||
</script> | ||
|
||
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs --> | ||
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> | ||
|
||
<!-- Load your application shell --> | ||
<script type="module" src="src/my-app.js"></script> | ||
|
||
<!-- Add any global styles for body, document, etc. --> | ||
<style> | ||
body { | ||
margin: 0; | ||
font-family: "Roboto", "Noto", sans-serif; | ||
line-height: 1.5; | ||
min-height: 100vh; | ||
background-color: #eeeeee; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<my-app></my-app> | ||
<noscript> | ||
Please enable JavaScript to view this website. | ||
</noscript> | ||
<!-- Built with love using Polymer Starter Kit --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "My App", | ||
"short_name": "My App", | ||
"description": "My App description", | ||
"icons": [ | ||
{ | ||
"src": "images/manifest/icon-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "images/manifest/icon-512x512.png", | ||
"sizes": "512x512", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "/", | ||
"display": "standalone", | ||
"theme_color": "#3f51b5", | ||
"background_color": "#3f51b5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "polymer-starter-kit", | ||
"version": "4.0.0", | ||
"description": "A starting point for Polymer apps", | ||
"author": "The Polymer Authors", | ||
"license": "BSD-3-Clause", | ||
"repository": "Polymer/polymer-starter-kit", | ||
"scripts": { | ||
"start": "polymer serve", | ||
"dev": "polymer serve --port $PORT", | ||
"build": "polymer build", | ||
"lint": "polymer lint", | ||
"test": "polymer test", | ||
"test:integration": "polymer build # test that psk builds without error with the CLI" | ||
}, | ||
"dependencies": { | ||
"@polymer/app-layout": "^3.0.0-pre.15", | ||
"@polymer/app-route": "^3.0.0-pre.15", | ||
"@polymer/iron-flex-layout": "^3.0.0-pre.15", | ||
"@polymer/iron-iconset-svg": "^3.0.0-pre.15", | ||
"@polymer/iron-media-query": "^3.0.0-pre.15", | ||
"@polymer/iron-pages": "^3.0.0-pre.15", | ||
"@polymer/iron-selector": "^3.0.0-pre.15", | ||
"@polymer/paper-icon-button": "^3.0.0-pre.15", | ||
"@polymer/polymer": "^3.0.0", | ||
"@webcomponents/webcomponentsjs": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"polymer-cli": "^1.7.1", | ||
"wct-browser-legacy": "^1.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=16.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"entrypoint": "index.html", | ||
"shell": "src/my-app.js", | ||
"sources": ["images/**/*"], | ||
"extraDependencies": [ | ||
"manifest.json", | ||
"node_modules/@webcomponents/webcomponentsjs/*.js", | ||
"!node_modules/@webcomponents/webcomponentsjs/gulpfile.js", | ||
"node_modules/@webcomponents/webcomponentsjs/bundles/*.js" | ||
], | ||
"builds": [ | ||
{ | ||
"name": "esm-bundled", | ||
"browserCapabilities": ["es2015", "modules"], | ||
"js": { | ||
"minify": true | ||
}, | ||
"css": { | ||
"minify": true | ||
}, | ||
"html": { | ||
"minify": true | ||
}, | ||
"bundle": true, | ||
"addServiceWorker": true | ||
}, | ||
{ | ||
"name": "es6-bundled", | ||
"browserCapabilities": ["es2015"], | ||
"js": { | ||
"minify": true, | ||
"transformModulesToAmd": true | ||
}, | ||
"css": { | ||
"minify": true | ||
}, | ||
"html": { | ||
"minify": true | ||
}, | ||
"bundle": true, | ||
"addServiceWorker": true | ||
}, | ||
{ | ||
"name": "es5-bundled", | ||
"js": { | ||
"minify": true, | ||
"compile": true, | ||
"transformModulesToAmd": true | ||
}, | ||
"css": { | ||
"minify": true | ||
}, | ||
"html": { | ||
"minify": true | ||
}, | ||
"bundle": true, | ||
"addServiceWorker": true | ||
} | ||
], | ||
"moduleResolution": "node", | ||
"npm": true, | ||
"lint": { | ||
"rules": ["polymer-3"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. | ||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
* Code distributed by Google as part of the polymer project is also | ||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
|
||
console.info( | ||
'Service worker disabled for development, will be generated at build time.' | ||
); |
Oops, something went wrong.