Skip to content

Commit

Permalink
Feat PWA (#197)
Browse files Browse the repository at this point in the history
* added pwa

* build errors removed

* remove console config
  • Loading branch information
prtkjakhar authored Oct 25, 2023
1 parent 7270b0e commit 36dd605
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 39 deletions.
48 changes: 25 additions & 23 deletions apps/amakrushi/next.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
/** @type {import('next').NextConfig} */

const nextConfig = {
reactStrictMode: false,
compiler: {
removeConsole: true
},
}
const withPWA = require("next-pwa");
const withBundleAnalyzer = require('@next/bundle-analyzer')({
// eslint-disable-next-line turbo/no-undeclared-env-vars
enabled: process.env.ANALYZE === 'true'
})
});



module.exports = withBundleAnalyzer({
env: {
NEXT_PUBLIC_ENV: 'PRODUCTION', //your next configs goes here
},
nextConfig,
typescript: {
ignoreBuildErrors: true,
},
i18n: {
locales: ['or','en'],
defaultLocale: 'en',
}
})
module.exports = withBundleAnalyzer(
withPWA({
pwa: {
dest: "public",
register: true,
skipWaiting: true,
},
env: {
NEXT_PUBLIC_ENV: 'PRODUCTION', // your next configs go here
},
reactStrictMode: false,
typescript: {
ignoreBuildErrors: true,
},
compiler: {
removeConsole: true
},
i18n: {
locales: ['or', 'en'],
defaultLocale: 'en',
},
})
);
1 change: 1 addition & 0 deletions apps/amakrushi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"jwks-rsa": "^3.0.1",
"jwt-decode": "^3.1.2",
"next": "12.1.6",
"next-pwa": "^5.6.0",
"react": "17.0.2",
"react-alert": "^7.0.3",
"react-alert-template-basic": "^1.0.2",
Expand Down
Binary file added apps/amakrushi/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/amakrushi/public/logo192.png
Binary file not shown.
Binary file removed apps/amakrushi/public/logo512.png
Binary file not shown.
10 changes: 5 additions & 5 deletions apps/amakrushi/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "AmakrushAI",
"name": "AmakrushAI",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"src": "logo.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"src": "logo.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"start_url": "/",
"display": "standalone",
"theme_color": "black",
"background_color": "white"
Expand Down
10 changes: 6 additions & 4 deletions apps/amakrushi/src/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@

import { Html, Head, Main, NextScript } from "next/document";
import { Html, Head, Main, NextScript } from 'next/document';

export default function Document() {
return (
<Html>
<Head />
<Head>
<link rel="manifest" href="/manifest.json" />
<link rel="apple-touch-icon" href="/icon.png"></link>
<meta name="theme-color" content="#fff" />
</Head>
<body>
<div id="modal_portal" />
<Main />
<NextScript />
</body>

</Html>
);
}
76 changes: 69 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7420,7 +7420,7 @@ array-includes@^3.0.3, array-includes@^3.1.5, array-includes@^3.1.6:
get-intrinsic "^1.1.3"
is-string "^1.0.7"

array-union@^1.0.2:
array-union@^1.0.1, array-union@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
integrity sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==
Expand Down Expand Up @@ -7729,7 +7729,7 @@ babel-jest@^28.1.3:
graceful-fs "^4.2.9"
slash "^3.0.0"

babel-loader@^8.0.0, babel-loader@^8.2.3:
babel-loader@^8.0.0, babel-loader@^8.2.3, babel-loader@^8.2.5:
version "8.3.0"
resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.3.0.tgz#124936e841ba4fe8176786d6ff28add1f134d6a8"
integrity sha512-H8SvsMF+m9t15HNLMipppzkC+Y2Yq+v3SonZyU70RBL/h1gxPkH08Ot8pEE9Z4Kd+czyWJClmFS8qzIP9OZ04Q==
Expand Down Expand Up @@ -8766,6 +8766,13 @@ clean-stack@^2.0.0:
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b"
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==

clean-webpack-plugin@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-4.0.0.tgz#72947d4403d452f38ed61a9ff0ada8122aacd729"
integrity sha512-WuWE1nyTNAyW5T7oNyys2EN0cfP2fdRxhxnIQWiAp0bMabPdHhoGxM8A6YL2GhqwgrPnnaemVE7nv5XJ2Fhh2w==
dependencies:
del "^4.1.1"

cli-boxes@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f"
Expand Down Expand Up @@ -10031,6 +10038,19 @@ define-property@^2.0.2:
is-descriptor "^1.0.2"
isobject "^3.0.1"

del@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4"
integrity sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==
dependencies:
"@types/glob" "^7.1.1"
globby "^6.1.0"
is-path-cwd "^2.0.0"
is-path-in-cwd "^2.0.0"
p-map "^2.0.0"
pify "^4.0.1"
rimraf "^2.6.3"

del@^6.0.0:
version "6.1.1"
resolved "https://registry.npmjs.org/del/-/del-6.1.1.tgz"
Expand Down Expand Up @@ -12453,7 +12473,7 @@ [email protected]:
once "^1.3.0"
path-is-absolute "^1.0.0"

glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0:
glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@^7.2.0:
version "7.2.3"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b"
integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==
Expand Down Expand Up @@ -12567,6 +12587,17 @@ globby@^12.0.0:
merge2 "^1.4.1"
slash "^4.0.0"

globby@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c"
integrity sha512-KVbFv2TQtbzCoxAnfD6JcHZTYCzyliEaaeM/gH8qQdkKr5s0OP9scEgvdcngyk7AVdY6YVW/TJHd+lQ/Df3Daw==
dependencies:
array-union "^1.0.1"
glob "^7.0.3"
object-assign "^4.0.1"
pify "^2.0.0"
pinkie-promise "^2.0.0"

globby@^9.2.0:
version "9.2.0"
resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d"
Expand Down Expand Up @@ -13751,11 +13782,25 @@ is-object@^1.0.1:
resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf"
integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==

is-path-cwd@^2.2.0:
is-path-cwd@^2.0.0, is-path-cwd@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz"
integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==

is-path-in-cwd@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb"
integrity sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==
dependencies:
is-path-inside "^2.1.0"

is-path-inside@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2"
integrity sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==
dependencies:
path-is-inside "^1.0.2"

is-path-inside@^3.0.2, is-path-inside@^3.0.3:
version "3.0.3"
resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283"
Expand Down Expand Up @@ -16713,6 +16758,18 @@ nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0:
resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.1.tgz#26c8a3cee6cc05fbcf1e333cd2fc3e003326c0b5"
integrity sha512-9iN1ka/9zmX1ZvLV9ewJYEk9h7RyRRtqdK0woXcqohu8EWIerfPUjYJPg0ULy0UqP7cslmdGc8xKDJcojlKiaw==

next-pwa@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/next-pwa/-/next-pwa-5.6.0.tgz#f7b1960c4fdd7be4253eb9b41b612ac773392bf4"
integrity sha512-XV8g8C6B7UmViXU8askMEYhWwQ4qc/XqJGnexbLV68hzKaGHZDMtHsm2TNxFcbR7+ypVuth/wwpiIlMwpRJJ5A==
dependencies:
babel-loader "^8.2.5"
clean-webpack-plugin "^4.0.0"
globby "^11.0.4"
terser-webpack-plugin "^5.3.3"
workbox-webpack-plugin "^6.5.4"
workbox-window "^6.5.4"

[email protected]:
version "12.1.6"
resolved "https://registry.yarnpkg.com/next/-/next-12.1.6.tgz#eb205e64af1998651f96f9df44556d47d8bbc533"
Expand Down Expand Up @@ -17835,6 +17892,11 @@ path-is-absolute@^1.0.0:
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==

path-is-inside@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
integrity sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==

path-key@^2.0.0, path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"
Expand Down Expand Up @@ -21627,7 +21689,7 @@ terser-webpack-plugin@^4.2.3:
terser "^5.3.4"
webpack-sources "^1.4.3"

terser-webpack-plugin@^5.0.3, terser-webpack-plugin@^5.2.5, terser-webpack-plugin@^5.3.7:
terser-webpack-plugin@^5.0.3, terser-webpack-plugin@^5.2.5, terser-webpack-plugin@^5.3.3, terser-webpack-plugin@^5.3.7:
version "5.3.9"
resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz#832536999c51b46d468067f9e37662a3b96adfe1"
integrity sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==
Expand Down Expand Up @@ -23352,7 +23414,7 @@ [email protected]:
resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-6.6.1.tgz#d4c4ca3125088e8b9fd7a748ed537fa0247bd72c"
integrity sha512-R7whwjvU2abHH/lR6kQTTXLHDFU2izht9kJOvBRYK65FbwutT4VvnUAJIgHvfWZ/fokrOPhfoWYoPCMpSgUKHQ==

workbox-webpack-plugin@^6.4.1:
workbox-webpack-plugin@^6.4.1, workbox-webpack-plugin@^6.5.4:
version "6.6.1"
resolved "https://registry.yarnpkg.com/workbox-webpack-plugin/-/workbox-webpack-plugin-6.6.1.tgz#4f81cc1ad4e5d2cd7477a86ba83c84ee2d187531"
integrity sha512-zpZ+ExFj9NmiI66cFEApyjk7hGsfJ1YMOaLXGXBoZf0v7Iu6hL0ZBe+83mnDq3YYWAfA3fnyFejritjOHkFcrA==
Expand All @@ -23363,7 +23425,7 @@ workbox-webpack-plugin@^6.4.1:
webpack-sources "^1.4.3"
workbox-build "6.6.1"

[email protected]:
[email protected], workbox-window@^6.5.4:
version "6.6.1"
resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-6.6.1.tgz#f22a394cbac36240d0dadcbdebc35f711bb7b89e"
integrity sha512-wil4nwOY58nTdCvif/KEZjQ2NP8uk3gGeRNy2jPBbzypU4BT4D9L8xiwbmDBpZlSgJd2xsT9FvSNU0gsxV51JQ==
Expand Down

0 comments on commit 36dd605

Please sign in to comment.