NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 253 forks source link

Scaffolded content #1792

Open yishaigalatzer opened 8 years ago

yishaigalatzer commented 8 years ago

We want to support adding file to a project (with the intent of them being modifiable by the user).

This is the second part to the content in transitive restore discussion started here - https://github.com/NuGet/Home/issues/627 and https://github.com/NuGet/Home/wiki/%5BSpec%5D-Content-v2-for-project.json

The goal is to enable authoring packages that allow for modifying the project in the following scenarios

  1. Add a configuration file
  2. Add a configuration/code file that is modifiable based on the project
  3. Run XDT transforms over the project
304NotModified commented 8 years ago

We really like to see this feature for NLog.

nbarbettini commented 8 years ago

Agreed, this is a current pain point with transitive restore - which is otherwise awesome. :smile:

v2Shridhar commented 7 years ago

Any updates, when this feature will be released?

lordofscripts commented 7 years ago

Another use case is when you have a series of Views and even a controller in a web application that you would like to reuse in other web applications. Currently you can't put views in a NUPKG (at least not since I started .NET COre) and you want the user to be able to customize that controller and views to something that blends more with their web application or do some extra things.

I used to be able to do that with standard ASP.NET MVC but now I cannot with ASP.NET Core and it is a bummer. I had to create a NuGet Tripe (as I call it) to do it until this feature is brought back.

brgrz commented 7 years ago

It's unclear from the docs and the two GitHub issues whether packaging content is still supported or not.

This page says it is not (or is vague about it) https://docs.microsoft.com/en-us/nuget/create-packages/project-json-impact

Similar to install scripts, transforms run on package install and are typically not idempotent. Since there is no install time anymore, XDT Transform and similar features are not supported, and are ignored if such a package is used in a transitive scenario.

Support for content is currently disabled for similar reasons for scripts and transforms, but we are in the process of designing support for content.

Content files can still be carried inside the packages, and are ignored currently, however the end user can still copy them into the right spot.

Having hard time understanding what it means "copy them into the right spot" - are we supposed to manually extract and copy content files?

Also, another page at docs says transforms are still supported and gives a whole tutorial how to do it: https://docs.microsoft.com/en-us/nuget/create-packages/source-and-config-file-transformations

It'd be nice if some cleared up what's the actual status of this and also revised the docs.

Jtango18 commented 6 years ago

I just want to clarify here (having spent several hours messing with this) that currently, with a PackageReference formatted package, it is NOT possible to add a transformed source file (e.g. MyClass.cs.pp) to the consuming project's structure in a way that is user visible/editable. Is that correct?

chuanboz commented 6 years ago

Any update for this? I see it labled with Priority 1 but has a conflict milestones as Backlog.