Open RIP21 opened 3 years ago
Never used CLI with this package manager. There will be couple places where CLI (and depending packages) will fail. We do not test with anything else than npm or yarn
You shall start testing with it as it is pretty popular :P
PNPM is major for all people that are using rush.js monorepo management tool. To name a few Microsoft, Revolut and many more.
PNPM is just amazing and IMO how npm
should've been working from the day 1 :)
Anyway, mostly 99% of packages are working as is with PNPM, only CLIs are getting broken usually due to bin
behavior (which is makes sense as it doesn't leak CLIs (bins) from transitive dependencies)
Just tried installing graphql-cli
using PNPM (since that's what I use) and I got the same error:
Overall GraphQL CLI + Codegen + Inspector add-ons are seem to be very fragile. I cannot specify, but on multiple occasions using those tools through the CLI wrapper, I end up getting issues, so currently I'm using those tools CLIs directly as, fortunately they're working as expected. And it's with regular npm. I'm not mentioning PNPM that is special.
I would rather keep init and few other commands unique to CLI in it, but rest would've removed for good to simplify maintenance.
As because I think you folks at Guild are having so much products to maintain I see their quality is worsened overtime and is not as perfect as it used to be and in integration they're not working quite often which is annoying.
Basically, I'm using
graphql-cli
in a PNPM Workspaces environment, and if fails with the error below for any other CLI Tool integration such ascodegen
,coverage
andvaldiate
. Usingcodegen
as standalone CLI works fine no matter their setup.PNPM resolves modules in a different way than
yarn
andnpm
I assume you may expect flattening and havinggraphql-codegen
to be available innode_modules/.bin
and just spawning the process like./bin/graphql-codegen <some-args>
relative to cwd, but it's not there due to PNPM resolution strategy so it fails. The obvious solution would be, to use the programmatic usage of CLIs tools mentioned above and not spawning the processes? Probably too much coding :) I'm unsure :) From code I see that there are maybe some issues with the generator of sh file./node_modules/./bin/graphql
that handles symlinks improperly?To Reproduce Steps to reproduce the behavior:
Expected behavior Everything is working fine. Or at least meaningful error message is there :)
Screenshots
Versions (please complete the following information):
graphql-cli
:4.1.0
Generated
graphql
bin filecase
uname
in CYGWIN) basedir=cygpath -w "$basedir"
;; esacexport NODE_PATH="/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules/graphql-cli/dist/bin.js/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules/graphql-cli/dist/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules/graphql-cli/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules/.pnpm/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/temp/node_modules:/home/alos/Projects/LiveFlow/app-frontend/common/node_modules:/home/alos/Projects/LiveFlow/app-frontend/node_modules:/home/alos/Projects/LiveFlow/node_modules:/home/alos/Projects/node_modules:/home/alos/node_modules:/home/node_modules:/node_modules:/home/alos/Projects/LiveFlow/app-frontend/ui/app/node_modules:/home/alos/Projects/LiveFlow/app-frontend/ui/node_modules" if [ -x "$basedir/node" ]; then exec "$basedir/node" "$basedir/../../../../common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules/graphql-cli/dist/bin.js" "$@" else exec node "$basedir/../../../../common/temp/node_modules/.pnpm/graphql-cli@4.1.0_graphql@15.4.0/node_modules/graphql-cli/dist/bin.js" "$@" fi