forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps) & feat: support Next's new logging style, added `PluginOp…
…tions.browserslist` (#84)
- Loading branch information
Showing
44 changed files
with
1,163 additions
and
1,006 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,9 @@ | ||
--- | ||
"@ducanh2912/next-pwa": minor | ||
--- | ||
|
||
feat: added `PluginOptions.browserslist` | ||
|
||
- This defaults to `"chrome >= 56"`, same with Workbox's default. | ||
- Note that `.browserslistrc`, `package.json.browserslist`, etc. are not supported (yet), and the only way to pass the config to `next-pwa` is `PluginOptions.browserslist`, but you can read the file yourself, parse it, then pass it to `next-pwa`. | ||
- This allows you to configure which browsers you want to target your workers for. This tells `next-pwa` to add `PluginOptions.workboxOptions.babelPresetEnvTargets` if that option is not defined, which means that the service worker will, too, be bundled to target these browsers, but you can change that by adding the option. |
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,7 @@ | ||
--- | ||
"@ducanh2912/next-pwa": minor | ||
--- | ||
|
||
feat: support Next's new logging style | ||
|
||
- So Next changed its logging style again, and I'm wondering if trying to match its logging style is even a good idea. |
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
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
File renamed without changes.
5 changes: 1 addition & 4 deletions
5
examples/basic/app/appdir/about/page.tsx → examples/basic/app/about/page.tsx
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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,54 @@ | ||
import type { Metadata } from "next"; | ||
import type { ReactNode } from "react"; | ||
|
||
import { PWALifeCycle } from "../components/PWALifecycle"; | ||
|
||
const APP_NAME = "next-pwa example"; | ||
const APP_DESCRIPTION = "This is an example of using next-pwa"; | ||
|
||
export const metadata: Metadata = { | ||
applicationName: APP_NAME, | ||
title: { | ||
default: APP_NAME, | ||
template: "%s - PWA App", | ||
}, | ||
description: APP_DESCRIPTION, | ||
manifest: "/manifest.json", | ||
themeColor: "#FFFFFF", | ||
appleWebApp: { | ||
capable: true, | ||
statusBarStyle: "default", | ||
title: APP_NAME, | ||
}, | ||
formatDetection: { | ||
telephone: false, | ||
}, | ||
icons: { | ||
shortcut: "/favicon.ico", | ||
apple: [{ url: "/icons/apple-touch-icon.png", sizes: "180x180" }], | ||
}, | ||
}; | ||
|
||
export default function RootLayout({ children }: { children: ReactNode }) { | ||
return ( | ||
<html lang="en" dir="ltr"> | ||
<head> | ||
<style>{` | ||
html, body, #__next { | ||
height: 100%; | ||
} | ||
#__next { | ||
margin: 0 auto; | ||
} | ||
h1 { | ||
text-align: center; | ||
} | ||
`}</style> | ||
</head> | ||
<body> | ||
<PWALifeCycle /> | ||
{children} | ||
</body> | ||
</html> | ||
); | ||
} |
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 @@ | ||
import type { Metadata } from "next"; | ||
|
||
export const metadata: Metadata = { | ||
title: "next-pwa example", | ||
}; | ||
|
||
export default function Page() { | ||
return ( | ||
<> | ||
<h1>Next.js + PWA = AWESOME!!</h1> | ||
</> | ||
); | ||
} |
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
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
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
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,12 @@ | ||
import Head from "next/head"; | ||
|
||
export default function Index() { | ||
return ( | ||
<> | ||
<Head> | ||
<title>next-pwa example</title> | ||
</Head> | ||
<h1>Next.js + PWA = AWESOME!!</h1> | ||
</> | ||
); | ||
} |
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
Oops, something went wrong.