Skip to content

Commit 4baffff

Browse files
Empty Blazor WebAssembly Project Template (#42215)
* Duplicated required files * Removed authentication, pages, formatting * Fix namespaces * Remove readme / auth template options * Update Index.razor * Remove auth options from templatestrings * Update launchSettings.json * Remove auth (cont.), rename files * Added .csproj.in files * Update templatestrings.json * Update templatestrings.cs.json * Update Program.cs * Modify to reflect changes in http/https launch profiles * Add template test; remove RequiresHttps logic * Added blazorwasm-empty template baseline tests * Merge branch 'main' into t-samsoncera/empty-wasm * Changes from code review; fix failing test * Add empty file to Shared folder * Update src/ProjectTemplates/test/Templates.Blazor.Tests/EmptyBlazorWasmTemplateTest.cs Co-authored-by: Tanay Parikh <[email protected]> * Fix issues with launchBrowser and missing PWA install app * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Server/Program.cs Co-authored-by: Tanay Parikh <[email protected]> * Update EmptyComponentsWebAssembly-CSharp.sln * Fix missing Server project * Update .json files * Update template-baselines.json * Move icon.png into ide/ * Update ide.host.json * Fix template-baselines, template.json * Fix templates-baselines, remove icon-192.png * Revert "Fix templates-baselines, remove icon-192.png" This reverts commit fa76595. * Delete icon-192.png * Update src/ProjectTemplates/Web.ProjectTemplates/content/EmptyComponentsWebAssembly-CSharp/Client/wwwroot/manifest.json Co-authored-by: Tanay Parikh <[email protected]> * Add ExcludeLaunchSettings to template.json * Move tags into ide.host.json * Fix closing brace appsettings.json Caused /Server build to fail Co-authored-by: Tanay Parikh <[email protected]>
1 parent 7340c27 commit 4baffff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1344
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
2+
3+
<PropertyGroup>
4+
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<!--#if PWA -->
8+
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
9+
<!--#endif -->
10+
<!--#if Hosted -->
11+
<AssemblyName Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">`$(AssemblyName.Replace(' ', '_'))</AssemblyName>
12+
<!--#endif -->
13+
</PropertyGroup>
14+
15+
<ItemGroup>
16+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="${MicrosoftAspNetCoreComponentsWebAssemblyVersion}" />
17+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="${MicrosoftAspNetCoreComponentsWebAssemblyDevServerVersion}" PrivateAssets="all" />
18+
<PackageReference Include="Microsoft.Extensions.Http" Version="${MicrosoftExtensionsHttpVersion}" Condition="'$(Hosted)' == 'true'" />
19+
</ItemGroup>
20+
21+
<!--#if Hosted -->
22+
<ItemGroup>
23+
<ProjectReference Include="..\Shared\EmptyComponentsWebAssembly-CSharp.Shared.csproj" />
24+
</ItemGroup>
25+
26+
<!--#endif -->
27+
<!--#if PWA -->
28+
<ItemGroup>
29+
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
30+
</ItemGroup>
31+
32+
<!--#endif -->
33+
</Project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
8+
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">EmptyComponentsWebAssembly-CSharp.Server</RootNamespace>
9+
<AssemblyName Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">`$(AssemblyName.Replace(' ', '_'))</AssemblyName>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="${MicrosoftAspNetCoreComponentsWebAssemblyServerVersion}" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Client\EmptyComponentsWebAssembly-CSharp.Client.csproj" />
18+
<ProjectReference Include="..\Shared\EmptyComponentsWebAssembly-CSharp.Shared.csproj" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<SupportedPlatform Include="browser" />
11+
</ItemGroup>
12+
</Project>

src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Client.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Client/ComponentsWebAssembly-CSharp.Client.csproj" />
6868
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Shared.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Shared/ComponentsWebAssembly-CSharp.Shared.csproj" />
6969
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Server.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj" />
70+
<GeneratedContent Include="EmptyComponentsWebAssembly-CSharp.Client.csproj.in" OutputPath="content/EmptyComponentsWebAssembly-CSharp/Client/EmptyComponentsWebAssembly-CSharp.Client.csproj" />
71+
<GeneratedContent Include="EmptyComponentsWebAssembly-CSharp.Shared.csproj.in" OutputPath="content/EmptyComponentsWebAssembly-CSharp/Shared/EmptyComponentsWebAssembly-CSharp.Shared.csproj" />
72+
<GeneratedContent Include="EmptyComponentsWebAssembly-CSharp.Server.csproj.in" OutputPath="content/EmptyComponentsWebAssembly-CSharp/Server/EmptyComponentsWebAssembly-CSharp.Server.csproj" />
7073
</ItemGroup>
7174

7275
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "http://json.schemastore.org/dotnetcli.host",
3+
"symbolInfo": {
4+
"skipRestore": {
5+
"longName": "no-restore",
6+
"shortName": ""
7+
},
8+
"Hosted": {
9+
"longName": "hosted"
10+
},
11+
"PWA": {
12+
"longName": "pwa"
13+
},
14+
"Framework": {
15+
"longName": "framework"
16+
},
17+
"kestrelHttpPort": {
18+
"isHidden": true
19+
},
20+
"kestrelHttpsPort": {
21+
"isHidden": true
22+
},
23+
"iisHttpPort": {
24+
"isHidden": true
25+
},
26+
"iisHttpsPort": {
27+
"isHidden": true
28+
},
29+
"ExcludeLaunchSettings": {
30+
"longName": "exclude-launch-settings",
31+
"shortName": ""
32+
},
33+
"NoHttps": {
34+
"longName": "no-https",
35+
"shortName": ""
36+
},
37+
"CalledApiUrl": {
38+
"longName": "called-api-url",
39+
"shortName": ""
40+
}
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "http://json.schemastore.org/ide.host",
3+
"order": 660,
4+
"icon": "ide/icon.png",
5+
"disableHttpsSymbol": "NoHttps",
6+
"symbolInfo": [
7+
{
8+
"id": "Hosted",
9+
"isVisible": "true",
10+
"persistenceScope": "templateGroup"
11+
},
12+
{
13+
"id": "PWA",
14+
"isVisible": "true",
15+
"persistenceScope": "templateGroup"
16+
}
17+
],
18+
"tags": [
19+
{
20+
"type": "projectType",
21+
"add": [ "Cloud", "Web" ],
22+
"remove": [ "*" ]
23+
},
24+
{
25+
"type": "platform",
26+
"add": [ "Linux", "macOS", "Windows" ]
27+
}
28+
]
29+
}
1.12 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor WebAssembly App Empty",
4+
"description": "An empty project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template does not have any content in it.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
9+
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
10+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
11+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
12+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
13+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
14+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
15+
"symbols/PWA/displayName": "_Progressive Web Application",
16+
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
17+
"symbols/HasHttpProfile/description": "Always have HTTP profile.",
18+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
19+
"postActions/restore/description": "Restore NuGet packages required by this project.",
20+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'",
21+
"postActions/restoreClient/description": "Restore NuGet packages required by this project.",
22+
"postActions/restoreClient/manualInstructions/default/text": "Run 'dotnet restore'"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor WebAssembly App Empty",
4+
"description": "An empty project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template does not have any content in it.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
9+
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
10+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
11+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
12+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
13+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
14+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
15+
"symbols/PWA/displayName": "_Progressive Web Application",
16+
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
17+
"symbols/HasHttpProfile/description": "Always have HTTP profile.",
18+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
19+
"postActions/restore/description": "Restore NuGet packages required by this project.",
20+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'",
21+
"postActions/restoreClient/description": "Restore NuGet packages required by this project.",
22+
"postActions/restoreClient/manualInstructions/default/text": "Run 'dotnet restore'"
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"author": "Microsoft",
3+
"name": "Blazor WebAssembly App Empty",
4+
"description": "An empty project template for creating a Blazor app that runs on WebAssembly and is optionally hosted by an ASP.NET Core app. This template does not have any content in it.",
5+
"symbols/Framework/description": "The target framework for the project.",
6+
"symbols/Framework/choices/net7.0/description": "Target net7.0",
7+
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
8+
"symbols/Hosted/displayName": "ASP.NET Core _Hosted",
9+
"symbols/Hosted/description": "If specified, includes an ASP.NET Core host for the Blazor WebAssembly app.",
10+
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
11+
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
12+
"symbols/kestrelHttpsPort/description": "Port number to use for the HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
13+
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
14+
"symbols/iisHttpsPort/description": "Port number to use for the IIS Express HTTPS endpoint in launchSettings.json. This option is only applicable when the parameter no-https is not used.",
15+
"symbols/PWA/displayName": "_Progressive Web Application",
16+
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
17+
"symbols/HasHttpProfile/description": "Always have HTTP profile.",
18+
"symbols/NoHttps/description": "Whether to turn off HTTPS.",
19+
"postActions/restore/description": "Restore NuGet packages required by this project.",
20+
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'",
21+
"postActions/restoreClient/description": "Restore NuGet packages required by this project.",
22+
"postActions/restoreClient/manualInstructions/default/text": "Run 'dotnet restore'"
23+
}

0 commit comments

Comments
 (0)