Local Build
This is the contributor workflow for regenerating and building the libraries from source. See Packages for the planned NuGet release and its current status. The build generates the runtime bindings from exact releases of Cloudflare's npm packages and the control-plane clients from a pinned copy of Cloudflare's OpenAPI document.
- You need .NET SDK 10.0.401, Node.js with npm, Python 3, git
- You get Compiled bindings and a local package feed
Sibling Checkouts
The build requires three more repositories beside FSharp.CloudEdge. Xantham and Hawaii are the generators: Xantham reads Cloudflare's TypeScript declarations for the runtime bindings, and Hawaii reads Cloudflare's OpenAPI document for the control-plane clients. The third checkout, BAREWire, is a dependency of one test in the solution.
Make a parent folder named
reposfor the checkouts.mkdir repos cd reposClone the four repositories, with Hawaii on its
fsharp-cloudedge-supportbranch.git clone https://github.com/fsprojects/FSharp.CloudEdge.git git clone https://github.com/shayanhabibi/Xantham.git git clone --branch fsharp-cloudedge-support https://github.com/FidelityFramework/Hawaii.git git clone https://github.com/FidelityFramework/BAREWire.gitSwitch Xantham to commit
c7e2fa0. The runtime bindings in the repository were generated with a Xantham tool packed from that commit.git -C Xantham switch --detach c7e2fa0daa2ed3ec662cd453ae4c287a6a28673bHEAD is now at c7e2fa0 Flatten interface bases emitted as abstract classes
The parent folder now holds four checkouts. The package-based First Worker guide does not require this folder layout.
ls
BAREWire FSharp.CloudEdge Hawaii Xantham
Generator Tools
Xantham and Hawaii run as .NET tools that you pack from your checkouts. Enter the remaining commands on this page in the FSharp.CloudEdge folder.
Install the repository's npm dependencies. They include the pinned TypeScript compiler, which Xantham uses to read the declarations.
cd FSharp.CloudEdge npm ciadded 3 packages, and audited 4 packages in 330ms found 0 vulnerabilitiesPack the generators and Xantham's support packages.
npm run tools:bootstrapxantham: installed xantham 0.1.0-local.4c8eab44ac350e5cf178 hawaii-unofficial: installed Hawaii.Unofficial 1.0.0-local.8d94cc643f84f47d4848 Local tools are pinned in .config/dotnet-tools.json; package hashes are in config/tool-packages.json.The bootstrap packs the Xantham and Hawaii checkouts with
dotnet packin Release and writes the packages toartifacts/tool-feed. It also packsXantham.Fable.CoreandXantham.Fable.Core.TS, the two support packages that every runtime binding requires. Each version number ends in a digest of the package's source and build recipe, and the digest also covers your SDK version. With another SDK patch, your digests differ from the ones above. The bootstrap then installs both tools in the repository's tool manifest,.config/dotnet-tools.json, and records the package hashes inconfig/tool-packages.json.Restore the tools that the manifest lists.
npm run tools:restoreThe command wraps
dotnet tool restore, which fetches Fable 5.13.0 from nuget.org and the two generators fromartifacts/tool-feed. When the restore prints a notice about a newer Fable release, keep the manifest at 5.13.0. On First Worker you install Fable 5.13.0 as well.
Library Build
Install the npm packages that provide the TypeScript declarations.
npm run install:profiles -- --deliveryEach folder under
profiles/is a dependency profile: a set of npm packages with its own lock file. With--delivery, the installer runsnpm ci --ignore-scriptsin the 24 profiles thatnpm run buildreads. It prints one line per profile, such asagents: installed.Check the support package.
npm run test:support-packageThis builds a small F# project with
Xantham.Fable.Core, restored from the local feed. Fable compiles that project to JavaScript, and a Node script checks the result. It finishes withPackage-only support smoke passedand the package version.Generate and compile the libraries.
npm run build- Xantham generates the 31 runtime libraries from the declarations in the profiles, along with the three AI SDK contract libraries they share. The build then compiles those 34 libraries.
- A Python runner downloads Cloudflare's OpenAPI document at a pinned commit and verifies its SHA-256. Hawaii generates the 11 control-plane clients and their shared model project from the downloaded file. The runner builds those 12 projects. A test program then sends four requests through the Tenancy and Compute clients to a loopback HTTP server.
- The build compiles the solution,
FSharp.CloudEdge.slnx, in Release.
On success, the last line of output starts with
Complete hierarchy compiledand lists the project counts. The build writes a log for each stage underartifacts/, andartifacts/library-build/latest.jsonrecords how the most recent attempt ended.Finish with the ByteBridge test.
npm run test:bridge{"passed":13,"runtime":"v25.1.0","scope":"Fable, generated Workers Body bindings and BAREWire codecs in Node Fetch"}The ByteBridge test project references the Workers bindings and BAREWire. Fable translates it to JavaScript, and Node runs its 13 checks. The JSON line reports the number of checks that passed and the Node runtime.
Rebuilds
A second build can reuse the first. With --resume, the build compares each library's input, generator and output hashes with the values that the previous build recorded. Where they match, the build skips generation for that library. Where they differ, the generator runs again. Compilation covers every library either way.
npm run build -- --resume
The bootstrap compares hashes too. When a generator's source is unchanged, the bootstrap reuses the package in artifacts/tool-feed after it verifies the package against its build receipt.
In a new clone on the same machine, the bootstrap packs the tools again with the same version numbers. NuGet still holds the packages from the first clone in its cache at ~/.nuget/packages, so the bootstrap installs those copies and stops with installed cache differs from the local package. Delete the cached tool packages, then repeat the bootstrap.
rm -rf ~/.nuget/packages/xantham ~/.nuget/packages/hawaii.unofficial
npm run tools:bootstrap
Build Output
Source-based consumers use two folders from FSharp.CloudEdge.
src/holds the bindings, compiled in Release. A source-based Worker consumer can referencesrc/Runtime/Platform/FSharp.CloudEdge.Runtime.Workers, and a source-based upload program can reference the control-plane projects insrc/Coreandsrc/Management.artifacts/tool-feed/is the local package feed. The runtime bindings referenceXantham.Fable.CoreandXantham.Fable.Core.TS, so a project that uses the bindings restores those two packages from this folder.
To run site examples against these source builds instead of packages, pass -p:CloudEdgeUseSource=true. The normal example mode uses NuGet 0.1.0.
dotnet build site/examples/FirstWorker/FirstWorker.fsproj -c Release -p:CloudEdgeUseSource=true