Move UI Client files to StaticAssets project and refactor build targets #15055
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites
Description
One of the biggest hurdles with getting started with the CMS codebase (for contributing and debugging) is currently the fact that you need to first manually run
npm
commands to build the front-end bits. Also, if NPM packages get updated, you need to manually re-runnpm ci
to get the correct/latest versions installed.For our commercial products, we're already using an adaptation of the
MicrosoftAspNetCore.ClientAssets
build targets, which takes care of automatically restoring and building NPM client assets as part of the .NET build. There are plans to integrate this into the .NET SDK, but that has recently been delayed to .NET 9...Testing can be done by checking whether the build output (specifically the
Umbraco.Cms.StaticAssets
NuGet package) contains the correct assets and the backoffice still runs when checking out a fresh copy of this PR and runningdotnet run --project src\Umbraco.Web.UI
(spoiler: this will do a .NET restore and build, NPM install and build, and finally start the application and show the installer screen).