-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(core): accept various task runner options from root of nx.json #19243
feat(core): accept various task runner options from root of nx.json #19243
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 9704f7b. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 6 targets
Sent with 💌 from NxCloud. |
c824db4
to
03c49ac
Compare
packages/nx/src/config/nx-json.ts
Outdated
* If specified Nx will use nx-cloud by default with the given token. | ||
* To use a different runner that accepts an access token, define it in {@link tasksRunnerOptions} | ||
*/ | ||
accessToken?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about nxCloudAccessToken
or cloudAccessToken
instead?
I don't think accessToken
by itself at the root is self-documenting enough for someone who isn't intimately familiar with our ecosystem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to chat about it, I think its fine though as we will update the schemas to have intellisense and the docs will also show it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with nxCloudAccessToken
but I'll defer to @vsavkin .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Victor is as well. Changing it.
03c49ac
to
0b39499
Compare
0b39499
to
d7c234c
Compare
d7c234c
to
6c20939
Compare
packages/nx/src/config/nx-json.ts
Outdated
* If specified Nx will use nx-cloud by default with the given token. | ||
* To use a different runner that accepts an access token, define it in {@link tasksRunnerOptions} | ||
*/ | ||
accessToken?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm okay with nxCloudAccessToken
but I'll defer to @vsavkin .
packages/nx/src/config/nx-json.ts
Outdated
parallel?: number; | ||
|
||
/** | ||
* Changes the default location of the cache directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Changes the default location of the cache directory. | |
* Changes the directory used by Nx to store its cache. |
packages/nx/src/config/nx-json.ts
Outdated
accessToken?: string; | ||
|
||
/** | ||
* Specifies how many tasks are ran in parallel by Nx for the default tasks runner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Specifies how many tasks are ran in parallel by Nx for the default tasks runner. | |
* Specifies how many tasks can be run in parallel. |
packages/nx/src/config/nx-json.ts
Outdated
cacheDirectory?: string; | ||
|
||
/** | ||
* Allows turning the daemon off if set to false explicitly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Allows turning the daemon off if set to false explicitly. | |
* Set this to false to disable the daemon |
@@ -23,6 +24,15 @@ Target's configuration | |||
|
|||
## Properties | |||
|
|||
### cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this typing definitino to TargetDefaults
for now.
@@ -64,7 +64,9 @@ export class DaemonClient { | |||
|
|||
enabled() { | |||
if (this._enabled === undefined) { | |||
// TODO: Add migration to move it out of existing configs and remove the ?? here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: Add migration to move it out of existing configs and remove the ?? here. | |
// TODO(v18): Add migration to move it out of existing configs and remove the ?? here. |
if (nxJson.accessToken) { | ||
result.accessToken ??= nxJson.accessToken; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ONLY send this in if nx-cloud
is used.
6c20939
to
452946f
Compare
452946f
to
da28015
Compare
da28015
to
d140b5e
Compare
d140b5e
to
3cb5d27
Compare
3cb5d27
to
9704f7b
Compare
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. |
Current Behavior
tasksRunnerOptions
is a required property for most workspaces, even though they only have 1 runner.Expected Behavior
This PR simplifies the configuration by allowing most properties to instead be read from the root of the nx.json. One property which changes notably is that
cacheableOperations
's default value is inferred from the value ofcache: true
intargetDefaults
.This PR also lays the groundwork for allowing specification of
cache: true
in a project.json file or similar, but it is hidden behind an env variable until other runners (notably nx cloud) support the property.Related Issue(s)
Fixes #