feat(platform): add package contract descriptors
- WHY: provide explicit package compatibility metadata for consumers - WHAT: add common contract descriptors and module package contracts - RULE: keep references internal to blueprint dependency boundaries
This commit is contained in:
parent
5e3daa4839
commit
281fdb375a
17
docs/consumption/nuget-publishing-map.md
Normal file
17
docs/consumption/nuget-publishing-map.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# NuGet Publishing Map
|
||||||
|
|
||||||
|
## Package Outputs
|
||||||
|
|
||||||
|
- Core.Blueprint.Common
|
||||||
|
- Core.Blueprint.Logging
|
||||||
|
- Core.Blueprint.Mongo
|
||||||
|
- Core.Blueprint.Redis
|
||||||
|
- Core.Blueprint.SQLServer
|
||||||
|
- Core.Blueprint.Storage
|
||||||
|
- Core.Blueprint.KeyVault
|
||||||
|
|
||||||
|
## Publishing Baseline
|
||||||
|
|
||||||
|
- Publish packages independently from this repository.
|
||||||
|
- Maintain explicit package dependency on `Core.Blueprint.Common` for all feature modules.
|
||||||
|
- Keep package identifiers stable to protect downstream compatibility.
|
||||||
13
docs/consumption/semantic-versioning-policy.md
Normal file
13
docs/consumption/semantic-versioning-policy.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Semantic Versioning Policy
|
||||||
|
|
||||||
|
## Default Policy
|
||||||
|
|
||||||
|
- Patch: backward-compatible fixes.
|
||||||
|
- Minor: backward-compatible contract additions.
|
||||||
|
- Major: breaking contract changes.
|
||||||
|
|
||||||
|
## Contract Compatibility
|
||||||
|
|
||||||
|
- Module package contracts are represented as descriptors implementing `IBlueprintPackageContract`.
|
||||||
|
- Consumer-impacting contract changes require version policy review before publish.
|
||||||
|
- Blueprint package contracts must remain identity-agnostic.
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
namespace Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Describes package-level contract metadata for publishing and compatibility.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="PackageId">Package identifier.</param>
|
||||||
|
/// <param name="VersionPolicy">Default semantic version policy.</param>
|
||||||
|
/// <param name="DependencyPackageIds">Required package dependencies.</param>
|
||||||
|
public sealed record BlueprintPackageDescriptor(
|
||||||
|
string PackageId,
|
||||||
|
PackageVersionPolicy VersionPolicy,
|
||||||
|
IReadOnlyList<string> DependencyPackageIds);
|
||||||
13
src/Core.Blueprint.Common/Contracts/CommonPackageContract.cs
Normal file
13
src/Core.Blueprint.Common/Contracts/CommonPackageContract.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.Common.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class CommonPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.Common",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
[]);
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
namespace Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines a package contract descriptor exposed for consumers and tooling.
|
||||||
|
/// </summary>
|
||||||
|
public interface IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Gets package descriptor metadata.
|
||||||
|
/// </summary>
|
||||||
|
BlueprintPackageDescriptor Descriptor { get; }
|
||||||
|
}
|
||||||
22
src/Core.Blueprint.Common/Contracts/PackageVersionPolicy.cs
Normal file
22
src/Core.Blueprint.Common/Contracts/PackageVersionPolicy.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
namespace Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines semantic version increment policies for package changes.
|
||||||
|
/// </summary>
|
||||||
|
public enum PackageVersionPolicy
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Increment patch version for backward-compatible fixes.
|
||||||
|
/// </summary>
|
||||||
|
Patch,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increment minor version for backward-compatible contract additions.
|
||||||
|
/// </summary>
|
||||||
|
Minor,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Increment major version for breaking contract changes.
|
||||||
|
/// </summary>
|
||||||
|
Major
|
||||||
|
}
|
||||||
@ -1,9 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.KeyVault.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.KeyVault.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class KeyVaultPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.KeyVault",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.Logging.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.Logging.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class LoggingPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.Logging",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
15
src/Core.Blueprint.Mongo/Contracts/MongoPackageContract.cs
Normal file
15
src/Core.Blueprint.Mongo/Contracts/MongoPackageContract.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.Mongo.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.Mongo.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class MongoPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.Mongo",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
15
src/Core.Blueprint.Redis/Contracts/RedisPackageContract.cs
Normal file
15
src/Core.Blueprint.Redis/Contracts/RedisPackageContract.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.Redis.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.Redis.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class RedisPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.Redis",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.SQLServer.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.SQLServer.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class SqlServerPackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.SQLServer",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -0,0 +1,15 @@
|
|||||||
|
using Core.Blueprint.Common.Contracts;
|
||||||
|
|
||||||
|
namespace Core.Blueprint.Storage.Contracts;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Defines package metadata contract for Core.Blueprint.Storage.
|
||||||
|
/// </summary>
|
||||||
|
public sealed class StoragePackageContract : IBlueprintPackageContract
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public BlueprintPackageDescriptor Descriptor { get; } = new(
|
||||||
|
"Core.Blueprint.Storage",
|
||||||
|
PackageVersionPolicy.Minor,
|
||||||
|
["Core.Blueprint.Common"]);
|
||||||
|
}
|
||||||
@ -4,4 +4,7 @@
|
|||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Core.Blueprint.Common\Core.Blueprint.Common.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user