Open SpeedySH opened 1 month ago
Thanks, let's make it more comfortable to use.
I can roughly tell what's going on, but I'd like to know the exact commands used for each point.
Relevant info that I can share:
- When trying to run the CLI, with --install enabled, it does not install dependencies, or even add them to package.json
- CLI detects what package manager you used to invoke it, so it depends. For example NPM creates a package.json when none is there, Yarn cannot.
- CLI skips the installation when no missing dependencies are found.
- If not explicitly specified in package.json or with --react option, it generates a client not for react (the hooks are just not there)
- When no options are defined, the default is to look for
react
in all dependencies, and if that's not found it skips the react part.- Same logic goes for
solid
.- I need to be able to disable dependency installation and customization in general. For example: I want to regenerate a client, and I have all the settings already specified in package.json (gqty block), gqty reads them, and still asks me to use CLI input! Why?
- The minimum required option to skip interactive mode is the GraphQL endpoint, I may need to read your config block and the command you used to know exactly why.
- watch just doesn't work. Let's start from the beginning:
- The error is most likely caused by a wildcard endpoint that resolves to NO files, I'll make a quick patch update when we confirm this one.
Thanks, let's make it more comfortable to use.
I can roughly tell what's going on, but I'd like to know the exact commands used for each point.
Relevant info that I can share:
- When trying to run the CLI, with --install enabled, it does not install dependencies, or even add them to package.json
- CLI detects what package manager you used to invoke it, so it depends. For example NPM creates a package.json when none is there, Yarn cannot.
- CLI skips the installation when no missing dependencies are found.
- If not explicitly specified in package.json or with --react option, it generates a client not for react (the hooks are just not there)
- When no options are defined, the default is to look for
react
in all dependencies, and if that's not found it skips the react part.- Same logic goes for
solid
.
- I need to be able to disable dependency installation and customization in general. For example: I want to regenerate a client, and I have all the settings already specified in package.json (gqty block), gqty reads them, and still asks me to use CLI input! Why?
- The minimum required option to skip interactive mode is the GraphQL endpoint, I may need to read your config block and the command you used to know exactly why.
- watch just doesn't work. Let's start from the beginning:
- The error is most likely caused by a wildcard endpoint that resolves to NO files, I'll make a quick patch update when we confirm this one.
Am I right that now, packages are only installed if you use npm? it won't work with bun or pnpm?
My package.json has information in react packages, but all ravon until I used the --react option it only generated basic (i.e. no hooks)
Command to start watch mode: bun gqty --watch
. I also tried npx @gqty/cli --watch
and bunx @gqty/cli --watch
"gqty": {
"introspection": {
"endpoint": "https://localhost:51835/graphql"
},
"react": true,
"javascriptOutput": false,
"subscriptions": false,
"destination": "./generated/index.ts",
"scalarTypes": {
"DateTime": "Date"
},
"enumStyle": "const"
}
@SpeedySH The CLI auto-detects NPM, Yarn and PNPM. Bun is possible, let me put that in the roadmaps.
The idea, as well as the client, is great. But there are some points that make me uncomfortable
TypeError: Reduce of empty array with no initial value at Array.reduce ()
at file:///E:/Projects/ONREZA/TEST_FRONTEND/node_modules/@gqty/cli/commands/default.mjs:2:4624
at async file:///E:/Projects/ONREZA/TEST_FRONTEND/node_modules/@gqty/cli/commands/default.mjs:2:4555