docs: clarify trailing slash requirement for inputs directory paths #33664
+23 −0
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Current Behavior
Users specifying directory paths in
inputswithout a trailing slash or glob pattern find that files are not matched. For example,{projectRoot}/srcdoes not match any files, whileoutputsallows naked directory paths without issue.Expected Behavior
Documentation clearly explains that directory paths in
inputsrequire a trailing slash or glob pattern:{ "inputs": [ "{projectRoot}/src/", // ✓ Works (trailing slash) "{projectRoot}/src/**/*", // ✓ Works (glob pattern) "{projectRoot}/src" // ✗ Does NOT work ] }Changes
reference/inputs.mdoc): Added "Directory Paths" section explaining the requirement with examplesconfigure-inputs.mdoc): Added callout warning at top alerting users to this behavioroutputs, which do support naked directory pathsRelated Issue(s)
Fixes https://linear.app/nxdev/issue/NXC-2102/clarify-trailing-slash-requirement-for-inputs-in-directory-paths
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
staging.nx.app/usr/local/bin/node node ./bin/post-install(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Issue Title: Clarify trailing slash requirement for inputs in directory paths
Issue Description: Ideally, bring the syntax supported by
inputsin line with that supported byoutputs. If this is not possible, document the differences so folks aren't confused.@steven said:
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
https://github.com/nrwl/nx
Comment by User d484ef82-7f7d-4a95-be09-9d82ca3905dc:
📋 I wasn't able to determine which GitHub repository to work in.
I think it's one of these, but can you tell me which one is right?
Comment by User :
This thread is for an agent session with githubcopilot.
Comment by User 439b15a6-827b-4258-971a-d86133ad59de:
yeah throw it at copilot for the docs if it's something sticky clients keep hitting. probs just want this page
depending on if you want to denote this on the outputs or inputs page.
https://nx.dev/docs/guides/tasks--caching/configure-outputs
https://nx.dev/docs/guides/tasks--caching/configure-inputs
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
@caleb Do you think this is worth documenting? Could probably just throw it at Copilot if so, since there's a decent amount of context in the thread.
Comment by User :
This comment thread is synced to a corresponding thread in Slack. All replies are displayed in both locations.
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
yeah just misc probably
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
@MaxK -- Is core where you track things for console?
@jon -- Should I create a Linear task for this? (if so, where? Also Core?)
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
Is there a linear board for Console? Or should I do this on github?
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
Ahh the long term fix is part of that other thread from a while ago where the static output takes forever :thinkspin:
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
but long-term, idk
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
so the fix for it now shouldn't be too tricky
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
nope, should be fine (for now). Tbf the way the task graph works right now is bad though. We compute potential tasks graphs for everything which takes a long time. We need to update it so that the graphs are built on demand from the project graph instead. And once that happens in the browser, it might become less trivial
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
Sure thing!
Is there any issue with calling into native/rust code for the graph?
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
yeah okay, can you make a ticket for that? We wanted to look into merging these functions anyways at some point just never got around to it
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
Correct. CLI supports
foo/but graph doesn't expand it without globs added.With the additional potential addition of a "naked" path being enumerated if it points to a directory as it works for output (pending Jon's discovery).
Comment by User 899d8ea3-41b0-4565-8819-1c9ec8af943a:
well i think functionality is either my business or jon’s business depending in where the mistake is exactly ^^
Just to make sure i’m getting this right: we don’t interpret the SS1 syntax correctly when listing the input files in the graph. It should contain test-file.txt even with the SS1 syntax. The cli correctly picks up the file as an input with SS1 syntax, though.
Is that correct? That it’s a graph-only problem?
Comment by User bfb77a6b-f2e4-4252-a69b-abba8c2d0bf0:
@MaxK While testing this, I also noticed that we don't expand directories in the task graph when using the trailing slash syntax for inputs:
SS 1 is with
"inputs": ["{projectRoot}/src/"],SS 2 is with
"inputs": ["{projectRoot}/src/***/**"],repro
*(sorry if task graph is not under the c...
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.