Skip to content

Commit 9b802c5

Browse files
committed
feat(Template): Add manifest.json to WASM template
This allows the default templates for WASM to generate a PWA that can be installed to the local operating system. Default icons are automatically included.
1 parent 9ac2a0c commit 9b802c5

File tree

16 files changed

+90
-0
lines changed

16 files changed

+90
-0
lines changed
Loading
Loading
Loading
Loading
Loading

src/SolutionTemplate/UnoSolutionTemplate.WinUI.net6/Wasm/UnoQuickStart.Wasm.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>$basetargetframework$</TargetFramework>
66
<NoWarn>NU1701</NoWarn>
7+
8+
<WasmPWAManifestFile>manifest.json</WasmPWAManifestFile>
79
</PropertyGroup>
810

911
<PropertyGroup Condition="'$(Configuration)'=='Debug'">

src/SolutionTemplate/UnoSolutionTemplate.WinUI.net6/Wasm/Wasm.winui.net6.vstemplate

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,16 @@
2121
<Project TargetFileName="$ext_safeprojectname$.Wasm.csproj" File="UnoQuickStart.Wasm.csproj" ReplaceParameters="true">
2222
<ProjectItem ReplaceParameters="true" TargetFileName="Program.cs">Program.cs</ProjectItem>
2323
<ProjectItem ReplaceParameters="true">LinkerConfig.xml</ProjectItem>
24+
<ProjectItem ReplaceParameters="true" TargetFileName="manifest.json">manifest.json</ProjectItem>
2425
<Folder Name="Properties" TargetFolderName="Properties">
2526
<ProjectItem TargetFileName="launchSettings.json" ReplaceParameters="true">launchSettings.json</ProjectItem>
2627
</Folder>
2728
<Folder Name="Assets" TargetFolderName="Assets">
29+
<ProjectItem TargetFileName="AppIcon-16.png" ReplaceParameters="false">AppIcon-16.png</ProjectItem>
30+
<ProjectItem TargetFileName="AppIcon-32.png" ReplaceParameters="false">AppIcon-32.png</ProjectItem>
31+
<ProjectItem TargetFileName="AppIcon-128.png" ReplaceParameters="false">AppIcon-128.png</ProjectItem>
32+
<ProjectItem TargetFileName="AppIcon-256.png" ReplaceParameters="false">AppIcon-256.png</ProjectItem>
33+
<ProjectItem TargetFileName="AppIcon-512.png" ReplaceParameters="false">AppIcon-512.png</ProjectItem>
2834
<ProjectItem TargetFileName="SplashScreen.png" ReplaceParameters="false">SplashScreen.png</ProjectItem>
2935
</Folder>
3036
<Folder Name="wwwroot" TargetFolderName="wwwroot">
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"background_color": "#ffffff",
3+
"description": "$ext_safeprojectname$",
4+
"display": "standalone",
5+
"icons": [
6+
{
7+
"src": "Assets/AppIcon-16.png",
8+
"sizes": "16x16",
9+
"type": "image/png"
10+
},
11+
{
12+
"src": "Assets/AppIcon-32.png",
13+
"sizes": "32x32",
14+
"type": "image/png"
15+
},
16+
{
17+
"src": "Assets/AppIcon-128.png",
18+
"sizes": "128x128",
19+
"type": "image/png"
20+
},
21+
{
22+
"src": "Assets/AppIcon-256.png",
23+
"sizes": "256x256",
24+
"type": "image/png"
25+
},
26+
{
27+
"src": "Assets/AppIcon-512.png",
28+
"sizes": "512x512",
29+
"type": "image/png"
30+
}
31+
],
32+
"name": "$ext_safeprojectname$",
33+
"short_name": "$ext_safeprojectname$",
34+
"start_url": "/index.html",
35+
"theme_color": "#ffffff",
36+
"scope": "/"
37+
}
Loading
Loading
Loading
Loading
Loading

src/SolutionTemplate/UnoSolutionTemplate.net6/Wasm/UnoQuickStart.Wasm.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net6.0</TargetFramework>
66
<NoWarn>NU1701</NoWarn>
7+
8+
<WasmPWAManifestFile>manifest.json</WasmPWAManifestFile>
79
</PropertyGroup>
810

911
<PropertyGroup Condition="'$(Configuration)'=='Debug'">

src/SolutionTemplate/UnoSolutionTemplate.net6/Wasm/Wasm.net6.vstemplate

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
<Project TargetFileName="$ext_safeprojectname$.Wasm.csproj" File="UnoQuickStart.Wasm.csproj" ReplaceParameters="true">
2121
<ProjectItem ReplaceParameters="true" TargetFileName="Program.cs">Program.cs</ProjectItem>
2222
<ProjectItem ReplaceParameters="true">LinkerConfig.xml</ProjectItem>
23+
<ProjectItem ReplaceParameters="true" TargetFileName="manifest.json">manifest.json</ProjectItem>
2324
<Folder Name="Assets" TargetFolderName="Assets">
25+
<ProjectItem TargetFileName="AppIcon-16.png" ReplaceParameters="false">AppIcon-16.png</ProjectItem>
26+
<ProjectItem TargetFileName="AppIcon-32.png" ReplaceParameters="false">AppIcon-32.png</ProjectItem>
27+
<ProjectItem TargetFileName="AppIcon-128.png" ReplaceParameters="false">AppIcon-128.png</ProjectItem>
28+
<ProjectItem TargetFileName="AppIcon-256.png" ReplaceParameters="false">AppIcon-256.png</ProjectItem>
29+
<ProjectItem TargetFileName="AppIcon-512.png" ReplaceParameters="false">AppIcon-512.png</ProjectItem>
2430
<ProjectItem TargetFileName="SplashScreen.png" ReplaceParameters="false">SplashScreen.png</ProjectItem>
2531
</Folder>
2632
<Folder Name="wwwroot" TargetFolderName="wwwroot">
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"background_color": "#ffffff",
3+
"description": "$ext_safeprojectname$",
4+
"display": "standalone",
5+
"icons": [
6+
{
7+
"src": "Assets/AppIcon-16.png",
8+
"sizes": "16x16",
9+
"type": "image/png"
10+
},
11+
{
12+
"src": "Assets/AppIcon-32.png",
13+
"sizes": "32x32",
14+
"type": "image/png"
15+
},
16+
{
17+
"src": "Assets/AppIcon-128.png",
18+
"sizes": "128x128",
19+
"type": "image/png"
20+
},
21+
{
22+
"src": "Assets/AppIcon-256.png",
23+
"sizes": "256x256",
24+
"type": "image/png"
25+
},
26+
{
27+
"src": "Assets/AppIcon-512.png",
28+
"sizes": "512x512",
29+
"type": "image/png"
30+
}
31+
],
32+
"name": "$ext_safeprojectname$",
33+
"short_name": "$ext_safeprojectname$",
34+
"start_url": "/index.html",
35+
"theme_color": "#ffffff",
36+
"scope": "/"
37+
}

0 commit comments

Comments
 (0)