Skip to content

Commit

Permalink
Replace the React front-end with Razor pages (loic-sharma#678)
Browse files Browse the repository at this point in the history
Reduces complexity and improves developer productivity. For more information, see: loic-sharma#678
  • Loading branch information
loic-sharma authored Sep 18, 2021
1 parent 7d5e2ad commit 869c379
Show file tree
Hide file tree
Showing 125 changed files with 71,915 additions and 20,225 deletions.
8 changes: 1 addition & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,5 @@ __pycache__/
# Cake - Uncomment if you are using it
# tools/

# Ignore client app cache
**/Baget.UI/.cache

# Ignore client dist files
**/Baget.UI/dist/

# Ignore database file
**/baget.db
**/baget.db
11 changes: 9 additions & 2 deletions BaGet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGet.Hosting", "src\BaGet.Hosting\BaGet.Hosting.csproj", "{D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGet.Web", "src\BaGet.Web\BaGet.Web.csproj", "{D68B56AC-98DD-4DA7-B4F8-1243538A8A5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGet.Database.Sqlite", "src\BaGet.Database.Sqlite\BaGet.Database.Sqlite.csproj", "{EC5E6B2C-2494-40E8-8682-080BA580DDA7}"
EndProject
Expand All @@ -48,7 +48,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGet.Protocol.Samples.Test
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGet.Aliyun", "src\BaGet.Aliyun\BaGet.Aliyun.csproj", "{9F7C4F38-D598-42D9-A9F8-962490483B18}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGetWebApplication", "samples\BaGetWebApplication\BaGetWebApplication.csproj", "{E5AFE55D-0932-46A9-BFA3-C8A034037377}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BaGetWebApplication", "samples\BaGetWebApplication\BaGetWebApplication.csproj", "{E5AFE55D-0932-46A9-BFA3-C8A034037377}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BaGet.Web.Tests", "tests\BaGet.Web.Tests\BaGet.Web.Tests.csproj", "{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -124,6 +126,10 @@ Global
{E5AFE55D-0932-46A9-BFA3-C8A034037377}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5AFE55D-0932-46A9-BFA3-C8A034037377}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5AFE55D-0932-46A9-BFA3-C8A034037377}.Release|Any CPU.Build.0 = Release|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -146,6 +152,7 @@ Global
{16B0D424-BB2F-4C0C-90B0-4F7955326ADF} = {DDEC0736-8169-4834-815E-B78E7CE612A4}
{9F7C4F38-D598-42D9-A9F8-962490483B18} = {26A0B557-53FB-4B9A-94C4-BCCF1BDCB0CC}
{E5AFE55D-0932-46A9-BFA3-C8A034037377} = {DDEC0736-8169-4834-815E-B78E7CE612A4}
{BEEAAA73-36CD-4178-9C9F-6D036586E7BF} = {C237857D-AD8E-4C52-974F-6A8155BB0C18}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1423C027-2C90-417F-8629-2A4CF107C055}
Expand Down
11 changes: 5 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BaGet :baguette_bread:

[![Build Status](https://sharml.visualstudio.com/BaGet/_apis/build/status/loic-sharma.BaGet)](https://sharml.visualstudio.com/BaGet/_build/latest?definitionId=2) [![Join the chat at https://gitter.im/BaGetServer/community](https://badges.gitter.im/BaGetServer/community.svg)](https://gitter.im/BaGetServer/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Twitter](https://img.shields.io/twitter/follow/bagetapp?label=Follow)](https://twitter.com/bagetapp)
[![Build Status](https://sharml.visualstudio.com/BaGet/_apis/build/status/loic-sharma.BaGet)](https://sharml.visualstudio.com/BaGet/_build/latest?definitionId=2) [![Join the chat at https://gitter.im/BaGetServer/community](https://badges.gitter.im/BaGetServer/community.svg)](https://gitter.im/BaGetServer/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Twitter](https://img.shields.io/twitter/follow/bagetapp?label=Follow)](https://twitter.com/bagetapp)

A lightweight [NuGet](https://docs.microsoft.com/en-us/nuget/what-is-nuget) and [Symbol](https://docs.microsoft.com/en-us/windows/desktop/debug/symbol-servers-and-symbol-stores) server.

Expand Down Expand Up @@ -33,8 +33,7 @@ Stay tuned, more features are planned!

1. Install [.NET Core SDK](https://www.microsoft.com/net/download) and [Node.js](https://nodejs.org/)
2. Run `git clone https://github.com/loic-sharma/BaGet.git`
3. Navigate to `.\BaGet\src\BaGet.UI`
4. Install the frontend's dependencies with `npm install`
5. Navigate to `..\BaGet`
6. Start the service with `dotnet run`
7. Open the URL `http://localhost:5000/v3/index.json` in your browser
3. Navigate to `.\BaGet\src\BaGet`
4. Navigate to `..\BaGet`
5. Start the service with `dotnet run`
6. Open the URL `http://localhost:5000/v3/index.json` in your browser
2 changes: 1 addition & 1 deletion samples/BaGetWebApplication/BaGetWebApplication.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<ProjectReference Include="..\..\src\BaGet.Database.Sqlite\BaGet.Database.Sqlite.csproj" />
<ProjectReference Include="..\..\src\BaGet.Hosting\BaGet.Hosting.csproj" />
<ProjectReference Include="..\..\src\BaGet.Web\BaGet.Web.csproj" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions samples/BaGetWebApplication/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Threading.Tasks;
using BaGet.Hosting;
using BaGet.Web;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;

Expand All @@ -10,9 +10,9 @@ public class Program
public static async Task Main(string[] args)
{
var host = CreateHostBuilder(args).Build();

await host.RunMigrationsAsync();
host.Run();
await host.RunAsync();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Expand Down
17 changes: 3 additions & 14 deletions samples/BaGetWebApplication/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using BaGet;
using BaGet.Core;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

Expand All @@ -27,24 +25,15 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
app.UseDeveloperExceptionPage();
}

app.UseStaticFiles();
app.UseRouting();

app.UseEndpoints(endpoints =>
{
// Add BaGet's endpoints.
var api = new BaGetApi();
var baget = new BaGetEndpointBuilder();

api.MapRoutes(endpoints);

// Add a "welcome" endpoint to help you find the package source.
// This is optional, you can remove this endpoint if you'd like.
endpoints.MapGet("/", async context =>
{
var url = context.RequestServices.GetRequiredService<IUrlGenerator>();
var packageSource = url.GetServiceIndexUrl();

await context.Response.WriteAsync($"Package source URL: '{packageSource}'");
});
baget.MapEndpoints(endpoints);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/BaGet.Core/BaGet.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>

<PackageTags>NuGet</PackageTags>
<Description>The core libraries that power BaGet.</Description>
Expand Down
2 changes: 0 additions & 2 deletions src/BaGet.Core/Metadata/DefaultPackageMetadataService.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using BaGet.Protocol.Models;
using NuGet.Packaging.Core;
using NuGet.Versioning;

namespace BaGet.Core
Expand Down
1 change: 0 additions & 1 deletion src/BaGet.Core/Metadata/PackageRegistration.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using BaGet.Core;

namespace BaGet.Core
{
Expand Down
2 changes: 0 additions & 2 deletions src/BaGet.Core/Mirror/MirrorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

namespace BaGet.Core
{
using PackageIdentity = NuGet.Packaging.Core.PackageIdentity;

public class MirrorService : IMirrorService
{
private readonly IPackageService _localPackages;
Expand Down
1 change: 0 additions & 1 deletion src/BaGet.Core/Mirror/PackageDownloadsJsonSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public async Task<Dictionary<string, Dictionary<string, long>>> GetPackageDownlo
{
_logger.LogInformation("Fetching package downloads...");

var serializer = new JsonSerializer();
var results = new Dictionary<string, Dictionary<string, long>>();

using (var downloadsStream = await GetDownloadsStreamAsync())
Expand Down
1 change: 0 additions & 1 deletion src/BaGet.Core/Validation/ValidateBaGetOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.Extensions.Options;
Expand Down
18 changes: 0 additions & 18 deletions src/BaGet.Hosting/BaGet.Hosting.csproj

This file was deleted.

3 changes: 1 addition & 2 deletions src/BaGet.Protocol/PackageMetadata/IPackageMetadataClient.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
using System.Threading;
using System.Threading.Tasks;
using BaGet.Protocol.Models;
using NuGet.Versioning;

namespace BaGet.Protocol
{
/// <summary>
/// The Package Metadata client, used to fetch packages' metadata.
///
///
/// See https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource
/// </summary>
public interface IPackageMetadataClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Threading;
using System.Threading.Tasks;
using BaGet.Protocol.Models;
using NuGet.Versioning;

namespace BaGet.Protocol
{
Expand Down
21 changes: 0 additions & 21 deletions src/BaGet.UI/.gitignore

This file was deleted.

Loading

0 comments on commit 869c379

Please sign in to comment.