Skip to content

Commit

Permalink
Add StaticAssets project
Browse files Browse the repository at this point in the history
  • Loading branch information
PerplexDaniel committed Sep 27, 2023
1 parent 718a7a4 commit 47342b3
Show file tree
Hide file tree
Showing 55 changed files with 89 additions and 176 deletions.
File renamed without changes
7 changes: 7 additions & 0 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@
<NoWarn>$(NoWarn);CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)..\pkg\icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,4 @@
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.0.0" />
</ItemGroup>

<ItemGroup>
<None Include="..\Perplex.ContentBlocks\icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

</Project>

This file was deleted.

50 changes: 50 additions & 0 deletions src/Perplex.ContentBlocks.StaticAssets/ManifestFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System.Diagnostics;
using Umbraco.Cms.Core.Manifest;

namespace Perplex.ContentBlocks.StaticAssets;

internal class ManifestFilter : IManifestFilter
{
void IManifestFilter.Filter(List<PackageManifest> manifests)
{
var assembly = typeof(PackageManifest).Assembly;
var versionInfo = FileVersionInfo.GetVersionInfo(assembly.Location);

manifests.Add(new PackageManifest
{
PackageName = "Perplex.ContentBlocks",
Version = versionInfo.ProductVersion ?? "1.0.0",
AllowPackageTelemetry = false,
BundleOptions = BundleOptions.Default,
Scripts = new[]
{
// Note: .requires.js should be loaded first
"/App_Plugins/Perplex.ContentBlocks/perplex.content-blocks.requires.js",

"/App_Plugins/Perplex.ContentBlocks/perplex.content-blocks.api.js",
"/App_Plugins/Perplex.ContentBlocks/perplex.content-blocks.controller.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-block.component.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.add-block.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.custom-component.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.custom-components.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.icon.js",
"/App_Plugins/Perplex.ContentBlocks/components/perplex.content-blocks.nested-content-patch.js",
"/App_Plugins/Perplex.ContentBlocks/configuration/perplex.content-blocks.configuration.structure.js",
"/App_Plugins/Perplex.ContentBlocks/lib/angular-slick.js",
"/App_Plugins/Perplex.ContentBlocks/lib/slick.min.js",
"/App_Plugins/Perplex.ContentBlocks/utils/perplex.content-blocks.copy-paste-service.js",
"/App_Plugins/Perplex.ContentBlocks/utils/perplex.content-blocks.utils.js",
"/App_Plugins/Perplex.ContentBlocks/utils/portal/perplex.content-blocks-portal.js",
"/App_Plugins/Perplex.ContentBlocks/utils/property/perplex.content-blocks.property-scaffold-cache.js",
"/App_Plugins/Perplex.ContentBlocks/utils/property/perplex.content-blocks.property.js",
"/App_Plugins/Perplex.ContentBlocks/utils/tab-focus/perplex.content-blocks.tab-focus-once.directive.js",
"/App_Plugins/Perplex.ContentBlocks/utils/tab-focus/perplex.content-blocks.tab-focus.service.js",
},

Stylesheets = new[]
{
"/App_Plugins/Perplex.ContentBlocks/perplex.content-blocks.css",
},
});
}
}
10 changes: 10 additions & 0 deletions src/Perplex.ContentBlocks.StaticAssets/ManifestFilterComposer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.DependencyInjection;

namespace Perplex.ContentBlocks.StaticAssets;

public class ManifestFilterComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
=> builder.ManifestFilters().Append<ManifestFilter>();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup Label="NuGet Package">
<PackageId>Perplex.ContentBlocks.StaticAssets</PackageId>
<PackageTags>umbraco</PackageTags>
<Description>Perplex.ContentBlocks Static Assets</Description>
<StaticWebAssetBasePath>/</StaticWebAssetBasePath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms.Web.BackOffice" Version="10.0.0" />
</ItemGroup>

</Project>
8 changes: 7 additions & 1 deletion src/Perplex.ContentBlocks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ VisualStudioVersion = 17.7.34003.232
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perplex.ContentBlocks", "Perplex.ContentBlocks\Perplex.ContentBlocks.csproj", "{CC00D01F-A987-4E6F-9983-FFAC97CE27A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Perplex.ContentBlocks.Core", "Perplex.ContentBlocks.Core\Perplex.ContentBlocks.Core.csproj", "{1282FAD9-5B28-4DBA-BF0E-0F8982085F59}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perplex.ContentBlocks.Core", "Perplex.ContentBlocks.Core\Perplex.ContentBlocks.Core.csproj", "{1282FAD9-5B28-4DBA-BF0E-0F8982085F59}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perplex.ContentBlocks.StaticAssets", "Perplex.ContentBlocks.StaticAssets\Perplex.ContentBlocks.StaticAssets.csproj", "{B8986C6A-0F31-4963-A439-441844FD262A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -21,6 +23,10 @@ Global
{1282FAD9-5B28-4DBA-BF0E-0F8982085F59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1282FAD9-5B28-4DBA-BF0E-0F8982085F59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1282FAD9-5B28-4DBA-BF0E-0F8982085F59}.Release|Any CPU.Build.0 = Release|Any CPU
{B8986C6A-0F31-4963-A439-441844FD262A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B8986C6A-0F31-4963-A439-441844FD262A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B8986C6A-0F31-4963-A439-441844FD262A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B8986C6A-0F31-4963-A439-441844FD262A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 1 addition & 7 deletions src/Perplex.ContentBlocks/Perplex.ContentBlocks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

<ItemGroup>
<None Include="icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Perplex.ContentBlocks.Core\Perplex.ContentBlocks.Core.csproj" />
<ProjectReference Include="..\Perplex.ContentBlocks.StaticAssets\Perplex.ContentBlocks.StaticAssets.csproj" />
</ItemGroup>

</Project>

0 comments on commit 47342b3

Please sign in to comment.