Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #80 from PolymerElements/update_psk
Browse files Browse the repository at this point in the history
Update PSK to v2.2.0
  • Loading branch information
abdonrd authored Aug 2, 2017
2 parents 7fb40d3 + fd4b258 commit fc37646
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 70 deletions.
56 changes: 10 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# generator-polymer-init-custom-build
# Polymer App Toolbox - Starter Kit with custom build

[![Build Status](https://travis-ci.org/PolymerElements/generator-polymer-init-custom-build.svg?branch=master)](https://travis-ci.org/PolymerElements/generator-polymer-init-custom-build)

This template is a starting point for building apps using Polymer Starter Kit
This template is a starting point for building apps using [Polymer Starter Kit](https://github.com/PolymerElements/polymer-starter-kit)
with a custom gulp process leveraging [polymer-build](https://github.com/Polymer/polymer-build),
the library powering [Polymer CLI](https://github.com/Polymer/polymer-cli).

Expand All @@ -17,57 +17,21 @@ assume you have pre-installed [node.js](https://nodejs.org)).
npm install -g polymer-cli
npm install -g generator-polymer-init-custom-build

##### Initialize project from template
Second, install [Bower](https://bower.io/) using [npm](https://www.npmjs.com)

npm install -g bower

Generate your new project using `polymer init`:
##### Initialize project from template

mkdir my-app
cd my-app
polymer init custom-build
polymer init polymer-starter-kit-custom-build

### Start the development server

This command serves the app at `http://localhost:8080` and provides basic URL
This command serves the app at `http://127.0.0.1:8081` and provides basic URL
routing for the app:

polymer serve --open

### Build

Rather than rely on the usual `polymer build` command, this project gives you an
"escape hatch" so you can include additional steps in your build process.

The included `gulpfile.js` relies on [the `polymer-build` library](https://github.com/Polymer/polymer-build),
the same library that powers Polymer CLI. Out of the box it will clean the
`build` directory, and provide image minification. Follow the comments in the
`gulpfile.js` to add additional steps like JS transpilers or CSS preprocessors.

npm run build

### Preview the build

This command serves the minified version of the app at `http://localhost:8080`:

polymer serve build/

### Run tests

This command will run [Web Component Tester](https://github.com/Polymer/web-component-tester)
against the browsers currently installed on your machine:

polymer test

### Adding a new build step

The `gulpfile.js` already contains an example build step that demonstrates how
to run image minification across your source files. For more examples, refer to
the section in [the polymer-build README on extracting inline sources](https://github.com/Polymer/polymer-build#extracting-inlined-cssjs).

### Adding a new view
polymer serve

You can extend the app by adding more views that will be demand-loaded
e.g. based on the route, or to progressively render non-critical sections of the
application. Each new demand-loaded fragment should be added to the list of
`fragments` in the included `polymer.json` file. This will ensure those
components and their dependencies are added to the list of pre-cached components
(and will have bundles created in the fallback `bundled` build).
### You can read more information at [template README.md](generators/app/README.md).
38 changes: 28 additions & 10 deletions generators/app/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Polymer App Toolbox - Starter Kit
# Polymer App Toolbox - Starter Kit with custom build

[![Build Status](https://travis-ci.org/PolymerElements/polymer-starter-kit.svg?branch=master)](https://travis-ci.org/PolymerElements/polymer-starter-kit)
[![Build Status](https://travis-ci.org/PolymerElements/generator-polymer-init-custom-build.svg?branch=master)](https://travis-ci.org/PolymerElements/generator-polymer-init-custom-build)

This template is a starting point for building apps using a drawer-based
layout. The layout is provided by `app-layout` elements.
Expand All @@ -18,25 +18,36 @@ The PRPL pattern, in a nutshell:
* **Pre-cache** components for remaining routes
* **Lazy-load** and progressively upgrade next routes on-demand

Also have a custom gulp process leveraging [polymer-build](https://github.com/Polymer/polymer-build),
the library powering [Polymer CLI](https://github.com/Polymer/polymer-cli).

### Setup

##### Prerequisites

First, install [Polymer CLI](https://github.com/Polymer/polymer-cli) using
[npm](https://www.npmjs.com) (we assume you have pre-installed [node.js](https://nodejs.org)).
First, install [Polymer CLI](https://github.com/Polymer/polymer-cli) and
generator-polymer-init-custom-build using [npm](https://www.npmjs.com) (we
assume you have pre-installed [node.js](https://nodejs.org)).

npm install -g polymer-cli
npm install -g generator-polymer-init-custom-build

Second, install [Bower](https://bower.io/) using [npm](https://www.npmjs.com)

npm install -g bower

And install the dependencies:
##### Initialize project from template

npm install && bower install
mkdir my-app
cd my-app
polymer init polymer-starter-kit-custom-build

### Start the development server

This command serves the app at `http://localhost:8080` and provides basic URL
This command serves the app at `http://127.0.0.1:8081` and provides basic URL
routing for the app:

polymer serve --open
polymer serve

### Build

Expand All @@ -53,7 +64,7 @@ the dependencies based on the entrypoint and fragments specified in

### Preview the build

This command serves the minified version of the app at `http://localhost:8080`:
This command serves your app.

polymer serve build/

Expand All @@ -64,6 +75,13 @@ against the browsers currently installed on your machine:

polymer test

If running Windows you will need to set the following environment variables:

- LAUNCHPAD_BROWSERS
- LAUNCHPAD_CHROME

Read More here [daffl/launchpad](https://github.com/daffl/launchpad#environment-variables-impacting-local-browsers-detection)

### Adding a new build step

The `gulpfile.js` already contains an example build step that demonstrates how
Expand All @@ -77,4 +95,4 @@ e.g. based on the route, or to progressively render non-critical sections of the
application. Each new demand-loaded fragment should be added to the list of
`fragments` in the included `polymer.json` file. This will ensure those
components and their dependencies are added to the list of pre-cached components
and will be included in the `bundled` build.
and will be included in the build.
22 changes: 9 additions & 13 deletions generators/app/package.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
{
"name": "polymer-starter-kit-custom-build",
"version": "0.0.0",
"description": "A starting point for Polymer 1.0 custom build apps",
"license": "BSD-3-Clause",
"scripts": {
"lint": "eslint . --ext js,html --ignore-path .gitignore",
"test": "npm run lint && polymer test",
"build": "gulp build"
},
"devDependencies": {
"del": "^2.2.0",
"eslint": "^3.12.0",
"eslint": "^3.19.0",
"eslint-config-google": "^0.7.0",
"eslint-plugin-html": "^1.7.0",
"eslint-plugin-html": "^2.0.0",
"gulp": "gulpjs/gulp#4.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^3.1.0",
"merge-stream": "^1.0.1",
"polymer-build": "^1.0.0"
},
"engines": {
"node": ">=6.0"
},
"private": true
"scripts": {
"lint": "npm run lint:javascript",
"lint:javascript": "eslint . --ext js,html --ignore-path .gitignore",
"test": "polymer test",
"test:integration": "polymer build # test that psk builds without error with the CLI",
"build": "gulp build"
}
}
2 changes: 1 addition & 1 deletion generators/app/polymer-starter-kit

0 comments on commit fc37646

Please sign in to comment.