Move umbraco views to static assets and make that an RCL + Embedded language files (#12324)

* RCL for static assets to replace the nuspec

* Fix build

* Fix unit tests

* clean up in build.ps1

* Removed test (lang files will be removed later anyway)

* Fixed namespaces.. + Ensure we set web root path if missing (e.g. wwwroot folder do not exist) + Added StaticWebAssetBasePath

* fixed namespace

* cleanup

* Set root variable

* Added static assets

* Experimenting with StaticWebAssetBasePath

* Embedded lang files into Umbraco.Core

* Removed legacy test. New test can be implemented instead

* Fixed tests

* clean up

* Fix merge issue
This commit is contained in:
Bjarke Berg
2022-05-02 19:38:33 +02:00
committed by GitHub
parent f00bfc408e
commit 13f6d4791c
54 changed files with 222 additions and 318 deletions

View File

@@ -4,12 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Web.UI</RootNamespace>
</PropertyGroup>
<Import Project="../../build/NuSpecs/buildTransitive/Umbraco.Cms.StaticAssets.props" />
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/umbraco/**</DefaultItemExcludes>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DocumentationFile>bin/Release/Umbraco.Web.UI.xml</DocumentationFile>
</PropertyGroup>
@@ -23,6 +18,7 @@
<ProjectReference Include="../Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj" />
<ProjectReference Include="../Umbraco.Web.Common/Umbraco.Web.Common.csproj" />
<ProjectReference Include="../Umbraco.Web.Website/Umbraco.Web.Website.csproj" />
<ProjectReference Include="..\Umbraco.Cms.StaticAssets\Umbraco.Cms.StaticAssets.csproj" />
<!-- <ProjectReference Include="../Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj" Condition="'$(OS)' == 'Windows_NT'" />-->
<ProjectReference Include="..\Umbraco.PublishedCache.NuCache\Umbraco.PublishedCache.NuCache.csproj" />
<ProjectReference Include="..\Umbraco.Web.BackOffice\Umbraco.Web.BackOffice.csproj" />
@@ -50,7 +46,6 @@
<PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<_ContentIncludedByDefault Remove="wwwroot\umbraco\views\common\infiniteeditors\twofactor\enabletwofactor.html" />
</ItemGroup>
<PropertyGroup>
@@ -60,22 +55,13 @@
</PropertyGroup>
<PropertyGroup>
<BellePath>$(ProjectDir)wwwroot/umbraco</BellePath>
<JsonSchemaPath>$(ProjectDir)umbraco/config/appsettings-schema.json</JsonSchemaPath>
</PropertyGroup>
<Target Name="CheckPreconditions" BeforeTargets="Build">
<Message Text="-CheckPreconditions-" Importance="high" />
<Message Text="JsonSchemaPath: $(JsonSchemaPath)" Importance="high" />
<Message Text="BellePath: $(BellePath)" Importance="high" />
<!-- Build Belle, if building is Visual Studio and the build folder does not exist yet -->
<Message Text="Skip Belle because UmbracoBuild is '$(UmbracoBuild)' (this is not Visual Studio)." Importance="High" Condition="'$(UmbracoBuild)' != ''" />
<Message Text="Skip Belle because $(BellePath) exists." Importance="High" Condition="Exists('$(BellePath)')" />
<Message Text="Build Belle because UmbracoBuild is empty (this is Visual Studio), and $(BellePath) does not exist." Importance="High" Condition="!Exists('$(BellePath)') and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="BelleBuild" Condition="!Exists('$(BellePath)') and '$(UmbracoBuild)' == ''" />
<Message Text="Skip JsonSchema generation because $(JsonSchemaPath) exists." Importance="High" Condition="Exists('$(JsonSchemaPath)')" />
<Message Text="Generate the appsettings json schema." Importance="High" Condition="!Exists('$(JsonSchemaPath)') and '$(UmbracoBuild)' == ''" />
<CallTarget Targets="JsonSchemaBuild" Condition="!Exists('$(JsonSchemaPath)') and '$(UmbracoBuild)' == ''" />
@@ -83,10 +69,7 @@
<CallTarget Targets="AppsettingsDevBuild" Condition="!Exists('appsettings.Development.json')" />
</Target>
<Target Name="BelleBuild">
<Exec WorkingDirectory="$(ProjectDir)/../Umbraco.Web.UI.Client/" Command="npm ci --no-fund --no-audit --prefer-offline" />
<Exec WorkingDirectory="$(ProjectDir)/../Umbraco.Web.UI.Client/" Command="npm run build:skip-tests" />
</Target>
<Target Name="JsonSchemaBuild">
<!-- <Exec WorkingDirectory="$(ProjectDir)/../../" Command="powershell -ExecutionPolicy RemoteSigned -Command '&amp;dotnet run &#45;&#45;project $pwd/src/JsonSchema/JsonSchema.csproj -c Release &#45;&#45; &#45;&#45;outputFile $pwd/src/Umbraco.Web.UI/$(JsonSchemaPath)'" /> -->
@@ -101,19 +84,5 @@
<Message Text="Generating appsettings.Development.json because it doesnt exist" Importance="High" />
<Copy SourceFiles="$(ProjectDir)appsettings.Development.template.json" DestinationFiles="$(ProjectDir)appsettings.Development.json" />
</Target>
<!-- Clean Belle when cleaning and rebuilding, but only in Visual Studio -->
<Target Name="CleanPreconditions" AfterTargets="Clean" Condition="'$(UmbracoBuild)' == ''">
<Message Text="-CleanPreconditions-" Importance="high" />
<Message Text="Nothing to clean, as $(BellePath) does not exist." Importance="High" Condition="!Exists('$(BellePath)')" />
<Message Text="Not cleaning (found src/preserve.belle)." Importance="High" Condition="Exists('$(BellePath)') and Exists('$(SolutionDir)preserve.belle')" />
<Message Text="Remove $(BellePath)." Importance="High" Condition="Exists('$(BellePath)') and !Exists('$(SolutionDir)preserve.belle')" />
<ItemGroup>
<BelleLib Include="$(BellePath)" />
</ItemGroup>
<RemoveDir Directories="@(BelleLib)" Condition="Exists('$(BellePath)') and !Exists('$(SolutionDir)preserve.belle')" />
<Message Text="Remove $(JsonSchemaPath)." Importance="High" Condition="Exists('$(JsonSchemaPath)') and !Exists('$(SolutionDir)preserve.jsonschema')" />
<Delete Files="$(JsonSchemaPath)" Condition="Exists('$(JsonSchemaPath)') and !Exists('$(SolutionDir)preserve.jsonschema')" />
</Target>
</Project>