-
Notifications
You must be signed in to change notification settings - Fork 9
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
RCL-ification of the package template. #8
Conversation
@KevinJump thought about this as well after seeing Lotte's tweet. I thought for a moment that your I suppose both are right, but maybe mine is slightly simpler as there then doesn't need to be a sub folder the assets. On the other hand, with mine the destination folder has to use the assembly name 🤔 Anyways - Lotte wrote this in the README:
So to explain why RCLs are awesome, I think one of the key takeways is that when you're working locally in Visual Studio or similar, the assets from the package is added to your project virtually. Meaning that aren't physically on disk inside your project - they are instead pulled virtually from the NuGet package and made to appear as if they were inside your project. For one, this makes it easier to work in packages and version control, since you don't have to commit the assets to your repo. It isn't until you do a publish that the files are added disk (or the generated ZIP). ASP.NET Core and Umbraco can access the virtual files - eg. for exploring language files and backoffice icons. But like Kevin mentions, this isn't supported for |
Yes, I too started with the package folder being "wwwroot". but I changed my mind 😊. (And this is an opinionated starter package) I actually now think this way is simpler because it's one less thing hidden in a config file that you have to remember . This might just be me on a journey towards just having "wwwroot/app_plugins/package-name" and nothing in the csproj file - which really might be the purest form and don't require umbraco secret knowledge or config changes 🤔 |
I hadn't considered leaving out I've build an internal tool to create new package stubs, so not really a problem for me. But for people not used to creating packages, I can see the benefit in keeping it simple 👍 |
Thank you @KevinJump for the PR, and @abjerner for the explanations. Very interesting to hear the approaches you both take! |
Thank you so much for this @KevinJump !! I have finally found / made / forced ;-) the time to check this and that I understand it all before merging |
Hi,
More than happy to explain this, but this makes the template use RCL stuff.
Microsoft.NET.Sdk
toMicrosoft.NET.Sdk.Razor
<StaticWebAssetBasePath>
setting (set to App_Plugins) - this in effect tells net what the wwwroot folder will map to on the site when the package is installed ^app_plugins
to 'wwwroot'.targets file
you don't need that anymorescripts
andcss
will be referenced in the package manifest filter**^ in an RCL all the static files have to live in a wwwroot folder, you can't rename that in the package but the
staticwebassetbasepath
setting does rename it when the package is installed on a site, so your files look like they are in/app_plugins
** In v10 - Umbraco can't read package. Manifest files from RCL folders. so, you need to explicitly reference files in the manifest filter. in v11 it can read the package. Manifest files so you can put them in their instead if you want to. for cross compatibility its best to stick to the manifest filter.