Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaneli/typescript4s
TypeScript compiler for Scala
https://github.com/zaneli/typescript4s
Last synced: 28 days ago
JSON representation
TypeScript compiler for Scala
- Host: GitHub
- URL: https://github.com/zaneli/typescript4s
- Owner: zaneli
- License: apache-2.0
- Created: 2014-05-17T03:22:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-06T01:50:27.000Z (about 9 years ago)
- Last Synced: 2023-03-31T03:57:28.119Z (almost 2 years ago)
- Language: JavaScript
- Size: 3 MB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# typescript4s
Scala library to compile [TypeScript](http://www.typescriptlang.org/)[![Build Status](https://api.travis-ci.org/zaneli/typescript4s.png?branch=master)](https://travis-ci.org/zaneli/typescript4s)
## Usage
### Compile
```
scala> import com.zaneli.typescript4s.TypeScriptCompiler
import com.zaneli.typescript4s.TypeScriptCompilerscala> val dest = TypeScriptCompiler(new java.io.File("example.ts")).compile()
dest: Seq[java.io.File] = List(example.js)scala> val dest = TypeScriptCompiler(new java.io.File("example.ts")).out(new java.io.File("dest.js")).compile()
dest: Seq[java.io.File] = List(dest.js)scala> val dest = TypeScriptCompiler(new java.io.File("example.ts")).declaration(true).sourcemap(true).compile()
dest: Seq[java.io.File] = List(example.js.map, example.js, example.d.ts)
```### Watch
equivalent of tsc --watch option
```
scala> import com.zaneli.typescript4s.TypeScriptCompiler
import com.zaneli.typescript4s.TypeScriptCompilerscala> val watcher = TypeScriptCompiler(new java.io.File("example.ts")).watch()
// compile example.ts and start watching file.scala> watcher.cancel
// stop watching file.
```## Credit
* typescript4s include typescriptServices.js, lib.d.ts and lib.es6.d.ts from TypeScript licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
* typescript4s consulted [typescript4j](https://github.com/martypitt/typescript4j)##Maven Repository
for Scala 2.10.x and Scala 2.11.x
###pom.xml
com.zaneli
Zaneli Repository
http://www.zaneli.com/repositories
com.zaneli
typescript4s_2.11
0.0.2
###build.sbt
resolvers += "Zaneli Repository" at "http://www.zaneli.com/repositories"libraryDependencies ++= {
Seq("com.zaneli" %% "typescript4s" % "0.0.2")
}