EventFlow icon indicating copy to clipboard operation
EventFlow copied to clipboard

dotnet new templates for EventFlow

Open ibebbs opened this issue 5 years ago • 9 comments

dotnet new templates for EventFlow

I thought some dotnet new templates for EventFlow would be more beneficial than additional examples as it'll significantly lower the barrier to entry for getting started with this fantastic project.

This PR contains a new top level project EventFlow.TemplatePack which, when packed, published and installed using "dotnet new --install EventFlow.Templates", presents the following new project templates:

Templates                                Short Name               Language          Tags
-----------------------------------      -------------------      ------------      ----------------------
EventFlow Console Application Te...      eventflowapp             [C#]              Console
EventFlow Library Template               eventflowlibrary         [C#]              Library
EventFlow WebApp Application Tem...      eventflowwebapp          [C#]              Web/WebApi

Each template takes an --entity parameter meant to represent the entity being modelled.

EventFlow Library Template

dotnet new eventflowlibrary -n Ordering --entity Order

Creates a new netstandard 2.0 Ordering project containing an Order aggregate root, OrderId identity and OrderState aggregate state, fully wired with sample Increment and Decrement commands/handlers/events.

EventFlow Console Application Template

mkdir Ordering
cd Ordering
dotnet new eventflowapp --entity Order

Creates a new Ordering solution containing two projects; "Ordering" and "Ordering.Domain". "Ordering.Domain" is a netstandard2.0 library with the same content as the EventFlow Library Template. "Ordering" is a netcoreapp 3.1 console application which receives key presses from the console and emits commands to / performs queries on, the Ordering.Domain.

EventFlow WebApp Application Template

mkdir Ordering
cd Ordering
dotnet new eventflowwebapp --entity Order

Creates a new Ordering solution containing two projects; "Ordering" and "Ordering.Domain". "Ordering.Domain" is a netstandard2.0 library with the same content as the EventFlow Library Template. "Ordering" is a netcoreapp 3.1 web application containing an 'Order' controller which provides POST/GET endpoints to emit commands to / performs queries on, the Ordering.Domain.

TODO

  1. Build process I wasn't able to run the automated build. I believe the EventFlow.TemplatePack project should be built and packed correctly but this needs to be confirmed

Comments

If you feel this PR is missing anything or would like additional templates just let me know.

Cheers, Ian

ibebbs avatar Nov 11 '20 14:11 ibebbs

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 11 '20 14:11 CLAassistant

It seems the AppVeyor build is failing due to missing license headers on the file.

Before I spend the time adding these headers, is there any interest in this PR?

ibebbs avatar Nov 12 '20 09:11 ibebbs

Hey @rasmus any thoughts on this? If there's no interest I'll publish the nuget package separately.

Cheers, Ian

ibebbs avatar Nov 23 '20 15:11 ibebbs

Sorry for the late reply, spending most evenings with the family lately.

I do think this is an excellent idea.

rasmus avatar Nov 23 '20 16:11 rasmus

Righto, I'll get the headers on the files sorted then.

ibebbs avatar Nov 23 '20 16:11 ibebbs

Hey @rasmus,

Any idea why I'm seeing the error: EventFlow.Library.Template.csproj does not have a Project/PropertyGroup/PackageReleaseNotes property ?

I've checked the project file and it has the <PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes> element in the exact same manner as other projects in the solution.

Full csproj here:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PackageType>Template</PackageType>
    <PackageVersion>1.0</PackageVersion>
    <PackageId>EventFlow.Templates</PackageId>
    <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
    <Title>EventFlow Templates</Title>
    <Authors>Rasmus Mikkelsen, Ian Bebbington</Authors>
    <Company>Rasmus Mikkelsen</Company>
    <Copyright>Copyright (c) Rasmus Mikkelsen 2015 - 2019</Copyright>
    <Description>Templates to use when creating an EventFlow library or application.</Description>
    <PackageTags>dotnet-new;templates;EventFlow</PackageTags>
    <RepositoryType>git</RepositoryType>
    <RepositoryUrl>https://github.com/eventflow/EventFlow</RepositoryUrl>
    <PackageProjectUrl>https://docs.geteventflow.net/</PackageProjectUrl>
    <PackageLicenseExpression>MIT</PackageLicenseExpression>
    <NeutralLanguage>en-US</NeutralLanguage>
    <PackageReleaseNotes>UPDATED BY BUILD</PackageReleaseNotes>

    <TargetFramework>netstandard2.0</TargetFramework>

    <IncludeContentInPack>true</IncludeContentInPack>
    <IncludeBuildOutput>false</IncludeBuildOutput>
    <ContentTargetFolders>content</ContentTargetFolders>
  </PropertyGroup>

  <ItemGroup>
    <Content Include="templates\**\*" Exclude="templates\**\.vs\**;templates\**\bin\**;templates\**\obj\**" />
    <Compile Remove="**\*" />
  </ItemGroup>

</Project>

ibebbs avatar Nov 25 '20 09:11 ibebbs

Odd, I have some time in the weekend and will have a look

rasmus avatar Dec 04 '20 06:12 rasmus

Hey @rasmus, any luck looking into this? I'be been thinking about adding a "real-world" template with eventstore + mongodb integrated along with all the bits needed to get the entire stack running in docker, but can't really justify the time if it's not going to be used.

ibebbs avatar Dec 09 '20 16:12 ibebbs

@ibebbs between work, family and doing PoCs on a 1.0 release I hadn't have time to have a look. I'll try this weekend

rasmus avatar Dec 11 '20 10:12 rasmus

Hello there!

We hope this message finds you well. We wanted to let you know that we have noticed that there has been no activity on this pull request for the past 90 days, which makes it a stale pull request.

As a result, we will be closing this pull request within the next seven days. If you still think this pull request is necessary or relevant, please feel free to update it or leave a comment within the next seven days.

Thank you for your contributions and understanding.

Best regards, EventFlow

github-actions[bot] avatar Apr 08 '23 13:04 github-actions[bot]

Hello there! I'm a bot and I wanted to let you know that your pull request has been closed due to inactivity after being marked as stale for seven days. If you believe this was done in error, or if you still plan to work on this pull request, please don't hesitate to reopen it and let us know. We're always happy to review and merge high-quality contributions. Thank you for your interest in our project! Best regards, EventFlow

github-actions[bot] avatar Apr 16 '23 09:04 github-actions[bot]