Skip to content

Commit

Permalink
Merge pull request #845 from polyadic/package-metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bash authored Feb 5, 2025
2 parents 40b406d + b92d329 commit c59a394
Show file tree
Hide file tree
Showing 14 changed files with 1,091 additions and 0 deletions.
Binary file added Artwork/logo-green-rounded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Artwork/logo-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Artwork/logo-red-rounded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Artwork/logo-red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
912 changes: 912 additions & 0 deletions Artwork/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@
<Description>Analyzers to guide to the correct usage of Funcky.</Description>
<PackageTags>funcky, analyzers, roslyn</PackageTags>
<DevelopmentDependency>true</DevelopmentDependency>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>package.md</PackageReadmeFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Funcky.Analyzers\Funcky.Analyzers.csproj" PackAsAnalyzer="true" />
<ProjectReference Include="..\Funcky.Analyzers\Funcky.Analyzers.Roslyn4.0.csproj" PackAsAnalyzer="true" />
<ProjectReference Include="..\Funcky.Analyzers.CodeFixes\Funcky.Analyzers.CodeFixes.csproj" PackAsAnalyzer="true" />
<ProjectReference Include="..\Funcky.Analyzers.CodeFixes\Funcky.Analyzers.CodeFixes.Roslyn4.0.csproj" PackAsAnalyzer="true" />
</ItemGroup>
<ItemGroup>
<None Include="package.md" Pack="true" PackagePath="\" />
<None Include="..\..\Artwork\logo-red-rounded.png" Pack="true" PackagePath="\icon.png" Visible="false" />
</ItemGroup>
<ItemGroup>
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
<None Update="buildTransitive\$(PackageId).targets" Pack="true" PackagePath="%(Identity)" />
Expand Down
7 changes: 7 additions & 0 deletions Funcky.Analyzers/Funcky.Analyzers.Package/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Analyzers and code fixes that guide you towards idiomatic usage of [Funcky].

```xml
<PackageReference Include="Funcky.Analyzers" Version="..." PrivateAssets="all" />
```

[Funcky]: https://www.nuget.org/packages/Funcky
6 changes: 6 additions & 0 deletions Funcky.Async/Funcky.Async.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<VersionPrefix>1.4.1</VersionPrefix>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>package.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
Expand Down Expand Up @@ -49,6 +51,10 @@
<ItemGroup>
<ProjectReference Include="..\Funcky\Funcky.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\Artwork\logo-green-rounded.png" Pack="true" PackagePath="\icon.png" Visible="false" />
<None Include="package.md" Pack="true" PackagePath="\" />
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\FrameworkFeatureConstants.props" />
Expand Down
14 changes: 14 additions & 0 deletions Funcky.Async/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## About
Provides async counterparts for [Funcky]'s `IEnumerable` extensions,
`IEnumerable` generators, traversal and retrying.

## Main Types
* `Funcky.AsyncSequence`—Generate asynchronous sequences.
* `Funcky.Extensions.AsyncEnumerableExtensions`—Extensions for `IAsyncEnumerable`.
* `Funcky.AsyncFunctional`—Async Retrying.

