Skip to content
shayanhabibiPublic

Latest commit

 

History

1,006 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Xantham

Warning

New Xantham releases are temporarily published to Cloudsmith. I am waiting for NuGet support to transfer package ownership back to me. Until the transfer is complete, use the Xantham Cloudsmith feed for the tool, generator and companion packages. Older releases remain on nuget.org.

NuGet source: https://nuget.cloudsmith.io/shayanhabibi/xantham/v3/index.json

This warning will be removed and publishing will return to nuget.org once the transfer is complete.

Add the temporary source alongside nuget.org so package dependencies can also be restored:

dotnet nuget add source https://nuget.cloudsmith.io/shayanhabibi/xantham/v3/index.json --name xantham-temporary

Release CI publishes to this source using the repository secret CLOUDSMITH_API_KEY. When ownership is restored, remove the temporary warnings, switch the default and CI --nuget-source back to https://api.nuget.org/v3/index.json, and restore the NuGet credential.

NuGet Version NuGet Version NuGet Version NuGet Version NuGet Version

Xantham is a TypeScript → F# Fable bindings generator, built on the TypeScript 7 compiler's own API server. Pure F# consumer and producer.

The TypeScript 7 compiler API protocol is generated from the source, and distributed independently as Xantham.TypeScript.Wire.


Xantham

# Install dotnet tool
dotnet tool install --global xantham

# View help line
xantham --help

# Cache the pinned typescript compiler
xantham tsc init
# Generate bindings
xantham generate node_modules/typescript_package

The xantham tool can be configured using a .json file. The schema can be pointed to reference the repository schema, or generated to match the version of the tool you are using:

xantham schema

xantham schema -o xantham.schema.json

See the Docs for more information.

The generator is also published as Xantham.Generator for customisations and applications that embed the generation pipeline. It includes a dependency on Xantham.TypeScript.Wire.

dotnet add package Xantham.Generator

Xantham.TypeScript.Wire

The tsc --api protocol that is used by xantham. It is generated from the source, with clear instructions provided in AGENTS.md and our associated documentation on how to generate it for a specific version of the compiler, or to update it. The instructions are specific only for those parts of the protocol that are not generated.

Sync vs Async

The tsc async api uses a different messaging envelope with a higher memory footprint. The performance at design time between using the sync api with batchRequests and the async api was not significant, but the memory efficiency was.

For this reason, we generate against the synchronous api, and use a MailboxProcessor to batch requests asynchronously in-process.

Usage

dotnet add package Xantham.TypeScript.Wire

The wire protocol and its usage are explained in the docs. You can also observe its usage from our implementation of the generator.


Support Packages

These are packages distributed and maintained by the authors, which are either required for the generated output, or warrant a centralised implementation (ie @types/node).

Package Required Description
Xantham.Fable.Core ✅ Utility types and functions that improve interoperability and representation of some TypeScript types.
Xantham.Fable.Core.TS ✅ The typescript library dom and es* bindings.
Xantham.Fable.Node Bindings to @types/node - ~300k loc.

See the Docs

Docs are generated from the source.

Releases

Sponsor this project

Packages

Contributors

Languages