-
-
Notifications
You must be signed in to change notification settings - Fork 376
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
pnpm catalog fails to parse version in package.json #1965
Comments
duplicate #1931 |
I used version 7.6.0, but the issue persists. The catalog is used in multiple dependencies. 🛑 petstore - Oups... 🍻. An Error occurred while writing file => Error: Invalid argument not valid semver ('catalog:' received) |
@shotanue can you confirm? |
7.6.0 seems to have fixed the issue I reported in #1931. Here's my orval.config.ts that I'm using: import { defineConfig } from "orval";
export default defineConfig({
xxxxx: {
input: "xxxxx/openapi.yaml",
output: {
mode: "split",
client: "react-query",
target: "xxxxxx",
override: {
query: {
useSuspenseQuery: true,
+ version: 5,
},
mutator: {
path: "./src/custom-instance.ts",
name: "customInstance",
},
},
},
},
}); When using pnpm catalogs, it appears that specifying |
I tried that workaround, but when there are other dependencies managed by the catalog, a slightly different error occurs. In #1931, it was not an error related to file writing. The issue is resolved and works fine by applying a patch that resolves the catalog version mentioned in the first comment.
|
@shotanue any thoughts? |
I apologize for not reading the issue body thoroughly. I did not come up with alternative workarounds. As an Orval user, it would be better if Orval supported pnpm catalogs due to the current limitations that sometimes require workarounds, which don't always work reliably. The proposal to support pnpm catalogs with sanitizing package.json is a good idea 👍 If it supported https://pnpm.io/catalogs#named-catalogs, it would make for an even better implementation. The proposed solution could be applicable beyond react-query, eliminating the need for workarounds, which would be a great improvement for Orval. |
Reopened. I know nothing about PNPM and catalog so this will most likely require a PR from a user... |
Puting |
When using Orval with the
catalog
feature of pnpm workspace, an error occurs because it cannot parse the version inpackage.json
.I tried to modify the code so that it parses the
pnpm-workspace.yaml
, extracts the catalog version, and maps it topackage.json
as follows. What do you think? There might be adjustments needed, like handling cases where aname
is not found in the catalog and retaining the original'catalog:'
. If everything looks good, I can create a pull request.The text was updated successfully, but these errors were encountered: