Clean up and improve project templates

This commit is contained in:
Ronald Barendse
2022-02-23 23:20:13 +01:00
parent 4c037774de
commit 5813a8aadf
16 changed files with 602 additions and 650 deletions

View File

@@ -12,14 +12,10 @@ namespace Umbraco.Cms.Web.UI
.Build()
.Run();
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
public static IHostBuilder CreateHostBuilder(string[] args)
=> Host.CreateDefaultBuilder(args)
#if DEBUG
.ConfigureAppConfiguration(config
=> config.AddJsonFile(
"appsettings.Local.json",
optional: true,
reloadOnChange: true))
.ConfigureAppConfiguration(config => config.AddJsonFile("appsettings.Local.json", optional: true, reloadOnChange: true))
#endif
.ConfigureLogging(x => x.ClearProviders())
.ConfigureWebHostDefaults(webBuilder => webBuilder.UseStartup<Startup>());

View File

@@ -20,7 +20,7 @@ namespace Umbraco.Cms.Web.UI
/// <param name="webHostEnvironment">The web hosting environment.</param>
/// <param name="config">The configuration.</param>
/// <remarks>
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337
/// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337.
/// </remarks>
public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config)
{
@@ -34,18 +34,15 @@ namespace Umbraco.Cms.Web.UI
/// <param name="services">The services.</param>
/// <remarks>
/// This method gets called by the runtime. Use this method to add services to the container.
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
/// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940.
/// </remarks>
public void ConfigureServices(IServiceCollection services)
{
#pragma warning disable IDE0022 // Use expression body for methods
services.AddUmbraco(_env, _config)
.AddBackOffice()
.AddWebsite()
.AddComposers()
.Build();
#pragma warning restore IDE0022 // Use expression body for methods
}
/// <summary>

View File

@@ -3,89 +3,39 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Web.UI</RootNamespace>
<DefaultItemExcludes>
$(DefaultItemExcludes);
umbraco/Data/**;
umbraco/Logs/**;
wwwroot/umbraco/**
</DefaultItemExcludes>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DocumentationFile>bin/Release/Umbraco.Web.UI.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup>
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj" Condition="'$(OS)' == 'Windows_NT'" />
<ProjectReference Include="../Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj" />
<ProjectReference Include="../Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj" />
<ProjectReference Include="../Umbraco.Web.Common/Umbraco.Web.Common.csproj" />
<ProjectReference Include="../Umbraco.Web.Website/Umbraco.Web.Website.csproj" />
<ProjectReference Include="../Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj" Condition="'$(OS)' == 'Windows_NT'" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Condition="$(RuntimeIdentifier.StartsWith('linux')) Or $(RuntimeIdentifier.StartsWith('win')) Or ('$(RuntimeIdentifier)' == '' And !$([MSBuild]::IsOSPlatform('osx')))" Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Plugins" />
<Folder Include="Views" />
</ItemGroup>
<ItemGroup>
<Compile Remove="umbraco/Data/**" />
<Compile Remove="umbraco/logs/**" />
<Compile Remove="umbraco/mediacache/**" />
<Compile Remove="wwwroot/umbraco/**" />
<Compile Remove="App_Data/**" />
<Compile Remove="Controllers\**" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="App_Data/**" />
<EmbeddedResource Remove="umbraco/Data/**" />
<EmbeddedResource Remove="umbraco/logs/**" />
<EmbeddedResource Remove="umbraco/mediacache/**" />
<EmbeddedResource Remove="Controllers\**" />
</ItemGroup>
<ItemGroup>
<Content Remove="App_Data/**" />
<Content Remove="umbraco/Data/**" />
<Content Remove="umbraco/logs/**" />
<Content Remove="umbraco/mediacache/**" />
<Content Remove="umbraco\UmbracoWebsite\NotFound.cshtml" />
<Content Remove="wwwroot/Web.config" />
<Content Remove="Controllers\**" />
</ItemGroup>
<ItemGroup>
<None Include="config/**/*.*">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</None>
<None Include="umbraco/**/*.*">
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</None>
<None Remove="App_Data/**" />
<None Remove="umbraco/Data/**" />
<None Remove="umbraco/logs/**" />
<None Remove="umbraco/mediacache/**" />
<None Include="umbraco/UmbracoWebsite/NoNodes.cshtml" />
<None Remove="Controllers\**" />
</ItemGroup>
<!-- We don't want to include the generated files, they will throw a lot of errors -->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.11" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Umbraco.Code" Version="1.2.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="all" />
<PackageReference Include="Umbraco.Code" Version="1.2.0" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
@@ -96,8 +46,8 @@
<PropertyGroup>
<BellePath>$(ProjectDir)wwwroot/umbraco</BellePath>
<JsonSchemaPath>$(ProjectDir)umbraco/config/appsettings-schema.json</JsonSchemaPath>
</PropertyGroup>
<Target Name="CheckPreconditions" BeforeTargets="Build">
<Message Text="-CheckPreconditions-" Importance="high" />
<Message Text="JsonSchemaPath: $(JsonSchemaPath)" Importance="high" />
@@ -108,33 +58,33 @@
<Message Text="Skip Belle because $(BellePath) exists." Importance="High" Condition="Exists('$(BellePath)')" />
<Message Text="Build Belle because UmbracoBuild is empty (this is Visual Studio), and $(BellePath) does not exist." Importance="High" Condition="!Exists('$(BellePath)') and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="BelleBuild" Condition="!Exists('$(BellePath)') and '$(UmbracoBuild)' == ''" />
<Message Text="Skip JsonSchema generation because $(JsonSchemaPath) exists." Importance="High" Condition="Exists('$(JsonSchemaPath)')" />
<Message Text="Generate the appsettings json schema." Importance="High" Condition="!Exists('$(JsonSchemaPath)') and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="JsonSchemaBuild" Condition="!Exists('$(JsonSchemaPath)') and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="AppsettingsBuild" Condition="!Exists('appsettings.json')" />
<CallTarget Targets="AppsettingsDevBuild" Condition="!Exists('appsettings.Development.json')" />
</Target>
<Target Name="BelleBuild">
<Exec WorkingDirectory="$(ProjectDir)/../Umbraco.Web.UI.Client/" Command="npm ci" />
<Exec WorkingDirectory="$(ProjectDir)/../Umbraco.Web.UI.Client/" Command="npm ci --no-fund --no-audit --prefer-offline" />
<Exec WorkingDirectory="$(ProjectDir)/../Umbraco.Web.UI.Client/" Command="npm run build:skip-tests" />
</Target>
<Target Name="JsonSchemaBuild">
<!-- <Exec WorkingDirectory="$(ProjectDir)/../../" Command="powershell -ExecutionPolicy RemoteSigned -Command '&amp;dotnet run &#45;&#45;project $pwd/src/JsonSchema/JsonSchema.csproj -c Release &#45;&#45; &#45;&#45;outputFile $pwd/src/Umbraco.Web.UI/$(JsonSchemaPath)'" />-->
<!-- <Exec WorkingDirectory="$(ProjectDir)/../../" Command="powershell -ExecutionPolicy RemoteSigned -Command '&amp;dotnet run &#45;&#45;project $pwd/src/JsonSchema/JsonSchema.csproj -c Release &#45;&#45; &#45;&#45;outputFile $pwd/src/Umbraco.Web.UI/$(JsonSchemaPath)'" /> -->
</Target>
<Target Name="AppsettingsBuild">
<Message Text="Generating appsettings.json because it doesnt exist" Importance="High" />
<Copy SourceFiles="$(Projectdir)/appsettings.template.json" DestinationFiles="$(ProjectDir)/appsettings.json" />
</Target>
<Target Name="AppsettingsDevBuild">
<Message Text="Generating appsettings.Development.json because it doesnt exist" Importance="High" />
<Copy SourceFiles="$(ProjectDir)appsettings.Development.template.json" DestinationFiles="$(ProjectDir)appsettings.Development.json" />
</Target>
<!-- clean Belle when cleaning and rebuilding, but only in Visual Studio -->
<!-- Clean Belle when cleaning and rebuilding, but only in Visual Studio -->
<Target Name="CleanPreconditions" AfterTargets="Clean" Condition="'$(UmbracoBuild)' == ''">
<Message Text="-CleanPreconditions-" Importance="high" />
<Message Text="Nothing to clean, as $(BellePath) does not exist." Importance="High" Condition="!Exists('$(BellePath)')" />
@@ -144,8 +94,8 @@
<BelleLib Include="$(BellePath)" />
</ItemGroup>
<RemoveDir Directories="@(BelleLib)" Condition="Exists('$(BellePath)') and !Exists('$(SolutionDir)preserve.belle')" />
<Message Text="Remove $(JsonSchemaPath)." Importance="High" Condition="Exists('$(JsonSchemaPath)') and !Exists('$(SolutionDir)preserve.jsonschema')" />
<Delete Files="$(JsonSchemaPath)" Condition="Exists('$(JsonSchemaPath)') and !Exists('$(SolutionDir)preserve.jsonschema')" />
</Target>
</Project>

View File

@@ -1,6 +1,13 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"Framework": {
"longName": "Framework",
"shortName": "F"
},
"UmbracoVersion": {
"longName": "version",
"shortName": "v"
}
}
}

