Open vladdcom opened 9 months ago
Hello @vladdcom,
Do you mean that it would just ignore this prompt:
? You have multiple configs available in "ts-to-zod.config.js"
What do you want? (Use arrow keys)
❯ Execute all configs (--all)
Execute "example" config (--config=example)
Execute "example/person" config (--config=example/person)
Execute "config" config (--config=config)
Don't use the config
and be the equivalent of selecting the last option?
yeah, exactly the equivalent of selecting the last option
In that case, you must add arguments to CLI call, right?
At least an input
argument (and ideally an output
otherwise your input
will be overwritten).
Maybe we should skip the config step altogether when an input
is passed.
per repo
yarn ts-to-zod --all -> use the ts-to-zod config yarn ts-to-zod --noneConfig src/iDontTrustThisApi.ts src/nowIcanValidateEverything.ts -> ignore the config, use inline params
"Don't use the config" in the prompt is working the same way
In terms of developer experience, I'm wondering if we actually need the --noConfig
flag.
Why not skip config when calling
yarn ts-to-zod src/iDontTrustThisApi.ts src/nowIcanValidateEverything.ts
?
My point being that all the information needed to perform the action is in the command. I think your request is very valid, but I feel that adding a new flag is not the best DevExp. What do you think?
I have ts-to-zod config in my repo and if I run this command
yarn ts-to-zod src/iDontTrustThisApi.ts src/nowIcanValidateEverything.ts
I'm gonna get into a interactive mode of the prompt. But I want to disable config by one command
I'm gonna get into a interactive mode of the prompt. But I want to disable config by one command
Yes, I think I understand that.
My point is that might be better to disable config if the command actually passes input
and output
arguments: no need to add a flag for that, it would be the logical behaviour to execute the generation directly.
got it, the idea is good
@tvillaren sounds good. If we implement this, so it would be breaking. Let's collect breaking changes such as this and the exit code 1 upon failure so we can combine those in a v4 release.
Yep, had the same thought 😄 I don't have any permission on this repository, but I would be glad to help tag some features to track what could be added in a V4
How can I tell the CLI to use the config file? It seems it needs me to duplicate the input-output files in the CLI.
@aminya: if you have a ts-to-zod.config.js
at the root of your project, the CLI should use it directly.
@tvillaren I tried that in a mono-repo, but it did not work. Could you add more documentation on this? Also, the CLI doesn't have any indication of this happening despite using --verbose
, or I could not find a --config
settings for specifying the path.
Feature description
In cli prompt the program has option "Don't use the config" but i cannot use it through inline command
ts-to-zod --none
orts-to-zod --config=none
doesnt workInput
Output
ts-to-zod ignore ts-to-zod config and use passed inline data