Code Monkey home page Code Monkey logo

Comments (4)

artiomchi avatar artiomchi commented on August 28, 2024

I'm finally back from being away for so long, and started working on this (as the main outstanding issue for alpha 1).

I'm digging deeper into the .net code to see how they handled this on their side. Seems like the install.ps1 and uninstall.ps1 are no longer in use, and may be deprecated in the future, so I'm looking at alternative solutions.

The way EF Core are handling it is quite interesting/different. The user's end project will reference the Microsoft.EntityFrameworkCore.Design package, which contains the actual code for migrations, db sync, etc. The Microsoft.EntityFrameworkCore.Tools and Microsoft.EntityFrameworkCore.Tools.Dotnet packages are just a "bootstrap" package, that uses the Design library from the end project to run the code.

We can't use the same approach, since we can't just reference the build tools and code analysers in the user's web project - that would be silly and would cause issues.

I'm checking a couple other tools libraries to see how they handle this issue

from r4mvc.

artiomchi avatar artiomchi commented on August 28, 2024

Digging deeper, I finally made some progress.. I've switched the name of the issue to change it into a discussion on tooling in general, rather than making it PS specific

First things first, I've managed to make the PowerShell tooling work in a reliable way. (i.e. it will pick up the latest version of the tools after each update without the need for a VS restart!) As such, I think we can go ahead with a first alpha (my MyGet fields are still being updated too).

Here's what I had so far in terms of a plan for the tools. We'll have two options that users can use. Both will provide the same level of functionality, the only difference is how they're invoked. While I'll strive to make them cross platform if possible, that doesn't seem to be an option at the moment, since MSBuild is only compiled against the full .NET framework. Once that changes, we should be able to make R4Mvc generation cross platform as well.

  1. PowerShell commands invoked in the Package Manager Console inside VS
    • Get-R4MVCStatus analyse the project, checking whether the project has any R4Mvc generated code
    • Generate-R4MVC main command that will invoke the R4Mvc generators
    • Remove-R4MVC will attempt to remove all custom code from the project (sans removing partial and virtual keywords)
  2. dotnet cli, which can be invoked either inside VS or from a command line in the project's path
    • dotnet r4mvc default command showing whether the project has any R4Mvc generated code, as well as a short help message with usage examples
    • dotnet r4mvc generate main command that invokes the R4Mvc generators
    • dotnet r4mvc remove - will attempt to remove the custom code from the project

Currently we only have the generate command, and I'll only start on the others when the core functionality is finished, so the others are really a backlog issue.

dotnet cli support is also in progress, although it's not quite there yet. Seems like the project that contains the cli commands HAS to be multi platform, otherwise we won't be able to add it to most projects. That explains why EF has separate projects for the PowerShell and the dotnet cli tools.

from r4mvc.

kevinkuszyk avatar kevinkuszyk commented on August 28, 2024

@artiomchi looks like a good approach to me. Shall we open issues to track progress on each of the commands and then close this one?

from r4mvc.

artiomchi avatar artiomchi commented on August 28, 2024

Yup, that makes sense. I'll go over them and create 4 new issues to replace this one with a proper write-up this evening

from r4mvc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.