-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
fix(cli): fix watching of schema files outside of working directory #1998
Conversation
@lubosmato Thanks for contributing! There are some missing bits that I'd like to add before merging, would you please enable Allow edits from maintainers? |
Hi @vicary, thank you for this amazing project. Allow by maintainers should be allowed. |
@lubosmato For some reason a canary is not published, would you like to test the main branch locally before release? |
@vicary I have just tested it and it's not working 🤔. I will check what is the problem and ping back. |
The correct diff --git a/packages/cli/src/commands/default.ts b/packages/cli/src/commands/default.ts
index 1f54a4b4..9d9c4508 100644
--- a/packages/cli/src/commands/default.ts
+++ b/packages/cli/src/commands/default.ts
@@ -274,12 +274,13 @@ export const addCommand = (command: Command) => {
// Watch file changes
(async () => {
- const watchEndpoints = endpoints
- .map((endpoint) => path.resolve(endpoint))
+ const watchFiles = endpoints
+ .map((endpoint) => path.resolve(endpoint));
+ const watchDirectories = watchFiles
.map((endpoint) => path.dirname(endpoint));
const watchIterable = pipeAsync(
- [...new Set(watchEndpoints)],
+ [...new Set(watchDirectories)],
map((path) =>
pipeAsync(
watch(path),
@@ -296,7 +297,7 @@ export const addCommand = (command: Command) => {
const fullPath = path.resolve(parentPath, filename);
- if (!isMatch(fullPath, watchEndpoints)) continue;
+ if (!isMatch(fullPath, watchFiles)) continue;
// Already queued
if (shouldRun) continue; |
…1998) * fix(cli): fix watching of schema files that are outside of working directory * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
@lubosmato My bad for the oversight, pushed again to main. |
…1998) * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
…1998) * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
…qty-dev#1998) * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
…qty-dev#1998) * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
…1998) * fix(cli): fix watching of schema files that are outside of working directory * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
…1998) * fix(cli): fix watching of schema files that are outside of working directory * chore(package/cli): cosmetic touch-ups * chore(package/cli): changeset --------- Co-authored-by: Vicary A <[email protected]>
The PR fixes watching of schema files that are outside of working directory.
Solves #1997