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

Add dotnet local tool instructions tab #8433

Conversation

augustoproiete
Copy link
Contributor

@augustoproiete augustoproiete commented Feb 28, 2021

Implementation of the tab with installation instructions for .NET local tools:

  • Rename the existing .NET CLI tab to .NET CLI (Global)

  • Update the info text at the bottom:

- This package contains a .NET Core Global Tool you can call from the shell/command line
+ This package contains a .NET tool you can call from the shell/command line
  • Add a new tab .NET CLI (Local) with the following instructions:
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local <ToolName> --version <ToolVersion>

image


image


Addresses #8373

@augustoproiete augustoproiete force-pushed the add-dotnet-local-tool-instructions-tab branch from 454e49e to ba12605 Compare February 28, 2021 07:20
@joelverhagen
Copy link
Member

I think changing the model to a list of strings (one string per command line) is a good one assuming the copy button still copies the expected text. It's important that the copied text is actually two lines with nothing else added, so that pasting into a terminal behaves nicely.

Also, when you add multi-command support, please check what happens with a longer package ID and a narrow screen. Right now the text wrapping looks "good enough" for a single command. We'd want it to look similarly "good enough" 😄 for a command text.

@joelverhagen joelverhagen self-assigned this Mar 1, 2021
@joelverhagen
Copy link
Member

Hey @augustoproiete, is something I can help out with here or clarify? This seems like a good change and I'd be happy to review the next iteration per my previous comment (#8433 (comment)) whenever you're ready 😃.

@augustoproiete
Copy link
Contributor Author

Hey @joelverhagen, thanks for the nudge. I think it's all clear and the ball is in my court now to try to implement the multi-line ​commands whilst preserving the current copy/paste behavior - though any ideas are welcome.

I'll set some time aside this coming weekend and see if I can complete this one.

@augustoproiete augustoproiete force-pushed the add-dotnet-local-tool-instructions-tab branch from ba12605 to bbee7cf Compare March 22, 2021 04:05
@augustoproiete
Copy link
Contributor Author

@joelverhagen This is ready for round 2.

I've updated the view model to allow more than one install command and I'm rendering each command inside of a span in order to add the command prefix to each individual line.

The copy/paste continues to copy the expected text in all cases, preserving line-breaks (if any).

I tested all tabs (Package Manager, .NET CLI, PackageReference, Paket CLI, F# Interactive, Cake, and .NET CLI for Templates), and they continue to display the install commands as expected.


Single command with one line

image

- dotnet tool install --global dotnet-ef --version 5.0.4
+ <span class="install-command-row">dotnet tool install --global dotnet-ef --version 5.0.4</span>

Multiple commands 🆕

image

+ <span class="install-command-row">dotnet new tool-manifest # if you are setting up this repo
+ </span><span class="install-command-row">dotnet tool install --local dotnet-ef --version 5.0.4</span>

Single command with multiple lines (e.g. PackageReference for Development dependencies)

image

- &lt;PackageReference Include=&quot;GitVersion.MsBuild&quot; Version=&quot;5.6.6&quot;&gt;
-   &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
-   &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers&lt;/IncludeAssets&gt;
- &lt;/PackageReference&gt
+ <span class="install-command-row">&lt;PackageReference Include=&quot;GitVersion.MsBuild&quot; Version=&quot;5.6.6&quot;&gt;
+   &lt;PrivateAssets&gt;all&lt;/PrivateAssets&gt;
+   &lt;IncludeAssets&gt;runtime; build; native; contentfiles; analyzers&lt;/IncludeAssets&gt;
+ &lt;/PackageReference&gt;</span>

@augustoproiete augustoproiete force-pushed the add-dotnet-local-tool-instructions-tab branch from bbee7cf to c000338 Compare March 23, 2021 04:51
@joelverhagen joelverhagen merged commit e9a61f3 into NuGet:dev Mar 25, 2021
@joelverhagen
Copy link
Member

Thanks @augustoproiete!

@augustoproiete augustoproiete deleted the add-dotnet-local-tool-instructions-tab branch March 25, 2021 00:34
@ryuyu ryuyu mentioned this pull request Apr 8, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants