From 5813a8aadf56ec15f4fee41ecd1bb852a230fcec Mon Sep 17 00:00:00 2001 From: Ronald Barendse Date: Wed, 23 Feb 2022 23:20:13 +0100 Subject: [PATCH] Clean up and improve project templates --- src/Umbraco.Web.UI/Program.cs | 10 +- src/Umbraco.Web.UI/Startup.cs | 7 +- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 94 +-- .../.template.config/dotnetcli.host.json | 13 +- .../.template.config/ide.host.json | 24 +- .../.template.config/template.json | 197 +++--- .../UmbracoPackage/package.manifest | 3 + .../UmbracoPackage/UmbracoPackage.csproj | 6 +- .../build/UmbracoPackage.targets | 6 +- templates/UmbracoProject/.gitignore | 3 - .../.template.config/dotnetcli.host.json | 96 +-- .../.template.config/ide.host.json | 119 ++-- .../.template.config/template.json | 622 +++++++++--------- .../UmbracoProject/UmbracoProject.csproj | 15 +- .../appsettings.Development.json | 18 +- templates/UmbracoProject/appsettings.json | 19 +- 16 files changed, 602 insertions(+), 650 deletions(-) diff --git a/src/Umbraco.Web.UI/Program.cs b/src/Umbraco.Web.UI/Program.cs index 797fd00562..9b77c126b7 100644 --- a/src/Umbraco.Web.UI/Program.cs +++ b/src/Umbraco.Web.UI/Program.cs @@ -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()); diff --git a/src/Umbraco.Web.UI/Startup.cs b/src/Umbraco.Web.UI/Startup.cs index 71c3dd008c..e0a48216e0 100644 --- a/src/Umbraco.Web.UI/Startup.cs +++ b/src/Umbraco.Web.UI/Startup.cs @@ -20,7 +20,7 @@ namespace Umbraco.Cms.Web.UI /// The web hosting environment. /// The configuration. /// - /// 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. /// public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) { @@ -34,18 +34,15 @@ namespace Umbraco.Cms.Web.UI /// The services. /// /// 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. /// 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 - } /// diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 4222f4312d..33129accef 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -3,89 +3,39 @@ net5.0 Umbraco.Cms.Web.UI + + $(DefaultItemExcludes); + umbraco/Data/**; + umbraco/Logs/**; + wwwroot/umbraco/** + - + + bin/Release/Umbraco.Web.UI.xml + true + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - Always - - - true - Always - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - + + @@ -96,8 +46,8 @@ $(ProjectDir)wwwroot/umbraco $(ProjectDir)umbraco/config/appsettings-schema.json - + @@ -108,33 +58,33 @@ - - - + - + + - + + + - - + @@ -144,8 +94,8 @@ - + diff --git a/templates/UmbracoPackage/.template.config/dotnetcli.host.json b/templates/UmbracoPackage/.template.config/dotnetcli.host.json index 141f7bf97c..0f64d676c1 100644 --- a/templates/UmbracoPackage/.template.config/dotnetcli.host.json +++ b/templates/UmbracoPackage/.template.config/dotnetcli.host.json @@ -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" } + } } diff --git a/templates/UmbracoPackage/.template.config/ide.host.json b/templates/UmbracoPackage/.template.config/ide.host.json index aa4eb34552..baec9f98c6 100644 --- a/templates/UmbracoPackage/.template.config/ide.host.json +++ b/templates/UmbracoPackage/.template.config/ide.host.json @@ -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" + } + ] } diff --git a/templates/UmbracoPackage/.template.config/template.json b/templates/UmbracoPackage/.template.config/template.json index 082f9301bf..733853d1ec 100644 --- a/templates/UmbracoPackage/.template.config/template.json +++ b/templates/UmbracoPackage/.template.config/template.json @@ -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" + } + ] } diff --git a/templates/UmbracoPackage/App_Plugins/UmbracoPackage/package.manifest b/templates/UmbracoPackage/App_Plugins/UmbracoPackage/package.manifest index 8593c62d96..906db79b7a 100644 --- a/templates/UmbracoPackage/App_Plugins/UmbracoPackage/package.manifest +++ b/templates/UmbracoPackage/App_Plugins/UmbracoPackage/package.manifest @@ -1,2 +1,5 @@ { + "name": "UmbracoPackage", + "version": "", + "allowPackageTelemetry": true } \ No newline at end of file diff --git a/templates/UmbracoPackage/UmbracoPackage.csproj b/templates/UmbracoPackage/UmbracoPackage.csproj index a1ec4fa23d..f203c34a3d 100644 --- a/templates/UmbracoPackage/UmbracoPackage.csproj +++ b/templates/UmbracoPackage/UmbracoPackage.csproj @@ -12,8 +12,8 @@ - - + + @@ -22,7 +22,7 @@ Always - True + true buildTransitive diff --git a/templates/UmbracoPackage/build/UmbracoPackage.targets b/templates/UmbracoPackage/build/UmbracoPackage.targets index 5e3abf6ae1..33d3689179 100644 --- a/templates/UmbracoPackage/build/UmbracoPackage.targets +++ b/templates/UmbracoPackage/build/UmbracoPackage.targets @@ -9,11 +9,7 @@ - - + diff --git a/templates/UmbracoProject/.gitignore b/templates/UmbracoProject/.gitignore index f4caa41045..602728d104 100644 --- a/templates/UmbracoProject/.gitignore +++ b/templates/UmbracoProject/.gitignore @@ -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 diff --git a/templates/UmbracoProject/.template.config/dotnetcli.host.json b/templates/UmbracoProject/.template.config/dotnetcli.host.json index d357188ed7..68f7f906be 100644 --- a/templates/UmbracoProject/.template.config/dotnetcli.host.json +++ b/templates/UmbracoProject/.template.config/dotnetcli.host.json @@ -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\"" + ] } diff --git a/templates/UmbracoProject/.template.config/ide.host.json b/templates/UmbracoProject/.template.config/ide.host.json index d44cb154c1..893b9cc3f9 100644 --- a/templates/UmbracoProject/.template.config/ide.host.json +++ b/templates/UmbracoProject/.template.config/ide.host.json @@ -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" + } + ] } diff --git a/templates/UmbracoProject/.template.config/template.json b/templates/UmbracoProject/.template.config/template.json index 810940c4eb..9966070519 100644 --- a/templates/UmbracoProject/.template.config/template.json +++ b/templates/UmbracoProject/.template.config/template.json @@ -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 + } + ] } diff --git a/templates/UmbracoProject/UmbracoProject.csproj b/templates/UmbracoProject/UmbracoProject.csproj index 6b47686415..2459c071de 100644 --- a/templates/UmbracoProject/UmbracoProject.csproj +++ b/templates/UmbracoProject/UmbracoProject.csproj @@ -11,20 +11,15 @@ - + - - + - - - - + + + diff --git a/templates/UmbracoProject/appsettings.Development.json b/templates/UmbracoProject/appsettings.Development.json index dad70ac5d8..e132ce944d 100644 --- a/templates/UmbracoProject/appsettings.Development.json +++ b/templates/UmbracoProject/appsettings.Development.json @@ -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 @@ } } } -} \ No newline at end of file +} diff --git a/templates/UmbracoProject/appsettings.json b/templates/UmbracoProject/appsettings.json index 99e877812c..896d67d5fa 100644 --- a/templates/UmbracoProject/appsettings.json +++ b/templates/UmbracoProject/appsettings.json @@ -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": {