Skip to content

Commit

Permalink
feat!: support Vite 5 (#26)
Browse files Browse the repository at this point in the history
* feat!: support Vite 5

* chore: align with VP, ESM only

* chore: lint

* chore: bump to pnpm 8.10.5

* chore: normalize assetsDirs

* chore: cleanup

* chore: apply suggestions

* chore: bump to latest VP and PWA plugin

* chore: apply suggestion

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>

---------

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
userquin and brc-dd committed Nov 18, 2023
1 parent 81bcd74 commit 7f51f7b
Show file tree
Hide file tree
Showing 14 changed files with 1,005 additions and 642 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ Zero-config PWA Plugin for VitePress

## 📦 Install

> Requires Vite 3.1.0+
> From v0.3`, `@vite-pwa/vitepress` requires **Vite 5** and **VitePress 1.0.0-rc.26 or above**.
> Using any version older than v0.3 requires Vite 3.1.0+.
```bash
npm i @vite-pwa/vitepress -D
Expand All @@ -59,7 +61,7 @@ pnpm add @vite-pwa/vitepress -D

## 🦄 Usage

You will need wrap your VitePress config with `withPwa`:
You will need to wrap your VitePress config with `withPwa`:

```ts
// .vitepress/config.ts
Expand Down
2 changes: 2 additions & 0 deletions examples/pwa-prompt/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export default withPwa(defineConfig({
__DATE__: `'${new Date().toISOString()}'`,
},
},
// for testing purposes
assetsDir: './assets/ja',
lang: 'en-US',
title: 'VitePress PWA',
description: 'Vite Plugin PWA Integration example for VitePress',
Expand Down
6 changes: 3 additions & 3 deletions examples/pwa-prompt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"https": "nr build && serve .vitepress/dist"
},
"dependencies": {
"vue": "^3.3.4"
"vue": "^3.3.8"
},
"devDependencies": {
"@vite-pwa/vitepress": "workspace:*",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue": "^4.5.0",
"https-localhost": "^4.7.1",
"typescript": "^5.1.3",
"typescript": "^5.2.2",
"workbox-window": "^7.0.0"
}
}
20 changes: 10 additions & 10 deletions examples/pwa-prompt/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "esnext",
"incremental": false,
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"module": "esnext",
"moduleResolution": "node",
"noUnusedLocals": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"types": [
"vite/client",
"vitepress",
"vite-plugin-pwa/client"
]
],
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"skipLibCheck": true
},
"include": [
"./*.ts",
Expand Down
2 changes: 1 addition & 1 deletion examples/pwa-simple-sw/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"@vite-pwa/vitepress": "workspace:*",
"https-localhost": "^4.7.1",
"typescript": "^5.1.3"
"typescript": "^5.2.2"
}
}
20 changes: 10 additions & 10 deletions examples/pwa-simple-sw/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "esnext",
"incremental": false,
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"module": "esnext",
"moduleResolution": "node",
"noUnusedLocals": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"types": [
"vite/client",
"vitepress",
"@vite-pwa/vitepress"
]
],
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"skipLibCheck": true
},
"include": [
"./*.ts",
Expand Down
2 changes: 1 addition & 1 deletion examples/pwa-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"devDependencies": {
"@vite-pwa/vitepress": "workspace:*",
"https-localhost": "^4.7.1",
"typescript": "^5.1.3"
"typescript": "^5.2.2"
}
}
20 changes: 10 additions & 10 deletions examples/pwa-simple/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"compilerOptions": {
"baseUrl": ".",
"module": "esnext",
"incremental": false,
"target": "ESNext",
"lib": ["DOM", "ESNext"],
"strict": true,
"esModuleInterop": true,
"incremental": false,
"skipLibCheck": true,
"module": "esnext",
"moduleResolution": "node",
"noUnusedLocals": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"baseUrl": ".",
"types": [
"vite/client",
"vitepress",
"@vite-pwa/vitepress"
]
],
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"skipLibCheck": true
},
"include": [
"./*.ts",
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@vite-pwa/vitepress",
"type": "module",
"version": "0.2.3",
"packageManager": "pnpm@8.10.3",
"packageManager": "pnpm@8.10.5",
"description": "Zero-config PWA for VitePress",
"author": "antfu <anthonyfu117@hotmail.com>",
"license": "MIT",
Expand All @@ -23,12 +23,11 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"default": "./dist/index.mjs"
},
"./dist/*": "./dist/*"
},
"main": "dist/index.cjs",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
Expand All @@ -43,21 +42,21 @@
"release": "bumpp && npm publish"
},
"peerDependencies": {
"vite-plugin-pwa": ">=0.16.5 <1"
"vite-plugin-pwa": ">=0.17.0 <1"
},
"devDependencies": {
"@antfu/eslint-config": "^0.41.0",
"@antfu/ni": "^0.21.8",
"@types/debug": "^4.1.8",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@antfu/eslint-config": "^0.43.1",
"@antfu/ni": "^0.21.9",
"@types/debug": "^4.1.12",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"bumpp": "^9.2.0",
"eslint": "^8.49.0",
"eslint": "^8.54.0",
"https-localhost": "^4.7.1",
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"vite": "^4.4.9",
"vite-plugin-pwa": ">=0.16.5 <1",
"vitepress": "1.0.0-beta.3"
"vite": "^5.0.0",
"vite-plugin-pwa": ">=0.17.0 <1",
"vitepress": "1.0.0-rc.28"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
Loading

0 comments on commit 7f51f7b

Please sign in to comment.