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

The help does not show on command line #196

Closed
FlorianCousin opened this issue Jan 9, 2024 · 3 comments · Fixed by #223
Closed

The help does not show on command line #196

FlorianCousin opened this issue Jan 9, 2024 · 3 comments · Fixed by #223
Labels
bug Something isn't working

Comments

@FlorianCousin
Copy link

FlorianCousin commented Jan 9, 2024

Bug description

The help of ts-to-zod is not accessible.

Input

On Windows 10, I use Cmder and run the following commands :

npm install ts-to-zod --save-dev
npx ts-to-zod --help

Expected output

The help of the command line.

Actual output

 »   Error: Parsing --help
 »      Command tstozod not found.
 »   See more help with --help

Versions

  • Typescript: v5.3.3
  • Zod: v3.22.4
  • ts-to-zod: v3.6.0
@FlorianCousin
Copy link
Author

The command npx ts-to-zod exists because whe I run npx ts-to-zod, I get the folowwing :

 »   Error: Missing 1 required arg:
 »   input file (typescript)
 »   See more help with --help

@tvillaren tvillaren added the bug Something isn't working label Mar 6, 2024
@tvillaren
Copy link
Collaborator

Hello @FlorianCousin,

I found a fix for this but cannot test it on Windows (see #222)
Would you mind testing on your side (if this issue is still relevant to you)? 🙏

@FlorianCousin
Copy link
Author

  • I cloned the GitHub repository
  • I ran npm install
  • I ran npm run build
  • I ran npx ts-to-zod --help

It seems to work because I got the following.

λ npx ts-to-zod --help
Generate Zod schemas from a Typescript file

USAGE
  $ ts-to-zod  --all
  $ ts-to-zod  --config example
  $ ts-to-zod  --config example/person
  $ ts-to-zod  --config config

ARGUMENTS
  INPUT   input file (typescript)
  OUTPUT  output file (zod schemas)

FLAGS
  -a, --all                    Execute all configs
  -c, --config=<option>        Execute one config
                               <options: example|example/person|config>
  -h, --help                   Show CLI help.
  -i, --init                   Create a ts-to-zod.config.js file
  -k, --keepComments           Keep parameters comments
  -v, --version                Show CLI version.
  -w, --watch                  Watch input file(s) for changes and re-run related task
      --inferredTypes=<value>  Path of z.infer<> types file
      --skipParseJSDoc         Skip the creation of zod validators from JSDoc annotations
      --skipValidation         Skip the validation step (not recommended)

DESCRIPTION
  Generate Zod schemas from a Typescript file

EXAMPLES
  $ ts-to-zod src/types.ts src/types.zod.ts

Though, I could not test with ts-to-zod as a dependency of another project because #222 is not released, but I guess it works the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants