Skip to content
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

Target Descriptions #19355

Closed
1 task
ethanjdiamond opened this issue Sep 27, 2023 · 3 comments · Fixed by #27131
Closed
1 task

Target Descriptions #19355

ethanjdiamond opened this issue Sep 27, 2023 · 3 comments · Fixed by #27131
Assignees
Labels

Comments

@ethanjdiamond
Copy link

ethanjdiamond commented Sep 27, 2023

Description

An optional "description" field for target definitions that is a human readable description of the target. This would then be surfaced in nx graph, nx show [project] and the nx plugin for VSCode.

Motivation

As monorepos grow large, you tend to get a large variety of targets that need to be run to accomplish different tasks. It's not always obvious from context what a target does, or how to use it. For example, a target might require an extra argument that's expected to be used like nx run project:install -- otherpackage, but there's nowhere great to quickly capture that information for other developers who are unfamiliar with your project. It'd be great to see at a glance, particularly in the nx VS plugin, a list of a projects targets and what they do.

Suggested Implementation

A target definition in a project.json file would include a field for "description" that is free-text. The ProjectConfiguration for project nodes would pick up that string and store it as part of the target definition. Dev tools would then present that field if present.

Alternate Implementations

I'm not sure if there's a particularly good alternate option worth considering that achieves the goal.

@AgentEnder AgentEnder added the scope: core core nx functionality label Sep 28, 2023
@alberturria
Copy link

I see it's been a while already, but I'd love to have this feature too. (And I'm also willing to help there! 🙂)
Is there any new regarding this?

@FrozenPandaz
Copy link
Collaborator

FrozenPandaz commented Jul 25, 2024

This feature is now available: You can specify the description for your project under metadata:

project.json

{
  metadata: {
    description: 'This is the marketing app'
  }
}

The same is available for targets.

image

I'll get this documented.

FrozenPandaz added a commit that referenced this issue Aug 1, 2024
#27131)

…ent it

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Target description is not shown in the PDV.

Also, being able to set a description in `project.json` is not in the
schema nor is it documented.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Target descriptions are shown in the PDV.

Also, being able to set a description in `project.json` is in the schema
and documented on
https://nx-dev-git-metadata-docs-nrwl.vercel.app/project-configuration#target-metadata

![image](https://github.com/user-attachments/assets/2037eca8-d516-4513-81fd-12b8384a9411)

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #19355

(cherry picked from commit 381efa8)
ZackDeRose pushed a commit to ZackDeRose/nx that referenced this issue Aug 8, 2024
nrwl#27131)

…ent it

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

Target description is not shown in the PDV.

Also, being able to set a description in `project.json` is not in the
schema nor is it documented.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Target descriptions are shown in the PDV.

Also, being able to set a description in `project.json` is in the schema
and documented on
https://nx-dev-git-metadata-docs-nrwl.vercel.app/project-configuration#target-metadata


![image](https://github.com/user-attachments/assets/2037eca8-d516-4513-81fd-12b8384a9411)


## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes nrwl#19355
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants