Skip to content

Commit

Permalink
Rename projects & namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
danslapman committed Nov 18, 2023
1 parent 838ce5e commit 294a525
Show file tree
Hide file tree
Showing 23 changed files with 41 additions and 41 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ jobs:
- name: prepare version
run: |
echo "$VERSION"
- name: pack Tinkoff.Visor
- name: pack LeviySoft.Visor
run: |
cd src
dotnet pack Tinkoff.Visor/Tinkoff.Visor.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack Tinkoff.Visor.Gen
dotnet pack LeviySoft.Visor/LeviySoft.Visor.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack LeviySoft.Visor.Gen
run: |
cd src
dotnet pack Tinkoff.Visor.Gen/Tinkoff.Visor.Gen.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack Tinkoff.Visor.Gen.FSharp
dotnet pack LeviySoft.Visor.Gen/LeviySoft.Visor.Gen.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack LeviySoft.Visor.Gen.FSharp
run: |
cd src
dotnet pack Tinkoff.Visor.Gen.FSharp/Tinkoff.Visor.Gen.FSharp.fsproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack Tinkoff.Visor.LanguageExt
dotnet pack LeviySoft.Visor.Gen.FSharp/LeviySoft.Visor.Gen.FSharp.fsproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: pack LeviySoft.Visor.LanguageExt
run: |
cd src
dotnet pack Tinkoff.Visor.LanguageExt/Tinkoff.Visor.LanguageExt.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
dotnet pack LeviySoft.Visor.LanguageExt/LeviySoft.Visor.LanguageExt.csproj -c Release /p:Version=${{env.VERSION}} /p:PackageVersion=${{env.VERSION}}
- name: publish
run: |
cd src
dotnet nuget push **/Tinkoff.Visor.*.nupkg -k ${{secrets.NUGET_APIKEY}} -s https://www.nuget.org
dotnet nuget push **/LeviySoft.Visor.*.nupkg -k ${{secrets.NUGET_APIKEY}} -s https://www.nuget.org
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Visor

Tinkoff.Visor is a optics library for .NET
LeviySoft.Visor is a optics library for .NET

## Rationale

Expand Down Expand Up @@ -46,7 +46,7 @@ abstract over subtyping, with `Traverse` over enumerable structures etc.

## How-to

- install `Tinkoff.Visor` and `Tinkoff.Visor.Gen`
- install `LeviySoft.Visor` and `LeviySoft.Visor.Gen`
- add `[Optics]` attribute on your record and make your record partial

