Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish under LeviySoft Organization #3

Merged
merged 3 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
14 changes: 7 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# Visor

Tinkoff.Visor is a optics library for .NET

Tinkoff.Visor includes the following features:
- C# & F# support
- incremental lens code generator
LeviySoft.Visor is a optics library for .NET

## Rationale

Expand Down Expand Up @@ -50,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 All @@ -71,4 +67,8 @@ Sample.DescriptionLens.Set("replaced")(...);
- Traverse
- Fold
- Iso
- utility optics for collections
- utility optics for collections

## Other notes

LeviySoft.Visor is a fork of Tinkoff.Visor maintained independently and not related to Tinkoff in any kind.
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
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
17 changes: 0 additions & 17 deletions src/Tinkoff.Visor.Gen.FSharp/Gen.fs

This file was deleted.

94 changes: 0 additions & 94 deletions src/Tinkoff.Visor.Gen.FSharp/Impl.fs

This file was deleted.

Loading