Convert TypeScript types to Swift/Kotlin types
type-transform <SRC> --out <OUT>
Arguments:
<SRC> Input file name
Options:
--out <OUT> The output file. Target language is inferred from file extension
--banner <BANNER> A banner to be added to the generated file, this can be a package path for "kotlin", a custom auto code generated message or a comment block such as a license for the code
--footer <FOOTER> A footer to be added to the generated file, this can be something like a comment block for a license or just a fun easter egg
-h, --help Print help
-V, --version Print version
Example:
type-transform hello-world.ts --out hello-world.swift
Example Usage of a Banner:
#!/usr/bin/env bash
set -e
DATE=$(date +%Y-%m-%dT%H:%M:%S%z)
type-transform ts-files/hello-world.ts --out gen/hello-world.kt --banner "// Hello World\n// This code was auto generated at ${DATE} \npackage com.github.goldenratio\n"
- Swift (.swift)
- Kotlin (.kt)
cargo build --release
Checkout releases for binaries, https://github.com/goldenratio/type-transform/releases
https://www.npmjs.com/package/@goldenratio/type-transform
cargo release <VERSION LEVEL> --execute --no-publish
Where <VERSION LEVEL>
is one of major
, minor
, or patch
Next you need to manually make the release in github from the tag. This will kick off the build process to build all the releases assets and store them on the release in github.