{"id":25718980,"url":"https://github.com/scala2ts/scala2ts-core","last_synced_at":"2026-04-16T00:32:02.667Z","repository":{"id":39851417,"uuid":"256794705","full_name":"scala2ts/scala2ts-core","owner":"scala2ts","description":"The Scala Compiler Plugin for Scala2TS","archived":false,"fork":false,"pushed_at":"2024-08-19T19:44:00.000Z","size":101,"stargazers_count":2,"open_issues_count":13,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T04:57:51.931Z","etag":null,"topics":["compiler-plugin","scala","transpiler","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scala2ts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-18T16:01:02.000Z","updated_at":"2021-07-29T10:12:12.000Z","dependencies_parsed_at":"2025-02-25T16:31:57.336Z","dependency_job_id":"2d9ee743-4dd6-422c-968e-0d440bdf2f37","html_url":"https://github.com/scala2ts/scala2ts-core","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/scala2ts/scala2ts-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scala2ts%2Fscala2ts-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scala2ts%2Fscala2ts-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scala2ts%2Fscala2ts-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scala2ts%2Fscala2ts-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scala2ts","download_url":"https://codeload.github.com/scala2ts/scala2ts-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scala2ts%2Fscala2ts-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compiler-plugin","scala","transpiler","typescript"],"created_at":"2025-02-25T16:27:34.142Z","updated_at":"2026-04-16T00:32:02.320Z","avatar_url":"https://github.com/scala2ts.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# scala2ts-core\n\n\u003e Transform your Scala classes, objects and traits into Typescript interfaces and classes\n\nThis repository contains the parser, transpiler and renderer for the scala2ts\nproject. It's primary purpose is to act as a [Scala compiler plugin](https://docs.scala-lang.org/overviews/plugins/index.html) that, on compile, will\nproduce equivalent Typescript typings for your desired Scala classes, objects and traits.\n\n## SBT\n\nIt is highly recommended that if you use SBT for your project, to use the `scala2ts-sbt` SBT plugin\ninstead of this project directly. It streamlines adding the compiler plugin and configuring it for you.\n\nYou can find the project [here](https://github.com/scala2ts/scala2ts-sbt). If you dont use SBT or have a \nmore complex build configuration, proceed below.\n\n## Support\n\n![Maven Central](https://img.shields.io/maven-central/v/com.github.scala2ts/scala2ts-core_2.13)\n\n|**Version**|**Scala**|\n|---|---|\n|1.1.x|2.13\u003cbr /\u003e2.12\u003cbr /\u003e2.11|\n|1.0.x|2.13\u003cbr /\u003e2.12\u003cbr /\u003e2.11|\n\n## Usage\n\n```sbt\n// build.sbt\n\nlazy val yourProject = (project in file(\".\"))\n  .settings(\n    autoCompilerPlugins := true,\n    addCompilerPlugin(\"com.github.scala2ts\" % \"scala2ts-core\" % \"latestVersion\"),\n    scalacOptions := Seq(\n      // See below for configuration options\n    ) \n  )\n```\n\nAdding `autoCompilerPlugins` tells SBT to automatically include the `-Xplugin` scalac flag with the\nappropriate path to found compiler plugins.\n\n## Configuration\n\nThere are many configuration options in how and what Typescript is emitted from your Scala code. The defaults\nof which can be found in the [`com.github.scala2ts.configuration.Configuration`](https://github.com/scala2ts/scala2ts-core/blob/master/src/main/scala/com/github/scala2ts/configuration/Configuration.scala#L3) case class.\nFor ease of use, here is the current list of configuration options and their defaults:\n\n|**Option**|**Flag**|**Multi**|**Type**|**Default**|**Description**|\n|---|---|---|---|---|---|\n|Debug|-P:scala2ts:debug|no|Boolean|false|Enable debug logging|\n|Include File|-P:scala2ts:file:includes|yes|Regex| |File path to include in compilation|\n|Exclude File|-P:scala2ts:file:excludes|yes|Regex| |File path to exclude in compilation|\n|Include Type|-P:scala2ts:type:includes|yes|Regex| |Type name to include in compilation|\n|Exclude Type|-P:scala2ts:type:excludes|yes|Regex| |Type name to exclude in compilation|\n|Prefix|-P:scala2ts:type:prefix|no|String| |A prefix to use in your Typescript names (e.g. I for IInterface)|\n|Suffix|-P:scala2ts:type:suffix|no|String| |A suffix to use in your Typescript names (e.g. Data InterfaceData)|\n|Date Mapping|-P:scala2ts:date|no|String|AsDate|How to emit Date types (options: AsDate, AsString, AsNumber)|\n|Long \u0026 Double Mapping|-P:scala2ts:longDouble|no|String|AsString|How to emit Long(s) or Double(s) (options: AsString, AsNumber)|\n|Sealed Trait Type Mapping|-P:scala2ts:sealedTypes|no|SealedTypesMapping|None|Emit an enum or type union for a sealed trait/class's members (options: None, AsEnum, AsUnion, AsUnionString)|\n|Render As|-P:scala2ts:renderAs|no|RenderAs|Interface|How to render interfaces/classes|\n|Class Discriminator|-P:scala2ts:includeDiscriminator|no|Boolean|false|Include a class property that acts as a discriminator|\n|Discriminator Name|-P:scala2ts:discriminatorName|no|String|\"type\"|The name of the class discriminator property|\n|Output Directory|-P:scala2ts:outDir|no|String| |What directory to emit files to|\n|Output File Name|-P:scala2ts:outFileName|no|String|index.d.ts|The name of the outputted Typescript file|\n|package.json Name|-P:scala2ts:pj:name|no|String| |The name to use in package.json. Note: This is the only required field to enable package.json to emit|\n|package.json Version|-P:scala2ts:pj:name|no|String| |The version to use in package.json|\n|package.json Types|-P:scala2ts:pj:types|no|String| |The path to use in the types field of package.json|\n|package.json publishConfig Registry|-P:scala2ts:pj:registry|no|String| |The url to use for an external NPM registry|\n\n## Motivations\n\nMost current Scala -\u003e TS solutions rely on SBT, where they couple the transpile code within an SBT plugin. The way\nSBT operates, it has its own Scala version separate from the project its operating on. This means that these plugins\ncan only operate on 2.10 (SBT 0.x) and 2.12 (SBT 1.x) codebases. \n\nWhy is this the case? Scala's reflection library can only operate on Scala code produced by the specific Scala version\nbeing used at the time. If I compile a 2.13 project, I cannot use the 2.12 reflection library against that code. This \nis where the limitations of the current SBT plugins comes to light.\n\nThis library tries to eliminate that by operating at the compiler level, where we're guaranteed binary compatibility.\nThe SBT plugin (scala2ts-sbt) merely acts as a configuration layer for the compiler plugin.\n\n## Acknowledgments\n\nBig thanks to the maintainers of `scala-ts` and `Typescript-Generator` projects, specifically [@cchantep](https://github.com/cchantep) [PR](https://github.com/scala-ts/scala-ts/pull/20) \nwith the `scala-ts`library which was the inspiration for this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscala2ts%2Fscala2ts-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscala2ts%2Fscala2ts-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscala2ts%2Fscala2ts-core/lists"}