8000 Releases · scala-tsi/scala-tsi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: scala-tsi/scala-tsi

0.4.0

11 Sep 16:57
Compare
Choose a tag to compare
  • Generate typescript based on TSType, not just TSNamedType (#98)
  • Rename typescriptClassesToGenerateFor sbt setting to typescriptExports

minor changes:

  • Rename TypescriptGenPlugin sbt plugin to ScalaTsiPlugin
  • Upgrade scala-collection-compat from 2.1.6 to 2.2.0

0.3.2 - Enumerations

28 Aug 14:50
Compare
Choose a tag to compare
  • 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

21 Aug 22:22
a70c6a4
Compare
Choose a tag to compare

Fixes the compiler crashing on circular references with this plugin (#67)

0.3.0 - Package changed to com.scalatsi

13 Jun 20:53
Compare
Choose a tag to compare

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

29 May 20:10
Compare
Choose a tag to compare

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

22 May 21:26
Compare
Choose a tag to compare

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

04 May 15:25
Compare
Choose a tag to compare

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 or sealed 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

  • Add experimental semicolon support with typescriptStyleSemicolons sbt setting (#62)
  • TSExternalName was renamed to TSTypeReference (#43)
  • Types are now always outputted in alphabetical order
  • Output now has constined and no superflous whitespace

0.1.3 - Built-ins

08 Jun 13:21
Compare
Choose a tag to compare
  • Add export to all typescript definitions for easier importing from other files (#31, Fixes #28)
  • Add TSObject for the Typescript object type (#25)
  • Map scala.Any to Typescript any
  • Map scala.AnyRef and java.lang.Object to object (#25)
  • Map java.time.* and java.util.Date to string
    changeable by overriding val java8TimeTSType from JavaTSTypes 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

08 Jun 10:25
8f37a8c
Compare
Choose a tag to compare

Fixes exception when using the plugin in SBT 1.1+ (#23)

0.1.1

16 Mar 14:49
Compare
Choose a tag to compare

scala-tsi artifact now contains all dependencies, does not depend on a macro project any more

0