How to use the ink.render function in ink

To help you get started, we’ve selected a few ink 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 kamranahmedse / git-pending / index.js View on Github external
'author': { type: 'string', alias: 'a' },
    'strict': { type: 'boolean', alias: 's', default: false },
    'debug': { type: 'boolean', alias: 'd', default: false },
  },
});

cli.flags = cli.flags || {};
cli.flags.path = process.cwd();

// Check if the given path is valid git repository
if (!fs.existsSync(path.join(cli.flags.path, '/.git'))) {
  console.log('The command must be run inside a git repository');
  process.exit(1);
}

render(React.createElement(ui, cli.flags));
github prisma / lift / src / utils / ensureDatabaseExists.tsx View on Github external
return new Promise(resolve => {
    let app: Instance | undefined

    const onDone = () => {
      if (app) {
        app.unmount()
        app.waitUntilExit()
      }
      // .write as console.log introduces an unwanted linebreak here
      process.stdout.write(ansiEscapes.eraseLines(11)) // height of the dialog
      resolve()
    }

    app = render(
      
        
          
        
      ,
    )
  })
}
github sindresorhus / emoj / cli.js View on Github external
};

	let unmount; // eslint-disable-line prefer-const

	const onError = () => {
		unmount();
		process.exit(1);
	};

	const onExit = () => {
		unmount();
		process.exit();
	};

	// Uses `h` instead of JSX to avoid transpiling this file
	unmount = render(h(ui, {skinNumber, onSelectEmoji, onError, onExit}));
};
github maticzav / emma-cli / src / index.js View on Github external
let unmount // eslint-disable-line prefer-const

   const onError = () => {
      unmount()
      process.exit(1)
   }

   const onExit = () => {
      unmount()
      process.exit()
   }

   const { dev } = cli.flags

   // Uses `h` instead of JSX to avoid transpiling this file
   unmount = render(h(emma, { dev, onError, onExit }))
}
github prisma / lift / src / utils / handlePanic.tsx View on Github external
return new Promise(resolve => {
    let app: Instance | undefined

    const onDone = async () => {
      if (app) {
        app.unmount()
        app.waitUntilExit()
      }
      await exit()
    }

    app = render(
      
        
      ,
    )
  })
}
github maticzav / emma-cli / packages / create-emma / src / bin.tsx View on Github external
description: starter.description || '',
        repo: repo,
      },
      dist,
    )

    if (loadStatus.status === 'err') {
      spinner.fail()
      console.error(loadStatus.message)
    } else {
      spinner.succeed()
      console.log(loadStatus.message)
    }
  }

  app = render(, {
    exitOnCtrlC: true,
  })
}
github prisma / lift / src / ink / DevComponentRenderer.tsx View on Github external
public render() {
    if (!this.app) {
      return render()
    }
    this.app.rerender()

    return this.app
  }
}
github shakeabi / livcricket / cli.js View on Github external
1.0.0
		
	Note:
	-> Checkout the settings.json to look into more features of the app.
	-> You need to have notify-send to enable notifications, try 'notify-send "Hey Sexy!"' to check if you've notify-send.
	-> The refreshtime must be given in seconds.
	-> Maxcharacters can be modified if you've smaller or bigger terminals. It'll be reflected in the score display.
	-> Drop a star if you find this project useful (https://github.com/shakeabi/livcricket)
	
	Other:
	-> Made with lots of love by Abishake (https://github.com/shakeabi)
	-> Thanks to AdarshPatel (https://github.com/adarshPatel509)

`);

render(React.createElement(ui, cli.flags));
github sw-yx / egghead-cli-workshop / references / myfirstcli / src / commands / jest.tsx View on Github external
async run() {
    const { flags } = this.parse(JestCommand);
    const app = render();
  }
}
github parcel-bundler / parcel / packages / reporters / cli / src / SimpleCLIReporter.js View on Github external
}

      let message = getProgressMessage(event);
      if (message != null) {
        writeOut(message);
      }
      break;
    }
    case 'buildSuccess':
      if (logLevelFilter < logLevels.info) {
        break;
      }

      writeOut(`Built in ${prettifyTime(event.buildTime)}`);
      if (options.mode === 'production') {
        render();
      }
      break;
    case 'buildFailure':
      if (logLevelFilter < logLevels.error) {
        break;
      }

      writeErr(event.error, options.logLevel);
      break;
    case 'log': {
      switch (event.level) {
        case 'warn':
        case 'error':
          if (logLevelFilter >= logLevels[event.level]) {
            writeErr(event.message, options.logLevel);
          }

ink

React for CLI

MIT
Latest version published 8 months ago

Package Health Score

85 / 100
Full package analysis