## Feedback & Contributing
This package is released as open source under the MIT or Apache-2.0 license at your choice.
Bug reports and contributions are welcome at the [GitHub repository](https://github.com/polyadic/funcky).

[Funcky]: https://www.nuget.org/packages/Funcky
6 changes: 6 additions & 0 deletions Funcky.Xunit.v3/Funcky.Xunit.v3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<RootNamespace>Funcky</RootNamespace>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>package.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<EnablePackageValidation>true</EnablePackageValidation>
Expand All @@ -27,6 +29,7 @@
</ItemGroup>
<ItemGroup>
<None Include="build\$(PackageId).targets" Pack="true" PackagePath="build\" />
<None Include="package.md" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="PolySharp" PrivateAssets="all" />
Expand All @@ -38,6 +41,9 @@
<ItemGroup>
<ProjectReference Include="../Funcky/Funcky.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\Artwork\logo-green-rounded.png" Pack="true" PackagePath="\icon.png" Visible="false" />
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
</Project>
70 changes: 70 additions & 0 deletions Funcky.Xunit.v3/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
## About
Provides expressive assertions for xUnit.net 3.x that unpack [Funcky]'s monads.

It also enables `Option`, `Either` and `Unit` for use in theory data by providing
custom [serializers].

## Main Types
* `Funcky.FunctionalAssert`—Assertions for Funcky's monads.

## How to Use

### Test an Option
```csharp
var some = Option.Some("hello world");
var none = Option<int>.None;

// Asserts that an Option contains a value, returns its value.
var text = FunctionalAssert.Some(some);
Assert.Equal("hello world", text);

// Asserts that an Option contains the given value.
FunctionalAssert.Some("hello world", some);

// Asserts that the Option is empty.
FunctionalAssert.None(none);
```

### Test an Either
```csharp
var right = Either<string>.Return(42);
var left = Either<string, int>.Left("failure");

// Asserts that the Either is a right, returns the value.
var value = FunctionalAssert.Right(right);
Assert.Equal(42, value);

// Asserts that the Either is a right with the given value.
FunctionalAssert.Right(42, right);

// Asserts that the Either is a left, returns the value.
var message = FunctionalAssert.Left(left);
Assert.Equal("failure", message);

// Asserts that the Either is a left with the given value.
FunctionalAssert.Left("failure", left);
```

## Use an Option as theory data

```csharp
[Theory]
[MemberData(nameof(OptionValues))]
public void Example(Option<int> option) { /* ... */ }

public static TheoryData<Option<int>> OptionValues()
=> [
Option<int>.None,
Option.Some(10),
Option.Some(20),
];
```

## Feedback & Contributing
This package is released as open source under the MIT or Apache-2.0 license at your choice.
Bug reports and contributions are welcome at the [GitHub repository].


[Funcky]: https://www.nuget.org/packages/Funcky
[serializers]: https://xunit.net/docs/getting-started/v3/custom-serialization
[GitHub repository]: https://github.com/polyadic/funcky
6 changes: 6 additions & 0 deletions Funcky.Xunit/Funcky.Xunit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<RootNamespace>Funcky</RootNamespace>
<PackageIcon>icon.png</PackageIcon>
<PackageReadmeFile>package.md</PackageReadmeFile>
</PropertyGroup>
<PropertyGroup>
<EnablePackageValidation>true</EnablePackageValidation>
Expand All @@ -27,6 +29,10 @@
<ItemGroup>
<ProjectReference Include="../Funcky/Funcky.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="..\Artwork\logo-green-rounded.png" Pack="true" PackagePath="\icon.png" Visible="false" />
<None Include="package.md" Pack="true" PackagePath="\" />
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
</Project>
60 changes: 60 additions & 0 deletions Funcky.Xunit/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## About
Provides expressive assertions for xUnit.net 2.x that unpack [Funcky]'s monads.

## Main Types
* `Funcky.FunctionalAssert`—Assertions for Funcky's monads.
* `Funcky.Extensions.ToTheoryDataExtension`—Conveniently convert `IEnumerable`s to `TheoryData<..>`.

## How to Use

### Test an Option
```csharp
var some = Option.Some("hello world");
var none = Option<int>.None;

// Asserts that an Option contains a value, returns its value.
var text = FunctionalAssert.Some(some);
Assert.Equal("hello world", text);

// Asserts that an Option contains the given value.
FunctionalAssert.Some("hello world", some);

// Asserts that the Option is empty.
FunctionalAssert.None(none);
```

### Test an Either
```csharp
var right = Either<string>.Return(42);
var left = Either<string, int>.Left("failure");

// Asserts that the Either is a right, returns the value.
var value = FunctionalAssert.Right(right);
Assert.Equal(42, value);

// Asserts that the Either is a right with the given value.
FunctionalAssert.Right(42, right);

// Asserts that the Either is a left, returns the value.
var message = FunctionalAssert.Left(left);
Assert.Equal("failure", message);

// Asserts that the Either is a left with the given value.
FunctionalAssert.Left("failure", left);
```

### Create theory data from an `IEnumerable`

```csharp
public static TheoryData<string, int> Integers()
=> Enumerable.Range(0, 10)
.Select(n => (n.ToString(), n))
.ToTheoryData();
```

## Feedback & Contributing
This package is released as open source under the MIT or Apache-2.0 license at your choice.
Bug reports and contributions are welcome at the [GitHub repository].

[Funcky]: https://www.nuget.org/packages/Funcky
[GitHub repository]: https://github.com/polyadic/funcky
4 changes: 4 additions & 0 deletions Funcky/Funcky.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>
<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
Expand Down Expand Up @@ -56,6 +57,9 @@
<ItemGroup>
<EmbeddedResource Include="ILLink.LinkAttributes.xml" LogicalName="ILLink.LinkAttributes.xml" />
</ItemGroup>
<ItemGroup>
<None Include="..\Artwork\logo-green-rounded.png" Pack="true" PackagePath="\icon.png" Visible="false" />
</ItemGroup>
<Import Project="..\Analyzers.props" />
<Import Project="..\GlobalUsings.props" />
<Import Project="..\FrameworkFeatureConstants.props" />
Expand Down

0 comments on commit c59a394

Please sign in to comment.