Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type safety #6

Open
clo4 opened this issue Aug 21, 2022 · 2 comments
Open

Type safety #6

clo4 opened this issue Aug 21, 2022 · 2 comments
Labels
Milestone

Comments

@clo4
Copy link
Owner

clo4 commented Aug 21, 2022

You can use options.get("not an option") and TS won't tell you there's a mistake, because actions currently cannot know their options or args statically.

Blocked on parser generator. Can generate types too.

@clo4 clo4 added this to the 0.2 milestone Aug 24, 2022
@clo4
Copy link
Owner Author

clo4 commented Sep 9, 2022

Not blocked on parser generator. I think I'll do this with an API like:

const spec = Fig.infer({
  name: "...",
});

Fig.run(spec);

You can of course write it directly in Fig.run but that's a bit of an antipattern.

I'm thinking this will do something more specific than Fig.Spec etc. Instead it will use something like Fig.InferredSpec which has a shitload of generics on it that Fig.infer will infer for you. It has to be a function param atm, generics can't be inferred on an assignment :(

@clo4
Copy link
Owner Author

clo4 commented Feb 20, 2023

This is not possible, because of nesting subcommands. TS doesn't support this as a pattern

@clo4 clo4 added the blocked label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant