-
-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
β‘ perf: Use nextjs pwa feat to gen manifest file (#4042)
* β‘ perf: Use nextjs pwa feat to gen manifest file * π fix: Fix review problem * β test: Add test * π style: Update next config * π fix: Fix test config * π style: Update layout
- Loading branch information
1 parent
d3aa60a
commit 8afb4e2
Showing
15 changed files
with
729 additions
and
176 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
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
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,86 @@ | ||
import { kebabCase } from 'lodash-es'; | ||
import type { MetadataRoute } from 'next'; | ||
|
||
import { BRANDING_LOGO_URL, BRANDING_NAME } from '@/const/branding'; | ||
import { manifestModule } from '@/server/manifest'; | ||
import { translation } from '@/server/translation'; | ||
|
||
const manifest = async (): Promise<MetadataRoute.Manifest | any> => { | ||
const { t } = await translation('metadata'); | ||
|
||
return manifestModule.generate({ | ||
description: t('chat.description', { appName: BRANDING_NAME }), | ||
icons: [ | ||
{ | ||
purpose: 'any', | ||
sizes: '192x192', | ||
url: '/icons/icon-192x192.png', | ||
}, | ||
{ | ||
purpose: 'maskable', | ||
sizes: '192x192', | ||
url: '/icons/icon-192x192.maskable.png', | ||
}, | ||
{ | ||
purpose: 'any', | ||
sizes: '512x512', | ||
url: '/icons/icon-512x512.png', | ||
}, | ||
{ | ||
purpose: 'maskable', | ||
sizes: '512x512', | ||
url: '/icons/icon-512x512.maskable.png', | ||
}, | ||
], | ||
id: kebabCase(BRANDING_NAME), | ||
name: BRANDING_NAME, | ||
screenshots: BRANDING_LOGO_URL | ||
? [] | ||
: [ | ||
{ | ||
form_factor: 'narrow', | ||
url: '/screenshots/shot-1.mobile.png', | ||
}, | ||
{ | ||
form_factor: 'narrow', | ||
url: '/screenshots/shot-2.mobile.png', | ||
}, | ||
{ | ||
form_factor: 'narrow', | ||
sizes: '640x1138', | ||
|
||
url: '/screenshots/shot-3.mobile.png', | ||
}, | ||
{ | ||
form_factor: 'narrow', | ||
url: '/screenshots/shot-4.mobile.png', | ||
}, | ||
{ | ||
form_factor: 'narrow', | ||
url: '/screenshots/shot-5.mobile.png', | ||
}, | ||
{ | ||
form_factor: 'wide', | ||
url: '/screenshots/shot-1.desktop.png', | ||
}, | ||
{ | ||
form_factor: 'wide', | ||
url: '/screenshots/shot-2.desktop.png', | ||
}, | ||
{ | ||
form_factor: 'wide', | ||
url: '/screenshots/shot-3.desktop.png', | ||
}, | ||
{ | ||
form_factor: 'wide', | ||
url: '/screenshots/shot-4.desktop.png', | ||
}, | ||
{ | ||
form_factor: 'wide', | ||
url: '/screenshots/shot-5.desktop.png', | ||
}, | ||
], | ||
}); | ||
}; | ||
|
||
export default manifest; |
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.