How to use tsc-watch - 7 common examples

To help you get started, we’ve selected a few tsc-watch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eManPrague / redmine_tracker / config / server.js View on Github external
const server = app.listen(PORT, 'localhost', serverError => {
  if (serverError) {
    return console.error(serverError);
  }

  if (argv['start-hot']) {
    tscWatch.on('first_success', () => {
      console.log('typescript watcher ready, start electron...');
      electronProcess = createHotElectronProcess();
    });

    tscWatch.on('subsequent_success', () => {
      console.log('restarting electron...');
      treeKill(electronProcess.pid, 'SIGKILL', createHotElectronProcess);
    });

    tscWatch.on('compile_errors', () => {
      console.log('compile main error!!!!!!!!!');
    });

    tscWatch.start('-p', 'app');
  }
github eManPrague / redmine_tracker / config / server.js View on Github external
if (serverError) {
    return console.error(serverError);
  }

  if (argv['start-hot']) {
    tscWatch.on('first_success', () => {
      console.log('typescript watcher ready, start electron...');
      electronProcess = createHotElectronProcess();
    });

    tscWatch.on('subsequent_success', () => {
      console.log('restarting electron...');
      treeKill(electronProcess.pid, 'SIGKILL', createHotElectronProcess);
    });

    tscWatch.on('compile_errors', () => {
      console.log('compile main error!!!!!!!!!');
    });

    tscWatch.start('-p', 'app');
  }

  console.log(`Listening at http://localhost:${PORT}`);
});
github eManPrague / redmine_tracker / config / server.js View on Github external
const server = app.listen(PORT, 'localhost', serverError => {
  if (serverError) {
    return console.error(serverError);
  }

  if (argv['start-hot']) {
    tscWatch.on('first_success', () => {
      console.log('typescript watcher ready, start electron...');
      electronProcess = createHotElectronProcess();
    });

    tscWatch.on('subsequent_success', () => {
      console.log('restarting electron...');
      treeKill(electronProcess.pid, 'SIGKILL', createHotElectronProcess);
    });

    tscWatch.on('compile_errors', () => {
      console.log('compile main error!!!!!!!!!');
    });

    tscWatch.start('-p', 'app');
  }

  console.log(`Listening at http://localhost:${PORT}`);
});
github eManPrague / redmine_tracker / config / server.js View on Github external
if (argv['start-hot']) {
    tscWatch.on('first_success', () => {
      console.log('typescript watcher ready, start electron...');
      electronProcess = createHotElectronProcess();
    });

    tscWatch.on('subsequent_success', () => {
      console.log('restarting electron...');
      treeKill(electronProcess.pid, 'SIGKILL', createHotElectronProcess);
    });

    tscWatch.on('compile_errors', () => {
      console.log('compile main error!!!!!!!!!');
    });

    tscWatch.start('-p', 'app');
  }

  console.log(`Listening at http://localhost:${PORT}`);
});
github hmmhmmhm / dva-engine / bin / core / transform / watch.ts View on Github external
tscProcess.stdout.on('data', buffer => {

    const lines = manipulate(buffer)
    print(false, false, lines)

    let isInit = lines.some(line => line.indexOf('Starting compilation in watch mode') != -1)
    if(isInit){
        Logger.debug(`D.VA ENGINE v${packageData.version}`)
        Logger.debug(`Please hold while first transpile.. Processing...`)
        Logger.debug(`(First transpile can take a few seconds or minutes...)`)
    }

    const state = detectState(lines)
    const compilationError = state.compilationError
    const compilationComplete = state.compilationComplete

    if (compilationComplete) {
        killProcesses(false).then(() => {
            if (compilationError) {
                Logger.debug(`Failed initialization sequence.`)
                Signal.emitFail()
            } else {
                Signal.emitSuccess()

                if (firstTime) {
                    firstTime = false
                    loadUserScript()

                } else {
github hmmhmmhm / dva-engine / bin / core / transform / watch.ts View on Github external
tscProcess.stdout.on('data', buffer => {

    const lines = manipulate(buffer)
    print(false, false, lines)

    let isInit = lines.some(line => line.indexOf('Starting compilation in watch mode') != -1)
    if(isInit){
        Logger.debug(`D.VA ENGINE v${packageData.version}`)
        Logger.debug(`Please hold while first transpile.. Processing...`)
        Logger.debug(`(First transpile can take a few seconds or minutes...)`)
    }

    const state = detectState(lines)
    const compilationError = state.compilationError
    const compilationComplete = state.compilationComplete

    if (compilationComplete) {
        killProcesses(false).then(() => {
            if (compilationError) {
github hmmhmmhm / dva-engine / bin / core / transform / watch.ts View on Github external
tscProcess.stdout.on('data', buffer => {

    const lines = manipulate(buffer)
    print(false, false, lines)

    let isInit = lines.some(line => line.indexOf('Starting compilation in watch mode') != -1)
    if(isInit){
        Logger.debug(`D.VA ENGINE v${packageData.version}`)
        Logger.debug(`Please hold while first transpile.. Processing...`)
        Logger.debug(`(First transpile can take a few seconds or minutes...)`)
    }

    const state = detectState(lines)
    const compilationError = state.compilationError
    const compilationComplete = state.compilationComplete

    if (compilationComplete) {
        killProcesses(false).then(() => {
            if (compilationError) {
                Logger.debug(`Failed initialization sequence.`)