nx
nx copied to clipboard
fix(core): use globbing also for workspace file patterns without '*'
This change allows cache input strings for{workspaceRoot} filesets to be parsed as glob patterns even if they don't contain asterisk * inside.
Few examples:
// nx.json
{
"targetDefaults": {
"build": {
"inputs": [
"{workspaceRoot}/.babelrc?(.json)",
"{workspaceRoot}/tsconfig.{e2e-base,ts-node}.json"
]
}
}
// or project.json
{
"targets": {
"build": {
"inputs": [
"{workspaceRoot}/.babelrc?(.json)",
"{workspaceRoot}/tsconfig.{e2e-base,ts-node}.json"
]
}
}
}
Making perf optimizations by skipping minimatch for a few static files might not be worth the tradeoff. (related commit: https://github.com/nrwl/nx/commit/15ccae0b5833c2e46cd3f8b0ba02ae6db57f8ba2)
Note: this is a behaviour related to "cache inputs" feature introduced in Nx 14.4.
Current Behavior
Rerunning a target with above defined inputs with one of .babelrc or tsconfig.{e2e-base,ts-node}.json files updated will not invalidate a cache for the target.
Expected Behavior
Those files would get matched by Hasher and the Nx cache for the target would get invalidated.
☁️ Nx Cloud Report
CI is running/has finished running commands for commit ac15309aaaea6134c47a6a0e9c15bc598b084480. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this branch
✅ Successfully ran 12 targets
nx affected --target=e2e --base=f2222ff9689f48162e84d0e393c71384f640cd04 --head=ac15309aaaea6134c47a6a0e9c15bc598b084480 --exclude=e2e-storybook,e2e-storybook-angular,e2e-react-native,e2e-detox --parallel=1nx affected --target=test --base=f2222ff9689f48162e84d0e393c71384f640cd04 --head=ac15309aaaea6134c47a6a0e9c15bc598b084480 --parallel=1nx affected --target=build --base=f2222ff9689f48162e84d0e393c71384f640cd04 --head=ac15309aaaea6134c47a6a0e9c15bc598b084480 --parallel=3nx affected --target=lint --base=f2222ff9689f48162e84d0e393c71384f640cd04 --head=ac15309aaaea6134c47a6a0e9c15bc598b084480 --parallel=3nx-cloud record -- yarn nx workspace-lintnx-cloud record -- yarn documentationnx build typedoc-themenx-cloud record -- yarn depchecknx-cloud record -- yarn check-lock-filesnx-cloud record -- yarn check-commitnx-cloud record -- yarn nx format:check --base=f2222ff9689f48162e84d0e393c71384f640cd04 --head=ac15309aaaea6134c47a6a0e9c15bc598b084480nx-cloud record -- yarn check-imports
Sent with 💌 from NxCloud.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| nx-dev | ✅ Ready (Inspect) | Visit Preview | Jul 26, 2022 at 6:19PM (UTC) |
Alternatively, condition checking for presence of minimatch pattern (fileset.indexOf('*') > -1) could be expanded to multiple most common glob patterns, e.g. /[*?]|{.+}|[+@!]\(/.test(fileset) (matching patterns: *, ?, ?(), +(), @(), !(), {a,b})
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.