How to use the foy.option function in foy

To help you get started, we’ve selected a few foy 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 hydux / hydux / Foyfile.ts View on Github external
`changelog --${ctx.options.version} -x chore`,
      `git add -A`,
      `git commit -m 'updated CHANGELOG.md'`,
    ])
  }
)

task(
  'build:all', [
    { name: 'build', async: true },
    { name: 'build:dist', async: true },
    { name: 'build:es', async: true },
  ],
)

option('-t, --type ', 'Semver versions, patch | major | minor')
task<{ type: 'patch' | 'major' | 'minor' }>('publish', async ctx => {
  await ctx.run('preversion', { options: { version: ctx.options.type } })
  await ctx.exec(`npm version ${ctx.options.type}`)
  await fs.rmrf('./lib/test')
  await fs.rmrf('./es/test')
  await Promise.all([
    ctx.exec(`git push origin master --tags`),
    ctx.exec(`npm --registry https://registry.npmjs.org/ publish`),
  ])
})

task('test', async ctx => {
  await ctx.exec(`${MochaCli} \"src/test/unit/*.test.ts\"`)
})

task('test:all', ['test'.async(), 'test:e2e'.async(), 'flow'.async()])

foy

A simple, light-weight and modern task runner for general purpose.

MIT
Latest version published 4 months ago

Package Health Score

65 / 100
Full package analysis