Skip to content

@clack/core@1.4.0

Choose a tag to compare

@bombshell-bot bombshell-bot released this 29 May 16:34
· 31 commits to main since this release
Immutable release. Only release title and notes can be modified.
030ba4d

Minor Changes

  • #543 83428ac Thanks @florian-lefebvre! - Adds support for Standard Schema validation

    Prompts accept an optional validate() function to validate user input. While a function provides more flexibility and customization over your validation, it can be a bit verbose. To help solve this, there are libraries that provide schema-based validation to make shorthand and type-strict validation substantially easier.

    Libraries following the Standard Schema specification are now natively supported. For example, using Arktype:

    import { text } from '@clack/prompts';
    import { type } from 'arktype';
    
    const name = await text({
    	message: 'Enter your email',
    +	validate: type('string.email').describe('Invalid email'),
    });

Patch Changes