PolymerLabs/tsc-then

Name: tsc-then

Owner: PolymerLabs

Description: Like `tsc -w` but it runs a command of your choosing when compilation finishes

Created: 2017-12-11 18:38:26.0

Updated: 2017-12-20 13:51:56.0

Pushed: 2018-01-05 06:35:08.0

Homepage: null

Size: 9

Language: TypeScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

tsc-then

tsc -w will watch the filesystem and recompile your code almost instantly. Wouldn't you like to be able to run a command after it's done compiling? Like run your tests?

tsc-then is a super simple command that will run tsc -w and run a specified command after tsc -w is finished. It's ok if your command takes much longer than compiling, it will wait until the last run of your command is finished before starting the next one.

Because I'm generally editing with a smart editor that gives me inline errors, I left typescript's error reporting out of the console output, but this may change or become an option in a future version.

Example Usage
tsc-then -- npx mocha

This runs typescript's tsc -w, and each time compilation finishes, it runs the command npx mocha. It passes the stdout and stderr of npx mocha through, as well as some lines to delineate one run of the command from the next.

Multiple projects

Pass in -p to specify a project directory or config file, the same as the -p argument to tsc. Pass it in multiple times, and tsc-then will run multiple tsc -w processes, one for each project, and it will first wait for all of them to compile, run your script, then it will run your script after any of them changes.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.