Skip to content
CAI
Software that uses CAICheck a score

fable-compiler/ts2fable

50.7

Adequate · 13 November 2026

30.9k

lines of production code

F#

primary language

8

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

ts2fable is a command-line tool and web application that converts TypeScript declaration files into type-safe F\# bindings for use with Fable. It leverages the TypeScript compiler API to parse syntax and transform abstract syntax trees into F\# code, handling complex patterns such as generics, interfaces, and JSDoc comments. The system includes a web interface built with React and Monaco for interactive conversion, alongside a robust test suite that validates the accuracy of the generated bindings against various real-world libraries.

How it got here

2017–2018 — Initial development and web interface

18 changes.

This period established the core ts2fable TypeScript-to-F\# converter, including its build infrastructure, AST transformation logic, and initial Fable bindings for the TypeScript compiler API. It also introduced a web-based interface using React and Monaco, alongside extensive test coverage for various library fragments and edge cases.

2019–2023 — Build migration and test expansion

7 changes.

The project migrated its build system to FAKE with .NET 7 and Fable 4, replacing the previous setup. Concurrently, extensive regression tests were added to verify the TypeScript-to-F\# conversion of complex patterns, including generic constraints, type literals, and JSDoc comment transformations.

Features

Add Remove Obsolete option to ts2fable web app

The ts2fable web application now includes a toggle in its configuration UI to remove obsolete functions, properties, and variables from the generated F\# code. This new option is exposed via a checkbox in the navbar, allowing users to control whether obsolete members are filtered out during the TypeScript-to-F\# conversion process.

ts2fable-web-app · high confidence

Add main SCSS entry point with Bulma customization

A new main.scss file has been added to the web-app styles, importing the Bulma framework along with the pageloader and tooltip extensions. This file establishes global styling defaults, such as setting the base body font size to 14px, and defines specific layout rules for the page content height, navbar inputs, and absolute positioning for copy buttons and notifications.

web-app/sass · high confidence

Initial project structure and build configuration

The repository has been initialized with the core project files for ts2fable, including the solution file (ts2fable.sln), project definitions, and a comprehensive README detailing usage, conventions, and testing procedures. Build infrastructure is established using FAKE via build.cmd and build.sh scripts, targeting .NET SDK 7.0.202 as specified in global.json. CI/CD is configured via appveyor.yml to build and package the tool, while Nuget.Config ensures package sources are correctly set up. Source control hygiene is improved with .gitattributes for consistent line endings and an updated .gitignore to exclude build artifacts, IDE files, and generated outputs.

(repo-wide) · high confidence

Initial release of the ts2fable TypeScript-to-F\# converter

This commit introduces the core source files for ts2fable, a tool that converts TypeScript definitions into F\# bindings. The implementation includes the main entry point (\TypeScript.fs\) which interfaces with the TypeScript compiler API, a bridge layer (\bridge.fs\) supporting both Node.js and web environments, and the internal modules for reading TypeScript syntax (\read.fs\), transforming the AST (\transform.fs\), printing F\# code (\print.fs\), and handling naming conventions (\naming.fs\). It also establishes the configuration options (\config.fs\) for controlling output behavior, such as emitting \ResizeArray\ vs arrays or handling tagged unions, and defines the internal syntax tree structures (\syntax.fs\).

src · high confidence

Initial release of ts2fable TypeScript-to-F\# bindings

This entry introduces the initial generation of F\# bindings for the TypeScript compiler API, providing a complete type-safe bridge to interact with TypeScript's syntax tree and compiler services from F\#. The generated code includes the full \TypeScript.Ts.IExports\ interface, mapping core compiler functions such as source file creation, scanner operations, and JSDoc tag extraction. It also defines the internal \ts2fable\ bridge layer (\NodeBridge\, \WebBridge\) which handles the translation of TypeScript paths and source files into F\# syntax trees, along with the \FsFile\ transformation pipeline that processes these trees into final F\# output.

ts2fable · high confidence

Introduce web-app scaffolding with Monaco editor and React components

The web-app location now includes the foundational files for a TypeScript-to-Fable web interface. This adds a webpack 5 build configuration (webpack.config.js) and a minimal entry page (index.html). It introduces React-based UI components for the user interface: an Editor component wrapping the Monaco code editor with resize handling, and a CopyButton component for clipboard operations. Additionally, it provides generated Fable type bindings (Monaco.fs) for the Monaco editor API and embedded TypeScript definitions (Samples.fs) for the Chai testing library, supported by a new paket.references file listing the Fable and Elmish dependencies.

web-app · high confidence

Node.js support for ES Modules and file system operations

Added new F\# source files in src/node to enable Node.js integration, specifically targeting ES Module compatibility and file system handling. The implementation includes file system utilities (readText, readLines, enumerateFiles) in FileSystem.fs, transformation logic for namespace fixes in Transform.fs, and version detection in Version.fs that uses import.meta.url to support ES Modules. The Write.fs module handles output generation, including a fix to properly split lines containing embedded newlines during file writing.

src/node · high confidence

Behavioural changes

Build system migrated to FAKE with .NET 7 and Fable 4

The build process has been rewritten using FAKE (F\# Make) to replace the previous setup, aligning with the upgrade to .NET 7 and Fable 4. This change introduces a new build script (Program.fs) and dependency references (paket.references) that manage the compilation of the CLI, tests, and web application via Fable and webpack. Users will now rely on this FAKE-based pipeline for building and testing the project.

build · high confidence

Tooling scripts converted to ES Modules

Internal build and utility scripts in the tools directory have been migrated to ES Modules. New scripts, including add-shebang.js and build-update.package.js, now use ES module syntax (import statements) to handle file operations and package.json modifications, replacing previous CommonJS patterns.

tools · high confidence

Test coverage

Added React type-fragment tests; Added regression tests for Babylon.js TypeScript-to-F\# conversion edge cases; Added regression tests for TypeScript-to-F\# conversion edge cases; Added test coverage for BreezeJS global class and variable bindings; Added test coverage for JSDoc comment transformations; Added test coverage for duplicate option handling in yargs; Added test coverage for generic type constraints; Added test fragment for ReactXP duplicated variable exports; Added test fragment for monaco-editor variable-in-module scenario; Added test fragment for string enums containing periods; Added test fragments for ReactXP multi-platform accessibility and app APIs; Added test fragments for keyof, index signatures, and type literals; Added tests for \#nowarn handling of obsolete usage and invalid XML comments; Added tests for obsolete removal and type imports.

Dependencies

Added Fable library references for test compilation

The test-compile project now explicitly references Fable.Core, Fable.Browser.Css, Fable.Browser.Dom, and Fable.Browser.Svg via a new paket.references file, ensuring the test compilation environment has access to these specific browser-related Fable libraries.

test-compile · high confidence

Migrate build infrastructure to .NET 7 and update core dependencies

The project's build system and core libraries have been upgraded to target .NET 7, including the main compiler project, the FAKE build script, and the test suite. The primary TypeScript dependency has been updated to version 5.1.6, and the Node.js engine requirement is now restricted to versions 12.20.0, 14.13.1, or 16.0.0 and above. Additionally, the web application dependencies have been cleared, and the test-compile suite has been adjusted to remove React while retaining other library bindings.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 46 → 51 (+4.5)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 85 → 81 (-3.4)
  • Architecture 89 → 89 (+0.0)
  • Maturity 46 → 45 (-0.8)
  • Readiness 25 → 33 (+8.0)
  • Security 75 → 87 (+11.2)
  • Performance 100 → 100 (+0.0)

Resolved (8)

  • End-of-life runtime: .NET net7.0 (web-app/ts2fable-web-app.fsproj)
  • High secret: WD-SECRET-0005 (package-lock.json)
  • IL efficiency: 13 authored method(s) exceed the IL budget (src/print.fs)
  • Rotate the exposed credentials — git history can't be un-committed
  • Vulnerable: Microsoft.Build.Tasks.Core
  • Vulnerable: NuGet.Packaging
  • Vulnerable: System.Formats.Asn1
  • Vulnerable: System.Text.Json

New (6)

  • End-of-life runtime: .NET net7.0 (build/fake/build.fsproj)
  • End-of-life runtime: .NET net7.0 (src/ts2fable.fsproj)
  • End-of-life runtime: .NET net7.0 (test-compile/test-compile.fsproj)
  • End-of-life runtime: .NET net7.0 (test/test.fsproj)
  • End-of-life runtime: .NET net7.0 (web-app/ts2fable-web-app.fsproj)
  • High CVE: [GHSA redacted] (package-lock.json)

Architecture

  • Unchanged — 0 containers · 2 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

fable-compiler/ts2fable was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 64a029ce32cf4503774d470430dcd1ef9fc1d151 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.61+preprod-b8b1a43ae4c3.