generated from pwa-builder/pwa-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fe8e879
Showing
49 changed files
with
8,292 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,52 @@ | ||
name: Deploy PWA Starter to GitHub Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '16.13' | ||
|
||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Rewrite Manifest Path in Index | ||
run: sed -i 's@/manifest.json@${{ github.event.repository.name }}/manifest.json@g' ./index.html && cat index.html | ||
|
||
- name: Rewrite Service Worker Path in Index | ||
run: sed -i 's@/sw.js@${{ github.event.repository.name }}/sw.js@g' ./index.html && cat ./index.html | ||
|
||
- name: Replace Paths in Manifest | ||
run: sed -i 's@"/"@"/${{ github.event.repository.name }}/"@g' ./public/manifest.json && cat ./public/manifest.json | ||
|
||
- name: Vite Build | ||
run: npm run build -- --base=${{ github.event.repository.name }} | ||
|
||
- name: Redirect 404 to Index for SPA | ||
run: cp dist/index.html dist/404.html | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: dist/ | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
uses: actions/deploy-pages@v1 |
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,8 @@ | ||
.DS_Store | ||
node_modules | ||
dist | ||
dev-dist | ||
build | ||
types | ||
.idea | ||
.github |
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,8 @@ | ||
{ | ||
"recommendations": [ | ||
"eg2.vscode-npm-script", | ||
"christian-kohler.npm-intellisense", | ||
"ms-edgedevtools.vscode-edge-devtools", | ||
"PWABuilder.pwa-studio" | ||
] | ||
} |
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,29 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "pwa-msedge", | ||
"request": "launch", | ||
"name": "Run PWA", | ||
"webRoot": "${workspaceFolder}/", | ||
"runtimeArgs": [ | ||
"--app=http://localhost:5173" | ||
], | ||
"sourceMapPathOverrides": { | ||
"../../src": "${workspaceFolder}/src", | ||
"../../src/*": "${workspaceFolder}/src/*" | ||
}, | ||
"preLaunchTask": "npm run dev-task", | ||
"postDebugTask": "postdebugKill" | ||
}, | ||
{ | ||
"name": "Launch Microsoft Edge and open the Edge DevTools", | ||
"request": "launch", | ||
"type": "vscode-edge-devtools.debug", | ||
"url": "" // Provide your project's url to finish configuring | ||
} | ||
] | ||
} |
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,9 @@ | ||
{ | ||
"files.trimTrailingWhitespace": true, | ||
"markdownlint.config": { | ||
"MD028": false, | ||
"MD025": { | ||
"front_matter_title": "" | ||
} | ||
}, | ||
} |
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,36 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "npm run dev-task", | ||
"type": "npm", | ||
"script": "dev-task", | ||
"isBackground": true, | ||
"problemMatcher": { | ||
"owner": "custom", | ||
"pattern": { | ||
"regexp": "^$" | ||
}, | ||
"background": { | ||
"activeOnStart": true, | ||
"beginsPattern": ".*", | ||
"endsPattern": "ready in .+" | ||
} | ||
}, | ||
}, | ||
{ | ||
"label": "postdebugKill", | ||
"command": "echo ${input:terminate}", | ||
"type": "shell", | ||
"problemMatcher": [] | ||
}, | ||
], | ||
"inputs": [ | ||
{ | ||
"id": "terminate", | ||
"type": "command", | ||
"command": "workbench.action.tasks.terminate", | ||
"args": "npm run dev-task" | ||
} | ||
] | ||
} |
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 @@ | ||
ManifoldJS | ||
|
||
Copyright (c) Microsoft Corporation | ||
|
||
All rights reserved. | ||
|
||
MIT License | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,15 @@ | ||
[Documentation](https://docs.pwabuilder.com/#/starter/quick-start) | ||
|
||
The PWABuilder pwa-starter is our opinionated, best practices, production tested starter that we use to build all of our PWAs, including [PWABuilder itself](https://blog.pwabuilder.com/posts/introducing-the-brand-new-pwa-builder/)! The pwa-starter is a starter codebase, just like create-react-app or the Angular CLI can generate, that uses the PWABuilder team's preferred front-end tech stack. | ||
|
||
[![Get started with the pwa-starter!](https://img.youtube.com/vi/u3pWKpmic_k/0.jpg)](https://www.youtube.com/watch?v=u3pWKpmic_k) | ||
|
||
With it you get an app that: | ||
- Has no build system to set up and no boilerplate code to add. Everything is included out of the box. | ||
- Has a Service Worker system using [Workbox](https://developers.google.com/web/tools/workbox/) | ||
- Scores close to 100 on Lighthouse out of the box | ||
- Has everything needed to be installable in the browser | ||
- Is ready to be package for the app stores using [PWABuilder](https://www.pwabuilder.com) | ||
- Uses the [Azure Static Web Apps CLI](https://azure.github.io/static-web-apps-cli) which enables emulating your production environment locally, and gets you ready for deploying to Azure Static Web Apps! | ||
|
||
and all with just a few button clicks 😊. |
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,55 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>PWA Starter</title> | ||
|
||
<base href="/" /> | ||
|
||
<!-- This meta viewport ensures the webpage's dimensions change according to the device it's on. This is called Responsive Web Design.--> | ||
<meta name="viewport" | ||
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" /> | ||
<meta name="description" content="This is a PWA Starter app" /> | ||
|
||
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#181818" /> | ||
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#f3f3f3" /> | ||
|
||
<!-- These meta tags are Apple-specific, and set the web application to run in full-screen mode with a black status bar. Learn more at https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html--> | ||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<meta name="apple-mobile-web-app-title" content="PWA Starter" /> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
|
||
<!-- This tag is used by the PWA Starter CLI to identify template projects. Don't remove if you are using the CLI. --> | ||
<meta name="pwa-starter-template-identity" content="pwa-starter"/> | ||
|
||
<!-- Imports an icon to represent the document. --> | ||
<link rel="icon" href="/assets/icons/icon_24.png" type="image/png" /> | ||
|
||
<!-- Imports the manifest to represent the web application. A web app must have a manifest to be a PWA. --> | ||
<link rel="manifest" href="/manifest.json" /> | ||
|
||
<!-- light mode and dark mode CSS --> | ||
<link rel="stylesheet" media="(prefers-color-scheme:light)" | ||
href="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/themes/light.css"> | ||
<link rel="stylesheet" media="(prefers-color-scheme:dark)" | ||
href="https://cdn.jsdelivr.net/npm/@shoelace-style/[email protected]/dist/themes/dark.css" | ||
onload="document.documentElement.classList.add('sl-theme-dark');"> | ||
|
||
<script type="module" src="/src/app-index.ts"></script> | ||
</head> | ||
|
||
<body> | ||
<!-- Our app-index web component. This component is defined in src/pages/app-index.ts--> | ||
<app-index></app-index> | ||
|
||
<script> | ||
if ('serviceWorker' in navigator) { | ||
navigator.serviceWorker.register( | ||
'/sw.js' | ||
); | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.