Skip to content

Commit

Permalink
chore: 🔨 use serwist for pwa
Browse files Browse the repository at this point in the history
  • Loading branch information
moinulmoin committed Jun 21, 2024
1 parent 456c6bd commit c523750
Show file tree
Hide file tree
Showing 13 changed files with 3,986 additions and 5,667 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
ui/
*.d.ts
*.d.ts
*.config.*
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,5 @@
"argsIgnorePattern": "^_"
}
]
},
"ignorePatterns": [
"*.config.js"
]
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ next-env.d.ts
.idea

# worker
sw.*
sw.js
workbox-*.*
.react-email
.env*
Expand Down
4 changes: 2 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pre-commit:
run: npx tsc --noEmit
lint:
glob: "src/**/*.{ts,tsx,js,jsx}"
run: pnpm eslint {staged_files} --fix && && git update-index --again
run: pnpm eslint {staged_files} --fix && git update-index --again
format:
glob: "src/**/*.{ts,tsx,js,jsx,css}"
run: pnpm prettier --write {staged_files} && && git update-index --again
run: pnpm prettier --write {staged_files} && git update-index --again
23 changes: 0 additions & 23 deletions next.config.js

This file was deleted.

26 changes: 26 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import withSerwistInit from "@serwist/next";

const withSerwist = withSerwistInit({
// Note: This is only an example. If you use Pages Router,
// use something else that works, such as "service-worker/index.ts".
swSrc: "src/app/sw.ts",
swDest: "public/sw.js",
});

const nextConfig = {
redirects: async () => {
return [
{
source: "/dashboard",
destination: "/dashboard/projects",
permanent: false,
},
];
},
trailingSlash: true,
eslint: {
ignoreDuringBuilds: true,
},
};

export default withSerwist(nextConfig);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"preinstall": "lefthook install"
},
"dependencies": {
"@ducanh2912/next-pwa": "^10.0.0",
"@hookform/resolvers": "^3.3.2",
"@lucia-auth/adapter-prisma": "4.0.0-beta.8",
"@prisma/client": "^5.7.0",
Expand All @@ -29,6 +28,7 @@
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-toast": "^1.1.5",
"@react-email/components": "^0.0.12",
"@serwist/next": "^9.0.3",
"@uploadthing/react": "^6.0.2",
"arctic": "^0.10.2",
"dayjs": "^1.11.10",
Expand Down Expand Up @@ -69,6 +69,7 @@
"prettier": "3.2.5",
"prettier-plugin-tailwindcss": "^0.6.2",
"prisma": "^5.7.0",
"serwist": "^9.0.3",
"sharp": "^0.33.1",
"tailwind-merge": "^2.3.0",
"tailwindcss": "3.4.1",
Expand Down
Loading

0 comments on commit c523750

Please sign in to comment.