View File

@@ -1,13 +1,15 @@
{
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order" : 0,
"icon": "../../icon.png",
"description": {
"id": "UmbracoPackage",
"text": "Umbraco Package - An empty Umbraco CMS package (Plugin)"
},
"symbolInfo": [
]
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order": 0,
"icon": "../../icon.png",
"description": {
"id": "UmbracoPackage",
"text": "Umbraco Package - An empty Umbraco CMS package/plugin"
},
"symbolInfo": [
{
"id": "UmbracoVersion",
"isVisible": "true"
}
]
}

View File

@@ -1,99 +1,108 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"description": "An empty Umbraco Package/Plugin ready to get started",
"classifications": [ "Web", "CMS", "Umbraco", "Package", "Plugin"],
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
"name": "Umbraco Package",
"shortName": "umbracopackage",
"defaultName": "UmbracoPackage1",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
},
"primaryOutputs": [
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"classifications": [
"Web",
"CMS",
"Umbraco",
"Package",
"Plugin"
],
"name": "Umbraco Package",
"description": "An empty Umbraco package/plugin project ready to get started",
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
"shortName": "umbracopackage",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "UmbracoPackage",
"defaultName": "UmbracoPackage1",
"preferNameDirectory": true,
"symbols": {
"Framework": {
"displayName": "Framework",
"description": "The target framework for the project.",
"type": "parameter",
"datatype": "choice",
"choices": [
{
"path": "UmbracoPackage.csproj"
}
],
"sourceName": "UmbracoPackage",
"preferNameDirectory": true,
"symbols": {
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.4.0-rc",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"namespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "UmbracoPackage",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
}
},
"msbuildReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "UmbracoPackageMsBuild",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": ""
},
{
"regex": "\\.",
"replacement": ""
},
{
"regex": "-",
"replacement": ""
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": ""
}
]
}
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{
"choice": "net6.0",
"description": "Target net6.0"
}
],
"replaces": "net5.0",
"defaultValue": "net5.0"
"displayName": ".NET 5.0",
"description": "Target net5.0",
"choice": "net5.0"
},
{
"displayName": ".NET 6.0",
"description": "Target net6.0",
"choice": "net6.0"
}
],
"defaultValue": "net5.0",
"replaces": "net5.0"
},
"UmbracoVersion": {
"displayName": "Umbraco version",
"description": "The version of Umbraco.Cms to add as PackageReference.",
"type": "parameter",
"datatype": "string",
"defaultValue": "9.4.0-rc",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"namespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
},
"replaces": "UmbracoPackage"
},
"msbuildReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": ""
},
{
"regex": "\\.",
"replacement": ""
},
{
"regex": "-",
"replacement": ""
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": ""
}
]
},
"replaces": "UmbracoPackageMsBuild"
}
},
"primaryOutputs": [
{
"path": "UmbracoPackage.csproj"
}
]
}

