How to use the @flood/element-api.EvaluatedScript.mustCompileFile function in @flood/element-api

To help you get started, we’ve selected a few @flood/element-api 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 flood-io / element / packages / cli / src / cmd / plan.ts View on Github external
const main = async (args: Arguments) => {
	const { EvaluatedScript, nullRuntimeEnvironment } = require('@flood/element-api')
	const script = await EvaluatedScript.mustCompileFile(args.file, nullRuntimeEnvironment)

	if (args.json) return printJSON(script)

	const { settings, steps } = script

	console.log(
		boxen(
			chalk`test script
{blue ${settings.name || ''}}
{blue ${settings.description || ''}}`,
			{ padding: 1, margin: 1, align: 'center' },
		),
	)

	console.log(chalk`{blue Settings}:`)
	console.log(inspect(settings, { colors: true }))