diff --git a/templates/Umbraco.Templates.csproj b/templates/Umbraco.Templates.csproj index 10bbd666d1..3f9e1f0ce4 100644 --- a/templates/Umbraco.Templates.csproj +++ b/templates/Umbraco.Templates.csproj @@ -12,6 +12,7 @@ + UmbracoProject\Program.cs diff --git a/templates/UmbracoPackage/.template.config/dotnetcli.host.json b/templates/UmbracoPackage/.template.config/dotnetcli.host.json index 6bd79b7fd9..6473c5c643 100644 --- a/templates/UmbracoPackage/.template.config/dotnetcli.host.json +++ b/templates/UmbracoPackage/.template.config/dotnetcli.host.json @@ -3,11 +3,16 @@ "symbolInfo": { "Framework": { "longName": "Framework", - "shortName": "F" + "shortName": "F", + "isHidden": true }, "UmbracoVersion": { "longName": "version", "shortName": "v" + }, + "SkipRestore": { + "longName": "no-restore", + "shortName": "" } } } diff --git a/templates/UmbracoPackage/.template.config/template.json b/templates/UmbracoPackage/.template.config/template.json index 36c93da093..b1b4ef9425 100644 --- a/templates/UmbracoPackage/.template.config/template.json +++ b/templates/UmbracoPackage/.template.config/template.json @@ -41,9 +41,16 @@ "description": "The version of Umbraco.Cms to add as PackageReference.", "type": "parameter", "datatype": "string", - "defaultValue": "10.0.0-rc1", + "defaultValue": "11.0.0", "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" }, + "SkipRestore": { + "displayName": "Skip restore", + "description": "If specified, skips the automatic restore of the project on create.", + "type": "parameter", + "datatype": "bool", + "defaultValue": "false" + }, "Namespace": { "type": "derived", "valueSource": "name", @@ -83,5 +90,19 @@ { "path": "UmbracoPackage.csproj" } + ], + "postActions": [ + { + "id": "restore", + "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/UmbracoPackageRcl/.template.config/dotnetcli.host.json b/templates/UmbracoPackageRcl/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..9a960b348e --- /dev/null +++ b/templates/UmbracoPackageRcl/.template.config/dotnetcli.host.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://json.schemastore.org/dotnetcli.host.json", + "symbolInfo": { + "Framework": { + "longName": "Framework", + "shortName": "F", + "isHidden": true + }, + "UmbracoVersion": { + "longName": "version", + "shortName": "" + }, + "SkipRestore": { + "longName": "no-restore", + "shortName": "" + }, + "SupportPagesAndViews": { + "longName": "support-pages-and-views", + "shortName": "s" + } + } +} diff --git a/templates/UmbracoPackageRcl/.template.config/ide.host.json b/templates/UmbracoPackageRcl/.template.config/ide.host.json new file mode 100644 index 0000000000..8e630f1e99 --- /dev/null +++ b/templates/UmbracoPackageRcl/.template.config/ide.host.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/ide.host.json", + "order": 0, + "icon": "../../icon.png", + "description": { + "id": "UmbracoPackageRcl", + "text": "Umbraco Package RCL - An empty Umbraco package/plugin (Razor Class Library)." + }, + "symbolInfo": [ + { + "id": "UmbracoVersion", + "isVisible": true + }, + { + "id": "SupportPagesAndViews", + "isVisible": true, + "persistenceScope": "templateGroup" + } + ] +} diff --git a/templates/UmbracoPackageRcl/.template.config/template.json b/templates/UmbracoPackageRcl/.template.config/template.json new file mode 100644 index 0000000000..c61289f6c2 --- /dev/null +++ b/templates/UmbracoPackageRcl/.template.config/template.json @@ -0,0 +1,82 @@ +{ + "$schema": "https://json.schemastore.org/template.json", + "author": "Umbraco HQ", + "classifications": [ + "Web", + "CMS", + "Umbraco", + "Package", + "Plugin", + "Razor Class Library" + ], + "name": "Umbraco Package RCL", + "description": "An empty Umbraco package/plugin (Razor Class Library).", + "groupIdentity": "Umbraco.Templates.UmbracoPackageRcl", + "identity": "Umbraco.Templates.UmbracoPackageRcl.CSharp", + "shortName": "umbracopackage-rcl", + "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": [ + { + "displayName": ".NET 7.0", + "description": "Target net7.0", + "choice": "net7.0" + } + ], + "defaultValue": "net7.0", + "replaces": "net7.0" + }, + "UmbracoVersion": { + "displayName": "Umbraco version", + "description": "The version of Umbraco.Cms to add as PackageReference.", + "type": "parameter", + "datatype": "string", + "defaultValue": "11.0.0", + "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" + }, + "SkipRestore": { + "displayName": "Skip restore", + "description": "If specified, skips the automatic restore of the project on create.", + "type": "parameter", + "datatype": "bool", + "defaultValue": "false" + }, + "SupportPagesAndViews": { + "type": "parameter", + "datatype": "bool", + "defaultValue": "false", + "displayName": "Support pages and views", + "description": "Whether to support adding traditional Razor pages and Views to this library." + } + }, + "primaryOutputs": [ + { + "path": "UmbracoPackage.csproj" + } + ], + "postActions": [ + { + "id": "restore", + "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/UmbracoPackageRcl/UmbracoPackage.csproj b/templates/UmbracoPackageRcl/UmbracoPackage.csproj new file mode 100644 index 0000000000..5c980684ce --- /dev/null +++ b/templates/UmbracoPackageRcl/UmbracoPackage.csproj @@ -0,0 +1,27 @@ + + + net7.0 + enable + enable + true + UmbracoPackage + App_Plugins/UmbracoPackage + + + + UmbracoPackage + UmbracoPackage + UmbracoPackage + ... + umbraco plugin package + + + + + + + + + + + diff --git a/templates/UmbracoPackageRcl/wwwroot/package.manifest b/templates/UmbracoPackageRcl/wwwroot/package.manifest new file mode 100644 index 0000000000..6aadd0cee6 --- /dev/null +++ b/templates/UmbracoPackageRcl/wwwroot/package.manifest @@ -0,0 +1,5 @@ +{ + "name": "UmbracoPackage", + "version": "", + "allowPackageTelemetry": true +} diff --git a/templates/UmbracoProject/.template.config/dotnetcli.host.json b/templates/UmbracoProject/.template.config/dotnetcli.host.json index 7f5479eab0..dfd6f80184 100644 --- a/templates/UmbracoProject/.template.config/dotnetcli.host.json +++ b/templates/UmbracoProject/.template.config/dotnetcli.host.json @@ -3,7 +3,8 @@ "symbolInfo": { "Framework": { "longName": "Framework", - "shortName": "F" + "shortName": "F", + "isHidden": true }, "UmbracoVersion": { "longName": "version", @@ -55,14 +56,15 @@ }, "PackageProjectName": { "longName": "PackageTestSiteName", - "shortName": "p" + "shortName": "p", + "isHidden": true } }, "usageExamples": [ - "dotnet new umbraco -n MyNewProject", - "dotnet new umbraco -n MyNewProject --no-restore", - "dotnet new umbraco -n MyNewProject --development-database-type SQLite", - "dotnet new umbraco -n MyNewProject --development-database-type LocalDB", - "dotnet new umbraco -n MyNewProject --friendly-name \"Friendly Admin User\" --email admin@example.com --password password1234 --connection-string \"Server=ConnectionStringHere\"" + "dotnet new umbraco --name MyNewProject", + "dotnet new umbraco --name MyNewProject --no-restore", + "dotnet new umbraco --name MyNewProject --development-database-type SQLite", + "dotnet new umbraco --name MyNewProject --development-database-type LocalDB", + "dotnet new umbraco --name MyNewProject --friendly-name \"Administrator\" --email admin@example.com --password 1234567890 --connection-string \"Server=(local);Database=MyNewProject;Trusted_Connection=True;\"" ] } diff --git a/templates/UmbracoProject/.template.config/ide.host.json b/templates/UmbracoProject/.template.config/ide.host.json index 617f924f97..1a302779cc 100644 --- a/templates/UmbracoProject/.template.config/ide.host.json +++ b/templates/UmbracoProject/.template.config/ide.host.json @@ -13,19 +13,18 @@ }, { "id": "UseHttpsRedirect", - "isVisible": true - }, - { - "id": "SkipRestore", - "isVisible": true + "isVisible": true, + "persistenceScope": "templateGroup" }, { "id": "ExcludeGitignore", - "isVisible": true + "isVisible": true, + "persistenceScope": "templateGroup" }, { "id": "MinimalGitignore", - "isVisible": true + "isVisible": true, + "persistenceScope": "templateGroup" }, { "id": "ConnectionString", @@ -37,7 +36,8 @@ }, { "id": "DevelopmentDatabaseType", - "isVisible": true + "isVisible": true, + "persistenceScope": "templateGroup" }, { "id": "UnattendedUserName", @@ -54,10 +54,6 @@ { "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 befe6d7e5a..049db86bf1 100644 --- a/templates/UmbracoProject/.template.config/template.json +++ b/templates/UmbracoProject/.template.config/template.json @@ -51,7 +51,7 @@ "description": "The version of Umbraco.Cms to add as PackageReference.", "type": "parameter", "datatype": "string", - "defaultValue": "10.0.0-rc1", + "defaultValue": "11.0.0", "replaces": "UMBRACO_VERSION_FROM_TEMPLATE" }, "UseHttpsRedirect": {