View File

@@ -1,2 +1,5 @@
{
"name": "UmbracoPackage",
"version": "",
"allowPackageTelemetry": true
}

View File

@@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE"/>
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="UMBRACO_VERSION_FROM_TEMPLATE"/>
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
</ItemGroup>
<ItemGroup>
@@ -22,7 +22,7 @@
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
</Content>
<None Include="build\**\*.*">
<Pack>True</Pack>
<Pack>true</Pack>
<PackagePath>buildTransitive</PackagePath>
</None>
</ItemGroup>

View File

@@ -9,11 +9,7 @@
<UmbracoPackageMsBuildContentFiles Include="$(UmbracoPackageMsBuildContentFilesPath)" />
</ItemGroup>
<Message Text="Copying UmbracoPackage files: $(UmbracoPackageMsBuildContentFilesPath) - #@(UmbracoPackageMsBuildContentFiles->Count()) files" Importance="high" />
<Copy
SourceFiles="@(UmbracoPackageMsBuildContentFiles)"
DestinationFiles="@(UmbracoPackageMsBuildContentFiles->'$(MSBuildProjectDirectory)\App_Plugins\UmbracoPackage\%(RecursiveDir)%(Filename)%(Extension)')"
SkipUnchangedFiles="true" />
<Copy SourceFiles="@(UmbracoPackageMsBuildContentFiles)" DestinationFiles="@(UmbracoPackageMsBuildContentFiles->'$(MSBuildProjectDirectory)\App_Plugins\UmbracoPackage\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
</Target>
<Target Name="ClearUmbracoPackageMsBuildAssets" BeforeTargets="Clean">

