Skip to content

Commit

Permalink
Rename old manifest stuff to legacy manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac committed Feb 15, 2023
1 parent 04ea016 commit d2ed03a
Show file tree
Hide file tree
Showing 34 changed files with 307 additions and 150 deletions.
112 changes: 112 additions & 0 deletions src/Umbraco.Core/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.CompositePackageManifest</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.IManifestFilter</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.IManifestParser</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.IPackageManifest</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestAssets</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestContentAppDefinition</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestContentAppFactory</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestDashboard</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestFilterCollection</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestFilterCollectionBuilder</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.ManifestSection</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Umbraco.Cms.Core.Manifest.PackageManifest</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.Configuration.Grid.GridConfig.#ctor(Umbraco.Cms.Core.Cache.AppCaches,Umbraco.Cms.Core.Manifest.IManifestParser,Umbraco.Cms.Core.Serialization.IJsonSerializer,Umbraco.Cms.Core.Hosting.IHostingEnvironment,Microsoft.Extensions.Logging.ILoggerFactory)</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.Models.Blocks.BlockGridItem.get_ForceLeft</Target>
Expand Down Expand Up @@ -343,6 +434,20 @@
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.PropertyEditors.ParameterEditorCollection.#ctor(Umbraco.Cms.Core.PropertyEditors.DataEditorCollection,Umbraco.Cms.Core.Manifest.IManifestParser)</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.PropertyEditors.PropertyEditorCollection.#ctor(Umbraco.Cms.Core.PropertyEditors.DataEditorCollection,Umbraco.Cms.Core.Manifest.IManifestParser)</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Umbraco.Cms.Core.Services.Implement.DataTypeService.#ctor(Umbraco.Cms.Core.PropertyEditors.IDataValueEditorFactory,Umbraco.Cms.Core.Scoping.ICoreScopeProvider,Microsoft.Extensions.Logging.ILoggerFactory,Umbraco.Cms.Core.Events.IEventMessagesFactory,Umbraco.Cms.Core.Persistence.Repositories.IDataTypeRepository,Umbraco.Cms.Core.Persistence.Repositories.IDataTypeContainerRepository,Umbraco.Cms.Core.Persistence.Repositories.IAuditRepository,Umbraco.Cms.Core.Persistence.Repositories.IEntityRepository,Umbraco.Cms.Core.Persistence.Repositories.IContentTypeRepository,Umbraco.Cms.Core.IO.IIOHelper,Umbraco.Cms.Core.Services.ILocalizedTextService,Umbraco.Cms.Core.Services.ILocalizationService,Umbraco.Cms.Core.Strings.IShortStringHelper,Umbraco.Cms.Core.Serialization.IJsonSerializer)</Target>
Expand Down Expand Up @@ -567,6 +672,13 @@
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>M:Umbraco.Cms.Core.Telemetry.ITelemetryService.GetTelemetryReportDataAsync</Target>
<Left>lib/net7.0/Umbraco.Core.dll</Left>
<Right>lib/net7.0/Umbraco.Core.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0006</DiagnosticId>
<Target>P:Umbraco.Cms.Core.Models.IDataType.ConfigurationData</Target>
Expand Down
8 changes: 4 additions & 4 deletions src/Umbraco.Core/Configuration/Grid/GridConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ public class GridConfig : IGridConfig
{
public GridConfig(
AppCaches appCaches,
IManifestParser manifestParser,
ILegacyManifestParser legacyManifestParser,
IJsonSerializer jsonSerializer,
IHostingEnvironment hostingEnvironment,
ILoggerFactory loggerFactory,
IGridEditorsConfigFileProviderFactory gridEditorsConfigFileProviderFactory)
=> EditorsConfig =
new GridEditorsConfig(appCaches, hostingEnvironment, manifestParser, jsonSerializer, loggerFactory.CreateLogger<GridEditorsConfig>(), gridEditorsConfigFileProviderFactory);
new GridEditorsConfig(appCaches, hostingEnvironment, legacyManifestParser, jsonSerializer, loggerFactory.CreateLogger<GridEditorsConfig>(), gridEditorsConfigFileProviderFactory);

[Obsolete("Use other ctor - Will be removed in Umbraco 13")]
public GridConfig(
AppCaches appCaches,
IManifestParser manifestParser,
ILegacyManifestParser legacyManifestParser,
IJsonSerializer jsonSerializer,
IHostingEnvironment hostingEnvironment,
ILoggerFactory loggerFactory)
: this(
appCaches,
manifestParser,
legacyManifestParser,
jsonSerializer,
hostingEnvironment,
loggerFactory,
Expand Down
12 changes: 6 additions & 6 deletions src/Umbraco.Core/Configuration/Grid/GridEditorsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ internal class GridEditorsConfig : IGridEditorsConfig
private readonly IJsonSerializer _jsonSerializer;
private readonly ILogger<GridEditorsConfig> _logger;
private readonly IGridEditorsConfigFileProviderFactory _gridEditorsConfigFileProviderFactory;
private readonly IManifestParser _manifestParser;
private readonly ILegacyManifestParser _legacyManifestParser;

public GridEditorsConfig(
AppCaches appCaches,
IHostingEnvironment hostingEnvironment,
IManifestParser manifestParser,
ILegacyManifestParser legacyManifestParser,
IJsonSerializer jsonSerializer,
ILogger<GridEditorsConfig> logger,
IGridEditorsConfigFileProviderFactory gridEditorsConfigFileProviderFactory)
{
_appCaches = appCaches;
_hostingEnvironment = hostingEnvironment;
_manifestParser = manifestParser;
_legacyManifestParser = legacyManifestParser;
_jsonSerializer = jsonSerializer;
_logger = logger;
_gridEditorsConfigFileProviderFactory = gridEditorsConfigFileProviderFactory;
Expand All @@ -43,13 +43,13 @@ public GridEditorsConfig(
public GridEditorsConfig(
AppCaches appCaches,
IHostingEnvironment hostingEnvironment,
IManifestParser manifestParser,
ILegacyManifestParser legacyManifestParser,
IJsonSerializer jsonSerializer,
ILogger<GridEditorsConfig> logger)
: this(
appCaches,
hostingEnvironment,
manifestParser,
legacyManifestParser,
jsonSerializer,
logger,
StaticServiceProvider.Instance.GetRequiredService<IGridEditorsConfigFileProviderFactory>())
Expand Down Expand Up @@ -120,7 +120,7 @@ List<IGridEditorConfig> GetResult()
}

// Add manifest editors, skip duplicates
foreach (GridEditor gridEditor in _manifestParser.CombinedManifest.GridEditors)
foreach (GridEditor gridEditor in _legacyManifestParser.CombinedManifest.GridEditors)
{
if (editors.Contains(gridEditor) == false)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ protected override IEnumerable<IContentAppFactory> CreateItems(IServiceProvider
// get the manifest parser just-in-time - injecting it in the ctor would mean that
// simply getting the builder in order to configure the collection, would require
// its dependencies too, and that can create cycles or other oddities
IManifestParser manifestParser = factory.GetRequiredService<IManifestParser>();
ILegacyManifestParser legacyManifestParser = factory.GetRequiredService<ILegacyManifestParser>();
IIOHelper ioHelper = factory.GetRequiredService<IIOHelper>();
return base.CreateItems(factory)
.Concat(manifestParser.CombinedManifest.ContentApps.Select(x =>
new ManifestContentAppFactory(x, ioHelper)));
.Concat(legacyManifestParser.CombinedManifest.ContentApps.Select(x =>
new LegacyManifestContentAppFactory(x, ioHelper)));
}
}
8 changes: 4 additions & 4 deletions src/Umbraco.Core/Dashboards/DashboardCollectionBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ protected override IEnumerable<IDashboard> CreateItems(IServiceProvider factory)
// get the manifest parser just-in-time - injecting it in the ctor would mean that
// simply getting the builder in order to configure the collection, would require
// its dependencies too, and that can create cycles or other oddities
IManifestParser manifestParser = factory.GetRequiredService<IManifestParser>();
ILegacyManifestParser legacyManifestParser = factory.GetRequiredService<ILegacyManifestParser>();

IEnumerable<IDashboard> dashboardSections =
Merge(base.CreateItems(factory), manifestParser.CombinedManifest.Dashboards);
Merge(base.CreateItems(factory), legacyManifestParser.CombinedManifest.Dashboards);

return dashboardSections;
}

private IEnumerable<IDashboard> Merge(
IEnumerable<IDashboard> dashboardsFromCode,
IReadOnlyList<ManifestDashboard> dashboardFromManifest) =>
IReadOnlyList<LegacyManifestDashboard> dashboardFromManifest) =>
dashboardsFromCode.Concat(dashboardFromManifest)
.Where(x => !string.IsNullOrEmpty(x.Alias))
.OrderBy(GetWeight);
Expand All @@ -32,7 +32,7 @@ private int GetWeight(IDashboard dashboard)
{
switch (dashboard)
{
case ManifestDashboard manifestDashboardDefinition:
case LegacyManifestDashboard manifestDashboardDefinition:
return manifestDashboardDefinition.Weight;

default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static IUmbracoBuilder AddDashboard<T>(this IUmbracoBuilder builder)
/// <typeparam name="T">The type of the manifest filter.</typeparam>
/// <param name="builder">The Builder.</param>
public static IUmbracoBuilder AddManifestFilter<T>(this IUmbracoBuilder builder)
where T : class, IManifestFilter
where T : class, ILegacyManifestFilter
{
builder.ManifestFilters().Append<T>();
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ internal static void AddAllCoreCollectionBuilders(this IUmbracoBuilder builder)
.Add<ExamineDashboard>()
.Add<FormsDashboard>()
.Add<HealthCheckDashboard>()
.Add<ManifestDashboard>()
.Add<LegacyManifestDashboard>()
.Add<MediaDashboard>()
.Add<MembersDashboard>()
.Add<ProfilerDashboard>()
Expand Down Expand Up @@ -270,8 +270,8 @@ internal static ManifestValueValidatorCollectionBuilder ManifestValueValidators(
/// Gets the manifest filter collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
public static ManifestFilterCollectionBuilder ManifestFilters(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<ManifestFilterCollectionBuilder>();
public static LegacyManifestFilterCollectionBuilder ManifestFilters(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<LegacyManifestFilterCollectionBuilder>();

/// <summary>
/// Gets the content finders collection builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ namespace Umbraco.Cms.Core.Manifest;
/// <summary>
/// A package manifest made up of all combined manifests
/// </summary>
public class CompositePackageManifest
public class CompositeLegacyPackageManifest
{
public CompositePackageManifest(
public CompositeLegacyPackageManifest(
IReadOnlyList<IDataEditor> propertyEditors,
IReadOnlyList<IDataEditor> parameterEditors,
IReadOnlyList<GridEditor> gridEditors,
IReadOnlyList<ManifestContentAppDefinition> contentApps,
IReadOnlyList<ManifestDashboard> dashboards,
IReadOnlyList<ManifestSection> sections,
IReadOnlyDictionary<BundleOptions, IReadOnlyList<ManifestAssets>> scripts,
IReadOnlyDictionary<BundleOptions, IReadOnlyList<ManifestAssets>> stylesheets)
IReadOnlyList<LegacyManifestContentAppDefinition> contentApps,
IReadOnlyList<LegacyManifestDashboard> dashboards,
IReadOnlyList<LegacyManifestSection> sections,
IReadOnlyDictionary<BundleOptions, IReadOnlyList<LegacyManifestAssets>> scripts,
IReadOnlyDictionary<BundleOptions, IReadOnlyList<LegacyManifestAssets>> stylesheets)
{
PropertyEditors = propertyEditors ?? throw new ArgumentNullException(nameof(propertyEditors));
ParameterEditors = parameterEditors ?? throw new ArgumentNullException(nameof(parameterEditors));
Expand Down Expand Up @@ -45,19 +45,19 @@ public CompositePackageManifest(
/// <summary>
/// Gets or sets the content apps listed in the manifest.
/// </summary>
public IReadOnlyList<ManifestContentAppDefinition> ContentApps { get; }
public IReadOnlyList<LegacyManifestContentAppDefinition> ContentApps { get; }

/// <summary>
/// Gets or sets the dashboards listed in the manifest.
/// </summary>
public IReadOnlyList<ManifestDashboard> Dashboards { get; }
public IReadOnlyList<LegacyManifestDashboard> Dashboards { get; }

/// <summary>
/// Gets or sets the sections listed in the manifest.
/// </summary>
public IReadOnlyCollection<ManifestSection> Sections { get; }
public IReadOnlyCollection<LegacyManifestSection> Sections { get; }

public IReadOnlyDictionary<BundleOptions, IReadOnlyList<ManifestAssets>> Scripts { get; }
public IReadOnlyDictionary<BundleOptions, IReadOnlyList<LegacyManifestAssets>> Scripts { get; }

public IReadOnlyDictionary<BundleOptions, IReadOnlyList<ManifestAssets>> Stylesheets { get; }
public IReadOnlyDictionary<BundleOptions, IReadOnlyList<LegacyManifestAssets>> Stylesheets { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Umbraco.Cms.Core.Manifest;
/// <summary>
/// Provides filtering for package manifests.
/// </summary>
public interface IManifestFilter
public interface ILegacyManifestFilter
{
/// <summary>
/// Filters package manifests.
Expand All @@ -12,5 +12,5 @@ public interface IManifestFilter
/// <remarks>
/// <para>It is possible to remove, change, or add manifests.</para>
/// </remarks>
void Filter(List<PackageManifest> manifests);
void Filter(List<LegacyPackageManifest> manifests);
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
namespace Umbraco.Cms.Core.Manifest;

public interface IManifestParser
public interface ILegacyManifestParser
{
string AppPluginsPath { get; set; }

/// <summary>
/// Gets all manifests, merged into a single manifest object.
/// </summary>
/// <returns></returns>
CompositePackageManifest CombinedManifest { get; }
CompositeLegacyPackageManifest CombinedManifest { get; }

/// <summary>
/// Parses a manifest.
/// </summary>
PackageManifest ParseManifest(string text);
LegacyPackageManifest ParseManifest(string text);

/// <summary>
/// Returns all package individual manifests
/// </summary>
/// <returns></returns>
IEnumerable<PackageManifest> GetManifests();
IEnumerable<LegacyPackageManifest> GetManifests();
}
Loading

0 comments on commit d2ed03a

Please sign in to comment.