Giter VIP home page Giter VIP logo

pwabuilder's Introduction

PWABuilder

Built with the PWABuilder PWA Starter

Welcome to PWABuilder v3.0! Read our launch blog here for all the details!

Try It

Want to help us build PWABuilder? Check out the info below and our developer's wiki to get started!

Prerequisites

You will need the following things properly installed on your computer.

You should also be familiar with TypeScript which we use for this project. This helps give you more guidance as you code from intellisense when using VSCode.

Recommended Development setup

We recommend the following tools for your dev setup:

Additionally, when you open the project in VS Code, you'll be prompted to install recommended extensions.

Development

Run npm install and then run npm run dev, the project should open in your default browser. From here you can start developing, your changes will be rebuilt and reloaded in the browser as you develop.

Running Tests

We currently have E2E tests that are run using the Playwright test-runner. Currently they can be run by running the following commands:

  • npm run dev (We are going to run the E2E tests on your latest local changes)
  • npm run test (This will make sure the needed dependences are installed and will start running the tests)

The output of the tests can be found in the console.

Notes

  • If a test fails it will retry twice. The reason this is needed is our tests are relying on network requests, of which many are happening at once as tests run which can cause false positives.
  • Playwright spins up workers for tests to try to spread the load on your CPU and avoid false positives. I have set this to 2 when running in a CI (recommended), when running locally it will use your number of CPU cores - 1. So on a Surface Pro X with 8 cores it will attempt to spin up 7 workers.
  • I have also set a timeout of a minute for each test.

Debugging in VS Code

In VS Code, install Debugger for Microsoft Edge extension.

In VSCode, set a breakpoint in a TypeScript file. Then press F5 to launch debugging.

Building for Production

Run npm run build, the dist/ folder will contain your built PWA. The production build will also generate a pre-caching service worker using Workbox.

Folder Structure

PWABuilder
│   README.md (docs)
│   rollup.config.js (bundler config https://rollupjs.org/)
|   tsconfig.json (TypeScript config https://www.typescriptlang.org/)
|   pwabuilder-sw.js (Service Worker https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API)
|   package.json (https://docs.npmjs.com/creating-a-package-json-file)
|   package-lock.json (https://docs.npmjs.com/files/package-lock.json)
|   manifest.json (web manifest https://developer.mozilla.org/en-US/docs/Web/Manifest)
|   index.prod.html (index.html file used for production builds)
|   index.html (index.html for dev builds)
|   *note*: The index.prod.html registers a service worker which caches assets, so index.html is used for dev builds
|   .gitignore (git config file https://git-scm.com/docs/gitignore)
│
└───src (most of your development will happen here)
│   │   global.css (used for global CSS styles and CSS variables)
│   │
│   └───script
│       │
│       |
|       └───components
|           |   header.ts (header component)
|           |   more components
|       |
|       |
|       └───pages
|           |   app-index.ts (app-index component)
|           |   app-home.ts (app-home component)
|           |   app-about.ts (app-about component)
|           |   more pages

pwabuilder's People

Contributors

jgw96 avatar lee-leonardo avatar ckgrafico avatar judahgabriel avatar boyofgreen avatar ryanbillingsley avatar ff4500 avatar streetalchemist avatar nsbingham avatar lukealvarez avatar davrous avatar michael-hawker avatar gerardlopez avatar tesheg avatar ejadib avatar jaylyn-barbee avatar rumsha7 avatar ihpannu avatar juanar avatar dependabot[bot] avatar alexkryzh avatar marcerodriguez avatar rnrneverdies avatar maraah1 avatar peterblazejewicz avatar spertusatti avatar kyaa-dost avatar joel-44 avatar mccoykillian avatar kbrons avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.