View File

@@ -464,9 +464,6 @@ $RECYCLE.BIN/
# Umbraco log files
**/umbraco/Logs/
# Dont commit files that are generated and cached from the default ImageSharp location
**/umbraco/mediacache/
# Umbraco backoffice language files
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
# Customize langguage files in /config/lang/{language}.user.xml

View File

@@ -1,47 +1,55 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"PackageTestSiteName": {
"longName": "PackageTestSiteName",
"shortName": "p"
},
"UseSqlCe": {
"longName": "SqlCe",
"shortName": "ce"
},
"SkipRestore": {
"longName": "no-restore",
"shortName": ""
},
"FriendlyName": {
"longName": "friendly-name",
"shortName": ""
},
"Email": {
"longName": "email",
"shortName": ""
},
"Password": {
"longName": "password",
"shortName": ""
},
"ConnectionString":{
"longName": "connection-string",
"shortName": ""
},
"NoNodesViewPath":{
"longName": "no-nodes-view-path",
"shortName": ""
},
"UseHttpsRedirect": {
"longName": "use-https-redirect",
"shortName": ""
}
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"Framework": {
"longName": "Framework",
"shortName": "F"
},
"usageExamples": [
"dotnet new umbraco -n MyNewProject",
"dotnet new umbraco -n MyNewProjectWithCE -ce",
"dotnet new umbraco -n MyNewProject --no-restore",
"dotnet new umbraco -n MyNewProject --friendly-name \"Friendly User\" --email user@email.com --password password1234 --connection-string \"Server=ConnectionStringHere\""
]
"UmbracoVersion": {
"longName": "version",
"shortName": "v"
},
"UseHttpsRedirect": {
"longName": "use-https-redirect",
"shortName": ""
},
"UseSqlCe": {
"longName": "SqlCe",
"shortName": "ce"
},
"SkipRestore": {
"longName": "no-restore",
"shortName": ""
},
"UnattendedUserName": {
"longName": "friendly-name",
"shortName": ""
},
"UnattendedUserEmail": {
"longName": "email",
"shortName": ""
},
"UnattendedUserPassword": {
"longName": "password",
"shortName": ""
},
"ConnectionString": {
"longName": "connection-string",
"shortName": ""
},
"NoNodesViewPath": {
"longName": "no-nodes-view-path",
"shortName": ""
},
"PackageProjectName": {
"longName": "PackageTestSiteName",
"shortName": "p"
}
},
"usageExamples": [
"dotnet new umbraco -n MyNewProject",
"dotnet new umbraco -n MyNewProjectUsingSqlCE -ce",
"dotnet new umbraco -n MyNewProject --no-restore",
"dotnet new umbraco -n MyNewProject --friendly-name \"Friendly Admin User\" --email admin@example.com --password password1234 --connection-string \"Server=ConnectionStringHere\""
]
}

