Skip to content

Commit

Permalink
Merge pull request #154 from Polymer/3.0
Browse files Browse the repository at this point in the history
3.0
  • Loading branch information
keanulee authored Sep 13, 2018
2 parents ee8b2db + d5a1a80 commit 279ba08
Show file tree
Hide file tree
Showing 40 changed files with 20,326 additions and 1,858 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
bower_components/
node_modules/
build/
*.pyc
node_modules
build
45 changes: 22 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# NEWS

## Prerequisites

### Polymer CLI

Install [polymer-cli](https://github.com/Polymer/polymer-cli):

npm install -g polymer-cli

### Setup

git clone https://github.com/polymer/news.git
cd news
bower install

## Start the development server

polymer serve
## Setup
```bash
$ git clone https://github.com/polymer/news.git
$ cd news
$ npm i
$ npm start
```

## Build

polymer build
```bash
$ npm run build
```

## Test the build

Use `polymer serve` to serve a specific build preset of the app. For example:

polymer serve build/es5-bundled
To test prpl-server build:
```bash
$ npm run serve:prpl-server
```
To test static build:
```bash
$ npm run serve:static
```

## Deploying

Our [production deployment of NEWS](https://news.polymer-project.org/) is hosted on App Engine with Node.js. It can be deployed with [the same steps as PWA Starter Kit](https://polymer.github.io/pwa-starter-kit/building-and-deploying/#deploying-prpl-server).
22 changes: 0 additions & 22 deletions bower.json

This file was deleted.

43 changes: 43 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
@license
Copyright (c) 2018 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
*/

const gulp = require('gulp');
const rename = require('gulp-rename');
const replace = require('gulp-replace');
const del = require('del');

/**
* Cleans the prpl-server build in the server directory.
*/
gulp.task('prpl-server:clean', () => {
return del('server/build');
});

/**
* Copies the prpl-server build to the server directory while renaming the
* node_modules directory so services like App Engine will upload it.
*/
gulp.task('prpl-server:build', () => {
const pattern = 'node_modules';
const replacement = 'node_assets';

return gulp.src('build/**')
.pipe(rename(((path) => {
path.basename = path.basename.replace(pattern, replacement);
path.dirname = path.dirname.replace(pattern, replacement);
})))
.pipe(replace(pattern, replacement))
.pipe(gulp.dest('server/build'));
});

gulp.task('prpl-server', gulp.series(
'prpl-server:clean',
'prpl-server:build'
));
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">

<title>NEWS</title>
<meta name="description" content="Polymer News Demo">

<link rel="shortcut icon" sizes="32x32" href="images/news-icon-32.png">
<meta name="twitter:card" content="summary">
Expand Down Expand Up @@ -75,8 +76,8 @@

<news-app unresolved app-title="NEWS">NEWS</news-app>

<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>
<link rel="import" href="src/news-app.html">
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
<script type="module" src="src/news-app.js"></script>

</body>
</html>
Loading

0 comments on commit 279ba08

Please sign in to comment.