Skip to content

Management of locally installed dotnet tools #44

@AgentEnder

Description

@AgentEnder

I definitely agree about installing tools being the path for getting this executor up and running.

I see something like this:

  1. Init schematic is updated to create the tool-manifest, with some messaging about "Tool Manifest created for managing dotnet tools"
  2. Tools are installed if needed at the time a schematic that would use them is used the first time.
    • In practice, this means that we can have this format tool, or the swagger cli tool later, or other tools be known by the package, but only installed if users care about them.
    • A process flow with this would look something like: User runs nx format my-api -> Executor checks for tool in manifest, installs if missing -> Executor checks that tool has been restored, reports error message otherwise -> Executor runs tool
  3. Add a restore schematic (simple schematic, runs dotnet restore and dotnet tool restore)
  4. Update init schematic to add nx g @nx-dotnet/core:restore to npm prepare scripts. Something like:
        const package = readJson(host, 'package.json')
        const prepareSteps = package.scripts.prepare?.split?.('&&')?.map?.(x => x.trim()) ?? [];
        if (!prepareSteps.includes('nx g @nx-dotnet/core:restore')) {
            prepareSteps.push('nx g @nx-dotnet/core:restore')
        }
        package.scripts.prepare = prepareSteps.join(' && ')
        writeJson(host, 'package.json', package)

I'll create new issues for the tool management when I am home this evening.

After we get tool-mgmt in, this executor should be pretty quick to test.

Originally posted by @AgentEnder in #13 (comment)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions