Skip to content
CAI
Software that uses CAICheck a score

fable-compiler/ts2fable

53.3

Weak · 24 September 2026

30.9k

lines of production code

F#

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

ts2fable is a command-line tool that converts TypeScript declaration files into F\# bindings for use with Fable. It leverages the TypeScript compiler API to parse syntax and transform the abstract syntax tree into F\# code, supporting various configuration options such as handling obsolete members, generic constraints, and JSDoc comments. The system includes an interactive web playground for testing conversions and is built using a FAKE-based pipeline targeting .NET 7.

How it got here

2017–2018 — Initial development and core feature implementation

15 changes.

This period established the ts2fable project from scratch, implementing the core TypeScript-to-F\# conversion engine and its build infrastructure. It introduced key features such as an interactive web playground, Node.js support, and various compiler configuration options. The work was heavily supported by expanding test coverage across diverse libraries like React, BreezeJS, and Monaco to ensure robust binding generation.

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

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

Introduce interactive web-app playground for ts2fable configuration

The web-app now provides an interactive playground that allows users to experiment with TypeScript-to-F\# conversion directly in the browser. The application features dual Monaco code editors for HTML and F\# code, along with a configuration panel in the navigation bar that exposes toggleable options for the ts2fable compiler: emitting ResizeArray instead of arrays, converting property functions, emitting tagged unions, and removing obsolete members. This enables users to instantly see how different compiler settings affect the generated F\# output.

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 watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 55 → 53 (-1.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 99 → 95 (-4.0)
  • Architecture 100 → 100 (-0.4)
  • Maturity 38 → 38 (+0.0)
  • Readiness 46 → 44 (-2.1)
  • Security 89 → 84 (-5.3)

Resolved (27)

  • Dependency hygiene not measured — no packages were read
  • Duplicated block (10 lines × 2) (src/TypeScript.fs)
  • Duplicated block (10 lines × 2) (src/read.fs)
  • Duplicated block (12 lines × 3) (src/read.fs)
  • Duplicated block (6 lines × 2) (src/TypeScript.fs)
  • Duplicated block (6 lines × 2) (src/TypeScript.fs)
  • Duplicated block (6 lines × 2) (src/TypeScript.fs)
  • Duplicated block (7 lines × 2) (src/TypeScript.fs)
  • Duplicated block (8 lines × 2) (web-app/Monaco.fs)
  • Duplicated block (8 lines × 6) (src/TypeScript.fs)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High vulnerability: [GHSA redacted] (package-lock.json)
  • Low CVE: [GHSA redacted] (package-lock.json)
  • Low CVE: [GHSA redacted] (package-lock.json)
  • Medium CVE: [GHSA redacted] (package-lock.json)
  • Medium CVE: [GHSA redacted] (package-lock.json)
  • Medium CVE: [GHSA redacted] (package-lock.json)
  • …and 7 more

New (32)

  • Duplicated block (11 lines × 3) (src/read.fs)
  • Duplicated block (13 lines × 2) (src/read.fs)
  • Duplicated block (5 lines × 3) (src/TypeScript.fs)
  • Duplicated block (6 lines × 2) (src/TypeScript.fs)
  • Duplicated block (6 lines × 2) (src/TypeScript.fs)
  • Duplicated block (6 lines × 2) (src/naming.fs)
  • Duplicated block (6 lines × 2) (web-app/Monaco.fs)
  • Duplicated block (7 lines × 2) (src/TypeScript.fs)
  • Duplicated block (7 lines × 2) (src/transform.fs)
  • Duplicated block (9 lines × 2) (src/TypeScript.fs)
  • End-of-life runtime: .NET net7.0
  • FileTooLong: src/TypeScript.fs (src/TypeScript.fs)
  • FileTooLong: src/print.fs (src/print.fs)
  • FileTooLong: src/read.fs (src/read.fs)
  • FileTooLong: src/transform.fs (src/transform.fs)
  • FileTooLong: src/transformComments.fs (src/transformComments.fs)
  • FileTooLong: web-app/Monaco.fs (web-app/Monaco.fs)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • High CVE: [GHSA redacted] (package-lock.json)
  • …and 12 more

Changes since last survey

  • 6 commits — 6 feature/other, 0 fixes

By area

  • (repo) — 3 commits
  • (root) — 3 commits

Notable commits

  • change: Build(deps-dev): Bump browserslist from 4.28.1 to 4.28.8
  • change: Build(deps-dev): Bump js-yaml from 4.2.0 to 4.3.1
  • change: Build(deps-dev): Bump js-yaml from 4.3.1 to 4.3.2
  • change: Merge pull request #522 from fable-compiler/dependabot/npm_and_yarn/js-yaml-4.3.1
  • change: Merge pull request #523 from fable-compiler/dependabot/npm_and_yarn/browserslist-4.28.8
  • change: Merge pull request #524 from fable-compiler/dependabot/npm_and_yarn/js-yaml-4.3.2

Written by watchdog.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 24 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 841c3230534560e6fa1c8a19d677c84f178d5bf3 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-923689c465cf.