Skip to content

Commit fc65109

Browse files
authored
chore: update pnpm to 10.6.5 and eslint to 9.23.0 (#841)
1 parent 53568d0 commit fc65109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2019
-974
lines changed

.github/workflows/cr.yml

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
- uses: pnpm/[email protected]
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: 20
28+
registry-url: https://registry.npmjs.org/
29+
cache: pnpm
2530
- run: pnpm install
2631
- run: pnpm build
2732
- run: pnpx pkg-pr-new publish --compact --no-template --pnpm

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-node@v3
2020
with:
21-
node-version: 18
21+
node-version: 20.17.0
2222

2323
- run: npx changelogithub
2424
env:

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The `vite-plugin-pwa` repo includes a set of examples where you can test the cha
3434
- `pnpm run examples`: select `sveltekit` framework and default options on the cli (you can also test another options)
3535
- `pnpm run examples`: select `solid` framework and default options on the cli (you can also test another options)
3636

37-
> The default options from the `cli` are just to check your changes are not breaking major ui/app frameworks build: `generateSW` strategy, `Prompt for update` behavior and `Enable periodic SW updates` to `no`.
37+
> The default options from the `cli` are just to check your changes are not breaking major ui/app frameworks build: `generateSW` strategy, `Prompt for update` behavior and `Enable periodic SW updates` to `no`.
3838
3939
> If your changes are specific to some behavior, just use the corresponding option on the `cli`.
4040

README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Zero-config PWA Framework-agnostic Plugin for Vite
2727
</a>
2828
</p>
2929

30-
3130
## 🚀 Features
3231

3332
- 📖 [**Documentation & guides**](https://vite-pwa-org.netlify.app/)
@@ -53,12 +52,12 @@ Zero-config PWA Framework-agnostic Plugin for Vite
5352
> From v0.13, `vite-plugin-pwa` requires **Vite 3.1 or above**.
5453
5554
```bash
56-
npm i vite-plugin-pwa -D
55+
npm i vite-plugin-pwa -D
5756

58-
# yarn
57+
# yarn
5958
yarn add vite-plugin-pwa -D
6059

61-
# pnpm
60+
# pnpm
6261
pnpm add vite-plugin-pwa -D
6362
```
6463

@@ -77,7 +76,7 @@ export default {
7776
}
7877
```
7978

80-
Read the [📖 documentation](https://vite-pwa-org.netlify.app/guide/) for a complete guide on how to configure and use
79+
Read the [📖 documentation](https://vite-pwa-org.netlify.app/guide/) for a complete guide on how to configure and use
8180
this plugin.
8281

8382
Check out the client type declarations [client.d.ts](./client.d.ts) for built-in frameworks support.
@@ -89,7 +88,6 @@ Check out the type declaration [src/types.ts](./src/types.ts) and the following
8988
- [Web app manifests](https://developer.mozilla.org/en-US/docs/Web/Manifest)
9089
- [Workbox](https://developers.google.com/web/tools/workbox)
9190

92-
9391
## 📄 License
9492

9593
[MIT](./LICENSE) License &copy; 2020-PRESENT [Anthony Fu](https://github.com/antfu)

eslint.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import antfu from '@antfu/eslint-config'
33
export default await antfu(
44
{
55
ignores: [
6+
'netlify.toml',
67
'**/build/**',
78
'**/dist/**',
9+
'**/docs/**',
810
'**/dev-dist/**',
911
],
1012
},

examples/assets-generator/src/pwa.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { pwaInfo } from 'virtual:pwa-info'
21
import { pwaAssetsHead } from 'virtual:pwa-assets/head'
32
import { pwaAssetsIcons } from 'virtual:pwa-assets/icons'
3+
import { pwaInfo } from 'virtual:pwa-info'
44
import { registerSW } from 'virtual:pwa-register'
55

66
console.log(pwaInfo)

examples/assets-generator/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineConfig } from 'vite'
21
import type { PWAAssetsOptions } from 'vite-plugin-pwa'
2+
import { defineConfig } from 'vite'
33
import { VitePWA } from 'vite-plugin-pwa'
44

55
const pwaAssets: PWAAssetsOptions = process.env.INLINE_PWA_ASSETS

examples/preact-router/src/ReloadPrompt.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import './ReloadPrompt.css'
1+
import { pwaInfo } from 'virtual:pwa-info'
22

33
import { useRegisterSW } from 'virtual:pwa-register/preact'
4-
import { pwaInfo } from 'virtual:pwa-info'
4+
import './ReloadPrompt.css'
55

66
console.log(pwaInfo)
77

@@ -43,17 +43,17 @@ function ReloadPrompt() {
4343
return (
4444
<div className="ReloadPrompt-container">
4545
{ (offlineReady || needRefresh)
46-
&& (
47-
<div className="ReloadPrompt-toast">
48-
<div className="ReloadPrompt-message">
49-
{ offlineReady
50-
? <span>App ready to work offline</span>
51-
: <span>New content available, click on reload button to update.</span>}
46+
&& (
47+
<div className="ReloadPrompt-toast">
48+
<div className="ReloadPrompt-message">
49+
{ offlineReady
50+
? <span>App ready to work offline</span>
51+
: <span>New content available, click on reload button to update.</span>}
52+
</div>
53+
{ needRefresh && <button className="ReloadPrompt-toast-button" onClick={() => updateServiceWorker(true)}>Reload</button> }
54+
<button className="ReloadPrompt-toast-button" onClick={() => close()}>Close</button>
5255
</div>
53-
{ needRefresh && <button className="ReloadPrompt-toast-button" onClick={() => updateServiceWorker(true)}>Reload</button> }
54-
<button className="ReloadPrompt-toast-button" onClick={() => close()}>Close</button>
55-
</div>
56-
)}
56+
)}
5757
<div className="ReloadPrompt-date">{buildDate}</div>
5858
</div>
5959
)

examples/preact-router/src/app.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { Router } from 'preact-router'
22

3-
import ReloadPrompt from './ReloadPrompt'
4-
import Home from './pages/Home'
53
import About from './pages/About'
64
import Hi from './pages/hi/[name]'
5+
import Home from './pages/Home'
6+
import ReloadPrompt from './ReloadPrompt'
77

88
import './App.css'
99

examples/preact-router/src/claims-sw.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
21
import { clientsClaim } from 'workbox-core'
2+
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
33
import { NavigationRoute, registerRoute } from 'workbox-routing'
44

55
declare let self: ServiceWorkerGlobalScope

examples/preact-router/src/pages/Home.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useState } from 'preact/hooks'
21
import { route } from 'preact-router'
2+
import { useState } from 'preact/hooks'
33
import './Home.css'
44

55
function Home() {

examples/preact-router/test/build.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { existsSync, readFileSync } from 'node:fs'
22
import { dirname, resolve } from 'node:path'
3-
import { fileURLToPath } from 'node:url'
43
import process from 'node:process'
4+
import { fileURLToPath } from 'node:url'
55

66
import { describe, expect, it } from 'vitest'
77

@@ -32,13 +32,13 @@ describe('preact: test-build', () => {
3232
const workboxName = resolvePath(_dirname, `../dist/${match?.[1]}.js`)
3333
expect(existsSync(workboxName), `${workboxName} doesn't exist`).toBeTruthy()
3434
const workboxContent = readFileSync(workboxName, 'utf-8')
35-
match = workboxContent.match(/self\['workbox:core:[0-9.]+']/)
35+
match = workboxContent.match(/self\['workbox:core:[0-9.]+'\]/)
3636
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
3737
match = swContent.match(/self\.skipWaiting\(\);?\s*workbox\.clientsClaim\(\)/)
3838
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()
3939
}
4040
else {
41-
match = swContent.match(/self\['workbox:core:[0-9.]+']/)
41+
match = swContent.match(/self\['workbox:core:[0-9.]+'\]/)
4242
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
4343
match = swContent.match(/self\.skipWaiting\(\);?\s*clientsClaim\(\)/)
4444
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()

examples/preact-router/vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
12
import process from 'node:process'
2-
import { defineConfig } from 'vite'
33
import preact from '@preact/preset-vite'
4-
import { VitePWA } from 'vite-plugin-pwa'
5-
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
64
import replace from '@rollup/plugin-replace'
5+
import { defineConfig } from 'vite'
6+
import { VitePWA } from 'vite-plugin-pwa'
77

88
const pwaOptions: Partial<VitePWAOptions> = {
99
mode: 'development',

examples/react-router/src/ReloadPrompt.tsx

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react'
2-
import './ReloadPrompt.css'
2+
import { pwaInfo } from 'virtual:pwa-info'
33

44
import { useRegisterSW } from 'virtual:pwa-register/react'
5-
import { pwaInfo } from 'virtual:pwa-info'
5+
import './ReloadPrompt.css'
66

77
console.log(pwaInfo)
88

@@ -44,17 +44,17 @@ function ReloadPrompt() {
4444
return (
4545
<div className="ReloadPrompt-container">
4646
{ (offlineReady || needRefresh)
47-
&& (
48-
<div className="ReloadPrompt-toast">
49-
<div className="ReloadPrompt-toast-message">
50-
{ offlineReady
51-
? <span>App ready to work offline</span>
52-
: <span>New content available, click on reload button to update.</span>}
47+
&& (
48+
<div className="ReloadPrompt-toast">
49+
<div className="ReloadPrompt-toast-message">
50+
{ offlineReady
51+
? <span>App ready to work offline</span>
52+
: <span>New content available, click on reload button to update.</span>}
53+
</div>
54+
{ needRefresh && <button className="ReloadPrompt-toast-button" onClick={() => updateServiceWorker(true)}>Reload</button> }
55+
<button className="ReloadPrompt-toast-button" onClick={() => close()}>Close</button>
5356
</div>
54-
{ needRefresh && <button className="ReloadPrompt-toast-button" onClick={() => updateServiceWorker(true)}>Reload</button> }
55-
<button className="ReloadPrompt-toast-button" onClick={() => close()}>Close</button>
56-
</div>
57-
)}
57+
)}
5858
<div className="ReloadPrompt-date">{buildDate}</div>
5959
</div>
6060
)

examples/react-router/src/claims-sw.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
21
import { clientsClaim } from 'workbox-core'
2+
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
33
import { NavigationRoute, registerRoute } from 'workbox-routing'
44

55
declare let self: ServiceWorkerGlobalScope

examples/react-router/src/main.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React from 'react'
2-
import { BrowserRouter, Route, Routes } from 'react-router-dom'
32
import { createRoot } from 'react-dom/client'
4-
import './index.css'
3+
import { BrowserRouter, Route, Routes } from 'react-router-dom'
54
import App from './App'
6-
import Home from './pages/Home'
75
import About from './pages/About'
86
import Hi from './pages/hi/[name]'
7+
import Home from './pages/Home'
8+
import './index.css'
99

1010
createRoot(document.getElementById('app')!).render(
1111
<BrowserRouter>

examples/react-router/test/build.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { existsSync, readFileSync } from 'node:fs'
22
import { dirname, resolve } from 'node:path'
3-
import { fileURLToPath } from 'node:url'
43
import process from 'node:process'
4+
import { fileURLToPath } from 'node:url'
55
import { describe, expect, it } from 'vitest'
66

77
const _dirname = typeof __dirname !== 'undefined'
@@ -31,13 +31,13 @@ describe('react: test-build', () => {
3131
const workboxName = resolvePath(_dirname, `../dist/${match?.[1]}.js`)
3232
expect(existsSync(workboxName), `${workboxName} doesn't exist`).toBeTruthy()
3333
const workboxContent = readFileSync(workboxName, 'utf-8')
34-
match = workboxContent.match(/self\['workbox:core:[0-9.]+']/)
34+
match = workboxContent.match(/self\['workbox:core:[0-9.]+'\]/)
3535
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
3636
match = swContent.match(/self\.skipWaiting\(\);?\s*workbox\.clientsClaim\(\)/)
3737
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()
3838
}
3939
else {
40-
match = swContent.match(/self\['workbox:core:[0-9.]+']/)
40+
match = swContent.match(/self\['workbox:core:[0-9.]+'\]/)
4141
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
4242
match = swContent.match(/self\.skipWaiting\(\);?\s*clientsClaim\(\)/)
4343
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()

examples/react-router/vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
12
import process from 'node:process'
2-
import { defineConfig } from 'vite'
3+
import replace from '@rollup/plugin-replace'
34
import react from '@vitejs/plugin-react'
4-
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
5+
import { defineConfig } from 'vite'
56
import { VitePWA } from 'vite-plugin-pwa'
6-
import replace from '@rollup/plugin-replace'
77

88
const pwaOptions: Partial<VitePWAOptions> = {
99
mode: 'development',

examples/solid-router/src/ReloadPrompt.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Component } from 'solid-js'
22
import { Show } from 'solid-js'
3-
import { useRegisterSW } from 'virtual:pwa-register/solid'
43
import { pwaInfo } from 'virtual:pwa-info'
4+
import { useRegisterSW } from 'virtual:pwa-register/solid'
55
import styles from './ReloadPrompt.module.css'
66

77
console.log(pwaInfo)

examples/solid-router/src/app.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { Component } from 'solid-js'
22
import { useRoutes } from '@solidjs/router'
3-
import { routes } from './routes'
43
import styles from './app.module.css'
54
import ReloadPrompt from './ReloadPrompt'
5+
import { routes } from './routes'
66

77
const App: Component = () => {
88
// replaced dynamically

examples/solid-router/src/claims-sw.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
21
import { clientsClaim } from 'workbox-core'
2+
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
33
import { NavigationRoute, registerRoute } from 'workbox-routing'
44

55
declare let self: ServiceWorkerGlobalScope

examples/solid-router/src/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { render } from 'solid-js/web'
21
import { Router } from '@solidjs/router'
2+
import { render } from 'solid-js/web'
33
import App from './app'
44

55
render(

examples/solid-router/src/pages/home.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createSignal } from 'solid-js'
21
import { useNavigate } from '@solidjs/router'
2+
import { createSignal } from 'solid-js'
33
import styles from './home.module.css'
44

55
export default function Home() {

examples/solid-router/src/routes.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { lazy } from 'solid-js'
21
import type { RouteDefinition } from '@solidjs/router'
2+
import { lazy } from 'solid-js'
33

4-
import Home from './pages/home'
54
import HiData from './pages/hi/[name].data'
5+
import Home from './pages/home'
66

77
export const routes: RouteDefinition[] = [
88
{

examples/solid-router/test/build.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { existsSync, readFileSync } from 'node:fs'
22
import { dirname, resolve } from 'node:path'
3-
import { fileURLToPath } from 'node:url'
43
import process from 'node:process'
4+
import { fileURLToPath } from 'node:url'
55
import { describe, expect, it } from 'vitest'
66

77
const _dirname = typeof __dirname !== 'undefined'
@@ -31,13 +31,13 @@ describe('solid: test-build', () => {
3131
const workboxName = resolvePath(_dirname, `../dist/${match?.[1]}.js`)
3232
expect(existsSync(workboxName), `${workboxName} doesn't exist`).toBeTruthy()
3333
const workboxContent = readFileSync(workboxName, 'utf-8')
34-
match = workboxContent.match(/self\['workbox:core:[0-9.]+']/)
34+
match = workboxContent.match(/self\['workbox:core:[0-9.]+'\]/)
3535
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
3636
match = swContent.match(/self\.skipWaiting\(\);?\s*workbox\.clientsClaim\(\)/)
3737
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()
3838
}
3939
else {
40-
match = swContent.match(/self\['workbox:core:[0-9.]+']/)
40+
match = swContent.match(/self\['workbox:core:[0-9.]+'\]/)
4141
expect(match && match.length === 1, 'missing workbox:core module').toBeTruthy()
4242
match = swContent.match(/self\.skipWaiting\(\);?\s*clientsClaim\(\)/)
4343
expect(match && match.length === 1, 'missing self.skipWaiting and clientsClaim workbox calls').toBeTruthy()

examples/solid-router/vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
12
import process from 'node:process'
3+
import replace from '@rollup/plugin-replace'
24
import { defineConfig } from 'vite'
3-
import solidPlugin from 'vite-plugin-solid'
45
import { VitePWA } from 'vite-plugin-pwa'
5-
import type { ManifestOptions, VitePWAOptions } from 'vite-plugin-pwa'
6-
import replace from '@rollup/plugin-replace'
6+
import solidPlugin from 'vite-plugin-solid'
77

88
const pwaOptions: Partial<VitePWAOptions> = {
99
mode: 'development',

examples/svelte-routify/src/claims-sw.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
21
import { clientsClaim } from 'workbox-core'
2+
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
33
import { NavigationRoute, registerRoute } from 'workbox-routing'
44

55
declare let self: ServiceWorkerGlobalScope

0 commit comments

Comments
 (0)