Skip to content

Commit

Permalink
Replace legacy package template with RCL
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldbarendse committed Nov 17, 2023
1 parent f286b11 commit 45d3f16
Show file tree
Hide file tree
Showing 19 changed files with 135 additions and 342 deletions.
2 changes: 2 additions & 0 deletions templates/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Do not inherit customized EditorConfig for template content
root = true
4 changes: 2 additions & 2 deletions templates/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<!-- Enable multi-level merging with src -->
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\src\'))" />
<!-- Enable multi-level merging with src -->
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)..\src\'))" />
</Project>
123 changes: 61 additions & 62 deletions templates/Umbraco.Templates.csproj
Original file line number Diff line number Diff line change
@@ -1,66 +1,65 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Title>Umbraco CMS - Templates</Title>
<Description>Contains templates for Umbraco CMS, as well as the templates for creating new packages for the Umbraco CMS.</Description>
<PackageType>Template</PackageType>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
<NoDefaultExcludes>true</NoDefaultExcludes>
<IncludeContentInPack>true</IncludeContentInPack>
<ContentTargetFolders>.</ContentTargetFolders>
<NoWarn>NU5128</NoWarn>
</PropertyGroup>
<PropertyGroup>
<Title>Umbraco CMS - Templates</Title>
<Description>Contains templates for Umbraco CMS, as well as the templates for creating new packages for the Umbraco CMS.</Description>
<PackageType>Template</PackageType>
<IncludeBuildOutput>false</IncludeBuildOutput>
<IncludeSymbols>false</IncludeSymbols>
<NoDefaultExcludes>true</NoDefaultExcludes>
<IncludeContentInPack>true</IncludeContentInPack>
<ContentTargetFolders>.</ContentTargetFolders>
<NoWarn>NU5128</NoWarn>
</PropertyGroup>

<ItemGroup>
<Content Include="UmbracoPackage\**" Exclude="bin;obj" />
<Content Include="UmbracoPackageRcl\**" Exclude="bin;obj" />
<Content Include="UmbracoProject\**" Exclude="bin;obj" />
<Content Include="..\src\Umbraco.Web.UI\Program.cs">
<Link>UmbracoProject\Program.cs</Link>
<PackagePath>UmbracoProject</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\blocklist\**">
<Link>UmbracoProject\Views\Partials\blocklist\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\blocklist</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\grid\**">
<Link>UmbracoProject\Views\Partials\grid\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\grid</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\blockgrid\**">
<Link>UmbracoProject\Views\Partials\blockgrid\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\blockgrid</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\_ViewImports.cshtml">
<Link>UmbracoProject\Views\_ViewImports.cshtml</Link>
<PackagePath>UmbracoProject\Views</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\wwwroot\favicon.ico">
<Link>UmbracoProject\wwwroot\favicon.ico</Link>
<PackagePath>UmbracoProject\wwwroot</PackagePath>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="UmbracoPackage\**" Exclude="bin;obj" />
<Content Include="UmbracoProject\**" Exclude="bin;obj" />
<Content Include="..\src\Umbraco.Web.UI\Program.cs">
<Link>UmbracoProject\Program.cs</Link>
<PackagePath>UmbracoProject</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\blocklist\**">
<Link>UmbracoProject\Views\Partials\blocklist\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\blocklist</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\grid\**">
<Link>UmbracoProject\Views\Partials\grid\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\grid</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\Partials\blockgrid\**">
<Link>UmbracoProject\Views\Partials\blockgrid\%(RecursiveDir)%(Filename)%(Extension)</Link>
<PackagePath>UmbracoProject\Views\Partials\blockgrid</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\Views\_ViewImports.cshtml">
<Link>UmbracoProject\Views\_ViewImports.cshtml</Link>
<PackagePath>UmbracoProject\Views</PackagePath>
</Content>
<Content Include="..\src\Umbraco.Web.UI\wwwroot\favicon.ico">
<Link>UmbracoProject\wwwroot\favicon.ico</Link>
<PackagePath>UmbracoProject\wwwroot</PackagePath>
</Content>
</ItemGroup>

<!-- Update template.json files with the default UmbracoVersion value set to the current build version -->
<ItemGroup>
<PackageReference Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Content Update="**\.template.config\template.json" Pack="false" />
</ItemGroup>
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetUmbracoBuildVersion">
<ItemGroup>
<_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
<_TemplateJsonFiles>
<DestinationFile>$(IntermediateOutputPath)%(RelativeDir)%(Filename)%(Extension)</DestinationFile>
</_TemplateJsonFiles>
</ItemGroup>
<Copy SourceFiles="@(_TemplateJsonFiles)" DestinationFiles="%(DestinationFile)" />
<JsonPathUpdateValue JsonFile="%(_TemplateJsonFiles.DestinationFile)" Path="$.symbols.UmbracoVersion.defaultValue" Value="&quot;$(PackageVersion)&quot;" />
<ItemGroup>
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
<PackagePath>%(_TemplateJsonFiles.RelativeDir)</PackagePath>
</_PackageFiles>
</ItemGroup>
</Target>
<!-- Update template.json files with the default UmbracoVersion value set to the current build version -->
<ItemGroup>
<PackageReference Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Content Update="**\.template.config\template.json" Pack="false" />
</ItemGroup>
<Target Name="GetUpdatedTemplateJsonPackageFiles" BeforeTargets="GenerateNuspec" AfterTargets="GetUmbracoBuildVersion">
<ItemGroup>
<_TemplateJsonFiles Include="**\.template.config\template.json" Exclude="bin\**;obj\**" />
<_TemplateJsonFiles>
<DestinationFile>$(IntermediateOutputPath)%(RelativeDir)%(Filename)%(Extension)</DestinationFile>
</_TemplateJsonFiles>
</ItemGroup>
<Copy SourceFiles="@(_TemplateJsonFiles)" DestinationFiles="%(DestinationFile)" />
<JsonPathUpdateValue JsonFile="%(_TemplateJsonFiles.DestinationFile)" Path="$.symbols.UmbracoVersion.defaultValue" Value="&quot;$(PackageVersion)&quot;" />
<ItemGroup>
<_PackageFiles Include="%(_TemplateJsonFiles.DestinationFile)">
<PackagePath>%(_TemplateJsonFiles.RelativeDir)</PackagePath>
</_PackageFiles>
</ItemGroup>
</Target>
</Project>
4 changes: 4 additions & 0 deletions templates/UmbracoPackage/.template.config/dotnetcli.host.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"SkipRestore": {
"longName": "no-restore",
"shortName": ""
},
"SupportPagesAndViews": {
"longName": "support-pages-and-views",
"shortName": "s"
}
}
}
7 changes: 6 additions & 1 deletion templates/UmbracoPackage/.template.config/ide.host.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
"icon": "../../icon.png",
"description": {
"id": "UmbracoPackage",
"text": "Umbraco Package - An empty Umbraco CMS package/plugin."
"text": "Umbraco Package - An empty Umbraco package/plugin."
},
"symbolInfo": [
{
"id": "UmbracoVersion",
"isVisible": true
},
{
"id": "SupportPagesAndViews",
"isVisible": true,
"persistenceScope": "templateGroup"
}
]
}
41 changes: 7 additions & 34 deletions templates/UmbracoPackage/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"Plugin"
],
"name": "Umbraco Package",
"description": "An empty Umbraco package/plugin project ready to get started.",
"description": "An empty Umbraco package/plugin.",
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
"shortName": "umbracopackage",
Expand Down Expand Up @@ -51,39 +51,12 @@
"datatype": "bool",
"defaultValue": "false"
},
"Namespace": {
"type": "derived",
"valueSource": "name",
"valueTransform": "safe_namespace",
"fileRename": "UmbracoPackage",
"replaces": "UmbracoPackage"
},
"MsBuildName": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": ""
},
{
"regex": "\\.",
"replacement": ""
},
{
"regex": "-",
"replacement": ""
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": ""
}
]
},
"replaces": "UmbracoPackageMsBuild"
"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": [
Expand Down

This file was deleted.

43 changes: 24 additions & 19 deletions templates/UmbracoPackage/UmbracoPackage.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ContentTargetFolders>.</ContentTargetFolders>
<Product>UmbracoPackage</Product>
<PackageId>UmbracoPackage</PackageId>
<Title>UmbracoPackage</Title>
<Description>...</Description>
<PackageTags>umbraco plugin package</PackageTags>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">UmbracoPackage</RootNamespace>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk.Razor">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<AddRazorSupportForMvc Condition="'$(SupportPagesAndViews)' == 'True'">true</AddRazorSupportForMvc>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">UmbracoPackage</RootNamespace>
<StaticWebAssetBasePath>App_Plugins/UmbracoPackage</StaticWebAssetBasePath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
</ItemGroup>
<PropertyGroup>
<PackageId>UmbracoPackage</PackageId>
<Product>UmbracoPackage</Product>
<Title>UmbracoPackage</Title>
<Description>...</Description>
<PackageTags>umbraco plugin package</PackageTags>
</PropertyGroup>

<ItemGroup>
<Content Include="App_Plugins\UmbracoPackage\**" ExcludeFromSingleFile="true" CopyToPublishDirectory="Always" />
<None Include="buildTransitive\**" Pack="true" PackagePath="buildTransitive" />
</ItemGroup>
<ItemGroup Condition="'$(SupportPagesAndViews)' == 'True'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms.Web.Website" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="UMBRACO_VERSION_FROM_TEMPLATE" />
</ItemGroup>
</Project>
21 changes: 0 additions & 21 deletions templates/UmbracoPackage/buildTransitive/UmbracoPackage.targets

This file was deleted.

5 changes: 5 additions & 0 deletions templates/UmbracoPackage/wwwroot/package.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "UmbracoPackage",
"name": "UmbracoPackage",
"allowPackageTelemetry": true
}
22 changes: 0 additions & 22 deletions templates/UmbracoPackageRcl/.template.config/dotnetcli.host.json

This file was deleted.

20 changes: 0 additions & 20 deletions templates/UmbracoPackageRcl/.template.config/ide.host.json

This file was deleted.

Loading

0 comments on commit 45d3f16

Please sign in to comment.