Skip to content

Commit

Permalink
Release 1.1.0 (#36)
Browse files Browse the repository at this point in the history
* Adds order managers mapped role

* Add content type item template (#17)

* Add Content Type item template

* Update README with additional details (#19)

Also fix parameter spelling error

* Add scheduled job item template (#20)

* Add Initialization Module item template (#18)

* Add Initialization Module item template
* correct parameter name

* Add Page Controller template (#23)

* Add Content Component template (#24)

* Razor page item template (#25)

* Add Razor Page Item template

* Fix some copy/paste naming errors

* List all item templates (#26)

* Publish CI packages to GitHub Packages (#27)

* Publish CI packages to GitHub Packages
* Supress .NET welcome msg during builds

* Add license expression to package (#28)

* Updates CMS to latest (#30)

* Various bugfixes (#31)

* Fixes broken link in content

* Makes section handling more resilient

Now handles created below root directly.

* Increases timeout for database creation

* Updates the version

* Reverts to 1.1 since this will be next release (#32)

* Delete old package versions (#29)

* Delete old package versions. Keep 10 versions
* Split cleanup into separate step

* Fixes inconsistent file naming on disk and code files (#35)

The template engine replaces whitespace with - in filenames and _ in text files. That means db filenames on disk doesn't match the names in the connection strings. We need to use unambiguous source names, so unfortunately we end up with ugly project names and namespaces. But this ensures everything gets replaced correctly, see https://github.com/dotnet/templating/wiki/Naming-and-default-value-forms.

Added restart on failure in Docker compose. Services are just started in correct order, but do not wait until they are ready. The db might take time to set up first time on a slow machine, then the web fails and you have to 'docker up' again. There is no nice way to achieve this in another way, other than making the app itself more resilient.

Also updated with our v3 NuGet feed.

Co-authored-by: Henrik Nystrom <[email protected]>
Co-authored-by: Henrik Nystrom <[email protected]>
  • Loading branch information
3 people authored Mar 24, 2022
1 parent da2b561 commit 1e2a28e
Show file tree
Hide file tree
Showing 147 changed files with 780 additions and 209 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
runs-on: windows-latest
env:
buildConfiguration: release
versionSuffix: ci-${{ github.RUN_NUMBER }}
versionSuffix: ${{ github.ref == 'refs/heads/develop' && 'pre-' || 'ci-' }}${{github.RUN_NUMBER }}
DOTNET_NOLOGO: 1
steps:
- uses: actions/checkout@v2
- name: Restore
Expand All @@ -34,11 +35,27 @@ jobs:
name: Publish
needs: build_test_pack
runs-on: windows-latest
env:
nugetSource: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
DOTNET_NOLOGO: 1
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: packages
- name: Publish packages
# run: dotnet nuget push *.nupkg --source 'nuget.example.com'
run: echo 'Packages are not published at the moment, they can however be downloaded from the artifacts'
- name: Publish to Github Packages
run: dotnet nuget push *.nupkg --source $env:nugetSource --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }}

cleanup:
name: Cleanup
needs: build_test_pack
runs-on: ubuntu-latest
steps:
- name: Cleanup old Packages
uses: actions/delete-package-versions@v3
with:
package-name: 'EPiServer.Templates'
min-versions-to-keep: 10
# 1-in-1-out
num-old-versions-to-delete: 1
delete-only-pre-release-versions: "true"
60 changes: 50 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,59 @@
# Optimizely Templates
# Optimizely Templates for .NET

[![Continuous integration](https://github.com/episerver/content-templates/actions/workflows/ci.yml/badge.svg)](https://github.com/episerver/content-templates/actions/workflows/ci.yml)

## Available templates
- epi-alloy-mvc
- epi-cms-empty
- epi-commerce-empty
This repository contains templates for Optimizely Digital Experience Cloud to be used with `dotnet new` and Visual Studio 2022.

The templates in this repository are distributed as a NuGet package available from [NuGet.org](https://www.nuget.org/packages/EPiServer.Templates/) and can be installed using the `dotnet new` command.

```bash
$ dotnet new -i EPiServer.Templates
```

Once installed, these templates will also be available in Visual Studio 2022.
Note that Visual Studio currently only supports *Project Templates* and not *Item Templates*.

To generate code based on the template simply execute the following.

## Installation
```bash
$ dotnet new -i EPiServer.Templates --force
$ dotnet new epi-alloy-mvc
```
It's also possible to download the source code or clone this repository and then run each template as a regular project.

## Update
Replace `epi-alloy-mvc` with the name of the template you want to use.

See below for a list of available templates and details on each individual template. For direct access to documentation on each template, execute:

```bash
$ dotnet new --update-apply
$ dotnet new epi-alloy-mvc --help
```

For further documentation on how to work with `dotnet new` see https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new.

## Available templates

The following templates are included in this repository and available through the `EPiServer.Templates` package.

### Project Templates

- epi-alloy-mvc
- epi-cms-empty
- epi-commerce-empty


### Item Templates

- epi-cms-contentcomponent
- epi-cms-contenttype
- epi-cms-initializationmodule
- epi-cms-job
- epi-cms-pagecontroller
- epi-cms-razorpage

## Contributing

We would love community contributions here. The easiest way to contribute is to join in with the discussions on Github issues or create new issues with questions, suggestions or any other feedback.
If you want to contribute code or documentation, you are more than welcome to create pull-requests, but make sure that you read the [contribution page](CONTRIBUTING.md) first.

## License

This project is licensed with the [Apache license](LICENSE.md)
2 changes: 1 addition & 1 deletion build/version.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- This file may be overwritten by automation. Only values allowed here are VersionPrefix and VersionSuffix. -->
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionPrefix>1.1.0</VersionPrefix>
<VersionSuffix Condition="'$(Configuration)' == 'Debug'">devbuild</VersionSuffix>
</PropertyGroup>
</Project>
27 changes: 21 additions & 6 deletions content-templates.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
# Visual Studio Version 17
VisualStudioVersion = 17.1.32210.238
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EPiServer.Templates", "templates\EPiServer.Templates.csproj", "{8B343E37-F699-461C-8755-8D371CC82EAC}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "templates", "templates", "{350B8822-08B0-47CE-9295-9D379C42A718}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Alloy.Mvc", "templates\Alloy.Mvc\Alloy.Mvc.csproj", "{D26A321A-ED45-42C4-9792-1C64A969C70B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Alloy.Mvc", "templates\Alloy.Mvc\Alloy.1.csproj", "{D26A321A-ED45-42C4-9792-1C64A969C70B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cms.Empty", "templates\Cms.Empty\Cms.Empty.csproj", "{A64C6372-EC36-4F19-B2AD-8A2185AAC015}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cms.Empty", "templates\Cms.Empty\Cms.1.csproj", "{A64C6372-EC36-4F19-B2AD-8A2185AAC015}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Commerce.Empty", "templates\Commerce.Empty\Commerce.Empty.csproj", "{9B5A3754-D23E-4032-A09D-5568F935F34F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Commerce.Empty", "templates\Commerce.Empty\Commerce.1.csproj", "{9B5A3754-D23E-4032-A09D-5568F935F34F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{8F2A1A07-7B50-4060-89B0-B53021C3F593}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -36,6 +36,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cms.Item", "templates\Cms.Item\Cms.Item.csproj", "{08ACA24C-AC25-4391-BDBA-D309EED6C80E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -94,15 +96,28 @@ Global
{9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x64.Build.0 = Release|Any CPU
{9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x86.ActiveCfg = Release|Any CPU
{9B5A3754-D23E-4032-A09D-5568F935F34F}.Release|x86.Build.0 = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x64.ActiveCfg = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x64.Build.0 = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x86.ActiveCfg = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Debug|x86.Build.0 = Debug|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|Any CPU.Build.0 = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x64.ActiveCfg = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x64.Build.0 = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x86.ActiveCfg = Release|Any CPU
{08ACA24C-AC25-4391-BDBA-D309EED6C80E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D26A321A-ED45-42C4-9792-1C64A969C70B} = {350B8822-08B0-47CE-9295-9D379C42A718}
{0FC00D98-1708-47C9-A126-B4AC4C4C5260} = {8F2A1A07-7B50-4060-89B0-B53021C3F593}
{A64C6372-EC36-4F19-B2AD-8A2185AAC015} = {350B8822-08B0-47CE-9295-9D379C42A718}
{9B5A3754-D23E-4032-A09D-5568F935F34F} = {350B8822-08B0-47CE-9295-9D379C42A718}
{0FC00D98-1708-47C9-A126-B4AC4C4C5260} = {8F2A1A07-7B50-4060-89B0-B53021C3F593}
{08ACA24C-AC25-4391-BDBA-D309EED6C80E} = {350B8822-08B0-47CE-9295-9D379C42A718}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6F4B71A0-BE63-44F5-856C-3831FB1C0943}
Expand Down
2 changes: 1 addition & 1 deletion nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="optimizely" value="https://nuget.optimizely.com/feed/packages.svc" />
<add key="optimizely" value="https://api.nuget.optimizely.com/v3/index.json" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion templates/Alloy.Mvc/.template.config/dotnetcli.host.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"symbolInfo": {
"enablelDocker": {
"enableDocker": {
"longName": "enable-docker",
"shortName": ""
},
Expand Down
6 changes: 3 additions & 3 deletions templates/Alloy.Mvc/.template.config/template.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Episerver AB",
"sourceName": "Alloy.Mvc",
"sourceName": "Alloy.1",
"classifications": [ "Web" ],
"identity": "EPiServer.Templates.Alloy.Mvc",
"name": "Optimizely Alloy MVC",
Expand All @@ -15,7 +15,7 @@
{
"modifiers": [
{
"condition": "(!enablelDocker)",
"condition": "(!enableDocker)",
"exclude": [
"Directory.Build.props",
"docker-compose.yml",
Expand All @@ -26,7 +26,7 @@
}
],
"symbols": {
"enablelDocker": {
"enableDocker": {
"type": "parameter",
"datatype": "bool",
"defaultValue": "false",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EPiServer.CMS" Version="12.3.1" />
<PackageReference Include="EPiServer.CMS" Version="12.3.2" />
<PackageReference Include="Wangkanai.Detection" Version="2.0.1" />
</ItemGroup>

Expand Down
File renamed without changes.
Binary file modified templates/Alloy.Mvc/App_Data/DefaultSiteContent.episerverdata
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using EPiServer.Framework.Localization;
using EPiServer.Web;

namespace Alloy.Mvc.Business.Channels
namespace Alloy._1.Business.Channels
{
/// <summary>
/// Base class for all resolution definitions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using EPiServer.Framework.Localization;

namespace Alloy.Mvc.Business.Channels
namespace Alloy._1.Business.Channels
{
/// <summary>
/// Defines resolution for desktop displays
Expand Down
2 changes: 1 addition & 1 deletion templates/Alloy.Mvc/Business/Channels/MobileChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Extensions.DependencyInjection;
using Wangkanai.Detection;

namespace Alloy.Mvc.Business.Channels
namespace Alloy._1.Business.Channels
{
//<summary>
// Defines the 'Mobile' content channel
Expand Down
2 changes: 1 addition & 1 deletion templates/Alloy.Mvc/Business/Channels/WebChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.Extensions.DependencyInjection;
using Wangkanai.Detection;

namespace Alloy.Mvc.Business.Channels
namespace Alloy._1.Business.Channels
{
/// <summary>
/// Defines the 'Web' content channel
Expand Down
2 changes: 1 addition & 1 deletion templates/Alloy.Mvc/Business/ContentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using EPiServer.Framework.Web;
using EPiServer.ServiceLocation;

namespace Alloy.Mvc.Business
namespace Alloy._1.Business
{
/// <summary>
/// Extension methods for content
Expand Down
4 changes: 2 additions & 2 deletions templates/Alloy.Mvc/Business/ContentLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using Alloy.Mvc.Models.Pages;
using Alloy._1.Models.Pages;
using EPiServer;
using EPiServer.Core;
using EPiServer.Filters;
using EPiServer.ServiceLocation;
using EPiServer.Shell.Configuration;
using EPiServer.Web;

namespace Alloy.Mvc.Business
namespace Alloy._1.Business
{
[ServiceConfiguration(Lifecycle = ServiceInstanceScope.Singleton)]
public class ContentLocator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using EPiServer.ServiceLocation;
using EPiServer.Shell.ObjectEditing;

namespace Alloy.Mvc.Business.EditorDescriptors
namespace Alloy._1.Business.EditorDescriptors
{
/// <summary>
/// Provides a list of options corresponding to ContactPage pages on the site
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using EPiServer.Shell.ObjectEditing;
using EPiServer.Shell.ObjectEditing.EditorDescriptors;

namespace Alloy.Mvc.Business.EditorDescriptors
namespace Alloy._1.Business.EditorDescriptors
{
/// <summary>
/// Registers an editor to select a ContactPage for a PageReference property using a dropdown
Expand Down
4 changes: 2 additions & 2 deletions templates/Alloy.Mvc/Business/IModifyLayout.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Alloy.Mvc.Models.ViewModels;
using Alloy._1.Models.ViewModels;

namespace Alloy.Mvc.Business
namespace Alloy._1.Business
{
/// <summary>
/// Defines a method which may be invoked by PageContextActionFilter allowing controllers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Alloy.Mvc.Business.Rendering;
using Alloy._1.Business.Rendering;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
Expand All @@ -7,7 +7,7 @@
using EPiServer.Web.Mvc.Html;
using Microsoft.Extensions.DependencyInjection;

namespace Alloy.Mvc.Business.Initialization
namespace Alloy._1.Business.Initialization
{
/// <summary>
/// Module for customizing templates and rendering.
Expand Down
6 changes: 3 additions & 3 deletions templates/Alloy.Mvc/Business/PageContextActionFilter.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Alloy.Mvc.Models.Pages;
using Alloy.Mvc.Models.ViewModels;
using Alloy._1.Models.Pages;
using Alloy._1.Models.ViewModels;
using EPiServer.Web.Routing;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

namespace Alloy.Mvc.Business
namespace Alloy._1.Business
{
/// <summary>
/// Intercepts actions with view models of type IPageViewModel and populates the view models
Expand Down
2 changes: 1 addition & 1 deletion templates/Alloy.Mvc/Business/PageTypeExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using EPiServer.DataAbstraction;
using EPiServer.ServiceLocation;

namespace Alloy.Mvc.Business
namespace Alloy._1.Business
{
/// <summary>
/// Provides extension methods for types intended to be used when working with page types
Expand Down
Loading

0 comments on commit 1e2a28e

Please sign in to comment.