lukeed / sade

Smooth (CLI) Operator 🎶

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Typescript errors after upgrade

selfagency opened this issue · comments

After upgrading to the latest version of Sade, I'm getting the following type error on my actions:

Argument of type '(service: string, opts: Options) => Promise<void>' is not assignable to parameter of type 
'Handler<[service: string]>'.\n  Types of parameters 'opts' and 'args_1' are incompatible.\n    
Type 'Argv<Default>' has no properties in common with type 'Options'.

I can make it looser in a patch tomorrow, but there isn’t meant to be any continuation from the previous types because there were no previous types included in sade directly. The strictness is/was a feature

So, in practical terms, does that mean that I'm supposed to leave opts as any?

It was meant to be something like .action<[string]>((value, options) => { ... }) where options was automatically typed with mri.Argv.Default, but that didn't allow you to add more explicit types for options which is/was problematic.

Publishing a patch now. Sorry for the trouble!

No worries, thanks for your work on it!