Need help with typescript-progressive-quickstart?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

192 Stars 5 Forks Other 5 Commits 1 Opened issues


TypeScript Progressive Web App Quickstart

Services available


Need anything else?

Contributors list

No Data

TypeScript Progressive Web App

This is a bootstrap for a TypeScript Progressive Web App.

Service workers are auto generated. Note that you will need to click "Update on reload" in the Application tab of Chrome Dev Tools to get the latest code on each refresh.

BrowserSync is integrated to automatically detect changes and trigger browser reloads.

This is not the ideal setup for your application, but simply a bootstrap to get started quickly.

This was built on top of existing code from the Angular 2 Quickstart repo (

To get started, clone the repo and run

npm start
. Chokidar will detect changes and regenerate service workers using sw-precache.


Get it now if it's not already installed on your machine.

Verify that you are running at least node

and npm
by running

node -v
npm -v
in a terminal/console window. Older versions produce errors.

We recommend nvm for managing multiple versions of node and npm.

Create a new project based on the QuickStart

Clone this repo into new project folder (e.g.,

git clone  my-proj
cd my-proj

Discard the

rm -rf .git  # OS/X (bash)
rd .git /S/Q # windows

Delete non-essential files (optional)

You can quickly delete the non-essential files that concern testing and QuickStart repository maintenance (including all git-related artifacts such as the

folder and
!) by entering the following commands while in the project folder:
OS/X (bash)
xargs rm -rf < non-essential-files.osx.txt
rm src/app/*.spec*.ts
rm non-essential-files.osx.txt
for /f %i in (non-essential-files.txt) do del %i /F /S /Q
rd .git /s /q
rd e2e /s /q

Create a new git repo

You could start writing code now and throw it all away when you're done. If you'd rather preserve your work under source control, consider taking the following steps.

Initialize this project as a local git repo and make the first commit:

git init
git add .
git commit -m "Initial commit"

Recover the deleted

from the QuickStart repository if you lost it in the Delete non-essential files step.

Create a remote repository for this project on the service of your choice.

Grab its address (e.g.
) and push the local repo to the remote.

git remote add origin 
git push -u origin master

Install npm packages

See npm and nvm version notes above

Install the npm packages described in the

and verify that it works:
npm install
npm start

Doesn't work in Bash for Windows which does not support servers as of January, 2017.


npm start
command first compiles the application, then simultaneously re-compiles and runs the
. Both the compiler and the server watch for file changes.

Shut it down manually with


You're ready to write your application.

npm scripts

We've captured many of the most useful commands in npm scripts defined in the

  • npm start
    - runs the compiler and a server at the same time, both in "watch mode".
  • npm run build
    - runs the TypeScript compiler once and generates a service worker
  • npm run build:w
    - runs the TypeScript compiler in watch mode; the process keeps running, awaiting changes to TypeScript files and re-compiling when it sees them. The service worker is automatically regenerated as each cacheable asset changes.
  • npm run serve
    - runs the lite-server, a light-weight, static file server, written and maintained by John Papa and Christopher Martin with excellent support for Angular apps that use routing.

Here are the test related scripts: *

npm test
- compiles, runs and watches the karma unit tests *
npm run e2e
- compiles and run protractor e2e tests, written in Typescript (*e2e-spec.ts)


The QuickStart documentation doesn't discuss testing. This repo adds both karma/jasmine unit test and protractor end-to-end testing support.

These tools are configured for specific conventions described below.

It is unwise and rarely possible to run the application, the unit tests, and the e2e tests at the same time. We recommend that you shut down one before starting another.

Unit Tests

TypeScript unit-tests are usually in the

folder. Their filenames must end in

Look for the example

. Add more
files as you wish; we configured karma to find them.

Run it with

npm test

That command first compiles the application, then simultaneously re-compiles and runs the karma test-runner. Both the compiler and the karma watch for (different) file changes.

Shut it down manually with


Test-runner output appears in the terminal window. We can update our app and our tests in real-time, keeping a weather eye on the console for broken tests. Karma is occasionally confused and it is often necessary to shut down its browser or even shut the command down (

) and restart it. No worries; it's pretty quick.

End-to-end (E2E) Tests

E2E tests are in the

directory, side by side with the
folder. Their filenames must end in

Look for the example

. Add more
files as you wish (although one usually suffices for small projects); we configured Protractor to find them.

Thereafter, run them with

npm run e2e

That command first compiles, then simultaneously starts the

and launches Protractor.

The pass/fail test results appear at the bottom of the terminal window. A custom reporter (see

) generates a
file which is easier to read; this file is excluded from source control.

Shut it down manually with


We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.