UNPKG

inngest-setup-redwoodjs

Version:

Setup Inngest in RedwoodJS

36 lines (35 loc) 1.27 kB
export const command = 'inngest-setup-redwoodjs function'; export const description = 'Set up an Inngest function'; export const builder = (yargs) => { return yargs .scriptName('inngest-setup-redwoodjs') .positional('name', { type: 'string', description: 'Name of the function to setup' }) .option('eventName', { aliases: ['e', 'event', 'eventName'], default: undefined, description: 'Name of the event to trigger the function. Defaults to the function name.', type: 'string', }) .option('graphql', { aliases: ['g', 'graphql', 'gql'], default: false, description: 'Build event name from your web side GraphQL operations', type: 'boolean', }) .option('type', { alias: 't', type: 'string', choices: ['background', 'scheduled', 'delayed', 'step'], description: 'Type of Inngest function to setup', }) .option('force', { alias: 'f', default: false, description: 'Overwrite existing files', type: 'boolean', }); }; export const handler = async (options) => { const { handler } = await import('./handler'); return handler({ ...options, operationType: undefined }); };