Skip to content

Commit

Permalink
Merge pull request #134 from Lombiq/issue/OSOE-797
Browse files Browse the repository at this point in the history
OSOE-797: Simplify getting started with the module and make it available as a standalone solution too
  • Loading branch information
sarahelsaig authored Feb 26, 2024
2 parents 9f0ec7f + d6544fa commit 0f30420
Show file tree
Hide file tree
Showing 143 changed files with 457 additions and 137 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-and-test-orchard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and Test

# Runs for PRs opened for any branch, and pushes to the dev branch.
on:
pull_request:
push:
branches:
- dev

jobs:
build-and-test:
name: Build and Test
uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev
with:
timeout-minutes: 5
194 changes: 185 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,190 @@
.vs/
.idea/
.vscode/
obj/
bin/
artifacts/
wwwroot/
node_modules/
## Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
.pnpm-debug.log
*.sln.docstates
*.sln.ide/

# Build results

[Dd]ebug/
[Rr]elease/
x64/
build/
app.publish/
[Bb]in/
[Oo]bj/

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
project.lock.json

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml
*.pubxml

# NuGet Packages Directory
packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
*.Cache
!OrchardCore.Environment.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf


## Windows and MAC detritus

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac
.DS_Store


## ASP.NET Core and Orchard Core specifics

App_Data/
*.user
*.patch
*.hg
build/
/buildazure
/buildtasks
/artifacts
site/
*.sln.cache
log.xml
profiling/
*.orig
.vs/
#.vscode/
.build/
.testPublish/

nuget.exe
.nuget/

# Enable all /lib artifacts
!lib/*/*.*

# Exclude node modules
node_modules/

# Exclude Web project wwwroot and add exceptions
Lombiq.TrainingDemo.Web/wwwroot/*
!Lombiq.TrainingDemo.Web/wwwroot/favicon.ico
!Lombiq.TrainingDemo.Web/wwwroot/.placeholder

*.Web/Localization
/.editorconfig
5 changes: 0 additions & 5 deletions Assets/Styles/trainingdemo-colorpicker.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Lombiq.TrainingDemo.csproj" />
<ProjectReference Include="..\Lombiq.TrainingDemo\Lombiq.TrainingDemo.csproj" />
</ItemGroup>

</Project>
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,5 @@ private static TestedService CreateTestedService(out AutoMocker mocker)

// END OF TRAINING SECTION: Unit and integration testing

// NEXT STATION: Head back to the module project and check out package.json.
// NEXT STATION: Head back to the module project and check out GraphQL/Startup.cs to learn about extending Orchard
// Core's GraphQL APIs!
32 changes: 32 additions & 0 deletions Lombiq.TrainingDemo.Web/Lombiq.TrainingDemo.Web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Folder Include="wwwroot\" />
<Folder Include="Localization\" />
</ItemGroup>

<!-- Watcher include and excludes -->
<ItemGroup>
<Watch Include="**\*.cs" Exclude="Recipes\**;Assets\**;node_modules\**\*;**\*.js.map;obj\**\*;bin\**\*" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="OrchardCore.Logging.NLog" Version="1.8.2" />
<PackageReference Include="OrchardCore.Application.Cms.Targets" Version="1.8.2" />
<!-- This reference is not strictly needed here but included so if the web and the module projects' Orchard Core
versions go out of sync, the CI build's package consolidation validation will fail. -->
<PackageReference Include="OrchardCore.ContentManagement" Version="1.8.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lombiq.TrainingDemo\Lombiq.TrainingDemo.csproj" />
</ItemGroup>

</Project>
32 changes: 32 additions & 0 deletions Lombiq.TrainingDemo.Web/NLog.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogLevel="Warn"
internalLogFile="App_Data/logs/internal-nlog.txt">

<extensions>
<add assembly="NLog.Web.AspNetCore"/>
<add assembly="OrchardCore.Logging.NLog"/>
</extensions>

<targets>
<!-- file target -->
<target xsi:type="File" name="file"
fileName="${var:configDir}/App_Data/logs/orchard-log-${shortdate}.log"
layout="${longdate}|${orchard-tenant-name}|${aspnet-traceidentifier}|${event-properties:item=EventId}|${logger}|${uppercase:${level}}|${message} ${exception:format=ToString,StackTrace}"
/>

<!-- console target -->
<target xsi:type="Console" name="console" />

</targets>

<rules>
<!-- all warnings and above go to the file target -->
<logger name="*" minlevel="Warn" writeTo="file" />

<!-- the hosting lifetime events go to the console and file targets -->
<logger name="Microsoft.Hosting.Lifetime" minlevel="Info" writeTo="file, console" />
</rules>
</nlog>
17 changes: 17 additions & 0 deletions Lombiq.TrainingDemo.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using OrchardCore.Logging;

var builder = WebApplication.CreateBuilder(args);

builder.Host.UseNLogHost();

builder.Services
.AddOrchardCms()
.AddSetupFeatures("OrchardCore.AutoSetup");

var app = builder.Build();

app
.UseStaticFiles()
.UseOrchardCore();

app.Run();
27 changes: 27 additions & 0 deletions Lombiq.TrainingDemo.Web/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:8080",
"sslPort": 44300
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Lombiq.TrainingDemo.Web": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
28 changes: 28 additions & 0 deletions Lombiq.TrainingDemo.Web/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"OrchardCore": {
"OrchardCore_AutoSetup": {
"AutoSetupPath": "",
"Tenants": [
{
"ShellName": "Default",
"SiteName": "Lombiq Training Demo for Orchard Core",
"SiteTimeZone": "Europe/Budapest",
"AdminUsername": "admin",
"AdminEmail": "admin@example.com",
"AdminPassword": "Password1!",
"DatabaseProvider": "Sqlite",
"DatabaseConnectionString": "",
"DatabaseTablePrefix": "",
"RecipeName": "Lombiq.TrainingDemo"
}
]
}
}
}
Empty file.
Loading

0 comments on commit 0f30420

Please sign in to comment.