diff --git a/.changeset/config.json b/.changeset/config.json index f1cb0630..5e8958df 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -10,5 +10,5 @@ "access": "public", "baseBranch": "master", "updateInternalDependencies": "patch", - "ignore": ["@next-pwa-example/*", "tests-utils", "next-pwa-tests", "docs"] + "ignore": ["@next-pwa-example/*", "next-pwa-tests", "docs"] } diff --git a/.changeset/soft-ears-leave.md b/.changeset/soft-ears-leave.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/soft-ears-leave.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a26b8f71..58ac593c 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -81,7 +81,6 @@ module.exports = { "import/internal-regex": "^@ducanh2912/", "import/external-module-folders": [ "packages/next-pwa", - "packages/next-sw", "packages/utils", "packages/constants", "node_modules", diff --git a/.github/ISSUE_TEMPLATE/1-bug-next-sw.yaml b/.github/ISSUE_TEMPLATE/1-bug-next-sw.yaml deleted file mode 100644 index 855f8436..00000000 --- a/.github/ISSUE_TEMPLATE/1-bug-next-sw.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Bug report for `next-sw` -description: Create a bug report for `@ducanh2912/next-sw`. -title: "[Bug - next-sw]: " -labels: ["bug", "next-sw", "triage"] -assignees: - - DuCanhGH -body: - - type: markdown - attributes: - value: Note that `@ducanh2912/next-sw` is NOT yet stable and recommended for use. - - type: textarea - attributes: - label: Provide environment information - description: Please provide the version of `next` and `@ducanh2912/next-sw` that you are currently using. - validations: - required: true - - type: input - attributes: - label: Link to reproduction - Issues with a link to complete (but minimal) reproduction code help us address them faster - description: A link to a GitHub repository, a [StackBlitz](https://stackblitz.com/fork/github/vercel/next.js/tree/canary/examples/reproduction-template), or a [CodeSandbox](https://codesandbox.io/s/github/vercel/next.js/tree/canary/examples/reproduction-template) minimal reproduction. Minimal reproductions should be created from Next.js's [bug report template with `npx create-next-app -e reproduction-template`](https://github.com/vercel/next.js/tree/canary/examples/reproduction-template) and should include only changes that contribute to the issue. - validations: - required: true - - type: textarea - attributes: - label: To reproduce - description: Steps to reproduce the behavior, please provide a clear description of how to reproduce the issue, based on the linked minimal reproduction. If you are using code blocks, make sure that [syntax highlighting is correct](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks#syntax-highlighting) and double check that the rendered preview is not broken. - validations: - required: true - - type: textarea - attributes: - label: Describe the bug - description: A clear and concise description of what the bug is. - validations: - required: true - - type: textarea - attributes: - label: Expected behavior - description: A clear and concise description of what you expected to happen. - validations: - required: true - - type: markdown - attributes: - value: Before posting the issue go through the steps you've written down to make sure the steps provided are detailed and clear. - - type: textarea - attributes: - label: Screenshots (if relevant) - description: Please also provide some screenshots if you can :) Thanks! - - type: textarea - attributes: - label: Additional information (if relevant) - description: Please also provide some additional information about the issue if you can :) Thanks! diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.yaml b/.github/ISSUE_TEMPLATE/1-feature-request.yaml similarity index 79% rename from .github/ISSUE_TEMPLATE/2-feature-request.yaml rename to .github/ISSUE_TEMPLATE/1-feature-request.yaml index 1161683c..e7b35261 100644 --- a/.github/ISSUE_TEMPLATE/2-feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/1-feature-request.yaml @@ -10,17 +10,7 @@ body: value: Thanks for taking the time to file a feature request! Please fill out this form as completely as possible. - type: markdown attributes: - value: 'Feature requests will be converted to the GitHub Discussions "Ideas" section.' - - type: dropdown - id: project - attributes: - multiple: false - label: Which project is this feature idea for? - options: - - "@ducanh2912/next-pwa" - - "@ducanh2912/next-sw" - validations: - required: true + value: 'Feature requests will be converted to the GitHub Discussions "Ideas" section when suitable.' - type: textarea attributes: label: Describe the feature you'd like to request diff --git a/.github/ISSUE_TEMPLATE/3-docs.yaml b/.github/ISSUE_TEMPLATE/2-docs.yaml similarity index 81% rename from .github/ISSUE_TEMPLATE/3-docs.yaml rename to .github/ISSUE_TEMPLATE/2-docs.yaml index 6d87c52c..1ea5869f 100644 --- a/.github/ISSUE_TEMPLATE/3-docs.yaml +++ b/.github/ISSUE_TEMPLATE/2-docs.yaml @@ -8,17 +8,9 @@ body: - type: textarea attributes: label: Provide environment information - description: Please provide the version of `next` and `@ducanh2912/next-pwa`/`@ducanh2912/next-sw` that you are currently using. + description: Please provide the version of `next` and `@ducanh2912/next-pwa` that you are currently using. validations: required: true - - type: dropdown - id: project - attributes: - multiple: false - label: Whose documentation is this feedback for? - options: - - "@ducanh2912/next-pwa" - - "@ducanh2912/next-sw" - type: textarea attributes: label: Describe the problem diff --git a/.prettierignore b/.prettierignore index effa0bd3..3320363c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -42,9 +42,6 @@ coverage/ .DS_Store *.pem -*.css -*.json - .vercel/ **/public/workbox** @@ -56,5 +53,5 @@ coverage/ # other files LICENSE CODE_OF_CONDUCT.md -*.css -*.json \ No newline at end of file + +tsconfig.json \ No newline at end of file diff --git a/README.md b/README.md index f7982a28..66dd5c6d 120000 --- a/README.md +++ b/README.md @@ -1 +1 @@ -packages/next-pwa/README.md +./packages/next-pwa/README.md \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index a12db182..3b85fc29 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -This is the documentation for DuCanh's `next-pwa` and `next-sw`! +This is the documentation for DuCanh's PWA suite! ## Getting started diff --git a/docs/content/index.mdx b/docs/content/index.mdx index 8b1fa838..1086ded8 100644 --- a/docs/content/index.mdx +++ b/docs/content/index.mdx @@ -5,18 +5,9 @@ type: Docs # Welcome to DuCanh's PWA suite for Next.js! -## Variants +Take a look around: -- There are two different variants of this plugin: - - - [`next-pwa`](/docs/next-pwa/getting-started) - - [`next-sw` (not stable)](/docs/next-sw) - -## What's the difference between these two? - -- `next-pwa` is a stable package, which makes use of Workbox to generate the service worker for you. Many available - configurations are inherited from it. This is the recommended option if you are not sure. -- `next-sw` is NOT stable, and is built from ground up. This one is more limited and lightweight. +- [`next-pwa`](/docs/next-pwa/getting-started) ## What's the plan for the future? diff --git a/docs/content/next-sw/index.mdx b/docs/content/next-sw/index.mdx deleted file mode 100644 index f35623a8..00000000 --- a/docs/content/next-sw/index.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: next-sw -type: Docs ---- - -# Welcome to `next-sw`! - -Docs is WIP. diff --git a/docs/package.json b/docs/package.json index 70e3ffb9..b98415d5 100644 --- a/docs/package.json +++ b/docs/package.json @@ -10,13 +10,13 @@ }, "dependencies": { "@ducanh2912/next-pwa": "workspace:*", - "@mantine/hooks": "7.1.2", + "@mantine/hooks": "7.1.3", "@tabler/icons-react": "2.39.0", "bright": "0.8.4", "client-only": "0.0.1", "contentlayer": "0.3.4", "highlight.js": "11.9.0", - "next": "13.5.4", + "next": "13.5.5", "next-contentlayer": "0.3.4", "react": "18.2.0", "react-dom": "18.2.0", @@ -27,11 +27,11 @@ "zustand": "4.4.3" }, "devDependencies": { - "@types/extend": "3.0.2", - "@types/hast": "3.0.1", - "@types/mdast": "4.0.1", + "@types/extend": "3.0.3", + "@types/hast": "3.0.2", + "@types/mdast": "4.0.2", "@types/mdx": "2.0.8", - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "@types/uuid": "9.0.5", @@ -49,7 +49,7 @@ "rehype-highlight": "7.0.0", "rehype-sanitize": "6.0.0", "tailwindcss": "3.3.3", - "typescript": "5.3.0-dev.20231011", + "typescript": "5.3.0-dev.20231018", "unified": "10.1.2", "unist-util-is": "6.0.0", "unist-util-visit": "5.0.0" diff --git a/docs/src/utils/buildDocsTree.ts b/docs/src/utils/buildDocsTree.ts index fb3e8131..97c01049 100644 --- a/docs/src/utils/buildDocsTree.ts +++ b/docs/src/utils/buildDocsTree.ts @@ -2,7 +2,7 @@ import { allDocs, type Docs } from "contentlayer/generated"; import { v4 as uuidv4 } from "uuid"; const treePriority: Record = { - "/docs": ["next-pwa", "next-sw"], + "/docs": ["next-pwa"], "/docs/next-pwa": [ "getting-started", "configuring", diff --git a/examples/basic/package.json b/examples/basic/package.json index 9914a2b6..79fb7e42 100644 --- a/examples/basic/package.json +++ b/examples/basic/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/custom-server/package.json b/examples/custom-server/package.json index 1938b2ea..ac25edf8 100644 --- a/examples/custom-server/package.json +++ b/examples/custom-server/package.json @@ -13,14 +13,14 @@ "@ducanh2912/next-pwa": "latest", "@fastify/compress": "6.4.0", "cross-env": "7.0.3", - "fastify": "4.24.0", - "next": "13.5.4", + "fastify": "4.24.2", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@swc/core": "1.3.92", - "@types/node": "20.8.4", + "@swc/core": "1.3.93", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "nodemon": "3.0.1", diff --git a/examples/custom-worker/package.json b/examples/custom-worker/package.json index c3900eb5..b81306d6 100644 --- a/examples/custom-worker/package.json +++ b/examples/custom-worker/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/lifecycle/package.json b/examples/lifecycle/package.json index 3f9887c9..3d937caf 100644 --- a/examples/lifecycle/package.json +++ b/examples/lifecycle/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/lifecycle/tsconfig.json b/examples/lifecycle/tsconfig.json index aeeefe52..4d7cbbf6 100644 --- a/examples/lifecycle/tsconfig.json +++ b/examples/lifecycle/tsconfig.json @@ -1,11 +1,7 @@ { "compilerOptions": { "target": "es5", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "strict": true, @@ -18,22 +14,13 @@ "isolatedModules": true, "jsx": "preserve", "incremental": true, - "types": [ - "@ducanh2912/next-pwa/workbox" - ], + "types": ["@ducanh2912/next-pwa/workbox"], "plugins": [ { "name": "next" } ] }, - "include": [ - "next-env.d.ts", - "**/*.ts", - "**/*.tsx", - ".next/types/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/examples/next-i18next/package.json b/examples/next-i18next/package.json index eed6fac6..ad72ec41 100644 --- a/examples/next-i18next/package.json +++ b/examples/next-i18next/package.json @@ -15,14 +15,14 @@ "express": "4.18.2", "fastify-compress": "4.1.0", "i18next": "23.5.1", - "next": "13.5.4", + "next": "13.5.5", "next-i18next": "14.0.3", "react": "18.2.0", "react-dom": "18.2.0", - "react-i18next": "13.2.2" + "react-i18next": "13.3.0" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/next-image/package.json b/examples/next-image/package.json index 6d5b9ec3..6e6407d0 100644 --- a/examples/next-image/package.json +++ b/examples/next-image/package.json @@ -11,12 +11,12 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/offline-fallback-v2/package.json b/examples/offline-fallback-v2/package.json index 0d094dc7..b6292501 100644 --- a/examples/offline-fallback-v2/package.json +++ b/examples/offline-fallback-v2/package.json @@ -11,13 +11,13 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0", "sharp": "0.32.6" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "typescript": "5.2.2" diff --git a/examples/web-push/package.json b/examples/web-push/package.json index a8826e35..b2d179ad 100644 --- a/examples/web-push/package.json +++ b/examples/web-push/package.json @@ -12,13 +12,13 @@ }, "dependencies": { "@ducanh2912/next-pwa": "latest", - "next": "13.5.4", + "next": "13.5.5", "react": "18.2.0", "react-dom": "18.2.0", "web-push": "3.6.6" }, "devDependencies": { - "@types/node": "20.8.4", + "@types/node": "20.8.7", "@types/react": "18.2.28", "@types/react-dom": "18.2.13", "@types/web-push": "3.6.1", diff --git a/examples/workboxless/.gitignore b/examples/workboxless/.gitignore deleted file mode 100644 index 8434d7db..00000000 --- a/examples/workboxless/.gitignore +++ /dev/null @@ -1,44 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# next.js -/.next/ -/out/ -.vscode - -# production -/build - -# misc -.DS_Store -*.pem - -# debug -npm-debug.log* -yarn-debug.log* -yarn-error.log* -.pnpm-debug.log* - -# local env files -.env*.local - -# vercel -.vercel - -# typescript -*.tsbuildinfo -next-env.d.ts - -# next-pwa -**/public/workbox** -**/public/sw** -**/public/worker** -**/public/fallback** -**/public/precache** \ No newline at end of file diff --git a/examples/workboxless/README.md b/examples/workboxless/README.md deleted file mode 100644 index edb99a68..00000000 --- a/examples/workboxless/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# next-pwa - basic example - -This example demonstrates how to use `next-sw`, which is an unstable package and does not use Workbox. - -## Usage - -[![Open in Gitpod and run](https://img.shields.io/badge/Open%20In-Gitpod.io-%231966D2?style=for-the-badge&logo=gitpod)](https://gitpod.io/#https://github.com/DuCanhGH/next-pwa/) - -```bash -cd examples/workboxless -pnpm build -pnpm start -``` - -or - -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: - -```bash -npx create-next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/workboxless workboxless-app -``` - -```bash -yarn create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/workboxless workboxless-app -``` - -```bash -pnpm create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/workboxless workboxless-app -``` - -## Recommended `.gitignore` - -```gitignore -**/public/sw.js -``` diff --git a/examples/workboxless/app/appdir/about/Button.tsx b/examples/workboxless/app/appdir/about/Button.tsx deleted file mode 100644 index 40976d25..00000000 --- a/examples/workboxless/app/appdir/about/Button.tsx +++ /dev/null @@ -1,7 +0,0 @@ -"use client"; -import { useState } from "react"; - -export function Button() { - const [count, setCount] = useState(0); - return ; -} diff --git a/examples/workboxless/app/appdir/about/page.tsx b/examples/workboxless/app/appdir/about/page.tsx deleted file mode 100644 index c068ecb1..00000000 --- a/examples/workboxless/app/appdir/about/page.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import Link from "next/link"; - -import { Button } from "./Button"; - -export default function Page() { - return ( - <> -

This is the basic example.

- Home page -