Comparing version 1.0.29 to 1.0.30
# @gilamran/tsc-watch CHANGELOG | ||
## v1.0.30 - 10/10/2018 | ||
* Added custom compiler ability (Thanks to @sosoba for the PR) | ||
## v1.0.29 - 25/09/2018 | ||
@@ -4,0 +7,0 @@ * Fixed regression bug (Thanks to @onehorsetown) |
setInterval(() => console.log(Math.random()), 1000); |
@@ -57,2 +57,3 @@ #!/usr/bin/env node | ||
.filter(arg => arg.toLowerCase() !== '--watch') | ||
.filter(arg => arg.toLowerCase() !== '--compiler') | ||
.filter(arg => arg.toLowerCase() !== '--nocolors') | ||
@@ -127,6 +128,20 @@ .filter(arg => arg.toLowerCase() !== '--onsuccess') | ||
const noColors = getCommandIdx(process.argv, '--noColors') > -1; | ||
let compiler = getCustomeCommand('--compiler'); | ||
if( ! compiler ){ | ||
compiler = 'typescript/bin/tsc'; | ||
} | ||
const args = processArgs(process.argv); | ||
const bin = require.resolve('typescript/bin/tsc'); | ||
let bin; | ||
try{ | ||
bin = require.resolve( compiler ); | ||
}catch(e){ | ||
if(e.code === 'MODULE_NOT_FOUND' ){ | ||
console.error( e.message ); | ||
process.exit(9); | ||
} | ||
throw e; | ||
} | ||
const tscProcess = spawn(bin, [...args]); | ||
@@ -133,0 +148,0 @@ |
{ | ||
"name": "tsc-watch", | ||
"version": "1.0.29", | ||
"version": "1.0.30", | ||
"description": "The TypeScript compiler with onSuccess command", | ||
@@ -5,0 +5,0 @@ "scripts": { |
# The TypeScript compiler with `--watch` and a new onSuccess argument | ||
`tsc-watch` starts the `tsc` (TypeScript compiler) with `--watch` parameter, there are 3 new arguments. | ||
`tsc-watch` starts a TypeScript compiler with `--watch` parameter, there are 5 new arguments. | ||
@@ -8,2 +8,3 @@ - `--onSuccess COMMAND` - The `COMMAND` will be executed on every successful TypeScript compilation. | ||
- `--noColors` - `tsc-watch` colors the output with green on success, and in red on failiure. Add this argument to prevent that. | ||
- `--compiler PATH` - The `PATH` will be used instead of typescript compiler. Defaults typescript/bin/tsc. | ||
@@ -21,3 +22,3 @@ ## Install | ||
```sh | ||
tsc-watch server.ts --outDir ./dist --onSuccess "node ./dist/server.js" --onFailure "echo Beep! Compilation Failed" | ||
tsc-watch server.ts --outDir ./dist --onSuccess "node ./dist/server.js" --onFailure "echo Beep! Compilation Failed" --compiler typescript/bin/tsc | ||
``` | ||
@@ -24,0 +25,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18045
373
68
3