Skip to content

Commit 5f58ab8

Browse files
author
Tim Forkmann
committed
feat: Initialize project with Fable, Vite, and Tailwind CSS setup
- Added package.json with necessary scripts and dependencies for development. - Created Docs.fsproj for F# project structure. - Implemented multiple pages for documentation including BorderRadius, BoxShadow, FontSize, Install, JustifyContent, JustifyItems, TextAlign, and Use. - Added index.css for styling with Tailwind and FontAwesome. - Created index.html as the entry point for the application. - Configured Vite for building and serving the application with React and Tailwind CSS support.
1 parent 2ca8fcc commit 5f58ab8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+8549
-21867
lines changed

.github/workflows/docs.yml

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,49 @@
1-
name: Release docs
1+
name: Docs
22

33
on:
4+
workflow_dispatch:
45
push:
5-
tags:
6-
- '*'
7-
6+
branches: [ main ]
7+
paths:
8+
- 'src/Docs/**'
9+
- '.github/workflows/Docs.yml'
810
jobs:
911
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout source
15+
uses: actions/checkout@v2
16+
17+
- name: Setup .NET 9 SDK
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 9.0.201
21+
22+
- name: Install Tools
23+
run: dotnet tool restore
24+
25+
- name: Build
26+
run: dotnet run -- PublishDocs
1027

11-
runs-on: windows-latest
28+
- name: Publish Docs
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: docs
32+
path: publish/docs
1233

34+
deploy:
35+
needs: build
36+
runs-on: ubuntu-latest
1337
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v2
16-
- name: Setup .NET Core
17-
uses: actions/setup-dotnet@v1
18-
with:
19-
dotnet-version: 9.0.203
20-
- name: Restore tools
21-
run: dotnet tool restore
22-
- name: Run Fornax
23-
run: dotnet run -- PublishDocs
24-
- name: Deploy
25-
uses: peaceiris/actions-gh-pages@v3
26-
with:
27-
personal_token: ${{ secrets.GITHUB_TOKEN }}
28-
publish_dir: ./docs/_public
29-
publish_branch: gh-pages
30-
force_orphan: true
38+
- name: Download app artifact
39+
uses: actions/download-artifact@v4
40+
with:
41+
name: docs
42+
path: docs
43+
- name: Deploy
44+
uses: JamesIves/github-pages-deploy-action@3.7.1
45+
with:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
BRANCH: gh-pages
48+
FOLDER: docs
49+
CLEAN: true

Build.fs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ open Fake.IO.FileSystemOperators
1010
open Fake.IO.Globbing.Operators
1111
open Fake.Tools
1212
open Helpers
13+
14+
open BuildHelpers
15+
open BuildTools
16+
1317
initializeContext()
1418

1519
//-----------------------------------------------
@@ -219,20 +223,12 @@ Target.create "Push" (fun _ -> pushPackage [] )
219223
let docsSrcPath = Path.getFullName "./src/docs"
220224
let docsDeployPath = "docs"
221225

222-
Target.create "InstallDocs" (fun _ ->
223-
224-
runTool yarnTool "install --frozen-lockfile" docsSrcPath
225-
runDotNet "restore" docsSrcPath )
226-
227226
Target.create "PublishDocs" (fun _ ->
228-
let docsDeployLocalPath = (docsSrcPath </> "deploy")
229-
[ docsDeployPath; docsDeployLocalPath] |> Shell.cleanDirs
230-
runTool yarnTool"webpack-cli -p" docsSrcPath
231-
Shell.copyDir docsDeployPath docsDeployLocalPath FileFilter.allFiles
227+
Tools.npm "run build" ""
232228
)
233229

234-
235-
Target.create "RunDocs" (fun _ -> runTool npmTool "webpack-dev-server" docsSrcPath)
230+
Target.create "RunDocs" (fun _ ->
231+
Tools.npm "run start" "")
236232

237233
Target.runOrDefault "Build"
238234

Build.fsproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
7-
<Compile Include="Helpers.fs" />
7+
<Compile Include="BuildHelpers.fs" />
8+
<Compile Include="BuildTools.fs" />
89
<Compile Include="Build.fs" />
910
</ItemGroup>
1011
<Import Project=".paket\Paket.Restore.targets" />

Helpers.fs renamed to BuildHelpers.fs

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
module Helpers
1+
module BuildHelpers
22

33
open Fake.Core
4+
open Fake.DotNet
45

56
let initializeContext () =
67
let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ]
@@ -71,29 +72,6 @@ let createProcess exe arg dir =
7172
|> CreateProcess.withWorkingDirectory dir
7273
|> CreateProcess.ensureExitCode
7374

