Closed github-actions[bot] closed 3 months ago
@vicary can we merge this or is there anything else that should be tested/checked?
@lubosmato If you think the current main works as intended, we are good to go.
I tested these cases.
yarn gqty --react --no-subscriptions --target=./generated/gqty.ts --typescript --no-install --watch ../api/*.graphql
yarn gqty --react --no-subscriptions --target=./generated/gqty.ts --typescript --no-install --watch "../api/*.graphql"
yarn gqty --react --no-subscriptions --target=./generated/gqty.ts --typescript --no-install --watch schema.graphql
yarn gqty --react --no-subscriptions --target=./generated/gqty.ts --typescript --no-install --watch ../api/**/*.graphql
yarn gqty --react --no-subscriptions --target=./generated/gqty.ts --typescript --no-install --watch "../api/**/*.graphql"
Let me know if it is worth to focus on the Glob pattern with quotes or we can merge.
@lubosmato Thanks for the extensive testing.
To qualify as a patch upgrade, we should try to retain previous behaviours. Fortunately CLI already has fast-glob
so we don't have to introduce another new dependency.
I made some changes to main, see if 6bbdce83 checks everything on your list?
@vicary Thank you for taking care of the glob pattern.
Tested again and found that glob pattern does not pick up some changes.
CWD: apps/web/
Pattern is "../api/**/*.graphql"
Folder structure:
.
└── apps/
├── api/
│ ├── sub/
│ │ └── schema.graphql
│ └── schema.graphql
└── web (cwd)
Only apps/api/schema.graphql
changes are picked up.
Not sure why at the moment. Will check the issue later today.
@lubosmato Basically map( pipeAsync() )
with flat()
cuts off the iterable at the first match, do you think it's possible to do it without iter-ops
?
Yeah, working on it.
@lubosmato Looking at the diff reminds me of the fact that we were watching recursively.
Shallow watches on the immediate directories would ignore nested directories created after the watcher is started.
I can think of two options at the moment,
wdyt?
I tried again to combine those pesky AsyncIterators
and realized that this is a bit rabbit hole 😅 . The simplest approach could be watching recursively the top-most directory based on input endpoints
.
E.g. ../api/**/*.graphql ../api2/**/*.graphql ./local.graphql
would do single recursive watch on $PWD/../
.
@vicary Let's revert my changes so we don't block release process and I will prepare a new MR with single recursive watch if you aggree.
@vicary The simplest approach implemented here and without any additional dependencies: https://github.com/gqty-dev/gqty/pull/2000
Thank you for your time and help with this fix.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@gqty/cli@4.1.2
Patch Changes
fc1155f
Thanks @lubosmato! - Allow watch targets above current working directory