docs: clarify trailing slash requirement for inputs directory paths#33664
docs: clarify trailing slash requirement for inputs directory paths#33664
Conversation
✅ Deploy Preview for nx-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: llwt <1036428+llwt@users.noreply.github.com>
|
View your CI Pipeline Execution ↗ for commit fa8f74e
☁️ Nx Cloud last updated this comment at |
✅ Deploy Preview for nx-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
These formatting changes fix the Prettier linting error in the inputs documentation. The PR added new content explaining trailing slash requirements for input directory paths, but the JSON code example was missing trailing commas which violated the project's Prettier configuration. Running Prettier added the standard trailing commas to conform to the codebase's JSON formatting conventions.
Tip
✅ We verified this fix by re-running astro-docs:format.
diff --git a/astro-docs/src/content/docs/reference/inputs.mdoc b/astro-docs/src/content/docs/reference/inputs.mdoc
index 9d0de353cb..30c328b8e8 100644
--- a/astro-docs/src/content/docs/reference/inputs.mdoc
+++ b/astro-docs/src/content/docs/reference/inputs.mdoc
@@ -60,8 +60,8 @@ When specifying a directory as an input, you must use a trailing slash or a glob
"inputs": [
"{projectRoot}/src/", // ✓ Matches all files in src (note the trailing slash)
"{projectRoot}/src/**/*", // ✓ Matches all files in src using glob
- "{projectRoot}/src" // ✗ Does NOT match files - treated as a file path
- ]
+ "{projectRoot}/src", // ✗ Does NOT match files - treated as a file path
+ ],
}
```
Or Apply changes locally with:
npx nx-cloud apply-locally YfBp-H7lv
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
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.