7nohe / openapi-react-query-codegen

OpenAPI React Query Codegen is a code generator for creating React Query (also known as TanStack Query) hooks based on your OpenAPI schema.
https://openapi-react-query-codegen.vercel.app
MIT License
302 stars 31 forks source link

fix: add `ts-morph` to dependencies #170

Closed poteboy closed 1 week ago

poteboy commented 1 week ago

During CLI execution of openapi-react-query-codegen, the library uses ts-morph as part of its internal process (as you can see here). However, ts-morph was not included as a dependency, which could lead to runtime issues when executing the CLI.

Alternatively, if adding ts-morph as a dependency feels burdensome, it may be helpful to include installation instructions for ts-morph in the documentation.

vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
openapi-react-query-codegen ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 8:33am
seriouslag commented 1 week ago

It is listed as a peerDependancy. I believe all modern package managers pull the peer dependencies if not specified in the projects package.json.

If this is not the case could you provide an example.

poteboy commented 1 week ago

@seriouslag Actually, not all modern package managers auto-install peer dependencies. Only npm v7+, pnpm v8+ and Bun v1.x do this by default. Package managers like npm ~v6, pnpm ~v8, and Yarn (at least v1) won’t install peer dependencies automatically—you’d need to set auto-install-peers=true or use an option like install-peers. Therefore, as mentioned in the PR description, adding installation instructions for ts-morph in the documentation could help avoid runtime issues.

Refs:

seriouslag commented 1 week ago

@seriouslag Actually, not all modern package managers auto-install peer dependencies. Only npm v7+, pnpm v8+ and Bun v1.x do this by default. Package managers like npm ~v6, pnpm ~v8, and Yarn (at least v1) won’t install peer dependencies automatically—you’d need to set auto-install-peers=true or use an option like install-peers. Therefore, as mentioned in the PR description, adding installation instructions for ts-morph in the documentation could help avoid runtime issues.

Refs:

I believe you listed a bunch of unmaintained package managers 🤷‍♂️

Is the only reason for this change to support these older package manager versions?

poteboy commented 1 week ago

@seriouslag pnpm v8 is still documented on their site, and v9 was only released 7 months ago. If that timeframe doesn't qualify as "modern," then it seems our definitions of "modern" differ. That said, the claim that "pnpm v8 doesn't have docs on their site" is simply not accurate. The emoji 🤷‍♂️ suggests this may not be a constructive discussion, so I’ll leave it at that. No hard feelings