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

Replace the React front-end with Razor pages #678

Merged
merged 17 commits into from
Sep 18, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
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
4 changes: 2 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,7 @@ 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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
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: 4 additions & 13 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,25 +25,18 @@ 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);
baget.MapEndpoints(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}'");
});
});
}
}
} // TODO: Test Razor pages work.
}
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.

33 changes: 0 additions & 33 deletions src/BaGet.Hosting/Extensions/IServiceCollectionExtensions.cs

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