-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support manifest.json static and dynamic route (#47240)
* Add `manifest.webmanifest` and `manifest.(j|t)xs?` support for manifest.json route * Add `Manifest` type for it for autocomplete purpose. Remove the exports for `SitemapFile` and `RobotsFile` globally, will discuss how to re-export them with better naming later Small fix for `Robots` typing, should allow `string | string[]` for user agent of single Robots Closes NEXT-839 ---------
- Loading branch information
Showing
17 changed files
with
209 additions
and
36 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 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 @@ | ||
export type Manifest = { | ||
background_color?: string | ||
categories?: string[] | ||
description?: string | ||
display?: 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser' | ||
display_override?: string[] | ||
icons?: { | ||
src: string | ||
type?: string | ||
sizes?: string | ||
purpose?: 'any' | 'maskable' | 'monochrome' | 'badge' | ||
}[] | ||
id?: string | ||
launch_handler?: { | ||
platform?: 'windows' | 'macos' | 'linux' | ||
url?: string | ||
} | ||
name?: string | ||
orientation?: | ||
| 'any' | ||
| 'natural' | ||
| 'landscape' | ||
| 'portrait' | ||
| 'portrait-primary' | ||
| 'portrait-secondary' | ||
| 'landscape-primary' | ||
| 'landscape-secondary' | ||
prefer_related_applications?: boolean | ||
protocol_handlers?: { | ||
protocol: string | ||
url: string | ||
title?: string | ||
}[] | ||
related_applications?: { | ||
platform: string | ||
url: string | ||
id?: string | ||
}[] | ||
scope?: string | ||
screenshots?: { | ||
src: string | ||
type?: string | ||
sizes?: string | ||
}[] | ||
serviceworker?: { | ||
src?: string | ||
scope?: string | ||
type?: string | ||
update_via_cache?: 'import' | 'none' | 'all' | ||
} | ||
share_target?: { | ||
action?: string | ||
method?: 'get' | 'post' | ||
enctype?: | ||
| 'application/x-www-form-urlencoded' | ||
| 'multipart/form-data' | ||
| 'text/plain' | ||
params?: { | ||
name: string | ||
value: string | ||
required?: boolean | ||
}[] | ||
url?: string | ||
title?: string | ||
text?: string | ||
files?: { | ||
accept?: string[] | ||
name?: string | ||
}[] | ||
} | ||
short_name?: string | ||
shortcuts?: { | ||
name: string | ||
short_name?: string | ||
description?: string | ||
url: string | ||
icons?: { | ||
src: string | ||
type?: string | ||
sizes?: string | ||
purpose?: 'any' | 'maskable' | 'monochrome' | 'badge' | ||
}[] | ||
}[] | ||
start_url?: string | ||
theme_color?: string | ||
} |
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,18 @@ | ||
export default function manifest() { | ||
return { | ||
name: 'Next.js App', | ||
short_name: 'Next.js App', | ||
description: 'Next.js App', | ||
start_url: '/', | ||
display: 'standalone', | ||
background_color: '#fff', | ||
theme_color: '#fff', | ||
icons: [ | ||
{ | ||
src: '/favicon.ico', | ||
sizes: 'any', | ||
type: 'image/x-icon', | ||
}, | ||
], | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"name": "Next.js Static Manifest", | ||
"short_name": "Next.js App", | ||
"description": "Next.js App", | ||
"start_url": "/", | ||
"display": "standalone", | ||
"background_color": "#fff", | ||
"theme_color": "#fff" | ||
} |
Oops, something went wrong.