This project is
- a wrapper to allow
tsc
to run on the JVM, plus - a Maven plugin to compile TypeScript as part of a build
This project is currently in a proof-of-concept stage and is not suitable for use by end users.
In particular, readDirectory is not implemented yet, so tsc.js will only be able to locate explicitly named files.
There are a variety of reasons that a development team can't require Node.js and NPM for their build process, including company policy, regulatory and audit compliance, and inertia. While individual developers may be able to work around these roadblocks, a requirement to install new software on the build server is more likely to remain a problem.
First, build and install the plugin into your local repository:
$ mvn -am -pl jtsc-maven-plugin install
See the demo-project
project for a minimal but complete project.
- Configure the plugin in your project:
<plugin>
<groupId>ca.eqv.jtsc</groupId>
<artifactId>jtsc-maven-plugin</artifactId>
<version>0.1.0.BUILD-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
- Place a
tsconfig.json
in your project root (next topom.xml
) - Compile your project.
- Build the executable:
$ mvn -am -pl jtsc-executable package
- Run it:
$ java -jar jtsc-executable/target/jtsc-executable-*-jar-with-dependencies.jar --help
If installing/executing Node.js is a possibility, consider other plugins such as frontend-maven-plugin and grunt-maven-plugin.
This project is intended to replace tsc-maven-plugin which is only capable of running tsc versions older than 1.5.
Based on work and discussion in TypeScript #8565