Skip to content

[Blazor] Add new Blazor Web Template #48285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ProjectTemplates/Shared/AspNetProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ public async Task AssertPagesOk(IEnumerable<Page> pages)
foreach (var page in pages)
{
await AssertOk(page.Url);
await ContainsLinks(page);
if (page.Links?.Count() > 0)
{
await ContainsLinks(page);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<!--#if UseWebAssembly -->
<TargetFrameworks>${DefaultNetCoreTargetFramework};${DefaultNetCoreTargetFramework}-browser</TargetFrameworks>
<!--#else -->
<TargetFramework>${DefaultNetCoreTargetFramework}</TargetFramework>
<!--#endif -->
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NoDefaultLaunchSettingsFile Condition="'$(ExcludeLaunchSettings)' == 'True'">True</NoDefaultLaunchSettingsFile>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">ComponentsWebAssembly-CSharp.Server</RootNamespace>
<AssemblyName Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">`$(AssemblyName.Replace(' ', '_'))</AssemblyName>
<!--#if UseWebAssembly && PWA -->
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<!--#endif -->
</PropertyGroup>
<!--#if UseWebAssembly -->

<ItemGroup Condition="'$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == 'browser'">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="${MicrosoftAspNetCoreComponentsWebAssemblyVersion}" />
</ItemGroup>

<ItemGroup Condition="'$([MSBuild]::GetTargetPlatformIdentifier($(TargetFramework)))' == ''">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="${MicrosoftAspNetCoreComponentsWebAssemblyServerVersion}" />
</ItemGroup>
<!--#endif -->
<!--#if UseWebAssembly && PWA -->

<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
<!--#endif -->

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<GeneratedContent Include="WebApi-FSharp.fsproj.in" OutputPath="content/WebApi-FSharp/Company.WebApplication1.fsproj" />
<GeneratedContent Include="Worker-CSharp.csproj.in" OutputPath="content/Worker-CSharp/Company.Application1.csproj" />
<GeneratedContent Include="Worker-FSharp.fsproj.in" OutputPath="content/Worker-FSharp/Company.Application1.fsproj" />
<GeneratedContent Include="Components-CSharp.csproj.in" OutputPath="content/Components-CSharp/Components-CSharp.csproj" />
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Client.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Client/ComponentsWebAssembly-CSharp.Client.csproj" />
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Shared.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Shared/ComponentsWebAssembly-CSharp.Shared.csproj" />
<GeneratedContent Include="ComponentsWebAssembly-CSharp.Server.csproj.in" OutputPath="content/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"skipRestore": {
"longName": "no-restore",
"shortName": ""
},
"PWA": {
"longName": "pwa",
"isHidden": true
},
"UseServer": {
"longName": "use-server",
"isHidden": true
},
"UseWebAssembly": {
"longName": "use-wasm",
"isHidden": true
},
"Framework": {
"longName": "framework"
},
"kestrelHttpPort": {
"isHidden": true
},
"kestrelHttpsPort": {
"isHidden": true
},
"iisHttpPort": {
"isHidden": true
},
"iisHttpsPort": {
"isHidden": true
},
"ExcludeLaunchSettings": {
"longName": "exclude-launch-settings",
"shortName": ""
},
"UserSecretsId": {
"isHidden": true
},
"NoHttps": {
"longName": "no-https",
"shortName": ""
},
"UseProgramMain": {
"longName": "use-program-main",
"shortName": ""
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "http://json.schemastore.org/ide.host",
"order": 610,
"icon": "icon.png",
"disableHttpsSymbol": "NoHttps",
"symbolInfo": [
{
"id": "UseServer",
"isVisible": false,
"persistenceScope": "templateGroup"
},
{
"id": "UseWebAssembly",
"isVisible": false,
"persistenceScope": "templateGroup"
},
{
"id": "PWA",
"isVisible": false,
"persistenceScope": "templateGroup"
},
{
"id": "UseProgramMain",
"isVisible": true,
"persistenceScope": "shared",
"persistenceScopeName": "Microsoft"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"author": "Microsoft",
"name": "Blazor Web App",
"description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net8.0/description": "Target net8.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/UseWebAssembly/displayName": "_Use interactive webassembly components",
"symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively on the browser using webassembly.",
"symbols/UseServer/displayName": "_Use interactive server components",
"symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.",
"symbols/PWA/displayName": "_Progressive Web Application",
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"author": "Microsoft",
"name": "Blazor Web App",
"description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net8.0/description": "Target net8.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/UseWebAssembly/displayName": "_Use interactive webassembly components",
"symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively on the browser using webassembly.",
"symbols/UseServer/displayName": "_Use interactive server components",
"symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.",
"symbols/PWA/displayName": "_Progressive Web Application",
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"author": "Microsoft",
"name": "Blazor Web App",
"description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net8.0/description": "Target net8.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/UseWebAssembly/displayName": "_Use interactive webassembly components",
"symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively on the browser using webassembly.",
"symbols/UseServer/displayName": "_Use interactive server components",
"symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.",
"symbols/PWA/displayName": "_Progressive Web Application",
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"author": "Microsoft",
"name": "Blazor Web App",
"description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net8.0/description": "Target net8.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/UseWebAssembly/displayName": "_Use interactive webassembly components",
"symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively on the browser using webassembly.",
"symbols/UseServer/displayName": "_Use interactive server components",
"symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.",
"symbols/PWA/displayName": "_Progressive Web Application",
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"author": "Microsoft",
"name": "Blazor Web App",
"description": "A project template for creating a Blazor app hosted inside an ASP.NET app that runs on the server. This template can be used for web apps with rich dynamic user interfaces (UIs).",
"symbols/Framework/description": "The target framework for the project.",
"symbols/Framework/choices/net8.0/description": "Target net8.0",
"symbols/skipRestore/description": "If specified, skips the automatic restore of the project on create.",
"symbols/ExcludeLaunchSettings/description": "Whether to exclude launchSettings.json from the generated template.",
"symbols/kestrelHttpPort/description": "Port number to use for the HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/iisHttpPort/description": "Port number to use for the IIS Express HTTP endpoint in launchSettings.json.",
"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 (no-https will be ignored if either IndividualAuth or OrganizationalAuth is used).",
"symbols/UseWebAssembly/displayName": "_Use interactive webassembly components",
"symbols/UseWebAssembly/description": "If specified, configures the project to render components interactively on the browser using webassembly.",
"symbols/UseServer/displayName": "_Use interactive server components",
"symbols/UseServer/description": "If specified, configures the project to render components interactively on the server.",
"symbols/PWA/displayName": "_Progressive Web Application",
"symbols/PWA/description": "If specified, produces a Progressive Web Application (PWA) supporting installation and offline use.",
"symbols/NoHttps/description": "Whether to turn off HTTPS. This option only applies if Individual, IndividualB2C, SingleOrg, or MultiOrg aren't used for --auth.",
"symbols/UseProgramMain/displayName": "Do not use _top-level statements",
"symbols/UseProgramMain/description": "Whether to generate an explicit Program class and Main method instead of top-level statements.",
"postActions/restore/description": "Restore NuGet packages required by this project.",
"postActions/restore/manualInstructions/default/text": "Run 'dotnet restore'"
}
Loading