Giter Site home page Giter Site logo

jtsc's Introduction

JVM Wrapper for the TypeScript Compiler

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

Warning

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.

Why?

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.

How to use

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.

Using jtsc-maven-plugin in your 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 to pom.xml)
  • Compile your project.

Using the self-contained tsc equivalent executable

  • Build the executable:
	$ mvn -am -pl jtsc-executable package
  • Run it:
	$ java -jar jtsc-executable/target/jtsc-executable-*-jar-with-dependencies.jar --help

See also

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.

Credits

Based on work and discussion in TypeScript #8565

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.