Skip to content

Commit 4638da9

Browse files
committed
Add command to fetch and discover nuget oss stats
This command performs the following tasks: - Search all packages, sorted by most downloaded - Lookup each and determine if it has source repo information - If the source repo is github, lookup contributors This builds a map of: - GH users > repos > nugets This will allow sponsorlink to consider "oss authors" all GH users who have contributed to repos that produce nuget packages that are active and popular.
1 parent 3ec1b11 commit 4638da9

File tree

6 files changed

+386
-2
lines changed

6 files changed

+386
-2
lines changed

samples/dotnet/Analyzer/GraceApiAnalyzer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System.Collections.Immutable;
22
using System.Linq;
33
using Devlooped.Sponsors;
4-
using Humanizer;
54
using Microsoft.CodeAnalysis;
65
using Microsoft.CodeAnalysis.CSharp;
76
using Microsoft.CodeAnalysis.Diagnostics;

src/Cli/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#endif
1818

1919
var app = App.Create(out var services);
20+
#if DEBUG
21+
app.Configure(c => c.PropagateExceptions());
22+
#endif
2023

2124
if (args.Contains("-?"))
2225
args = args.Select(x => x == "-?" ? "-h" : x).ToArray();

src/Commands/App.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ public static CommandApp Create(out IServiceProvider services)
7373
config.AddCommand<SyncCommand>();
7474
config.AddCommand<ViewCommand>();
7575
config.AddCommand<WelcomeCommand>().IsHidden();
76+
config.AddCommand<NuGetStatsCommand>("nuget")
77+
#if !DEBUG
78+
.IsHidden()
79+
#endif
80+
;
7681
});
7782

7883
services = registrar.Services.BuildServiceProvider();

src/Commands/CliGraphQueryClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class CliGraphQueryClient : IGraphQueryClient
2727
// Legacy queries won't have anything in the "query" (a URL endpoint is expected), but can still paginate in the CLI.
2828
// NOTE: this is an inconsistency with the HttpGraphQueryClient, which doesn't do pagination for legacy queries.
2929
// TODO: perhaps we should implement that, but it's not needed right now.
30-
(query.IsLegacy ||
30+
(query.IsLegacy ||
3131
(query.Query.Contains("$endCursor") && query.Query.Contains("first:")));
3232

3333
if (paginate)

src/Commands/Commands.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11+
<PackageReference Include="Devlooped.Web" Version="1.2.2" />
1112
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
1213
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
14+
<PackageReference Include="NuGet.Protocol" Version="6.11.0" />
1315
<PackageReference Include="NuGetizer" Version="1.2.3" PrivateAssets="all" />
16+
<PackageReference Include="Polly" Version="8.4.1" />
1417
<PackageReference Include="Spectre.Console.Cli" Version="0.49.1" />
1518
<PackageReference Include="Spectre.Console.Json" Version="0.49.1" />
1619
<PackageReference Include="Devlooped.CredentialManager" Version="2.5.0.1" />

0 commit comments

Comments
 (0)