View File

@@ -1,74 +1,51 @@
{
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order" : 0,
"icon": "../../icon.png",
"description": {
"id": "UmbracoProject",
"text": "Umbraco Web Application - An empty Umbraco CMS web application"
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order": 0,
"icon": "../../icon.png",
"description": {
"id": "UmbracoProject",
"text": "Umbraco Web Application - An empty Umbraco CMS web application"
},
"symbolInfo": [
{
"id": "UmbracoVersion",
"isVisible": "true"
},
"symbolInfo": [
{
"id": "UseSqlCe",
"name": {
"text": "Use Sql Compact Edition (SqlCE)"
},
"isVisible": "true"
},
{
"id": "SkipRestore",
"name": {
"text": "Skips the automatic NuGet restore of the project on create"
},
"isVisible": "true"
},
{
"id": "PackageTestSiteName",
"name": {
"text": "Optional: Specify the name of a package that this should be a test site for"
},
"isVisible": "true"
},
{
"id": "FriendlyName",
"name": {
"text": "Optional: The friendly name of the user for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "Email",
"name": {
"text": "Optional: Email to use for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "Password",
"name": {
"text": "Optional: Password to use for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "ConnectionString",
"name": {
"text": "Optional: Database connection string when using Unattended install"
},
"isVisible": "true"
},
{
"id": "NoNodesViewPath",
"name": {
"text": "Optional: Path to a custom view presented with the Umbraco installation contains no published content"
},
"isVisible": "true"
},
{
"id": "UseHttpsRedirect",
"name": {
"text": "Optional: Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting."
},
"isVisible": "true"
}
]
{
"id": "UseHttpsRedirect",
"isVisible": "true"
},
{
"id": "UseSqlCe",
"isVisible": "true"
},
{
"id": "SkipRestore",
"isVisible": "true"
},
{
"id": "UnattendedUserName",
"isVisible": "true"
},
{
"id": "UnattendedUserEmail",
"isVisible": "true"
},
{
"id": "UnattendedUserPassword",
"isVisible": "true"
},
{
"id": "ConnectionString",
"isVisible": "true"
},
{
"id": "NoNodesViewPath",
"isVisible": "true"
},
{
"id": "PackageProjectName",
"isVisible": "true"
}
]
}

View File

@@ -1,304 +1,326 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"description": "An empty Umbraco Project ready to get started",
"classifications": [ "Web", "CMS", "Umbraco"],
"groupIdentity": "Umbraco.Templates.UmbracoProject",
"identity": "Umbraco.Templates.UmbracoProject.CSharp",
"name": "Umbraco Project",
"shortName": "umbraco",
"defaultName": "UmbracoProject1",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"classifications": [
"Web",
"CMS",
"Umbraco"
],
"name": "Umbraco Project",
"description": "An empty Umbraco project ready to get started",
"groupIdentity": "Umbraco.Templates.UmbracoProject",
"identity": "Umbraco.Templates.UmbracoProject.CSharp",
"shortName": "umbraco",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "UmbracoProject",
"defaultName": "UmbracoProject1",
"preferNameDirectory": true,
"symbols": {
"Framework": {
"displayName": "Framework",
"description": "The target framework for the project.",
"type": "parameter",
"datatype": "choice",
"choices": [
{
"displayName": ".NET 5.0",
"description": "Target net5.0",
"choice": "net5.0"
},
{
"displayName": ".NET 6.0",
"description": "Target net6.0",
"choice": "net6.0"
}
],
"defaultValue": "net5.0",
"replaces": "net5.0"
},
"primaryOutputs": [
{
"path": "UmbracoProject.csproj"
}
],
"postActions": [
{
"condition": "(!SkipRestore)",
"description": "Restore NuGet packages required by this project",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}
],
"sourceName": "UmbracoProject",
"symbols": {
"namespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "Umbraco.Cms.Web.UI",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
}
},
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.4.0-rc",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"PackageTestSiteName": {
"type": "parameter",
"datatype":"text",
"defaultValue": "",
"replaces":"PackageTestSiteName",
"description": "The name of the package this should be a test site for (Default: '')"
},
"UseSqlCe":{
"type": "parameter",
"datatype":"bool",
"defaultValue": "false",
"description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)"
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project",
"datatype": "choice",
"choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{
"choice": "net6.0",
"description": "Target net6.0"
}
],
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"SkipRestore": {
"type": "parameter",
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create",
"defaultValue": "false"
},
"HttpPort": {
"type": "generated",
"generator": "port",
"replaces": "HTTP_PORT_FROM_TEMPLATE",
"parameters": {
"high": 65535,
"low": 1024,
"fallback": 5000
}
},
"HttpsPort": {
"type": "generated",
"generator": "port",
"replaces": "HTTPS_PORT_FROM_TEMPLATE",
"parameters": {
"low": 44300,
"high": 44399,
"fallback": 5001
}
},
"FriendlyName":{
"type": "parameter",
"datatype":"text",
"description": "The friendly name of the user for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"FriendlyNameReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "FRIENDLY_NAME_FROM_TEMPLATE",
"parameters": {
"source": "FriendlyName",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"Email":{
"type": "parameter",
"datatype":"text",
"description": "Email to use for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"EmailReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "EMAIL_FROM_TEMPLATE",
"parameters": {
"source": "Email",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"Password":{
"type": "parameter",
"datatype":"text",
"description": "Password to use for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"PasswordReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "PASSWORD_FROM_TEMPLATE",
"parameters": {
"source": "Password",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"ConnectionString":{
"type": "parameter",
"datatype":"text",
"description": "Database connection string when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"ConnectionStringReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "CONNECTION_FROM_TEMPLATE",
"parameters": {
"source": "ConnectionString",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"NoNodesViewPath":{
"type": "parameter",
"datatype":"text",
"description": "Path to a custom view presented with the Umbraco installation contains no published content",
"defaultValue": ""
},
"NoNodesViewPathReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
"parameters": {
"source": "NoNodesViewPath",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"HasConnectionString":{
"type": "computed",
"value": "(ConnectionString != \"\")"
},
"HasNoNodesViewPath":{
"type": "computed",
"value": "(NoNodesViewPath != \"\")"
},
"UsingUnattenedInstall":{
"type": "computed",
"value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")"
},
"UseHttpsRedirect":{
"type": "parameter",
"datatype":"bool",
"defaultValue": "false",
"description": "Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting (Default: false)"
}
"UmbracoVersion": {
"displayName": "Umbraco version",
"description": "The version of Umbraco.Cms to add as PackageReference.",
"type": "parameter",
"datatype": "string",
"defaultValue": "9.4.0-rc",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"UseHttpsRedirect": {
"displayName": "Use HTTPS redirect",
"description": "Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting.",
"type": "parameter",
"datatype": "bool",
"defaultValue": "false"
},
"UseSqlCe": {
"displayName": "Add dependencies to use SQL CE database provider",
"description": "Adds the required dependencies to use SQL Compact Edition as database provider (Windows only).",
"type": "parameter",
"datatype": "bool",
"defaultValue": "false"
},
"SkipRestore": {
"displayName": "Skip restore",
"description": "If specified, skips the automatic restore of the project on create.",
"type": "parameter",
"datatype": "bool",
"defaultValue": "false"
},
"UnattendedUserName": {
"displayName": "Unattended user name",
"description": "Used to specify the name of the default admin user when using unattended install (stored as plain text).",
"type": "parameter",
"datatype": "string",
"defaultValue": ""
},
"UnattendedUserNameReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "UnattendedUserName",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
},
"replaces": "UNATTENDED_USER_NAME_FROM_TEMPLATE"
},
"UnattendedUserEmail": {
"displayName": "Unattended user email",
"description": "Used to specify the email of the default admin user when using unattended install (stored as plain text).",
"type": "parameter",
"datatype": "string",
"defaultValue": ""
},
"UnattendedUserEmailReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "UnattendedUserEmail",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
},
"replaces": "UNATTENDED_USER_EMAIL_FROM_TEMPLATE"
},
"UnattendedUserPassword": {
"displayName": "Unattended user password",
"description": "Used to specify the password of the default admin user when using unattended install (stored as plain text).",
"type": "parameter",
"datatype": "string",
"defaultValue": ""
},
"UnattendedUserPasswordReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "UnattendedUserPassword",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
},
"replaces": "UNATTENDED_USER_PASSWORD_FROM_TEMPLATE"
},
"ConnectionString": {
"displayName": "Connection string",
"description": "Database connection string used by Umbraco.",
"type": "parameter",
"datatype": "string",
"defaultValue": ""
},
"ConnectionStringReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "ConnectionString",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
},
"replaces": "CONNECTION_STRING_FROM_TEMPLATE"
},
"HasConnectionString": {
"type": "computed",
"value": "(ConnectionString != \"\")"
},
"UsingUnattenedInstall": {
"type": "computed",
"value": "(UnattendedUserName != \"\" && UnattendedUserEmail != \"\" && UnattendedUserPassword != \"\" && ConnectionString != \"\")"
},
"NoNodesViewPath": {
"displayName": "No nodes view path",
"description": "Path to a custom view presented with the Umbraco installation contains no published content",
"type": "parameter",
"datatype": "string",
"defaultValue": ""
},
"NoNodesViewPathReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "NoNodesViewPath",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
},
"replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE"
},
"HasNoNodesViewPath": {
"type": "computed",
"value": "(NoNodesViewPath != \"\")"
},
"PackageProjectName": {
"displayName": "Umbraco package project name",
"description": "The name of the package project this should be a test site for.",
"type": "parameter",
"datatype": "string",
"defaultValue": "",
"replaces": "PACKAGE_PROJECT_NAME_FROM_TEMPLATE"
},
"NamespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
},
"replaces": "Umbraco.Cms.Web.UI"
},
"HttpPort": {
"type": "generated",
"generator": "port",
"parameters": {
"fallback": 5000
},
"replaces": "HTTP_PORT_FROM_TEMPLATE"
},
"HttpsPort": {
"type": "generated",
"generator": "port",
"parameters": {
"low": 44300,
"high": 44399,
"fallback": 5001
},
"replaces": "HTTPS_PORT_FROM_TEMPLATE"
},
"TelemetryId": {
"type": "generated",
"generator": "guid",
"replaces": "TELEMETRYID_FROM_TEMPLATE"
}
},
"primaryOutputs": [
{
"path": "UmbracoProject.csproj"
}
],
"postActions": [
{
"condition": "(!SkipRestore)",
"description": "Restore NuGet packages required by this project",
"manualInstructions": [
{
"text": "Run 'dotnet restore'"
}
],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}
]
}

