Skip to content

Commit

Permalink
Improve the PWA build and make sure things work offline
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmyersdev committed Dec 31, 2023
1 parent 7680c3e commit c642f4b
Show file tree
Hide file tree
Showing 9 changed files with 1,965 additions and 2,574 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -61,11 +61,11 @@ jobs:
- name: Setup pnpm cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-v2
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: v1-${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --shamefully-hoist
lint:
Expand All @@ -78,7 +78,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -91,11 +91,11 @@ jobs:
- name: Setup pnpm cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-v2
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: v1-${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --shamefully-hoist
- name: Run linter
Expand All @@ -110,7 +110,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -123,11 +123,11 @@ jobs:
- name: Setup pnpm cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-v2
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: v1-${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --shamefully-hoist
- uses: cypress-io/github-action@v6.5.0
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -172,11 +172,11 @@ jobs:
- name: Setup pnpm cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-v2
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: v1-${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --shamefully-hoist
- run: pnpm nuxi prepare
Expand All @@ -191,7 +191,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -204,11 +204,11 @@ jobs:
- name: Setup pnpm cache
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}-v2
key: v1-${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
path: |
${{ env.STORE_PATH }}
~/.cache/Cypress
restore-keys: ${{ runner.os }}-pnpm-store-
restore-keys: v1-${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --shamefully-hoist
- run: pnpm nuxi prepare
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- run: pnpm install --shamefully-hoist
- run: pnpm vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- run: pnpm vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18
- uses: pnpm/action-setup@v2
with:
version: 8
run_install: false
- run: pnpm install --shamefully-hoist
- run: pnpm vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- run: pnpm vercel build --token=${{ secrets.VERCEL_TOKEN }}
Expand Down
9 changes: 0 additions & 9 deletions manifest.ts

This file was deleted.

4 changes: 2 additions & 2 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export default defineNuxtConfig({
host: '127.0.0.1',
},
experimental: {
// Todo: Does not respect port provided with `nuxi dev --port`
// viteNode: true,
appManifest: true,
payloadExtraction: true,
},
hooks: {
'pages:extend': (pages) => {
Expand Down
25 changes: 14 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "octo",
"type": "module",
"private": true,
"packageManager": "pnpm@8.6.6",
"author": "David R. Myers <hello@davidmyers.dev>",
"funding": "https://github.com/sponsors/davidmyersdev",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt prepare && nuxt typecheck && tsx manifest.ts && nuxt generate",
"build": "nuxt prepare && nuxt typecheck && nuxt generate",
"clean": "rimraf .output dev-dist dist",
"dev": "nuxt dev --port 8888",
"firebase:login": "firebase login",
Expand Down Expand Up @@ -52,19 +53,19 @@
},
"devDependencies": {
"@heroicons/vue": "^2.0.18",
"@nuxtjs/tailwindcss": "^6.8.1",
"@nuxtjs/tailwindcss": "^6.10.3",
"@pinia/nuxt": "^0.4.11",
"@tailwindcss/typography": "^0.5.10",
"@types/file-saver": "^2.0.6",
"@types/mime-types": "^2.1.3",
"@types/node": "^18.18.7",
"@types/remarkable": "^2.0.7",
"@vite-pwa/nuxt": "^0.0.4",
"@vite-pwa/nuxt": "^0.4.0",
"@vue/test-utils": "^2.4.1",
"@vueuse/core": "^10.5.0",
"@vueuse/core": "^10.7.1",
"@vueuse/head": "^1.3.1",
"@vueuse/nuxt": "^9.13.0",
"@vueuse/rxjs": "^10.5.0",
"@vueuse/rxjs": "^10.7.1",
"autoprefixer": "^10.4.16",
"cypress": "^13.3.3",
"cypress-network-idle": "^1.14.2",
Expand All @@ -76,17 +77,15 @@
"happy-dom": "^12.9.1",
"micromark": "^3.1.0",
"npm-run-all": "^4.1.5",
"nuxt": "^3.8.0",
"nuxt": "^3.9.0",
"postcss": "^8.4.31",
"remarkable-front-matter": "1.0.1-beta.1",
"rimraf": "^4.4.1",
"serve": "^14.2.1",
"tailwindcss": "^3.3.5",
"tsx": "^3.14.0",
"typescript": "^5.2.2",
"vercel": "^28.20.0",
"vite-plugin-node-polyfills": "^0.14.1",
"vite-plugin-pwa": "^0.14.7",
"vite-svg-loader": "^3.6.0",
"vitest": "^0.34.6",
"vue-tsc": "^1.8.21",
Expand All @@ -110,7 +109,11 @@
"default": "./test/utils/*"
}
},
"packageManager": "pnpm@8.6.6",
"pnpm": {
"overrides": {
"vite": "^5.0.0"
}
},
"resolutions": {
"terser": "^5.14.2"
}
Expand Down
Loading

0 comments on commit c642f4b

Please sign in to comment.