From 4df3a2486b31806c27119c1d3fd1eb4cc243b676 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Thu, 7 Nov 2024 14:49:38 +0000 Subject: [PATCH] Rename project and namespace roots to PolyType. --- Makefile | 2 +- typeshape-csharp.sln => PolyType.sln | 20 +++--- README.md | 72 +++++++++---------- .../ConfigurationBinder.AOT.csproj | 6 +- .../ConfigurationBinder.AOT/Program.cs | 6 +- .../ObjectMapper.AOT/ObjectMapper.AOT.csproj | 6 +- applications/ObjectMapper.AOT/Program.cs | 6 +- .../RandomGeneratorApp.AOT/Program.cs | 6 +- .../RandomGeneratorApp.AOT.csproj | 6 +- applications/SerializationApp.AOT/Program.cs | 14 ++-- .../SerializationApp.AOT.csproj | 6 +- .../SerializationApp.Reflection/Program.cs | 16 ++--- .../SerializationApp.Reflection.csproj | 12 ++-- applications/ValidationApp.AOT/Program.cs | 4 +- .../ValidationApp.AOT.csproj | 6 +- docs/core-abstractions.md | 8 +-- docs/docfx.json | 8 +-- docs/index.md | 32 ++++----- ...eshape-providers.md => shape-providers.md} | 16 ++--- docs/toc.yml | 8 +-- src/Directory.Build.props | 4 +- .../CborSerializer/CborConverter.cs | 2 +- .../CborSerializer/CborSerializer.Builder.cs | 8 +-- .../CborSerializer/CborSerializer.cs | 6 +- .../Converters/CborDictionaryConverter.cs | 6 +- .../Converters/CborEnumConverter.cs | 2 +- .../Converters/CborEnumerableConverter.cs | 6 +- .../CborSerializer/Converters/CborHelpers.cs | 2 +- .../Converters/CborNullableConverter.cs | 2 +- .../Converters/CborObjectConverter.cs | 4 +- .../Converters/CborPropertyConverter.cs | 4 +- .../Converters/DelayedCborConverter.cs | 4 +- .../Converters/PrimitiveConverters.cs | 2 +- .../Cloner/Cloner.cs | 8 +-- .../ConfigurationBinder.cs | 8 +-- .../Counter/Counter.Builder.cs | 6 +- .../Counter/Counter.cs | 6 +- .../JsonSchema/JsonSchemaGenerator.cs | 4 +- .../Converters/DelayedJsonConverter.cs | 4 +- .../Converters/JsonDictionaryConverter.cs | 6 +- .../Converters/JsonEnumerableConverter.cs | 6 +- .../Converters/JsonNullableConverter.cs | 2 +- .../Converters/JsonObjectConverter.cs | 4 +- .../Converters/JsonPropertyConverter.cs | 4 +- .../Converters/JsonPropertyDictionary.cs | 4 +- .../Converters/JsonValueConverters.cs | 4 +- .../JsonSerializer/JsonHelpers.cs | 2 +- .../JsonSerializer/JsonSerializer.Builder.cs | 8 +-- .../JsonSerializer/JsonSerializer.cs | 6 +- .../ObjectMapper/Mapper.Builder.cs | 6 +- .../ObjectMapper/Mapper.cs | 8 +-- .../PolyType.Examples.csproj} | 3 +- .../PrettyPrinter/PrettyPrinter.Builder.cs | 6 +- .../PrettyPrinter/PrettyPrinter.cs | 6 +- .../README.md | 6 +- .../RandomGenerator.Builder.cs | 6 +- .../RandomGenerator/RandomGenerator.cs | 6 +- .../Comparers/DelayedComparer.cs | 4 +- .../Comparers/DictionaryEqualityComparer.cs | 2 +- .../Comparers/EnumerableEqualityComparer.cs | 2 +- .../Comparers/NullableEqualityComparer.cs | 2 +- .../Comparers/ObjectEqualityComparer.cs | 4 +- .../StructuralEqualityComparer.Builder.cs | 8 +-- .../StructuralEqualityComparer.cs | 6 +- .../Utilities/PooledList.cs | 2 +- .../Utilities/SpanDictionary.cs | 2 +- .../Utilities/SpanEqualityComparer.cs | 2 +- .../Utilities/TypeDictionary.cs | 4 +- .../Validation/ValidationAttributes.cs | 2 +- .../Validation/Validator.Builder.cs | 6 +- .../Validation/Validator.cs | 6 +- .../Converters/DelayedXmlConverter.cs | 4 +- .../Converters/PrimitiveConverters.cs | 2 +- .../Converters/XmlDictionaryConverter.cs | 6 +- .../Converters/XmlEnumConverter.cs | 2 +- .../Converters/XmlEnumerableConverter.cs | 6 +- .../XmlSerializer/Converters/XmlHelpers.cs | 2 +- .../Converters/XmlNullableConverter.cs | 2 +- .../Converters/XmlObjectConverter.cs | 4 +- .../Converters/XmlPropertyConverter.cs | 4 +- .../XmlSerializer/XmlConverter.cs | 2 +- .../XmlSerializer/XmlSerializer.Builder.cs | 8 +-- .../XmlSerializer/XmlSerializer.cs | 8 +-- .../Helpers/RoslynHelpers.cs | 2 +- .../IncrementalTypes/EquatableDiagnostic.cs | 4 +- .../ImmutableEquatableArray.cs | 2 +- .../ImmutableEquatableDictionary.cs | 2 +- .../IncrementalTypes/ImmutableEquatableSet.cs | 2 +- .../KnownSymbols.cs | 2 +- .../CollectionModelConstructionStrategy.cs | 2 +- .../Model/ConstructorDataModel.cs | 2 +- .../Model/ConstructorParameterDataModel.cs | 4 +- .../Model/DictionaryDataModel.cs | 2 +- .../Model/EnumDataModel.cs | 2 +- .../Model/EnumerableDataModel.cs | 2 +- .../Model/NullableDataModel.cs | 2 +- .../Model/ObjectDataModel.cs | 2 +- .../Model/PropertyDataModel.cs | 4 +- .../Model/TupleDataModel.cs | 2 +- .../Model/TypeDataKind.cs | 2 +- .../Model/TypeDataModel.cs | 2 +- .../TypeDataModelGenerationContext.cs | 2 +- .../TypeDataModelGenerationStatus.cs | 2 +- .../TypeDataModelGenerator.Dictionary.cs | 4 +- .../TypeDataModelGenerator.Enum.cs | 2 +- .../TypeDataModelGenerator.Enumerable.cs | 4 +- .../TypeDataModelGenerator.Nullable.cs | 2 +- .../TypeDataModelGenerator.Object.cs | 4 +- .../TypeDataModelGenerator.Tuple.cs | 4 +- .../ModelGenerator/TypeDataModelGenerator.cs | 4 +- .../PolyType.Roslyn.csproj} | 3 +- .../README.md | 2 +- .../SourceWriter.cs | 2 +- .../version.json | 0 .../RoslynHelpers.IncrementalValues.cs | 2 +- .../Helpers/RoslynHelpers.cs | 2 +- .../Model/CollectionConstructionStrategy.cs | 2 +- .../Model/ConstructorParameterShapeModel.cs | 2 +- .../Model/ConstructorShapeModel.cs | 4 +- .../Model/DictionaryShapeModel.cs | 4 +- .../Model/EnumShapeModel.cs | 2 +- .../Model/EnumerableShapeModel.cs | 4 +- .../Model/NullableShapeModel.cs | 2 +- .../Model/ObjectShapeModel.cs | 4 +- .../Model/PropertyShapeModel.cs | 2 +- .../Model/TypeDeclarationModel.cs | 4 +- .../Model/TypeId.cs | 2 +- .../Model/TypeShapeModel.cs | 4 +- .../Model/TypeShapeProviderModel.cs | 4 +- .../Parser/Parser.Diagnostics.cs | 20 +++--- .../Parser/Parser.ModelMapper.cs | 8 +-- .../Parser/Parser.cs | 12 ++-- .../PolyType.SourceGenerator.csproj} | 4 +- .../SourceFormatter.Constructors.cs | 18 ++--- .../SourceFormatter.Dictionary.cs | 16 ++--- .../SourceFormatter/SourceFormatter.Enum.cs | 10 +-- .../SourceFormatter.Enumerable.cs | 14 ++-- .../SourceFormatter.ITypeShapeProvider.cs | 26 +++---- .../SourceFormatter.Nullable.cs | 10 +-- .../SourceFormatter/SourceFormatter.Object.cs | 10 +-- .../SourceFormatter.Properties.cs | 12 ++-- .../SourceFormatter/SourceFormatter.Type.cs | 12 ++-- .../SourceFormatter/SourceFormatter.cs | 6 +- .../TypeShapeIncrementalGenerator.cs | 12 ++-- .../TypeShapeKnownSymbols.cs | 12 ++-- .../PolyType.TestCases.FSharp.fsproj} | 0 .../TestTypes.fs | 2 +- .../ITestCase.cs | 4 +- .../PolyType.TestCases.csproj} | 6 +- .../README.md | 4 +- .../ReflectionHelpers.cs | 0 .../TestCase.cs | 6 +- .../TestCaseOfT.cs | 4 +- .../TestTypes.cs | 6 +- .../CollectionConstructionStrategy.cs | 2 +- .../Abstractions/ConstructorParameterKind.cs | 2 +- .../Abstractions/Delegates.cs | 2 +- .../IConstructorParameterShape.cs | 2 +- .../Abstractions/IConstructorShape.cs | 2 +- .../Abstractions/IDictionaryTypeShape.cs | 2 +- .../Abstractions/IEnumTypeShape.cs | 2 +- .../Abstractions/IEnumerableTypeShape.cs | 2 +- .../Abstractions/INullableTypeShape.cs | 2 +- .../Abstractions/IObjectTypeShape.cs | 2 +- .../Abstractions/IPropertyShape.cs | 2 +- .../Abstractions/ITypeShape.cs | 2 +- .../Abstractions/ITypeShapeFunc.cs | 2 +- .../Abstractions/ITypeShapeVisitor.cs | 2 +- .../Abstractions/TypeShapeKind.cs | 2 +- .../Abstractions/TypeShapeProvider.cs | 4 +- .../Abstractions/TypeShapeVisitor.cs | 2 +- .../ConstructorShapeAttribute.cs | 2 +- .../GenerateShapeAttribute.cs | 6 +- src/{TypeShape => PolyType}/IShapeableOfT.cs | 6 +- .../ITypeShapeProvider.cs | 4 +- .../ParameterShapeAttribute.cs | 2 +- .../PolyType.csproj} | 5 +- .../PropertyShapeAttribute.cs | 2 +- src/{TypeShape => PolyType}/README.md | 14 ++-- .../Helpers/CommonHelpers.cs | 2 +- .../Helpers/ReflectionHelpers.cs | 2 +- .../IReflectionMemberAccessor.cs | 4 +- .../ReflectionEmitMemberAccessor.cs | 4 +- .../ReflectionMemberAccessor.cs | 4 +- .../ReflectionConstructorParameterShape.cs | 4 +- .../ReflectionConstructorShape.cs | 4 +- .../ReflectionDictionaryTypeShape.cs | 6 +- .../ReflectionEnumTypeShape.cs | 4 +- .../ReflectionEnumerableTypeShape.cs | 6 +- .../ReflectionNullableTypeShape.cs | 4 +- .../ReflectionObjectTypeShape.cs | 4 +- .../ReflectionPropertyShape.cs | 4 +- .../ReflectionTypeShapeProvider.cs | 10 +-- .../ReflectionTypeShapeProviderOptions.cs | 2 +- .../Helpers/CollectionHelpers.cs | 2 +- .../SourceGenConstructorParameterShape.cs | 4 +- .../SourceGenConstructorShape.cs | 4 +- .../SourceGenDictionaryTypeShape.cs | 4 +- .../SourceGenModel/SourceGenEnumTypeShape.cs | 4 +- .../SourceGenEnumerableTypeShape.cs | 4 +- .../SourceGenNullableTypeShape.cs | 4 +- .../SourceGenObjectTypeShape.cs | 4 +- .../SourceGenModel/SourceGenPropertyShape.cs | 4 +- .../Utilities/ReflectionUtilities.cs | 4 +- .../CounterBenchmark.cs | 6 +- .../JsonBenchmark.cs | 26 +++---- .../PolyType.Benchmarks.csproj} | 6 +- .../Program.cs | 0 .../CompilationHelpers.cs | 8 +-- .../CompilationTests.cs | 36 +++++----- .../DiagnosticTests.cs | 20 +++--- .../IncrementalCompilationTests.cs | 20 +++--- ...PolyType.SourceGenerator.UnitTests.csproj} | 4 +- .../CborTests.cs | 4 +- .../ClonerTests.cs | 8 +-- .../ConfigurationBinderTests.cs | 10 +-- .../CounterTests.cs | 4 +- .../IProviderUnderTest.cs | 6 +- .../JsonSchemaTests.cs | 8 +-- .../JsonTests.cs | 6 +- .../ObjectMapperTests.cs | 8 +-- .../PolyType.Tests.csproj} | 14 ++-- .../PrettyPrinterTests.cs | 8 +-- .../RandomGeneratorTests.cs | 8 +-- .../SourceGenProvider.cs | 2 +- .../StructuralEqualityTests.cs | 4 +- .../TypeShapeProviderTests.cs | 8 +-- .../ValidationTests.cs | 4 +- .../XmlTests.cs | 4 +- 229 files changed, 653 insertions(+), 656 deletions(-) rename typeshape-csharp.sln => PolyType.sln (86%) rename docs/{typeshape-providers.md => shape-providers.md} (83%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/CborConverter.cs (95%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/CborSerializer.Builder.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/CborSerializer.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborDictionaryConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborEnumConverter.cs (86%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborEnumerableConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborHelpers.cs (92%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborNullableConverter.cs (91%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborObjectConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/CborPropertyConverter.cs (96%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/DelayedCborConverter.cs (77%) rename src/{TypeShape.Examples => PolyType.Examples}/CborSerializer/Converters/PrimitiveConverters.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/Cloner/Cloner.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/ConfigurationBinder/ConfigurationBinder.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/Counter/Counter.Builder.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/Counter/Counter.cs (87%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSchema/JsonSchemaGenerator.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/DelayedJsonConverter.cs (90%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonDictionaryConverter.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonEnumerableConverter.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonNullableConverter.cs (93%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonObjectConverter.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonPropertyConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonPropertyDictionary.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/Converters/JsonValueConverters.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/JsonHelpers.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/JsonSerializer.Builder.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/JsonSerializer/JsonSerializer.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/ObjectMapper/Mapper.Builder.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/ObjectMapper/Mapper.cs (93%) rename src/{TypeShape.Examples/TypeShape.Examples.csproj => PolyType.Examples/PolyType.Examples.csproj} (84%) rename src/{TypeShape.Examples => PolyType.Examples}/PrettyPrinter/PrettyPrinter.Builder.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/PrettyPrinter/PrettyPrinter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/README.md (85%) rename src/{TypeShape.Examples => PolyType.Examples}/RandomGenerator/RandomGenerator.Builder.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/RandomGenerator/RandomGenerator.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/Comparers/DelayedComparer.cs (77%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/Comparers/DictionaryEqualityComparer.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/Comparers/EnumerableEqualityComparer.cs (93%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/Comparers/NullableEqualityComparer.cs (90%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/Comparers/ObjectEqualityComparer.cs (96%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/StructuralEqualityComparer.Builder.cs (95%) rename src/{TypeShape.Examples => PolyType.Examples}/StructuralEquality/StructuralEqualityComparer.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/Utilities/PooledList.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/Utilities/SpanDictionary.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/Utilities/SpanEqualityComparer.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/Utilities/TypeDictionary.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/Validation/ValidationAttributes.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/Validation/Validator.Builder.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/Validation/Validator.cs (96%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/DelayedXmlConverter.cs (78%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/PrimitiveConverters.cs (99%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlDictionaryConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlEnumConverter.cs (87%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlEnumerableConverter.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlHelpers.cs (95%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlNullableConverter.cs (91%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlObjectConverter.cs (98%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/Converters/XmlPropertyConverter.cs (96%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/XmlConverter.cs (95%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/XmlSerializer.Builder.cs (97%) rename src/{TypeShape.Examples => PolyType.Examples}/XmlSerializer/XmlSerializer.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Helpers/RoslynHelpers.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/IncrementalTypes/EquatableDiagnostic.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/IncrementalTypes/ImmutableEquatableArray.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/IncrementalTypes/ImmutableEquatableDictionary.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/IncrementalTypes/ImmutableEquatableSet.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/KnownSymbols.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/CollectionModelConstructionStrategy.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/ConstructorDataModel.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/ConstructorParameterDataModel.cs (93%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/DictionaryDataModel.cs (98%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/EnumDataModel.cs (93%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/EnumerableDataModel.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/NullableDataModel.cs (93%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/ObjectDataModel.cs (95%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/PropertyDataModel.cs (98%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/TupleDataModel.cs (95%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/TypeDataKind.cs (96%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/Model/TypeDataModel.cs (96%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerationContext.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerationStatus.cs (95%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Dictionary.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Enum.cs (96%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Enumerable.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Nullable.cs (97%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Object.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.Tuple.cs (98%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/ModelGenerator/TypeDataModelGenerator.cs (99%) rename src/{TypeShape.Roslyn/TypeShape.Roslyn.csproj => PolyType.Roslyn/PolyType.Roslyn.csproj} (78%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/README.md (85%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/SourceWriter.cs (99%) rename src/{TypeShape.Roslyn => PolyType.Roslyn}/version.json (100%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Helpers/RoslynHelpers.IncrementalValues.cs (99%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Helpers/RoslynHelpers.cs (99%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/CollectionConstructionStrategy.cs (80%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/ConstructorParameterShapeModel.cs (96%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/ConstructorShapeModel.cs (93%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/DictionaryShapeModel.cs (90%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/EnumShapeModel.cs (71%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/EnumerableShapeModel.cs (90%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/NullableShapeModel.cs (71%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/ObjectShapeModel.cs (84%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/PropertyShapeModel.cs (96%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/TypeDeclarationModel.cs (86%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/TypeId.cs (95%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/TypeShapeModel.cs (71%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Model/TypeShapeProviderModel.cs (85%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Parser/Parser.Diagnostics.cs (80%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Parser/Parser.ModelMapper.cs (99%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/Parser/Parser.cs (98%) rename src/{TypeShape.SourceGenerator/TypeShape.SourceGenerator.csproj => PolyType.SourceGenerator/PolyType.SourceGenerator.csproj} (69%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Constructors.cs (95%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Dictionary.cs (84%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Enum.cs (51%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Enumerable.cs (89%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs (65%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Nullable.cs (54%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Object.cs (88%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Properties.cs (94%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.Type.cs (86%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/SourceFormatter/SourceFormatter.cs (97%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/TypeShapeIncrementalGenerator.cs (89%) rename src/{TypeShape.SourceGenerator => PolyType.SourceGenerator}/TypeShapeKnownSymbols.cs (63%) rename src/{TypeShape.TestCases.FSharp/TypeShape.TestCases.FSharp.fsproj => PolyType.TestCases.FSharp/PolyType.TestCases.FSharp.fsproj} (100%) rename src/{TypeShape.TestCases.FSharp => PolyType.TestCases.FSharp}/TestTypes.fs (97%) rename src/{TypeShape.TestCases => PolyType.TestCases}/ITestCase.cs (97%) rename src/{TypeShape.TestCases/TypeShape.TestCases.csproj => PolyType.TestCases/PolyType.TestCases.csproj} (70%) rename src/{TypeShape.TestCases => PolyType.TestCases}/README.md (92%) rename src/{TypeShape.TestCases => PolyType.TestCases}/ReflectionHelpers.cs (100%) rename src/{TypeShape.TestCases => PolyType.TestCases}/TestCase.cs (97%) rename src/{TypeShape.TestCases => PolyType.TestCases}/TestCaseOfT.cs (98%) rename src/{TypeShape.TestCases => PolyType.TestCases}/TestTypes.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/CollectionConstructionStrategy.cs (95%) rename src/{TypeShape => PolyType}/Abstractions/ConstructorParameterKind.cs (92%) rename src/{TypeShape => PolyType}/Abstractions/Delegates.cs (98%) rename src/{TypeShape => PolyType}/Abstractions/IConstructorParameterShape.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/IConstructorShape.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/IDictionaryTypeShape.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/IEnumTypeShape.cs (96%) rename src/{TypeShape => PolyType}/Abstractions/IEnumerableTypeShape.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/INullableTypeShape.cs (96%) rename src/{TypeShape => PolyType}/Abstractions/IObjectTypeShape.cs (98%) rename src/{TypeShape => PolyType}/Abstractions/IPropertyShape.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/ITypeShape.cs (98%) rename src/{TypeShape => PolyType}/Abstractions/ITypeShapeFunc.cs (95%) rename src/{TypeShape => PolyType}/Abstractions/ITypeShapeVisitor.cs (99%) rename src/{TypeShape => PolyType}/Abstractions/TypeShapeKind.cs (95%) rename src/{TypeShape => PolyType}/Abstractions/TypeShapeProvider.cs (94%) rename src/{TypeShape => PolyType}/Abstractions/TypeShapeVisitor.cs (99%) rename src/{TypeShape => PolyType}/ConstructorShapeAttribute.cs (91%) rename src/{TypeShape => PolyType}/GenerateShapeAttribute.cs (80%) rename src/{TypeShape => PolyType}/IShapeableOfT.cs (74%) rename src/{TypeShape => PolyType}/ITypeShapeProvider.cs (91%) rename src/{TypeShape => PolyType}/ParameterShapeAttribute.cs (94%) rename src/{TypeShape/TypeShape.csproj => PolyType/PolyType.csproj} (65%) rename src/{TypeShape => PolyType}/PropertyShapeAttribute.cs (96%) rename src/{TypeShape => PolyType}/README.md (71%) rename src/{TypeShape => PolyType}/ReflectionProvider/Helpers/CommonHelpers.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/Helpers/ReflectionHelpers.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs (94%) rename src/{TypeShape => PolyType}/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionConstructorParameterShape.cs (98%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionConstructorShape.cs (98%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionDictionaryTypeShape.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionEnumTypeShape.cs (81%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionEnumerableTypeShape.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionNullableTypeShape.cs (77%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionObjectTypeShape.cs (99%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionPropertyShape.cs (98%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionTypeShapeProvider.cs (97%) rename src/{TypeShape => PolyType}/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs (96%) rename src/{TypeShape => PolyType}/SourceGenModel/Helpers/CollectionHelpers.cs (99%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenConstructorParameterShape.cs (97%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenConstructorShape.cs (97%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenDictionaryTypeShape.cs (97%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenEnumTypeShape.cs (90%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenEnumerableTypeShape.cs (97%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenNullableTypeShape.cs (88%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenObjectTypeShape.cs (95%) rename src/{TypeShape => PolyType}/SourceGenModel/SourceGenPropertyShape.cs (97%) rename src/{TypeShape => PolyType}/Utilities/ReflectionUtilities.cs (95%) rename tests/{TypeShape.Benchmarks => PolyType.Benchmarks}/CounterBenchmark.cs (95%) rename tests/{TypeShape.Benchmarks => PolyType.Benchmarks}/JsonBenchmark.cs (78%) rename tests/{TypeShape.Benchmarks/TypeShape.Benchmarks.csproj => PolyType.Benchmarks/PolyType.Benchmarks.csproj} (64%) rename tests/{TypeShape.Benchmarks => PolyType.Benchmarks}/Program.cs (100%) rename tests/{TypeShape.SourceGenerator.UnitTests => PolyType.SourceGenerator.UnitTests}/CompilationHelpers.cs (97%) rename tests/{TypeShape.SourceGenerator.UnitTests => PolyType.SourceGenerator.UnitTests}/CompilationTests.cs (93%) rename tests/{TypeShape.SourceGenerator.UnitTests => PolyType.SourceGenerator.UnitTests}/DiagnosticTests.cs (96%) rename tests/{TypeShape.SourceGenerator.UnitTests => PolyType.SourceGenerator.UnitTests}/IncrementalCompilationTests.cs (92%) rename tests/{TypeShape.SourceGenerator.UnitTests/TypeShape.SourceGenerator.UnitTests.csproj => PolyType.SourceGenerator.UnitTests/PolyType.SourceGenerator.UnitTests.csproj} (88%) rename tests/{TypeShape.Tests => PolyType.Tests}/CborTests.cs (98%) rename tests/{TypeShape.Tests => PolyType.Tests}/ClonerTests.cs (92%) rename tests/{TypeShape.Tests => PolyType.Tests}/ConfigurationBinderTests.cs (92%) rename tests/{TypeShape.Tests => PolyType.Tests}/CounterTests.cs (97%) rename tests/{TypeShape.Tests => PolyType.Tests}/IProviderUnderTest.cs (96%) rename tests/{TypeShape.Tests => PolyType.Tests}/JsonSchemaTests.cs (97%) rename tests/{TypeShape.Tests => PolyType.Tests}/JsonTests.cs (99%) rename tests/{TypeShape.Tests => PolyType.Tests}/ObjectMapperTests.cs (96%) rename tests/{TypeShape.Tests/TypeShape.Tests.csproj => PolyType.Tests/PolyType.Tests.csproj} (59%) rename tests/{TypeShape.Tests => PolyType.Tests}/PrettyPrinterTests.cs (96%) rename tests/{TypeShape.Tests => PolyType.Tests}/RandomGeneratorTests.cs (90%) rename tests/{TypeShape.Tests => PolyType.Tests}/SourceGenProvider.cs (98%) rename tests/{TypeShape.Tests => PolyType.Tests}/StructuralEqualityTests.cs (98%) rename tests/{TypeShape.Tests => PolyType.Tests}/TypeShapeProviderTests.cs (99%) rename tests/{TypeShape.Tests => PolyType.Tests}/ValidationTests.cs (98%) rename tests/{TypeShape.Tests => PolyType.Tests}/XmlTests.cs (98%) diff --git a/Makefile b/Makefile index 0b44cc6..5f8d76c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ NUGET_SOURCE ?= "https://api.nuget.org/v3/index.json" NUGET_API_KEY ?= "" ADDITIONAL_ARGS ?= -p:ContinuousIntegrationBuild=true CODECOV_ARGS ?= --collect:"XPlat Code Coverage" --results-directory $(ARTIFACT_PATH) -DOCKER_IMAGE_NAME ?= "typeshape-docker-build" +DOCKER_IMAGE_NAME ?= "polytype-docker-build" DOCKER_CMD ?= make CONFIGURATION=$(CONFIGURATION) clean: diff --git a/typeshape-csharp.sln b/PolyType.sln similarity index 86% rename from typeshape-csharp.sln rename to PolyType.sln index d33385a..61357da 100644 --- a/typeshape-csharp.sln +++ b/PolyType.sln @@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.12.35323.107 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape", "src\TypeShape\TypeShape.csproj", "{C1D31D26-9A35-4E88-8014-20D600B08306}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType", "src\PolyType\PolyType.csproj", "{C1D31D26-9A35-4E88-8014-20D600B08306}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.Examples", "src\TypeShape.Examples\TypeShape.Examples.csproj", "{62A5D47E-C7A8-43B1-8B11-7B964AE14504}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.Examples", "src\PolyType.Examples\PolyType.Examples.csproj", "{62A5D47E-C7A8-43B1-8B11-7B964AE14504}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SerializationApp.Reflection", "applications\SerializationApp.Reflection\SerializationApp.Reflection.csproj", "{FD0477BD-155D-4E06-9563-5D1F88ECE067}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.Roslyn", "src\TypeShape.Roslyn\TypeShape.Roslyn.csproj", "{9B4627DE-9185-4050-82E2-EE8341003A4E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.Roslyn", "src\PolyType.Roslyn\PolyType.Roslyn.csproj", "{9B4627DE-9185-4050-82E2-EE8341003A4E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.SourceGenerator", "src\TypeShape.SourceGenerator\TypeShape.SourceGenerator.csproj", "{3BE34E78-92CC-4931-9C83-6BF2FF4B02EB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.SourceGenerator", "src\PolyType.SourceGenerator\PolyType.SourceGenerator.csproj", "{3BE34E78-92CC-4931-9C83-6BF2FF4B02EB}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConfigurationBinder.AOT", "applications\ConfigurationBinder.AOT\ConfigurationBinder.AOT.csproj", "{6BDF614A-7D1B-4AA9-8E4E-BAA993771ED1}" EndProject @@ -23,11 +23,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SerializationApp.AOT", "app EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ValidationApp.AOT", "applications\ValidationApp.AOT\ValidationApp.AOT.csproj", "{74D6B54A-294D-4FA4-927A-DA3577393859}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.Benchmarks", "tests\TypeShape.Benchmarks\TypeShape.Benchmarks.csproj", "{07EB616A-9393-4C5B-9E3F-E0607FC6009D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.Benchmarks", "tests\PolyType.Benchmarks\PolyType.Benchmarks.csproj", "{07EB616A-9393-4C5B-9E3F-E0607FC6009D}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.SourceGenerator.UnitTests", "tests\TypeShape.SourceGenerator.UnitTests\TypeShape.SourceGenerator.UnitTests.csproj", "{DF05A2E3-4C68-46C9-8CBA-E263CC3F10F8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.SourceGenerator.UnitTests", "tests\PolyType.SourceGenerator.UnitTests\PolyType.SourceGenerator.UnitTests.csproj", "{DF05A2E3-4C68-46C9-8CBA-E263CC3F10F8}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeShape.Tests", "tests\TypeShape.Tests\TypeShape.Tests.csproj", "{EAABC384-65E6-404B-AA30-12EF559A0545}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PolyType.Tests", "tests\PolyType.Tests\PolyType.Tests.csproj", "{EAABC384-65E6-404B-AA30-12EF559A0545}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{E712CC73-2B97-4F4C-840D-4C82F5C07936}" EndProject @@ -61,8 +61,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B036DAA9-D docs\core-abstractions.md = docs\core-abstractions.md docs\docfx.json = docs\docfx.json docs\index.md = docs\index.md + docs\shape-providers.md = docs\shape-providers.md docs\toc.yml = docs\toc.yml - docs\typeshape-providers.md = docs\typeshape-providers.md EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F2C95E2E-AED7-46E4-A93E-831FA658BD2B}" @@ -72,9 +72,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F2C95E2E-AED EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1EAD80C8-8E21-4173-9438-67CE9A7A3292}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypeShape.TestCases", "src\TypeShape.TestCases\TypeShape.TestCases.csproj", "{9C5EE30D-663C-42FF-B0B0-A7C240FF0BEE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PolyType.TestCases", "src\PolyType.TestCases\PolyType.TestCases.csproj", "{9C5EE30D-663C-42FF-B0B0-A7C240FF0BEE}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TypeShape.TestCases.FSharp", "src\TypeShape.TestCases.FSharp\TypeShape.TestCases.FSharp.fsproj", "{7BC73596-FF6B-5933-D061-4E651B15B43E}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "PolyType.TestCases.FSharp", "src\PolyType.TestCases.FSharp\PolyType.TestCases.FSharp.fsproj", "{7BC73596-FF6B-5933-D061-4E651B15B43E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/README.md b/README.md index 465da48..1aef70a 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,36 @@ -# typeshape-csharp [![Build & Tests](https://github.com/eiriktsarpalis/typeshape-csharp/actions/workflows/build.yml/badge.svg)](https://github.com/eiriktsarpalis/typeshape-csharp/actions/workflows/build.yml) [![NuGet Badge](https://img.shields.io/nuget/dt/typeshape-csharp)](https://www.nuget.org/packages/typeshape-csharp/) +# PolyType [![Build & Tests](https://github.com/eiriktsarpalis/PolyType/actions/workflows/build.yml/badge.svg)](https://github.com/eiriktsarpalis/PolyType/actions/workflows/build.yml) [![NuGet Badge](https://img.shields.io/nuget/dt/PolyType)](https://www.nuget.org/packages/PolyType/) -`typeshape-csharp` is a practical datatype-generic programming library for .NET types. It is a port of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) F# library, adapted to patterns and idioms available in C#. See the [project website](https://eiriktsarpalis.github.io/typeshape-csharp) for additional background and [API documentation](https://eiriktsarpalis.github.io/typeshape-csharp/api/TypeShape.html). +`PolyType` is a practical datatype-generic programming library for .NET types. It is an adaptation of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) library for F#, adapted to patterns and idioms available in C#. See the [project website](https://eiriktsarpalis.github.io/PolyType) for additional background and [API documentation](https://eiriktsarpalis.github.io/PolyType/api/PolyType.html). ## Quick Start -You can try the library by installing the `typeshape-csharp` NuGet package: +You can try the library by installing the `PolyType` NuGet package: ```bash -$ dotnet add package typeshape-csharp +$ dotnet add package PolyType ``` which includes the core types and source generator for generating type shapes: ```C# -using TypeShape; +using PolyType; [GenerateShape] public partial record Person(string name, int age); ``` -Doing this will augment `Person` with an implementation of the `IShapeable` interface. This suffices to make `Person` usable with any library that targets the TypeShape core abstractions. You can try this out by installing the built-in example libraries: +Doing this will augment `Person` with an implementation of the `IShapeable` interface. This suffices to make `Person` usable with any library that targets the PolyType core abstractions. You can try this out by installing the built-in example libraries: ```bash -$ dotnet add package TypeShape.Examples +$ dotnet add package PolyType.Examples ``` Here's how the same value can be serialized to three separate formats. ```csharp -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.CborSerializer; -using TypeShape.Examples.XmlSerializer; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.CborSerializer; +using PolyType.Examples.XmlSerializer; Person person = new("Pete", 70); JsonSerializerTS.Serialize(person); // {"Name":"Pete","Age":70} @@ -38,13 +38,13 @@ XmlSerializer.Serialize(person); // Pete70(format); // Compiles @@ -64,18 +64,18 @@ partial record Person(string name, int age, List children); For more information see: -* The [core abstractions](https://eiriktsarpalis.github.io/typeshape-csharp/core-abstractions.html) document for an overview of the core programming model. -* The [typeshape providers](https://eiriktsarpalis.github.io/typeshape-csharp/typeshape-providers.html) document for an overview of the built-in shape providers and their APIs. -* The generated [API documentation](https://eiriktsarpalis.github.io/typeshape-csharp/api/TypeShape.html) for the project. -* The [`TypeShape.Examples`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Examples) project for advanced examples of libraries built on top of TypeShape. +* The [core abstractions](https://eiriktsarpalis.github.io/PolyType/core-abstractions.html) document for an overview of the core programming model. +* The [shape providers](https://eiriktsarpalis.github.io/PolyType/shape-providers.html) document for an overview of the built-in shape providers and their APIs. +* The generated [API documentation](https://eiriktsarpalis.github.io/PolyType/api/PolyType.html) for the project. +* The [`PolyType.Examples`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Examples) project for advanced examples of libraries built on top of PolyType. ## Case Study: Writing a JSON serializer -The repo includes a [JSON serializer](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Examples/JsonSerializer) built on top of the `Utf8JsonWriter`/`Utf8JsonReader` primitives provided by System.Text.Json. At the time of writing, the full implementation is just under 1200 lines of code but exceeds STJ's built-in `JsonSerializer` both in terms of [supported types](https://github.com/eiriktsarpalis/typeshape-csharp/blob/main/tests/TypeShape.Tests/JsonTests.cs) and performance. +The repo includes a [JSON serializer](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Examples/JsonSerializer) built on top of the `Utf8JsonWriter`/`Utf8JsonReader` primitives provided by System.Text.Json. At the time of writing, the full implementation is just under 1200 lines of code but exceeds STJ's built-in `JsonSerializer` both in terms of [supported types](https://github.com/eiriktsarpalis/PolyType/blob/main/tests/PolyType.Tests/JsonTests.cs) and performance. ### Performance -Here's a [benchmark](https://github.com/eiriktsarpalis/typeshape-csharp/blob/main/tests/TypeShape.Benchmarks/JsonBenchmark.cs) comparing `System.Text.Json` with the included TypeShape-derived implementation: +Here's a [benchmark](https://github.com/eiriktsarpalis/PolyType/blob/main/tests/PolyType.Benchmarks/JsonBenchmark.cs) comparing `System.Text.Json` with the included PolyType implementation: #### Serialization @@ -84,8 +84,8 @@ Here's a [benchmark](https://github.com/eiriktsarpalis/typeshape-csharp/blob/mai | Serialize_StjReflection | 491.9 ns | 1.00 | 312 B | 1.00 | | Serialize_StjSourceGen | 467.0 ns | 0.95 | 312 B | 1.00 | | Serialize_StjSourceGen_FastPath | 227.2 ns | 0.46 | - | 0.00 | -| Serialize_TypeShapeReflection | 277.9 ns | 0.57 | - | 0.00 | -| Serialize_TypeShapeSourceGen | 273.6 ns | 0.56 | - | 0.00 | +| Serialize_PolyTypeReflection | 277.9 ns | 0.57 | - | 0.00 | +| Serialize_PolyTypeSourceGen | 273.6 ns | 0.56 | - | 0.00 | #### Deserialization @@ -93,28 +93,28 @@ Here's a [benchmark](https://github.com/eiriktsarpalis/typeshape-csharp/blob/mai |-------------------------------- |-----------:|------:|----------:|------------:| | Deserialize_StjReflection | 1,593.0 ns | 1.00 | 1024 B | 1.00 | | Deserialize_StjSourceGen | 1,530.3 ns | 0.96 | 1000 B | 0.98 | -| Deserialize_TypeShapeReflection | 773.1 ns | 0.49 | 440 B | 0.43 | -| Deserialize_TypeShapeSourceGen | 746.7 ns | 0.47 | 440 B | 0.43 | +| Deserialize_PolyTypeReflection | 773.1 ns | 0.49 | 440 B | 0.43 | +| Deserialize_PolyTypeSourceGen | 746.7 ns | 0.47 | 440 B | 0.43 | -Even though both serializers target the same underlying reader and writer types, the TypeShape implementation is ~75% faster for serialization and ~100% faster for deserialization, when compared with System.Text.Json's metadata serializer. As expected, fast-path serialization is still fastest since its implementation is fully inlined. +Even though both serializers target the same underlying reader and writer types, the PolyType implementation is ~75% faster for serialization and ~100% faster for deserialization, when compared with System.Text.Json's metadata serializer. As expected, fast-path serialization is still fastest since its implementation is fully inlined. -## Known libraries based on TypeShape +## Known libraries based on PolyType -The following codebases are based upon TypeShape and may be worth checking out. +The following code bases are based upon PolyType and may be worth checking out. -- [Nerdbank.MessagePack](https://github.com/AArnott/Nerdbank.MessagePack) - a MessagePack library with performance to rival MessagePack-CSharp, and greater simplicity and additional features. +* [Nerdbank.MessagePack](https://github.com/AArnott/Nerdbank.MessagePack) - a MessagePack library with performance to rival MessagePack-CSharp, and greater simplicity and additional features. ## Project structure The repo consists of the following projects: -* The core `TypeShape` library containing: - * The [core abstractions](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape/Abstractions) defining the type model. - * The [reflection provider](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape/ReflectionProvider) implementation. - * The [model classes](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape/SourceGenModel) used by the source generator. -* The [`TypeShape.SourceGenerator`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.SourceGenerator) project contains the built-in source generator implementation. -* The [`TypeShape.Roslyn`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Roslyn) library exposes a set of components for extracting data models from Roslyn type symbols. Used as the foundation for the built-in source generator. -* [`TypeShape.Examples`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Examples) containing library examples: +* The core `PolyType` library containing: + * The [core abstractions](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType/Abstractions) defining the type model. + * The [reflection provider](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType/ReflectionProvider) implementation. + * The [model classes](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType/SourceGenModel) used by the source generator. +* The [`PolyType.SourceGenerator`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.SourceGenerator) project contains the built-in source generator implementation. +* The [`PolyType.Roslyn`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Roslyn) library exposes a set of components for extracting data models from Roslyn type symbols. Used as the foundation for the built-in source generator. +* [`PolyType.Examples`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Examples) containing library examples: * A serializer built on top of System.Text.Json, * A serializer built on top of System.Xml, * A serializer built on top of System.Formats.Cbor, @@ -126,4 +126,4 @@ The repo consists of the following projects: * A structural `IEqualityComparer` generator for POCOs and collections, * An object validator in the style of System.ComponentModel.DataAnnotations. * A simple .NET object mapper. -* The [`applications`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/applications) folder contains sample Native AOT console applications. +* The [`applications`](https://github.com/eiriktsarpalis/PolyType/tree/main/applications) folder contains sample Native AOT console applications. diff --git a/applications/ConfigurationBinder.AOT/ConfigurationBinder.AOT.csproj b/applications/ConfigurationBinder.AOT/ConfigurationBinder.AOT.csproj index 0393bb4..5d6e522 100644 --- a/applications/ConfigurationBinder.AOT/ConfigurationBinder.AOT.csproj +++ b/applications/ConfigurationBinder.AOT/ConfigurationBinder.AOT.csproj @@ -15,9 +15,9 @@ - - - + + + diff --git a/applications/ConfigurationBinder.AOT/Program.cs b/applications/ConfigurationBinder.AOT/Program.cs index cb5449e..8d80bfe 100644 --- a/applications/ConfigurationBinder.AOT/Program.cs +++ b/applications/ConfigurationBinder.AOT/Program.cs @@ -1,8 +1,8 @@ using System.Collections.Immutable; using Microsoft.Extensions.Configuration; -using TypeShape; -using TypeShape.Examples.ConfigurationBinder; -using TypeShape.Examples.PrettyPrinter; +using PolyType; +using PolyType.Examples.ConfigurationBinder; +using PolyType.Examples.PrettyPrinter; IConfigurationRoot configuration = new ConfigurationBuilder() .SetBasePath(AppContext.BaseDirectory) diff --git a/applications/ObjectMapper.AOT/ObjectMapper.AOT.csproj b/applications/ObjectMapper.AOT/ObjectMapper.AOT.csproj index 3397d78..0fc5aa8 100644 --- a/applications/ObjectMapper.AOT/ObjectMapper.AOT.csproj +++ b/applications/ObjectMapper.AOT/ObjectMapper.AOT.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/applications/ObjectMapper.AOT/Program.cs b/applications/ObjectMapper.AOT/Program.cs index 0fa440e..f641bbd 100644 --- a/applications/ObjectMapper.AOT/Program.cs +++ b/applications/ObjectMapper.AOT/Program.cs @@ -1,6 +1,6 @@ -using TypeShape; -using TypeShape.Examples.ObjectMapper; -using TypeShape.Examples.PrettyPrinter; +using PolyType; +using PolyType.Examples.ObjectMapper; +using PolyType.Examples.PrettyPrinter; var weatherForecastDto = new WeatherForecastDTO { diff --git a/applications/RandomGeneratorApp.AOT/Program.cs b/applications/RandomGeneratorApp.AOT/Program.cs index 94d5f1c..7e6d2ca 100644 --- a/applications/RandomGeneratorApp.AOT/Program.cs +++ b/applications/RandomGeneratorApp.AOT/Program.cs @@ -1,6 +1,6 @@ -using TypeShape; -using TypeShape.Examples.PrettyPrinter; -using TypeShape.Examples.RandomGenerator; +using PolyType; +using PolyType.Examples.PrettyPrinter; +using PolyType.Examples.RandomGenerator; foreach (MeasurementData data in RandomGenerator.GenerateValues()) { diff --git a/applications/RandomGeneratorApp.AOT/RandomGeneratorApp.AOT.csproj b/applications/RandomGeneratorApp.AOT/RandomGeneratorApp.AOT.csproj index 3397d78..0fc5aa8 100644 --- a/applications/RandomGeneratorApp.AOT/RandomGeneratorApp.AOT.csproj +++ b/applications/RandomGeneratorApp.AOT/RandomGeneratorApp.AOT.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/applications/SerializationApp.AOT/Program.cs b/applications/SerializationApp.AOT/Program.cs index 4ea9752..cbca0e4 100644 --- a/applications/SerializationApp.AOT/Program.cs +++ b/applications/SerializationApp.AOT/Program.cs @@ -1,10 +1,10 @@ -using TypeShape; -using TypeShape.Examples.CborSerializer; -using TypeShape.Examples.JsonSchema; -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.PrettyPrinter; -using TypeShape.Examples.StructuralEquality; -using TypeShape.Examples.XmlSerializer; +using PolyType; +using PolyType.Examples.CborSerializer; +using PolyType.Examples.JsonSchema; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.PrettyPrinter; +using PolyType.Examples.StructuralEquality; +using PolyType.Examples.XmlSerializer; DateOnly today = DateOnly.FromDateTime(DateTime.Now); Todos originalValue = new( diff --git a/applications/SerializationApp.AOT/SerializationApp.AOT.csproj b/applications/SerializationApp.AOT/SerializationApp.AOT.csproj index e782aea..b2cbac3 100644 --- a/applications/SerializationApp.AOT/SerializationApp.AOT.csproj +++ b/applications/SerializationApp.AOT/SerializationApp.AOT.csproj @@ -15,9 +15,9 @@ - - - + + + \ No newline at end of file diff --git a/applications/SerializationApp.Reflection/Program.cs b/applications/SerializationApp.Reflection/Program.cs index c76057b..191174f 100644 --- a/applications/SerializationApp.Reflection/Program.cs +++ b/applications/SerializationApp.Reflection/Program.cs @@ -1,12 +1,12 @@ using System.Text.Json.Serialization; -using TypeShape; -using TypeShape.Examples.CborSerializer; -using TypeShape.Examples.JsonSchema; -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.PrettyPrinter; -using TypeShape.Examples.StructuralEquality; -using TypeShape.Examples.XmlSerializer; -using TypeShape.ReflectionProvider; +using PolyType; +using PolyType.Examples.CborSerializer; +using PolyType.Examples.JsonSchema; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.PrettyPrinter; +using PolyType.Examples.StructuralEquality; +using PolyType.Examples.XmlSerializer; +using PolyType.ReflectionProvider; // Use reflection to derive the shape for BindingModel and use it to fold // serialization, pretty printing, CBOR encoding and validation programs. diff --git a/applications/SerializationApp.Reflection/SerializationApp.Reflection.csproj b/applications/SerializationApp.Reflection/SerializationApp.Reflection.csproj index be3e7b9..c4105e7 100644 --- a/applications/SerializationApp.Reflection/SerializationApp.Reflection.csproj +++ b/applications/SerializationApp.Reflection/SerializationApp.Reflection.csproj @@ -4,15 +4,15 @@ Exe net8.0 enable - enable - Nullable - True - true + enable + Nullable + True + true - - + + diff --git a/applications/ValidationApp.AOT/Program.cs b/applications/ValidationApp.AOT/Program.cs index 9e3b6f6..c4ab9c2 100644 --- a/applications/ValidationApp.AOT/Program.cs +++ b/applications/ValidationApp.AOT/Program.cs @@ -1,5 +1,5 @@ -using TypeShape; -using TypeShape.Examples.Validation; +using PolyType; +using PolyType.Examples.Validation; var validInstance = new BindingModel { diff --git a/applications/ValidationApp.AOT/ValidationApp.AOT.csproj b/applications/ValidationApp.AOT/ValidationApp.AOT.csproj index 3397d78..0fc5aa8 100644 --- a/applications/ValidationApp.AOT/ValidationApp.AOT.csproj +++ b/applications/ValidationApp.AOT/ValidationApp.AOT.csproj @@ -12,9 +12,9 @@ - - - + + + diff --git a/docs/core-abstractions.md b/docs/core-abstractions.md index b09aa1f..067973a 100644 --- a/docs/core-abstractions.md +++ b/docs/core-abstractions.md @@ -1,6 +1,6 @@ # Core Abstractions -This document provides a walkthrough the core type abstractions found in TypeShape. This includes `ITypeShape`, `IPropertyShape` and the visitor types for accessing them. These are typically consumed by library authors looking to build datatype-generic components. Unless otherwise stated, all APIs are found in the `TypeShape.Abstractions` namespace. +This document provides a walkthrough the core type abstractions found in PolyType. This includes `ITypeShape`, `IPropertyShape` and the visitor types for accessing them. These are typically consumed by library authors looking to build datatype-generic components. Unless otherwise stated, all APIs are found in the `PolyType.Abstractions` namespace. ## The `ITypeShape` interface @@ -9,7 +9,7 @@ The `ITypeShape` interface defines a reflection-like representation for a given To illustrate the idea, consider the following APIs modelling objects with properties: ```C# -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; public partial interface IObjectTypeShape : ITypeShape { @@ -290,7 +290,7 @@ struct MyPoco ### Constructor shapes -While property setters should suffice when mutating existing objects, constructing a new instance from scratch is somewhat more complicated, particularly for types that only expose parameterized constructors or are immutable. TypeShape models constructors using the `IConstructorShape` abstraction which can be obtained as follows: +While property setters should suffice when mutating existing objects, constructing a new instance from scratch is somewhat more complicated, particularly for types that only expose parameterized constructors or are immutable. PolyType models constructors using the `IConstructorShape` abstraction which can be obtained as follows: ```C# public partial interface IObjectTypeShape @@ -489,4 +489,4 @@ class EmptyConstructorVisitor : TypeShapeVisitor } ``` -This concludes the tutorial for the core TypeShape programming model. For more detailed examples, please refer to the [`TypeShape.Examples`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Examples) project folder. +This concludes the tutorial for the core PolyType programming model. For more detailed examples, please refer to the [`PolyType.Examples`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Examples) project folder. diff --git a/docs/docfx.json b/docs/docfx.json index 5fd393e..ae7ce9e 100644 --- a/docs/docfx.json +++ b/docs/docfx.json @@ -5,8 +5,8 @@ { "src": "../src", "files": [ - "**/TypeShape.csproj", - "**/TypeShape.Roslyn.csproj" + "**/PolyType.csproj", + "**/PolyType.Roslyn.csproj" ] } ], @@ -34,8 +34,8 @@ "modern" ], "globalMetadata": { - "_appName": "typeshape-csharp", - "_appTitle": "typeshape-csharp", + "_appName": "PolyType", + "_appTitle": "PolyType", "_enableSearch": true, "pdf": false } diff --git a/docs/index.md b/docs/index.md index 52ee0ee..799a736 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,37 +4,37 @@ _layout: landing # Overview -`typeshape-csharp` is a practical datatype-generic programming library for .NET types. It is a port of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) F# library, adapted to patterns and idioms available in C#. +`PolyType` is a practical datatype-generic programming library for .NET types. It is a port of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) F# library, adapted to patterns and idioms available in C#. ## Quick Start -You can try the library by installing the `typeshape-csharp` NuGet package: +You can try the library by installing the `PolyType` NuGet package: ```bash -$ dotnet add package typeshape-csharp +$ dotnet add package PolyType ``` which includes the core types and source generator for generating type shapes: ```C# -using TypeShape; +using PolyType; [GenerateShape] public partial record Person(string name, int age); ``` -Doing this will augment `Person` with an implementation of the `IShapeable` interface. This suffices to make `Person` usable with any library that targets the TypeShape core abstractions. You can try this out by installing the built-in example libraries: +Doing this will augment `Person` with an implementation of the `IShapeable` interface. This suffices to make `Person` usable with any library that targets the PolyType core abstractions. You can try this out by installing the built-in example libraries: ```bash -$ dotnet add package TypeShape.Examples +$ dotnet add package PolyType.Examples ``` Here's how the same value can be serialized to three separate formats. ```csharp -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.CborSerializer; -using TypeShape.Examples.XmlSerializer; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.CborSerializer; +using PolyType.Examples.XmlSerializer; Person person = new("Pete", 70); JsonSerializerTS.Serialize(person); // {"Name":"Pete","Age":70} @@ -42,7 +42,7 @@ XmlSerializer.Serialize(person); // Pete70(format); // Compiles @@ -106,6 +106,6 @@ partial record Person(string name, int age, List children); For more information see: -1. The [core abstractions](https://eiriktsarpalis.github.io/typeshape-csharp/core-abstractions.html) document for an overview of the core programming model. -2. The [typeshape providers](https://eiriktsarpalis.github.io/typeshape-csharp/typeshape-providers.html) document for an overview of the built-in shape providers and their APIs. -3. The [`TypeShape.Examples`](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.Examples) project for advanced examples of libraries built on top of TypeShape. \ No newline at end of file +1. The [core abstractions](https://eiriktsarpalis.github.io/PolyType/core-abstractions.html) document for an overview of the core programming model. +2. The [shape providers](https://eiriktsarpalis.github.io/PolyType/shape-providers.html) document for an overview of the built-in shape providers and their APIs. +3. The [`PolyType.Examples`](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.Examples) project for advanced examples of libraries built on top of PolyType. diff --git a/docs/typeshape-providers.md b/docs/shape-providers.md similarity index 83% rename from docs/typeshape-providers.md rename to docs/shape-providers.md index f6047e1..d744bb0 100644 --- a/docs/typeshape-providers.md +++ b/docs/shape-providers.md @@ -1,19 +1,19 @@ -# TypeShape providers +# Shape providers -This document provides a walkthrough of the built-in TypeShape providers. These are typically consumed by end users looking to use their types with libraries built on top of the TypeShape core abstractions. +This document provides a walkthrough of the built-in type shape providers. These are typically consumed by end users looking to use their types with libraries built on top of the PolyType core abstractions. ## Source Generator We can use the built-in source generator to auto-generate shape metadata for a user-defined type like so: ```C# -using TypeShape; +using PolyType; [GenerateShape] partial record Person(string name, int age, List children); ``` -This augments `Person` with an explicit implementation of `IShapeable`, which can be used an entry point by libraries targeting TypeShape: +This augments `Person` with an explicit implementation of `IShapeable`, which can be used an entry point by libraries targeting PolyType: ```C# MyRandomGenerator.Generate(); // Compiles @@ -46,10 +46,10 @@ public static class MyRandomGenerator ## Reflection Provider -TypeShape includes a reflection-based provider that resolves shape metadata at run time: +PolyType includes a reflection-based provider that resolves shape metadata at run time: ```C# -using TypeShape.ReflectionProvider; +using PolyType.ReflectionProvider; ITypeShapeProvider provider = ReflectionTypeShapeProvider.Default; var shape = (ITypeShape)provider.GetShape(typeof(Person)); @@ -76,7 +76,7 @@ ITypeShapeProvider provider = new ReflectionTypeShapeProvider(useReflectionEmit: ## Shape attributes -TypeShape exposes a number of attributes that tweak aspects of the generated shape. These attributes are recognized both by the source generator and the reflection provider. +PolyType exposes a number of attributes that tweak aspects of the generated shape. These attributes are recognized both by the source generator and the reflection provider. ### PropertyShapeAttribute @@ -106,7 +106,7 @@ Can be used to pick a specific constructor for a given type, if there is ambigui class PocoWithConstructors { public PocoWithConstructors(); - [ConstructorShape] // <--- Only use this constructor in TypeShape apps + [ConstructorShape] // <--- Only use this constructor in PolyType apps public PocoWithConstructors(int x1, int x2); } ``` diff --git a/docs/toc.yml b/docs/toc.yml index b23f973..8ed6fc0 100644 --- a/docs/toc.yml +++ b/docs/toc.yml @@ -1,8 +1,8 @@ - name: Abstractions href: core-abstractions.md -- name: Providers - href: typeshape-providers.md +- name: Shape Providers + href: shape-providers.md - name: API Documentation - href: api/TypeShape.yml + href: api/PolyType.yml - name: Github - href: https://github.com/eiriktsarpalis/typeshape-csharp + href: https://github.com/eiriktsarpalis/PolyType diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 743825f..b6c0a6f 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -17,8 +17,8 @@ Eirik Tsarpalis 2024 MIT - https://github.com/eiriktsarpalis/typeshape-csharp - https://eiriktsarpalis.github.io/typeshape-csharp/ + https://github.com/eiriktsarpalis/PolyType + https://eiriktsarpalis.github.io/PolyType/ generic programming, source generator, polytypic $(RepoRoot)artifacts/ pkgicon.png diff --git a/src/TypeShape.Examples/CborSerializer/CborConverter.cs b/src/PolyType.Examples/CborSerializer/CborConverter.cs similarity index 95% rename from src/TypeShape.Examples/CborSerializer/CborConverter.cs rename to src/PolyType.Examples/CborSerializer/CborConverter.cs index b0d9414..a6dbbee 100644 --- a/src/TypeShape.Examples/CborSerializer/CborConverter.cs +++ b/src/PolyType.Examples/CborSerializer/CborConverter.cs @@ -1,6 +1,6 @@ using System.Formats.Cbor; -namespace TypeShape.Examples.CborSerializer; +namespace PolyType.Examples.CborSerializer; /// /// Defines a strongly typed CBOR to .NET converter. diff --git a/src/TypeShape.Examples/CborSerializer/CborSerializer.Builder.cs b/src/PolyType.Examples/CborSerializer/CborSerializer.Builder.cs similarity index 97% rename from src/TypeShape.Examples/CborSerializer/CborSerializer.Builder.cs rename to src/PolyType.Examples/CborSerializer/CborSerializer.Builder.cs index 5bd8f68..bd339da 100644 --- a/src/TypeShape.Examples/CborSerializer/CborSerializer.Builder.cs +++ b/src/PolyType.Examples/CborSerializer/CborSerializer.Builder.cs @@ -1,8 +1,8 @@ -using TypeShape.Abstractions; -using TypeShape.Examples.CborSerializer.Converters; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.CborSerializer.Converters; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.CborSerializer; +namespace PolyType.Examples.CborSerializer; public static partial class CborSerializer { diff --git a/src/TypeShape.Examples/CborSerializer/CborSerializer.cs b/src/PolyType.Examples/CborSerializer/CborSerializer.cs similarity index 99% rename from src/TypeShape.Examples/CborSerializer/CborSerializer.cs rename to src/PolyType.Examples/CborSerializer/CborSerializer.cs index a39058d..8c42af9 100644 --- a/src/TypeShape.Examples/CborSerializer/CborSerializer.cs +++ b/src/PolyType.Examples/CborSerializer/CborSerializer.cs @@ -1,11 +1,11 @@ using System.Diagnostics; using System.Formats.Cbor; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.CborSerializer; +namespace PolyType.Examples.CborSerializer; /// -/// Provides a CBOR serialization implementation built on top of TypeShape. +/// Provides a CBOR serialization implementation built on top of PolyType. /// public static partial class CborSerializer { diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborDictionaryConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborDictionaryConverter.cs similarity index 97% rename from src/TypeShape.Examples/CborSerializer/Converters/CborDictionaryConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborDictionaryConverter.cs index 5c505f6..120a2ea 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborDictionaryConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborDictionaryConverter.cs @@ -1,8 +1,8 @@ using System.Formats.Cbor; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal class CborDictionaryConverter( CborConverter keyConverter, diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborEnumConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborEnumConverter.cs similarity index 86% rename from src/TypeShape.Examples/CborSerializer/Converters/CborEnumConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborEnumConverter.cs index 002980c..9a49a15 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborEnumConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborEnumConverter.cs @@ -1,6 +1,6 @@ using System.Formats.Cbor; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal sealed class CborEnumConverter : CborConverter where TEnum : struct, Enum diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborEnumerableConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborEnumerableConverter.cs similarity index 97% rename from src/TypeShape.Examples/CborSerializer/Converters/CborEnumerableConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborEnumerableConverter.cs index 0598e14..1bd70a6 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborEnumerableConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborEnumerableConverter.cs @@ -1,8 +1,8 @@ using System.Formats.Cbor; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal class CborEnumerableConverter( CborConverter elementConverter, diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborHelpers.cs b/src/PolyType.Examples/CborSerializer/Converters/CborHelpers.cs similarity index 92% rename from src/TypeShape.Examples/CborSerializer/Converters/CborHelpers.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborHelpers.cs index ad9df2e..f8db6ec 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborHelpers.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborHelpers.cs @@ -1,7 +1,7 @@ using System.Formats.Cbor; using System.Runtime.CompilerServices; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal static class CborHelpers { diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborNullableConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborNullableConverter.cs similarity index 91% rename from src/TypeShape.Examples/CborSerializer/Converters/CborNullableConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborNullableConverter.cs index 6bc824f..d459e49 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborNullableConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborNullableConverter.cs @@ -1,6 +1,6 @@ using System.Formats.Cbor; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal sealed class CborNullableConverter(CborConverter elementConverter) : CborConverter where T : struct diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborObjectConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborObjectConverter.cs similarity index 97% rename from src/TypeShape.Examples/CborSerializer/Converters/CborObjectConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborObjectConverter.cs index 6603e89..01c776d 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborObjectConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborObjectConverter.cs @@ -1,7 +1,7 @@ using System.Formats.Cbor; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal class CborObjectConverter(CborPropertyConverter[] properties) : CborConverter { diff --git a/src/TypeShape.Examples/CborSerializer/Converters/CborPropertyConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/CborPropertyConverter.cs similarity index 96% rename from src/TypeShape.Examples/CborSerializer/Converters/CborPropertyConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/CborPropertyConverter.cs index 5a1d446..131bfc4 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/CborPropertyConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/CborPropertyConverter.cs @@ -1,8 +1,8 @@ using System.Diagnostics; using System.Formats.Cbor; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal abstract class CborPropertyConverter(string name) { diff --git a/src/TypeShape.Examples/CborSerializer/Converters/DelayedCborConverter.cs b/src/PolyType.Examples/CborSerializer/Converters/DelayedCborConverter.cs similarity index 77% rename from src/TypeShape.Examples/CborSerializer/Converters/DelayedCborConverter.cs rename to src/PolyType.Examples/CborSerializer/Converters/DelayedCborConverter.cs index b0396f6..d8283ca 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/DelayedCborConverter.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/DelayedCborConverter.cs @@ -1,7 +1,7 @@ using System.Formats.Cbor; -using TypeShape.Examples.Utilities; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal sealed class DelayedCborConverter(ResultBox> self) : CborConverter { diff --git a/src/TypeShape.Examples/CborSerializer/Converters/PrimitiveConverters.cs b/src/PolyType.Examples/CborSerializer/Converters/PrimitiveConverters.cs similarity index 99% rename from src/TypeShape.Examples/CborSerializer/Converters/PrimitiveConverters.cs rename to src/PolyType.Examples/CborSerializer/Converters/PrimitiveConverters.cs index 7a99b46..1e631d2 100644 --- a/src/TypeShape.Examples/CborSerializer/Converters/PrimitiveConverters.cs +++ b/src/PolyType.Examples/CborSerializer/Converters/PrimitiveConverters.cs @@ -4,7 +4,7 @@ using System.Numerics; using System.Text; -namespace TypeShape.Examples.CborSerializer.Converters; +namespace PolyType.Examples.CborSerializer.Converters; internal sealed class BoolConverter : CborConverter { diff --git a/src/TypeShape.Examples/Cloner/Cloner.cs b/src/PolyType.Examples/Cloner/Cloner.cs similarity index 99% rename from src/TypeShape.Examples/Cloner/Cloner.cs rename to src/PolyType.Examples/Cloner/Cloner.cs index e92d27d..e357dfa 100644 --- a/src/TypeShape.Examples/Cloner/Cloner.cs +++ b/src/PolyType.Examples/Cloner/Cloner.cs @@ -1,11 +1,11 @@ using System.Collections.Concurrent; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.Cloner; +namespace PolyType.Examples.Cloner; /// -/// Provides an object graph deep cloning implementation built on top of TypeShape. +/// Provides an object graph deep cloning implementation built on top of PolyType. /// public static class Cloner { diff --git a/src/TypeShape.Examples/ConfigurationBinder/ConfigurationBinder.cs b/src/PolyType.Examples/ConfigurationBinder/ConfigurationBinder.cs similarity index 99% rename from src/TypeShape.Examples/ConfigurationBinder/ConfigurationBinder.cs rename to src/PolyType.Examples/ConfigurationBinder/ConfigurationBinder.cs index dce0af7..fa66658 100644 --- a/src/TypeShape.Examples/ConfigurationBinder/ConfigurationBinder.cs +++ b/src/PolyType.Examples/ConfigurationBinder/ConfigurationBinder.cs @@ -1,12 +1,12 @@ using Microsoft.Extensions.Configuration; using System.Globalization; using System.Numerics; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.ConfigurationBinder; +namespace PolyType.Examples.ConfigurationBinder; -/// Defines an binder build on top of TypeShape. +/// Defines an binder build on top of PolyType. public static class ConfigurationBinderTS { /// diff --git a/src/TypeShape.Examples/Counter/Counter.Builder.cs b/src/PolyType.Examples/Counter/Counter.Builder.cs similarity index 97% rename from src/TypeShape.Examples/Counter/Counter.Builder.cs rename to src/PolyType.Examples/Counter/Counter.Builder.cs index aeb1e9c..eeca4b5 100644 --- a/src/TypeShape.Examples/Counter/Counter.Builder.cs +++ b/src/PolyType.Examples/Counter/Counter.Builder.cs @@ -1,7 +1,7 @@ -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.Counter; +namespace PolyType.Examples.Counter; public static partial class Counter { diff --git a/src/TypeShape.Examples/Counter/Counter.cs b/src/PolyType.Examples/Counter/Counter.cs similarity index 87% rename from src/TypeShape.Examples/Counter/Counter.cs rename to src/PolyType.Examples/Counter/Counter.cs index 052912d..e98397e 100644 --- a/src/TypeShape.Examples/Counter/Counter.cs +++ b/src/PolyType.Examples/Counter/Counter.cs @@ -1,9 +1,9 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.Counter; +namespace PolyType.Examples.Counter; /// -/// A simple proof-of-concept implementation that uses TypeShape to count the number of nodes in an object graph. +/// A simple proof-of-concept implementation that uses PolyType to count the number of nodes in an object graph. /// public static partial class Counter { diff --git a/src/TypeShape.Examples/JsonSchema/JsonSchemaGenerator.cs b/src/PolyType.Examples/JsonSchema/JsonSchemaGenerator.cs similarity index 99% rename from src/TypeShape.Examples/JsonSchema/JsonSchemaGenerator.cs rename to src/PolyType.Examples/JsonSchema/JsonSchemaGenerator.cs index 6b9b85c..bf2049f 100644 --- a/src/TypeShape.Examples/JsonSchema/JsonSchemaGenerator.cs +++ b/src/PolyType.Examples/JsonSchema/JsonSchemaGenerator.cs @@ -2,9 +2,9 @@ using System.Runtime.InteropServices; using System.Text.Json; using System.Text.Json.Nodes; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.JsonSchema; +namespace PolyType.Examples.JsonSchema; /// /// A JSON schema generator for .NET types inspired by https://github.com/eiriktsarpalis/stj-schema-mapper diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs similarity index 90% rename from src/TypeShape.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs index 6e3db49..b4abdca 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/DelayedJsonConverter.cs @@ -1,9 +1,9 @@ using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Examples.Utilities; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal sealed class DelayedJsonConverter(ResultBox> self) : JsonConverter { diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs index 48ffb4f..3cd4c92 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonDictionaryConverter.cs @@ -1,10 +1,10 @@ using System.Diagnostics; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal class JsonDictionaryConverter(JsonConverter keyConverter, JsonConverter valueConverter, IDictionaryShape shape) : JsonConverter where TKey : notnull diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs index 14fe0f5..2577683 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonEnumerableConverter.cs @@ -5,10 +5,10 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Xml.Linq; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal class JsonEnumerableConverter(JsonConverter elementConverter, IEnumerableTypeShape typeShape) : JsonConverter { diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonNullableConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonNullableConverter.cs similarity index 93% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonNullableConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonNullableConverter.cs index af700fb..a4f4d26 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonNullableConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonNullableConverter.cs @@ -1,7 +1,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal sealed class JsonNullableConverter(JsonConverter elementConverter) : JsonConverter where T : struct diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonObjectConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonObjectConverter.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonObjectConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonObjectConverter.cs index 3e56d0b..1172545 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonObjectConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonObjectConverter.cs @@ -2,9 +2,9 @@ using System.Diagnostics; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal class JsonObjectConverter(JsonPropertyConverter[] properties) : JsonConverter { diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs similarity index 97% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs index c76b6eb..f32ed86 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyConverter.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal abstract class JsonPropertyConverter(string name) { diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs similarity index 97% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs index 00a5099..0fa634f 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonPropertyDictionary.cs @@ -2,9 +2,9 @@ using System.Diagnostics; using System.Text; using System.Text.Json; -using TypeShape.Examples.Utilities; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; internal abstract class JsonPropertyDictionary { diff --git a/src/TypeShape.Examples/JsonSerializer/Converters/JsonValueConverters.cs b/src/PolyType.Examples/JsonSerializer/Converters/JsonValueConverters.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/Converters/JsonValueConverters.cs rename to src/PolyType.Examples/JsonSerializer/Converters/JsonValueConverters.cs index bf9aa7b..fa75ed8 100644 --- a/src/TypeShape.Examples/JsonSerializer/Converters/JsonValueConverters.cs +++ b/src/PolyType.Examples/JsonSerializer/Converters/JsonValueConverters.cs @@ -6,9 +6,9 @@ using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.JsonSerializer.Converters; +namespace PolyType.Examples.JsonSerializer.Converters; /// Defines a converter for . public sealed class BigIntegerConverter : JsonConverter diff --git a/src/TypeShape.Examples/JsonSerializer/JsonHelpers.cs b/src/PolyType.Examples/JsonSerializer/JsonHelpers.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/JsonHelpers.cs rename to src/PolyType.Examples/JsonSerializer/JsonHelpers.cs index 97b4be3..664e386 100644 --- a/src/TypeShape.Examples/JsonSerializer/JsonHelpers.cs +++ b/src/PolyType.Examples/JsonSerializer/JsonHelpers.cs @@ -6,7 +6,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace TypeShape.Examples.JsonSerializer; +namespace PolyType.Examples.JsonSerializer; internal static class JsonHelpers { diff --git a/src/TypeShape.Examples/JsonSerializer/JsonSerializer.Builder.cs b/src/PolyType.Examples/JsonSerializer/JsonSerializer.Builder.cs similarity index 98% rename from src/TypeShape.Examples/JsonSerializer/JsonSerializer.Builder.cs rename to src/PolyType.Examples/JsonSerializer/JsonSerializer.Builder.cs index cbe640d..5507b5e 100644 --- a/src/TypeShape.Examples/JsonSerializer/JsonSerializer.Builder.cs +++ b/src/PolyType.Examples/JsonSerializer/JsonSerializer.Builder.cs @@ -1,11 +1,11 @@ using System.Diagnostics; using System.Text.Json.Serialization; using System.Text.Json.Serialization.Metadata; -using TypeShape.Abstractions; -using TypeShape.Examples.JsonSerializer.Converters; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.JsonSerializer.Converters; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.JsonSerializer; +namespace PolyType.Examples.JsonSerializer; public static partial class JsonSerializerTS { diff --git a/src/TypeShape.Examples/JsonSerializer/JsonSerializer.cs b/src/PolyType.Examples/JsonSerializer/JsonSerializer.cs similarity index 99% rename from src/TypeShape.Examples/JsonSerializer/JsonSerializer.cs rename to src/PolyType.Examples/JsonSerializer/JsonSerializer.cs index fdfbf62..84235c7 100644 --- a/src/TypeShape.Examples/JsonSerializer/JsonSerializer.cs +++ b/src/PolyType.Examples/JsonSerializer/JsonSerializer.cs @@ -3,12 +3,12 @@ using System.Text; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.JsonSerializer; +namespace PolyType.Examples.JsonSerializer; /// -/// Provides an JSON serialization implementation built on top of TypeShape. +/// Provides an JSON serialization implementation built on top of PolyType. /// public static partial class JsonSerializerTS { diff --git a/src/TypeShape.Examples/ObjectMapper/Mapper.Builder.cs b/src/PolyType.Examples/ObjectMapper/Mapper.Builder.cs similarity index 99% rename from src/TypeShape.Examples/ObjectMapper/Mapper.Builder.cs rename to src/PolyType.Examples/ObjectMapper/Mapper.Builder.cs index 65d0522..c6dc6c2 100644 --- a/src/TypeShape.Examples/ObjectMapper/Mapper.Builder.cs +++ b/src/PolyType.Examples/ObjectMapper/Mapper.Builder.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.ObjectMapper; +namespace PolyType.Examples.ObjectMapper; public static partial class Mapper { diff --git a/src/TypeShape.Examples/ObjectMapper/Mapper.cs b/src/PolyType.Examples/ObjectMapper/Mapper.cs similarity index 93% rename from src/TypeShape.Examples/ObjectMapper/Mapper.cs rename to src/PolyType.Examples/ObjectMapper/Mapper.cs index dc86ccb..c1b5340 100644 --- a/src/TypeShape.Examples/ObjectMapper/Mapper.cs +++ b/src/PolyType.Examples/ObjectMapper/Mapper.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.ObjectMapper; +namespace PolyType.Examples.ObjectMapper; /// /// Maps an object of type to an object of type . @@ -39,11 +39,11 @@ public static Mapper Create(ITypeShape - /// Derives a mapper delegate from a TypeShape provider. + /// Derives a mapper delegate from a PolyType provider. /// /// The type to map from. /// The type to map to. - /// The TypeShape provider. + /// The PolyType provider. /// A mapper delegate. public static Mapper Create(ITypeShapeProvider shapeProvider) => Create(shapeProvider.Resolve(), shapeProvider.Resolve()); diff --git a/src/TypeShape.Examples/TypeShape.Examples.csproj b/src/PolyType.Examples/PolyType.Examples.csproj similarity index 84% rename from src/TypeShape.Examples/TypeShape.Examples.csproj rename to src/PolyType.Examples/PolyType.Examples.csproj index 03f55ca..a504cd8 100644 --- a/src/TypeShape.Examples/TypeShape.Examples.csproj +++ b/src/PolyType.Examples/PolyType.Examples.csproj @@ -2,7 +2,6 @@ net8.0 true - TypeShape.Examples true README.md true @@ -18,6 +17,6 @@ - + diff --git a/src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.Builder.cs b/src/PolyType.Examples/PrettyPrinter/PrettyPrinter.Builder.cs similarity index 98% rename from src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.Builder.cs rename to src/PolyType.Examples/PrettyPrinter/PrettyPrinter.Builder.cs index 902d3ed..cf23eb2 100644 --- a/src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.Builder.cs +++ b/src/PolyType.Examples/PrettyPrinter/PrettyPrinter.Builder.cs @@ -1,10 +1,10 @@ using System.Diagnostics; using System.Numerics; using System.Text; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.PrettyPrinter; +namespace PolyType.Examples.PrettyPrinter; public static partial class PrettyPrinter { diff --git a/src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.cs b/src/PolyType.Examples/PrettyPrinter/PrettyPrinter.cs similarity index 97% rename from src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.cs rename to src/PolyType.Examples/PrettyPrinter/PrettyPrinter.cs index b25018f..4ea0af1 100644 --- a/src/TypeShape.Examples/PrettyPrinter/PrettyPrinter.cs +++ b/src/PolyType.Examples/PrettyPrinter/PrettyPrinter.cs @@ -1,12 +1,12 @@ using System.Text; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.PrettyPrinter; +namespace PolyType.Examples.PrettyPrinter; /// A delegate that formats a pretty-printed value to a string builder. public delegate void PrettyPrinter(StringBuilder builder, int indentation, T? value); -/// Provides a pretty printer for .NET types built on top of TypeShape. +/// Provides a pretty printer for .NET types built on top of PolyType. public static partial class PrettyPrinter { /// diff --git a/src/TypeShape.Examples/README.md b/src/PolyType.Examples/README.md similarity index 85% rename from src/TypeShape.Examples/README.md rename to src/PolyType.Examples/README.md index 588ab95..277ca74 100644 --- a/src/TypeShape.Examples/README.md +++ b/src/PolyType.Examples/README.md @@ -1,6 +1,6 @@ -# TypeShape.Examples +# PolyType.Examples -Includes a set of reference library implementations built on top of the TypeShape abstractions. These include: +Includes a set of reference library implementations built on top of the PolyType abstractions. These include: * A serializer built on top of System.Text.Json, * A serializer built on top of System.Xml, @@ -12,4 +12,4 @@ Includes a set of reference library implementations built on top of the TypeShap * An object graph cloning function, * A structural `IEqualityComparer` generator for POCOs and collections, * An object validator in the style of System.ComponentModel.DataAnnotations. -* A simple .NET object mapper. \ No newline at end of file +* A simple .NET object mapper. diff --git a/src/TypeShape.Examples/RandomGenerator/RandomGenerator.Builder.cs b/src/PolyType.Examples/RandomGenerator/RandomGenerator.Builder.cs similarity index 99% rename from src/TypeShape.Examples/RandomGenerator/RandomGenerator.Builder.cs rename to src/PolyType.Examples/RandomGenerator/RandomGenerator.Builder.cs index 3c6c167..634d8e5 100644 --- a/src/TypeShape.Examples/RandomGenerator/RandomGenerator.Builder.cs +++ b/src/PolyType.Examples/RandomGenerator/RandomGenerator.Builder.cs @@ -3,10 +3,10 @@ using System.Net; using System.Numerics; using System.Text; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.RandomGenerator; +namespace PolyType.Examples.RandomGenerator; public partial class RandomGenerator { diff --git a/src/TypeShape.Examples/RandomGenerator/RandomGenerator.cs b/src/PolyType.Examples/RandomGenerator/RandomGenerator.cs similarity index 98% rename from src/TypeShape.Examples/RandomGenerator/RandomGenerator.cs rename to src/PolyType.Examples/RandomGenerator/RandomGenerator.cs index 388ce95..60915b6 100644 --- a/src/TypeShape.Examples/RandomGenerator/RandomGenerator.cs +++ b/src/PolyType.Examples/RandomGenerator/RandomGenerator.cs @@ -1,11 +1,11 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.RandomGenerator; +namespace PolyType.Examples.RandomGenerator; /// A delegate that generates an instance from a seed. public delegate T RandomGenerator(Random random, int size); -/// Provides a random generator for .NET types built on top of TypeShape. +/// Provides a random generator for .NET types built on top of PolyType. public static partial class RandomGenerator { /// diff --git a/src/TypeShape.Examples/StructuralEquality/Comparers/DelayedComparer.cs b/src/PolyType.Examples/StructuralEquality/Comparers/DelayedComparer.cs similarity index 77% rename from src/TypeShape.Examples/StructuralEquality/Comparers/DelayedComparer.cs rename to src/PolyType.Examples/StructuralEquality/Comparers/DelayedComparer.cs index 4405e77..2368c46 100644 --- a/src/TypeShape.Examples/StructuralEquality/Comparers/DelayedComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/Comparers/DelayedComparer.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; -using TypeShape.Examples.Utilities; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.StructuralEquality.Comparers; +namespace PolyType.Examples.StructuralEquality.Comparers; internal sealed class DelayedEqualityComparer(ResultBox> self) : EqualityComparer { diff --git a/src/TypeShape.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs b/src/PolyType.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs similarity index 98% rename from src/TypeShape.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs rename to src/PolyType.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs index 26d475b..8787e7d 100644 --- a/src/TypeShape.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/Comparers/DictionaryEqualityComparer.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -namespace TypeShape.Examples.StructuralEquality.Comparers; +namespace PolyType.Examples.StructuralEquality.Comparers; internal abstract class DictionaryEqualityComparerBase : EqualityComparer where TKey : notnull diff --git a/src/TypeShape.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs b/src/PolyType.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs similarity index 93% rename from src/TypeShape.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs rename to src/PolyType.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs index 64bf340..201a286 100644 --- a/src/TypeShape.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/Comparers/EnumerableEqualityComparer.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -namespace TypeShape.Examples.StructuralEquality.Comparers; +namespace PolyType.Examples.StructuralEquality.Comparers; internal sealed class EnumerableEqualityComparer : EqualityComparer { diff --git a/src/TypeShape.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs b/src/PolyType.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs similarity index 90% rename from src/TypeShape.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs rename to src/PolyType.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs index 95ec7be..72d862c 100644 --- a/src/TypeShape.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/Comparers/NullableEqualityComparer.cs @@ -1,6 +1,6 @@ using System.Diagnostics.CodeAnalysis; -namespace TypeShape.Examples.StructuralEquality.Comparers; +namespace PolyType.Examples.StructuralEquality.Comparers; internal sealed class NullableEqualityComparer : EqualityComparer where T : struct diff --git a/src/TypeShape.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs b/src/PolyType.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs similarity index 96% rename from src/TypeShape.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs rename to src/PolyType.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs index 60b10d0..ac45bfa 100644 --- a/src/TypeShape.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/Comparers/ObjectEqualityComparer.cs @@ -2,9 +2,9 @@ using System.Collections.Concurrent; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.StructuralEquality.Comparers; +namespace PolyType.Examples.StructuralEquality.Comparers; internal sealed class ObjectEqualityComparer : EqualityComparer { diff --git a/src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs b/src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs similarity index 95% rename from src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs rename to src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs index e0f19d7..92e5d73 100644 --- a/src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs +++ b/src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.Builder.cs @@ -1,9 +1,9 @@ using System.Runtime.CompilerServices; -using TypeShape.Abstractions; -using TypeShape.Examples.StructuralEquality.Comparers; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.StructuralEquality.Comparers; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.StructuralEquality; +namespace PolyType.Examples.StructuralEquality; public static partial class StructuralEqualityComparer { diff --git a/src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.cs b/src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.cs similarity index 97% rename from src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.cs rename to src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.cs index 0838c2e..87f28dd 100644 --- a/src/TypeShape.Examples/StructuralEquality/StructuralEqualityComparer.cs +++ b/src/PolyType.Examples/StructuralEquality/StructuralEqualityComparer.cs @@ -1,10 +1,10 @@ using System.Collections; using System.Diagnostics.CodeAnalysis; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.StructuralEquality; +namespace PolyType.Examples.StructuralEquality; -/// Provides a structural generator built on top of TypeShape. +/// Provides a structural generator built on top of PolyType. public static partial class StructuralEqualityComparer { /// diff --git a/src/TypeShape.Examples/Utilities/PooledList.cs b/src/PolyType.Examples/Utilities/PooledList.cs similarity index 98% rename from src/TypeShape.Examples/Utilities/PooledList.cs rename to src/PolyType.Examples/Utilities/PooledList.cs index 61e16ca..8d45d60 100644 --- a/src/TypeShape.Examples/Utilities/PooledList.cs +++ b/src/PolyType.Examples/Utilities/PooledList.cs @@ -1,7 +1,7 @@ using System.Buffers; using System.Runtime.InteropServices; -namespace TypeShape.Examples.Utilities; +namespace PolyType.Examples.Utilities; /// /// A simple like implementation that uses pooled arrays. diff --git a/src/TypeShape.Examples/Utilities/SpanDictionary.cs b/src/PolyType.Examples/Utilities/SpanDictionary.cs similarity index 99% rename from src/TypeShape.Examples/Utilities/SpanDictionary.cs rename to src/PolyType.Examples/Utilities/SpanDictionary.cs index 7cbce80..d5ff9f3 100644 --- a/src/TypeShape.Examples/Utilities/SpanDictionary.cs +++ b/src/PolyType.Examples/Utilities/SpanDictionary.cs @@ -3,7 +3,7 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace TypeShape.Examples.Utilities; +namespace PolyType.Examples.Utilities; /// /// Read-only HashTable allowing lookup of ReadOnlySpan keys. diff --git a/src/TypeShape.Examples/Utilities/SpanEqualityComparer.cs b/src/PolyType.Examples/Utilities/SpanEqualityComparer.cs similarity index 97% rename from src/TypeShape.Examples/Utilities/SpanEqualityComparer.cs rename to src/PolyType.Examples/Utilities/SpanEqualityComparer.cs index bb63bac..9254cce 100644 --- a/src/TypeShape.Examples/Utilities/SpanEqualityComparer.cs +++ b/src/PolyType.Examples/Utilities/SpanEqualityComparer.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Examples.Utilities; +namespace PolyType.Examples.Utilities; /// Defines a span-based equality comparer. public interface ISpanEqualityComparer diff --git a/src/TypeShape.Examples/Utilities/TypeDictionary.cs b/src/PolyType.Examples/Utilities/TypeDictionary.cs similarity index 99% rename from src/TypeShape.Examples/Utilities/TypeDictionary.cs rename to src/PolyType.Examples/Utilities/TypeDictionary.cs index 4e42661..da6f3e5 100644 --- a/src/TypeShape.Examples/Utilities/TypeDictionary.cs +++ b/src/PolyType.Examples/Utilities/TypeDictionary.cs @@ -3,9 +3,9 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.Utilities; +namespace PolyType.Examples.Utilities; /// /// Defines a dictionary that can be used to store values keyed on . diff --git a/src/TypeShape.Examples/Validation/ValidationAttributes.cs b/src/PolyType.Examples/Validation/ValidationAttributes.cs similarity index 99% rename from src/TypeShape.Examples/Validation/ValidationAttributes.cs rename to src/PolyType.Examples/Validation/ValidationAttributes.cs index 9cf27a8..64e8d1d 100644 --- a/src/TypeShape.Examples/Validation/ValidationAttributes.cs +++ b/src/PolyType.Examples/Validation/ValidationAttributes.cs @@ -1,7 +1,7 @@ using System.Collections; using System.Text.RegularExpressions; -namespace TypeShape.Examples.Validation; +namespace PolyType.Examples.Validation; /// /// Defines an abstract validation attribute in the style of . diff --git a/src/TypeShape.Examples/Validation/Validator.Builder.cs b/src/PolyType.Examples/Validation/Validator.Builder.cs similarity index 98% rename from src/TypeShape.Examples/Validation/Validator.Builder.cs rename to src/PolyType.Examples/Validation/Validator.Builder.cs index f0a31bd..089c4fe 100644 --- a/src/TypeShape.Examples/Validation/Validator.Builder.cs +++ b/src/PolyType.Examples/Validation/Validator.Builder.cs @@ -1,8 +1,8 @@ using System.Diagnostics; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.Validation; +namespace PolyType.Examples.Validation; public static partial class Validator { diff --git a/src/TypeShape.Examples/Validation/Validator.cs b/src/PolyType.Examples/Validation/Validator.cs similarity index 96% rename from src/TypeShape.Examples/Validation/Validator.cs rename to src/PolyType.Examples/Validation/Validator.cs index 8948635..9f0ce6b 100644 --- a/src/TypeShape.Examples/Validation/Validator.cs +++ b/src/PolyType.Examples/Validation/Validator.cs @@ -1,15 +1,15 @@ using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.Validation; +namespace PolyType.Examples.Validation; /// /// Delegate containing a recursive validator walking the object graph for validation attributes. /// public delegate void Validator(T? value, List path, ref List? errors); -/// Provides an object validator for .NET types built on top of TypeShape. +/// Provides an object validator for .NET types built on top of PolyType. public static partial class Validator { /// diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs similarity index 78% rename from src/TypeShape.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs index 454c1e0..3d859f2 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/DelayedXmlConverter.cs @@ -1,7 +1,7 @@ using System.Xml; -using TypeShape.Examples.Utilities; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal sealed class DelayedXmlConverter(ResultBox> self) : XmlConverter { diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/PrimitiveConverters.cs b/src/PolyType.Examples/XmlSerializer/Converters/PrimitiveConverters.cs similarity index 99% rename from src/TypeShape.Examples/XmlSerializer/Converters/PrimitiveConverters.cs rename to src/PolyType.Examples/XmlSerializer/Converters/PrimitiveConverters.cs index 96a7ad1..7bcf48e 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/PrimitiveConverters.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/PrimitiveConverters.cs @@ -3,7 +3,7 @@ using System.Text; using System.Xml; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal sealed class BoolConverter : XmlConverter { diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs similarity index 97% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs index 7657b53..13732ee 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlDictionaryConverter.cs @@ -1,8 +1,8 @@ using System.Xml; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal class XmlDictionaryConverter( XmlConverter keyConverter, diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlEnumConverter.cs similarity index 87% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlEnumConverter.cs index b9a7182..8634fc7 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlEnumConverter.cs @@ -1,6 +1,6 @@ using System.Xml; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal sealed class XmlEnumConverter : XmlConverter where TEnum : struct, Enum diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs similarity index 97% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs index 1507083..0ae9291 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlEnumerableConverter.cs @@ -1,8 +1,8 @@ using System.Xml; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal class XmlEnumerableConverter( XmlConverter elementConverter, diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlHelpers.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlHelpers.cs similarity index 95% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlHelpers.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlHelpers.cs index 2a87772..c24e256 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlHelpers.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlHelpers.cs @@ -1,7 +1,7 @@ using System.Runtime.CompilerServices; using System.Xml; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal static class XmlHelpers { diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlNullableConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlNullableConverter.cs similarity index 91% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlNullableConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlNullableConverter.cs index 51fe112..b237ae3 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlNullableConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlNullableConverter.cs @@ -1,6 +1,6 @@ using System.Xml; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal sealed class XmlNullableConverter(XmlConverter elementConverter) : XmlConverter where T : struct diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlObjectConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlObjectConverter.cs similarity index 98% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlObjectConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlObjectConverter.cs index 25fa38c..dd32ec7 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlObjectConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlObjectConverter.cs @@ -1,7 +1,7 @@ using System.Xml; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal class XmlObjectConverter(XmlPropertyConverter[] properties) : XmlConverter { diff --git a/src/TypeShape.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs b/src/PolyType.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs similarity index 96% rename from src/TypeShape.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs rename to src/PolyType.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs index 0dc84b3..8f7e17a 100644 --- a/src/TypeShape.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/Converters/XmlPropertyConverter.cs @@ -1,8 +1,8 @@ using System.Diagnostics; using System.Xml; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Examples.XmlSerializer.Converters; +namespace PolyType.Examples.XmlSerializer.Converters; internal abstract class XmlPropertyConverter(string name) { diff --git a/src/TypeShape.Examples/XmlSerializer/XmlConverter.cs b/src/PolyType.Examples/XmlSerializer/XmlConverter.cs similarity index 95% rename from src/TypeShape.Examples/XmlSerializer/XmlConverter.cs rename to src/PolyType.Examples/XmlSerializer/XmlConverter.cs index 64b4cee..a6465f0 100644 --- a/src/TypeShape.Examples/XmlSerializer/XmlConverter.cs +++ b/src/PolyType.Examples/XmlSerializer/XmlConverter.cs @@ -1,6 +1,6 @@ using System.Xml; -namespace TypeShape.Examples.XmlSerializer; +namespace PolyType.Examples.XmlSerializer; /// /// Defines a strongly typed XML to .NET converter. diff --git a/src/TypeShape.Examples/XmlSerializer/XmlSerializer.Builder.cs b/src/PolyType.Examples/XmlSerializer/XmlSerializer.Builder.cs similarity index 97% rename from src/TypeShape.Examples/XmlSerializer/XmlSerializer.Builder.cs rename to src/PolyType.Examples/XmlSerializer/XmlSerializer.Builder.cs index c965140..8c18262 100644 --- a/src/TypeShape.Examples/XmlSerializer/XmlSerializer.Builder.cs +++ b/src/PolyType.Examples/XmlSerializer/XmlSerializer.Builder.cs @@ -1,8 +1,8 @@ -using TypeShape.Examples.XmlSerializer.Converters; -using TypeShape.Abstractions; -using TypeShape.Examples.Utilities; +using PolyType.Examples.XmlSerializer.Converters; +using PolyType.Abstractions; +using PolyType.Examples.Utilities; -namespace TypeShape.Examples.XmlSerializer; +namespace PolyType.Examples.XmlSerializer; public static partial class XmlSerializer { diff --git a/src/TypeShape.Examples/XmlSerializer/XmlSerializer.cs b/src/PolyType.Examples/XmlSerializer/XmlSerializer.cs similarity index 97% rename from src/TypeShape.Examples/XmlSerializer/XmlSerializer.cs rename to src/PolyType.Examples/XmlSerializer/XmlSerializer.cs index 686e485..c3fe26a 100644 --- a/src/TypeShape.Examples/XmlSerializer/XmlSerializer.cs +++ b/src/PolyType.Examples/XmlSerializer/XmlSerializer.cs @@ -1,13 +1,13 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Xml; -using TypeShape.Abstractions; -using TypeShape.Examples.XmlSerializer.Converters; +using PolyType.Abstractions; +using PolyType.Examples.XmlSerializer.Converters; -namespace TypeShape.Examples.XmlSerializer; +namespace PolyType.Examples.XmlSerializer; /// -/// Provides an XML serialization implementation built on top of TypeShape. +/// Provides an XML serialization implementation built on top of PolyType. /// public static partial class XmlSerializer { diff --git a/src/TypeShape.Roslyn/Helpers/RoslynHelpers.cs b/src/PolyType.Roslyn/Helpers/RoslynHelpers.cs similarity index 99% rename from src/TypeShape.Roslyn/Helpers/RoslynHelpers.cs rename to src/PolyType.Roslyn/Helpers/RoslynHelpers.cs index 3a62e0a..0294d8f 100644 --- a/src/TypeShape.Roslyn/Helpers/RoslynHelpers.cs +++ b/src/PolyType.Roslyn/Helpers/RoslynHelpers.cs @@ -5,7 +5,7 @@ using System.Globalization; using System.Reflection; -namespace TypeShape.Roslyn.Helpers; +namespace PolyType.Roslyn.Helpers; internal static class RoslynHelpers { diff --git a/src/TypeShape.Roslyn/IncrementalTypes/EquatableDiagnostic.cs b/src/PolyType.Roslyn/IncrementalTypes/EquatableDiagnostic.cs similarity index 97% rename from src/TypeShape.Roslyn/IncrementalTypes/EquatableDiagnostic.cs rename to src/PolyType.Roslyn/IncrementalTypes/EquatableDiagnostic.cs index e35d368..95b1d42 100644 --- a/src/TypeShape.Roslyn/IncrementalTypes/EquatableDiagnostic.cs +++ b/src/PolyType.Roslyn/IncrementalTypes/EquatableDiagnostic.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Descriptor for diagnostic instances using structural equality comparison. diff --git a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs similarity index 99% rename from src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs rename to src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs index a367d9c..ea7568d 100644 --- a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs +++ b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Defines an immutable array that defines structural equality semantics. diff --git a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs similarity index 99% rename from src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs rename to src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs index d05764a..ae9993b 100644 --- a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs +++ b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableDictionary.cs @@ -2,7 +2,7 @@ using System.ComponentModel; using System.Diagnostics; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Defines an immutable dictionary that defines structural equality semantics. diff --git a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs similarity index 99% rename from src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs rename to src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs index 59c3c1a..b786dc1 100644 --- a/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs +++ b/src/PolyType.Roslyn/IncrementalTypes/ImmutableEquatableSet.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using System.Runtime.CompilerServices; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Defines an immutable set that defines structural equality semantics. diff --git a/src/TypeShape.Roslyn/KnownSymbols.cs b/src/PolyType.Roslyn/KnownSymbols.cs similarity index 99% rename from src/TypeShape.Roslyn/KnownSymbols.cs rename to src/PolyType.Roslyn/KnownSymbols.cs index 18da447..0067752 100644 --- a/src/TypeShape.Roslyn/KnownSymbols.cs +++ b/src/PolyType.Roslyn/KnownSymbols.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Provides a caching layer for common known symbols wrapping a instance. diff --git a/src/TypeShape.Roslyn/Model/CollectionModelConstructionStrategy.cs b/src/PolyType.Roslyn/Model/CollectionModelConstructionStrategy.cs similarity index 97% rename from src/TypeShape.Roslyn/Model/CollectionModelConstructionStrategy.cs rename to src/PolyType.Roslyn/Model/CollectionModelConstructionStrategy.cs index ff6f73c..d7f2c68 100644 --- a/src/TypeShape.Roslyn/Model/CollectionModelConstructionStrategy.cs +++ b/src/PolyType.Roslyn/Model/CollectionModelConstructionStrategy.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// The construction strategy resolved for the collection type. diff --git a/src/TypeShape.Roslyn/Model/ConstructorDataModel.cs b/src/PolyType.Roslyn/Model/ConstructorDataModel.cs similarity index 97% rename from src/TypeShape.Roslyn/Model/ConstructorDataModel.cs rename to src/PolyType.Roslyn/Model/ConstructorDataModel.cs index 8a5968f..0516f3e 100644 --- a/src/TypeShape.Roslyn/Model/ConstructorDataModel.cs +++ b/src/PolyType.Roslyn/Model/ConstructorDataModel.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; using System.Collections.Immutable; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// A constructor data model wrapping an . diff --git a/src/TypeShape.Roslyn/Model/ConstructorParameterDataModel.cs b/src/PolyType.Roslyn/Model/ConstructorParameterDataModel.cs similarity index 93% rename from src/TypeShape.Roslyn/Model/ConstructorParameterDataModel.cs rename to src/PolyType.Roslyn/Model/ConstructorParameterDataModel.cs index 1afacca..b71ef55 100644 --- a/src/TypeShape.Roslyn/Model/ConstructorParameterDataModel.cs +++ b/src/PolyType.Roslyn/Model/ConstructorParameterDataModel.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// A constructor parameter data model wrapping an . diff --git a/src/TypeShape.Roslyn/Model/DictionaryDataModel.cs b/src/PolyType.Roslyn/Model/DictionaryDataModel.cs similarity index 98% rename from src/TypeShape.Roslyn/Model/DictionaryDataModel.cs rename to src/PolyType.Roslyn/Model/DictionaryDataModel.cs index b658fd3..b97787a 100644 --- a/src/TypeShape.Roslyn/Model/DictionaryDataModel.cs +++ b/src/PolyType.Roslyn/Model/DictionaryDataModel.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; using System.Collections; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Dictionary data model for types implementing , diff --git a/src/TypeShape.Roslyn/Model/EnumDataModel.cs b/src/PolyType.Roslyn/Model/EnumDataModel.cs similarity index 93% rename from src/TypeShape.Roslyn/Model/EnumDataModel.cs rename to src/PolyType.Roslyn/Model/EnumDataModel.cs index 3428db2..8cf6d2b 100644 --- a/src/TypeShape.Roslyn/Model/EnumDataModel.cs +++ b/src/PolyType.Roslyn/Model/EnumDataModel.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Represents an type data model. diff --git a/src/TypeShape.Roslyn/Model/EnumerableDataModel.cs b/src/PolyType.Roslyn/Model/EnumerableDataModel.cs similarity index 99% rename from src/TypeShape.Roslyn/Model/EnumerableDataModel.cs rename to src/PolyType.Roslyn/Model/EnumerableDataModel.cs index 615b6fc..343c039 100644 --- a/src/TypeShape.Roslyn/Model/EnumerableDataModel.cs +++ b/src/PolyType.Roslyn/Model/EnumerableDataModel.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; using System.Collections; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// List-like data model for types implementing diff --git a/src/TypeShape.Roslyn/Model/NullableDataModel.cs b/src/PolyType.Roslyn/Model/NullableDataModel.cs similarity index 93% rename from src/TypeShape.Roslyn/Model/NullableDataModel.cs rename to src/PolyType.Roslyn/Model/NullableDataModel.cs index 2832bf5..c6af11b 100644 --- a/src/TypeShape.Roslyn/Model/NullableDataModel.cs +++ b/src/PolyType.Roslyn/Model/NullableDataModel.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Represents a type. diff --git a/src/TypeShape.Roslyn/Model/ObjectDataModel.cs b/src/PolyType.Roslyn/Model/ObjectDataModel.cs similarity index 95% rename from src/TypeShape.Roslyn/Model/ObjectDataModel.cs rename to src/PolyType.Roslyn/Model/ObjectDataModel.cs index 11b1c28..ad28b5e 100644 --- a/src/TypeShape.Roslyn/Model/ObjectDataModel.cs +++ b/src/PolyType.Roslyn/Model/ObjectDataModel.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Represents a type whose data model is defined as a list of properties. diff --git a/src/TypeShape.Roslyn/Model/PropertyDataModel.cs b/src/PolyType.Roslyn/Model/PropertyDataModel.cs similarity index 98% rename from src/TypeShape.Roslyn/Model/PropertyDataModel.cs rename to src/PolyType.Roslyn/Model/PropertyDataModel.cs index c165c0c..2915ee0 100644 --- a/src/TypeShape.Roslyn/Model/PropertyDataModel.cs +++ b/src/PolyType.Roslyn/Model/PropertyDataModel.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Represents the data model for either an instance property or an instance field. diff --git a/src/TypeShape.Roslyn/Model/TupleDataModel.cs b/src/PolyType.Roslyn/Model/TupleDataModel.cs similarity index 95% rename from src/TypeShape.Roslyn/Model/TupleDataModel.cs rename to src/PolyType.Roslyn/Model/TupleDataModel.cs index a25ade1..b74263c 100644 --- a/src/TypeShape.Roslyn/Model/TupleDataModel.cs +++ b/src/PolyType.Roslyn/Model/TupleDataModel.cs @@ -1,6 +1,6 @@ using System.Collections.Immutable; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Represents the data model for a tuple type. diff --git a/src/TypeShape.Roslyn/Model/TypeDataKind.cs b/src/PolyType.Roslyn/Model/TypeDataKind.cs similarity index 96% rename from src/TypeShape.Roslyn/Model/TypeDataKind.cs rename to src/PolyType.Roslyn/Model/TypeDataKind.cs index 985910f..a5c54a7 100644 --- a/src/TypeShape.Roslyn/Model/TypeDataKind.cs +++ b/src/PolyType.Roslyn/Model/TypeDataKind.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// The kind of type represented by a . diff --git a/src/TypeShape.Roslyn/Model/TypeDataModel.cs b/src/PolyType.Roslyn/Model/TypeDataModel.cs similarity index 96% rename from src/TypeShape.Roslyn/Model/TypeDataModel.cs rename to src/PolyType.Roslyn/Model/TypeDataModel.cs index 2ae8f57..8e56b60 100644 --- a/src/TypeShape.Roslyn/Model/TypeDataModel.cs +++ b/src/PolyType.Roslyn/Model/TypeDataModel.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Exposes a data model extracted from an input. diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs similarity index 97% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs index 8aa2087..b058cb9 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationContext.cs @@ -2,7 +2,7 @@ using System.Collections.Immutable; using System.Diagnostics; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Defines an immutable struct encapsulating a snapshot of the current generation state. diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs similarity index 95% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs index 3bbd899..f943aec 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerationStatus.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Model generation result returned for a requested . diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs similarity index 99% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs index c71eda7..df71c7e 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Dictionary.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs similarity index 96% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs index 822665a..6d7b432 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enum.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs similarity index 99% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs index f986b00..af86628 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Enumerable.cs @@ -1,8 +1,8 @@ using Microsoft.CodeAnalysis; using System.Diagnostics.CodeAnalysis; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs similarity index 97% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs index d2d3370..f26597f 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Nullable.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs similarity index 99% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs index f243630..298c78a 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Object.cs @@ -2,9 +2,9 @@ using System.Collections.Immutable; using System.Diagnostics; using System.Reflection; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs similarity index 98% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs index 64fc17b..a8ee8f7 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.Tuple.cs @@ -1,8 +1,8 @@ using Microsoft.CodeAnalysis; using System.Collections.Immutable; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; public partial class TypeDataModelGenerator { diff --git a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.cs b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.cs similarity index 99% rename from src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.cs rename to src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.cs index 8e137a8..3a385d8 100644 --- a/src/TypeShape.Roslyn/ModelGenerator/TypeDataModelGenerator.cs +++ b/src/PolyType.Roslyn/ModelGenerator/TypeDataModelGenerator.cs @@ -1,8 +1,8 @@ using Microsoft.CodeAnalysis; using System.Collections.Immutable; -using TypeShape.Roslyn.Helpers; +using PolyType.Roslyn.Helpers; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// Provides functionality and extensibility points for generating diff --git a/src/TypeShape.Roslyn/TypeShape.Roslyn.csproj b/src/PolyType.Roslyn/PolyType.Roslyn.csproj similarity index 78% rename from src/TypeShape.Roslyn/TypeShape.Roslyn.csproj rename to src/PolyType.Roslyn/PolyType.Roslyn.csproj index a7beef7..298c669 100644 --- a/src/TypeShape.Roslyn/TypeShape.Roslyn.csproj +++ b/src/PolyType.Roslyn/PolyType.Roslyn.csproj @@ -2,7 +2,6 @@ netstandard2.0 true - TypeShape.Roslyn true README.md true @@ -13,7 +12,7 @@ - + diff --git a/src/TypeShape.Roslyn/README.md b/src/PolyType.Roslyn/README.md similarity index 85% rename from src/TypeShape.Roslyn/README.md rename to src/PolyType.Roslyn/README.md index 461ae3e..1f66439 100644 --- a/src/TypeShape.Roslyn/README.md +++ b/src/PolyType.Roslyn/README.md @@ -1,3 +1,3 @@ -# TypeShape.Roslyn +# PolyType.Roslyn Exposes an opinionated set of components for extracting data models from types using the Roslyn symbol API. diff --git a/src/TypeShape.Roslyn/SourceWriter.cs b/src/PolyType.Roslyn/SourceWriter.cs similarity index 99% rename from src/TypeShape.Roslyn/SourceWriter.cs rename to src/PolyType.Roslyn/SourceWriter.cs index 653b907..711962c 100644 --- a/src/TypeShape.Roslyn/SourceWriter.cs +++ b/src/PolyType.Roslyn/SourceWriter.cs @@ -4,7 +4,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace TypeShape.Roslyn; +namespace PolyType.Roslyn; /// /// A utility class for generating indented source code. diff --git a/src/TypeShape.Roslyn/version.json b/src/PolyType.Roslyn/version.json similarity index 100% rename from src/TypeShape.Roslyn/version.json rename to src/PolyType.Roslyn/version.json diff --git a/src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs b/src/PolyType.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs similarity index 99% rename from src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs rename to src/PolyType.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs index d6840b5..3239261 100644 --- a/src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs +++ b/src/PolyType.SourceGenerator/Helpers/RoslynHelpers.IncrementalValues.cs @@ -4,7 +4,7 @@ using System.Collections.Immutable; using System.Diagnostics; -namespace TypeShape.SourceGenerator.Helpers; +namespace PolyType.SourceGenerator.Helpers; public readonly struct TypeWithAttributeDeclarationContext { diff --git a/src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.cs b/src/PolyType.SourceGenerator/Helpers/RoslynHelpers.cs similarity index 99% rename from src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.cs rename to src/PolyType.SourceGenerator/Helpers/RoslynHelpers.cs index 03ce058..828b2a0 100644 --- a/src/TypeShape.SourceGenerator/Helpers/RoslynHelpers.cs +++ b/src/PolyType.SourceGenerator/Helpers/RoslynHelpers.cs @@ -6,7 +6,7 @@ using System.Diagnostics.CodeAnalysis; using System.Text; -namespace TypeShape.SourceGenerator.Helpers; +namespace PolyType.SourceGenerator.Helpers; internal static partial class RoslynHelpers { diff --git a/src/TypeShape.SourceGenerator/Model/CollectionConstructionStrategy.cs b/src/PolyType.SourceGenerator/Model/CollectionConstructionStrategy.cs similarity index 80% rename from src/TypeShape.SourceGenerator/Model/CollectionConstructionStrategy.cs rename to src/PolyType.SourceGenerator/Model/CollectionConstructionStrategy.cs index 4c4f4c7..47852d3 100644 --- a/src/TypeShape.SourceGenerator/Model/CollectionConstructionStrategy.cs +++ b/src/PolyType.SourceGenerator/Model/CollectionConstructionStrategy.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public enum CollectionConstructionStrategy { diff --git a/src/TypeShape.SourceGenerator/Model/ConstructorParameterShapeModel.cs b/src/PolyType.SourceGenerator/Model/ConstructorParameterShapeModel.cs similarity index 96% rename from src/TypeShape.SourceGenerator/Model/ConstructorParameterShapeModel.cs rename to src/PolyType.SourceGenerator/Model/ConstructorParameterShapeModel.cs index 4517919..1c54c62 100644 --- a/src/TypeShape.SourceGenerator/Model/ConstructorParameterShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/ConstructorParameterShapeModel.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record ConstructorParameterShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/ConstructorShapeModel.cs b/src/PolyType.SourceGenerator/Model/ConstructorShapeModel.cs similarity index 93% rename from src/TypeShape.SourceGenerator/Model/ConstructorShapeModel.cs rename to src/PolyType.SourceGenerator/Model/ConstructorShapeModel.cs index 16987d6..d2f0170 100644 --- a/src/TypeShape.SourceGenerator/Model/ConstructorShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/ConstructorShapeModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record ConstructorShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/DictionaryShapeModel.cs b/src/PolyType.SourceGenerator/Model/DictionaryShapeModel.cs similarity index 90% rename from src/TypeShape.SourceGenerator/Model/DictionaryShapeModel.cs rename to src/PolyType.SourceGenerator/Model/DictionaryShapeModel.cs index 1815837..aaf90b2 100644 --- a/src/TypeShape.SourceGenerator/Model/DictionaryShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/DictionaryShapeModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record DictionaryShapeModel : TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/EnumShapeModel.cs b/src/PolyType.SourceGenerator/Model/EnumShapeModel.cs similarity index 71% rename from src/TypeShape.SourceGenerator/Model/EnumShapeModel.cs rename to src/PolyType.SourceGenerator/Model/EnumShapeModel.cs index 85cbd60..277004a 100644 --- a/src/TypeShape.SourceGenerator/Model/EnumShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/EnumShapeModel.cs @@ -1,4 +1,4 @@ -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record EnumShapeModel : TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/EnumerableShapeModel.cs b/src/PolyType.SourceGenerator/Model/EnumerableShapeModel.cs similarity index 90% rename from src/TypeShape.SourceGenerator/Model/EnumerableShapeModel.cs rename to src/PolyType.SourceGenerator/Model/EnumerableShapeModel.cs index 1aff54a..9478dc6 100644 --- a/src/TypeShape.SourceGenerator/Model/EnumerableShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/EnumerableShapeModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record EnumerableShapeModel : TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/NullableShapeModel.cs b/src/PolyType.SourceGenerator/Model/NullableShapeModel.cs similarity index 71% rename from src/TypeShape.SourceGenerator/Model/NullableShapeModel.cs rename to src/PolyType.SourceGenerator/Model/NullableShapeModel.cs index 32f0c23..ef4142f 100644 --- a/src/TypeShape.SourceGenerator/Model/NullableShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/NullableShapeModel.cs @@ -1,4 +1,4 @@ -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record NullableShapeModel : TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/ObjectShapeModel.cs b/src/PolyType.SourceGenerator/Model/ObjectShapeModel.cs similarity index 84% rename from src/TypeShape.SourceGenerator/Model/ObjectShapeModel.cs rename to src/PolyType.SourceGenerator/Model/ObjectShapeModel.cs index e376314..db8affb 100644 --- a/src/TypeShape.SourceGenerator/Model/ObjectShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/ObjectShapeModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record ObjectShapeModel : TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/PropertyShapeModel.cs b/src/PolyType.SourceGenerator/Model/PropertyShapeModel.cs similarity index 96% rename from src/TypeShape.SourceGenerator/Model/PropertyShapeModel.cs rename to src/PolyType.SourceGenerator/Model/PropertyShapeModel.cs index 627bf83..9b2c971 100644 --- a/src/TypeShape.SourceGenerator/Model/PropertyShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/PropertyShapeModel.cs @@ -1,4 +1,4 @@ -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record PropertyShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/TypeDeclarationModel.cs b/src/PolyType.SourceGenerator/Model/TypeDeclarationModel.cs similarity index 86% rename from src/TypeShape.SourceGenerator/Model/TypeDeclarationModel.cs rename to src/PolyType.SourceGenerator/Model/TypeDeclarationModel.cs index bee07fb..760bebc 100644 --- a/src/TypeShape.SourceGenerator/Model/TypeDeclarationModel.cs +++ b/src/PolyType.SourceGenerator/Model/TypeDeclarationModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public record TypeDeclarationModel { diff --git a/src/TypeShape.SourceGenerator/Model/TypeId.cs b/src/PolyType.SourceGenerator/Model/TypeId.cs similarity index 95% rename from src/TypeShape.SourceGenerator/Model/TypeId.cs rename to src/PolyType.SourceGenerator/Model/TypeId.cs index 329d99f..b27442f 100644 --- a/src/TypeShape.SourceGenerator/Model/TypeId.cs +++ b/src/PolyType.SourceGenerator/Model/TypeId.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; /// /// Represents a cacheable type identifier that uses FQN to derive equality. diff --git a/src/TypeShape.SourceGenerator/Model/TypeShapeModel.cs b/src/PolyType.SourceGenerator/Model/TypeShapeModel.cs similarity index 71% rename from src/TypeShape.SourceGenerator/Model/TypeShapeModel.cs rename to src/PolyType.SourceGenerator/Model/TypeShapeModel.cs index 179baeb..9c7001e 100644 --- a/src/TypeShape.SourceGenerator/Model/TypeShapeModel.cs +++ b/src/PolyType.SourceGenerator/Model/TypeShapeModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public abstract record TypeShapeModel { diff --git a/src/TypeShape.SourceGenerator/Model/TypeShapeProviderModel.cs b/src/PolyType.SourceGenerator/Model/TypeShapeProviderModel.cs similarity index 85% rename from src/TypeShape.SourceGenerator/Model/TypeShapeProviderModel.cs rename to src/PolyType.SourceGenerator/Model/TypeShapeProviderModel.cs index df6221e..775263c 100644 --- a/src/TypeShape.SourceGenerator/Model/TypeShapeProviderModel.cs +++ b/src/PolyType.SourceGenerator/Model/TypeShapeProviderModel.cs @@ -1,6 +1,6 @@ -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator.Model; +namespace PolyType.SourceGenerator.Model; public sealed record TypeShapeProviderModel { diff --git a/src/TypeShape.SourceGenerator/Parser/Parser.Diagnostics.cs b/src/PolyType.SourceGenerator/Parser/Parser.Diagnostics.cs similarity index 80% rename from src/TypeShape.SourceGenerator/Parser/Parser.Diagnostics.cs rename to src/PolyType.SourceGenerator/Parser/Parser.Diagnostics.cs index 19bb7b2..7f85920 100644 --- a/src/TypeShape.SourceGenerator/Parser/Parser.Diagnostics.cs +++ b/src/PolyType.SourceGenerator/Parser/Parser.Diagnostics.cs @@ -1,6 +1,6 @@ using Microsoft.CodeAnalysis; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; public sealed partial class Parser { @@ -8,7 +8,7 @@ public sealed partial class Parser id: "TS0001", title: "Type shape generation not supported for type.", messageFormat: "Type shape generation not supported for type '{0}'.", - category: "TypeShape.SourceGenerator", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); @@ -16,7 +16,7 @@ public sealed partial class Parser id: "TS0002", title: "Type annotated with GenerateShapeAttribute is not partial.", messageFormat: "The type '{0}' has been annotated with GenerateShapeAttribute but it or one of its parent types are not partial.", - category: "TypeShape.SourceGenerator", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true); @@ -24,23 +24,23 @@ public sealed partial class Parser id: "TS0003", title: "Transitive type graph contains types with conflicting fully qualified names.", messageFormat: "The transitive type graph contains multiple types named '{0}'.", - category: "TypeShape.SourceGenerator", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true); private static DiagnosticDescriptor GenericTypeDefinitionsNotSupported { get; } = new DiagnosticDescriptor( id: "TS0004", - title: "TypeShape generation not supported for generic types.", - messageFormat: "The type '{0}' is a generic type which is not supported for TypeShape generation.", - category: "TypeShape.SourceGenerator", + title: "PolyType generation not supported for generic types.", + messageFormat: "The type '{0}' is a generic type which is not supported for PolyType generation.", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); private static DiagnosticDescriptor TypeNotAccessible { get; } = new DiagnosticDescriptor( id: "TS0005", title: "Type not accessible for generation.", - messageFormat: "The type '{0}' is not accessible for TypeShape generation.", - category: "TypeShape.SourceGenerator", + messageFormat: "The type '{0}' is not accessible for PolyType generation.", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); @@ -48,7 +48,7 @@ public sealed partial class Parser id: "TS0006", title: "Duplicate ConstructorShapeAttribute annotation.", messageFormat: "The type '{0}' contains multiple constructors with a ConstructorShapeAttribute.", - category: "TypeShape.SourceGenerator", + category: "PolyType.SourceGenerator", defaultSeverity: DiagnosticSeverity.Warning, isEnabledByDefault: true); } diff --git a/src/TypeShape.SourceGenerator/Parser/Parser.ModelMapper.cs b/src/PolyType.SourceGenerator/Parser/Parser.ModelMapper.cs similarity index 99% rename from src/TypeShape.SourceGenerator/Parser/Parser.ModelMapper.cs rename to src/PolyType.SourceGenerator/Parser/Parser.ModelMapper.cs index bf47ae7..cea0398 100644 --- a/src/TypeShape.SourceGenerator/Parser/Parser.ModelMapper.cs +++ b/src/PolyType.SourceGenerator/Parser/Parser.ModelMapper.cs @@ -1,9 +1,9 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Helpers; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Helpers; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; public sealed partial class Parser { diff --git a/src/TypeShape.SourceGenerator/Parser/Parser.cs b/src/PolyType.SourceGenerator/Parser/Parser.cs similarity index 98% rename from src/TypeShape.SourceGenerator/Parser/Parser.cs rename to src/PolyType.SourceGenerator/Parser/Parser.cs index 5b5c41e..eb1ac81 100644 --- a/src/TypeShape.SourceGenerator/Parser/Parser.cs +++ b/src/PolyType.SourceGenerator/Parser/Parser.cs @@ -4,11 +4,11 @@ using System.Collections.Immutable; using System.Diagnostics; using System.Text; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Helpers; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Helpers; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; public sealed partial class Parser : TypeDataModelGenerator { @@ -317,13 +317,13 @@ static string FormatTypeDeclarationHeader(BaseTypeDeclarationSyntax typeDeclarat { Id = new() { - FullyQualifiedName = "global::TypeShape.SourceGenerator.GenerateShapeProvider", + FullyQualifiedName = "global::PolyType.SourceGenerator.GenerateShapeProvider", GeneratedPropertyName = "GenerateShapeProvider", IsValueType = false, SpecialType = SpecialType.None, }, Name = "GenerateShapeProvider", - Namespace = "TypeShape.SourceGenerator", + Namespace = "PolyType.SourceGenerator", SourceFilenamePrefix = "GenerateShapeProvider", TypeDeclarationHeader = "internal partial class GenerateShapeProvider", IsValidTypeDeclaration = true, diff --git a/src/TypeShape.SourceGenerator/TypeShape.SourceGenerator.csproj b/src/PolyType.SourceGenerator/PolyType.SourceGenerator.csproj similarity index 69% rename from src/TypeShape.SourceGenerator/TypeShape.SourceGenerator.csproj rename to src/PolyType.SourceGenerator/PolyType.SourceGenerator.csproj index 03ae937..6fe0c10 100644 --- a/src/TypeShape.SourceGenerator/TypeShape.SourceGenerator.csproj +++ b/src/PolyType.SourceGenerator/PolyType.SourceGenerator.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs similarity index 95% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs index b09eaec..152a642 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Constructors.cs @@ -2,10 +2,10 @@ using System.Diagnostics; using System.Reflection.Metadata; using System.Text; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { @@ -17,14 +17,14 @@ private static void FormatConstructorFactory(SourceWriter writer, string methodN string constructorArgumentStateFQN = FormatConstructorArgumentStateFQN(type, constructor); string? constructorParameterFactoryName = constructor.TotalArity > 0 ? FormatConstructorParameterFactoryName(type) : null; - writer.WriteLine($"private global::TypeShape.Abstractions.IConstructorShape {methodName}()"); + writer.WriteLine($"private global::PolyType.Abstractions.IConstructorShape {methodName}()"); writer.WriteLine('{'); writer.Indentation++; writer.WriteLine($$""" - return new global::TypeShape.SourceGenModel.SourceGenConstructorShape<{{type.Type.FullyQualifiedName}}, {{constructorArgumentStateFQN}}> + return new global::PolyType.SourceGenModel.SourceGenConstructorShape<{{type.Type.FullyQualifiedName}}, {{constructorArgumentStateFQN}}> { - DeclaringType = (global::TypeShape.Abstractions.IObjectTypeShape<{{type.Type.FullyQualifiedName}}>){{type.Type.GeneratedPropertyName}}, + DeclaringType = (global::PolyType.Abstractions.IObjectTypeShape<{{type.Type.FullyQualifiedName}}>){{type.Type.GeneratedPropertyName}}, ParameterCount = {{constructor.TotalArity}}, GetParametersFunc = {{FormatNull(constructorParameterFactoryName)}}, DefaultConstructorFunc = {{FormatDefaultCtor(type, constructor)}}, @@ -258,7 +258,7 @@ static string FormatConstructorParameterFactoryName(TypeShapeModel type) => private static void FormatConstructorParameterFactory(SourceWriter writer, ObjectShapeModel type, string methodName, ConstructorShapeModel constructor, string constructorArgumentStateFQN) { - writer.WriteLine($"private global::TypeShape.Abstractions.IConstructorParameterShape[] {methodName}() => new global::TypeShape.Abstractions.IConstructorParameterShape[]"); + writer.WriteLine($"private global::PolyType.Abstractions.IConstructorParameterShape[] {methodName}() => new global::PolyType.Abstractions.IConstructorParameterShape[]"); writer.WriteLine('{'); writer.Indentation++; @@ -273,7 +273,7 @@ private static void FormatConstructorParameterFactory(SourceWriter writer, Objec } writer.WriteLine($$""" - new global::TypeShape.SourceGenModel.SourceGenConstructorParameterShape<{{constructorArgumentStateFQN}}, {{parameter.ParameterType.FullyQualifiedName}}> + new global::PolyType.SourceGenModel.SourceGenConstructorParameterShape<{{constructorArgumentStateFQN}}, {{parameter.ParameterType.FullyQualifiedName}}> { Position = {{parameter.Position}}, Name = {{FormatStringLiteral(parameter.Name)}}, @@ -351,7 +351,7 @@ ParameterKind.RequiredMember or _ => throw new InvalidOperationException($"Unsupported parameter kind: {parameter.Kind}"), }; - return $"global::TypeShape.Abstractions.ConstructorParameterKind.{identifier}"; + return $"global::PolyType.Abstractions.ConstructorParameterKind.{identifier}"; } } diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs similarity index 84% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs index 3b1cd61..5cdfb8f 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Dictionary.cs @@ -1,16 +1,16 @@ -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static void FormatDictionaryTypeShapeFactory(SourceWriter writer, string methodName, DictionaryShapeModel dictionaryShapeModel) { writer.WriteLine($$""" - private global::TypeShape.Abstractions.ITypeShape<{{dictionaryShapeModel.Type.FullyQualifiedName}}> {{methodName}}() + private global::PolyType.Abstractions.ITypeShape<{{dictionaryShapeModel.Type.FullyQualifiedName}}> {{methodName}}() { - return new global::TypeShape.SourceGenModel.SourceGenDictionaryTypeShape<{{dictionaryShapeModel.Type.FullyQualifiedName}}, {{dictionaryShapeModel.KeyType.FullyQualifiedName}}, {{dictionaryShapeModel.ValueType.FullyQualifiedName}}> + return new global::PolyType.SourceGenModel.SourceGenDictionaryTypeShape<{{dictionaryShapeModel.Type.FullyQualifiedName}}, {{dictionaryShapeModel.KeyType.FullyQualifiedName}}, {{dictionaryShapeModel.ValueType.FullyQualifiedName}}> { KeyType = {{dictionaryShapeModel.KeyType.GeneratedPropertyName}}, ValueType = {{dictionaryShapeModel.ValueType.GeneratedPropertyName}}, @@ -31,8 +31,8 @@ static string FormatGetDictionaryFunc(DictionaryShapeModel dictionaryType) return dictionaryType.Kind switch { DictionaryKind.IReadOnlyDictionaryOfKV => $"static obj => obj{suppressSuffix}", - DictionaryKind.IDictionaryOfKV => $"static obj => global::TypeShape.SourceGenModel.CollectionHelpers.AsReadOnlyDictionary<{dictionaryType.Type.FullyQualifiedName}, {dictionaryType.KeyType.FullyQualifiedName}, {dictionaryType.ValueType.FullyQualifiedName}>(obj{suppressSuffix})", - DictionaryKind.IDictionary => $"static obj => global::TypeShape.SourceGenModel.CollectionHelpers.AsReadOnlyDictionary(obj{suppressSuffix})!", + DictionaryKind.IDictionaryOfKV => $"static obj => global::PolyType.SourceGenModel.CollectionHelpers.AsReadOnlyDictionary<{dictionaryType.Type.FullyQualifiedName}, {dictionaryType.KeyType.FullyQualifiedName}, {dictionaryType.ValueType.FullyQualifiedName}>(obj{suppressSuffix})", + DictionaryKind.IDictionary => $"static obj => global::PolyType.SourceGenModel.CollectionHelpers.AsReadOnlyDictionary(obj{suppressSuffix})!", _ => throw new ArgumentException(dictionaryType.Kind.ToString()), }; } @@ -81,7 +81,7 @@ static string FormatSpanConstructorFunc(DictionaryShapeModel dictionaryType) } string suppressSuffix = dictionaryType.KeyValueTypesContainNullableAnnotations ? "!" : ""; - string valuesExpr = dictionaryType.CtorRequiresDictionaryConversion ? $"global::TypeShape.SourceGenModel.CollectionHelpers.CreateDictionary(values{suppressSuffix})" : $"values{suppressSuffix}"; + string valuesExpr = dictionaryType.CtorRequiresDictionaryConversion ? $"global::PolyType.SourceGenModel.CollectionHelpers.CreateDictionary(values{suppressSuffix})" : $"values{suppressSuffix}"; return dictionaryType switch { { StaticFactoryMethod: string factory } => $"static values => {factory}({valuesExpr})", diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs similarity index 51% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs index 38bf9cb..63de56e 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enum.cs @@ -1,16 +1,16 @@ -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static void FormatEnumTypeShapeFactory(SourceWriter writer, string methodName, EnumShapeModel enumShapeType) { writer.WriteLine($$""" - private global::TypeShape.Abstractions.ITypeShape<{{enumShapeType.Type.FullyQualifiedName}}> {{methodName}}() + private global::PolyType.Abstractions.ITypeShape<{{enumShapeType.Type.FullyQualifiedName}}> {{methodName}}() { - return new global::TypeShape.SourceGenModel.SourceGenEnumTypeShape<{{enumShapeType.Type.FullyQualifiedName}}, {{enumShapeType.UnderlyingType.FullyQualifiedName}}> + return new global::PolyType.SourceGenModel.SourceGenEnumTypeShape<{{enumShapeType.Type.FullyQualifiedName}}, {{enumShapeType.UnderlyingType.FullyQualifiedName}}> { UnderlyingType = {{enumShapeType.UnderlyingType.GeneratedPropertyName}}, Provider = this, diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs similarity index 89% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs index 5a0893a..c7798fc 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Enumerable.cs @@ -1,16 +1,16 @@ -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static void FormatEnumerableTypeShapeFactory(SourceWriter writer, string methodName, EnumerableShapeModel enumerableShapeModel) { writer.WriteLine($$""" - private global::TypeShape.Abstractions.ITypeShape<{{enumerableShapeModel.Type.FullyQualifiedName}}> {{methodName}}() + private global::PolyType.Abstractions.ITypeShape<{{enumerableShapeModel.Type.FullyQualifiedName}}> {{methodName}}() { - return new global::TypeShape.SourceGenModel.SourceGenEnumerableTypeShape<{{enumerableShapeModel.Type.FullyQualifiedName}}, {{enumerableShapeModel.ElementType.FullyQualifiedName}}> + return new global::PolyType.SourceGenModel.SourceGenEnumerableTypeShape<{{enumerableShapeModel.Type.FullyQualifiedName}}, {{enumerableShapeModel.ElementType.FullyQualifiedName}}> { ElementType = {{enumerableShapeModel.ElementType.GeneratedPropertyName}}, ConstructionStrategy = {{FormatCollectionConstructionStrategy(enumerableShapeModel.ConstructionStrategy)}}, @@ -68,7 +68,7 @@ static string FormatSpanConstructorFunc(EnumerableShapeModel enumerableType) } string suppressSuffix = enumerableType.ElementTypeContainsNullableAnnotations ? "!" : ""; - string valuesExpr = enumerableType.CtorRequiresListConversion ? $"global::TypeShape.SourceGenModel.CollectionHelpers.CreateList(values{suppressSuffix})" : $"values{suppressSuffix}"; + string valuesExpr = enumerableType.CtorRequiresListConversion ? $"global::PolyType.SourceGenModel.CollectionHelpers.CreateList(values{suppressSuffix})" : $"values{suppressSuffix}"; return enumerableType switch { { Kind: EnumerableKind.ArrayOfT or EnumerableKind.ReadOnlyMemoryOfT or EnumerableKind.MemoryOfT } => $"static values => {valuesExpr}.ToArray()", @@ -104,6 +104,6 @@ private static string FormatCollectionConstructionStrategy(CollectionConstructio _ => throw new ArgumentException(strategy.ToString()), }; - return $"global::TypeShape.Abstractions.CollectionConstructionStrategy." + identifier; + return $"global::PolyType.Abstractions.CollectionConstructionStrategy." + identifier; } } diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs similarity index 65% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs index 0cdc653..835c45a 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.ITypeShapeProvider.cs @@ -1,8 +1,8 @@ using Microsoft.CodeAnalysis.Text; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { @@ -11,32 +11,32 @@ private static SourceText FormatProviderInterfaceImplementation(TypeShapeProvide var writer = new SourceWriter(); StartFormatSourceFile(writer, provider.Declaration); - writer.WriteLine($"{provider.Declaration.TypeDeclarationHeader} : global::TypeShape.ITypeShapeProvider"); + writer.WriteLine($"{provider.Declaration.TypeDeclarationHeader} : global::PolyType.ITypeShapeProvider"); writer.WriteLine('{'); writer.Indentation++; writer.WriteLine(""" /// - /// Gets the generated for the specified type. + /// Gets the generated for the specified type. /// /// The type for which a shape is requested. /// - /// The generated for the specified type. + /// The generated for the specified type. /// - public global::TypeShape.Abstractions.ITypeShape? GetShape() - => (global::TypeShape.Abstractions.ITypeShape?)GetShape(typeof(T)); + public global::PolyType.Abstractions.ITypeShape? GetShape() + => (global::PolyType.Abstractions.ITypeShape?)GetShape(typeof(T)); """); writer.WriteLine(""" /// - /// Gets the generated for the specified type. + /// Gets the generated for the specified type. /// /// The type for which a shape is requested. /// - /// The generated for the specified type. + /// The generated for the specified type. /// - public global::TypeShape.Abstractions.ITypeShape? GetShape(global::System.Type type) + public global::PolyType.Abstractions.ITypeShape? GetShape(global::System.Type type) { """); @@ -66,12 +66,12 @@ private static SourceText FormatGenericProviderInterfaceImplementation(TypeDecla var writer = new SourceWriter(); StartFormatSourceFile(writer, typeDeclaration); - writer.WriteLine($"{typeDeclaration.TypeDeclarationHeader} : global::TypeShape.IShapeable<{typeDeclaration.Id.FullyQualifiedName}>"); + writer.WriteLine($"{typeDeclaration.TypeDeclarationHeader} : global::PolyType.IShapeable<{typeDeclaration.Id.FullyQualifiedName}>"); writer.WriteLine('{'); writer.Indentation++; writer.WriteLine($""" - static global::TypeShape.Abstractions.ITypeShape<{typeDeclaration.Id.FullyQualifiedName}> global::TypeShape.IShapeable<{typeDeclaration.Id.FullyQualifiedName}>.GetShape() + static global::PolyType.Abstractions.ITypeShape<{typeDeclaration.Id.FullyQualifiedName}> global::PolyType.IShapeable<{typeDeclaration.Id.FullyQualifiedName}>.GetShape() => {provider.Declaration.Id.FullyQualifiedName}.Default.{typeDeclaration.Id.GeneratedPropertyName}; """); diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs similarity index 54% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs index dfaf206..5af20b0 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Nullable.cs @@ -1,16 +1,16 @@ -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static void FormatNullableTypeShapeFactory(SourceWriter writer, string methodName, NullableShapeModel nullableShapeModel) { writer.WriteLine($$""" - private global::TypeShape.Abstractions.ITypeShape<{{nullableShapeModel.Type.FullyQualifiedName}}> {{methodName}}() + private global::PolyType.Abstractions.ITypeShape<{{nullableShapeModel.Type.FullyQualifiedName}}> {{methodName}}() { - return new global::TypeShape.SourceGenModel.SourceGenNullableTypeShape<{{nullableShapeModel.ElementType.FullyQualifiedName}}> + return new global::PolyType.SourceGenModel.SourceGenNullableTypeShape<{{nullableShapeModel.ElementType.FullyQualifiedName}}> { Provider = this, ElementType = {{nullableShapeModel.ElementType.GeneratedPropertyName}}, diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs similarity index 88% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs index d50a95d..c5cd114 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Object.cs @@ -1,7 +1,7 @@ -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { @@ -11,9 +11,9 @@ private static void FormatObjectTypeShapeFactory(SourceWriter writer, string met string? constructorFactoryMethodName = objectShapeModel.Constructor != null ? $"CreateConstructor_{objectShapeModel.Type.GeneratedPropertyName}" : null; writer.WriteLine($$""" - private global::TypeShape.Abstractions.ITypeShape<{{objectShapeModel.Type.FullyQualifiedName}}> {{methodName}}() + private global::PolyType.Abstractions.ITypeShape<{{objectShapeModel.Type.FullyQualifiedName}}> {{methodName}}() { - return new global::TypeShape.SourceGenModel.SourceGenObjectTypeShape<{{objectShapeModel.Type.FullyQualifiedName}}> + return new global::PolyType.SourceGenModel.SourceGenObjectTypeShape<{{objectShapeModel.Type.FullyQualifiedName}}> { Provider = this, IsRecordType = {{FormatBool(objectShapeModel.IsRecordType)}}, diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs similarity index 94% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs index b61d7cd..0b7101a 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Properties.cs @@ -1,15 +1,15 @@ using Microsoft.CodeAnalysis; using System.Diagnostics; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static void FormatPropertyFactory(SourceWriter writer, string methodName, ObjectShapeModel type) { - writer.WriteLine($"private global::TypeShape.Abstractions.IPropertyShape[] {methodName}() => new global::TypeShape.Abstractions.IPropertyShape[]"); + writer.WriteLine($"private global::PolyType.Abstractions.IPropertyShape[] {methodName}() => new global::PolyType.Abstractions.IPropertyShape[]"); writer.WriteLine('{'); writer.Indentation++; @@ -36,10 +36,10 @@ private static void FormatPropertyFactory(SourceWriter writer, string methodName }; writer.WriteLine($$""" - new global::TypeShape.SourceGenModel.SourceGenPropertyShape<{{type.Type.FullyQualifiedName}}, {{property.PropertyType.FullyQualifiedName}}> + new global::PolyType.SourceGenModel.SourceGenPropertyShape<{{type.Type.FullyQualifiedName}}, {{property.PropertyType.FullyQualifiedName}}> { Name = {{FormatStringLiteral(property.Name)}}, - DeclaringType = (global::TypeShape.Abstractions.IObjectTypeShape<{{type.Type.FullyQualifiedName}}>){{type.Type.GeneratedPropertyName}}, + DeclaringType = (global::PolyType.Abstractions.IObjectTypeShape<{{type.Type.FullyQualifiedName}}>){{type.Type.GeneratedPropertyName}}, PropertyType = {{property.PropertyType.GeneratedPropertyName}}, Getter = {{(property.EmitGetter ? $"static (ref {type.Type.FullyQualifiedName} obj) => {FormatGetterBody("obj", property)}{(suppressGetter ? "!" : "")}" : "null")}}, Setter = {{(property.EmitSetter ? $"static (ref {type.Type.FullyQualifiedName} obj, {property.PropertyType.FullyQualifiedName} value) => {FormatSetterBody("obj", "value" + (suppressSetter ? "!" : ""), property)}" : "null")}}, diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs similarity index 86% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs index e09039d..40b20c5 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.Type.cs @@ -1,15 +1,15 @@ using Microsoft.CodeAnalysis.Text; using System.Diagnostics; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { private static SourceText FormatType(TypeShapeProviderModel provider, TypeShapeModel type) { - string generatedPropertyType = $"global::TypeShape.Abstractions.ITypeShape<{type.Type.FullyQualifiedName}>"; + string generatedPropertyType = $"global::PolyType.Abstractions.ITypeShape<{type.Type.FullyQualifiedName}>"; string generatedFactoryMethodName = $"Create_{type.Type.GeneratedPropertyName}"; string generatedFieldName = "_" + type.Type.GeneratedPropertyName; @@ -19,7 +19,7 @@ private static SourceText FormatType(TypeShapeProviderModel provider, TypeShapeM if (type.EmitGenericTypeShapeProviderImplementation) { writer.WriteLine("#nullable disable annotations // Use nullable-oblivious interface implementation", disableIndentation: true); - writer.WriteLine($"""{provider.Declaration.TypeDeclarationHeader} : global::TypeShape.IShapeable<{type.Type.FullyQualifiedName}>"""); + writer.WriteLine($"""{provider.Declaration.TypeDeclarationHeader} : global::PolyType.IShapeable<{type.Type.FullyQualifiedName}>"""); writer.WriteLine("#nullable enable annotations // Use nullable-oblivious interface implementation", disableIndentation: true); } else @@ -40,7 +40,7 @@ private static SourceText FormatType(TypeShapeProviderModel provider, TypeShapeM if (type.EmitGenericTypeShapeProviderImplementation) { writer.WriteLine($""" - static {generatedPropertyType} global::TypeShape.IShapeable<{type.Type.FullyQualifiedName}>.GetShape() => Default.{type.Type.GeneratedPropertyName}; + static {generatedPropertyType} global::PolyType.IShapeable<{type.Type.FullyQualifiedName}>.GetShape() => Default.{type.Type.GeneratedPropertyName}; """); } diff --git a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.cs b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.cs similarity index 97% rename from src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.cs rename to src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.cs index b4d3e62..b9c27ae 100644 --- a/src/TypeShape.SourceGenerator/SourceFormatter/SourceFormatter.cs +++ b/src/PolyType.SourceGenerator/SourceFormatter/SourceFormatter.cs @@ -1,10 +1,10 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.Text; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; internal static partial class SourceFormatter { diff --git a/src/TypeShape.SourceGenerator/TypeShapeIncrementalGenerator.cs b/src/PolyType.SourceGenerator/TypeShapeIncrementalGenerator.cs similarity index 89% rename from src/TypeShape.SourceGenerator/TypeShapeIncrementalGenerator.cs rename to src/PolyType.SourceGenerator/TypeShapeIncrementalGenerator.cs index 70df1cf..a8579f1 100644 --- a/src/TypeShape.SourceGenerator/TypeShapeIncrementalGenerator.cs +++ b/src/PolyType.SourceGenerator/TypeShapeIncrementalGenerator.cs @@ -1,10 +1,10 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Helpers; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Helpers; +using PolyType.SourceGenerator.Model; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; [Generator] public sealed class TypeShapeIncrementalGenerator : IIncrementalGenerator @@ -19,7 +19,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) IncrementalValuesProvider generateShapeOfTModels = context.SyntaxProvider .ForTypesWithAttributeDeclaration( - "TypeShape.GenerateShapeAttribute", + "PolyType.GenerateShapeAttribute", (node, _) => node is ClassDeclarationSyntax) .Combine(knownSymbols) .Select((tuple, cancellationToken) => @@ -30,7 +30,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context) IncrementalValueProvider generateDataModels = context.SyntaxProvider .ForTypesWithAttributeDeclaration( - "TypeShape.GenerateShapeAttribute", + "PolyType.GenerateShapeAttribute", (node, _) => node is TypeDeclarationSyntax) .Collect() .Combine(knownSymbols) diff --git a/src/TypeShape.SourceGenerator/TypeShapeKnownSymbols.cs b/src/PolyType.SourceGenerator/TypeShapeKnownSymbols.cs similarity index 63% rename from src/TypeShape.SourceGenerator/TypeShapeKnownSymbols.cs rename to src/PolyType.SourceGenerator/TypeShapeKnownSymbols.cs index d0a7a64..d78fe40 100644 --- a/src/TypeShape.SourceGenerator/TypeShapeKnownSymbols.cs +++ b/src/PolyType.SourceGenerator/TypeShapeKnownSymbols.cs @@ -1,19 +1,19 @@ using Microsoft.CodeAnalysis; -using TypeShape.Roslyn; +using PolyType.Roslyn; -namespace TypeShape.SourceGenerator; +namespace PolyType.SourceGenerator; public sealed class TypeShapeKnownSymbols(Compilation compilation) : KnownSymbols(compilation) { - public INamedTypeSymbol? GenerateShapeAttributeOfT => GetOrResolveType("TypeShape.GenerateShapeAttribute`1", ref _GenerateShapeAttributeOfT); + public INamedTypeSymbol? GenerateShapeAttributeOfT => GetOrResolveType("PolyType.GenerateShapeAttribute`1", ref _GenerateShapeAttributeOfT); private Option _GenerateShapeAttributeOfT; - public INamedTypeSymbol? PropertyShapeAttribute => GetOrResolveType("TypeShape.PropertyShapeAttribute", ref _PropertyShapeAttribute); + public INamedTypeSymbol? PropertyShapeAttribute => GetOrResolveType("PolyType.PropertyShapeAttribute", ref _PropertyShapeAttribute); private Option _PropertyShapeAttribute; - public INamedTypeSymbol? ConstructorShapeAttribute => GetOrResolveType("TypeShape.ConstructorShapeAttribute", ref _ConstructorShapeAttribute); + public INamedTypeSymbol? ConstructorShapeAttribute => GetOrResolveType("PolyType.ConstructorShapeAttribute", ref _ConstructorShapeAttribute); private Option _ConstructorShapeAttribute; - public INamedTypeSymbol? ParameterShapeAttribute => GetOrResolveType("TypeShape.ParameterShapeAttribute", ref _ParameterShapeAttribute); + public INamedTypeSymbol? ParameterShapeAttribute => GetOrResolveType("PolyType.ParameterShapeAttribute", ref _ParameterShapeAttribute); private Option _ParameterShapeAttribute; } diff --git a/src/TypeShape.TestCases.FSharp/TypeShape.TestCases.FSharp.fsproj b/src/PolyType.TestCases.FSharp/PolyType.TestCases.FSharp.fsproj similarity index 100% rename from src/TypeShape.TestCases.FSharp/TypeShape.TestCases.FSharp.fsproj rename to src/PolyType.TestCases.FSharp/PolyType.TestCases.FSharp.fsproj diff --git a/src/TypeShape.TestCases.FSharp/TestTypes.fs b/src/PolyType.TestCases.FSharp/TestTypes.fs similarity index 97% rename from src/TypeShape.TestCases.FSharp/TestTypes.fs rename to src/PolyType.TestCases.FSharp/TestTypes.fs index dd3affc..d22daaf 100644 --- a/src/TypeShape.TestCases.FSharp/TestTypes.fs +++ b/src/PolyType.TestCases.FSharp/TestTypes.fs @@ -1,4 +1,4 @@ -namespace TypeShape.Tests.FSharp +namespace PolyType.Tests.FSharp type FSharpRecord = { diff --git a/src/TypeShape.TestCases/ITestCase.cs b/src/PolyType.TestCases/ITestCase.cs similarity index 97% rename from src/TypeShape.TestCases/ITestCase.cs rename to src/PolyType.TestCases/ITestCase.cs index a578aca..e7f00e3 100644 --- a/src/TypeShape.TestCases/ITestCase.cs +++ b/src/PolyType.TestCases/ITestCase.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Tests; +namespace PolyType.Tests; /// /// Represents a test case for a type shape and its value. diff --git a/src/TypeShape.TestCases/TypeShape.TestCases.csproj b/src/PolyType.TestCases/PolyType.TestCases.csproj similarity index 70% rename from src/TypeShape.TestCases/TypeShape.TestCases.csproj rename to src/PolyType.TestCases/PolyType.TestCases.csproj index b6921bb..e57c4c8 100644 --- a/src/TypeShape.TestCases/TypeShape.TestCases.csproj +++ b/src/PolyType.TestCases/PolyType.TestCases.csproj @@ -13,9 +13,9 @@ - - - + + + diff --git a/src/TypeShape.TestCases/README.md b/src/PolyType.TestCases/README.md similarity index 92% rename from src/TypeShape.TestCases/README.md rename to src/PolyType.TestCases/README.md index c7aa4d3..70f3b34 100644 --- a/src/TypeShape.TestCases/README.md +++ b/src/PolyType.TestCases/README.md @@ -1,6 +1,6 @@ -# TypeShape consumer test cases +# PolyType consumer test cases -This package is intended for consumption by your unit test project. It presents a bunch of types that help to exhaustively test your TypeShape visitors. +This package is intended for consumption by your unit test project. It presents a bunch of types that help to exhaustively test your PolyType visitors. ```cs [Theory] diff --git a/src/TypeShape.TestCases/ReflectionHelpers.cs b/src/PolyType.TestCases/ReflectionHelpers.cs similarity index 100% rename from src/TypeShape.TestCases/ReflectionHelpers.cs rename to src/PolyType.TestCases/ReflectionHelpers.cs diff --git a/src/TypeShape.TestCases/TestCase.cs b/src/PolyType.TestCases/TestCase.cs similarity index 97% rename from src/TypeShape.TestCases/TestCase.cs rename to src/PolyType.TestCases/TestCase.cs index 18541be..a1fe452 100644 --- a/src/TypeShape.TestCases/TestCase.cs +++ b/src/PolyType.TestCases/TestCase.cs @@ -1,9 +1,9 @@ using System.Collections; using System.Runtime.CompilerServices; -using TypeShape.Abstractions; -using TypeShape.ReflectionProvider; +using PolyType.Abstractions; +using PolyType.ReflectionProvider; -namespace TypeShape.Tests; +namespace PolyType.Tests; /// /// Defines a set of factory methods for building test cases. diff --git a/src/TypeShape.TestCases/TestCaseOfT.cs b/src/PolyType.TestCases/TestCaseOfT.cs similarity index 98% rename from src/TypeShape.TestCases/TestCaseOfT.cs rename to src/PolyType.TestCases/TestCaseOfT.cs index 6bfa503..70c69a4 100644 --- a/src/TypeShape.TestCases/TestCaseOfT.cs +++ b/src/PolyType.TestCases/TestCaseOfT.cs @@ -1,8 +1,8 @@ using System.Collections; using System.Runtime.CompilerServices; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.Tests; +namespace PolyType.Tests; /// /// Represents a test case whose shape is provided by an implementation. diff --git a/src/TypeShape.TestCases/TestTypes.cs b/src/PolyType.TestCases/TestTypes.cs similarity index 99% rename from src/TypeShape.TestCases/TestTypes.cs rename to src/PolyType.TestCases/TestTypes.cs index 437558f..a407da4 100644 --- a/src/TypeShape.TestCases/TestTypes.cs +++ b/src/PolyType.TestCases/TestTypes.cs @@ -10,9 +10,9 @@ using System.Text; using System.Text.Json.Serialization; using Microsoft.FSharp.Collections; -using TypeShape.Tests.FSharp; +using PolyType.Tests.FSharp; -namespace TypeShape.Tests; +namespace PolyType.Tests; /// /// Defines all the test cases for use as member data in Xunit theories. @@ -1627,7 +1627,7 @@ public ClassWithMultipleConstructors(int x, int y) [JsonConstructor] public ClassWithMultipleConstructors(int z) { - // TypeShape should automatically pick this ctor + // PolyType should automatically pick this ctor // as it maximizes the possible properties that get initialized. Z = z; diff --git a/src/TypeShape/Abstractions/CollectionConstructionStrategy.cs b/src/PolyType/Abstractions/CollectionConstructionStrategy.cs similarity index 95% rename from src/TypeShape/Abstractions/CollectionConstructionStrategy.cs rename to src/PolyType/Abstractions/CollectionConstructionStrategy.cs index f302546..7b2c1f5 100644 --- a/src/TypeShape/Abstractions/CollectionConstructionStrategy.cs +++ b/src/PolyType/Abstractions/CollectionConstructionStrategy.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// The construction strategy use for a given or . diff --git a/src/TypeShape/Abstractions/ConstructorParameterKind.cs b/src/PolyType/Abstractions/ConstructorParameterKind.cs similarity index 92% rename from src/TypeShape/Abstractions/ConstructorParameterKind.cs rename to src/PolyType/Abstractions/ConstructorParameterKind.cs index 8135878..3cfb01e 100644 --- a/src/TypeShape/Abstractions/ConstructorParameterKind.cs +++ b/src/PolyType/Abstractions/ConstructorParameterKind.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Specifies the kind of constructor parameter. diff --git a/src/TypeShape/Abstractions/Delegates.cs b/src/PolyType/Abstractions/Delegates.cs similarity index 98% rename from src/TypeShape/Abstractions/Delegates.cs rename to src/PolyType/Abstractions/Delegates.cs index 713fc07..8ffa9cb 100644 --- a/src/TypeShape/Abstractions/Delegates.cs +++ b/src/PolyType/Abstractions/Delegates.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Delegate representing a property/field getter. diff --git a/src/TypeShape/Abstractions/IConstructorParameterShape.cs b/src/PolyType/Abstractions/IConstructorParameterShape.cs similarity index 99% rename from src/TypeShape/Abstractions/IConstructorParameterShape.cs rename to src/PolyType/Abstractions/IConstructorParameterShape.cs index 5f52b82..3f31cc1 100644 --- a/src/TypeShape/Abstractions/IConstructorParameterShape.cs +++ b/src/PolyType/Abstractions/IConstructorParameterShape.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a given .NET constructor parameter, diff --git a/src/TypeShape/Abstractions/IConstructorShape.cs b/src/PolyType/Abstractions/IConstructorShape.cs similarity index 99% rename from src/TypeShape/Abstractions/IConstructorShape.cs rename to src/PolyType/Abstractions/IConstructorShape.cs index c6770bf..1ec9443 100644 --- a/src/TypeShape/Abstractions/IConstructorShape.cs +++ b/src/PolyType/Abstractions/IConstructorShape.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a given .NET constructor. diff --git a/src/TypeShape/Abstractions/IDictionaryTypeShape.cs b/src/PolyType/Abstractions/IDictionaryTypeShape.cs similarity index 99% rename from src/TypeShape/Abstractions/IDictionaryTypeShape.cs rename to src/PolyType/Abstractions/IDictionaryTypeShape.cs index a08bea7..1f4586f 100644 --- a/src/TypeShape/Abstractions/IDictionaryTypeShape.cs +++ b/src/PolyType/Abstractions/IDictionaryTypeShape.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a .NET type that is a dictionary. diff --git a/src/TypeShape/Abstractions/IEnumTypeShape.cs b/src/PolyType/Abstractions/IEnumTypeShape.cs similarity index 96% rename from src/TypeShape/Abstractions/IEnumTypeShape.cs rename to src/PolyType/Abstractions/IEnumTypeShape.cs index 9e88ac8..3243e1f 100644 --- a/src/TypeShape/Abstractions/IEnumTypeShape.cs +++ b/src/PolyType/Abstractions/IEnumTypeShape.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a .NET enum. diff --git a/src/TypeShape/Abstractions/IEnumerableTypeShape.cs b/src/PolyType/Abstractions/IEnumerableTypeShape.cs similarity index 99% rename from src/TypeShape/Abstractions/IEnumerableTypeShape.cs rename to src/PolyType/Abstractions/IEnumerableTypeShape.cs index a9821d4..5215b67 100644 --- a/src/TypeShape/Abstractions/IEnumerableTypeShape.cs +++ b/src/PolyType/Abstractions/IEnumerableTypeShape.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a .NET type that is enumerable. diff --git a/src/TypeShape/Abstractions/INullableTypeShape.cs b/src/PolyType/Abstractions/INullableTypeShape.cs similarity index 96% rename from src/TypeShape/Abstractions/INullableTypeShape.cs rename to src/PolyType/Abstractions/INullableTypeShape.cs index bdb18a7..db6fde8 100644 --- a/src/TypeShape/Abstractions/INullableTypeShape.cs +++ b/src/PolyType/Abstractions/INullableTypeShape.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a .NET type. diff --git a/src/TypeShape/Abstractions/IObjectTypeShape.cs b/src/PolyType/Abstractions/IObjectTypeShape.cs similarity index 98% rename from src/TypeShape/Abstractions/IObjectTypeShape.cs rename to src/PolyType/Abstractions/IObjectTypeShape.cs index f22d31b..ba0f907 100644 --- a/src/TypeShape/Abstractions/IObjectTypeShape.cs +++ b/src/PolyType/Abstractions/IObjectTypeShape.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a .NET object. diff --git a/src/TypeShape/Abstractions/IPropertyShape.cs b/src/PolyType/Abstractions/IPropertyShape.cs similarity index 99% rename from src/TypeShape/Abstractions/IPropertyShape.cs rename to src/PolyType/Abstractions/IPropertyShape.cs index 5e376e7..584f723 100644 --- a/src/TypeShape/Abstractions/IPropertyShape.cs +++ b/src/PolyType/Abstractions/IPropertyShape.cs @@ -1,7 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a given .NET instance property or field. diff --git a/src/TypeShape/Abstractions/ITypeShape.cs b/src/PolyType/Abstractions/ITypeShape.cs similarity index 98% rename from src/TypeShape/Abstractions/ITypeShape.cs rename to src/PolyType/Abstractions/ITypeShape.cs index 836652a..efe0573 100644 --- a/src/TypeShape/Abstractions/ITypeShape.cs +++ b/src/PolyType/Abstractions/ITypeShape.cs @@ -1,6 +1,6 @@ using System.Reflection; -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a strongly typed shape model for a given .NET type. diff --git a/src/TypeShape/Abstractions/ITypeShapeFunc.cs b/src/PolyType/Abstractions/ITypeShapeFunc.cs similarity index 95% rename from src/TypeShape/Abstractions/ITypeShapeFunc.cs rename to src/PolyType/Abstractions/ITypeShapeFunc.cs index f442d96..23db167 100644 --- a/src/TypeShape/Abstractions/ITypeShapeFunc.cs +++ b/src/PolyType/Abstractions/ITypeShapeFunc.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// A generic function used to unpack instances. diff --git a/src/TypeShape/Abstractions/ITypeShapeVisitor.cs b/src/PolyType/Abstractions/ITypeShapeVisitor.cs similarity index 99% rename from src/TypeShape/Abstractions/ITypeShapeVisitor.cs rename to src/PolyType/Abstractions/ITypeShapeVisitor.cs index d3d6048..3934abf 100644 --- a/src/TypeShape/Abstractions/ITypeShapeVisitor.cs +++ b/src/PolyType/Abstractions/ITypeShapeVisitor.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a visitor for strongly-typed traversal of .NET types. diff --git a/src/TypeShape/Abstractions/TypeShapeKind.cs b/src/PolyType/Abstractions/TypeShapeKind.cs similarity index 95% rename from src/TypeShape/Abstractions/TypeShapeKind.cs rename to src/PolyType/Abstractions/TypeShapeKind.cs index 789bbea..c42cd12 100644 --- a/src/TypeShape/Abstractions/TypeShapeKind.cs +++ b/src/PolyType/Abstractions/TypeShapeKind.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Defines kinds of an instance. diff --git a/src/TypeShape/Abstractions/TypeShapeProvider.cs b/src/PolyType/Abstractions/TypeShapeProvider.cs similarity index 94% rename from src/TypeShape/Abstractions/TypeShapeProvider.cs rename to src/PolyType/Abstractions/TypeShapeProvider.cs index df340fd..93a2b89 100644 --- a/src/TypeShape/Abstractions/TypeShapeProvider.cs +++ b/src/PolyType/Abstractions/TypeShapeProvider.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Helper methods for extracting instances from shape providers. @@ -40,5 +40,5 @@ public static ITypeShape Resolve(this ITypeShapeProvider shapeProvider) /// An instance describing . /// does not support . public static ITypeShape Resolve(this ITypeShapeProvider shapeProvider, Type type) - => shapeProvider.GetShape(type) ?? throw new NotSupportedException($"The TypeShape provider '{shapeProvider.GetType()}' does not support type '{type}'."); + => shapeProvider.GetShape(type) ?? throw new NotSupportedException($"The PolyType provider '{shapeProvider.GetType()}' does not support type '{type}'."); } \ No newline at end of file diff --git a/src/TypeShape/Abstractions/TypeShapeVisitor.cs b/src/PolyType/Abstractions/TypeShapeVisitor.cs similarity index 99% rename from src/TypeShape/Abstractions/TypeShapeVisitor.cs rename to src/PolyType/Abstractions/TypeShapeVisitor.cs index 9edb5aa..f9a5c5f 100644 --- a/src/TypeShape/Abstractions/TypeShapeVisitor.cs +++ b/src/PolyType/Abstractions/TypeShapeVisitor.cs @@ -1,4 +1,4 @@ -namespace TypeShape.Abstractions; +namespace PolyType.Abstractions; /// /// Provides a visitor for strongly-typed traversal of .NET types. diff --git a/src/TypeShape/ConstructorShapeAttribute.cs b/src/PolyType/ConstructorShapeAttribute.cs similarity index 91% rename from src/TypeShape/ConstructorShapeAttribute.cs rename to src/PolyType/ConstructorShapeAttribute.cs index 66f22fa..ea97511 100644 --- a/src/TypeShape/ConstructorShapeAttribute.cs +++ b/src/PolyType/ConstructorShapeAttribute.cs @@ -1,4 +1,4 @@ -namespace TypeShape; +namespace PolyType; /// /// Indicates that the annotated constructor should be included in the shape model. diff --git a/src/TypeShape/GenerateShapeAttribute.cs b/src/PolyType/GenerateShapeAttribute.cs similarity index 80% rename from src/TypeShape/GenerateShapeAttribute.cs rename to src/PolyType/GenerateShapeAttribute.cs index bb53cd4..e8ff7a9 100644 --- a/src/TypeShape/GenerateShapeAttribute.cs +++ b/src/PolyType/GenerateShapeAttribute.cs @@ -1,15 +1,15 @@ -namespace TypeShape; +namespace PolyType; /// /// When applied on a partial type, this attribute instructs the -/// TypeShape source generator to emit an +/// PolyType source generator to emit an /// implementation for the annotated type. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false, Inherited = false)] public sealed class GenerateShapeAttribute : Attribute; /// -/// When applied on a partial class, instructs the TypeShape source generator +/// When applied on a partial class, instructs the PolyType source generator /// to emit an implementation that /// includes a shape definition for . /// diff --git a/src/TypeShape/IShapeableOfT.cs b/src/PolyType/IShapeableOfT.cs similarity index 74% rename from src/TypeShape/IShapeableOfT.cs rename to src/PolyType/IShapeableOfT.cs index dfb8352..7472486 100644 --- a/src/TypeShape/IShapeableOfT.cs +++ b/src/PolyType/IShapeableOfT.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape; +namespace PolyType; /// /// Defines a static abstract factory providing a instance. @@ -9,7 +9,7 @@ namespace TypeShape; public interface IShapeable { /// - /// Gets the TypeShape instance corresponding to . + /// Gets the PolyType instance corresponding to . /// /// The shape for . static abstract ITypeShape GetShape(); diff --git a/src/TypeShape/ITypeShapeProvider.cs b/src/PolyType/ITypeShapeProvider.cs similarity index 91% rename from src/TypeShape/ITypeShapeProvider.cs rename to src/PolyType/ITypeShapeProvider.cs index 55dd6c1..e2feda5 100644 --- a/src/TypeShape/ITypeShapeProvider.cs +++ b/src/PolyType/ITypeShapeProvider.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape; +namespace PolyType; /// /// Defines a provider for implementations. diff --git a/src/TypeShape/ParameterShapeAttribute.cs b/src/PolyType/ParameterShapeAttribute.cs similarity index 94% rename from src/TypeShape/ParameterShapeAttribute.cs rename to src/PolyType/ParameterShapeAttribute.cs index efc7ded..455f20b 100644 --- a/src/TypeShape/ParameterShapeAttribute.cs +++ b/src/PolyType/ParameterShapeAttribute.cs @@ -1,4 +1,4 @@ -namespace TypeShape; +namespace PolyType; /// /// Configures the shape of a parameter for a given constructor. diff --git a/src/TypeShape/TypeShape.csproj b/src/PolyType/PolyType.csproj similarity index 65% rename from src/TypeShape/TypeShape.csproj rename to src/PolyType/PolyType.csproj index b75201f..567785d 100644 --- a/src/TypeShape/TypeShape.csproj +++ b/src/PolyType/PolyType.csproj @@ -2,7 +2,6 @@ net8.0 true - typeshape-csharp true README.md true @@ -13,11 +12,11 @@ - + - + diff --git a/src/TypeShape/PropertyShapeAttribute.cs b/src/PolyType/PropertyShapeAttribute.cs similarity index 96% rename from src/TypeShape/PropertyShapeAttribute.cs rename to src/PolyType/PropertyShapeAttribute.cs index 9149b80..6f65362 100644 --- a/src/TypeShape/PropertyShapeAttribute.cs +++ b/src/PolyType/PropertyShapeAttribute.cs @@ -1,4 +1,4 @@ -namespace TypeShape; +namespace PolyType; /// /// Configures the shape of a property or field for a given type. diff --git a/src/TypeShape/README.md b/src/PolyType/README.md similarity index 71% rename from src/TypeShape/README.md rename to src/PolyType/README.md index 6001759..92cd954 100644 --- a/src/TypeShape/README.md +++ b/src/PolyType/README.md @@ -1,8 +1,8 @@ -# typeshape-csharp +# PolyType -Contains a proof-of-concept port of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) library, adapted to patterns and idioms available in C#. The library provides a type model that facilitates development of high-performance datatype-generic components such as serializers, loggers, transformers and validators. At its core, the programming model employs a [variation on the visitor pattern](https://www.microsoft.com/research/publication/generalized-algebraic-data-types-and-object-oriented-programming/) that enables strongly-typed traversal of arbitrary type graphs: it can be used to generate object traversal algorithms that incur zero allocation cost. See the [project website](https://eiriktsarpalis.github.io/typeshape-csharp) for additional guides and [API documentation](https://eiriktsarpalis.github.io/typeshape-csharp/api/TypeShape.html). +Contains a port of the [TypeShape](https://github.com/eiriktsarpalis/TypeShape) F# library, adapted to patterns and idioms available in C#. It provides a type model that facilitates development of high-performance datatype-generic components such as serializers, loggers, transformers and validators. At its core, the programming model employs a [variation on the visitor pattern](https://www.microsoft.com/research/publication/generalized-algebraic-data-types-and-object-oriented-programming/) that enables strongly-typed traversal of arbitrary type graphs: it can be used to generate object traversal algorithms that incur zero allocation cost. See the [project website](https://eiriktsarpalis.github.io/PolyType) for additional guides and [API documentation](https://eiriktsarpalis.github.io/PolyType/api/PolyType.html). -The project includes two shape model providers: one [reflection derived](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape/ReflectionProvider) and one [source generated](https://github.com/eiriktsarpalis/typeshape-csharp/tree/main/src/TypeShape.SourceGenerator). It follows that any datatype-generic application built on top of the shape model gets trim safety/NativeAOT support for free once it targets source generated models. +The project includes two shape model providers: one [reflection derived](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType/ReflectionProvider) and one [source generated](https://github.com/eiriktsarpalis/PolyType/tree/main/src/PolyType.SourceGenerator). It follows that any datatype-generic application built on top of the shape model gets trim safety/NativeAOT support for free once it targets source generated models. ## Using the library @@ -30,13 +30,13 @@ public partial class Witness; The library also provides a reflection-based provider: ```C# -using TypeShape.ReflectionProvider; +using PolyType.ReflectionProvider; ITypeShape shape = ReflectionTypeShapeProvider.Default.GetShape(); public record MyPoco(string x, string y); ``` -In both cases the providers will generate a strongly typed datatype model for `MyPoco`. Models for types can be fed into datatype-generic consumers that can be declared using TypeShape's visitor pattern. +In both cases the providers will generate a strongly typed datatype model for `MyPoco`. Models for types can be fed into datatype-generic consumers that can be declared using PolyType's visitor pattern. ## Example: Writing a datatype-generic counter @@ -101,7 +101,7 @@ Func pocoCounter = Counter.CreateCounter(); public partial record MyPoco(string? x, string? y); ``` -In essence, TypeShape uses the visitor to fold a strongly typed `Func` counter delegate, +In essence, PolyType uses the visitor to fold a strongly typed `Func` counter delegate, but the delegate itself doesn't depend on the visitor once invoked: it only defines a chain of strongly typed delegate invocations that are cheap to invoke once constructed: @@ -112,4 +112,4 @@ pocoCounter(new MyPoco(null, null)); // 1 pocoCounter(null); // 0 ``` -For more details, please consult the [README file](https://github.com/eiriktsarpalis/typeshape-csharp#readme) at the project page. +For more details, please consult the [README file](https://github.com/eiriktsarpalis/PolyType#readme) at the project page. diff --git a/src/TypeShape/ReflectionProvider/Helpers/CommonHelpers.cs b/src/PolyType/ReflectionProvider/Helpers/CommonHelpers.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/Helpers/CommonHelpers.cs rename to src/PolyType/ReflectionProvider/Helpers/CommonHelpers.cs index 3ccfbf6..c1df75e 100644 --- a/src/TypeShape/ReflectionProvider/Helpers/CommonHelpers.cs +++ b/src/PolyType/ReflectionProvider/Helpers/CommonHelpers.cs @@ -1,6 +1,6 @@ using System.Diagnostics; -namespace TypeShape; +namespace PolyType; internal static class CommonHelpers { diff --git a/src/TypeShape/ReflectionProvider/Helpers/ReflectionHelpers.cs b/src/PolyType/ReflectionProvider/Helpers/ReflectionHelpers.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/Helpers/ReflectionHelpers.cs rename to src/PolyType/ReflectionProvider/Helpers/ReflectionHelpers.cs index 04f1665..3b1a1d8 100644 --- a/src/TypeShape/ReflectionProvider/Helpers/ReflectionHelpers.cs +++ b/src/PolyType/ReflectionProvider/Helpers/ReflectionHelpers.cs @@ -4,7 +4,7 @@ using System.Reflection; using System.Text; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; #if !IS_TEST_PROJECT [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs b/src/PolyType/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs similarity index 94% rename from src/TypeShape/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs rename to src/PolyType/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs index 49992d7..fa937c6 100644 --- a/src/TypeShape/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs +++ b/src/PolyType/ReflectionProvider/MemberAccessors/IReflectionMemberAccessor.cs @@ -1,7 +1,7 @@ using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider.MemberAccessors; +namespace PolyType.ReflectionProvider.MemberAccessors; internal interface IReflectionMemberAccessor { diff --git a/src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs b/src/PolyType/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs rename to src/PolyType/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs index 1a7d875..0b22306 100644 --- a/src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs +++ b/src/PolyType/ReflectionProvider/MemberAccessors/ReflectionEmitMemberAccessor.cs @@ -5,9 +5,9 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider.MemberAccessors; +namespace PolyType.ReflectionProvider.MemberAccessors; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs b/src/PolyType/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs rename to src/PolyType/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs index ee67b98..256f9b4 100644 --- a/src/TypeShape/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs +++ b/src/PolyType/ReflectionProvider/MemberAccessors/ReflectionMemberAccessor.cs @@ -2,9 +2,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider.MemberAccessors; +namespace PolyType.ReflectionProvider.MemberAccessors; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionConstructorParameterShape.cs b/src/PolyType/ReflectionProvider/ReflectionConstructorParameterShape.cs similarity index 98% rename from src/TypeShape/ReflectionProvider/ReflectionConstructorParameterShape.cs rename to src/PolyType/ReflectionProvider/ReflectionConstructorParameterShape.cs index 81a956f..42e3356 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionConstructorParameterShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionConstructorParameterShape.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionConstructorShape.cs b/src/PolyType/ReflectionProvider/ReflectionConstructorShape.cs similarity index 98% rename from src/TypeShape/ReflectionProvider/ReflectionConstructorShape.cs rename to src/PolyType/ReflectionProvider/ReflectionConstructorShape.cs index 62035ea..0a57308 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionConstructorShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionConstructorShape.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; internal sealed class ReflectionConstructorShape( ReflectionTypeShapeProvider provider, diff --git a/src/TypeShape/ReflectionProvider/ReflectionDictionaryTypeShape.cs b/src/PolyType/ReflectionProvider/ReflectionDictionaryTypeShape.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/ReflectionDictionaryTypeShape.cs rename to src/PolyType/ReflectionProvider/ReflectionDictionaryTypeShape.cs index 4009b61..5289a62 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionDictionaryTypeShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionDictionaryTypeShape.cs @@ -3,10 +3,10 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; -using TypeShape.SourceGenModel; +using PolyType.Abstractions; +using PolyType.SourceGenModel; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionEnumTypeShape.cs b/src/PolyType/ReflectionProvider/ReflectionEnumTypeShape.cs similarity index 81% rename from src/TypeShape/ReflectionProvider/ReflectionEnumTypeShape.cs rename to src/PolyType/ReflectionProvider/ReflectionEnumTypeShape.cs index 90a8b03..092f22e 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionEnumTypeShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionEnumTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; internal sealed class ReflectionEnumTypeShape(ReflectionTypeShapeProvider provider) : IEnumTypeShape where TEnum : struct, Enum diff --git a/src/TypeShape/ReflectionProvider/ReflectionEnumerableTypeShape.cs b/src/PolyType/ReflectionProvider/ReflectionEnumerableTypeShape.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/ReflectionEnumerableTypeShape.cs rename to src/PolyType/ReflectionProvider/ReflectionEnumerableTypeShape.cs index 2e933a9..6681fbb 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionEnumerableTypeShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionEnumerableTypeShape.cs @@ -3,10 +3,10 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.InteropServices; -using TypeShape.Abstractions; -using TypeShape.SourceGenModel; +using PolyType.Abstractions; +using PolyType.SourceGenModel; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionNullableTypeShape.cs b/src/PolyType/ReflectionProvider/ReflectionNullableTypeShape.cs similarity index 77% rename from src/TypeShape/ReflectionProvider/ReflectionNullableTypeShape.cs rename to src/PolyType/ReflectionProvider/ReflectionNullableTypeShape.cs index b3083bc..508bf3d 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionNullableTypeShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionNullableTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; internal sealed class ReflectionNullableTypeShape(ReflectionTypeShapeProvider provider) : INullableTypeShape where T : struct diff --git a/src/TypeShape/ReflectionProvider/ReflectionObjectTypeShape.cs b/src/PolyType/ReflectionProvider/ReflectionObjectTypeShape.cs similarity index 99% rename from src/TypeShape/ReflectionProvider/ReflectionObjectTypeShape.cs rename to src/PolyType/ReflectionProvider/ReflectionObjectTypeShape.cs index 77f6d43..662fd5a 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionObjectTypeShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionObjectTypeShape.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionPropertyShape.cs b/src/PolyType/ReflectionProvider/ReflectionPropertyShape.cs similarity index 98% rename from src/TypeShape/ReflectionProvider/ReflectionPropertyShape.cs rename to src/PolyType/ReflectionProvider/ReflectionPropertyShape.cs index 62a39bd..9daed67 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionPropertyShape.cs +++ b/src/PolyType/ReflectionProvider/ReflectionPropertyShape.cs @@ -1,9 +1,9 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; [RequiresUnreferencedCode(ReflectionTypeShapeProvider.RequiresUnreferencedCodeMessage)] [RequiresDynamicCode(ReflectionTypeShapeProvider.RequiresDynamicCodeMessage)] diff --git a/src/TypeShape/ReflectionProvider/ReflectionTypeShapeProvider.cs b/src/PolyType/ReflectionProvider/ReflectionTypeShapeProvider.cs similarity index 97% rename from src/TypeShape/ReflectionProvider/ReflectionTypeShapeProvider.cs rename to src/PolyType/ReflectionProvider/ReflectionTypeShapeProvider.cs index 478974e..9f21f07 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionTypeShapeProvider.cs +++ b/src/PolyType/ReflectionProvider/ReflectionTypeShapeProvider.cs @@ -3,10 +3,10 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; -using TypeShape.Abstractions; -using TypeShape.ReflectionProvider.MemberAccessors; +using PolyType.Abstractions; +using PolyType.ReflectionProvider.MemberAccessors; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; /// /// Provides a implementation that uses reflection. @@ -15,8 +15,8 @@ namespace TypeShape.ReflectionProvider; [RequiresDynamicCode(RequiresDynamicCodeMessage)] public class ReflectionTypeShapeProvider : ITypeShapeProvider { - internal const string RequiresUnreferencedCodeMessage = "TypeShape Reflection provider requires unreferenced code."; - internal const string RequiresDynamicCodeMessage = "TypeShape Reflection provider requires dynamic code."; + internal const string RequiresUnreferencedCodeMessage = "PolyType Reflection provider requires unreferenced code."; + internal const string RequiresDynamicCodeMessage = "PolyType Reflection provider requires dynamic code."; /// /// Gets the default provider instance using configuration supported by the current platform. diff --git a/src/TypeShape/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs b/src/PolyType/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs similarity index 96% rename from src/TypeShape/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs rename to src/PolyType/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs index 649e557..3448fe4 100644 --- a/src/TypeShape/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs +++ b/src/PolyType/ReflectionProvider/ReflectionTypeShapeProviderOptions.cs @@ -1,7 +1,7 @@ using System.Reflection; using System.Runtime.CompilerServices; -namespace TypeShape.ReflectionProvider; +namespace PolyType.ReflectionProvider; /// /// Exposes configuration options for the reflection-based type shape provider. diff --git a/src/TypeShape/SourceGenModel/Helpers/CollectionHelpers.cs b/src/PolyType/SourceGenModel/Helpers/CollectionHelpers.cs similarity index 99% rename from src/TypeShape/SourceGenModel/Helpers/CollectionHelpers.cs rename to src/PolyType/SourceGenModel/Helpers/CollectionHelpers.cs index 80f4b32..d586337 100644 --- a/src/TypeShape/SourceGenModel/Helpers/CollectionHelpers.cs +++ b/src/PolyType/SourceGenModel/Helpers/CollectionHelpers.cs @@ -2,7 +2,7 @@ using System.Diagnostics; using System.Runtime.InteropServices; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Collection helper methods to be consumed by the source generator. diff --git a/src/TypeShape/SourceGenModel/SourceGenConstructorParameterShape.cs b/src/PolyType/SourceGenModel/SourceGenConstructorParameterShape.cs similarity index 97% rename from src/TypeShape/SourceGenModel/SourceGenConstructorParameterShape.cs rename to src/PolyType/SourceGenModel/SourceGenConstructorParameterShape.cs index 145dfe3..e46cf56 100644 --- a/src/TypeShape/SourceGenModel/SourceGenConstructorParameterShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenConstructorParameterShape.cs @@ -1,7 +1,7 @@ using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for a constructor parameter shape. diff --git a/src/TypeShape/SourceGenModel/SourceGenConstructorShape.cs b/src/PolyType/SourceGenModel/SourceGenConstructorShape.cs similarity index 97% rename from src/TypeShape/SourceGenModel/SourceGenConstructorShape.cs rename to src/PolyType/SourceGenModel/SourceGenConstructorShape.cs index e66da2d..cbeda65 100644 --- a/src/TypeShape/SourceGenModel/SourceGenConstructorShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenConstructorShape.cs @@ -1,7 +1,7 @@ using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for a constructor shape. diff --git a/src/TypeShape/SourceGenModel/SourceGenDictionaryTypeShape.cs b/src/PolyType/SourceGenModel/SourceGenDictionaryTypeShape.cs similarity index 97% rename from src/TypeShape/SourceGenModel/SourceGenDictionaryTypeShape.cs rename to src/PolyType/SourceGenModel/SourceGenDictionaryTypeShape.cs index 50a3a7d..15b15ab 100644 --- a/src/TypeShape/SourceGenModel/SourceGenDictionaryTypeShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenDictionaryTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for dictionary shapes. diff --git a/src/TypeShape/SourceGenModel/SourceGenEnumTypeShape.cs b/src/PolyType/SourceGenModel/SourceGenEnumTypeShape.cs similarity index 90% rename from src/TypeShape/SourceGenModel/SourceGenEnumTypeShape.cs rename to src/PolyType/SourceGenModel/SourceGenEnumTypeShape.cs index d90c4bd..0f1d85b 100644 --- a/src/TypeShape/SourceGenModel/SourceGenEnumTypeShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenEnumTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for enum shapes. diff --git a/src/TypeShape/SourceGenModel/SourceGenEnumerableTypeShape.cs b/src/PolyType/SourceGenModel/SourceGenEnumerableTypeShape.cs similarity index 97% rename from src/TypeShape/SourceGenModel/SourceGenEnumerableTypeShape.cs rename to src/PolyType/SourceGenModel/SourceGenEnumerableTypeShape.cs index bd232c8..c937e89 100644 --- a/src/TypeShape/SourceGenModel/SourceGenEnumerableTypeShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenEnumerableTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for enumerable shapes. diff --git a/src/TypeShape/SourceGenModel/SourceGenNullableTypeShape.cs b/src/PolyType/SourceGenModel/SourceGenNullableTypeShape.cs similarity index 88% rename from src/TypeShape/SourceGenModel/SourceGenNullableTypeShape.cs rename to src/PolyType/SourceGenModel/SourceGenNullableTypeShape.cs index ccc8407..c44c394 100644 --- a/src/TypeShape/SourceGenModel/SourceGenNullableTypeShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenNullableTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for nullable types. diff --git a/src/TypeShape/SourceGenModel/SourceGenObjectTypeShape.cs b/src/PolyType/SourceGenModel/SourceGenObjectTypeShape.cs similarity index 95% rename from src/TypeShape/SourceGenModel/SourceGenObjectTypeShape.cs rename to src/PolyType/SourceGenModel/SourceGenObjectTypeShape.cs index a931088..8cad163 100644 --- a/src/TypeShape/SourceGenModel/SourceGenObjectTypeShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenObjectTypeShape.cs @@ -1,6 +1,6 @@ -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for object type shapes. diff --git a/src/TypeShape/SourceGenModel/SourceGenPropertyShape.cs b/src/PolyType/SourceGenModel/SourceGenPropertyShape.cs similarity index 97% rename from src/TypeShape/SourceGenModel/SourceGenPropertyShape.cs rename to src/PolyType/SourceGenModel/SourceGenPropertyShape.cs index 1d7ff3f..fd4ee4a 100644 --- a/src/TypeShape/SourceGenModel/SourceGenPropertyShape.cs +++ b/src/PolyType/SourceGenModel/SourceGenPropertyShape.cs @@ -1,7 +1,7 @@ using System.Reflection; -using TypeShape.Abstractions; +using PolyType.Abstractions; -namespace TypeShape.SourceGenModel; +namespace PolyType.SourceGenModel; /// /// Source generator model for a property shape. diff --git a/src/TypeShape/Utilities/ReflectionUtilities.cs b/src/PolyType/Utilities/ReflectionUtilities.cs similarity index 95% rename from src/TypeShape/Utilities/ReflectionUtilities.cs rename to src/PolyType/Utilities/ReflectionUtilities.cs index 00b7dc7..847eac7 100644 --- a/src/TypeShape/Utilities/ReflectionUtilities.cs +++ b/src/PolyType/Utilities/ReflectionUtilities.cs @@ -1,9 +1,9 @@ using System.Reflection; -namespace TypeShape.Utilities; +namespace PolyType.Utilities; /// -/// Defines a set of common reflection utilities for use by TypeShape applications. +/// Defines a set of common reflection utilities for use by PolyType applications. /// public static class ReflectionUtilities { diff --git a/tests/TypeShape.Benchmarks/CounterBenchmark.cs b/tests/PolyType.Benchmarks/CounterBenchmark.cs similarity index 95% rename from tests/TypeShape.Benchmarks/CounterBenchmark.cs rename to tests/PolyType.Benchmarks/CounterBenchmark.cs index d62b0f1..128799a 100644 --- a/tests/TypeShape.Benchmarks/CounterBenchmark.cs +++ b/tests/PolyType.Benchmarks/CounterBenchmark.cs @@ -1,8 +1,8 @@ using BenchmarkDotNet.Attributes; -using TypeShape.Examples.Counter; -using TypeShape.ReflectionProvider; +using PolyType.Examples.Counter; +using PolyType.ReflectionProvider; -namespace TypeShape.Benchmarks; +namespace PolyType.Benchmarks; [MemoryDiagnoser] public partial class CounterBenchmark diff --git a/tests/TypeShape.Benchmarks/JsonBenchmark.cs b/tests/PolyType.Benchmarks/JsonBenchmark.cs similarity index 78% rename from tests/TypeShape.Benchmarks/JsonBenchmark.cs rename to tests/PolyType.Benchmarks/JsonBenchmark.cs index d7368c3..2038a0e 100644 --- a/tests/TypeShape.Benchmarks/JsonBenchmark.cs +++ b/tests/PolyType.Benchmarks/JsonBenchmark.cs @@ -3,9 +3,9 @@ using System.Text.Json; using System.Text.Json.Serialization; using System.Text.Json.Serialization.Metadata; -using TypeShape; -using TypeShape.Examples.JsonSerializer; -using TypeShape.ReflectionProvider; +using PolyType; +using PolyType.Examples.JsonSerializer; +using PolyType.ReflectionProvider; public static class JsonData { @@ -21,8 +21,8 @@ public static class JsonData public static readonly JsonTypeInfo StjSourceGenInfo = StjContext.Default.MyPoco; public static readonly JsonTypeInfo StjSourceGenInfo_fastPath = StjContext_FastPath.Default.MyPoco; - public static readonly JsonConverter TypeShapeReflection = JsonSerializerTS.CreateConverter(ReflectionTypeShapeProvider.Default); - public static readonly JsonConverter TypeShapeSourceGen = JsonSerializerTS.CreateConverter(); + public static readonly JsonConverter PolyTypeReflection = JsonSerializerTS.CreateConverter(ReflectionTypeShapeProvider.Default); + public static readonly JsonConverter PolyTypeSourceGen = JsonSerializerTS.CreateConverter(); } [MemoryDiagnoser(false)] @@ -60,16 +60,16 @@ public void Serialize_StjSourceGen_FastPath() } [Benchmark] - public void Serialize_TypeShapeReflection() + public void Serialize_PolyTypeReflection() { - JsonData.TypeShapeReflection.Serialize(_writer, JsonData.Value); + JsonData.PolyTypeReflection.Serialize(_writer, JsonData.Value); Reset(); } [Benchmark] - public void Serialize_TypeShapeSourceGen() + public void Serialize_PolyTypeSourceGen() { - JsonData.TypeShapeSourceGen.Serialize(_writer, JsonData.Value); + JsonData.PolyTypeSourceGen.Serialize(_writer, JsonData.Value); Reset(); } @@ -93,12 +93,12 @@ public class JsonDeserializeBenchmark => JsonSerializer.Deserialize(JsonData.Utf8JsonValue, JsonData.StjSourceGenInfo); [Benchmark] - public MyPoco? Deserialize_TypeShapeReflection() - => JsonData.TypeShapeReflection.Deserialize(JsonData.Utf8JsonValue); + public MyPoco? Deserialize_PolyTypeReflection() + => JsonData.PolyTypeReflection.Deserialize(JsonData.Utf8JsonValue); [Benchmark] - public MyPoco? Deserialize_TypeShapeSourceGen() - => JsonData.TypeShapeSourceGen.Deserialize(JsonData.Utf8JsonValue); + public MyPoco? Deserialize_PolyTypeSourceGen() + => JsonData.PolyTypeSourceGen.Deserialize(JsonData.Utf8JsonValue); } [GenerateShape] diff --git a/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.csproj b/tests/PolyType.Benchmarks/PolyType.Benchmarks.csproj similarity index 64% rename from tests/TypeShape.Benchmarks/TypeShape.Benchmarks.csproj rename to tests/PolyType.Benchmarks/PolyType.Benchmarks.csproj index 7bdbb74..57beb63 100644 --- a/tests/TypeShape.Benchmarks/TypeShape.Benchmarks.csproj +++ b/tests/PolyType.Benchmarks/PolyType.Benchmarks.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/tests/TypeShape.Benchmarks/Program.cs b/tests/PolyType.Benchmarks/Program.cs similarity index 100% rename from tests/TypeShape.Benchmarks/Program.cs rename to tests/PolyType.Benchmarks/Program.cs diff --git a/tests/TypeShape.SourceGenerator.UnitTests/CompilationHelpers.cs b/tests/PolyType.SourceGenerator.UnitTests/CompilationHelpers.cs similarity index 97% rename from tests/TypeShape.SourceGenerator.UnitTests/CompilationHelpers.cs rename to tests/PolyType.SourceGenerator.UnitTests/CompilationHelpers.cs index 2e5252e..464ecac 100644 --- a/tests/TypeShape.SourceGenerator.UnitTests/CompilationHelpers.cs +++ b/tests/PolyType.SourceGenerator.UnitTests/CompilationHelpers.cs @@ -4,11 +4,11 @@ using System.Collections.Immutable; using System.Reflection; using System.Text.Encodings.Web; -using TypeShape.Roslyn; -using TypeShape.SourceGenerator.Model; +using PolyType.Roslyn; +using PolyType.SourceGenerator.Model; using Xunit; -namespace TypeShape.SourceGenerator.UnitTests; +namespace PolyType.SourceGenerator.UnitTests; public record TypeShapeSourceGeneratorResult { @@ -51,7 +51,7 @@ public static Compilation CreateCompilation( MetadataReference.CreateFromFile(typeof(JavaScriptEncoder).Assembly.Location), MetadataReference.CreateFromFile(typeof(LinkedList<>).Assembly.Location), MetadataReference.CreateFromFile(systemRuntimeAssembly.Location), - MetadataReference.CreateFromFile(typeof(TypeShape.Abstractions.ITypeShape).Assembly.Location), + MetadataReference.CreateFromFile(typeof(PolyType.Abstractions.ITypeShape).Assembly.Location), MetadataReference.CreateFromFile(typeof(System.Runtime.CompilerServices.Unsafe).Assembly.Location), .. additionalReferences, ]; diff --git a/tests/TypeShape.SourceGenerator.UnitTests/CompilationTests.cs b/tests/PolyType.SourceGenerator.UnitTests/CompilationTests.cs similarity index 93% rename from tests/TypeShape.SourceGenerator.UnitTests/CompilationTests.cs rename to tests/PolyType.SourceGenerator.UnitTests/CompilationTests.cs index 13c67d2..d39495d 100644 --- a/tests/TypeShape.SourceGenerator.UnitTests/CompilationTests.cs +++ b/tests/PolyType.SourceGenerator.UnitTests/CompilationTests.cs @@ -2,7 +2,7 @@ using Microsoft.CodeAnalysis.CSharp; using Xunit; -namespace TypeShape.SourceGenerator.UnitTests; +namespace PolyType.SourceGenerator.UnitTests; public static class CompilationTests { @@ -10,8 +10,8 @@ public static class CompilationTests public static void CompileSimplePoco_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; - using TypeShape.Abstractions; + using PolyType; + using PolyType.Abstractions; using System.Collections.Generic; [GenerateShape] @@ -41,7 +41,7 @@ public static ITypeShape Test() public static void CompileSimpleRecord_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public partial record MyRecord(string value); @@ -55,7 +55,7 @@ public partial record MyRecord(string value); public static void CompileSimpleCollection_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; using System.Collections; [GenerateShape] @@ -70,7 +70,7 @@ public partial class MyWitness; public static void CompileClassWithMultipleSetters_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public partial class ClassWithParameterizedConstructorAndMultiplePropertySetters(int x00) @@ -98,7 +98,7 @@ public partial class ClassWithParameterizedConstructorAndMultiplePropertySetters public static void ClassWithSetsRequiredMembersConstructor_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; using System.Diagnostics.CodeAnalysis; [GenerateShape] @@ -122,8 +122,8 @@ public MyClass(int value) public static void UseTypesWithNullableAnnotations_NoWarnings() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; - using TypeShape.Abstractions; + using PolyType; + using PolyType.Abstractions; using System.Collections.Generic; #nullable enable @@ -156,7 +156,7 @@ public partial class MyProvider { } public static void DerivedClassWithShadowedMembers_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; #nullable enable public record BaseClassWithShadowingMembers @@ -185,8 +185,8 @@ public partial record DerivedClassWithShadowingMember : BaseClassWithShadowingMe public static void MultiplePartialContextDeclarations_NoErrors() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; - using TypeShape.Abstractions; + using PolyType; + using PolyType.Abstractions; public static class Test { @@ -211,9 +211,9 @@ public partial class MyWitness; [Fact] public static void EnumGeneration_NoErrors() { - // Regression test for https://github.com/eiriktsarpalis/typeshape-csharp/issues/29 + // Regression test for https://github.com/eiriktsarpalis/PolyType/issues/29 Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; enum MyEnum { A, B, C } @@ -228,10 +228,10 @@ partial class Witness { } [Fact] public static void XmlDocumentGeneration_GenerateShapeOfT_NoErrors() { - // Regression test for https://github.com/eiriktsarpalis/typeshape-csharp/issues/35 + // Regression test for https://github.com/eiriktsarpalis/PolyType/issues/35 CSharpParseOptions parseOptions = CompilationHelpers.CreateParseOptions(documentationMode: DocumentationMode.Diagnose); Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; /// My poco. public class MyPoco { } @@ -249,10 +249,10 @@ public partial class Witness { } [Fact] public static void XmlDocumentGeneration_GenerateShape_NoErrors() { - // Regression test for https://github.com/eiriktsarpalis/typeshape-csharp/issues/35 + // Regression test for https://github.com/eiriktsarpalis/PolyType/issues/35 CSharpParseOptions parseOptions = CompilationHelpers.CreateParseOptions(documentationMode: DocumentationMode.Diagnose); Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; /// My poco. [GenerateShape] diff --git a/tests/TypeShape.SourceGenerator.UnitTests/DiagnosticTests.cs b/tests/PolyType.SourceGenerator.UnitTests/DiagnosticTests.cs similarity index 96% rename from tests/TypeShape.SourceGenerator.UnitTests/DiagnosticTests.cs rename to tests/PolyType.SourceGenerator.UnitTests/DiagnosticTests.cs index e3b6c46..8a6c65e 100644 --- a/tests/TypeShape.SourceGenerator.UnitTests/DiagnosticTests.cs +++ b/tests/PolyType.SourceGenerator.UnitTests/DiagnosticTests.cs @@ -1,7 +1,7 @@ using Microsoft.CodeAnalysis; using Xunit; -namespace TypeShape.SourceGenerator.UnitTests; +namespace PolyType.SourceGenerator.UnitTests; public static class DiagnosticTests { @@ -9,7 +9,7 @@ public static class DiagnosticTests public static void GenerateShapeOfT_UnsupportedType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public partial class ShapeProvider @@ -30,7 +30,7 @@ public partial class ShapeProvider public static void GenerateShape_NonPartialClass_ProducesError() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public class TypeToGenerate { } @@ -50,7 +50,7 @@ public class TypeToGenerate { } public static void GenerateShapeOfT_NonPartialClass_ProducesError() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public class ShapeProvider { } @@ -72,7 +72,7 @@ public class TypeToGenerate { } public static void GenerateShape_GenericType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public partial class GenericType @@ -94,7 +94,7 @@ public partial class GenericType public static void GenerateShape_NestedGenericType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; public partial class GenericContainer { @@ -119,7 +119,7 @@ public partial class TypeToGenerate public static void GenerateShapeOfT_GenericType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] public partial class Witness @@ -141,7 +141,7 @@ public partial class Witness public static void GenerateShapeOfT_NestedGenericType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; public partial class Container { @@ -166,7 +166,7 @@ public partial class Witness public static void GenerateShape_InaccessibleType_ProducesWarning() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; internal static partial class Container { @@ -189,7 +189,7 @@ private partial record TypeToGenerate(int x); public static void DuplicateConstructorShapeAttribute_ProducesWarnings() { Compilation compilation = CompilationHelpers.CreateCompilation(""" - using TypeShape; + using PolyType; [GenerateShape] partial class MyPoco diff --git a/tests/TypeShape.SourceGenerator.UnitTests/IncrementalCompilationTests.cs b/tests/PolyType.SourceGenerator.UnitTests/IncrementalCompilationTests.cs similarity index 92% rename from tests/TypeShape.SourceGenerator.UnitTests/IncrementalCompilationTests.cs rename to tests/PolyType.SourceGenerator.UnitTests/IncrementalCompilationTests.cs index 5271e97..6908b14 100644 --- a/tests/TypeShape.SourceGenerator.UnitTests/IncrementalCompilationTests.cs +++ b/tests/PolyType.SourceGenerator.UnitTests/IncrementalCompilationTests.cs @@ -1,21 +1,21 @@ using Microsoft.CodeAnalysis; -using TypeShape.SourceGenerator.Model; +using PolyType.SourceGenerator.Model; using Xunit; -namespace TypeShape.SourceGenerator.UnitTests; +namespace PolyType.SourceGenerator.UnitTests; public static class IncrementalCompilationTests { [Theory] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; public record MyPoco(int x, string[] ys); """)] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; @@ -25,7 +25,7 @@ public record MyPoco(int x, string[] ys); public partial class MyContext { } """)] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; @@ -33,7 +33,7 @@ namespace Test; public partial record MyPoco(int x, string[] ys); """)] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; @@ -56,7 +56,7 @@ public static void CompilingTheSameSourceResultsInEqualModels(string source) [Theory] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; @@ -66,7 +66,7 @@ public record MyPoco(int x, string[] ys, bool z); public partial class MyContext { } """, """ - using TypeShape; + using PolyType; namespace Test; @@ -88,7 +88,7 @@ public static void CompilingDifferentSourcesResultsInNotEqualModels(string sourc [Theory] [InlineData(""" - using TypeShape; + using PolyType; namespace Test; @@ -102,7 +102,7 @@ public class MyPoco public partial class MyContext { } """, """ - using TypeShape; + using PolyType; namespace Test; diff --git a/tests/TypeShape.SourceGenerator.UnitTests/TypeShape.SourceGenerator.UnitTests.csproj b/tests/PolyType.SourceGenerator.UnitTests/PolyType.SourceGenerator.UnitTests.csproj similarity index 88% rename from tests/TypeShape.SourceGenerator.UnitTests/TypeShape.SourceGenerator.UnitTests.csproj rename to tests/PolyType.SourceGenerator.UnitTests/PolyType.SourceGenerator.UnitTests.csproj index afb02bb..6c543e0 100644 --- a/tests/TypeShape.SourceGenerator.UnitTests/TypeShape.SourceGenerator.UnitTests.csproj +++ b/tests/PolyType.SourceGenerator.UnitTests/PolyType.SourceGenerator.UnitTests.csproj @@ -28,8 +28,8 @@ - - + + diff --git a/tests/TypeShape.Tests/CborTests.cs b/tests/PolyType.Tests/CborTests.cs similarity index 98% rename from tests/TypeShape.Tests/CborTests.cs rename to tests/PolyType.Tests/CborTests.cs index 762dd63..23156d1 100644 --- a/tests/TypeShape.Tests/CborTests.cs +++ b/tests/PolyType.Tests/CborTests.cs @@ -1,8 +1,8 @@ using System.Numerics; -using TypeShape.Examples.CborSerializer; +using PolyType.Examples.CborSerializer; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract partial class CborTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/ClonerTests.cs b/tests/PolyType.Tests/ClonerTests.cs similarity index 92% rename from tests/TypeShape.Tests/ClonerTests.cs rename to tests/PolyType.Tests/ClonerTests.cs index 2d355c4..c1ff56b 100644 --- a/tests/TypeShape.Tests/ClonerTests.cs +++ b/tests/PolyType.Tests/ClonerTests.cs @@ -1,9 +1,9 @@ -using TypeShape.Abstractions; -using TypeShape.Examples.Cloner; -using TypeShape.Examples.StructuralEquality; +using PolyType.Abstractions; +using PolyType.Examples.Cloner; +using PolyType.Examples.StructuralEquality; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class ClonerTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/ConfigurationBinderTests.cs b/tests/PolyType.Tests/ConfigurationBinderTests.cs similarity index 92% rename from tests/TypeShape.Tests/ConfigurationBinderTests.cs rename to tests/PolyType.Tests/ConfigurationBinderTests.cs index 4e6655f..ab527c9 100644 --- a/tests/TypeShape.Tests/ConfigurationBinderTests.cs +++ b/tests/PolyType.Tests/ConfigurationBinderTests.cs @@ -1,13 +1,13 @@ using Microsoft.Extensions.Configuration; using System.Text; using System.Text.Json.Serialization; -using TypeShape.Abstractions; -using TypeShape.Examples.ConfigurationBinder; -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.StructuralEquality; +using PolyType.Abstractions; +using PolyType.Examples.ConfigurationBinder; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.StructuralEquality; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class ConfigurationBinderTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/CounterTests.cs b/tests/PolyType.Tests/CounterTests.cs similarity index 97% rename from tests/TypeShape.Tests/CounterTests.cs rename to tests/PolyType.Tests/CounterTests.cs index 7974944..1bd170f 100644 --- a/tests/TypeShape.Tests/CounterTests.cs +++ b/tests/PolyType.Tests/CounterTests.cs @@ -1,7 +1,7 @@ -using TypeShape.Examples.Counter; +using PolyType.Examples.Counter; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract partial class CounterTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/IProviderUnderTest.cs b/tests/PolyType.Tests/IProviderUnderTest.cs similarity index 96% rename from tests/TypeShape.Tests/IProviderUnderTest.cs rename to tests/PolyType.Tests/IProviderUnderTest.cs index 0ef0ed0..b7a6692 100644 --- a/tests/TypeShape.Tests/IProviderUnderTest.cs +++ b/tests/PolyType.Tests/IProviderUnderTest.cs @@ -1,8 +1,8 @@ using System.Collections; -using TypeShape.Abstractions; -using TypeShape.ReflectionProvider; +using PolyType.Abstractions; +using PolyType.ReflectionProvider; -namespace TypeShape.Tests; +namespace PolyType.Tests; public interface IProviderUnderTest { diff --git a/tests/TypeShape.Tests/JsonSchemaTests.cs b/tests/PolyType.Tests/JsonSchemaTests.cs similarity index 97% rename from tests/TypeShape.Tests/JsonSchemaTests.cs rename to tests/PolyType.Tests/JsonSchemaTests.cs index d2a01d3..2aa4c80 100644 --- a/tests/TypeShape.Tests/JsonSchemaTests.cs +++ b/tests/PolyType.Tests/JsonSchemaTests.cs @@ -2,13 +2,13 @@ using System.Reflection; using System.Text.Json; using System.Text.Json.Nodes; -using TypeShape.Abstractions; -using TypeShape.Examples.JsonSchema; -using TypeShape.Examples.JsonSerializer; +using PolyType.Abstractions; +using PolyType.Examples.JsonSchema; +using PolyType.Examples.JsonSerializer; using Xunit; using Xunit.Sdk; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class JsonSchemaTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/JsonTests.cs b/tests/PolyType.Tests/JsonTests.cs similarity index 99% rename from tests/TypeShape.Tests/JsonTests.cs rename to tests/PolyType.Tests/JsonTests.cs index 0151172..97bebbe 100644 --- a/tests/TypeShape.Tests/JsonTests.cs +++ b/tests/PolyType.Tests/JsonTests.cs @@ -1,11 +1,11 @@ using System.Collections; using System.Text.Json; using System.Text.Json.Serialization; -using TypeShape.Examples.JsonSerializer; -using TypeShape.Examples.JsonSerializer.Converters; +using PolyType.Examples.JsonSerializer; +using PolyType.Examples.JsonSerializer.Converters; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract partial class JsonTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/ObjectMapperTests.cs b/tests/PolyType.Tests/ObjectMapperTests.cs similarity index 96% rename from tests/TypeShape.Tests/ObjectMapperTests.cs rename to tests/PolyType.Tests/ObjectMapperTests.cs index 7eb751a..5e01b09 100644 --- a/tests/TypeShape.Tests/ObjectMapperTests.cs +++ b/tests/PolyType.Tests/ObjectMapperTests.cs @@ -1,9 +1,9 @@ -using TypeShape.Abstractions; -using TypeShape.Examples.ObjectMapper; -using TypeShape.Examples.StructuralEquality; +using PolyType.Abstractions; +using PolyType.Examples.ObjectMapper; +using PolyType.Examples.StructuralEquality; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class ObjectMapperTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/TypeShape.Tests.csproj b/tests/PolyType.Tests/PolyType.Tests.csproj similarity index 59% rename from tests/TypeShape.Tests/TypeShape.Tests.csproj rename to tests/PolyType.Tests/PolyType.Tests.csproj index ae84377..a72dac4 100644 --- a/tests/TypeShape.Tests/TypeShape.Tests.csproj +++ b/tests/PolyType.Tests/PolyType.Tests.csproj @@ -10,8 +10,8 @@ - - + + @@ -29,11 +29,11 @@ - - - - - + + + + + diff --git a/tests/TypeShape.Tests/PrettyPrinterTests.cs b/tests/PolyType.Tests/PrettyPrinterTests.cs similarity index 96% rename from tests/TypeShape.Tests/PrettyPrinterTests.cs rename to tests/PolyType.Tests/PrettyPrinterTests.cs index 109b7ce..70026bd 100644 --- a/tests/TypeShape.Tests/PrettyPrinterTests.cs +++ b/tests/PolyType.Tests/PrettyPrinterTests.cs @@ -1,10 +1,10 @@ using System.Collections.Immutable; -using TypeShape.Abstractions; -using TypeShape.Examples.PrettyPrinter; -using TypeShape.ReflectionProvider; +using PolyType.Abstractions; +using PolyType.Examples.PrettyPrinter; +using PolyType.ReflectionProvider; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class PrettyPrinterTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/RandomGeneratorTests.cs b/tests/PolyType.Tests/RandomGeneratorTests.cs similarity index 90% rename from tests/TypeShape.Tests/RandomGeneratorTests.cs rename to tests/PolyType.Tests/RandomGeneratorTests.cs index 8d6321a..14f9118 100644 --- a/tests/TypeShape.Tests/RandomGeneratorTests.cs +++ b/tests/PolyType.Tests/RandomGeneratorTests.cs @@ -1,9 +1,9 @@ -using TypeShape.Abstractions; -using TypeShape.Examples.RandomGenerator; -using TypeShape.Examples.StructuralEquality; +using PolyType.Abstractions; +using PolyType.Examples.RandomGenerator; +using PolyType.Examples.StructuralEquality; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class RandomGeneratorTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/SourceGenProvider.cs b/tests/PolyType.Tests/SourceGenProvider.cs similarity index 98% rename from tests/TypeShape.Tests/SourceGenProvider.cs rename to tests/PolyType.Tests/SourceGenProvider.cs index ea0d89f..d51e401 100644 --- a/tests/TypeShape.Tests/SourceGenProvider.cs +++ b/tests/PolyType.Tests/SourceGenProvider.cs @@ -6,7 +6,7 @@ using System.Text; using System.Threading.Tasks; -namespace TypeShape.Tests; +namespace PolyType.Tests; [GenerateShape] [GenerateShape] diff --git a/tests/TypeShape.Tests/StructuralEqualityTests.cs b/tests/PolyType.Tests/StructuralEqualityTests.cs similarity index 98% rename from tests/TypeShape.Tests/StructuralEqualityTests.cs rename to tests/PolyType.Tests/StructuralEqualityTests.cs index bc60a54..02a5240 100644 --- a/tests/TypeShape.Tests/StructuralEqualityTests.cs +++ b/tests/PolyType.Tests/StructuralEqualityTests.cs @@ -1,7 +1,7 @@ -using TypeShape.Examples.StructuralEquality; +using PolyType.Examples.StructuralEquality; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract partial class StructuralEqualityTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/TypeShapeProviderTests.cs b/tests/PolyType.Tests/TypeShapeProviderTests.cs similarity index 99% rename from tests/TypeShape.Tests/TypeShapeProviderTests.cs rename to tests/PolyType.Tests/TypeShapeProviderTests.cs index 02bfb84..79e3eba 100644 --- a/tests/TypeShape.Tests/TypeShapeProviderTests.cs +++ b/tests/PolyType.Tests/TypeShapeProviderTests.cs @@ -2,12 +2,12 @@ using System.Collections.Immutable; using System.Reflection; using System.Text.Json; -using TypeShape.Abstractions; -using TypeShape.Examples.RandomGenerator; -using TypeShape.ReflectionProvider; +using PolyType.Abstractions; +using PolyType.Examples.RandomGenerator; +using PolyType.ReflectionProvider; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class TypeShapeProviderTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/ValidationTests.cs b/tests/PolyType.Tests/ValidationTests.cs similarity index 98% rename from tests/TypeShape.Tests/ValidationTests.cs rename to tests/PolyType.Tests/ValidationTests.cs index 7c79f35..35e18ef 100644 --- a/tests/TypeShape.Tests/ValidationTests.cs +++ b/tests/PolyType.Tests/ValidationTests.cs @@ -1,7 +1,7 @@ -using TypeShape.Examples.Validation; +using PolyType.Examples.Validation; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract partial class ValidationTests(IProviderUnderTest providerUnderTest) { diff --git a/tests/TypeShape.Tests/XmlTests.cs b/tests/PolyType.Tests/XmlTests.cs similarity index 98% rename from tests/TypeShape.Tests/XmlTests.cs rename to tests/PolyType.Tests/XmlTests.cs index bde02b2..0f1e151 100644 --- a/tests/TypeShape.Tests/XmlTests.cs +++ b/tests/PolyType.Tests/XmlTests.cs @@ -1,10 +1,10 @@ using System.Collections.Immutable; using System.Numerics; using System.Xml; -using TypeShape.Examples.XmlSerializer; +using PolyType.Examples.XmlSerializer; using Xunit; -namespace TypeShape.Tests; +namespace PolyType.Tests; public abstract class XmlTests(IProviderUnderTest providerUnderTest) {