View File

@@ -11,20 +11,15 @@
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" Condition="'$(UseSqlCe)' == 'true'" />
</ItemGroup>
<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
<!-- Force Windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older Windows 10 and most, if not all, Windows Server editions will run NLS -->
<ItemGroup>
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption
Condition="$(RuntimeIdentifier.StartsWith('linux')) Or $(RuntimeIdentifier.StartsWith('win')) Or ('$(RuntimeIdentifier)' == '' And !$([MSBuild]::IsOSPlatform('osx')))"
Include="System.Globalization.AppLocalIcu"
Value="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) Or $(RuntimeIdentifier.StartsWith('win')) Or ('$(RuntimeIdentifier)' == '' And !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>
<Import Project="..\PackageTestSiteName\build\PackageTestSiteName.targets" Condition="'$(PackageTestSiteName)' != ''" />
<ItemGroup Condition="'$(PackageTestSiteName)' != ''">
<ProjectReference Include="..\PackageTestSiteName\PackageTestSiteName.csproj" />
<Import Project="..\PACKAGE_PROJECT_NAME_FROM_TEMPLATE\build\PACKAGE_PROJECT_NAME_FROM_TEMPLATE.targets" Condition="'$(PackageProjectName)' != ''" />
<ItemGroup Condition="'$(PackageProjectName)' != ''">
<ProjectReference Include="..\PACKAGE_PROJECT_NAME_FROM_TEMPLATE\PACKAGE_PROJECT_NAME_FROM_TEMPLATE.csproj" />
</ItemGroup>
<PropertyGroup>

