Skip to content

Commit 74a1975

Browse files
committed
chore: upgrade dependencies and repository automation
1 parent 440fe9a commit 74a1975

12 files changed

Lines changed: 357 additions & 269 deletions

File tree

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"isRoot": true,
44
"tools": {
55
"fable": {
6-
"version": "5.0.0",
6+
"version": "5.13.0",
77
"commands": [
88
"fable"
99
],
1010
"rollForward": false
1111
},
1212
"fantomas": {
13-
"version": "7.0.3",
13+
"version": "7.0.5",
1414
"commands": [
1515
"fantomas"
1616
],

.github/dependabot.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "nuget"
5+
directories:
6+
- "/"
7+
- "/Fable.Literate"
8+
- "/Fable.Literate.Tests"
9+
schedule:
10+
interval: "weekly"
11+
groups:
12+
nuget-minor-and-patch:
13+
patterns:
14+
- "*"
15+
update-types:
16+
- "minor"
17+
- "patch"
18+
19+
- package-ecosystem: "uv"
20+
directory: "/"
21+
schedule:
22+
interval: "weekly"
23+
groups:
24+
python-minor-and-patch:
25+
patterns:
26+
- "*"
27+
update-types:
28+
- "minor"
29+
- "patch"
30+
31+
- package-ecosystem: "npm"
32+
directory: "/"
33+
schedule:
34+
interval: "weekly"
35+
groups:
36+
npm-minor-and-patch:
37+
patterns:
38+
- "*"
39+
update-types:
40+
- "minor"
41+
- "patch"
42+
43+
- package-ecosystem: "github-actions"
44+
directory: "/"
45+
schedule:
46+
interval: "weekly"
47+
groups:
48+
actions-minor-and-patch:
49+
patterns:
50+
- "*"
51+
update-types:
52+
- "minor"
53+
- "patch"

.github/workflows/build-blogpost.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ jobs:
1616
- name: Set up .NET
1717
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: '8.0.x'
19+
dotnet-version: '10.0.x'
2020

2121
- name: Set up Python
2222
uses: actions/setup-python@v5
2323
with:
24-
python-version: '3.12'
24+
python-version: '3.14'
2525

2626
- name: Set up Node.js
2727
uses: actions/setup-node@v4
2828
with:
29-
node-version: '20'
29+
node-version: '22'
3030

3131
- name: Install uv
3232
run: pipx install uv

AGENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
5+
This repository is a self-documenting Fable.Python guide. Author chapter content as literate F# in `chapters/*.fs`; each file mixes executable examples with Markdown in `(** ... *)` comments. Keep chapter order synchronized between `fable-python.fsproj` and the `chapters` variable in `justfile`.
6+
7+
`Fable.Literate/` contains the F# parser and Markdown generator. Its cross-target tests live in `Fable.Literate.Tests/`. Fable writes generated Python to `output/`, while documentation is generated under `docs/`; do not hand-edit generated files. `docs/blogpost.md` is the published, tracked aggregate.
8+
9+
## Build, Test, and Development Commands
10+
11+
Use the repository `justfile` as the command entry point:
12+
13+
- `just setup` restores local .NET tools and synchronizes Python dependencies with `uv`.
14+
- `just restore` restores NuGet and npm dependencies.
15+
- `just build` transpiles the chapters and converter to Python.
16+
- `just generate` rebuilds individual chapter Markdown; `just blogpost` rebuilds `docs/blogpost.md`.
17+
- `just watch` recompiles chapter sources during development.
18+
- `just test-all` runs the Expecto suite on .NET and the Pyxpecto build on Python. Use `just test` or `just test-python` for one target.
19+
- `just format` applies Fantomas to F# and Ruff to generated Python; `just lint` checks generated Markdown.
20+
- `just all` runs the complete restore, generation, formatting, and lint pipeline, but not tests.
21+
22+
## Coding Style & Naming Conventions
23+
24+
Use four-space indentation and let Fantomas format `.fs` files according to `.editorconfig`. Follow F# conventions: PascalCase for modules, types, and chapter filenames; camelCase for values and functions. Keep examples compatible with both .NET and Fable.Python unless a chapter explicitly demonstrates target-specific interop. Use Ruff for generated Python and markdownlint for generated documentation.
25+
26+
## Testing Guidelines
27+
28+
Tests use Expecto on .NET and Fable.Pyxpecto on Python. Add focused cases to `Fable.Literate.Tests/Tests.fs`, group them in descriptive `testList` values, and name cases as behaviors, such as `"parses simple markdown block"`. Run `just test-all` before submitting changes to the converter or generation pipeline.
29+
30+
## Commit & Pull Request Guidelines
31+
32+
Recent history uses short, imperative Conventional Commit prefixes such as `feat:`, `fix:`, `docs:`, and `chore:`. Keep each commit scoped. Pull requests should summarize the source change, note generated documentation updates, and list validation commands. Include the rebuilt `docs/blogpost.md` when chapter output changes; link relevant issues and add screenshots only when rendered output needs visual review.

CLAUDE.md

Lines changed: 2 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,3 @@
1-
# CLAUDE.md
1+
# Claude Code Guidance
22

3-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4-
5-
## Project Overview
6-
7-
**F# Advent 2025 blog post project** demonstrating Fable.Python capabilities.
8-
9-
**Fable.Literate** is a literate programming converter (inspired by jupytext) written in F# that transpiles to Python via Fable.Python. It processes `.fs` files with embedded Markdown comments (FSharp.Formatting conventions) and outputs GitHub-flavored Markdown suitable for publishing on platforms like Hashnode.
10-
11-
**Key concept:** The project is self-documenting - the chapters and converter generate the blog post that documents how they work.
12-
13-
## Build Commands (using just)
14-
15-
```bash
16-
just setup # Install Fable and Python dependencies
17-
just restore # Restore NuGet packages
18-
just build # Build all chapters and tools to Python
19-
just generate # Generate individual markdown docs from chapters
20-
just blogpost # Generate concatenated blogpost.md for publishing
21-
just format # Format Python with ruff
22-
just lint # Lint Markdown (markdownlint)
23-
just watch # Watch mode for development
24-
just clean # Clean generated files
25-
just all # Full pipeline: restore, build, generate, format, lint
26-
```
27-
28-
## Architecture
29-
30-
### Fable.Literate AST Pipeline
31-
32-
The converter follows a compiler-like architecture with three phases:
33-
34-
1. **Parse**: Convert source lines into a Block AST
35-
2. **Transform**: Filter hidden blocks, resolve Python includes
36-
3. **Print**: Render the AST as Markdown
37-
38-
### Literate Directives
39-
40-
| Directive | Purpose |
41-
|-----------|---------|
42-
| `(** content *)` | Raw markdown content |
43-
| `(*** hide ***)` | Hide following code from output |
44-
| `(*** include-python: symbol ***)` | Include generated Python for symbol |
45-
| Regular F# code | Wrapped in ```fsharp fenced blocks |
46-
47-
### File Structure
48-
49-
```text
50-
chapters/
51-
├── Introduction.fs # What is Fable.Python, why use it
52-
├── Python.fs # F# concepts for Python developers
53-
├── GettingStarted.fs # Setup, first project, hello world
54-
├── Interop.fs # Using existing Python libraries
55-
├── Bindings.fs # Creating Python bindings
56-
├── Compatibility.fs # F# features supported, limitations
57-
├── AsyncProgramming.fs # async vs task, Python asyncio mapping
58-
├── Testing.fs # Testing F# code with Python test runners
59-
├── FableV5.fs # Fable v5 features, Rust core, PyPI
60-
├── Pydantic.fs # Pydantic models, DTOs, validation
61-
├── FastAPI.fs # Type-safe web APIs with FastAPI
62-
├── UnitsOfMeasure.fs # Compile-time dimensional analysis
63-
├── FableLiterate.fs # Symlink → ../Fable.Literate/App.fs
64-
└── Summary.fs # Wrap-up, resources, repo link
65-
Fable.Literate/
66-
├── App.fs # Fable.Literate converter source (F#)
67-
└── Fable.Literate.fsproj
68-
output/
69-
├── chapters/ # Generated Python from chapters
70-
└── Fable.Literate/
71-
└── app.py # Generated converter (Python)
72-
docs/
73-
├── *.md # Individual chapter markdown
74-
└── blogpost.md # Concatenated for Hashnode
75-
```
76-
77-
## Chapter Writing Guidelines
78-
79-
- Each chapter is a literate F# file with embedded markdown
80-
- Use `(** ... *)` for markdown content
81-
- Use `(*** hide ***)` to hide setup code (module declarations, imports)
82-
- Use `(*** include-python: symbolName ***)` to show generated Python
83-
- Tables are auto-formatted by markdownlint - don't fight it
84-
- Keep code examples self-contained and buildable
85-
86-
## Fable.Python Considerations
87-
88-
- Use `Fable.Core` attributes (`[<Emit>]`, `[<Import>]`, etc.)
89-
- Use `Fable.Python.Pydantic` for Pydantic interop
90-
- Stick to Fable-compatible F# subset
91-
- `task { }` compiles to native Python `async def` (Fable v5)
92-
- `async { }` for multi-target code (Python, .NET, JS)
93-
94-
## Resources
95-
96-
- [Fable.Python docs](https://fable.io/docs/getting-started/python.html)
97-
- [Fable.Python GitHub](https://github.com/fable-compiler/Fable.Python/)
98-
- [Content Plan](CONTENT-PLAN.md) - Chapter structure and TODO items (important!)
3+
Follow the repository-wide contributor and agent instructions in [AGENTS.md](AGENTS.md).

Fable.Literate.Tests/Fable.Literate.Tests.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<PackageReference Include="Fable.Pyxpecto" Version="2.0.0" />
1414
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
1515
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.14.3" />
16-
<PackageReference Include="Fable.Core" Version="5.0.0" />
17-
<PackageReference Include="Fable.Python" Version="5.1.0" />
16+
<PackageReference Include="Fable.Core" Version="5.2.0" />
17+
<PackageReference Include="Fable.Python" Version="5.4.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>

Fable.Literate/Fable.Literate.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Fable.Core" Version="5.0.0" />
11-
<PackageReference Include="Fable.Python" Version="5.1.0" />
10+
<PackageReference Include="Fable.Core" Version="5.2.0" />
11+
<PackageReference Include="Fable.Python" Version="5.4.0" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

fable-python.fsproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Fable.Core" Version="5.0.0" />
10-
<PackageReference Include="Fable.Python" Version="5.1.0" />
9+
<PackageReference Include="Fable.Core" Version="5.2.0" />
10+
<PackageReference Include="Fable.Python" Version="5.4.0" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

0 commit comments

Comments
 (0)