Skip to content

Commit faf9fe8

Browse files
committed
Add the other packages to the release. Update the docs to explain the different packages.
1 parent 0f4b292 commit faf9fe8

7 files changed

Lines changed: 53 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ jobs:
2121
dotnet-version: "9.0.x"
2222

2323
- name: Restore
24-
run: dotnet restore FunctionalStateMachine.Core/FunctionalStateMachine.Core.csproj
24+
run: dotnet restore FunctionalStateMachine.sln
2525

2626
- name: Build
27-
run: dotnet build FunctionalStateMachine.Core/FunctionalStateMachine.Core.csproj --configuration Release --no-restore
27+
run: dotnet build FunctionalStateMachine.sln --configuration Release --no-restore
28+
29+
- name: Set Version
30+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
2831

2932
- name: Pack
30-
run: dotnet pack FunctionalStateMachine.Core/FunctionalStateMachine.Core.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source
33+
run: |
34+
dotnet pack FunctionalStateMachine.Core/FunctionalStateMachine.Core.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source /p:PackageVersion=${VERSION}
35+
dotnet pack FunctionalStateMachine.CommandRunner/FunctionalStateMachine.CommandRunner.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source /p:PackageVersion=${VERSION}
36+
dotnet pack FunctionalStateMachine.Diagrams/FunctionalStateMachine.Diagrams.csproj --configuration Release --no-build --output ./artifacts --include-symbols --include-source /p:PackageVersion=${VERSION}
3137
3238
- name: Release
3339
uses: softprops/action-gh-release@v2

Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project>
2+
<PropertyGroup>
3+
<PackageVersion Condition="'$(PackageVersion)' == ''">0.0.0-dev</PackageVersion>
4+
</PropertyGroup>
5+
</Project>

FunctionalStateMachine.CommandRunner.Generator/FunctionalStateMachine.CommandRunner.Generator.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
88
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
99
<NoWarn>$(NoWarn);RS1035</NoWarn>
10+
<IsPackable>false</IsPackable>
1011
</PropertyGroup>
1112

1213
<ItemGroup>

FunctionalStateMachine.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_", "_", "{919D74CB-8078-40
2727
docs\internal-transitions.md = docs\internal-transitions.md
2828
docs\no-data.md = docs\no-data.md
2929
docs\state-data.md = docs\state-data.md
30+
docs\packages.md = docs\packages.md
3031
EndProjectSection
3132
EndProject
3233
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunctionalStateMachine.CommandRunner", "FunctionalStateMachine.CommandRunner\FunctionalStateMachine.CommandRunner.csproj", "{A0A6A44F-CD8C-49F6-B659-5BA7B77A2BB4}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ var (nextState, nextData, commands) = machine.Fire(new LightTrigger.Toggle(), cu
7070

7171
Each feature has its own short guide with simple and more advanced examples.
7272

73+
- Packages and when to reference them: [docs/packages.md](docs/packages.md)
7374
- Commands instead of side effects: [docs/commands-vs-effects.md](docs/commands-vs-effects.md)
7475
- Fluent configuration: [docs/fluent-configuration.md](docs/fluent-configuration.md)
7576
- Entry and exit commands: [docs/entry-exit.md](docs/entry-exit.md)
@@ -86,4 +87,3 @@ Each feature has its own short guide with simple and more advanced examples.
8687
## Additional
8788

8889
- See Samples in `FunctionalStateMachine.Samples` project.
89-

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Welcome to the Functional State Machine docs. Each guide introduces a feature, w
44

55
## Core features
66

7+
- Packages and when to reference them: `packages.md`
78
- Commands instead of side effects: `commands-vs-effects.md`
89
- Fluent configuration: `fluent-configuration.md`
910
- Entry and exit commands: `entry-exit.md`

docs/packages.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Packages
2+
3+
This library is split into a few packages so you can reference only what you need.
4+
5+
## FunctionalStateMachine.Core
6+
7+
The core state machine implementation.
8+
Most consumers should reference this package otherwise what are you even doing here? 🤣
9+
10+
## FunctionalStateMachine.CommandRunner
11+
12+
Optional command runner integration that dispatches commands through DI.
13+
You can implement your own command dispatcher but it's very boilerplate-y.
14+
15+
Use it when you want:
16+
- Command handlers as DI-resolved classes.
17+
- A built-in provider to run commands returned by the state machine.
18+
19+
Note: It includes a source generator so the disptacher does not use reflection.
20+
21+
## FunctionalStateMachine.Diagrams
22+
23+
Design-time diagram generator for Mermaid diagrams.
24+
25+
Use it when you want:
26+
- Build-time diagrams from your builder methods.
27+
- No runtime dependency (analyzer-only package).
28+
29+
Add a package reference and annotate builder methods with `[StateMachineDiagram("path/to/diagram.md")]`.
30+
31+
## Quick reference
32+
33+
- Always: `FunctionalStateMachine.Core`
34+
- Optional: `FunctionalStateMachine.CommandRunner` for DI-based command execution.
35+
- Optional: `FunctionalStateMachine.Diagrams` for build-time Mermaid diagrams.

0 commit comments

Comments
 (0)