Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
Set up template
Browse files Browse the repository at this point in the history
  • Loading branch information
Freymaurer committed Sep 2, 2022
1 parent 0103166 commit 82c70db
Show file tree
Hide file tree
Showing 17 changed files with 1,005 additions and 13 deletions.
7 changes: 7 additions & 0 deletions Nfdi4Plants.Fornax.sln
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Nfdi4Plants.Fornax", "src\N
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Nfdi4Plants.Fornax.Tests", "tests\Nfdi4Plants.Fornax.Tests\Nfdi4Plants.Fornax.Tests.fsproj", "{DB4ECEE1-1EF6-4DE6-B358-4A63F2DF74FD}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Nfdi4Plants.Fornax.Template", "src\Nfdi4Plants.Fornax.Template\Nfdi4Plants.Fornax.Template.fsproj", "{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -38,13 +40,18 @@ Global
{DB4ECEE1-1EF6-4DE6-B358-4A63F2DF74FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB4ECEE1-1EF6-4DE6-B358-4A63F2DF74FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB4ECEE1-1EF6-4DE6-B358-4A63F2DF74FD}.Release|Any CPU.Build.0 = Release|Any CPU
{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{235EF1A1-0447-40A7-ADF7-35FD0FBA9685} = {2B672946-D10B-4804-93DE-B11DE6B85259}
{DB4ECEE1-1EF6-4DE6-B358-4A63F2DF74FD} = {569B21DD-E434-48EF-9D28-FC864B6A7EC3}
{8087D3B5-E961-4A3B-BC8F-7E33F67B8D3C} = {2B672946-D10B-4804-93DE-B11DE6B85259}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9591E7EB-8243-4661-BA6B-3DD822EB60EB}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See the official [@nfdi4plants/web-components docs](https://nfdi4plants.github.i
- Build the library
- Create a nuget package and copy it to the client test folder.
4. Update nuget reference for library to new version.
- In `client\loaders\docsloader.fsx`.
- In `client\loaders\_lib.fsx`.
- 👀 It might be necessary to clear nuget cache if the version was not changed for it to update.
5. [Test](##start-test-client) the new version.

Expand Down
16 changes: 14 additions & 2 deletions build/BasicTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ open BlackFox.Fake
open Fake.IO
open Fake.DotNet
open Fake.IO.Globbing.Operators
open System.IO

open ProjectInfo

Expand All @@ -25,6 +26,17 @@ let clean = BuildTask.create "Clean" [] {
}

let build = BuildTask.create "Build" [clean] {
solutionFile
|> DotNet.build id
//solutionFile
//|> DotNet.build
let srcFolder = "src"
let projects =
Directory.GetFiles(
srcFolder,
"*.fsproj",
new EnumerationOptions() |> fun x -> x.RecurseSubdirectories <- true; x
)
// need to remove template project. Would error otherwise because of NoBuild param in .fsproj file.
|> Array.filter (fun x -> x.EndsWith "Nfdi4Plants.Fornax.Template.fsproj" |> not)
projects
|> Array.iter (DotNet.build id)
}
8 changes: 0 additions & 8 deletions client/generators/layout.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,3 @@ let render (ctx : SiteContents) cnt =
let docsLayout (docs: Nfdi4Plants.Docs) =
// just an example url
Nfdi4Plants.Components.docsLayout("https://github.com/nfdi4plants/nfdi4plants.github.io/tree/main/src/", docs)

let docsMinimalLayout (docs: Nfdi4Plants.Docs) =
div [Class "tile is-4 is-parent"] [
div [Class "tile is-child box"] [
p [Class "title"] [ a [Href docs.link] [!! docs.title] ]
p [] [ !! $"""by {docs.author.Value}, {docs.published.Value.ToString("yyyy-MM-dd")}""" ]
]
]
2 changes: 2 additions & 0 deletions client/loaders/_lib.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// This can be used to access local .nupkg, thanks to the nuget.config file.
#r "nuget: Nfdi4Plants.Fornax, 0.6.0"
4 changes: 2 additions & 2 deletions client/loaders/docsloader.fsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#r "../_lib/Fornax.Core.dll"
#r "../_lib/Markdig.dll"
// This can be used to access local .nupkg, thanks to the nuget.config file.
#r "nuget: Nfdi4Plants.Fornax, 0.5.5"
// // This can be used to access local .nupkg, thanks to the nuget.config file.
#load "_lib.fsx"

open System.IO
open Fornax
Expand Down
43 changes: 43 additions & 0 deletions src/Nfdi4Plants.Fornax.Template/Nfdi4Plants.Fornax.Template.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<NeutralLanguage>en-US</NeutralLanguage>
<PackageType>Template</PackageType>
<NoBuild>true</NoBuild>
<TargetFramework>net5.0</TargetFramework>
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
<!--https://docs.microsoft.com/en-us/dotnet/core/tutorials/cli-templates-create-template-package-->
<IncludeContentInPack>true</IncludeContentInPack>
<IncludeBuildOutput>false</IncludeBuildOutput>
<ContentTargetFolders>content</ContentTargetFolders>
<NoWarn>$(NoWarn);NU5128</NoWarn>
</PropertyGroup>
<PropertyGroup>
<Title>Nfdi4Plants.Fornax.Template</Title>
<PackageId>Nfdi4Plants.Fornax.Template</PackageId>
<Authors>Kevin Frey</Authors>
<Description>Create Fornax template with Nfdi4Plants.Fornax.</Description>
<Summary>Create Fornax template with Nfdi4Plants.Fornax</Summary>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/Freymaurer/Nfdi4Plants.Fornax</PackageProjectUrl>
<PackageTags>"DataPlant", "nfdi4plants", "Docs"</PackageTags>
<RepositoryUrl>https://github.com/Freymaurer/Nfdi4Plants.Fornax</RepositoryUrl>
</PropertyGroup>
<PropertyGroup>
<ExcludeFromPackage>
../../client/_public/**/*;
../../client/_lib/*.nupkg;
../../client/loaders/_lib.fsx
</ExcludeFromPackage>
</PropertyGroup>
<ItemGroup>
<Content Include="../../client/**/*" Exclude="$(ExcludeFromPackage)">
<PackagePath>Content\src</PackagePath>
</Content>
<Content Include="content/**/*">
<PackagePath>Content\</PackagePath>
</Content>
<Compile Remove="**\*" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions src/Nfdi4Plants.Fornax.Template/content/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fornax": {
"version": "0.14.3",
"commands": [
"fornax"
]
},
"paket": {
"version": "7.1.5",
"commands": [
"paket"
]
}
}
}
Loading

0 comments on commit 82c70db

Please sign in to comment.