Releases: scala-tsi/scala-tsi
0.4.0
0.3.2 - Enumerations
- Support Scala and Java enumerations out of the box (#75)
Scala:
object SomeEnum extends Enumeration {
type SomeEnum = Value
val OPTION1, OPTION2, OPTION3, OPTION4 = Value
}
or Java:
public enum SomeEnum {
OPTION1,
OPTION2,
OPTION3,
OPTION4
}
will become:
export type SomeEnum = ("OPTION1" | "OPTION2" | "OPTION3" | "OPTION4")
- Fix bug where no error was given when no typescript mapping is available for a non-
abstract
sealed class
(#80)
0.3.1
0.3.0 - Package changed to com.scalatsi
Change package from nl.codestar.scalatsi
to com.scalatsi
Libraries will be published under both organizations on maven central for backwards-compatibility initially.
0.2.2 - DSL & Output
Add ability to rename generated types
Output will now be generated even if parent directories do not exists yet and improve error messages
Fixed unused import warning when generating model
0.2.1 - Literal types
Add support for Literal types under Scala 2.13
Example:
case class DeepThought(
query: "The Answer to Life, the Universe and Everything",
answer: 42,
question: None.type
)
will output:
export interface IDeepThought {
query: "The Answer to Life, the Universe and Everything"
answer: 42
question: null
}
0.2.0 - Full auto
The most useful feature of this release is that in most cases you do not need implicits anymore, the plugin will use the standard generation by default!
Scala 2.13 support
Library now requires Scala 2.12 or 2.13, and the SBT plugin requires SBT 1.3
Case classes and sealed trait are now automatically generated
In most cases simply adding the SBT plugin is now enough to generate typescript interfaces for your types.
Implicits are now only necessary:
- When you want to adjust the standard generation behavior, see the README for examples or
- the type is not a
case class
,sealed trait
orsealed abstract class
and - the type is not one of the Scala or Java library types the plugin already knows
Sealed traits are now converted into a Typescript Discriminated Union
Example:
sealed trait AorB
case class A(foo: Int) extends AorB
case class B(bar: Int) extends AorB
will produce by default:
export type AorB = IA | IB
export interface IA {
foo: number
}
export interface IB {
bar: number
}
See #43 for more details
Other changes
0.1.3 - Built-ins
- Add
export
to all typescript definitions for easier importing from other files (#31, Fixes #28) - Add
TSObject
for the Typescriptobject
type (#25) - Map
scala.Any
to Typescriptany
- Map
scala.AnyRef
andjava.lang.Object
toobject
(#25) - Map
java.time.*
andjava.util.Date
tostring
changeable by overridingval java8TimeTSType
fromJavaTSTypes
orDefaultTSTypes
(#26) - Map java numeric types to
Number
(#26) - Fix collection types not automatically being converted to an array of the collection element (#27)
0.1.2
0.1.1
scala-tsi
artifact now contains all dependencies, does not depend on a macro project any more