diff --git a/docs/consumption/nuget-publishing-map.md b/docs/consumption/nuget-publishing-map.md new file mode 100644 index 0000000..2ae05fc --- /dev/null +++ b/docs/consumption/nuget-publishing-map.md @@ -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. diff --git a/docs/consumption/semantic-versioning-policy.md b/docs/consumption/semantic-versioning-policy.md new file mode 100644 index 0000000..67d5d40 --- /dev/null +++ b/docs/consumption/semantic-versioning-policy.md @@ -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. diff --git a/src/Core.Blueprint.Common/Contracts/BlueprintPackageDescriptor.cs b/src/Core.Blueprint.Common/Contracts/BlueprintPackageDescriptor.cs new file mode 100644 index 0000000..15b30e5 --- /dev/null +++ b/src/Core.Blueprint.Common/Contracts/BlueprintPackageDescriptor.cs @@ -0,0 +1,12 @@ +namespace Core.Blueprint.Common.Contracts; + +/// +/// Describes package-level contract metadata for publishing and compatibility. +/// +/// Package identifier. +/// Default semantic version policy. +/// Required package dependencies. +public sealed record BlueprintPackageDescriptor( + string PackageId, + PackageVersionPolicy VersionPolicy, + IReadOnlyList DependencyPackageIds); diff --git a/src/Core.Blueprint.Common/Contracts/CommonPackageContract.cs b/src/Core.Blueprint.Common/Contracts/CommonPackageContract.cs new file mode 100644 index 0000000..d27f4ed --- /dev/null +++ b/src/Core.Blueprint.Common/Contracts/CommonPackageContract.cs @@ -0,0 +1,13 @@ +namespace Core.Blueprint.Common.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.Common. +/// +public sealed class CommonPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.Common", + PackageVersionPolicy.Minor, + []); +} diff --git a/src/Core.Blueprint.Common/Contracts/IBlueprintPackageContract.cs b/src/Core.Blueprint.Common/Contracts/IBlueprintPackageContract.cs new file mode 100644 index 0000000..3d66422 --- /dev/null +++ b/src/Core.Blueprint.Common/Contracts/IBlueprintPackageContract.cs @@ -0,0 +1,12 @@ +namespace Core.Blueprint.Common.Contracts; + +/// +/// Defines a package contract descriptor exposed for consumers and tooling. +/// +public interface IBlueprintPackageContract +{ + /// + /// Gets package descriptor metadata. + /// + BlueprintPackageDescriptor Descriptor { get; } +} diff --git a/src/Core.Blueprint.Common/Contracts/PackageVersionPolicy.cs b/src/Core.Blueprint.Common/Contracts/PackageVersionPolicy.cs new file mode 100644 index 0000000..fa91792 --- /dev/null +++ b/src/Core.Blueprint.Common/Contracts/PackageVersionPolicy.cs @@ -0,0 +1,22 @@ +namespace Core.Blueprint.Common.Contracts; + +/// +/// Defines semantic version increment policies for package changes. +/// +public enum PackageVersionPolicy +{ + /// + /// Increment patch version for backward-compatible fixes. + /// + Patch, + + /// + /// Increment minor version for backward-compatible contract additions. + /// + Minor, + + /// + /// Increment major version for breaking contract changes. + /// + Major +} diff --git a/src/Core.Blueprint.Common/Core.Blueprint.Common.csproj b/src/Core.Blueprint.Common/Core.Blueprint.Common.csproj index b760144..6c3a887 100644 --- a/src/Core.Blueprint.Common/Core.Blueprint.Common.csproj +++ b/src/Core.Blueprint.Common/Core.Blueprint.Common.csproj @@ -1,9 +1,7 @@ - - + net10.0 enable enable - diff --git a/src/Core.Blueprint.KeyVault/Contracts/KeyVaultPackageContract.cs b/src/Core.Blueprint.KeyVault/Contracts/KeyVaultPackageContract.cs new file mode 100644 index 0000000..b013d4f --- /dev/null +++ b/src/Core.Blueprint.KeyVault/Contracts/KeyVaultPackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.KeyVault.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.KeyVault. +/// +public sealed class KeyVaultPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.KeyVault", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.KeyVault/Core.Blueprint.KeyVault.csproj b/src/Core.Blueprint.KeyVault/Core.Blueprint.KeyVault.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.KeyVault/Core.Blueprint.KeyVault.csproj +++ b/src/Core.Blueprint.KeyVault/Core.Blueprint.KeyVault.csproj @@ -4,4 +4,7 @@ enable enable + + + diff --git a/src/Core.Blueprint.Logging/Contracts/LoggingPackageContract.cs b/src/Core.Blueprint.Logging/Contracts/LoggingPackageContract.cs new file mode 100644 index 0000000..241c632 --- /dev/null +++ b/src/Core.Blueprint.Logging/Contracts/LoggingPackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.Logging.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.Logging. +/// +public sealed class LoggingPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.Logging", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.Logging/Core.Blueprint.Logging.csproj b/src/Core.Blueprint.Logging/Core.Blueprint.Logging.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.Logging/Core.Blueprint.Logging.csproj +++ b/src/Core.Blueprint.Logging/Core.Blueprint.Logging.csproj @@ -4,4 +4,7 @@ enable enable + + + diff --git a/src/Core.Blueprint.Mongo/Contracts/MongoPackageContract.cs b/src/Core.Blueprint.Mongo/Contracts/MongoPackageContract.cs new file mode 100644 index 0000000..b2f0eba --- /dev/null +++ b/src/Core.Blueprint.Mongo/Contracts/MongoPackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.Mongo.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.Mongo. +/// +public sealed class MongoPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.Mongo", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.Mongo/Core.Blueprint.Mongo.csproj b/src/Core.Blueprint.Mongo/Core.Blueprint.Mongo.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.Mongo/Core.Blueprint.Mongo.csproj +++ b/src/Core.Blueprint.Mongo/Core.Blueprint.Mongo.csproj @@ -4,4 +4,7 @@ enable enable + + + diff --git a/src/Core.Blueprint.Redis/Contracts/RedisPackageContract.cs b/src/Core.Blueprint.Redis/Contracts/RedisPackageContract.cs new file mode 100644 index 0000000..58aeaaf --- /dev/null +++ b/src/Core.Blueprint.Redis/Contracts/RedisPackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.Redis.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.Redis. +/// +public sealed class RedisPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.Redis", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.Redis/Core.Blueprint.Redis.csproj b/src/Core.Blueprint.Redis/Core.Blueprint.Redis.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.Redis/Core.Blueprint.Redis.csproj +++ b/src/Core.Blueprint.Redis/Core.Blueprint.Redis.csproj @@ -4,4 +4,7 @@ enable enable + + + diff --git a/src/Core.Blueprint.SQLServer/Contracts/SqlServerPackageContract.cs b/src/Core.Blueprint.SQLServer/Contracts/SqlServerPackageContract.cs new file mode 100644 index 0000000..c5bfabf --- /dev/null +++ b/src/Core.Blueprint.SQLServer/Contracts/SqlServerPackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.SQLServer.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.SQLServer. +/// +public sealed class SqlServerPackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.SQLServer", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.SQLServer/Core.Blueprint.SQLServer.csproj b/src/Core.Blueprint.SQLServer/Core.Blueprint.SQLServer.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.SQLServer/Core.Blueprint.SQLServer.csproj +++ b/src/Core.Blueprint.SQLServer/Core.Blueprint.SQLServer.csproj @@ -4,4 +4,7 @@ enable enable + + + diff --git a/src/Core.Blueprint.Storage/Contracts/StoragePackageContract.cs b/src/Core.Blueprint.Storage/Contracts/StoragePackageContract.cs new file mode 100644 index 0000000..3c9a730 --- /dev/null +++ b/src/Core.Blueprint.Storage/Contracts/StoragePackageContract.cs @@ -0,0 +1,15 @@ +using Core.Blueprint.Common.Contracts; + +namespace Core.Blueprint.Storage.Contracts; + +/// +/// Defines package metadata contract for Core.Blueprint.Storage. +/// +public sealed class StoragePackageContract : IBlueprintPackageContract +{ + /// + public BlueprintPackageDescriptor Descriptor { get; } = new( + "Core.Blueprint.Storage", + PackageVersionPolicy.Minor, + ["Core.Blueprint.Common"]); +} diff --git a/src/Core.Blueprint.Storage/Core.Blueprint.Storage.csproj b/src/Core.Blueprint.Storage/Core.Blueprint.Storage.csproj index 6c3a887..86fc935 100644 --- a/src/Core.Blueprint.Storage/Core.Blueprint.Storage.csproj +++ b/src/Core.Blueprint.Storage/Core.Blueprint.Storage.csproj @@ -4,4 +4,7 @@ enable enable + + +