```csharp
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>Nullable,FS0025,FS0026</WarningsAsErrors>
<WarningsAsErrors>Nullable</WarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Shouldly;
using Xunit;

namespace Tinkoff.Visor.Gen.Tests;
namespace LeviySoft.Visor.Gen.Tests;

public class ChainedOpticTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tinkoff.Visor\Tinkoff.Visor.csproj" />
<ProjectReference Include="..\Tinkoff.Visor.Gen\Tinkoff.Visor.Gen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\LeviySoft.Visor\LeviySoft.Visor.csproj" />
<ProjectReference Include="..\LeviySoft.Visor.Gen\LeviySoft.Visor.Gen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Shouldly;
using Xunit;

namespace Tinkoff.Visor.Gen.Tests;
namespace LeviySoft.Visor.Gen.Tests;

public class OpticTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Tinkoff.Visor.Gen.Tests;
namespace LeviySoft.Visor.Gen.Tests;

[Optics]
internal partial record Inner(string Field);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Tinkoff.Visor.Gen
namespace LeviySoft.Visor.Gen
{
internal static class ContainingTypesBuilder
{
Expand Down Expand Up @@ -60,8 +60,8 @@ static void BuildType(ITypeSymbol symbol, StringBuilder output, bool buildNested
if (propertyType.EndsWith("?"))
output.AppendLine("#nullable enable");

output.AppendLine($"{Indent(initialIndent + 2)}public static global::Tinkoff.Visor.ILens<{symbol.ToFQF()}, {propertyType}> {propertyName}Lens =>");
output.AppendLine($"{Indent(initialIndent + 3)}global::Tinkoff.Visor.Lens<{symbol.ToFQF()}, {propertyType}>.New(");
output.AppendLine($"{Indent(initialIndent + 2)}public static global::LeviySoft.Visor.ILens<{symbol.ToFQF()}, {propertyType}> {propertyName}Lens =>");
output.AppendLine($"{Indent(initialIndent + 3)}global::LeviySoft.Visor.Lens<{symbol.ToFQF()}, {propertyType}>.New(");
output.AppendLine($"{Indent(initialIndent + 4)}p => p.{propertyName},");
output.AppendLine($"{Indent(initialIndent + 4)}f => p => p with {{{propertyName} = f(p.{propertyName})}}");
output.AppendLine($"{Indent(initialIndent + 3)});");
Expand Down Expand Up @@ -94,7 +94,7 @@ static void BuildNested(ITypeSymbol rootType, string suffix, IPropertySymbol sym
if (propertyType.EndsWith("?"))
output.AppendLine("#nullable enable");

output.AppendLine($"{Indent(initialIndent + 2)}public static global::Tinkoff.Visor.ILens<{rootType.ToFQF()}, {propertyType}> {propertyName}Lens =>");
output.AppendLine($"{Indent(initialIndent + 2)}public static global::LeviySoft.Visor.ILens<{rootType.ToFQF()}, {propertyType}> {propertyName}Lens =>");
output.AppendLine($"{Indent(initialIndent + 3)}{rootType.ToFQF()}.{suffix}{basePropertyName}Lens.Compose({basePropertyType}.{propertyName}Lens);");

if (propertyType.EndsWith("?"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Tinkoff.Visor.Gen
namespace LeviySoft.Visor.Gen
{
[Generator]
public class LensGenerator : IIncrementalGenerator
Expand All @@ -31,7 +31,7 @@ static bool IsSyntaxTargetForGeneration(SyntaxNode node)
static RecordDeclarationSyntax GetSemanticTargetForGeneration(GeneratorSyntaxContext context)
{
var rec = (RecordDeclarationSyntax)context.Node;
var attributeMetadata = context.SemanticModel.Compilation.GetTypeByMetadataName("Tinkoff.Visor.OpticsAttribute");
var attributeMetadata = context.SemanticModel.Compilation.GetTypeByMetadataName("LeviySoft.Visor.OpticsAttribute");

var model = context.SemanticModel.Compilation.GetSemanticModel(rec.SyntaxTree);
var symbol = model.GetDeclaredSymbol(rec) as ITypeSymbol;
Expand All @@ -46,7 +46,7 @@ static RecordDeclarationSyntax GetSemanticTargetForGeneration(GeneratorSyntaxCon

private void Execute(Compilation compilation, ImmutableArray<RecordDeclarationSyntax> records, SourceProductionContext context)
{
INamedTypeSymbol attributeMetadata = compilation.GetTypeByMetadataName("Tinkoff.Visor.OpticsAttribute");
INamedTypeSymbol attributeMetadata = compilation.GetTypeByMetadataName("LeviySoft.Visor.OpticsAttribute");

foreach (var rec in records.Distinct())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using Microsoft.CodeAnalysis;

namespace Tinkoff.Visor.Gen
namespace LeviySoft.Visor.Gen
{
public static class SymbolHelpers
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tinkoff.Visor.LanguageExt\Tinkoff.Visor.LanguageExt.csproj" />
<ProjectReference Include="..\LeviySoft.Visor.LanguageExt\LeviySoft.Visor.LanguageExt.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Xunit;
using static LanguageExt.Prelude;

namespace Tinkoff.Visor.LanguageExt.Tests;
namespace LeviySoft.Visor.LanguageExt.Tests;

public class PropertyTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tinkoff.Visor\Tinkoff.Visor.csproj" />
<ProjectReference Include="..\LeviySoft.Visor\LeviySoft.Visor.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using LanguageExt;
using System;

namespace Tinkoff.Visor.LanguageExt;
namespace LeviySoft.Visor.LanguageExt;

public static class Property
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tinkoff.Visor\Tinkoff.Visor.csproj" />
<ProjectReference Include="..\LeviySoft.Visor\LeviySoft.Visor.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Tinkoff.Visor;
namespace LeviySoft.Visor;

/// <summary>
/// Interface of Getter optic.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Tinkoff.Visor;
namespace LeviySoft.Visor;

/// <summary>
/// Interface of Lens optic.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Tinkoff.Visor;
namespace LeviySoft.Visor;

/// <summary>
/// Interface of Property optic (aka Optional).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Tinkoff.Visor;
namespace LeviySoft.Visor;

/// <summary>
/// Interface of Setter optic.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace Tinkoff.Visor;
namespace LeviySoft.Visor;

[AttributeUsage(AttributeTargets.Class)]
public class OpticsAttribute : Attribute
Expand Down
12 changes: 6 additions & 6 deletions src/Visor.sln
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
#
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor.Gen", "Tinkoff.Visor.Gen\Tinkoff.Visor.Gen.csproj", "{E8D2803F-6E57-440F-806A-27BB2575C0EB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor.Gen", "LeviySoft.Visor.Gen\LeviySoft.Visor.Gen.csproj", "{E8D2803F-6E57-440F-806A-27BB2575C0EB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor.Gen.Tests", "Tinkoff.Visor.Gen.Tests\Tinkoff.Visor.Gen.Tests.csproj", "{49597BF6-5B5E-4B82-8835-AF91B923D6F9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor.Gen.Tests", "LeviySoft.Visor.Gen.Tests\LeviySoft.Visor.Gen.Tests.csproj", "{49597BF6-5B5E-4B82-8835-AF91B923D6F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor", "Tinkoff.Visor\Tinkoff.Visor.csproj", "{2B90E9E6-6C06-42AA-95D2-C3366F79E98B}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor", "LeviySoft.Visor\LeviySoft.Visor.csproj", "{2B90E9E6-6C06-42AA-95D2-C3366F79E98B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor.Tests", "Tinkoff.Visor.Tests\Tinkoff.Visor.Tests.csproj", "{55D94966-7858-44C6-97A6-2CC0B3D22FDB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor.Tests", "LeviySoft.Visor.Tests\LeviySoft.Visor.Tests.csproj", "{55D94966-7858-44C6-97A6-2CC0B3D22FDB}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor.LanguageExt", "Tinkoff.Visor.LanguageExt\Tinkoff.Visor.LanguageExt.csproj", "{F9037238-BB0D-456C-A3AA-FED9CC7B7B05}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor.LanguageExt", "LeviySoft.Visor.LanguageExt\LeviySoft.Visor.LanguageExt.csproj", "{F9037238-BB0D-456C-A3AA-FED9CC7B7B05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tinkoff.Visor.LanguageExt.Tests", "Tinkoff.Visor.LanguageExt.Tests\Tinkoff.Visor.LanguageExt.Tests.csproj", "{0AE99366-1370-4DD4-A1AA-46B969FC9DA0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LeviySoft.Visor.LanguageExt.Tests", "LeviySoft.Visor.LanguageExt.Tests\LeviySoft.Visor.LanguageExt.Tests.csproj", "{0AE99366-1370-4DD4-A1AA-46B969FC9DA0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 294a525

Please sign in to comment.