74-
let dotnet = createProcess "dotnet"
75-
let npm =
76-
let npmPath =
77-
match ProcessUtils.tryFindFileOnPath "npm" with
78-
| Some path -> path
79-
| None ->
80-
"npm was not found in path. Please install it and make sure it's available from your path. " +
81-
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
82-
|> failwith
83-
84-
createProcess npmPath
85-
86-
let yarn =
87-
let yarnPath =
88-
match ProcessUtils.tryFindFileOnPath "yarn" with
89-
| Some path -> path
90-
| None ->
91-
"npm was not found in path. Please install it and make sure it's available from your path. " +
92-
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
93-
|> failwith
94-
95-
createProcess yarnPath
96-
9775
let run proc arg dir =
9876
proc arg dir
9977
|> Proc.run
@@ -104,11 +82,11 @@ let runParallel processes =
10482
|> Proc.Parallel.run
10583
|> ignore
10684

107-
let runOrDefault args =
85+
let runOrDefault defTarget args =
10886
try
10987
match args with
11088
| [| target |] -> Target.runOrDefault target
111-
| _ -> Target.runOrDefault "Run"
89+
| _ -> Target.runOrDefault defTarget
11290
0
11391
with e ->
11492
printfn "%A" e

BuildTools.fs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
module BuildTools
2+
3+
open Fake.Core
4+
open Fake.DotNet
5+
6+
module Tools =
7+
let private findTool tool winTool =
8+
let tool = if Environment.isUnix then tool else winTool
9+
match ProcessUtils.tryFindFileOnPath tool with
10+
| Some t -> t
11+
| _ ->
12+
let errorMsg =
13+
tool + " was not found in path. " +
14+
"Please install it and make sure it's available from your path. "
15+
failwith errorMsg
16+
17+
let private runTool (cmd:string) args workingDir =
18+
let arguments = args |> String.split ' ' |> Arguments.OfArgs
19+
Command.RawCommand (cmd, arguments)
20+
|> CreateProcess.fromCommand
21+
|> CreateProcess.withWorkingDirectory workingDir
22+
|> CreateProcess.ensureExitCode
23+
|> Proc.run
24+
|> ignore
25+
26+
let dotnet cmd workingDir =
27+
let result =
28+
DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd ""
29+
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir
30+
31+
let femto = runTool "femto"
32+
let node = runTool (findTool "node" "node.exe")
33+
let yarn = runTool (findTool "yarn" "yarn.cmd")
34+
let npm = runTool (findTool "npm" "npm.cmd")

Fumble.sln

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ACBEE43C
1010
EndProject
1111
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Fumble.Tests", "tests\Fumble.Tests\FumbleTests.fsproj", "{1CA2E092-2320-451D-A4F0-9ED7C7C528CA}"
1212
EndProject
13-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7594D4D1-487B-4686-83B0-BC0955E5B677}"
14-
ProjectSection(SolutionItems) = preProject
15-
.gitattributes = .gitattributes
16-
.gitignore = .gitignore
17-
.travis.yml = .travis.yml
18-
appveyor.yml = appveyor.yml
19-
build.cmd = build.cmd
20-
build.fsx = build.fsx
21-
build.sh = build.sh
22-
LICENSE.md = LICENSE.md
23-
paket.dependencies = paket.dependencies
24-
paket.lock = paket.lock
25-
README.md = README.md
26-
RELEASE_NOTES.md = RELEASE_NOTES.md
27-
EndProjectSection
13+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Docs", "src\Docs\Docs.fsproj", "{63297B98-5CED-492C-A5B7-A5B4F73CF142}"
2814
EndProject
2915
Global
3016
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -36,6 +22,10 @@ Global
3622
Release|x86 = Release|x86
3723
EndGlobalSection
3824
GlobalSection(ProjectConfigurationPlatforms) = postSolution
25+
{63297B98-5CED-492C-A5B7-A5B4F73CF142}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
26+
{63297B98-5CED-492C-A5B7-A5B4F73CF142}.Debug|Any CPU.Build.0 = Debug|Any CPU
27+
{63297B98-5CED-492C-A5B7-A5B4F73CF142}.Release|Any CPU.ActiveCfg = Release|Any CPU
28+
{63297B98-5CED-492C-A5B7-A5B4F73CF142}.Release|Any CPU.Build.0 = Release|Any CPU
3929
{5D30E174-2538-47AC-8443-318C8C5DC2C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4030
{5D30E174-2538-47AC-8443-318C8C5DC2C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
4131
{5D30E174-2538-47AC-8443-318C8C5DC2C9}.Debug|x64.ActiveCfg = Debug|Any CPU
-33.5 KB
Binary file not shown.

docs/1.style.17d913428f30832dbf84.css

Lines changed: 0 additions & 156 deletions
This file was deleted.

docs/1.style.17d913428f30832dbf84.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
-131 KB
Binary file not shown.

0 commit comments

Comments
 (0)