View File

@@ -1,5 +1,5 @@
{
"$schema" : "./umbraco/config/appsettings-schema.json",
"$schema": "./umbraco/config/appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information"
@@ -19,22 +19,22 @@
},
//#if (HasConnectionString)
"ConnectionStrings": {
"umbracoDbDSN": "CONNECTION_FROM_TEMPLATE"
"umbracoDbDSN": "CONNECTION_STRING_FROM_TEMPLATE"
},
//#endif
"Umbraco": {
"CMS": {
"Content": {
"MacroErrors": "Throw"
},
//#if (UsingUnattenedInstall)
"Unattended": {
"InstallUnattended": true,
"UnattendedUserName": "FRIENDLY_NAME_FROM_TEMPLATE",
"UnattendedUserEmail": "EMAIL_FROM_TEMPLATE",
"UnattendedUserPassword": "PASSWORD_FROM_TEMPLATE"
"UnattendedUserName": "UNATTENDED_USER_NAME_FROM_TEMPLATE",
"UnattendedUserEmail": "UNATTENDED_USER_EMAIL_FROM_TEMPLATE",
"UnattendedUserPassword": "UNATTENDED_USER_PASSWORD_FROM_TEMPLATE"
},
//#endif
"Content": {
"MacroErrors": "Throw"
},
"Global": {
"Smtp": {
"From": "your@email.here",
@@ -51,4 +51,4 @@
}
}
}
}
}

View File

@@ -1,5 +1,5 @@
{
"$schema" : "./umbraco/config/appsettings-schema.json",
"$schema": "./umbraco/config/appsettings-schema.json",
"Serilog": {
"MinimumLevel": {
"Default": "Information",
@@ -11,26 +11,19 @@
}
},
"ConnectionStrings": {
"umbracoDbDSN": ""
"umbracoDbDSN": null
},
"Umbraco": {
"CMS": {
//#if (HasNoNodesViewPath || UseHttpsRedirect)
"Global": {
"SanitizeTinyMce": true,
//#if (!HasNoNodesViewPath && UseHttpsRedirect)
"UseHttps": true
//#elseif (UseHttpsRedirect)
"Id": "TELEMETRYID_FROM_TEMPLATE",
//#if (UseHttpsRedirect)
"UseHttps": true,
//#endif
//#if (HasNoNodesViewPath)
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE"
"NoNodesViewPath": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
//#endif
},
//#endif
"Hosting": {
"Debug": false
"SanitizeTinyMce": true
},
"Content": {
"ContentVersionCleanupPolicy": {