ScalablyTyped

ScalablyTyped

  • Github

›Development

ScalablyTyped

  • Use Typescript libraries with Scala.js!

Getting started (application)

  • SBT plugin
  • SBT plugin without scalajs-bundler
  • Command line tool

Getting started (library)

  • How to share code

Usage

  • What do I do now?
  • Working with objects
  • Flavour
  • Encoding

Configuration

  • Customize the generated code.
  • Remote cache

Development

  • What if I hit problems importing libraries?
  • Development
  • Running

Running

Not a developer? Check out the command line tool instead.

In batch mode the converter will process all files from the DefinitelyTyped project, as well as a selection of libraries from npm.

You can run the main directly from from sbt (importer/run) or intellij. Since it's used both for development and for CI, it supports a bunch of command line options.

All parameters without a leading dash will be taken to be names of libraries to convert.

Specifying one or more libraries will put the converter in "debug mode". The only difference is that the UI is different, and no sbt plugin and commit is created. For development you'll always use "debug mode".

Main supports a bunch of command line options:

optiondescription
-conserveSpaceThe CI server (and perhaps your developer laptop) doesn't have much hard drive space. This thins out the node_modules folder resulting from installing all the libraries outside DefinitelyTyped and keeps only what we need
-debugModeForce debugMode
-demoSetAdds the set of all libraries used in the demos
-dontCleanProjectNormally the CI build aggressively resets the ScalablyTyped git repo. Enabling this will skip that
-enableParseCacheThe Typescript parser is somewhat slow. Enabling this uses java serialization to cache when possible
-forceCommitCommit and build sbt plugin in debug mode
-scala212Build libraries with Scala 2.12 instead of 3.0.0
-scala213Build libraries with Scala 2.13 instead of 3.0.0
-offlineSkip pulling newest DefinitelyTyped and running npm update
-pedanticMake the converter more strict. Most things don't work yet in this mode
-softWritesWill only write changed/deleted files. This is essential if you want to keep ScalablyTyped products open in an IDE to avoid reindexing the world.
-flavourNormaldefault
-flavourSlinkyUse slinky flavour, integrate with scala-js-dom, and generate slinky components
-flavourJapgollyUse scalajs-react flavour, integrate with scala-js-dom, and generate scalajs-react components
-useScalaJsDomTypesRewrite types to use scala-js-dom types when using -flavourNormal
-benchmarkRun a benchmark run. Typically use with -demoSet. Let it first run once to build/parsecache everything

Directories

By default, all files will be written to ~/.cache/scalablytyped. The only exception is the ivy artifacts, which are local-published to ~/.ivy2/local.

← Development
ScalablyTyped
Community
Project Chat
More
GitHubStar
Copyright © 2024 Øyvind Raddum Berg